nav-img
Advanced

Enabling or Disabling WTP

Function

This API is used to enable or disable WTP.

URI

POST /v5/{project_id}/webtamper/static/status

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.

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 user token.

Content-Type

No

String

Default value: application/json; charset=utf-8

region

Yes

String

Region Id

Table 4 Request body parameters

Parameter

Mandatory

Type

Description

status

Yes

Boolean

Whether to enable the function. true: The function is enabled. false: The function is disabled.

host_id_list

Yes

Array of strings

The value in the array is server ID and the server ID cannot be empty.

resource_id

No

String

Resource ID

charging_mode

No

String

Billing mode. The value can be:

  • on_demand: pay-per-use

Response Parameters

None

Example Requests

Enable WTP, set the target server IDs to a, and set the billing mode to pay-per-use.

POST https://{endpoint}/v5/{project_id}/webtamper/static/status
{
"status" : true,
"host_id_list" : [ "a", "b" ],
"resource_id" : "aaxxx",
"charging_mode" : "on_demand"
}

Example Responses

None

Status Codes

Status Code

Description

200

Request succeeded.

Error Codes