Chronosphere ServiceAccount API

The ServiceAccount API from Chronosphere — 2 operation(s) for serviceaccount.

OpenAPI Specification

chronosphere-serviceaccount-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Config V1 Bucket ServiceAccount 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: ServiceAccount
paths:
  /api/v1/config/service-accounts:
    get:
      tags:
      - ServiceAccount
      operationId: ListServiceAccounts
      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 ServiceAccount 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 ServiceAccount 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
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/configv1ListServiceAccountsResponse'
        '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:
      - ServiceAccount
      operationId: CreateServiceAccount
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/configv1CreateServiceAccountRequest'
        required: true
      responses:
        '200':
          description: A successful response containing the created ServiceAccount.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/configv1CreateServiceAccountResponse'
        '400':
          description: Cannot create the ServiceAccount because the request is invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
        '409':
          description: Cannot create the ServiceAccount because there is a conflict with an existing ServiceAccount.
          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/service-accounts/{slug}:
    get:
      tags:
      - ServiceAccount
      operationId: ReadServiceAccount
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/configv1ReadServiceAccountResponse'
        '404':
          description: Cannot read the ServiceAccount 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'
    delete:
      tags:
      - ServiceAccount
      operationId: DeleteServiceAccount
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/configv1DeleteServiceAccountResponse'
        '400':
          description: Cannot delete the ServiceAccount because it is in use.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
        '404':
          description: Cannot delete the ServiceAccount 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:
    configv1DeleteServiceAccountResponse:
      type: object
    MetricsRestrictionPermission:
      type: string
      enum:
      - READ
      - WRITE
      - READ_WRITE
    ServiceAccountMetricsRestriction:
      type: object
      properties:
        permission:
          $ref: '#/components/schemas/MetricsRestrictionPermission'
        labels:
          type: object
          additionalProperties:
            type: string
          description: 'Optional labels which further restricts the service account to only read

            or write metrics with the given label names and values.'
    configv1ReadServiceAccountResponse:
      type: object
      properties:
        service_account:
          $ref: '#/components/schemas/configv1ServiceAccount'
    configv1ListServiceAccountsResponse:
      type: object
      properties:
        page:
          $ref: '#/components/schemas/configv1PageResult'
        service_accounts:
          type: array
          items:
            $ref: '#/components/schemas/configv1ServiceAccount'
    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.'
    configv1CreateServiceAccountResponse:
      type: object
      properties:
        service_account:
          $ref: '#/components/schemas/configv1ServiceAccount'
    configv1CreateServiceAccountRequest:
      type: object
      properties:
        service_account:
          $ref: '#/components/schemas/configv1ServiceAccount'
        dry_run:
          type: boolean
          description: If true, the ServiceAccount isn't created, and no response ServiceAccount will be returned. The response will return an error if the given ServiceAccount is invalid.
    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.
    configv1ServiceAccount:
      type: object
      properties:
        slug:
          type: string
          description: Unique identifier of the ServiceAccount. If a `slug` isn't provided, one will be generated based of the `name` field. You can't modify this field after the ServiceAccount is created.
        name:
          type: string
          description: Required. Name of the ServiceAccount. You can modify this value after the ServiceAccount is created.
        created_at:
          type: string
          description: Timestamp of when the ServiceAccount was created. Cannot be set by clients.
          format: date-time
          readOnly: true
        updated_at:
          type: string
          description: Timestamp of when the ServiceAccount was last updated. Cannot be set by clients.
          format: date-time
          readOnly: true
        token:
          type: string
          description: 'token is the generated API token of the service account. Cannot be set by

            clients.


            token is only set once by the server in the CreateServiceAccount response.

            ReadServiceAccount will always return an empty token. Therefore, when

            creating a service account, clients are responsible for securely storing

            the response token on their end, as they will not be able to read it

            again.'
          readOnly: true
        email:
          type: string
          description: 'email is the generated email address of the service account. Cannot be set

            by clients.'
          readOnly: true
        unrestricted:
          type: boolean
          description: 'If set, grants the service account access to all Chronosphere APIs

            (including resource configuration and metric data) within the access

            controls defined by the service account''s team membership.


            Exactly one of unrestricted or metrics_restriction must be set.'
        metrics_restriction:
          $ref: '#/components/schemas/ServiceAccountMetricsRestriction'
x-original-swagger-version: '2.0'