NAT Configuration Related Interface
If the user's EIP is bound to BCC and there is a need to actively access the external network. The user can configure a NAT instance for VPC where the EIP-bound virtual machine is located, and maintain the ability to actively access the external network after triggering attack scheduling.
Query NAT Configuration List
- Description
Query NAT configuration list.
You can specify vpcId, region for query.
-
Request syntax
GET /v{version}/scheduleNat?vpcId={vpcId}®ion={region}&clientToken={clientToken} HTTP/1.1 Host: adas.baidubce.com Authorization: authorization string
- Request header
There are no other special headers except the public headers.
- Request parameter
Parameter name | Type | Required or not | Parameter position | Description |
---|---|---|---|---|
version | String | Yes | URL parameter | API version number (the current value is 1) |
vpcId | String | No | Query parameter | vpcId to query |
region | String | No | Query parameter | vpc region to query must be a public cloud region |
clientToken | String | Yes | Query parameter | Idempotent Token |
- Response status code
Return 200 on success, see Error Code when return error.
- Response header fields
There are no other special headers except the public headers.
- Response parameter
Parameter name | Type | Description |
---|---|---|
natList | list | Scheduling instance list |
Request example
GET /v1/scheduleNat?region=bj&clientToken=be31b98c-5e41-4838-9830-9be700de5a20 HTTP/1.1
HOST adas.baidubce.com
Authorization bce-auth-v1/5e5a8adf11ae475ba95f1bd38228b44f/2016-04-10T08:26:52Z/1800/host;x-bce-date/ec3c0069f9abb1e247773a62707224124b2b31b4c171133677f9042969791f02
Response example
HTTP/1.1 200 OK
x-bce-request-id: 946002ee-cb4f-4aad-b686-5be55df27f09
Date: Wed, 10 Apr 2016 08:26:52 GMT
Transfer-Encoding: chunked
Content-Type: application/json;charset=UTF-8
Server: BWS
{
"natList": [
{
'natId': 'nat-bu2hiyq4270h',
'vpcId': 'vpc-0h82pc5dvmzc',
'region': 'bj',
},
...
]
}
Add Scheduling NAT
- Description
Add NAT configuration.
Need to enable custom routing white list: RouteOpenSourceAddress.
You must meet requirements in the specified region: The NAT instance of natId must belong to VPC of vpcId, and only one scheduling NAT instance can be configured for a VPC.
-
Request syntax
POST /v{version}/scheduleNat?clientToken={clientToken} HTTP/1.1 Host: adas.baidubce.com Authorization: authorization string
{ 'natId': 'nat-bu2hiyq4270h', 'vpcId': 'vpc-0h82pc5dvmzc', 'region': 'bj', }
- Request header
There are no other special headers except the public headers.
- Request parameter
Parameter name | Type | Required or not | Parameter position | Description |
---|---|---|---|---|
version | String | Yes | URL parameter | API version number (the current value is 1) |
clientToken | String | Yes | Query parameter | Idempotent Token |
natId | String | Yes | RequestBody parameter | natId to add |
vpcId | string | Yes | RequestBody parameter | vpcId of natId |
region | String | Yes | RequestBody parameter | The region to which vpc belongs must be a public cloud region |
- Response status code
Return 200 on success, see Error Code when return error.
- Response header fields
There are no other special headers except the public headers.
- Response parameter
No special return parameters
Request example
POST /v1/scheduleNat?clientToken=be31b98c-5e41-4838-9830-9be700de5a20 HTTP/1.1
HOST adas.baidubce.com
Authorization bce-auth-v1/5e5a8adf11ae475ba95f1bd38228b44f/2016-04-10T08:26:52Z/1800/host;x-bce-date/ec3c0069f9abb1e247773a62707224124b2b31b4c171133677f9042969791f02
{
'natId': 'nat-bu2hiyq4270h',
'vpcId': 'vpc-0h82pc5dvmzc',
'region': 'bj',
}
Response example
HTTP/1.1 200 OK
x-bce-request-id: 946002ee-cb4f-4aad-b686-5be55df27f09
Date: Wed, 10 Apr 2016 08:26:52 GMT
Transfer-Encoding: chunked
Content-Type: application/json;charset=UTF-8
Server: BWS
Delete the Scheduling NAT Configuration
- Description
Delete the NAT configuration.
-
Request syntax
DELETE /v{version}/scheduleNat/{region}/{natId}?clientToken={clientToken} HTTP/1.1 Host: adas.baidubce.com Authorization: authorization string
- Request header
There are no other special headers except the public headers.
- Request parameter
Parameter name | Type | Required or not | Parameter position | Description |
---|---|---|---|---|
version | String | Yes | URL parameter | API version number (the current value is 1) |
[region](DDOS/DDoS ADAS IP/ADAS Automation Schedule API Reference/Appendix 1.md#Region Code Definition) | String | Yes | Query parameter | The region to which nat belongs must be a public cloud region and cannot be private |
natId | String | Yes | Query parameter | natId to delete |
clientToken | String | Yes | Query parameter | Idempotent Token |
- Response status code
Return 200 on success, see Error Code when return error.
- Response header fields
There are no other special headers except the public headers.
- Response parameter
No special return parameters
Request example
DELETE /v1/scheduleNat/bj/nat-bu2hiyq4270h?clientToken=be31b98c-5e41-4838-9830-9be700de5a20 HTTP/1.1
HOST adas.baidubce.com
Authorization bce-auth-v1/5e5a8adf11ae475ba95f1bd38228b44f/2016-04-10T08:26:52Z/1800/host;x-bce-date/ec3c0069f9abb1e247773a62707224124b2b31b4c171133677f9042969791f02
Response example
HTTP/1.1 200 OK
x-bce-request-id: 946002ee-cb4f-4aad-b686-5be55df27f09
Date: Wed, 10 Apr 2016 08:26:52 GMT
Transfer-Encoding: chunked
Content-Type: application/json;charset=UTF-8
Server: BWS