Skip to main content

services

Creates, updates, deletes, gets or lists a services resource.

Overview​

Nameservices
TypeResource
Idgoogle.monitoring.services

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringIdentifier. Resource name for this Service. The format is: projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]
appEngineobjectType used for App Engine services. (id: AppEngine)
basicServiceobjectMessage 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)
cloudEndpointsobjectType used for Cloud Endpoints services. (id: CloudEndpoints)
cloudRunobjectType used for Cloud Run services. (id: CloudRun)
clusterIstioobjectType used for Istio services that live in a Kubernetes cluster. (id: ClusterIstio)
customobjectCustom service type. (id: Custom)
displayNamestringName used for UI elements listing this Service.
gkeNamespaceobjectType used for GKE Namespaces. (id: GkeNamespace)
gkeServiceobjectType used for GKE Services (the Kubernetes concept of a service). (id: GkeService)
gkeWorkloadobjectType used for GKE Workloads. (id: GkeWorkload)
istioCanonicalServiceobjectType 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)
meshIstioobjectType used for Istio services scoped to an Istio mesh. (id: MeshIstio)
telemetryobjectConfiguration for how to query telemetry on a Service. (id: Telemetry)
userLabelsobjectLabels 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:

NameAccessible byRequired ParamsOptional ParamsDescription
services_listselectparentType, parentfilter, pageSize, pageTokenList Services for this Metrics Scope.
services_getselectnameGet the named Service.
services_createinsertparentType, parentserviceIdCreate a Service.
services_patchupdatenameupdateMaskUpdate this Service.
services_deletedeletenameSoft 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.

NameDatatypeDescription
namestring
parentstring
parentTypestring
filterstring
pageSizeinteger (int32)
pageTokenstring
serviceIdstring
updateMaskstring (google-fieldmask)

SELECT examples​

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 }}'
;

INSERT examples​

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
;

UPDATE examples​

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​

Soft delete this Service.

DELETE FROM google.monitoring.services
WHERE name = '{{ name }}' --required
;