services
Creates, updates, deletes, gets or lists a services resource.
Overview
| Name | services |
| Type | Resource |
| Id | google.monitoring.services |
Fields
The following fields are returned by SELECT queries:
- services_list
- services_get
| Name | Datatype | Description |
|---|---|---|
name | string | Identifier. Resource name for this Service. The format is: projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] |
appEngine | object | Type used for App Engine services. (id: AppEngine) |
basicService | object | Message that contains the service type and service labels of this service if it is a basic service. Documentation and examples here (https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/api/api-structures#basic-svc-w-basic-sli). (id: BasicService) |
cloudEndpoints | object | Type used for Cloud Endpoints services. (id: CloudEndpoints) |
cloudRun | object | Type used for Cloud Run services. (id: CloudRun) |
clusterIstio | object | Type used for Istio services that live in a Kubernetes cluster. (id: ClusterIstio) |
custom | object | Custom service type. (id: Custom) |
displayName | string | Name used for UI elements listing this Service. |
gkeNamespace | object | Type used for GKE Namespaces. (id: GkeNamespace) |
gkeService | object | Type used for GKE Services (the Kubernetes concept of a service). (id: GkeService) |
gkeWorkload | object | Type used for GKE Workloads. (id: GkeWorkload) |
istioCanonicalService | object | Type used for canonical services scoped to an Istio mesh. Metrics for Istio are documented here (https://istio.io/latest/docs/reference/config/metrics/) (id: IstioCanonicalService) |
meshIstio | object | Type used for Istio services scoped to an Istio mesh. (id: MeshIstio) |
telemetry | object | Configuration for how to query telemetry on a Service. (id: Telemetry) |
userLabels | object | Labels which have been used to annotate the service. Label keys must start with a letter. Label keys and values may contain lowercase letters, numbers, underscores, and dashes. Label keys and values have a maximum length of 63 characters, and must be less than 128 bytes in size. Up to 64 label entries may be stored. For labels which do not have a semantic value, the empty string may be supplied for the label value. |
| Name | Datatype | Description |
|---|---|---|
name | string | Identifier. Resource name for this Service. The format is: projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] |
appEngine | object | Type used for App Engine services. (id: AppEngine) |
basicService | object | Message that contains the service type and service labels of this service if it is a basic service. Documentation and examples here (https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/api/api-structures#basic-svc-w-basic-sli). (id: BasicService) |
cloudEndpoints | object | Type used for Cloud Endpoints services. (id: CloudEndpoints) |
cloudRun | object | Type used for Cloud Run services. (id: CloudRun) |
clusterIstio | object | Type used for Istio services that live in a Kubernetes cluster. (id: ClusterIstio) |
custom | object | Custom service type. (id: Custom) |
displayName | string | Name used for UI elements listing this Service. |
gkeNamespace | object | Type used for GKE Namespaces. (id: GkeNamespace) |
gkeService | object | Type used for GKE Services (the Kubernetes concept of a service). (id: GkeService) |
gkeWorkload | object | Type used for GKE Workloads. (id: GkeWorkload) |
istioCanonicalService | object | Type used for canonical services scoped to an Istio mesh. Metrics for Istio are documented here (https://istio.io/latest/docs/reference/config/metrics/) (id: IstioCanonicalService) |
meshIstio | object | Type used for Istio services scoped to an Istio mesh. (id: MeshIstio) |
telemetry | object | Configuration for how to query telemetry on a Service. (id: Telemetry) |
userLabels | object | Labels which have been used to annotate the service. Label keys must start with a letter. Label keys and values may contain lowercase letters, numbers, underscores, and dashes. Label keys and values have a maximum length of 63 characters, and must be less than 128 bytes in size. Up to 64 label entries may be stored. For labels which do not have a semantic value, the empty string may be supplied for the label value. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
services_list | select | parentType, parent | filter, pageSize, pageToken | List Services for this Metrics Scope. |
services_get | select | name | Get the named Service. | |
services_create | insert | parentType, parent | serviceId | Create a Service. |
services_patch | update | name | updateMask | Update this Service. |
services_delete | delete | name | Soft delete this Service. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
name | string | |
parent | string | |
parentType | string | |
filter | string | |
pageSize | integer (int32) | |
pageToken | string | |
serviceId | string | |
updateMask | string (google-fieldmask) |
SELECT examples
- services_list
- services_get
List Services for this Metrics Scope.
SELECT
name,
appEngine,
basicService,
cloudEndpoints,
cloudRun,
clusterIstio,
custom,
displayName,
gkeNamespace,
gkeService,
gkeWorkload,
istioCanonicalService,
meshIstio,
telemetry,
userLabels
FROM google.monitoring.services
WHERE parentType = '{{ parentType }}' -- required
AND parent = '{{ parent }}' -- required
AND filter = '{{ filter }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
;
Get the named Service.
SELECT
name,
appEngine,
basicService,
cloudEndpoints,
cloudRun,
clusterIstio,
custom,
displayName,
gkeNamespace,
gkeService,
gkeWorkload,
istioCanonicalService,
meshIstio,
telemetry,
userLabels
FROM google.monitoring.services
WHERE name = '{{ name }}' -- required
;
INSERT examples
- services_create
- Manifest
Create a Service.
INSERT INTO google.monitoring.services (
data__appEngine,
data__basicService,
data__cloudEndpoints,
data__cloudRun,
data__clusterIstio,
data__custom,
data__displayName,
data__gkeNamespace,
data__gkeService,
data__gkeWorkload,
data__istioCanonicalService,
data__meshIstio,
data__name,
data__telemetry,
data__userLabels,
parentType,
parent,
serviceId
)
SELECT
'{{ appEngine }}',
'{{ basicService }}',
'{{ cloudEndpoints }}',
'{{ cloudRun }}',
'{{ clusterIstio }}',
'{{ custom }}',
'{{ displayName }}',
'{{ gkeNamespace }}',
'{{ gkeService }}',
'{{ gkeWorkload }}',
'{{ istioCanonicalService }}',
'{{ meshIstio }}',
'{{ name }}',
'{{ telemetry }}',
'{{ userLabels }}',
'{{ parentType }}',
'{{ parent }}',
'{{ serviceId }}'
RETURNING
name,
appEngine,
basicService,
cloudEndpoints,
cloudRun,
clusterIstio,
custom,
displayName,
gkeNamespace,
gkeService,
gkeWorkload,
istioCanonicalService,
meshIstio,
telemetry,
userLabels
;
# Description fields are for documentation purposes
- name: services
props:
- name: parentType
value: "{{ parentType }}"
description: Required parameter for the services resource.
- name: parent
value: "{{ parent }}"
description: Required parameter for the services resource.
- name: appEngine
description: |
Type used for App Engine services.
value:
moduleId: "{{ moduleId }}"
- name: basicService
description: |
Message that contains the service type and service labels of this service if it is a basic service. Documentation and examples here (https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/api/api-structures#basic-svc-w-basic-sli).
value:
serviceLabels: "{{ serviceLabels }}"
serviceType: "{{ serviceType }}"
- name: cloudEndpoints
description: |
Type used for Cloud Endpoints services.
value:
service: "{{ service }}"
- name: cloudRun
description: |
Type used for Cloud Run services.
value:
location: "{{ location }}"
serviceName: "{{ serviceName }}"
- name: clusterIstio
description: |
Type used for Istio services that live in a Kubernetes cluster.
value:
clusterName: "{{ clusterName }}"
location: "{{ location }}"
serviceName: "{{ serviceName }}"
serviceNamespace: "{{ serviceNamespace }}"
- name: custom
value: "{{ custom }}"
description: |
Custom service type.
- name: displayName
value: "{{ displayName }}"
description: |
Name used for UI elements listing this Service.
- name: gkeNamespace
description: |
Type used for GKE Namespaces.
value:
clusterName: "{{ clusterName }}"
location: "{{ location }}"
namespaceName: "{{ namespaceName }}"
projectId: "{{ projectId }}"
- name: gkeService
description: |
Type used for GKE Services (the Kubernetes concept of a service).
value:
clusterName: "{{ clusterName }}"
location: "{{ location }}"
namespaceName: "{{ namespaceName }}"
projectId: "{{ projectId }}"
serviceName: "{{ serviceName }}"
- name: gkeWorkload
description: |
Type used for GKE Workloads.
value:
clusterName: "{{ clusterName }}"
location: "{{ location }}"
namespaceName: "{{ namespaceName }}"
projectId: "{{ projectId }}"
topLevelControllerName: "{{ topLevelControllerName }}"
topLevelControllerType: "{{ topLevelControllerType }}"
- name: istioCanonicalService
description: |
Type used for canonical services scoped to an Istio mesh. Metrics for Istio are documented here (https://istio.io/latest/docs/reference/config/metrics/)
value:
canonicalService: "{{ canonicalService }}"
canonicalServiceNamespace: "{{ canonicalServiceNamespace }}"
meshUid: "{{ meshUid }}"
- name: meshIstio
description: |
Type used for Istio services scoped to an Istio mesh.
value:
meshUid: "{{ meshUid }}"
serviceName: "{{ serviceName }}"
serviceNamespace: "{{ serviceNamespace }}"
- name: name
value: "{{ name }}"
description: |
Identifier. Resource name for this Service. The format is: projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]
- name: telemetry
description: |
Configuration for how to query telemetry on a Service.
value:
resourceName: "{{ resourceName }}"
- name: userLabels
value: "{{ userLabels }}"
description: |
Labels which have been used to annotate the service. Label keys must start with a letter. Label keys and values may contain lowercase letters, numbers, underscores, and dashes. Label keys and values have a maximum length of 63 characters, and must be less than 128 bytes in size. Up to 64 label entries may be stored. For labels which do not have a semantic value, the empty string may be supplied for the label value.
- name: serviceId
value: "{{ serviceId }}"
UPDATE examples
- services_patch
Update this Service.
UPDATE google.monitoring.services
SET
data__appEngine = '{{ appEngine }}',
data__basicService = '{{ basicService }}',
data__cloudEndpoints = '{{ cloudEndpoints }}',
data__cloudRun = '{{ cloudRun }}',
data__clusterIstio = '{{ clusterIstio }}',
data__custom = '{{ custom }}',
data__displayName = '{{ displayName }}',
data__gkeNamespace = '{{ gkeNamespace }}',
data__gkeService = '{{ gkeService }}',
data__gkeWorkload = '{{ gkeWorkload }}',
data__istioCanonicalService = '{{ istioCanonicalService }}',
data__meshIstio = '{{ meshIstio }}',
data__name = '{{ name }}',
data__telemetry = '{{ telemetry }}',
data__userLabels = '{{ userLabels }}'
WHERE
name = '{{ name }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
appEngine,
basicService,
cloudEndpoints,
cloudRun,
clusterIstio,
custom,
displayName,
gkeNamespace,
gkeService,
gkeWorkload,
istioCanonicalService,
meshIstio,
telemetry,
userLabels;
DELETE examples
- services_delete
Soft delete this Service.
DELETE FROM google.monitoring.services
WHERE name = '{{ name }}' --required
;