Pre-Checking Resources
Function
This API is used to pre-check resources. Before calling this API:
- Learn how to authorize and authenticate it.
- Obtain the required region and endpoint.
URI
POST /v3/{project_id}/resource-check
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID of a tenant in a region. To obtain this value, see Obtaining a Project ID. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the token value. |
Content-Type |
Yes |
String |
Content type. Value: application/json |
X-Language |
No |
String |
Request language type. The default value is en-us. Values:
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
action |
Yes |
String |
Verification type.
|
resource |
Yes |
CheckResourceInfo object |
Resource information. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
enterprise_project_id |
No |
String |
Enterprise project ID. This parameter is mandatory when action is set to createInstance. |
instance_num |
No |
Integer |
Number of instances. This parameter is mandatory when action is set to createInstance. |
mode |
No |
String |
Instance type. Its value is Cluster. This parameter is mandatory when action is set to createInstance. |
availability_zone_mode |
No |
String |
AZ type. The value can be single or multi. This parameter is mandatory when action is set to createInstance. |
node_num |
No |
Integer |
Number of nodes. This parameter is mandatory when action is set to createInstance or createReadonlyNode. |
flavor_ref |
No |
String |
Specification code. This parameter is mandatory when action is set to createInstance or resizeFlavor. |
availability_zone |
No |
String |
AZ code. |
subnet_id |
No |
String |
Subnet ID. This parameter is mandatory when action is set to createInstance. |
instance_id |
No |
String |
Instance ID. This parameter is mandatory when action is set to createReadonlyNode or resizeFlavor. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
result |
Boolean |
Returned result.
|
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Example Request
- Pre-checking resources during instance creation
POST https://{endpoint}/v3/97b026aa9cc4417888c14c84a1ad9860/resource-check { "action" : "createInstance", "resource" : { "enterprise_project_id" : 0, "instance_num" : 1, "mode" : "Cluster", "availability_zone_mode" : "single", "node_num" : 2, "flavor_ref" : "gaussdb.mysql.xlarge.x86.4", "availability_zone" : "cn-southwest-244b", "subnet_id" : "1e9f71dd-9192-4c0d-9739-161d8dcca68c" } }
- Pre-checking resources during read replica creation
POST https://{endpoint}/v3/97b026aa9cc4417888c14c84a1ad9860/resource-check { "action" : "createReadonlyNode", "resource" : { "instance_id" : "376e0847a2224e95afcd3e607eccd544in07", "node_num" : 1 } }
- Pre-checking resources during instance specification change
POST https://{endpoint}/v3/97b026aa9cc4417888c14c84a1ad9860/resource-check { "action" : "resizeFlavor", "resource" : { "instance_id" : "376e0847a2224e95afcd3e607eccd544in07", "flavor_ref" : "gaussdb.mysql.xlarge.x86.4" } }
Example Response
Status code: 200
Success.
{ "result" : true }
Status Code
Status Code |
Description |
---|---|
200 |
Success. |
400 |
Client error. |
500 |
Server error. |
Error Code
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot