Skip to main content

service_level_objectives

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

Overview

Nameservice_level_objectives
TypeResource
Idgoogle.monitoring.service_level_objectives

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. Resource name for this ServiceLevelObjective. The format is: projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME]
calendarPeriodstringA calendar period, semantically "since the start of the current ". At this time, only DAY, WEEK, FORTNIGHT, and MONTH are supported.
displayNamestringName used for UI elements listing this SLO.
goalnumber (double)The fraction of service that must be good in order for this objective to be met. 0 < goal <= 0.9999.
rollingPeriodstring (google-duration)A rolling time period, semantically "in the past ". Must be an integer multiple of 1 day no larger than 30 days.
serviceLevelIndicatorobjectThe definition of good service, used to measure and calculate the quality of the Service's performance with respect to a single aspect of service quality. (id: ServiceLevelIndicator)
userLabelsobjectLabels which have been used to annotate the service-level objective. 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_service_level_objectives_listselectparentType, parentfilter, pageSize, pageToken, viewList the ServiceLevelObjectives for the given Service.
services_service_level_objectives_getselectnameviewGet a ServiceLevelObjective by name.
services_service_level_objectives_createinsertparentType, parentserviceLevelObjectiveIdCreate a ServiceLevelObjective for the given Service.
services_service_level_objectives_patchupdatenameupdateMaskUpdate the given ServiceLevelObjective.
services_service_level_objectives_deletedeletenameDelete the given ServiceLevelObjective.

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
serviceLevelObjectiveIdstring
updateMaskstring (google-fieldmask)
viewstring

SELECT examples

List the ServiceLevelObjectives for the given Service.

SELECT
name,
calendarPeriod,
displayName,
goal,
rollingPeriod,
serviceLevelIndicator,
userLabels
FROM google.monitoring.service_level_objectives
WHERE parentType = '{{ parentType }}' -- required
AND parent = '{{ parent }}' -- required
AND filter = '{{ filter }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND view = '{{ view }}';

INSERT examples

Create a ServiceLevelObjective for the given Service.

INSERT INTO google.monitoring.service_level_objectives (
data__name,
data__displayName,
data__serviceLevelIndicator,
data__goal,
data__rollingPeriod,
data__calendarPeriod,
data__userLabels,
parentType,
parent,
serviceLevelObjectiveId
)
SELECT
'{{ name }}',
'{{ displayName }}',
'{{ serviceLevelIndicator }}',
{{ goal }},
'{{ rollingPeriod }}',
'{{ calendarPeriod }}',
'{{ userLabels }}',
'{{ parentType }}',
'{{ parent }}',
'{{ serviceLevelObjectiveId }}'
RETURNING
name,
calendarPeriod,
displayName,
goal,
rollingPeriod,
serviceLevelIndicator,
userLabels
;

UPDATE examples

Update the given ServiceLevelObjective.

UPDATE google.monitoring.service_level_objectives
SET
data__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__serviceLevelIndicator = '{{ serviceLevelIndicator }}',
data__goal = {{ goal }},
data__rollingPeriod = '{{ rollingPeriod }}',
data__calendarPeriod = '{{ calendarPeriod }}',
data__userLabels = '{{ userLabels }}'
WHERE
name = '{{ name }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
calendarPeriod,
displayName,
goal,
rollingPeriod,
serviceLevelIndicator,
userLabels;

DELETE examples

Delete the given ServiceLevelObjective.

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