This API is used to create a protected instance. When a protected instance is created, the default name of the server at the DR site is the same as that of the server at the production site, but their IDs are different. To modify a server name, click the server name on the protected instance details page to switch to the server details page and modify the server name. Alternatively, you can call the API in Changing the Name of a Protected Instance to modify the name.
If the key pair of the production site server has been deleted, create a key pair with the same name.
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
protected_instance |
Yes |
Object |
Specifies the information about a protected instance. For details, see Table 1. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
server_group_id |
Yes |
String |
Specifies the ID of the protection group where a protected instance is added. For details, see Querying Protection Groups. |
server_id |
Yes |
String |
Specifies the ID of the production site server. NOTE:
When the API is successfully invoked, the DR site server will be automatically created. |
name |
Yes |
String |
Specifies the name of a protected instance. The name can contain a maximum of 64 bytes. The value can contain only letters (a to z and A to Z), digits (0 to 9), decimal points (.), underscores (_), and hyphens (-). |
description |
No |
String |
Specifies the description of a protected instance. The description can contain a maximum of 64 bytes. The value cannot contain the left angle bracket (<) or right angle bracket (>). |
primary_subnet_id |
No |
String |
Specifies the network ID of the subnet for the primary NIC on the DR site server. The value is the same as that of neutron_network_id obtained using the VPC API. For details about how to query the subnets, see Querying Subnets. |
primary_ip_address |
No |
String |
Specifies the IP address of the primary NIC on the DR site server. This parameter is valid only when primary_subnet_id is specified. If this parameter is not specified when primary_subnet_id is specified, the system automatically assigns an IP address to the primary NIC on the DR site server |
flavorRef |
No |
String |
Specifies the flavor ID of the DR site server NOTE:
|
tags |
No |
Array of objects |
Specifies the tag list. For details, see Table 2. NOTE:
You can add up to 10 tags for each protected instance. |
{ "protected_instance":{ "server_group_id": "523ab8ad-3759-4933-9436-4cf4ebb20867", "server_id": "403b603d-1d91-42cc-a357-81f3c2daf43f", "name": "test_protected_instance_name", "description": "my description", "primary_subnet_id": "a32217fh-3413-c313-6342-3124d3491502", "primary_ip_address": "192.168.0.5", "flavorRef": "s3.large.2", "tags": [ { "key": "key1", "value":"value1" }, { "key": "key", "value": "value3" } ] } }
Parameter |
Type |
Description |
---|---|---|
job_id |
String |
Specifies the returned parameter when the asynchronous API command is issued successfully. For details about the task execution result, see the description in Querying the Job Status. |
{ "job_id": "0000000062db92d70162db9d200f00bb" }
Or
{ "error": { "message": "XXXX", "code": "XXX" } }
In this example, error represents a general error, including badrequest (shown below) and itemNotFound.
{ "badrequest": { "message": "XXXX", "code": "XXX" } }
Returned Value |
Description |
---|---|
200 |
The server has accepted the request. |
Returned Value |
Description |
---|---|
400 Bad Request |
The server failed to process the request. |
401 Unauthorized |
You must enter a username and the password to access the requested page. |
403 Forbidden |
You are forbidden to access the requested page. |
404 Not Found |
The server could not find the requested page. |
405 Method Not Allowed |
You are not allowed to use the method specified in the request. |
406 Not Acceptable |
The response generated by the server could not be accepted by the client. |
407 Proxy Authentication Required |
You must use the proxy server for authentication so that the request can be processed. |
408 Request Timeout |
The request timed out. |
409 Conflict |
The request could not be processed due to a conflict. |
500 Internal Server Error |
Failed to complete the request because of a service error. |
501 Not Implemented |
Failed to complete the request because the server does not support the requested function. |
502 Bad Gateway |
Failed to complete the request because the server receives an invalid response from an upstream server. |
503 Service Unavailable |
Failed to complete the request because the system is unavailable. |
504 Gateway Timeout |
A gateway timeout error occurred. |