Restoring a Cluster
Function
This API is used to restore a cluster using a snapshot.
Calling Method
For details, see Calling APIs.
URI
POST /v1.0/{project_id}/snapshots/{snapshot_id}/actions
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition Project ID. To obtain the value, see Obtaining a Project ID. Constraints N/A Range N/A Default Value N/A |
|
snapshot_id |
Yes |
String |
Definition ID of the snapshot to be restored. Constraints N/A Range N/A Default Value N/A |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
restore |
Yes |
Restore object |
Definition Objects of cluster restoration. Range N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
name |
Yes |
String |
Definition Cluster name. Range The value must be unique. It must contain 4 to 64 characters and start with a letter. Only letters, digits, hyphens (-), and underscores (_) are allowed. |
|
subnet_id |
No |
String |
Definition Subnet ID, which is used for configuring the cluster network. Range The default value is the same as that of the original cluster. |
|
security_group_id |
No |
String |
Definition Security group ID, which is used for configuring the cluster network. The default value is the same as that of the original cluster. Range N/A |
|
vpc_id |
No |
String |
Definition VPC ID, which is used for configuring cluster network. The default value is the same as that of the original cluster. Range N/A |
|
availability_zone |
No |
String |
Definition AZ of the cluster. The default value is the same as that of the original cluster. Range N/A |
|
port |
No |
Integer |
Definition Cluster service port. Range N/A |
|
public_ip |
No |
PublicIp object |
Definition Public IP address. If the parameter is not specified, public connection is not used by default. Range N/A |
|
enterprise_project_id |
No |
String |
Definition Enterprise project ID for a cluster. If this parameter is not specified, the default value 0 (indicating that the ID of the default enterprise project) is used. Constraints N/A Range N/A Default Value 0 |
|
ipv6_enable |
No |
Boolean |
Definition Network protocol type. It indicates whether IPv6 is supported. By default, IPv6 is not used. Range N/A |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
cluster |
Cluster object |
Definition Cluster object. Range N/A |
Example Requests
Restore the snapshot to the new cluster dws-1. (AZ: az1.dc1. Database port: 8000. The subnet ID, security group ID, VPC ID, public IP address, and enterprise ID are specified)
POST https://{Endpoint}/v1.0/89cd04f168b84af6be287f71730fdb4b/snapshots/4ca46bf1-5c61-48ff-b4f3-0ad4e5e3ba90/actions
{
"restore" : {
"name" : "dws-1",
"subnet_id" : "374eca02-cfc4-4de7-8ab5-dbebf7d9a720",
"security_group_id" : "dc3ec145-9029-4b39-b5a3-ace5a01f772b",
"vpc_id" : "85b20d7e-9eb7-4b2a-98f3-3c8843ea3574",
"availability_zone" : "az1.dc1",
"port" : 8000,
"public_ip" : {
"public_bind_type" : "auto_assign",
"eip_id" : ""
},
"enterprise_project_id" : "aca4e50a-266f-4786-827c-f8d6cc3fbada"
}
}
Example Responses
Status code: 200
The request for restoring a cluster is submitted.
{
"cluster" : {
"id" : "7d85f602-a948-4a30-afd4-e84f47471c15"
}
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
The request for restoring a cluster is submitted. |
|
400 |
Request error. |
|
401 |
Authentication failed. |
|
403 |
You do not have required permissions. |
|
404 |
No resources found. |
|
500 |
Internal server error. |
|
503 |
Service unavailable. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.