High availability#

Refer to the list of limitations for HA at High availability for Cloud Databases.

Supported datastore versions for HA are MySQL 5.7, MySQL 8.0, Percona 5.7, MariaDB 10.4, and MariaDB 10.4enc.

For information about HA Instance Backups, see the following:

Note

To create an HA instance from an existing replication setup, see Convert replication setup to HA.

This section describes the following API operations that are supported for High Availability (HA) for Cloud Databases.

Create HA database instance#

POST /{version}/{accountId}/ha

This operation creates a new HA instance. The name of the HA instance is a required attribute.

The following tables shows the required and optional attributes for the operation.

Required and optional attributes for Create HA instance#

Name

Type

Description

name

String

(Required) Specifies the name of the HA instance. The length should be limited to 255 characters and any characters are permitted.

datastore

Object

Specifies database version and type for the datastore.

datastore.version

String

(Required) The database software release for the datastore.

datastore.type

String

(Required) The database type for the datastore, for example MYSQL.

replica_source

Object

Specifies properties for the replica.

replica_source.name

String

(Required) Specifies the name for the replica. Refer to the request example for the required json format.

replica_source.flavor

String

(Required) The flavor ID that specifies the database hardware configuration for the replica. You can find the available flavor IDs in the response returned by the List Flavors API operation.

replica_source.volume

String

(Required) Specifies the volume size in gigabytes (GB) for the replica. The value specified must be between 1 and 300.

networks

Comma-separated list

List of networks to be associated with the HA group. For example: {“networks”:[“public”,“servicenet”]} If you do not specify any networks, the value defaults to servicenet`. If you need a public network in addition to servicenet, specify a value. For example, ``"networks": ["public”]. If you want the HA group to have options for both a private servicenet and a public network, specify "networks": ["public", "servicenet"].

acls

Comma-separated list

List of IP based ACLs in the CIDR format. This is required to allow the HA group access to the specified IP. By default, the HA group access is blocked. For example: "acls": [{"address": "10.0.0.0/0"}, {"address": “1.2.3.4/5”}]. Additionally, if it is not specified while creating the HA group, it can be added later. For details, see Add ACLs to an HA instance.

configuration

String

ID of the configuration group.

The following table shows the possible response codes for this operation:

Response Code

Name

Description

202

Accepted

The request has been accepted for processing.

400

Bad Request

The request is missing one or more elements, or the values of some elements are invalid.

401

Unauthorized

You are not authorized to complete this operation. This error can occur if the request is submitted with an invalid authentication token.

403

Forbidden

You are denied access to the requested resource.

404

Not Found

The requested item was not found.

405

badMethod

The specified method is not allowed for the given resource.

413

Over Limit

The number of items returned is above the allowed limit.

422

unprocessableEntity

The item cannot be processed.

500

instanceFault

The instance has experienced a fault.

501

notImplemented

The server does not support the functionality required to fulfill the request.

503

Service Unavailable

The service is not available.

Request#

The following table shows the URI parameters for the request:

Name

Type

Description

{accountId}

String

The account ID of the owner of the specified instance.

Example Create HA database instance: JSON request

POST /v1.0/1234/ha HTTP/1.1
User-Agent: python-troveclient
Host: ord.databases.api.rackspacecloud.com
X-Auth-Token: e3b2c743aebf467fb6b91cbb644c036e
Accept: application/json
Content-Type: application/json
{
   "ha":{
      "datastore":{
         "version":"5.6",
         "type":"MYSQL"
      },
      "replicas":[
         {
            "volume":{
               "size":1
            },
            "flavorRef":"2",
            "name":"source_replica1"
         }
      ],
      "name":"ha-1",
      "networks":[
         "servicenet",
         "public"
      ],
      "configuration": "bbbcdf40-e4cc-423d-8e4b-1f0c7190dac4",
      "acls":[
         {
            "address":"10.0.0.0/0"
         },
         {
            "address":"1.2.3.4/5"
         }
      ],
      "replica_source":[
         {
            "volume":{
               "size":1
            },
            "flavorRef":"2",
            "name":"source"
         }
      ]
   }
}

Response#

Example Create HA database instance: JSON response

HTTP/1.1 202 Accepted
Content-Type: application/json
Via: 1.1 Repose (Repose/2.6.7)
Content-Length: ‘219’
Date: Fri, 08 May 2015 13:03:06 GMT
Server: Jetty(8.0.y.z-SNAPSHOT)

{
   "ha_instance":{
      "name":"ha-1",
      "tenant_id":"1234",
      "volume":{
         "size":1
      },
      "flavor":{
         "id":9,
         "links":[
            {
              "href":"https://ord.databases.api.rackspacecloud.com/v1.0/1234/flavors/9",
               "rel":"self"
            },
            {
               "href":"https://ord.databases.api.rackspacecloud.com/flavors/9",
               "rel":"bookmark"
            }
         ]
      },
      "replicas":[

      ],
      "replica_source":[

      ],
      "configuration":{
         "id":"bbbcdf40-e4cc-423d-8e4b-1f0c7190dac4",
         "links":[
            {
               "href":"https://ord.databases.api.rackspacecloud.com/v1.0/1234/configurations/bbbcdf40-e4cc-423d-8e4b-1f0c7190dac4",
               "rel":"self"
            },
            {
               "href":"https://ord.databases.api.rackspacecloud.com/configurations/bbbcdf40-e4cc-423d-8e4b-1f0c7190dac4",
               "rel":"bookmark"
            }
         ],
         "name":"database-configuration-1"
      },
      "id":"e7fdf90b-7140-4edb-b449-e093d55008fb",
      "state":"BUILD",
      "acls":[

      ],
      "datastore":{
         "version":"5.6",
         "type":"mysql"
      },
      "networks":[

      ]
   }
}

List all HA database instances#

GET /{version}/{accountId}/ha

Lists all the HA database instances.

This operation lists all the HA database instances.

This table shows the possible response codes for this operation:

Response Code

Name

Description

200

Success

Request succeeded.

400

Bad Request

The request is missing one or more elements, or the values of some elements are invalid.

401

Unauthorized

You are not authorized to complete this operation. This error can occur if the request is submitted with an invalid authentication token.

403

Forbidden

You are denied access to the requested resource.

404

Not Found

The requested item was not found.

405

badMethod

The specified method is not allowed for the given resource.

413

Over Limit

The number of items returned is above the allowed limit.

422

unprocessableEntity

The item cannot be processed.

500

instanceFault

The instance has experienced a fault.

501

notImplemented

The server does not support the functionality required to fulfill the request.

503

Service Unavailable

The service is not available.

Request#

This table shows the URI parameters for the request:

Name

Type

Description

{accountId}

String

The account ID of the owner of the specified instance.

This operation does not accept a request body.

Example List all HA database instances: JSON request

The following example shows the List all HA database instances request:

GET /v1.0/1234/ha HTTP/1.1
User-Agent: python-troveclient
Host: ord.databases.api.rackspacecloud.com
X-Auth-Token: e3b2c743aebf467fb6b91cbb644c036e
Accept: application/json
Content-Type: application/json

Response#

Example List all HA database instances: JSON response

The following example shows the List all HA database instances response:

HTTP/1.1 200 OK
Content-Type: application/json
Via: 1.1 Repose (Repose/2.6.7)
Content-Length: ‘2917’
Date: Fri, 08 May 2015 14:53:05 GMT
Server: Jetty(8.0.y.z-SNAPSHOT)

{
   "ha_instances":[
      {
         "state":"DELETION-ERROR",
         "id":"1ca4d721-d194-4e1d-9bef-73608d52a969",
         "datastore":{
            "version":"5.6",
            "type":"mysql"
         },
         "name":"try1-HA-2"
      },
      {
         "state":"ACTIVE",
         "id":"e7fdf90b-7140-4edb-b449-e093d55008fb",
         "datastore":{
            "version":"5.6",
            "type":"mysql"
         },
         "name":"ha-1"
      }
   ]
}

List HA database instance details#

GET /{version}/{accountId}/ha/{haId}

Lists details for a specified HA instance.

This operation lists the details of the specified HA instance.

This table shows the possible response codes for this operation:

Response Code

Name

Description

200

Success

Request succeeded.

400

Bad Request

The request is missing one or more elements, or the values of some elements are invalid.

401

Unauthorized

You are not authorized to complete this operation. This error can occur if the request is submitted with an invalid authentication token.

403

Forbidden

You are denied access to the requested resource.

404

Not Found

The requested item was not found.

405

badMethod

The specified method is not allowed for the given resource.

413

Over Limit

The number of items returned is above the allowed limit.

422

unprocessableEntity

The item cannot be processed.

500

instanceFault

The instance has experienced a fault.

501

notImplemented

The server does not support the functionality required to fulfill the request.

503

Service Unavailable

The service is not available.

Request#

This table shows the URI parameters for the request:

Name

Type

Description

{accountId}

String

The account ID of the owner of the specified instance.

{haId}

String

The ID for the specified HA instance.

This operation does not accept a request body.

Example List HA database instance details: JSON request

The following example shows the List HA instance status and details request:

GET /v1.0/1234/ha/e7fdf90b-7140-4edb-b449-e093d55008fb HTTP/1.1
User-Agent: python-troveclient
Host: ord.databases.api.rackspacecloud.com
X-Auth-Token: e3b2c743aebf467fb6b91cbb644c036e
Accept: application/json
Content-Type: application/json

Response#

Example List HA database instance details: JSON response

The following example shows the List HA instance status and details response:

 HTTP/1.1 200 OK
 Content-Type: application/json
 Via: 1.1 Repose (Repose/2.6.7)
 Content-Length: ‘1885’
 Date: Fri, 08 May 2015 13:25:30 GMT
 Server: Jetty(8.0.y.z-SNAPSHOT)

 {
   "ha_instance":{
    "name":"ha-1",
    "tenant_id":"5919009",
    "volume":{
       "size":1
    },
    "flavor":{
       "id":9,
       "links":[
          {
             "href":"https://ord.databases.api.rackspacecloud.com/v1.0/1234/flavors/9",
             "rel":"self"
          },
          {
             "href":"https://ord.databases.api.rackspacecloud.com/flavors/9",
             "rel":"bookmark"
          }
       ]
    },
    "replicas":[
       {
          "status":"ACTIVE",
          "name":"source_replica1",
          "links":{

          },
          "hostname":"7e51adcbf8ded6ed1d41311e2e449d5836914dc2.ord.rackspaceclouddb.com",
          "id":"4eeeb7a6-0dee-4e66-b433-f6462d45c580",
          "volume":{
             "size":1
          },
          "ha_id":"e7fdf90b-7140-4edb-b449-e093d55008fb",
          "flavor":{
             "id":"2",
             "links":{

             }
          },
          "datastore":{
             "version":"5.6",
             "type":"mysql"
          },
          "replica_of":{
             "id":"82cba72c-26a3-4e61-a4f1-7c65647b1c9f",
             "links":[
                {
                   "href":"https://ord.databases.api.rackspacecloud.com/v1.0/1234/instances/82cba72c-26a3-4e61-a4f1-7c65647b1c9f",
                   "rel":"self"
                },
                {
                   "href":"https://ord.databases.api.rackspacecloud.com/instances/82cba72c-26a3-4e61-a4f1-7c65647b1c9f",
                   "rel":"bookmark"
                }
             ]
          }
       }
    ],
    "replica_source":[
       {
          "status":"ACTIVE",
          "name":"source",
          "links":{

          },
          "replicas":[
             {
                "id":"4eeeb7a6-0dee-4e66-b433-f6462d45c580",
                "links":[
                   {
                      "href":"https://ord.databases.api.rackspacecloud.com/v1.0/1234/instances/4eeeb7a6-0dee-4e66-b433-f6462d45c580",
                      "rel":"self"
                   },
                   {
                      "href":"https://ord.databases.api.rackspacecloud.com/instances/4eeeb7a6-0dee-4e66-b433-f6462d45c580",
                      "rel":"bookmark"
                   }
                ],
                "name":"source_replica1"
             }
          ],
          "hostname":"55036bc3d34c36a44911414d0e92bba071f0bfc8.ord.rackspaceclouddb.com",
          "id":"82cba72c-26a3-4e61-a4f1-7c65647b1c9f",
          "volume":{
             "size":1
          },
          "flavor":{
             "id":"2",
             "links":{

             }
          },
          "datastore":{
             "version":"5.6",
             "type":"mysql"
          },
          "ha_id":"e7fdf90b-7140-4edb-b449-e093d55008fb"
       }
    ],
    "id":"e7fdf90b-7140-4edb-b449-e093d55008fb",
    "state":"ACTIVE",
    "acls":[

    ],
    "datastore":{
       "version":"5.6",
       "type":"mysql"
    },
    "configuration": null,
    "networks":[
       {
          "access":"read",
          "network":"servicenet",
          "port":3307,
          "address":"cdd9187448314cc0b2d33052686ba2c4.publb.ord.rackspaceclouddb.com"
       },
       {
          "access":"write",
          "network":"servicenet",
          "port":3306,
          "address":"cdd9187448314cc0b2d33052686ba2c4.publb.ord.rackspaceclouddb.com"
       }
    ]
  }
}

Delete HA database instance#

DELETE /{version}/{accountId}/ha/{haId}

Deletes an HA database instance.

This operation deletes the specified HA database instance.

This table shows the possible response codes for this operation:

Response Code

Name

Description

202

Accepted

The request has been accepted for processing.

400

Bad Request

The request is missing one or more elements, or the values of some elements are invalid.

401

Unauthorized

You are not authorized to complete this operation. This error can occur if the request is submitted with an invalid authentication token.

403

Forbidden

You are denied access to the requested resource.

404

Not Found

The requested item was not found.

405

badMethod

The specified method is not allowed for the given resource.

413

Over Limit

The number of items returned is above the allowed limit.

422

unprocessableEntity

The item cannot be processed.

500

instanceFault

The instance has experienced a fault.

501

notImplemented

The server does not support the functionality required to fulfill the request.

503

Service Unavailable

The service is not available.

Request#

This table shows the URI parameters for the request:

Name

Type

Description

{accountId}

String

The account ID of the owner of the specified instance.

{haId}

String

The ID for the specified HA instance.

This operation does not accept a request body.

Example Delete HA database instance: JSON request

The following example shows the Delete HA database instance request:

DELETE /v1.0/1234/ha/e7fdf90b-7140-4edb-b449-e093d55008fb HTTP/1.1
User-Agent: python-troveclient
Host: ord.databases.api.rackspacecloud.com
X-Auth-Token: f47d99adabe14bc8bd7bccda88292918
Accept: application/json
Content-Type: application/json

Response#

Example Delete HA database instance: JSON response

The following example shows the Delete HA database instance response:

HTTP/1.1 202 Accepted
Content-Type: application/json
Via: 1.1 Repose (Repose/2.12)
Content-Length: 0
Date: Fri, 08 May 2015 19:36:28 GMT
Connection: close
Server: Jetty(8.0.y.z-SNAPSHOT)

Add ACLs to an HA instance#

POST /{version}/{accountId}/ha/{haId}/acls

Adds Access Control Lists (ACLs) to an HA instance.

This operation adds ACLs to an HA instance.

Note

ACLs cannot be added when the HA instance is building (is in BUILD state).

The following table lists the required and optional attributes for creating ACLs for an HA setup.

Required and optional attributes for Create database#

Name

Description

Required

address

Specifies the CIDR notated IPV4 address. The IPV4 address to use should be CIDR notated.

Yes

This table shows the possible response codes for this operation:

Response Code

Name

Description

200

Success

Request succeeded.

400

Bad Request

The request is missing one or more elements, or the values of some elements are invalid.

401

Unauthorized

You are not authorized to complete this operation. This error can occur if the request is submitted with an invalid authentication token.

403

Forbidden

You are denied access to the requested resource.

404

Not Found

The requested item was not found.

405

badMethod

The specified method is not allowed for the given resource.

413

Over Limit

The number of items returned is above the allowed limit.

422

unprocessableEntity

The item cannot be processed.

500

instanceFault

The instance has experienced a fault.

501

notImplemented

The server does not support the functionality required to fulfill the request.

503

Service Unavailable

The service is not available.

Request#

This table shows the URI parameters for the request:

Name

Type

Description

{accountId}

String

The account ID of the owner of the specified instance.

{haId}

String

The ID for the specified HA instance.

Example Add ACLs to an HA instance: JSON request

The following example shows the Add ACLs to an HA instance request:

POST /v1.0/1234/ha/e7fdf90b-7140-4edb-b449-e093d55008fb/acls HTTP/1.1
User-Agent: python-troveclient
Host: ord.databases.api.rackspacecloud.com
X-Auth-Token: f47d99adabe14bc8bd7bccda88292918
Accept: application/json
Content-Type: application/json

{"address": "1.2.3.4/32"}

Response#

Example Add ACLs to an HA instance: JSON response

The following example shows the Add ACLs to an HA instance response:

HTTP/1.1 200 OK
Content-Type: application/json
Via: 1.1 Repose (Repose/2.12)
Content-Length: 0
Date: Fri, 08 May 2015 19:25:15 GMT
Connection: close
Server: Jetty(8.0.y.z-SNAPSHOT)

List ACLs for an HA instance#

GET /{version}/{accountId}/ha/{haId}/acls

Lists ACLs for an HA instance.

This operation lists ACLs for an HA instance.

This table shows the possible response codes for this operation:

Response Code

Name

Description

200

Success

Request succeeded.

400

Bad Request

The request is missing one or more elements, or the values of some elements are invalid.

401

Unauthorized

You are not authorized to complete this operation. This error can occur if the request is submitted with an invalid authentication token.

403

Forbidden

You are denied access to the requested resource.

404

Not Found

The requested item was not found.

405

badMethod

The specified method is not allowed for the given resource.

413

Over Limit

The number of items returned is above the allowed limit.

422

unprocessableEntity

The item cannot be processed.

500

instanceFault

The instance has experienced a fault.

501

notImplemented

The server does not support the functionality required to fulfill the request.

503

Service Unavailable

The service is not available.

Request#

This table shows the URI parameters for the request:

Name

Type

Description

{accountId}

String

The account ID of the owner of the specified instance.

{haId}

String

The ID for the specified HA instance.

This operation does not accept a request body.

Example List ACLs for an HA instance: JSON request

The following example shows the List ACLs for an HA instance request:

GET /v1.0/1234/ha/e7fdf90b-7140-4edb-b449-e093d55008fb/acls HTTP/1.1
User-Agent: python-troveclient
Host: ord.databases.api.rackspacecloud.com
X-Auth-Token: f47d99adabe14bc8bd7bccda88292918
Accept: application/json
Content-Type: application/json

Response#

Example List ACLs for an HA instance: JSON response

The following example shows the List ACLs for an HA instance response:

HTTP/1.1 200 OK
Content-Type: application/json
Via: 1.1 Repose (Repose/2.12)
Content-Length: 54
Date: Fri, 08 May 2015 19:32:09 GMT
Connection: close
Server: Jetty(8.0.y.z-SNAPSHOT)

{"acls": [{"type": "ALLOW", "address": "1.2.3.4/32"}]}

Delete ACLs from an HA instance#

DELETE /{version}/{accountId}/ha/{haId}/acls/{address}

Deletes ACLs from an HA instance.

This operation deletes ACLs from an HA instance.

This table shows the possible response codes for this operation:

Response Code

Name

Description

202

Accepted

The request has been accepted for processing.

400

Bad Request

The request is missing one or more elements, or the values of some elements are invalid.

401

Unauthorized

You are not authorized to complete this operation. This error can occur if the request is submitted with an invalid authentication token.

403

Forbidden

You are denied access to the requested resource.

404

Not Found

The requested item was not found.

405

badMethod

The specified method is not allowed for the given resource.

413

Over Limit

The number of items returned is above the allowed limit.

422

unprocessableEntity

The item cannot be processed.

500

instanceFault

The instance has experienced a fault.

501

notImplemented

The server does not support the functionality required to fulfill the request.

503

Service Unavailable

The service is not available.

Request#

This table shows the URI parameters for the request:

Name

Type

Description

{accountId}

String

The account ID of the owner of the specified instance.

{haId}

String

The ID for the specified HA instance.

{address}

String

The CIDR notated IPV4 address. The IPV4 address to use should be CIDR notated.

This operation does not accept a request body.

Example Delete ACLs from an HA instance: JSON request

The following example shows the Delete ACLs from an HA instance request:

DELETE /v1.0/1234/ha/e7fdf90b-7140-4edb-b449-e093d55008fb/acls/1.2.3.4%25252F32 HTTP/1.1
User-Agent: python-troveclient
Host: ord.databases.api.rackspacecloud.com
X-Auth-Token: f47d99adabe14bc8bd7bccda88292918
Accept: application/json
Content-Type: application/json

Note

Note that the string “%25252F” near the end of the IP address in the request refers to the special character for the forward slash (‘/’) that is used with the IP address in CIDR format (“1.2.3.4/32”).

Response#

Example Delete ACLs from an HA instance: JSON response

The following example shows the Delete ACLs from an HA instance response:

HTTP/1.1 202 Accepted
Content-Type: application/json
Via: 1.1 Repose (Repose/2.12)
Content-Length: 0
Date: Fri, 08 May 2015 19:36:28 GMT
Connection: close
Server: Jetty(8.0.y.z-SNAPSHOT)

Add replica to an HA instance#

POST /{version}/{accountId}/ha/{haId}/action

Add a replica node to the HA group specified by {ha_id}.

This operation adds a replica node to the HA group specified by {ha_id}. The HA instance goes into the ADDING_REPLICA state as a result of this action. It switches back to ACTIVE once the operation is complete.

Warning

Adding a new replica node would restart the mha manager service (which monitors the source/replica instances to trigger failover) and the haproxy service on the load balancer nodes. Refer to the article for more details about these components: High Availability for Cloud Databases.

The following table lists the required and optional attributes for creating a replica for an HA instance.

This table shows the possible response codes for this operation:

Response Code

Name

Description

202

Accepted

The request has been accepted for processing.

400

Bad Request

The request is missing one or more elements, or the values of some elements are invalid.

401

Unauthorized

You are not authorized to complete this operation. This error can occur if the request is submitted with an invalid authentication token.

403

Forbidden

You are denied access to the requested resource.

404

Not Found

The requested item was not found.

405

badMethod

The specified method is not allowed for the given resource.

413

Over Limit

The number of items returned is above the allowed limit.

422

unprocessableEntity

The item cannot be processed.

500

instanceFault

The instance has experienced a fault.

501

notImplemented

The server does not support the functionality required to fulfill the request.

503

Service Unavailable

The service is not available.

Request#

This table shows the URI parameters for the request:

Name

Type

Description

{accountId}

String

The account ID of the owner of the specified instance.

{haId}

String

The ID for the specified HA instance.

Example Add Replica to an HA instance: JSON request

The following example shows the Add replica to an HA instance request:

POST /v1.0/1234/ha/e7fdf90b-7140-4edb-b449-e093d55008fb/action HTTP/1.1
User-Agent: python-troveclient
Host: ord.databases.api.rackspacecloud.com
X-Auth-Token: f47d99adabe14bc8bd7bccda88292918
Accept: application/json
Content-Type: application/json

{
   "add_replica":{
      "replica_details":{
         "volume":{
            "size":1
         },
         "flavorRef":"2",
         "name":"new-replica2"
      }
   }
}

Response#

Example Add Replica to an HA instance: JSON response

The following example shows the Add replica to an HA instance response:

HTTP/1.1 202 Accepted
Content-Type: application/json
Via: 1.1 Repose (Repose/2.12)
Content-Length: 0
Date: Fri, 31 Jul 2015 16:53:03 GMT
Connection: close
Server: Jetty(8.0.y.z-SNAPSHOT)

Remove replica from an HA instance#

POST /{version}/{accountId}/ha/{haId}/action

Removes a replica node from the HA setup specified by {ha_id}.

This operation removes/detaches a replica node from the HA group. The HA instance goes into the REMOVING_REPLICA state as a result of this action. It switches back to ACTIVE once the operation is complete. The instance that is detached also goes into a DETACH_REPLICA state when it is being disabled as a replica and switches back to ACTIVE once detached.

Warning

Removing a replica node would restart the MHA manager service (which monitors the source/replica instances to trigger failover) and the haproxy service on the load balancer nodes. For more information, see High Availability for Cloud Databases.

Warning

Detaching a replica from the HA setup will cause a MySQL service restart on the detached instance.

The following table lists the required and optional attributes for creating a replica for an HA instance.

This table shows the possible response codes for this operation:

Response Code

Name

Description

202

Accepted

The request has been accepted for processing.

400

Bad Request

The request is missing one or more elements, or the values of some elements are invalid.

401

Unauthorized

You are not authorized to complete this operation. This error can occur if the request is submitted with an invalid authentication token.

403

Forbidden

You are denied access to the requested resource.

404

Not Found

The requested item was not found.

405

badMethod

The specified method is not allowed for the given resource.

413

Over Limit

The number of items returned is above the allowed limit.

422

unprocessableEntity

The item cannot be processed.

500

instanceFault

The instance has experienced a fault.

501

notImplemented

The server does not support the functionality required to fulfill the request.

503

Service Unavailable

The service is not available.

Request#

This table shows the URI parameters for the request:

Name

Type

Description

{accountId}

String

The account ID of the owner of the specified instance.

{haId}

String

The ID for the specified HA instance.

Example Remove Replica from an HA instance: JSON request

The following example shows the Remove replica from an HA instance request:

POST /v1.0/1234/ha/e7fdf90b-7140-4edb-b449-e093d55008fb/action HTTP/1.1
User-Agent: python-troveclient
Host: ord.databases.api.rackspacecloud.com
X-Auth-Token: f47d99adabe14bc8bd7bccda88292918
Accept: application/json
Content-Type: application/json
'{"remove_replica": "130922a2-b9ab-4e95-86be-9c5d79171b5"}'

Response#

Example Remove Replica from an HA instance: JSON response

The following example shows the Remove replica from an HA instance response:

HTTP/1.1 202 Accepted
Content-Type: application/json
Via: 1.1 Repose (Repose/2.12)
Content-Length: 0
Date: Fri, 31 Jul 2015 18:33:09 GMT
Connection: close
Server: Jetty(8.0.y.z-SNAPSHOT)

Resize volume for an HA instance#

POST /{version}/{accountId}/ha/{haId}/action

Resize the volume of an HA instance specified by {ha_id}.

This operation resizes the volume of an HA instance specified by {ha_id}. For the duration of this action, the HA instance goes into a RESIZING_VOLUME state and switches back to ACTIVE once the action is complete across the entire HA cluster.

Only increasing the size is allowed. Resize down is prevented.

This table shows the possible response codes for this operation:

Response Code

Name

Description

202

Accepted

The request has been accepted for processing.

400

Bad Request

The request is missing one or more elements, or the values of some elements are invalid.

401

Unauthorized

You are not authorized to complete this operation. This error can occur if the request is submitted with an invalid authentication token.

403

Forbidden

You are denied access to the requested resource.

404

Not Found

The requested item was not found.

405

badMethod

The specified method is not allowed for the given resource.

413

Over Limit

The number of items returned is above the allowed limit.

422

unprocessableEntity

The item cannot be processed.

500

instanceFault

The instance has experienced a fault.

501

notImplemented

The server does not support the functionality required to fulfill the request.

503

Service Unavailable

The service is not available.

Request#

This table shows the URI parameters for the request:

Name

Type

Description

{accountId}

String

The account ID of the owner of the specified instance.

{haId}

String

The ID for the specified HA instance.

Example Resize volume for an HA instance: JSON request

The following example shows the Resize volume for an HA instance request:

POST /v1.0/1234/ha/c8f07fae-b9d8-48f5-bf86-82cdec547fad/action HTTP/1.1
User-Agent: python-troveclient
Host: iad.databases.api.rackspacecloud.com
X-Auth-Token: f47d99adabe14bc8bd7bccda88292918
Accept: application/json
Content-Type: application/json

{
   "resize_volumes":{
      "size":4
   }
}

Response#

Example Resize volume for an HA instance: JSON response

The following example shows the Resize volume for an HA instance response:

HTTP/1.1 202 Accepted
Content-Type: application/json
Via: 1.1 Repose (Repose/2.12)
Content-Length: 0
Date: Mon, 14 Sep 2015 16:46:48 GMT
Connection: close
Server: Jetty(8.0.y.z-SNAPSHOT)

Resize flavor for an HA instance#

POST /{version}/{accountId}/ha/{haId}/action

Resize the flavor of an HA instance specified by {ha_id}.

This operation resizes the volume of an HA instance specified by {ha_id}. For the duration of this action, the HA instance goes into a RESIZING_FLAVOR state and switches back to ACTIVE once the action is complete.

Warning

Resizing the flavor of the HA cluster would restart the MHA manager service (which monitors the source/replica instances to trigger failover) and the haproxy service on the load balancer nodes. See High Availability for Cloud Databases in the Rackspace for more details about these components.

This table shows the possible response codes for this operation:

Response Code

Name

Description

202

Accepted

The request has been accepted for processing.

400

Bad Request

The request is missing one or more elements, or the values of some elements are invalid.

401

Unauthorized

You are not authorized to complete this operation. This error can occur if the request is submitted with an invalid authentication token.

403

Forbidden

You are denied access to the requested resource.

404

Not Found

The requested item was not found.

405

badMethod

The specified method is not allowed for the given resource.

413

Over Limit

The number of items returned is above the allowed limit.

422

unprocessableEntity

The item cannot be processed.

500

instanceFault

The instance has experienced a fault.

501

notImplemented

The server does not support the functionality required to fulfill the request.

503

Service Unavailable

The service is not available.

Request#

This table shows the URI parameters for the request:

Name

Type

Description

{accountId}

String

The account ID of the owner of the specified instance.

{haId}

String

The ID for the specified HA instance.

Example Resize flavor for an HA instance: JSON request

The following example shows the Resize flavor for an HA instance request:

POST /v1.0/1234/ha/bee7680a-b0bd-4edb-9583-fbac6b59a0cd/action HTTP/1.1
User-Agent: python-troveclient
Host: iad.databases.api.rackspacecloud.com
X-Auth-Token: f47d99adabe14bc8bd7bccda88292918
Accept: application/json
Content-Type: application/json

{"resize_flavor": "3"}

Response#

Example Resize flavor for an HA instance: JSON response

The following example shows the Resize flavor for an HA instance response:

HTTP/1.1 202 Accepted
Content-Type: application/json
Via: 1.1 Repose (Repose/2.12)
Content-Length: 0
Date: Mon, 14 Sep 2015 16:46:48 GMT
Connection: close
Server: Jetty(8.0.y.z-SNAPSHOT)

Restart an HA instance#

POST /{version}/{accountId}/ha/{haId}/action

Restarts an HA instance. During the restart process, the HA Instance goes into a REBOOT state. After the operation completes, the status changes to ACTIVE.

Warning

When the HA Instance Group is started, auto-failover is turned off (MHA stopped), then the mysql service on the replica nodes is restarted followed by the source node. Finally, auto-failover is turned on again. See the High Availability for Cloud Databases article in the Rackspace How To collection.

This table shows the possible response codes for this operation:

Response Code

Name

Description

202

Success

Request succeeded.

400

Bad Request

The request is missing one or more elements, or the values of some elements are invalid.

401

Unauthorized

You are not authorized to complete this operation. This error can occur if the request is submitted with an invalid authentication token.

403

Forbidden

You are denied access to the requested resource.

404

Not Found

The requested item was not found.

405

badMethod

The specified method is not allowed for the given resource.

413

Over Limit

The number of items returned is above the allowed limit.

422

unprocessableEntity

The item cannot be processed.

500

instanceFault

The instance has experienced a fault.

501

notImplemented

The server does not support the functionality required to fulfill the request.

503

Service Unavailable

The service is not available.

Request#

This table shows the URI parameters for the request:

Name

Type

Description

{accountId}

String

The account ID of the owner of the specified instance.

{haId}

String

The ID for the specified HA instance.

Example Restart HA Instance: JSON request

The following example shows the restart HA instance request:

POST /v1.0/1234/ha/3a493f8c-9b9c-4ca1-845b-e3689abb1f5c/action HTTP/1.1
User-Agent: python-troveclient
Host: ord.databases.api.rackspacecloud.com
X-Auth-Token: 87c6033c-9ff6-405f-943e-2deb73f278b7
Accept: application/json
Content-Type: application/json
{

    "restart":{
    }

}

Response#

Example Restart HA Instance: JSON response

The following example shows the restart HA instance response:

HTTP/1.1 202 Accepted
Content-Type: application/json
Via: 1.1 Repose (Repose/2.12)
Content-Length: 0
Date: Tue, 15 Mar 2016 16:36:48 GMT
Connection: close
Server: Jetty(8.0.y.z-SNAPSHOT)

Attach configuration group to HA instance#

PATCH /{version}/{accountId}/ha/{haId}

Attaches a specified configuration group to the HA Instance.

Note

If the configuration group has non-dynamic configuration parameters, the HA instance will be put in a RESTART_REQUIRED state. To enable the parameters on all the nodes (source and replicas of the HA group), restart the HA instance.

This table shows the possible response codes for this operation:

Response Code

Name

Description

202

Success

Request succeeded.

400

Bad Request

The request is missing one or more elements, or the values of some elements are invalid.

401

Unauthorized

You are not authorized to complete this operation. This error can occur if the request is submitted with an invalid authentication token.

403

Forbidden

You are denied access to the requested resource.

404

Not Found

The requested item was not found.

405

badMethod

The specified method is not allowed for the given resource.

413

Over Limit

The number of items returned is above the allowed limit.

422

unprocessableEntity

The item cannot be processed.

500

instanceFault

The instance has experienced a fault.

501

notImplemented

The server does not support the functionality required to fulfill the request.

503

Service Unavailable

The service is not available.

Request#

This table shows the URI parameters for the request:

Name

Type

Description

{accountId}

String

The account ID of the owner of the specified instance.

{haId}

String

The ID for the specified HA instance.

Example Attach Configuration Group to HA Instance: JSON request

The following example shows the attach configuration group to HA Instance request:

PATCH /v1.0/1234/ha/3a493f8c-9b9c-4ca1-845b-e3689abb1f5c HTTP/1.1
User-Agent: python-troveclient
Host: ord.databases.api.rackspacecloud.com
X-Auth-Token: 87c6033c-9ff6-405f-943e-2deb73f278b7
Accept: application/json
Content-Type: application/json
{

    "ha_instance":{
       "configuration": "bbbcdf40-e4cc-423d-8e4b-1f0c7190dac4"
    }

}

Response#

Example Attach Configuration Group to HA Instance: JSON response

The following example shows the attach configuration group to HA Instance response:

HTTP/1.1 202 Accepted
Content-Type: application/json
Via: 1.1 Repose (Repose/2.12)
Content-Length: 0
Date: Tue, 15 Mar 2016 16:13:15 GMT
Connection: close
Server: Jetty(8.0.y.z-SNAPSHOT)

Example List HA database instance details after configuration group attached: JSON response

The following example shows the List HA instance status and details response after configuration group is attached:

 HTTP/1.1 200 OK
 Content-Type: application/json
 Via: 1.1 Repose (Repose/2.6.7)
 Content-Length: ‘1885’
 Date: Fri, 08 May 2015 13:25:30 GMT
 Server: Jetty(8.0.y.z-SNAPSHOT)

 {
   "ha_instance":{
    "name":"ha-1",
    "tenant_id":"5919009",
    "volume":{
       "size":1
    },
    "flavor":{
       "id":9,
       "links":[
          {
             "href":"https://ord.databases.api.rackspacecloud.com/v1.0/1234/flavors/9",
             "rel":"self"
          },
          {
             "href":"https://ord.databases.api.rackspacecloud.com/flavors/9",
             "rel":"bookmark"
          }
       ]
    },
    "replicas":[
       {
          "status":"ACTIVE",
          "name":"source_replica1",
          "links":{

          },
          "hostname":"7e51adcbf8ded6ed1d41311e2e449d5836914dc2.ord.rackspaceclouddb.com",
          "id":"4eeeb7a6-0dee-4e66-b433-f6462d45c580",
          "volume":{
             "size":1
          },
          "ha_id":"e7fdf90b-7140-4edb-b449-e093d55008fb",
          "flavor":{
             "id":"2",
             "links":{

             }
          },
          "datastore":{
             "version":"5.6",
             "type":"mysql"
          },
          "replica_of":{
             "id":"82cba72c-26a3-4e61-a4f1-7c65647b1c9f",
             "links":[
                {
                   "href":"https://ord.databases.api.rackspacecloud.com/v1.0/1234/instances/82cba72c-26a3-4e61-a4f1-7c65647b1c9f",
                   "rel":"self"
                },
                {
                   "href":"https://ord.databases.api.rackspacecloud.com/instances/82cba72c-26a3-4e61-a4f1-7c65647b1c9f",
                   "rel":"bookmark"
                }
             ]
          }
       }
    ],
    "replica_source":[
       {
          "status":"ACTIVE",
          "name":"source",
          "links":{

          },
          "replicas":[
             {
                "id":"4eeeb7a6-0dee-4e66-b433-f6462d45c580",
                "links":[
                   {
                      "href":"https://ord.databases.api.rackspacecloud.com/v1.0/1234/instances/4eeeb7a6-0dee-4e66-b433-f6462d45c580",
                      "rel":"self"
                   },
                   {
                      "href":"https://ord.databases.api.rackspacecloud.com/instances/4eeeb7a6-0dee-4e66-b433-f6462d45c580",
                      "rel":"bookmark"
                   }
                ],
                "name":"source_replica1"
             }
          ],
          "hostname":"55036bc3d34c36a44911414d0e92bba071f0bfc8.ord.rackspaceclouddb.com",
          "id":"82cba72c-26a3-4e61-a4f1-7c65647b1c9f",
          "volume":{
             "size":1
          },
          "flavor":{
             "id":"2",
             "links":{

             }
          },
          "datastore":{
             "version":"5.6",
             "type":"mysql"
          },
          "ha_id":"e7fdf90b-7140-4edb-b449-e093d55008fb"
       }
    ],
    "id":"e7fdf90b-7140-4edb-b449-e093d55008fb",
    "state":"ACTIVE",
    "acls":[

    ],
    "datastore":{
       "version":"5.6",
       "type":"mysql"
    },
    "configuration":{
       "id":"bbbcdf40-e4cc-423d-8e4b-1f0c7190dac4",
       "links":[
          {
             "href":"https://ord.databases.api.rackspacecloud.com/v1.0/1234/configurations/bbbcdf40-e4cc-423d-8e4b-1f0c7190dac4",
             "rel":"self"
          },
          {
             "href":"https://ord.databases.api.rackspacecloud.com/configurations/bbbcdf40-e4cc-423d-8e4b-1f0c7190dac4",
             "rel":"bookmark"
          }
       ],
       "name":"database-configuration-1"
    },
    "networks":[
       {
          "access":"read",
          "network":"servicenet",
          "port":3307,
          "address":"cdd9187448314cc0b2d33052686ba2c4.publb.ord.rackspaceclouddb.com"
       },
       {
          "access":"write",
          "network":"servicenet",
          "port":3306,
          "address":"cdd9187448314cc0b2d33052686ba2c4.publb.ord.rackspaceclouddb.com"
       }
    ]
  }
}

Remove configuration group from HA instance#

PATCH /{version}/{accountId}/ha/{haId}

Detach configuration group from the HA Instance.

Note

If the configuration group has non-dynamic configuration parameters, the HA instance will be put in a RESTART_REQUIRED state. To disable the parameters on all the nodes (source and replicas of the HA group), restart the HA instance.

This table shows the possible response codes for this operation:

Response Code

Name

Description

202

Success

Request succeeded.

400

Bad Request

The request is missing one or more elements, or the values of some elements are invalid.

401

Unauthorized

You are not authorized to complete this operation. This error can occur if the request is submitted with an invalid authentication token.

403

Forbidden

You are denied access to the requested resource.

404

Not Found

The requested item was not found.

405

badMethod

The specified method is not allowed for the given resource.

413

Over Limit

The number of items returned is above the allowed limit.

422

unprocessableEntity

The item cannot be processed.

500

instanceFault

The instance has experienced a fault.

501

notImplemented

The server does not support the functionality required to fulfill the request.

503

Service Unavailable

The service is not available.

Request#

This table shows the URI parameters for the request:

Name

Type

Description

{accountId}

String

The account ID of the owner of the specified instance.

{haId}

String

The ID for the specified HA instance.

Example Remove Configuration Group from HA Instance: JSON request

The following example shows the remove configuration group from HA Instance request:

PATCH /v1.0/1234/ha/3a493f8c-9b9c-4ca1-845b-e3689abb1f5c HTTP/1.1
User-Agent: python-troveclient
Host: ord.databases.api.rackspacecloud.com
X-Auth-Token: 87c6033c-9ff6-405f-943e-2deb73f278b7
Accept: application/json
Content-Type: application/json
{

    "ha_instance":{
       "configuration": ""
    }

}

Response#

Example Remove Configuration Group from HA Instance: JSON response

The following example shows the remove configuration group from HA Instance response:

HTTP/1.1 202 Accepted
Content-Type: application/json
Via: 1.1 Repose (Repose/2.12)
Content-Length: 0
Date: Tue, 15 Mar 2016 16:13:15 GMT
Connection: close
Server: Jetty(8.0.y.z-SNAPSHOT)

Upgrade an HA instance#

POST /{version}/{accountId}/ha/{haId}/action

Upgrades an HA instance to a later datastore version, or in limited cases, to a different datastore type.

You can make the following upgrades:

  • MySQL 5.1 to MySQL 5.7

  • MySQL 5.6 to MySQL 5.7 and MariaDB 10.4enc

  • MariaDB 10/10.1 to MariaDB 10.4

  • MariaDB 10.4 to MariaDB 10.4enc

This operation returns a 202 Accepted response.

This table shows the possible response codes for this operation:

Response Code

Name

Description

202

Success

Request succeeded.

400

Bad Request

The request is missing one or more elements, or the values of some elements are invalid.

401

Unauthorized

You are not authorized to complete this operation. This error can occur if the request is submitted with an invalid authentication token.

403

Forbidden

You are denied access to the requested resource.

404

Not Found

The requested item was not found.

405

badMethod

The specified method is not allowed for the given resource.

413

Over Limit

The number of items returned is above the allowed limit.

422

unprocessableEntity

The item cannot be processed.

500

instanceFault

The instance has experienced a fault.

501

notImplemented

The server does not support the functionality required to fulfill the request.

503

Service Unavailable

The service is not available.

Request#

This table shows the URI parameters for the request:

Name

Type

Description

{accountId}

String

The account ID of the owner of the specified instance.

{haId}

String

The ID for the specified HA instance.

Example Upgrade HA Instance: JSON request

The following example shows the upgrade HA instance request:

POST /v1.0/1234/ha/67a59adb-d678-4092-b9a9-8cbe4ca39b4b/action HTTP/1.1
User-Agent: python-troveclient
Host: ord.databases.api.rackspacecloud.com
X-Auth-Token: 87c6033c-9ff6-405f-943e-2deb73f278b7
Accept: application/json
Content-Type: application/json
{
    "upgrade": {
        "datastore_type": "mysql",
        "datastore_version": "5.7"
    }
}

Response#

Example Upgrade HA Instance: JSON response

The following example shows the upgrade HA instance response:

HTTP/1.1 202 Accepted
Content-Type: application/json
Via: 1.1 Repose (Repose/2.12)
Content-Length: 192
Date: Tue, 15 Mar 2016 16:36:48 GMT
Connection: close

{
    "ha_instance": {
        "tenant_id": "1234",
        "state": "UPGRADING",
        "id": "67a59adb-d678-4092-b9a9-8cbe4ca39b4b",
        "datastore": {
            "version": "5.6",
            "type": "mysql"
        },
        "name": "test-upgrade-ha-mysql56"
    }
}