Create a ServiceLevelObjective for the given Service.

Scopes

You will need authorization for at least one of the following scopes to make a valid call:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/monitoring

If unset, the scope for this method defaults to https://www.googleapis.com/auth/cloud-platform. You can set the scope for this method like this: monitoring3 --scope <scope> services service-level-objectives-create ...

Required Scalar Argument

  • <parent> (string)
    • Required. Resource name of the parent Service. The format is: projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]

Required Request Value

The request value is a data-structure with various fields. Each field may be a simple scalar or another data-structure. In the latter case it is advised to set the field-cursor to the data-structure's field to specify values more concisely.

For example, a structure like this:

ServiceLevelObjective:
  calendar-period: string
  display-name: string
  goal: number
  name: string
  rolling-period: string
  service-level-indicator:
    basic-sli:
      latency:
        threshold: string
      location: [string]
      method: [string]
      version: [string]
    request-based:
      distribution-cut:
        distribution-filter: string
        range:
          max: number
          min: number
      good-total-ratio:
        bad-service-filter: string
        good-service-filter: string
        total-service-filter: string
    windows-based:
      good-bad-metric-filter: string
      good-total-ratio-threshold:
        basic-sli-performance:
          latency:
            threshold: string
          location: [string]
          method: [string]
          version: [string]
        performance:
          distribution-cut:
            distribution-filter: string
            range:
              max: number
              min: number
          good-total-ratio:
            bad-service-filter: string
            good-service-filter: string
            total-service-filter: string
        threshold: number
      metric-mean-in-range:
        range:
          max: number
          min: number
        time-series: string
      metric-sum-in-range:
        range:
          max: number
          min: number
        time-series: string
      window-period: string
  user-labels: { string: string }

can be set completely with the following arguments which are assumed to be executed in the given order. Note how the cursor position is adjusted to the respective structures, allowing simple field names to be used most of the time.

  • -r . calendar-period=sadipscing
    • A calendar period, semantically "since the start of the current ". At this time, only DAY, WEEK, FORTNIGHT, and MONTH are supported.
  • display-name=tempor
    • Name used for UI elements listing this SLO.
  • goal=0.790807870901993
    • The fraction of service that must be good in order for this objective to be met. 0 < goal <= 0.999.
  • name=et
    • Resource name for this ServiceLevelObjective. The format is: projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME]
  • rolling-period=lorem
    • A rolling time period, semantically "in the past ". Must be an integer multiple of 1 day no larger than 30 days.
  • service-level-indicator.basic-sli.latency threshold=magna

    • Good service is defined to be the count of requests made to this service that return in no more than threshold.
  • .. location=takimata

    • OPTIONAL: The set of locations to which this SLI is relevant. Telemetry from other locations will not be used to calculate performance for this SLI. If omitted, this SLI applies to all locations in which the Service has activity. For service types that don't support breaking down by location, setting this field will result in an error.
    • Each invocation of this argument appends the given value to the array.
  • method=rebum.
    • OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from other methods will not be used to calculate performance for this SLI. If omitted, this SLI applies to all the Service's methods. For service types that don't support breaking down by method, setting this field will result in an error.
    • Each invocation of this argument appends the given value to the array.
  • version=at

    • OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry from other API versions will not be used to calculate performance for this SLI. If omitted, this SLI applies to all API versions. For service types that don't support breaking down by version, setting this field will result in an error.
    • Each invocation of this argument appends the given value to the array.
  • ..request-based.distribution-cut distribution-filter=invidunt

    • A monitoring filter (https://cloud.google.com/monitoring/api/v3/filters) specifying a TimeSeries aggregating values. Must have ValueType = DISTRIBUTION and MetricKind = DELTA or MetricKind = CUMULATIVE.
  • range max=0.6807128254803334
    • Range maximum.
  • min=0.673041440175897

    • Range minimum.
  • ...good-total-ratio bad-service-filter=aliquyam

    • A monitoring filter (https://cloud.google.com/monitoring/api/v3/filters) specifying a TimeSeries quantifying bad service, either demanded service that was not provided or demanded service that was of inadequate quality. Must have ValueType = DOUBLE or ValueType = INT64 and must have MetricKind = DELTA or MetricKind = CUMULATIVE.
  • good-service-filter=ut
    • A monitoring filter (https://cloud.google.com/monitoring/api/v3/filters) specifying a TimeSeries quantifying good service provided. Must have ValueType = DOUBLE or ValueType = INT64 and must have MetricKind = DELTA or MetricKind = CUMULATIVE.
  • total-service-filter=sit

    • A monitoring filter (https://cloud.google.com/monitoring/api/v3/filters) specifying a TimeSeries quantifying total demanded service. Must have ValueType = DOUBLE or ValueType = INT64 and must have MetricKind = DELTA or MetricKind = CUMULATIVE.
  • ...windows-based good-bad-metric-filter=vero

    • A monitoring filter (https://cloud.google.com/monitoring/api/v3/filters) specifying a TimeSeries with ValueType = BOOL. The window is good if any true values appear in the window.
  • good-total-ratio-threshold.basic-sli-performance.latency threshold=rebum.

    • Good service is defined to be the count of requests made to this service that return in no more than threshold.
  • .. location=dolores

    • OPTIONAL: The set of locations to which this SLI is relevant. Telemetry from other locations will not be used to calculate performance for this SLI. If omitted, this SLI applies to all locations in which the Service has activity. For service types that don't support breaking down by location, setting this field will result in an error.
    • Each invocation of this argument appends the given value to the array.
  • method=consetetur
    • OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from other methods will not be used to calculate performance for this SLI. If omitted, this SLI applies to all the Service's methods. For service types that don't support breaking down by method, setting this field will result in an error.
    • Each invocation of this argument appends the given value to the array.
  • version=dolores

    • OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry from other API versions will not be used to calculate performance for this SLI. If omitted, this SLI applies to all API versions. For service types that don't support breaking down by version, setting this field will result in an error.
    • Each invocation of this argument appends the given value to the array.
  • ..performance.distribution-cut distribution-filter=sed

    • A monitoring filter (https://cloud.google.com/monitoring/api/v3/filters) specifying a TimeSeries aggregating values. Must have ValueType = DISTRIBUTION and MetricKind = DELTA or MetricKind = CUMULATIVE.
  • range max=0.4962661437411874
    • Range maximum.
  • min=0.015843876813973368

    • Range minimum.
  • ...good-total-ratio bad-service-filter=magna

    • A monitoring filter (https://cloud.google.com/monitoring/api/v3/filters) specifying a TimeSeries quantifying bad service, either demanded service that was not provided or demanded service that was of inadequate quality. Must have ValueType = DOUBLE or ValueType = INT64 and must have MetricKind = DELTA or MetricKind = CUMULATIVE.
  • good-service-filter=diam
    • A monitoring filter (https://cloud.google.com/monitoring/api/v3/filters) specifying a TimeSeries quantifying good service provided. Must have ValueType = DOUBLE or ValueType = INT64 and must have MetricKind = DELTA or MetricKind = CUMULATIVE.
  • total-service-filter=nonumy

    • A monitoring filter (https://cloud.google.com/monitoring/api/v3/filters) specifying a TimeSeries quantifying total demanded service. Must have ValueType = DOUBLE or ValueType = INT64 and must have MetricKind = DELTA or MetricKind = CUMULATIVE.
  • ... threshold=0.9152049934360651

    • If window performance >= threshold, the window is counted as good.
  • ..metric-mean-in-range.range max=0.6493036280045085

    • Range maximum.
  • min=0.6152684203454756

    • Range minimum.
  • .. time-series=sed

    • A monitoring filter (https://cloud.google.com/monitoring/api/v3/filters) specifying the TimeSeries to use for evaluating window quality.
  • ..metric-sum-in-range.range max=0.735189875377097

    • Range maximum.
  • min=0.02085600923949349

    • Range minimum.
  • .. time-series=at

    • A monitoring filter (https://cloud.google.com/monitoring/api/v3/filters) specifying the TimeSeries to use for evaluating window quality.
  • .. window-period=erat

    • Duration over which window quality is evaluated. Must be an integer fraction of a day and at least 60s.
  • ... user-labels=key=justo

    • Labels 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.
    • the value will be associated with the given key

About Cursors

The cursor position is key to comfortably set complex nested structures. The following rules apply:

  • The cursor position is always set relative to the current one, unless the field name starts with the . character. Fields can be nested such as in -r f.s.o .
  • The cursor position is set relative to the top-level structure if it starts with ., e.g. -r .s.s
  • You can also set nested fields without setting the cursor explicitly. For example, to set a value relative to the current cursor position, you would specify -r struct.sub_struct=bar.
  • You can move the cursor one level up by using ... Each additional . moves it up one additional level. E.g. ... would go three levels up.

Optional Output Flags

The method's return value a JSON encoded structure, which will be written to standard output by default.

  • -o out
    • out specifies the destination to which to write the server's result to. It will be a JSON-encoded structure. The destination may be - to indicate standard output, or a filepath that is to contain the received bytes. If unset, it defaults to standard output.

Optional Method Properties

You may set the following properties to further configure the call. Please note that -p is followed by one or more key-value-pairs, and is called like this -p k1=v1 k2=v2 even though the listing below repeats the -p for completeness.

  • -p service-level-objective-id=string
    • Optional. The ServiceLevelObjective id to use for this ServiceLevelObjective. If omitted, an id will be generated instead. Must match the pattern ^[a-zA-Z0-9-_:.]+$

Optional General Properties

The following properties can configure any call, and are not specific to this method.

  • -p $-xgafv=string

    • V1 error format.
  • -p access-token=string

    • OAuth access token.
  • -p alt=string

    • Data format for response.
  • -p callback=string

    • JSONP
  • -p fields=string

    • Selector specifying which fields to include in a partial response.
  • -p key=string

    • API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
  • -p oauth-token=string

    • OAuth 2.0 token for the current user.
  • -p pretty-print=boolean

    • Returns response with indentations and line breaks.
  • -p quota-user=string

    • Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
  • -p upload-type=string

    • Legacy upload protocol for media (e.g. "media", "multipart").
  • -p upload-protocol=string

    • Upload protocol for media (e.g. "raw", "multipart").