openapi: 3.0.3
info:
  title: Cluster Settings REST API
  version: '2.0'
  description: |
    This API enables you to view or set cluster-level Enterprise Analytics settings.
servers:
  - url: '{scheme}://{host}:{port}'
    description: The URL scheme, host, and port are as follows.
    variables:
      scheme:
        default: http
        description: |-
          The URL scheme.
          Use `https` for secure access.
        enum:
          - http
          - https
      host:
        default: localhost
        description: The host name or IP address of a node.
      port:
        default: '8091'
        description: |-
          The Cluster administration REST port.
          Use `18091` for secure access.

          Note that the port numbers for this REST API are different to the port numbers used by the other Enterprise Analytics Service REST APIs.
        enum:
          - '8091'
          - '18091'
paths:
  /settings/analytics:
    get:
      operationId: get_settings
      summary: View Enterprise Analytics Settings
      description: |
        Retrieves cluster-level Analytics settings.
      security:
        - ClusterRead: []
      responses:
        '200':
          description: The operation was successful.
          content: &ref_1
            application/json:
              schema:
                type: object
                properties: &ref_0
                  blobStorageScheme:
                    type: string
                    description: Specifies the blob storage scheme.
                    x-has-example: true
                    example: s3
                  blobStorageBucket:
                    type: string
                    description: Specifies the blob storage bucket name.
                    x-has-example: true
                    example: enteprise-analytics-bucket
                  blobStorageRegion:
                    type: string
                    description: Specifies the blob storage bucket region.
                    x-has-example: true
                    example: us-west-2
                  blobStoragePrefix:
                    type: string
                    description: Specifies the blob storage bucket prefix where enteprise analytics will store its data.
                    x-has-example: true
                    example: analytics-data/
                  blobStorageAnonymousAuth:
                    type: boolean
                    description: Specifies if anonymous authentication should be used when accessing the blob storage bucket.
                    x-has-example: true
                    example: false
                  blobStorageForcePathStyle:
                    type: boolean
                    description: Specifies if path style should be should be used when accessing the blob storage bucket.
                    x-has-example: true
                    example: false
                  numStoragePartitions:
                    type: integer
                    minimum: 1
                    maximum: 1024
                    description: Specifies the number partitions that will be used when storing the data in the blob storage bucket.
                    x-has-example: true
                    example: 128
        '401':
          description: |
            Unauthorized. The user name or password may be incorrect.
          content: &ref_2
            application/json:
              schema:
                type: object
    post:
      operationId: post_settings
      summary: Modify Enterprise Analytics Settings
      description: |
        Sets cluster-level Analytics settings.
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties: *ref_0
      security:
        - ClusterWrite: []
      responses:
        '200':
          description: The operation was successful.
          content: *ref_1
        '400':
          description: |
            Bad request. A parameter has an incorrect value.
          content: &ref_3
            application/json:
              schema:
                type: object
        '401':
          description: |
            Unauthorized. The user name or password may be incorrect.
          content: *ref_2
components:
  schemas:
    Settings:
      type: object
      properties: *ref_0
  responses:
    OK:
      description: The operation was successful.
      content: *ref_1
    BadRequest:
      description: |
        Bad request. A parameter has an incorrect value.
      content: *ref_3
    Unauthorized:
      description: |
        Unauthorized. The user name or password may be incorrect.
      content: *ref_2
  securitySchemes:
    ClusterRead:
      type: http
      scheme: basic
      description: |
        For the [View Enterprise Analytics Settings](#get_settings) operation, users must have one of the following RBAC roles:

        * Full Admin
        * Cluster Admin
        * Read-Only Admin
    ClusterWrite:
      type: http
      scheme: basic
      description: |
        For the [Modify Enterprise Analytics Settings](#post_settings) operation, users must have one of the following RBAC roles:

        * Full Admin
        * Cluster Admin
