nav-img
Advanced

Changing the Protection Status

Function

This API is used to change the protection status.

URI

POST /v5/{project_id}/host-management/protection

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

enterprise_project_id

No

String

Enterprise project ID. To query all enterprise projects, set this parameter to all_granted_eps.

Request Parameters

Table 3 Request header 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.

region

Yes

String

Region ID

Table 4 Request body parameters

Parameter

Mandatory

Type

Description

version

Yes

String

HSS edition. Its value can be:

  • hss.version.null: protection disabled

  • hss.version.basic: basic edition

  • hss.version.advanced: professional edition

  • hss.version.enterprise: enterprise edition

  • hss.version.premium: premium edition

  • hss.version.wtp: WTP edition

charging_mode

No

String

Billing mode. This parameter is mandatory when version is not set to hss.version.null.

  • on_demand: pay-per-use

resource_id

No

String

HSS quota ID. If this parameter is not specified, the quota of the corresponding version is randomly selected.

host_id_list

Yes

Array of strings

Server list

tags

No

Array of TagInfo objects

Resource tag list

Table 5 TagInfo

Parameter

Mandatory

Type

Description

key

No

String

Key. It can contain up to 128 Unicode characters. The key cannot be left blank.

value

No

String

Value. Each tag value can contain a maximum of 255 Unicode characters.

Response Parameters

None

Example Requests

Switch the protection edition of the server whose ID is 71a15ecc-049f-4cca-bd28-5e90aca1817f to the enterprise edition.

{
"version" : "hss.version.enterprise",
"charging_mode" : "on_demand",
"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

Request succeeded.

Error Codes