Chronosphere NotificationPolicy API

The NotificationPolicy API from Chronosphere — 2 operation(s) for notificationpolicy.

OpenAPI Specification

chronosphere-notificationpolicy-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Config V1 Bucket NotificationPolicy 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: NotificationPolicy
paths:
  /api/v1/config/notification-policies:
    get:
      tags:
      - NotificationPolicy
      operationId: ListNotificationPolicies
      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 NotificationPolicy 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 NotificationPolicy 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: Filters results by bucket_slug, where any NotificationPolicy with a matching bucket_slug in the given list (and matches all other filters) is returned.
        style: form
        explode: true
        schema:
          type: array
          items:
            type: string
      - name: team_slugs
        in: query
        description: Filters results by team_slug, where any NotificationPolicy with a matching team_slug in the given list (and matches all other filters) is returned.
        style: form
        explode: true
        schema:
          type: array
          items:
            type: string
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/configv1ListNotificationPoliciesResponse'
        '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:
      - NotificationPolicy
      operationId: CreateNotificationPolicy
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/configv1CreateNotificationPolicyRequest'
        required: true
      responses:
        '200':
          description: A successful response containing the created NotificationPolicy.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/configv1CreateNotificationPolicyResponse'
        '400':
          description: Cannot create the NotificationPolicy because the request is invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
        '409':
          description: Cannot create the NotificationPolicy because there is a conflict with an existing NotificationPolicy.
          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/notification-policies/{slug}:
    get:
      tags:
      - NotificationPolicy
      operationId: ReadNotificationPolicy
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/configv1ReadNotificationPolicyResponse'
        '404':
          description: Cannot read the NotificationPolicy 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:
      - NotificationPolicy
      operationId: UpdateNotificationPolicy
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConfigV1UpdateNotificationPolicyBody'
        required: true
      responses:
        '200':
          description: A successful response containing the updated NotificationPolicy.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/configv1UpdateNotificationPolicyResponse'
        '400':
          description: Cannot update the NotificationPolicy because the request is invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
        '404':
          description: Cannot update the NotificationPolicy because the slug does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
        '409':
          description: Cannot update the NotificationPolicy because there is a conflict with an existing NotificationPolicy.
          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:
      - NotificationPolicy
      operationId: DeleteNotificationPolicy
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/configv1DeleteNotificationPolicyResponse'
        '400':
          description: Cannot delete the NotificationPolicy because it is in use.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
        '404':
          description: Cannot delete the NotificationPolicy 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:
    NotificationPolicyRoutesGroupBy:
      type: object
      properties:
        label_names:
          type: array
          description: 'Set of label names used to group alerts.

            For example, if label_names is ["service", "code"] then all alerts including labels {service="foo",code="404"}

            will be grouped together.'
          items:
            type: string
    configv1CreateNotificationPolicyResponse:
      type: object
      properties:
        notification_policy:
          $ref: '#/components/schemas/configv1NotificationPolicy'
    configv1ListNotificationPoliciesResponse:
      type: object
      properties:
        page:
          $ref: '#/components/schemas/configv1PageResult'
        notification_policies:
          type: array
          items:
            $ref: '#/components/schemas/configv1NotificationPolicy'
    ConfigV1UpdateNotificationPolicyBody:
      type: object
      properties:
        notification_policy:
          $ref: '#/components/schemas/configv1NotificationPolicy'
        create_if_missing:
          type: boolean
          description: If true, the NotificationPolicy will be created if it does not already exist, identified by slug. If false, an error will be returned if the NotificationPolicy does not already exist.
        dry_run:
          type: boolean
          description: If true, the NotificationPolicy isn't created or updated, and no response NotificationPolicy will be returned. The response will return an error if the given NotificationPolicy is invalid.
    configv1NotificationPolicy:
      type: object
      properties:
        slug:
          type: string
          description: Unique identifier of the NotificationPolicy. If a `slug` isn't provided, one will be generated based of the `name` field. You can't modify this field after the NotificationPolicy is created.
        name:
          type: string
          description: Required. Name of the NotificationPolicy. You can modify this value after the NotificationPolicy is created.
        created_at:
          type: string
          description: Timestamp of when the NotificationPolicy was created. Cannot be set by clients.
          format: date-time
          readOnly: true
        updated_at:
          type: string
          description: Timestamp of when the NotificationPolicy was last updated. Cannot be set by clients.
          format: date-time
          readOnly: true
        bucket_slug:
          type: string
          description: 'Slug of the bucket the notification policy belongs to. Required if

            team_slug is not set.'
        team_slug:
          type: string
          description: 'Slug of the team the notification policy belongs to. Required if

            bucket_slug is not set.'
        routes:
          $ref: '#/components/schemas/NotificationPolicyRoutes'
    configv1LabelMatcherMatcherType:
      type: string
      enum:
      - EXACT
      - REGEX
    RoutesNotifierList:
      type: object
      properties:
        notifier_slugs:
          type: array
          description: Slugs of notifiers that will receive the alerts.
          items:
            type: string
        repeat_interval_secs:
          type: integer
          description: Frequency at which to resend alerts.
          format: int32
        group_by:
          $ref: '#/components/schemas/NotificationPolicyRoutesGroupBy'
    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.'
    NotificationPolicyRoutes:
      type: object
      properties:
        defaults:
          $ref: '#/components/schemas/RoutesSeverityNotifiers'
        overrides:
          type: array
          description: 'Optional list of overrides to use for alerts having matching labels.

            Each override defines labels that potentially match an alert''s labels.

            If one or more overrides match an alert, the notifiers of the first matching

            override are used instead of the defaults.'
          items:
            $ref: '#/components/schemas/NotificationPolicyRoutesOverride'
    configv1ReadNotificationPolicyResponse:
      type: object
      properties:
        notification_policy:
          $ref: '#/components/schemas/configv1NotificationPolicy'
    configv1UpdateNotificationPolicyResponse:
      type: object
      properties:
        notification_policy:
          $ref: '#/components/schemas/configv1NotificationPolicy'
    RoutesSeverityNotifiers:
      type: object
      properties:
        warn:
          $ref: '#/components/schemas/RoutesNotifierList'
        critical:
          $ref: '#/components/schemas/RoutesNotifierList'
    NotificationPolicyRoutesOverride:
      type: object
      properties:
        alert_label_matchers:
          type: array
          description: 'Set of matchers on an alert''s labels.

            If all labels match then the override notifiers apply.'
          items:
            $ref: '#/components/schemas/configv1LabelMatcher'
        notifiers:
          $ref: '#/components/schemas/RoutesSeverityNotifiers'
    genericError:
      type: object
      additionalProperties: true
    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.
    configv1CreateNotificationPolicyRequest:
      type: object
      properties:
        notification_policy:
          $ref: '#/components/schemas/configv1NotificationPolicy'
        dry_run:
          type: boolean
          description: If true, the NotificationPolicy isn't created, and no response NotificationPolicy will be returned. The response will return an error if the given NotificationPolicy is invalid.
    configv1LabelMatcher:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/configv1LabelMatcherMatcherType'
        name:
          type: string
          description: name always matches against an exact label name.
        value:
          type: string
          description: value matches against a label value based on the configured type.
    configv1DeleteNotificationPolicyResponse:
      type: object
x-original-swagger-version: '2.0'