Qovery Databases API

The Databases API from Qovery — 4 operation(s) for databases.

OpenAPI Specification

qovery-databases-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  version: 1.0.4
  title: Qovery Account Info Databases API
  description: '- Qovery is the fastest way to deploy your full-stack apps on any Cloud provider.

    - ℹ️ The API is stable and still in development.

    '
  contact:
    name: Qovery Product Team
    url: https://www.qovery.com
    email: support+api+documentation@qovery.com
  x-logo:
    url: https://console.qovery.com/assets/logos/logo-white.svg
    altText: Qovery
servers:
- url: https://api.qovery.com
security:
- bearerAuth: []
- ApiKeyAuth: []
tags:
- name: Databases
paths:
  /environment/{environmentId}/databaseConfiguration:
    get:
      summary: List eligible database types, versions and modes for the environment
      operationId: listEnvironmentDatabaseConfig
      parameters:
      - $ref: '#/components/parameters/environmentId'
      tags:
      - Databases
      responses:
        '200':
          description: List eligible database
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatabaseConfigurationResponseList'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
  /environment/{environmentId}/database:
    get:
      summary: List environment databases
      operationId: listDatabase
      parameters:
      - $ref: '#/components/parameters/environmentId'
      tags:
      - Databases
      responses:
        '200':
          description: List databases
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatabaseResponseList'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
    post:
      summary: Create a database
      operationId: createDatabase
      parameters:
      - $ref: '#/components/parameters/environmentId'
      tags:
      - Databases
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DatabaseRequest'
      responses:
        '201':
          description: 'Create database '
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Database'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '409':
          description: Database name within the environment is already taken
  /environment/{environmentId}/database/status:
    get:
      summary: List all environment databases statuses
      description: Returns a list of databases with only their id and status.
      operationId: getEnvironmentDatabaseStatus
      parameters:
      - $ref: '#/components/parameters/environmentId'
      tags:
      - Databases
      responses:
        '200':
          description: Get status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReferenceObjectStatusResponseList'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
  /database/{databaseId}/clone:
    post:
      summary: Clone database
      description: This will create a new database with the same configuration on the targeted environment Id.
      operationId: cloneDatabase
      parameters:
      - $ref: '#/components/parameters/databaseId'
      tags:
      - Databases
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CloneServiceRequest'
      responses:
        '202':
          description: Database clone has been requested
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Database'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '409':
          description: Operation is in progress
components:
  schemas:
    ReferenceObject:
      type: object
      required:
      - id
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
    DatabaseModeEnum:
      type: string
      enum:
      - CONTAINER
      - MANAGED
    ServiceLabelRequest:
      type: object
      required:
      - id
      properties:
        id:
          type: string
          format: uuid
    DatabaseVersionMode:
      type: object
      properties:
        name:
          type: string
          example: '10.1'
        supported_mode:
          $ref: '#/components/schemas/DatabaseModeEnum'
    OrganizationAnnotationsGroupScopeEnum:
      type: string
      description: Annotations Group Scope
      enum:
      - DEPLOYMENTS
      - STATEFUL_SETS
      - SERVICES
      - INGRESS
      - GATEWAY_API_ROUTES
      - HPA
      - PODS
      - SECRETS
      - JOBS
      - CRON_JOBS
    ServiceAnnotationsRequestList:
      type: array
      items:
        $ref: '#/components/schemas/ServiceAnnotationRequest'
    DatabaseAccessibilityEnum:
      type: string
      default: PRIVATE
      enum:
      - PRIVATE
      - PUBLIC
    OrganizationLabelsGroupResponse:
      allOf:
      - $ref: '#/components/schemas/Base'
      - type: object
        required:
        - name
        - labels
        properties:
          name:
            type: string
          labels:
            type: array
            items:
              $ref: '#/components/schemas/Label'
      title: ''
    DatabaseConfiguration:
      type: object
      properties:
        database_type:
          $ref: '#/components/schemas/DatabaseTypeEnum'
        version:
          type: array
          items:
            $ref: '#/components/schemas/DatabaseVersionMode'
    CloneServiceRequest:
      type: object
      required:
      - name
      - environment_id
      properties:
        name:
          type: string
        environment_id:
          type: string
          format: uuid
    ServiceAnnotationRequest:
      type: object
      required:
      - id
      properties:
        id:
          type: string
          format: uuid
    DatabaseTypeEnum:
      type: string
      enum:
      - MONGODB
      - MYSQL
      - POSTGRESQL
      - REDIS
    ServiceTypeEnum:
      type: string
      x-stoplight:
        id: d66063cd29913
      description: type of the service (application, database, job, ...)
      enum:
      - APPLICATION
      - DATABASE
      - CONTAINER
      - JOB
      - HELM
      - TERRAFORM
      - ARGOCD_APP
    OrganizationAnnotationsGroupResponse:
      allOf:
      - $ref: '#/components/schemas/Base'
      - type: object
        required:
        - name
        - annotations
        - scopes
        properties:
          name:
            type: string
          annotations:
            type: array
            items:
              $ref: '#/components/schemas/Annotation'
          scopes:
            type: array
            items:
              $ref: '#/components/schemas/OrganizationAnnotationsGroupScopeEnum'
    ReferenceObjectStatusResponseList:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/ReferenceObjectStatus'
    DatabaseConfigurationResponseList:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/DatabaseConfiguration'
    StepMetricStatusEnum:
      type: string
      enum:
      - SUCCESS
      - ERROR
      - CANCEL
      - SKIP
      description: 'The status of completion for the step:

        - SUCCESS: The step completed successfully.

        - ERROR: The step completed with an error.

        - CANCEL: The step was canceled.

        - SKIP: The step was skipped because it was not necessary.

        '
    Label:
      type: object
      required:
      - key
      - value
      - propagate_to_cloud_provider
      properties:
        key:
          type: string
        value:
          type: string
        propagate_to_cloud_provider:
          type: boolean
    ServiceSubActionEnum:
      type: string
      default: NONE
      enum:
      - NONE
      - TERRAFORM_PLAN_ONLY
      - TERRAFORM_PLAN_AND_APPLY
      - TERRAFORM_DESTROY
      - TERRAFORM_FORCE_UNLOCK_STATE
      - TERRAFORM_MIGRATE_STATE
    ServiceLabelsRequestList:
      type: array
      items:
        $ref: '#/components/schemas/ServiceLabelRequest'
    DatabaseRequest:
      type: object
      required:
      - name
      - type
      - version
      - mode
      properties:
        name:
          type: string
          description: name is case insensitive
        description:
          type: string
          description: give a description to this database
        type:
          $ref: '#/components/schemas/DatabaseTypeEnum'
        version:
          type: string
          example: '10.1'
        mode:
          $ref: '#/components/schemas/DatabaseModeEnum'
        accessibility:
          $ref: '#/components/schemas/DatabaseAccessibilityEnum'
        cpu:
          type: integer
          description: 'unit is millicores (m). 1000m = 1 cpu

            This field will be ignored for managed DB (instance type will be used instead).

            '
          default: 250
          example: 1250
        instance_type:
          type: string
          example: db.t3.medium
          description: Database instance type to be used for this database. The list of values can be retrieved via the endpoint /{CloudProvider}/managedDatabase/instanceType/{region}/{dbType}. This field SHOULD NOT be set for container DB.
        memory:
          type: integer
          description: "unit is MB. 1024 MB = 1GB\nThis field will be ignored for managed DB (instance type will be used instead).\nDefault value is linked to the database type:\n- MANAGED: `100`\n- CONTAINER\n  - POSTGRES: `100`\n  - REDIS: `100`\n  - MYSQL: `512`\n  - MONGODB: `256`\n"
          example: 1024
        storage:
          type: integer
          description: unit is GB
          default: 10
        annotations_groups:
          $ref: '#/components/schemas/ServiceAnnotationsRequestList'
        labels_groups:
          $ref: '#/components/schemas/ServiceLabelsRequestList'
        icon_uri:
          type: string
          format: uri
          description: Icon URI representing the database.
          x-stoplight:
            id: ls6yevnhskd5y
    OrganizationLabelsGroupResponseList:
      type: array
      items:
        $ref: '#/components/schemas/OrganizationLabelsGroupResponse'
      title: ''
    ServiceStepMetric:
      type: object
      properties:
        step_name:
          $ref: '#/components/schemas/ServiceStepMetricNameEnum'
        status:
          $ref: '#/components/schemas/StepMetricStatusEnum'
        duration_sec:
          description: The duration of the step in seconds.
          type: integer
    DatabaseResponseList:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/Database'
    Database:
      allOf:
      - $ref: '#/components/schemas/Base'
      - $ref: '#/components/schemas/DatabaseRequest'
      - type: object
        required:
        - environment
        - icon_uri
        - service_type
        properties:
          environment:
            $ref: '#/components/schemas/ReferenceObject'
          host:
            type: string
          port:
            type: integer
            example: 5432
          maximum_cpu:
            type: integer
            description: Maximum cpu that can be allocated to the database based on organization cluster configuration. unit is millicores (m). 1000m = 1 cpu
            example: 1250
          maximum_memory:
            type: integer
            description: Maximum memory that can be allocated to the database based on organization cluster configuration. unit is MB. 1024 MB = 1GB
            example: 1024
          disk_encrypted:
            type: boolean
            description: indicates if the database disk is encrypted or not
          instance_type:
            type: string
            example: db.t3.medium
            description: Database instance type to be used for this database. The list of values can be retrieved via the endpoint /{CloudProvider}/managedDatabase/instanceType/{region}/{dbType}. This field is null for container DB.
          disk_type:
            type: string
            nullable: true
            description: EBS disk type for the database. Only applicable for MANAGED mode (gp2 or gp3). Null for CONTAINER mode.
            enum:
            - gp2
            - gp3
          annotations_groups:
            $ref: '#/components/schemas/OrganizationAnnotationsGroupResponseList'
          labels_groups:
            $ref: '#/components/schemas/OrganizationLabelsGroupResponseList'
          icon_uri:
            type: string
            format: uri
            description: Icon URI representing the database.
          service_type:
            $ref: '#/components/schemas/ServiceTypeEnum'
    Annotation:
      type: object
      required:
      - key
      - value
      properties:
        key:
          type: string
        value:
          type: string
    ServiceDeploymentStatusEnum:
      type: string
      enum:
      - NEVER_DEPLOYED
      - OUT_OF_DATE
      - UP_TO_DATE
    ServiceStepMetricNameEnum:
      type: string
      enum:
      - REGISTRY_CREATE_REPOSITORY
      - GIT_CLONE
      - BUILD_QUEUEING
      - BUILD
      - DEPLOYMENT_QUEUEING
      - DEPLOYMENT
      - ROUTER_DEPLOYMENT
      - MIRROR_IMAGE
      - EXECUTING
      description: "The name of the deployment step at the service level:\n- REGISTRY_CREATE_REPOSITORY: The step to create the repository in the registry.\n- GIT_CLONE: The step to clone the source code repository. \n- BUILD_QUEUEING: The queuing time preceding the actual building step.\n- BUILD: The step to build the source code.\n- DEPLOYMENT_QUEUEING: The queuing time preceding the actual deployment step.\n- DEPLOYMENT: The step to deploy the service. \n- ROUTER_DEPLOYMENT: The step to deploy the router. \n- MIRROR_IMAGE: The step to mirror the image to the private registry.\n- EXECUTING: The step to execute a job or terraform apply.\n"
    ServiceStepMetrics:
      type: object
      required:
      - total_duration_sec
      - total_computing_duration_sec
      - details
      properties:
        total_duration_sec:
          description: The total duration in seconds of the service deployment or null if the deployment is not completed.
          type: integer
          nullable: true
        total_computing_duration_sec:
          description: The total duration in seconds of the service deployment without queuing steps.
          type: integer
        details:
          description: A list of metrics for deployment steps of the service.
          type: array
          items:
            $ref: '#/components/schemas/ServiceStepMetric'
    ServiceActionEnum:
      type: string
      enum:
      - DEPLOY
      - DELETE
      - RESTART
      - STOP
      - UNKNOWN
    ReferenceObjectStatus:
      allOf:
      - $ref: '#/components/schemas/ReferenceObject'
      - $ref: '#/components/schemas/Status'
    StateEnum:
      type: string
      enum:
      - BUILDING
      - BUILD_ERROR
      - CANCELED
      - CANCELING
      - DELETED
      - DELETE_ERROR
      - DELETE_QUEUED
      - DELETING
      - DEPLOYED
      - DEPLOYING
      - DEPLOYMENT_ERROR
      - DEPLOYMENT_QUEUED
      - EXECUTING
      - QUEUED
      - READY
      - RECAP
      - RESTARTED
      - RESTARTING
      - RESTART_ERROR
      - RESTART_QUEUED
      - STOPPED
      - STOPPING
      - STOP_ERROR
      - STOP_QUEUED
      - UNAVAILABLE
      - WAITING_DELETING
      - WAITING_RESTARTING
      - WAITING_RUNNING
      - WAITING_STOPPING
    OrganizationAnnotationsGroupResponseList:
      type: array
      items:
        $ref: '#/components/schemas/OrganizationAnnotationsGroupResponse'
    Status:
      type: object
      required:
      - id
      - state
      - service_deployment_status
      - status_details
      - is_part_last_deployment
      - deployment_requests_count
      - deployment_request_id
      properties:
        id:
          type: string
          format: uuid
        state:
          $ref: '#/components/schemas/StateEnum'
        service_deployment_status:
          $ref: '#/components/schemas/ServiceDeploymentStatusEnum'
        last_deployment_date:
          type: string
          format: date-time
        is_part_last_deployment:
          type: boolean
        steps:
          $ref: '#/components/schemas/ServiceStepMetrics'
        execution_id:
          type: string
          x-stoplight:
            id: 3o9tz4272s2ct
        status_details:
          $ref: '#/components/schemas/StatusDetails'
        deployment_request_id:
          type: string
          x-stoplight:
            id: bepixrb7tyzme
          format: uuid
          nullable: true
        deployment_requests_count:
          type: integer
          x-stoplight:
            id: crku532vt3v4p
    ServiceActionStatusEnum:
      type: string
      enum:
      - QUEUED
      - ONGOING
      - SUCCESS
      - ERROR
      - EXECUTING
      - CANCELED
      - CANCELING
      - NEVER
    Base:
      type: object
      required:
      - id
      - created_at
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        created_at:
          type: string
          readOnly: true
          format: date-time
        updated_at:
          type: string
          readOnly: true
          format: date-time
    StatusDetails:
      type: object
      required:
      - action
      - status
      - sub_action
      properties:
        action:
          $ref: '#/components/schemas/ServiceActionEnum'
        status:
          $ref: '#/components/schemas/ServiceActionStatusEnum'
        sub_action:
          $ref: '#/components/schemas/ServiceSubActionEnum'
  parameters:
    environmentId:
      name: environmentId
      in: path
      description: Environment ID
      required: true
      schema:
        type: string
        format: uuid
    databaseId:
      name: databaseId
      in: path
      description: Database ID
      required: true
      schema:
        type: string
        format: uuid
  responses:
    '400':
      description: Bad request
    '403':
      description: Access forbidden
    '404':
      description: Resource not found
    '401':
      description: Access token is missing or invalid
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'JWT tokens should be used with OIDC account (human to machine). JWT tokens used by the Qovery console to communicate with the API have a TTL. Curl Example '' curl https://console.qovery.com/organization -H "Authorization: Bearer $qovery_token" '''
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'Token API are generated by Qovery to manage machine to machine interaction and do not have a TTL. Curl Example '' curl https://console.qovery.com/organization -H "Authorization: Token $qovery_token" '''
x-tagGroups:
- name: Organization
  tags:
  - Organization Main Calls
  - Organization Api Token
  - Organization Account Git Repositories
  - Organization Cluster Lock
  - Organization Webhook
  - Organization Custom Role
  - Organization Event
  - Organization Annotations Group
  - Organization Labels Group
  - Organization Enterprise Connection
  - Projects
  - Members
  - Billing
  - Clusters
  - Cloud Provider
  - Cloud Provider Credentials
  - Github App
  - Container Registries
  - Helm Repositories
- name: Project
  tags:
  - Project Main Calls
  - Environments
  - Project Deployment Rule
  - Project Environment Variable
  - Project Secret
- name: Environment
  tags:
  - Environment Main Calls
  - Applications
  - Containers
  - Databases
  - Jobs
  - Helms
  - Terraforms
  - Environment Actions
  - Environment Logs
  - Environment Deployment History
  - Environment Deployment Rule
  - Environment Variable
  - Environment Secret
  - Environment Export
- name: Deployment Stage
  tags:
  - Deployment Stage Main Calls
- name: Application
  tags:
  - Application Main Calls
  - Application Actions
  - Application Configuration
  - Application Custom Domain
  - Application Database
  - Application Logs
  - Application Deployment Restriction
  - Application Deployment History
  - Application Environment Variable
  - Application Secret
  - Application Annotations Group
- name: Container
  tags:
  - Container Main Calls
  - Container Actions
  - Container Configuration
  - Container Custom Domain
  - Container Database
  - Container Logs
  - Container Deployment History
  - Container Environment Variable
  - Container Secret
  - Container Annotations Group
- name: Database
  tags:
  - Database Main Calls
  - Database Actions
  - Database Applications
  - Database Deployment History
  - Database Containers
  - Database Application
  - Database Container
  - Backups
  - Database Annotations Group
- name: Job
  tags:
  - Job Main Calls
  - Job Actions
  - Job Configuration
  - Job Custom Domain
  - Job Deployment Restriction
  - Job Deployment History
  - Job Environment Variable
  - Job Secret
  - Job Annotations Group
- name: Helm
  tags:
  - Helm Main Calls
  - Helm Actions
  - Helm Configuration
  - Helm Custom Domain
  - Helm Deployment Restriction
  - Helm Deployment History
- name: Terraform
  tags:
  - Terraform Main Calls
  - Terraform Actions
  - Terraform Configuration
  - Terraform Deployment Restriction
  - Terraform Deployment History
- name: Account
  tags:
  - Account Info
  - Git repositories
  - Referral & Rewards
- name: Git
  tags:
  - Git repositories
- name: Variable
  tags:
  - Variable Main Calls
- name: Lifecycle Template
  tags:
  - Lifecycle Template Main Calls
- name: Admin
  tags:
  - User Sign Up
- name: Alerting
  tags:
  - Alert Receivers
  - Alert Rules