Skip to content

Make a database the database of an application

POST
/api/v3/organizations/{organisation}/applications/{application}/database/{instanceId}/promote
curl --request POST \
--url https://dashboard.quantcdn.io/api/v3/organizations/example/applications/example/database/example/promote \
--header 'Authorization: Bearer <token>'

Makes the ready database the one every environment, backup, restore and new environment uses, and redeploys each environment onto it (a brief interruption per environment). The previous database is kept, so promoting it again is the rollback. Take a backup before promoting: the retired database is not reachable through the backups API afterwards. Environments are redeployed within about 15 seconds of the call: redeployed, redeployQueued (not done yet), redeployFailed (with a reason) and upToDate list the outcome, and redeployRequired is failed plus queued. Repeating the request only touches environments not yet on the new revision. Refused with 409, changing nothing, when another database operation holds the application’s lock, when the database is not ready, when a previous database is still kept (delete it first), when an environment has no user on it or its credentials cannot be read (environments lists them), or when it has no endpoint yet. Needs the delete_applications permission and the cloud:delete scope.

organisation
required
string

The organisation ID

application
required
string

The application ID

instanceId
required
string
/^[a-z][a-z0-9-]{0,62}$/

The database instance identifier

The database is now the active database

Media typeapplication/json
object
message
string
orgName
string
appName
string
active

The database now in use.

string
previous

The database kept for rollback. Absent when there was none.

string
environments

Every environment that uses the database.

Array<string>
redeployed

Environments whose service was updated onto a new task definition revision with a forced new deployment.

Array<string>
redeployQueued

Environments whose redeploy did not fit the request’s time budget and was queued. Not done yet; a failure is only logged.

Array<string>
redeployFailed

Environments whose redeploy could not be started. The switch is done; they still run the previous revision, which still works.

Array<object>
object
environment
string
error

A short reason. Never a credential.

string
upToDate

Environments that needed no redeploy: already on the new revision, or without a running service.

Array<string>
redeployRequired

RedeployFailed plus redeployQueued: the environments that still run the previous task definition.

Array<string>
warnings

Environments whose variables could not be updated. Repeat the request.

Array<string>
note
string
Examplegenerated
{
"message": "example",
"orgName": "example",
"appName": "example",
"active": "example",
"previous": "example",
"environments": [
"example"
],
"redeployed": [
"example"
],
"redeployQueued": [
"example"
],
"redeployFailed": [
{
"environment": "example",
"error": "example"
}
],
"upToDate": [
"example"
],
"redeployRequired": [
"example"
],
"warnings": [
"example"
],
"note": "example"
}

The application or the database was not found

Another database operation holds the lock, not ready, a previous database is still kept, or an environment has no user (or unreadable credentials) on it

Media typeapplication/json
object
message
string
operation

409 only: the operation that holds the application’s lock.

string
Allowed values: provision promote delete
requested

409 only: the operation that was refused.

string
Allowed values: provision promote delete
instanceId

409 only: the pending or previous database that blocks the request, or the provision in flight.

string
statusUrl

409 only: for a provision in flight, the path to poll on the platform (this API serves it at the database route).

string
environments

Promote 409 only: the environments that have no user, or unreadable credentials, on the instance.

Array<string>
errors

Delete 500 only: what could not be cleaned up.

Array<string>
Example
{
"operation": "provision",
"requested": "provision"
}

The platform could not complete the request

Media typeapplication/json
object
message
string
operation

409 only: the operation that holds the application’s lock.

string
Allowed values: provision promote delete
requested

409 only: the operation that was refused.

string
Allowed values: provision promote delete
instanceId

409 only: the pending or previous database that blocks the request, or the provision in flight.

string
statusUrl

409 only: for a provision in flight, the path to poll on the platform (this API serves it at the database route).

string
environments

Promote 409 only: the environments that have no user, or unreadable credentials, on the instance.

Array<string>
errors

Delete 500 only: what could not be cleaned up.

Array<string>
Example
{
"operation": "provision",
"requested": "provision"
}

The promote did not answer in time and may have completed. Read the databases, or repeat the promote (it is idempotent)

Media typeapplication/json
object
message
string
operation

409 only: the operation that holds the application’s lock.

string
Allowed values: provision promote delete
requested

409 only: the operation that was refused.

string
Allowed values: provision promote delete
instanceId

409 only: the pending or previous database that blocks the request, or the provision in flight.

string
statusUrl

409 only: for a provision in flight, the path to poll on the platform (this API serves it at the database route).

string
environments

Promote 409 only: the environments that have no user, or unreadable credentials, on the instance.

Array<string>
errors

Delete 500 only: what could not be cleaned up.

Array<string>
Example
{
"operation": "provision",
"requested": "provision"
}