Changing the Protection Status
Function
This API is used to change the protection status.
Calling Method
For details, see Calling APIs.
URI
POST /v5/{project_id}/host-management/protection
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
User project ID Minimum: 1 Maximum: 256 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
enterprise_project_id |
No |
String |
Enterprise project ID. To query all enterprise projects, set this parameter to all_granted_eps. Default: 0 Minimum: 1 Maximum: 256 |
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 a token. Minimum: 1 Maximum: 32768 |
region |
Yes |
String |
region id Minimum: 0 Maximum: 128 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
version |
Yes |
String |
HSS edition. Its value can be:
Minimum: 1 Maximum: 128 |
charging_mode |
No |
String |
Payment mode. This parameter is mandatory when version is not set to hss.version.null.
Minimum: 1 Maximum: 64 |
resource_id |
No |
String |
HSS quota ID. If this parameter is not specified, the quota of the corresponding version is randomly selected. Minimum: 1 Maximum: 128 |
host_id_list |
Yes |
Array of strings |
Server list Minimum: 1 Maximum: 128 Array Length: 0 - 2097152 |
tags |
No |
Array of TagInfo objects |
Resource tag list Array Length: 0 - 2097152 |
Response Parameters
None
Example Requests
Switch the protection edition of the server whose ID is 71a15ecc-049f-4cca-bd28-5e90aca1817f to the basic edition.
{ "version" : "hss.version.basic", "charging_mode" : "packet_cycle", "resource_id" : "af4d08ad-2b60-4916-a5cf-8d6a23956dda", "host_id_list" : [ "71a15ecc-049f-4cca-bd28-5e90aca1817f" ], "tags" : [ { "key" : "Service", "value" : "hss" } ] }
Example Responses
None
Status Codes
Status Code |
Description |
---|---|
200 |
successful response |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.