Chronosphere RecordingRule API

The RecordingRule API from Chronosphere — 2 operation(s) for recordingrule.

OpenAPI Specification

chronosphere-recordingrule-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Config V1 Bucket RecordingRule API
  description: '

    The Config API provides standard HTTP/JSON REST endpoints for creating, reading,

    updating, deleting, and listing configurable Chronosphere resources.


    Use this link to download the raw Swagger specification:

    <a href="/api/v1/config/swagger.json">/api/v1/config/swagger.json</a>

    '
  version: v1
servers:
- url: /
tags:
- name: RecordingRule
paths:
  /api/v1/config/recording-rules:
    get:
      tags:
      - RecordingRule
      operationId: ListRecordingRules
      parameters:
      - name: page.max_size
        in: query
        description: 'Page size preference (i.e. how many items are returned in the next

          page). If zero, the server will use a default. Regardless of what size

          is given, clients must never assume how many items will be returned.'
        schema:
          type: integer
          format: int64
      - name: page.token
        in: query
        description: 'Opaque page token identifying which page to request. An empty token

          identifies the first page.'
        schema:
          type: string
      - name: slugs
        in: query
        description: Filters results by slug, where any RecordingRule with a matching slug in the given list (and matches all other filters) is returned.
        style: form
        explode: true
        schema:
          type: array
          items:
            type: string
      - name: names
        in: query
        description: Filters results by name, where any RecordingRule with a matching name in the given list (and matches all other filters) is returned.
        style: form
        explode: true
        schema:
          type: array
          items:
            type: string
      - name: bucket_slugs
        in: query
        description: The execution_groups filter cannot be used when a bucket_slug filter is provided.
        style: form
        explode: true
        schema:
          type: array
          items:
            type: string
      - name: execution_groups
        in: query
        description: The bucket_slugs filter cannot be used when an execution_group filter is provided.
        style: form
        explode: true
        schema:
          type: array
          items:
            type: string
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/configv1ListRecordingRulesResponse'
        '500':
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
        default:
          description: An undefined error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/genericError'
    post:
      tags:
      - RecordingRule
      operationId: CreateRecordingRule
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/configv1CreateRecordingRuleRequest'
        required: true
      responses:
        '200':
          description: A successful response containing the created RecordingRule.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/configv1CreateRecordingRuleResponse'
        '400':
          description: Cannot create the RecordingRule because the request is invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
        '409':
          description: Cannot create the RecordingRule because there is a conflict with an existing RecordingRule.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
        '500':
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
        default:
          description: An undefined error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/genericError'
      x-codegen-request-body-name: body
  /api/v1/config/recording-rules/{slug}:
    get:
      tags:
      - RecordingRule
      operationId: ReadRecordingRule
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/configv1ReadRecordingRuleResponse'
        '404':
          description: Cannot read the RecordingRule because the slug does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
        '500':
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
        default:
          description: An undefined error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/genericError'
    put:
      tags:
      - RecordingRule
      operationId: UpdateRecordingRule
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConfigV1UpdateRecordingRuleBody'
        required: true
      responses:
        '200':
          description: A successful response containing the updated RecordingRule.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/configv1UpdateRecordingRuleResponse'
        '400':
          description: Cannot update the RecordingRule because the request is invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
        '404':
          description: Cannot update the RecordingRule because the slug does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
        '409':
          description: Cannot update the RecordingRule because there is a conflict with an existing RecordingRule.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
        '500':
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
        default:
          description: An undefined error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/genericError'
      x-codegen-request-body-name: body
    delete:
      tags:
      - RecordingRule
      operationId: DeleteRecordingRule
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/configv1DeleteRecordingRuleResponse'
        '400':
          description: Cannot delete the RecordingRule because it is in use.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
        '404':
          description: Cannot delete the RecordingRule because the slug does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
        '500':
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
        default:
          description: An undefined error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/genericError'
components:
  schemas:
    configv1RecordingRule:
      type: object
      properties:
        slug:
          type: string
          description: Unique identifier of the RecordingRule. If a `slug` isn't provided, one will be generated based of the `name` field. You can't modify this field after the RecordingRule is created.
        name:
          type: string
          description: Required. Name of the RecordingRule. You can modify this value after the RecordingRule is created.
        created_at:
          type: string
          description: Timestamp of when the RecordingRule was created. Cannot be set by clients.
          format: date-time
          readOnly: true
        updated_at:
          type: string
          description: Timestamp of when the RecordingRule was last updated. Cannot be set by clients.
          format: date-time
          readOnly: true
        bucket_slug:
          type: string
          description: Optional slug of the bucket the RecordingRule belongs to.
        label_policy:
          $ref: '#/components/schemas/configv1RecordingRuleLabelPolicy'
        interval_secs:
          type: integer
          description: Optional interval for evaluating the recording rule.
          format: int32
        metric_name:
          type: string
          description: 'The name of the time series to use for output, which must be a valid

            metric name.'
        prometheus_expr:
          type: string
          description: 'The PromQL expression to evaluate at the time of each evaluation cycle.

            The result is recorded as a new time series with its metric name

            defined by the metric_name (or name) field.'
        execution_group:
          type: string
          description: 'Optional execution_group in which this rule is to be evaluated.

            At least one of bucket_slug and execution_group must be set. If both are set, then they are expected to match.'
    configv1CreateRecordingRuleRequest:
      type: object
      properties:
        recording_rule:
          $ref: '#/components/schemas/configv1RecordingRule'
        dry_run:
          type: boolean
          description: If true, the RecordingRule isn't created, and no response RecordingRule will be returned. The response will return an error if the given RecordingRule is invalid.
    configv1DeleteRecordingRuleResponse:
      type: object
    configv1ReadRecordingRuleResponse:
      type: object
      properties:
        recording_rule:
          $ref: '#/components/schemas/configv1RecordingRule'
    configv1ListRecordingRulesResponse:
      type: object
      properties:
        page:
          $ref: '#/components/schemas/configv1PageResult'
        recording_rules:
          type: array
          items:
            $ref: '#/components/schemas/configv1RecordingRule'
    configv1PageResult:
      type: object
      properties:
        next_token:
          type: string
          description: 'Opaque page token which identifies the next page of items which the

            client should request. An empty next_token indicates that there are no

            more items to return.'
    configv1CreateRecordingRuleResponse:
      type: object
      properties:
        recording_rule:
          $ref: '#/components/schemas/configv1RecordingRule'
    ConfigV1UpdateRecordingRuleBody:
      type: object
      properties:
        recording_rule:
          $ref: '#/components/schemas/configv1RecordingRule'
        create_if_missing:
          type: boolean
          description: If true, the RecordingRule will be created if it does not already exist, identified by slug. If false, an error will be returned if the RecordingRule does not already exist.
        dry_run:
          type: boolean
          description: If true, the RecordingRule isn't created or updated, and no response RecordingRule will be returned. The response will return an error if the given RecordingRule is invalid.
    configv1RecordingRuleLabelPolicy:
      type: object
      properties:
        add:
          type: object
          additionalProperties:
            type: string
          description: Labels to add or overwrite before storing the result.
    apiError:
      type: object
      properties:
        code:
          type: integer
          description: An optional private error code whose values are undefined.
          format: int32
        message:
          type: string
          description: An error message describing what went wrong.
    genericError:
      type: object
      additionalProperties: true
    configv1UpdateRecordingRuleResponse:
      type: object
      properties:
        recording_rule:
          $ref: '#/components/schemas/configv1RecordingRule'
x-original-swagger-version: '2.0'