DBClusters

Learn how to access DBCluster objects via the DNAnexus API.

A license is required to use the Relational Database Service, which provides the functionality described on this page. Contact DNAnexus Sales for more information.

A DBCluster object is used to represent a relational database cluster that exists in the same cloud provider and region as the project it resides within. These databases can be accessed from within DNAnexus jobs at the port and endpoint properties returned when describing the dbcluster. All dbclusters are created with two instances in the cluster to provide high availability for the database operations. If the primary instance should fail, the second instance will be automatically promoted to primary. DBClusters can only exist within a single project, they cannot be cloned.

See the Relational Database Clusters page for more information on the dbcluster service.

DBCluster API Specification

API method: /dbcluster-xxxx/describe

Specification

Describes the specified dbcluster object.

Inputs:

  • project string A project or container ID used as a hint for finding the dbcluster.

  • defaultFields boolean (optional, default false if fields is supplied, true otherwise) Whether to include the default set of fields in the output (the default fields are described in the "Outputs" section below). The selections are overridden by any fields explicitly named in the fields input.

  • fields mapping (optional) Include or exclude specific fields from the output. These selections override settings in defaultFields.

    • key Desired output field. See "Outputs" Section for valid values here

    • value boolean Whether to include the field

Outputs:

  • id string The id of the dbcluster.

    The following fields are included by default (but can be disabled using fields or defaultFields):

  • project string ID of the project or container in which the object was found

  • class string The value "dbcluster"

  • types array of strings Types associated with the object. See the Types page for details

  • created timestamp Time at which this object was created

  • state string Always "open"

  • hidden boolean Whether the object is hidden or not

  • name string The name of the database data object, matches the id

  • folder string The project folder the dbcluster object resides in

  • sponsored boolean Whether the object is sponsored by DNAnexus

  • tags array of strings Tags associated with the object. See the Tags page for details

  • modified timestamp Time at which the user-provided metadata of the object was last modified

  • createdBy mapping How the object was created

    • user string ID of the user who created the object or launched an execution which created the object

  • properties mapping Properties associated with the object

    • key Property name

    • value string Property value

  • details mapping or array Contents of the object’s details

  • status string The status of the database cluster instances. Refer to Relational Databases for possible values and meaning

  • port integer The port this db should be accessed on

  • engineVersion string The engine version this cluster is running, corresponds to AWS Aurora engine versions for MySQL MySQL Versions and PostGres Postgres Versions. Refer to DBCluster Support Matrix for valid dxInstanceClass, engine, and engineVersion combinations

  • engine string The engine this cluster is running

  • dxInstanceClass string The instance class for the instances in the cluster

  • statusAsOf timestamp The timestamp the cluster's status was last updated

  • endpoint string The host endpoint to use when accessing this database from a DNAnexus job

    The following field (included by default) is available if the object is sponsored by a third party:

  • sponsoredUntil timestamp Indicates the expiration time of data sponsorship (this field is only set if the object is currently sponsored, and if set, the specified time is always in the future)

Errors:

  • ResourceNotFound

    • Thrown if the dbcluster is not found in any accessible project

  • InvalidInput

    • The input is not a valid JSON object, other inputs (if supplied) are not of the correct types

  • PermissionDenied

    • Thrown if user does not have VIEW access to the specified project

API method: /dbcluster/new

Specification

Creates a new dbcluster in the specified project.

Inputs:

All of the following inputs are required:

  • name string A user friendly name for the database cluster

  • project string The project ID that the database cluster will be created in

  • engine string The database engine to use (aurora, aurora-mysql, aurora-postgresql)

  • engineVersion string The version of the database engine to use.

    Aurora (mysql) versions:

    MySQL Versions

    Postgresql versions:

    Postgres Versions

  • dxInstanceClass string The DNAnexus instance class for the database instances in this cluster

  • adminPassword string The password associated with the admin user for this cluster. Must be at least 8 characters in length.

    Note: The admin user will have the username 'root' for purposes of connecting to the database

Outputs:

  • id string The id of the dbcluster.

Errors:

  • InvalidInput - Thrown for invalid combinations of dxInstanceClass + engine + engineVersion

  • ResourceNotFound - Thrown if the projectID does not exist

  • PermissionDenied

    • User doesn't have ADMIN access to the project or the org does not have the 'dbcluster' license feature enabled

    • DBCluster pricing is required for the project's billTo in the project's region to create a new DBCluster

    • DBCluster pricing for instance type <> is required for the project's billTo in the project's region to create a new DBCluster that uses this instance type.

API method: /dbcluster-xxxx/stop

Specification

Stops the specified dbcluster. The cluster must be in the 'available' status in order for this call to succeed.

Inputs:

  • None

Outputs:

  • id string The id of the dbcluster.

Errors:

  • InvalidState - Thrown if the cluster is not in the available status.

  • PermissionDenied - User doesn't have ADMIN access to the project or the org does not have the 'dbcluster' license feature enabled

API method: /dbcluster-xxxx/start

Specification

Restarts the specified dbcluster. Can only be called when the dbcluster is in the 'stopped' status.

Inputs:

  • None

Outputs:

  • id string The id of the dbcluster.

Errors:

  • InvalidState - Thrown if the cluster is not in the stopped status.

  • PermissionDenied - User doesn't have ADMIN access to the project or the org does not have the 'dbcluster' license feature enabled

API method: /dbcluster-xxxx/terminate

Specification

Terminates the specified dbcluster. This can only be called when the dbcluster is in the 'available' status as AWS does not allow users to terminate stopped databases.

Note: Once a dbcluster is terminated, the data is no longer accessible from the platform and all the data on the databases will be lost.

Inputs:

  • None

Outputs:

  • id string The id of the dbcluster.

Errors:

  • InvalidState - Thrown if the cluster is not in the 'available' status.

  • PermissionDenied - User doesn't have ADMIN access to the project or the org does not have the 'dbcluster' license feature enabled

Last updated

Copyright 2024 DNAnexus