x-generated: Automatically generated by CDP protoc plugin. Do not edit manually.
swagger: '2.0'
x-endpoint-name: opdb
x-products: CDP
x-form-factors: public
x-cdp-releases: PUBLIC
info:
  version: 0.9.163
  title: Operational Database service
  license:
    name: Apache 2.0
  description: Interact with the Cloudera Operational Database service
  termsOfService: https://www.cloudera.com/legal/commercial-terms-and-conditions.html
schemes:
  - https
consumes:
  - application/json
produces:
  - application/json
paths:
  /api/v1/opdb/collectDiagnostics:
    post:
      summary: Collect diagnostic data bundles from the database
      description: returns details of running command
      operationId: collectDiagnostics
      parameters:
        - name: input
          in: body
          required: true
          schema:
            $ref: '#/definitions/CollectDiagnosticsRequest'
      responses:
        200:
          description: Expected response to a valid request.
          schema:
            $ref: '#/definitions/CollectDiagnosticsResponse'
        default:
          description: The default response on an error.
          schema:
            $ref: '#/definitions/Error'
      x-mutating: false
  /api/v1/opdb/createDatabase:
    post:
      summary: Create opDb
      description: Create a operational database in a environment
      operationId: createDatabase
      parameters:
        - name: input
          in: body
          required: true
          schema:
            $ref: '#/definitions/CreateDatabaseRequest'
      responses:
        200:
          description: Expected response to a valid request.
          schema:
            $ref: '#/definitions/CreateDatabaseResponse'
        default:
          description: The default response on an error.
          schema:
            $ref: '#/definitions/Error'
      x-mutating: true
  /api/v1/opdb/createSnapshot:
    post:
      summary: Creates a snapshot for a specific table.
      description: Returns id state and creation time.
      operationId: createSnapshot
      parameters:
        - name: input
          in: body
          required: true
          schema:
            $ref: '#/definitions/CreateSnapshotRequest'
      responses:
        200:
          description: Expected response to a valid request.
          schema:
            $ref: '#/definitions/CreateSnapshotResponse'
        default:
          description: The default response on an error.
          schema:
            $ref: '#/definitions/Error'
      x-mutating: true
  /api/v1/opdb/deleteSnapshot:
    post:
      summary: Deletes a snapshot.
      description: Returns the snapshot that is deleted.
      operationId: deleteSnapshot
      parameters:
        - name: input
          in: body
          required: true
          schema:
            $ref: '#/definitions/DeleteSnapshotRequest'
      responses:
        200:
          description: Expected response to a valid request.
          schema:
            $ref: '#/definitions/DeleteSnapshotResponse'
        default:
          description: The default response on an error.
          schema:
            $ref: '#/definitions/Error'
      x-mutating: true
  /api/v1/opdb/describeClientConnectivity:
    post:
      summary: Returns client connectivity details
      description: Returns details to enable programmatic client connectivity for a database
      operationId: describeClientConnectivity
      parameters:
        - name: input
          in: body
          required: true
          schema:
            $ref: '#/definitions/DescribeClientConnectivityRequest'
      responses:
        200:
          description: Expected response to a valid request.
          schema:
            $ref: '#/definitions/DescribeClientConnectivityResponse'
        default:
          description: The default response on an error.
          schema:
            $ref: '#/definitions/Error'
      x-mutating: false
  /api/v1/opdb/describeDatabase:
    post:
      summary: Describe a opDb
      description: Details about the operational database
      operationId: describeDatabase
      parameters:
        - name: input
          in: body
          required: true
          schema:
            $ref: '#/definitions/DescribeDatabaseRequest'
      responses:
        200:
          description: Expected response to a valid request.
          schema:
            $ref: '#/definitions/DescribeDatabaseResponse'
        default:
          description: The default response on an error.
          schema:
            $ref: '#/definitions/Error'
      x-mutating: false
  /api/v1/opdb/describeUpgradeDatabase:
    post:
      summary: Describes the upgrade availability.
      description: Describes the upgrade availability for an operational database.
      operationId: describeUpgradeDatabase
      parameters:
        - name: input
          in: body
          required: true
          schema:
            $ref: '#/definitions/DescribeUpgradeDatabaseRequest'
      responses:
        200:
          description: Expected response to a valid request.
          schema:
            $ref: '#/definitions/DescribeUpgradeDatabaseResponse'
        default:
          description: The default response on an error.
          schema:
            $ref: '#/definitions/Error'
      x-mutating: false
  /api/v1/opdb/dropDatabase:
    post:
      summary: drop a opDb
      description: drop the operational database
      operationId: dropDatabase
      parameters:
        - name: input
          in: body
          required: true
          schema:
            $ref: '#/definitions/DropDatabaseRequest'
      responses:
        200:
          description: Expected response to a valid request.
          schema:
            $ref: '#/definitions/DropDatabaseResponse'
        default:
          description: The default response on an error.
          schema:
            $ref: '#/definitions/Error'
      x-mutating: true
  /api/v1/opdb/listDatabases:
    post:
      summary: List all opDbs in an environment
      description: Fetch a list of all operational databases in an environment
      operationId: listDatabases
      parameters:
        - name: input
          in: body
          required: true
          schema:
            $ref: '#/definitions/ListDatabasesRequest'
      responses:
        200:
          description: Expected response to a valid request.
          schema:
            $ref: '#/definitions/ListDatabasesResponse'
        default:
          description: The default response on an error.
          schema:
            $ref: '#/definitions/Error'
      x-mutating: false
  /api/v1/opdb/listDiagnostics:
    post:
      summary: List all diagnostics associated to the database
      description: returns list of diagnostics collections
      operationId: listDiagnostics
      parameters:
        - name: input
          in: body
          required: true
          schema:
            $ref: '#/definitions/ListDiagnosticsRequest'
      responses:
        200:
          description: Expected response to a valid request.
          schema:
            $ref: '#/definitions/ListDiagnosticsResponse'
        default:
          description: The default response on an error.
          schema:
            $ref: '#/definitions/Error'
      x-mutating: false
  /api/v1/opdb/listRestoreSnapshots:
    post:
      summary: Lists instances when a snapshot was restored to a database.
      description: Returns a list of snapshots restored into a database.
      operationId: listRestoreSnapshots
      parameters:
        - name: input
          in: body
          required: true
          schema:
            $ref: '#/definitions/ListRestoreSnapshotsRequest'
      responses:
        200:
          description: Expected response to a valid request.
          schema:
            $ref: '#/definitions/ListRestoreSnapshotsResponse'
        default:
          description: The default response on an error.
          schema:
            $ref: '#/definitions/Error'
      x-mutating: false
  /api/v1/opdb/listSnapshots:
    post:
      summary: Shows snapshot for a table name in a specific location.
      description: Returns list of snapshot names.
      operationId: listSnapshots
      parameters:
        - name: input
          in: body
          required: true
          schema:
            $ref: '#/definitions/ListSnapshotsRequest'
      responses:
        200:
          description: Expected response to a valid request.
          schema:
            $ref: '#/definitions/ListSnapshotsResponse'
        default:
          description: The default response on an error.
          schema:
            $ref: '#/definitions/Error'
      x-mutating: false
  /api/v1/opdb/listSupportedEnvironments:
    post:
      summary: List of environments available for the database creation
      description: Fetches a list of environments available for the database creation
      operationId: listSupportedEnvironments
      parameters:
        - name: input
          in: body
          required: true
          schema:
            $ref: '#/definitions/ListSupportedEnvironmentsRequest'
      responses:
        200:
          description: Expected response to a valid request.
          schema:
            $ref: '#/definitions/ListSupportedEnvironmentsResponse'
        default:
          description: The default response on an error.
          schema:
            $ref: '#/definitions/Error'
      x-mutating: false
  /api/v1/opdb/prepareUpgradeDatabase:
    post:
      summary: Prepare database upgrade.
      description: Runs upgrade related validations and prepares the required parcels for the upgrade.
      operationId: prepareUpgradeDatabase
      parameters:
        - name: input
          in: body
          required: true
          schema:
            $ref: '#/definitions/PrepareUpgradeDatabaseRequest'
      responses:
        200:
          description: Expected response to a valid request.
          schema:
            $ref: '#/definitions/PrepareUpgradeDatabaseResponse'
        default:
          description: The default response on an error.
          schema:
            $ref: '#/definitions/Error'
      x-mutating: true
  /api/v1/opdb/restoreSnapshot:
    post:
      summary: Restores a snapshot.
      description: Returns the snapshot that was restored.
      operationId: restoreSnapshot
      parameters:
        - name: input
          in: body
          required: true
          schema:
            $ref: '#/definitions/RestoreSnapshotRequest'
      responses:
        200:
          description: Expected response to a valid request.
          schema:
            $ref: '#/definitions/RestoreSnapshotResponse'
        default:
          description: The default response on an error.
          schema:
            $ref: '#/definitions/Error'
      x-mutating: true
  /api/v1/opdb/startDatabase:
    post:
      summary: Starts the database
      description: Starts a previously stopped database
      operationId: startDatabase
      parameters:
        - name: input
          in: body
          required: true
          schema:
            $ref: '#/definitions/StartDatabaseRequest'
      responses:
        200:
          description: Expected response to a valid request.
          schema:
            $ref: '#/definitions/StartDatabaseResponse'
        default:
          description: The default response on an error.
          schema:
            $ref: '#/definitions/Error'
      x-mutating: true
  /api/v1/opdb/stopDatabase:
    post:
      summary: Stops the database
      description: Stops a running database
      operationId: stopDatabase
      parameters:
        - name: input
          in: body
          required: true
          schema:
            $ref: '#/definitions/StopDatabaseRequest'
      responses:
        200:
          description: Expected response to a valid request.
          schema:
            $ref: '#/definitions/StopDatabaseResponse'
        default:
          description: The default response on an error.
          schema:
            $ref: '#/definitions/Error'
      x-mutating: true
  /api/v1/opdb/updateDatabase:
    post:
      summary: Updates the database
      description: Update an operational database in an environment
      operationId: updateDatabase
      parameters:
        - name: input
          in: body
          required: true
          schema:
            $ref: '#/definitions/UpdateDatabaseRequest'
      responses:
        200:
          description: Expected response to a valid request.
          schema:
            $ref: '#/definitions/UpdateDatabaseResponse'
        default:
          description: The default response on an error.
          schema:
            $ref: '#/definitions/Error'
      x-mutating: true
  /api/v1/opdb/upgradeDatabase:
    post:
      summary: Upgrades the database.
      description: Upgrades an operational database in an environment to a given runtime.
      operationId: upgradeDatabase
      parameters:
        - name: input
          in: body
          required: true
          schema:
            $ref: '#/definitions/UpgradeDatabaseRequest'
      responses:
        200:
          description: Expected response to a valid request.
          schema:
            $ref: '#/definitions/UpgradeDatabaseResponse'
        default:
          description: The default response on an error.
          schema:
            $ref: '#/definitions/Error'
      x-mutating: true
definitions:
  Error:
    type: object
    description: An object returned on an error.
    properties:
      code:
        type: string
        description: The error code.
      message:
        type: string
        description: The error message.
  DiagnosticDestination:
    type: string
    description: Destination of the created diagnostics bundle.
    enum:
      - UPLOAD_TO_CLOUDERA
      - DOWNLOAD
  DiagnosticsBundle:
    type: object
    description: Describe a diagnostics bundle.
    properties:
      id:
        type: string
        description: Identifier for each bundle collection.
      crn:
        type: string
        description: The object on which diagnostics was collected.
      startTime:
        type: string
        format: date-time
        description: Start time.
      endTime:
        type: string
        format: date-time
        description: The end time, if the command is finished.
      destination:
        description: Requested destination of the bundle.
        $ref: '#/definitions/DiagnosticDestination'
      caseNumber:
        type: string
        description: CSH case number.
      status:
        type: string
        description: A status of the diagnostics collection process.
      result:
        type: string
        description: If this is a download, a link to the download location of the bundle.
  CollectDiagnosticsRequest:
    type: object
    description: Enables starting collection of the diagnostics. This is an asynchronous API and not expected to block.
    required:
      - environmentName
      - databaseName
      - endTime
    properties:
      environmentName:
        type: string
        description: The name of the environment.
      databaseName:
        type: string
        description: The name of the database.
      endTime:
        type: string
        description: The end time (in ISO 8601 format) of the period to collection statistics for.
      startTime:
        type: string
        description: The start time (in ISO 8601 format) of the period to collection statistics for.
      destination:
        description: This defines where to put the resulting bundle.
        $ref: '#/definitions/DiagnosticDestination'
      caseNumber:
        type: string
        description: The CSH case number to associate the bundle.
      bundleSizeBytes:
        type: integer
        format: int64
        description: Bundle size limit.
  CollectDiagnosticsResponse:
    type: object
    description: Information about diagnostic bundle generation.
    properties:
      diagnosticsBundle:
        description: Details of requested diagnostic bundle collection.
        $ref: '#/definitions/DiagnosticsBundle'
  ListDiagnosticsRequest:
    type: object
    description: Lists the in-progress diagnostic bundle operations.
    required:
      - environmentName
      - databaseName
    properties:
      environmentName:
        type: string
        description: The name of the environment.
      databaseName:
        type: string
        description: The name of the database.
  ListDiagnosticsResponse:
    type: object
    description: The list of in-progress diagnostic bundle operations.
    properties:
      diagnosticsBundles:
        type: array
        items:
          $ref: '#/definitions/DiagnosticsBundle'
        description: List of diagnostics operations.
  KeyValuePair:
    type: object
    description: Generic key-value type, because map<> is not supported
    properties:
      key:
        type: string
        description: Key
      value:
        type: string
        description: Value
  InstanceGroupType:
    type: string
    description: "InstanceGroup Type.\n `WORKER` - WORKER value of the InstanceGroup name. `LEADER` - LEADER value of the InstanceGroup name. `MASTER` - MASTER value of the InstanceGroup name. `GATEWAY` - GATEWAY value of the InstanceGroup name. `STRONGMETA` - STRONGMETA value of the InstanceGroup name. `EDGE` - EDGE value of the InstanceGroup name. `COMPUTE` - COMPUTE value of the InstanceGroup name. `RESTWORKER` - RESTWORKER value of the InstanceGroup name."
    enum:
      - WORKER
      - LEADER
      - MASTER
      - GATEWAY
      - STRONGMETA
      - EDGE
  CustomRecipe:
    type: object
    description: Describe a custom recipe.
    required:
      - names
      - instanceGroup
    properties:
      names:
        type: array
        items:
          type: string
        description: Name of the recipe.
      instanceGroup:
        description: Instance group to apply the recipe to.
        $ref: '#/definitions/InstanceGroupType'
  VolumeEncryption:
    type: object
    description: Specify volume encryption key for instance group.
    required:
      - encryptionKey
      - instanceGroup
    properties:
      encryptionKey:
        type: string
        description: Encryption key.
      instanceGroup:
        description: Instance group to apply the encryption key to.
        $ref: '#/definitions/InstanceGroupType'
  CreateDatabaseRequest:
    type: object
    description: A request to create the database
    required:
      - environmentName
      - databaseName
    properties:
      environmentName:
        type: string
        description: environment name
      databaseName:
        type: string
        description: database name
      autoScalingParameters:
        description: Parameters to configure the AutoScaling
        $ref: '#/definitions/AutoScalingParameters'
      subnetId:
        type: string
        description: Override subnet where the database will be deployed. Disables Multi-AZ if set [only for AWS].
      customUserTags:
        type: array
        items:
          $ref: '#/definitions/KeyValuePair'
        description: Optional tags to apply to launched infrastructure resources
      disableMultiAz:
        type: boolean
        description: Disable deployment into multiple availability-zones (the database will be deployed into one subnet).
      attachedStorageForWorkers:
        description: Attached storage for the worker nodes for AWS, Azure, and GCP cloud providers.
        $ref: '#/definitions/AttachedStorageForWorkers'
      disableKerberos:
        type: boolean
        description: Disable Kerberos authentication.
      numEdgeNodes:
        type: integer
        format: int32
        description: Number of edge nodes to be created for the database. A positive, non-zero number is required. The default value is 0.
      image:
        description: Image details for the database.
        $ref: '#/definitions/Image'
      disableJwtAuth:
        type: boolean
        description: Disable OAuth Bearer (JWT) authentication scheme.
      enableRegionCanary:
        type: boolean
        description: To enable the region canary for the database.
      scaleType:
        description: Optional tags to choose one of the predefined cluster sizes.
        $ref: '#/definitions/ScaleType'
      storageType:
        description: Optional tag to choose the storage types.
        $ref: '#/definitions/StorageType'
      recipes:
        type: array
        items:
          $ref: '#/definitions/CustomRecipe'
        description: Custom recipes for the database.
      enableGrafana:
        type: boolean
        description: To enable grafana server for the database.
      rootVolumeSize:
        type: integer
        format: int32
        description: Root volume size in GiB.
      volumeEncryptions:
        type: array
        items:
          $ref: '#/definitions/VolumeEncryption'
        description: Specifies encryption key to encrypt volume for instance group. It is currently supported for AWS cloud provider only.
      gatewayNodesCount:
        type: integer
        format: int32
        description: Number of gateway nodes to be created for the database. When multiple gateway nodes are present Knox works in HA mode. A positive, non-zero number is required. The default value is 1. Requires the COD_RESTWORKERS entitlement.
      restworkerNodesCount:
        type: integer
        format: int32
        description: Number of REST Worker nodes to be created for the database. A positive, non-zero number is required. The default value is 0. Requires the COD_RESTWORKERS entitlement.
      architecture:
        description: Specifies the Architecture of the cluster nodes.
        $ref: '#/definitions/ArchitectureType'
      customInstanceTypes:
        description: Provide custom VM instance types for master, worker, gateway, leader, edge and compute groups.
        $ref: '#/definitions/CustomInstanceTypes'
  CustomInstanceTypes:
    type: object
    description: Custom VM Instance Types.
    properties:
      masterType:
        type: string
        description: Master VM Instance Type.
      workerType:
        type: string
        description: Worker VM Instance Type.
      gatewayType:
        type: string
        description: Gateway VM Instance Type.
      leaderType:
        type: string
        description: Leader VM Instance Type.
      edgeType:
        type: string
        description: Edge VM Instance Type.
      computeType:
        type: string
        description: Compute VM Instance Type.
  VolumeType:
    type: string
    description: "Volume Type.\n `HDD` - Hard disk drives (HDD) volume type. Default is HDD. `SSD` - Solid disk drives (SSD) volume type. `LOCAL_SSD` - Local SSD volume type."
    enum:
      - HDD
      - SSD
      - LOCAL_SSD
  AttachedStorageForWorkers:
    type: object
    description: Attached storage for the worker nodes for AWS, Azure, and GCP cloud providers.
    properties:
      volumeCount:
        type: integer
        format: int32
        minimum: 1
        maximum: 8
        description: 'The number of Volumes. Default is 4. Valid Range: Minimum value of 1, maximum value 8.'
      volumeSize:
        type: integer
        format: int32
        description: The target size of the volume, in GiB. Default is 2048.
      volumeType:
        description: The volume type. This parameter can be HDD or SSD. Default is HDD.
        $ref: '#/definitions/VolumeType'
  ScaleType:
    type: string
    description: "Scale type.\n `MICRO` - Create a 2-node cluster (1 gateway and 1 worker) with high availability disabled. `LIGHT` - Create a multi-node cluster with a light master and gateway instance type. `HEAVY` - Create a multi-node cluster with heavy master and gateway instance type."
    enum:
      - MICRO
      - LIGHT
      - HEAVY
  StorageType:
    type: string
    description: "Storage type for clusters.\n `CLOUD_WITH_EPHEMERAL` - Cloud with ephemeral storage. `CLOUD` - Cloud storage without ephemeral storage. `HDFS` - HDFS storage."
    enum:
      - CLOUD_WITH_EPHEMERAL
      - CLOUD
      - HDFS
  ArchitectureType:
    type: string
    description: "Architecture type for cluster.\n `X86_64` - X64 CPU Architecture is used for the cluster. `ARM64` - ARM64 CPU Architecture is used for the cluster."
    enum:
      - X86_64
      - ARM64
  UpdateDatabaseRequest:
    type: object
    description: A request to update the database
    required:
      - environmentName
      - databaseName
    properties:
      environmentName:
        type: string
        description: environment name
      databaseName:
        type: string
        description: database name
      autoScalingParameters:
        description: Parameters to configure the scaling policy
        $ref: '#/definitions/AutoScalingParameters'
      numDesiredStrongMetaServers:
        type: integer
        format: int32
        description: The desired number of strong meta servers for this database. A positive, non-zero number is required. Use removeStrongMetaServers to remove strong meta servers entirely. Requires the COD_STRONG_META_SERVERS entitlement.
      removeStrongMetaServers:
        type: boolean
        description: Removes any strong meta servers provisioned for this database. Requires the COD_STRONG_META_SERVERS entitlement.
      numDesiredRestworkerNodes:
        type: integer
        format: int32
        description: Sets the desired number of REST Worker nodes for the database. A positive, non-zero number is required. Requires the COD_RESTWORKERS entitlement.
      removeRestworkerNodes:
        type: boolean
        description: Removes any REST Worker nodes provisioned for this database. Requires the COD_RESTWORKERS entitlement.
  AutoScalingParameters:
    type: object
    description: A Parameters to configure AutoScaling
    properties:
      targetedValueForMetric:
        type: integer
        format: int64
        description: The target value of the metric a user expect to maintain for the cluster
      maxWorkersForDatabase:
        type: integer
        format: int32
        description: Maximum number of worker nodes as per this metrics can be scaled up to.
      maxWorkersPerBatch:
        type: integer
        format: int32
        description: Maximum number of worker nodes as per this metrics can be scaled up to in one batch.
      minWorkersForDatabase:
        type: integer
        format: int32
        description: Minimum number of worker nodes as per this metrics can be scaled down to.
      evaluationPeriod:
        type: integer
        format: int64
        description: Period of metrics(in seconds) needs to be considered.
      minimumBlockCacheGb:
        type: integer
        format: int32
        description: The amount of block cache, in Gigabytes, which the database should have.
  CreateDatabaseResponse:
    type: object
    description: A response which gives status of the database creation
    required:
      - databaseDetails
    properties:
      databaseDetails:
        description: Details of the Database created
        $ref: '#/definitions/DatabaseDetails'
  UpdateDatabaseResponse:
    type: object
    description: A response to database update request
    properties:
      status:
        type: string
        description: Status of whether the update was successful or not.
  DropDatabaseRequest:
    type: object
    description: A request to drop the database
    required:
      - environmentName
      - databaseName
    properties:
      environmentName:
        type: string
        description: environment name
      databaseName:
        type: string
        description: database name
      force:
        type: boolean
        description: Whether to forcefully drop the database
  DropDatabaseResponse:
    type: object
    description: A response which gives status of the database deletion
    properties:
      status:
        description: status of delete database request
        $ref: '#/definitions/StatusType'
  ListSupportedEnvironmentsRequest:
    type: object
    description: A request to get a list of available environments
  Environment:
    type: object
    description: Details of the environment
    required:
      - crn
      - name
    properties:
      crn:
        type: string
        description: The crn of the environment
      name:
        type: string
        description: The name of the environment
  ListSupportedEnvironmentsResponse:
    type: object
    description: A response which contains a list of available environments
    properties:
      environments:
        type: array
        items:
          $ref: '#/definitions/Environment'
        description: The crn of the environment
  StatusType:
    type: string
    description: status of the database
    enum:
      - REQUESTED
      - CREATE_IN_PROGRESS
      - AVAILABLE
      - UPDATE_IN_PROGRESS
      - UPDATE_REQUESTED
      - UPDATE_FAILED
      - CREATE_FAILED
      - ENABLE_SECURITY_FAILED
      - PRE_DELETE_IN_PROGRESS
      - DELETE_IN_PROGRESS
      - DELETE_FAILED
      - DELETE_COMPLETED
      - STOPPED
      - STOP_REQUESTED
      - START_REQUESTED
      - STOP_IN_PROGRESS
      - START_IN_PROGRESS
      - START_FAILED
      - STOP_FAILED
      - WAIT_FOR_SYNC
      - MAINTENANCE_MODE_ENABLED
      - REQUESTING
      - MISSING
      - BACKUP_IN_PROGRESS
      - BACKUP_FAILED
      - BACKUP_FINISHED
      - RESTORE_IN_PROGRESS
      - RESTORE_FAILED
      - RESTORE_FINISHED
      - DELETED_ON_PROVIDER_SIDE
      - AMBIGUOUS
      - EXTERNAL_DATABASE_CREATION_IN_PROGRESS
      - EXTERNAL_DATABASE_CREATION_FAILED
      - EXTERNAL_DATABASE_DELETION_IN_PROGRESS
      - EXTERNAL_DATABASE_DELETION_FINISHED
      - EXTERNAL_DATABASE_DELETION_FAILED
      - UNKNOWN
      - EXTERNAL_DATABASE_START_IN_PROGRESS
      - EXTERNAL_DATABASE_START_FINISHED
      - EXTERNAL_DATABASE_START_FAILED
      - EXTERNAL_DATABASE_STOP_IN_PROGRESS
      - EXTERNAL_DATABASE_STOP_FINISHED
      - EXTERNAL_DATABASE_STOP_FAILED
      - LOAD_BALANCER_UPDATE_IN_PROGRESS
      - LOAD_BALANCER_UPDATE_FINISHED
      - LOAD_BALANCER_UPDATE_FAILED
      - UNREACHABLE
      - NODE_FAILURE
      - RECOVERY_IN_PROGRESS
      - RECOVERY_REQUESTED
      - RECOVERY_FAILED
  ListDatabasesRequest:
    type: object
    description: A request to list databases
    properties:
      environmentName:
        type: string
        description: name of the environment
  ListDatabasesResponse:
    type: object
    description: A list of databases in response
    required:
      - databases
    properties:
      databases:
        type: array
        items:
          $ref: '#/definitions/DatabaseDetails'
        description: The details of the database
  DatabaseDetails:
    type: object
    description: Details of the databases.
    required:
      - databaseName
      - environmentCrn
      - crn
      - creationDate
    properties:
      databaseName:
        type: string
        description: The name of the database.
      environmentCrn:
        type: string
        description: environment crn
      crn:
        type: string
        description: database crn
      creationDate:
        type: string
        format: date-time
        description: The creation time of the database
      status:
        description: Status of the database creation
        $ref: '#/definitions/StatusType'
      creatorCrn:
        type: string
        description: Crn of the creator
      dbVersion:
        type: string
        description: Database version
      hueEndpoint:
        type: string
        description: Hue endpoint
      environmentName:
        type: string
        description: Environment name
      storageLocation:
        type: string
        description: HBase cloud storage location
      internalName:
        type: string
        description: Internal cluster name for this database
      gatewayNodesCount:
        type: integer
        format: int32
        description: Number of gateway nodes for the database.
      restworkerNodesCount:
        type: integer
        format: int32
        description: Number of REST Worker nodes for the database.
      architecture:
        description: Specifies the architecture of the cluster nodes.
        $ref: '#/definitions/ArchitectureType'
  DescribeDatabaseRequest:
    type: object
    description: request to get details of the database in a particular environment
    required:
      - environmentName
      - databaseName
    properties:
      environmentName:
        type: string
        description: The name of the environment.
      databaseName:
        type: string
        description: The name of the database.
  DescribeDatabaseResponse:
    type: object
    description: Details of the database.
    properties:
      databaseDetails:
        description: The details of the database.
        $ref: '#/definitions/DatabaseDetails'
  SnapshotStatusType:
    type: string
    description: "Snapshot Status Type.\n `NEW` - Expected when a snapshot request was just requested. `IN_PROGRESS` - When a snapshot request is in progress. `FAILED` - If for any reason a snapshot request has failed. `SUCCESSFUL` - A snapshot request has completed successfully. `LOCKED` - A snapshot exists, but can't be restored or read. `DELETED` - A snapshot existed but was just deleted. `CORRUPT` - A snapshot got corrupted. `DELETING` - A snapshot is being deleted."
    enum:
      - NEW
      - IN_PROGRESS
      - FAILED
      - SUCCESSFUL
      - LOCKED
      - DELETED
      - CORRUPT
      - DELETING
      - UNKNOWN
  CreateSnapshotRequest:
    type: object
    description: Create Snapshot Request.
    required:
      - environmentName
      - databaseName
      - tableName
      - snapshotName
      - snapshotLocation
    properties:
      environmentName:
        type: string
        description: The name of the environment.
      databaseName:
        type: string
        description: The name of the database.
      tableName:
        type: string
        description: The fully qualified table name.
      snapshotName:
        type: string
        description: Snapshot name unique per database.
      snapshotLocation:
        type: string
        description: The snapshot location URL on object store.
  CreateSnapshotResponse:
    type: object
    description: Create Snapshot Response.
    properties:
      environmentName:
        type: string
        description: The name of the environment.
      databaseName:
        type: string
        description: The name of the database.
      status:
        description: The status of the create snapshot.
        $ref: '#/definitions/SnapshotStatusType'
      creationTime:
        type: integer
        format: int64
        description: When the snapshot was created.
      commandID:
        type: integer
        format: int64
        description: The submitted Command ID of the create snapshot.
      statusReason:
        type: string
        description: Reason for the status.
  RestoreSnapshotRequest:
    type: object
    description: Restore Snapshot Request.
    required:
      - environmentName
      - databaseName
      - snapshotName
      - targetEnvironmentName
      - targetDatabaseName
    properties:
      environmentName:
        type: string
        description: The name of the original environment.
      databaseName:
        type: string
        description: The name of the original database.
      snapshotName:
        type: string
        description: The name of the snapshot.
      targetEnvironmentName:
        type: string
        description: The name of the target environment where the snapshot should be restored.
      targetDatabaseName:
        type: string
        description: The name of the target database where the snapshot should be restored.
  RestoreSnapshotResponse:
    type: object
    description: Response object for the RestoreSnapshot method.
    properties:
      environmentName:
        type: string
        description: The name of the environment.
      databaseName:
        type: string
        description: The name of the database.
      snapshotName:
        type: string
        description: The name of the snapshot.
      targetEnvironmentName:
        type: string
        description: The name of the target environment.
      targetDatabaseName:
        type: string
        description: The name of the target database.
      status:
        description: The status of the restore snapshot.
        $ref: '#/definitions/SnapshotStatusType'
      restoreTime:
        type: integer
        format: int64
        description: The time when the snapshot restore was started.
      commandID:
        type: integer
        format: int64
        description: The submitted Command ID of the restore snapshot.
      statusReason:
        type: string
        description: Reason for the status.
  DeleteSnapshotRequest:
    type: object
    description: Request object for the DeleteSnapshot method.
    required:
      - environmentName
      - databaseName
      - snapshotName
    properties:
      environmentName:
        type: string
        description: The name of the environment.
      databaseName:
        type: string
        description: The name of the database.
      snapshotName:
        type: string
        description: The name of the snapshot.
      force:
        type: boolean
        description: Forcefully delete the snapshot.
  DeleteSnapshotResponse:
    type: object
    description: Response object of the DeleteSnapshot method.
    properties:
      environmentName:
        type: string
        description: The name of the environment.
      databaseName:
        type: string
        description: The name of the database.
      status:
        description: The status of the delete snapshot.
        $ref: '#/definitions/SnapshotStatusType'
      commandID:
        type: integer
        format: int64
        description: The submitted Command ID of the delete snapshot.
      statusReason:
        type: string
        description: Reason for the status.
      snapshotName:
        type: string
        description: The name of the snapshot.
  Snapshot:
    type: object
    description: An instance of a table's snapshot.
    required:
      - snapshotId
      - tableName
      - snapshotName
    properties:
      snapshotId:
        type: integer
        format: int64
        description: The id of the snapshot.
      tableName:
        type: string
        description: The table name.
      snapshotName:
        type: string
        description: The name of the snapshot.
      creationTime:
        type: integer
        format: int64
        description: The creation time of the snapshot.
      status:
        description: The status of the snapshot.
        $ref: '#/definitions/SnapshotStatusType'
      commandID:
        type: integer
        format: int64
        description: The submitted Command ID of the snapshot.
      snapshotLocation:
        type: string
        description: The location of the snapshot.
      failureReason:
        type: string
        description: Reason for the failure in case of snapshot creation failed.
  ListSnapshotsRequest:
    type: object
    description: Show Snapshots Request.
    required:
      - environmentName
      - databaseName
    properties:
      environmentName:
        type: string
        description: The name of the environment.
      databaseName:
        type: string
        description: The name of the database.
      tableName:
        type: string
        description: The table name.
      commandId:
        type: integer
        format: int64
        description: The submitted Command ID of the snapshots.
      fromCreationTime:
        type: string
        format: date-time
        description: The creation time of the snapshots to search (inclusive).
      toCreationTime:
        type: string
        format: date-time
        description: The ending time of the snapshot creation to search (inclusive).
  ListSnapshotsResponse:
    type: object
    description: Show Snapshots Response.
    required:
      - environmentName
      - databaseName
    properties:
      environmentName:
        type: string
        description: The name of the environment.
      databaseName:
        type: string
        description: The name of the database.
      snapshots:
        type: array
        items:
          $ref: '#/definitions/Snapshot'
        description: List of snapshots.
      status:
        description: The status of the list snapshots.
        $ref: '#/definitions/SnapshotStatusType'
      statusReason:
        type: string
        description: Reason for the status.
  ListRestoreSnapshotsRequest:
    type: object
    description: Show Restore Snapshots Request.
    required:
      - environmentName
      - databaseName
    properties:
      environmentName:
        type: string
        description: The name of the environment.
      databaseName:
        type: string
        description: The name of the database.
      snapshotName:
        type: string
        description: The name of the snapshot.
      targetEnvironmentName:
        type: string
        description: The name of the target environment.
      targetDatabaseName:
        type: string
        description: The name of the target database.
      commandId:
        type: integer
        format: int64
        description: The submitted Command ID of the snapshot.
      fromRestoreTime:
        type: string
        format: date-time
        description: The starting snapshot restore time to search restore snapshots (inclusive).
      toRestoreTime:
        type: string
        format: date-time
        description: The ending snapshot restore time to search restore snapshots (inclusive).
  RestoreSnapshot:
    type: object
    description: An instance of restoring a snapshot to a database.
    required:
      - restoreId
      - snapshotId
    properties:
      restoreId:
        type: integer
        format: int64
        description: The id of the restore snapshot.
      snapshotId:
        type: integer
        format: int64
        description: The id of the snapshot.
      snapshotName:
        type: string
        description: The name of the snapshot.
      targetEnvironmentName:
        type: string
        description: The name of the target environment.
      targetDatabaseName:
        type: string
        description: The name of the target database.
      status:
        description: The status of the restore snapshot.
        $ref: '#/definitions/SnapshotStatusType'
      restoreTime:
        type: integer
        format: int64
        description: The time when the snapshot restore was started.
      commandID:
        type: integer
        format: int64
        description: The submitted Command ID of the restore snapshot.
      failureReason:
        type: string
        description: Reason for the failure in case of restore snapshot failed.
  ListRestoreSnapshotsResponse:
    type: object
    description: Show Restore Snapshots Response.
    required:
      - environmentName
      - databaseName
    properties:
      environmentName:
        type: string
        description: The name of the environment.
      databaseName:
        type: string
        description: The name of the database.
      restoreSnapshots:
        type: array
        items:
          $ref: '#/definitions/RestoreSnapshot'
        description: List of snapshots which have been restored against the database.
  StartDatabaseRequest:
    type: object
    description: Start the database.
    required:
      - environmentName
      - databaseName
    properties:
      environmentName:
        type: string
        description: The name of the environment
      databaseName:
        type: string
        description: The name of the database.
  StartDatabaseResponse:
    type: object
    description: A response from starting the database.
    properties:
      wasStarted:
        type: boolean
        description: True if the database start request accepted
      previousStatus:
        description: The status of the database prior to the start request.
        $ref: '#/definitions/StatusType'
  StopDatabaseRequest:
    type: object
    description: Stop the database.
    required:
      - environmentName
      - databaseName
    properties:
      environmentName:
        type: string
        description: The name of the environment
      databaseName:
        type: string
        description: The name of the database.
  StopDatabaseResponse:
    type: object
    description: A response from stopping the database.
    properties:
      wasStopped:
        type: boolean
        description: True if the database stop request accepted
      previousStatus:
        description: The status of the database prior to the stop request.
        $ref: '#/definitions/StatusType'
  DescribeClientConnectivityRequest:
    type: object
    description: A request for client API connectivity to a database.
    required:
      - environmentName
      - databaseName
    properties:
      environmentName:
        type: string
        description: The name of the environment
      databaseName:
        type: string
        description: The name of the database
  KerberosConfiguration:
    type: object
    description: Configuration information to enable Kerberos authentication
    properties:
      kdcHost:
        type: string
        description: The hostname of the KDC
      realm:
        type: string
        description: The Kerberos realm
      krb5Conf:
        type: string
        description: A base64-encoded krb5.conf file
  Kind:
    type: string
    description: "A categorization of a connector to describe how it is broadly used.\n `LIBRARY` - A client library or API which user's code invokes `JDBC` - A JDBC driver `SERVICE` - A Service URL `ENVIRONMENT` - An environment to use to run other commands and tools `ODBC` - An ODBC driver"
    enum:
      - LIBRARY
      - JDBC
      - SERVICE
      - ENVIRONMENT
  DependencyManagement:
    type: object
    description: Information about dependencies necessary to use a connector.
    properties:
      mavenUrl:
        type: string
        description: The URL of a Maven repository containing the client JARs.
  ClientConfigurationDetails:
    type: object
    description: A URL which holds information necessary to configure a Connector.
    properties:
      name:
        type: string
        description: The name of this configuration
      url:
        type: string
        description: The URL from which to fetch the configuration
  ConnectorConfiguration:
    type: object
    description: Runtime details necessary to use a connector.
    properties:
      clientConfigurationDetails:
        type: array
        items:
          $ref: '#/definitions/ClientConfigurationDetails'
        description: Configuration information required to use a Connector
      jdbcUrl:
        type: string
        description: A base JDBC URL if the connector is a JDBC driver.
      serviceUrl:
        type: string
        description: A base service URL
  Connector:
    type: object
    description: Information to use to connect to a database via some mechanism.
    properties:
      name:
        type: string
        description: The name of the API/Library this connector represents.
      version:
        type: string
        description: The version of the connector.
      kind:
        description: A categorization of this connector.
        $ref: '#/definitions/Kind'
      dependencies:
        description: Software dependency information necessary to use the connector.
        $ref: '#/definitions/DependencyManagement'
      configuration:
        description: Runtime details required to use the connector.
        $ref: '#/definitions/ConnectorConfiguration'
      requiresKerberos:
        type: boolean
        description: True if the connector requires Kerberos to authenticate.
  DescribeClientConnectivityResponse:
    type: object
    description: A response with client API connectivity to a database.
    properties:
      connectors:
        type: array
        items:
          $ref: '#/definitions/Connector'
        description: Available connectors for this database
      kerberosConfiguration:
        description: Kerberos configuration information
        $ref: '#/definitions/KerberosConfiguration'
  UpgradeDatabaseRequest:
    type: object
    description: Asynchronous request to upgrade the CDP Runtime for a database.
    properties:
      environment:
        type: string
        description: The name or CRN of the environment.
      database:
        type: string
        description: The name or CRN of the database.
      runtime:
        type: string
        description: The CDP Runtime version to upgrade to.
      osUpgradeOnly:
        type: boolean
        description: Only perform an Operating System upgrade.
  PrepareUpgradeDatabaseRequest:
    type: object
    description: Asynchronous request to prepare cluster upgrade.
    required:
      - environment
      - database
    properties:
      environment:
        type: string
        description: The name or CRN of the environment.
      database:
        type: string
        description: The name or CRN of the database.
      runtime:
        type: string
        description: The CDP Runtime version to upgrade to.
      imageId:
        type: string
        description: ID of a database image to upgrade to.
  UpgradeDatabaseResponse:
    type: object
    description: Response with the reason whether upgrade request is accepted or why it is not possible.
    properties:
      statusReason:
        type: string
        description: The reason whether upgrade request is accepted or why it is not possible.
  PrepareUpgradeDatabaseResponse:
    type: object
    description: Response with the reason whether prepare upgrade request is accepted or why it is not possible.
    properties:
      statusReason:
        type: string
        description: The reason whether upgrade request is accepted or why it is not possible.
  DescribeUpgradeDatabaseRequest:
    type: object
    description: Request to describe the upgrade availability of CDP Runtime and Operating System for a database.
    required:
      - environment
      - database
    properties:
      environment:
        type: string
        description: The name or CRN of the environment.
      database:
        type: string
        description: The name or CRN of the database.
  DescribeUpgradeDatabaseResponse:
    type: object
    description: Response with upgrade availability of CDP Runtime and Operating System for a database.
    properties:
      statusReason:
        type: string
        description: The reason whether upgrade request is accepted or why it is not possible.
      currentComponentVersion:
        description: Versions of currently deployed CDP runtime and operating system.
        $ref: '#/definitions/ComponentsVersion'
      availableComponentVersions:
        type: array
        items:
          $ref: '#/definitions/ComponentsVersion'
        description: List of available versions for upgrade.
      isOSUpgradeAvailable:
        type: boolean
        description: Is an OS upgrade available.
      isRuntimeUpgradeAvailable:
        type: boolean
        description: Is a CDP Runtime upgrade available.
  ComponentsVersion:
    type: object
    description: Versions of the CDP runtime and Operating system components.
    properties:
      cm:
        type: string
        description: Version of Cloudera Manager.
      cdp:
        type: string
        description: CDP Runtime version.
      os:
        type: string
        description: Operation System name and version.
      osPatchLevel:
        type: string
        description: Operation System patch level.
  Image:
    type: object
    description: Details of an Image.
    properties:
      id:
        type: string
        description: Image ID for the database.
      catalog:
        type: string
        description: Catalog name for the image.
x-audit: true
