Schedule instance Related Interface
Create a Scheduling Instance
- Description
Create a scheduling instance to bind the scheduled IP.
Two white lists need to be enabled: AadsAutoSchedule (high defense automation scheduling) and RouteOpenSourceAddress (custom routing white list).
Creating a scheduling instance requires identity verification. If you do not pass the identity verification, you can go to the identity verification under the security authentication in Baidu Open Cloud Console for authentication.
-
Request syntax
POST /v{version}/schedule?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) |
clientToken | String | Yes | Query parameter | Idempotent Token |
- Response header fields
There are no other special headers except the public headers.
- Response parameter
Parameter name | Type | Description |
---|---|---|
scheduleId | String | Created scheduling instance id |
Request example
POST /v1/schedule?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
{
"scheduleId":"sche-12345678"
}
Configure a Scheduling Instance
- Description
Configuration can be performed only when the scheduling instance is normal, that is, the status of the scheduling instance must be normal.
Need to specify schedule IP, region, ADAS ID. Among them, if region is private, it means that schedule IP can only be manually scheduled; otherwise, it means that schedule IP can be manually scheduled or use this region to trigger automatic schedule; ADAS ID must be ADAS short ID that can be used by users.
-
Request structure
PUT /v{version}/schedule/private/{scheduleId}?action={action}&clientToken={clientToken} HTTP/1.1 Host: ADAS.baidubce.com Authorization: authorization string
{ "scheduleIp": "182.61.1.1", "region": "private",
"ADASId": "ADAS-5e501b83", } - 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) |
scheduleId | String | Yes | Query parameter | Scheduling instance ID |
action | String | Yes | Query parameter | The action performed on the instance. The value of this parameter is update in this interface. |
clientToken | String | Yes | Query parameter | Idempotent Token |
scheduleIp | String | Yes | RequestBody parameter | Configure the scheduling instance IP: User's private IP |
region | String | Yes | RequestBody parameter | Schedule region |
adasId | String | Yes | RequestBody parameter | User's private ADAS instance ID |
- 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
PUT/v1/schedule/private/sche-1234abcd? action=update&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
{
"scheduleIp": "182.61.1.1",
"region": "private",
"ADASId": "ADAS-5e501b83",
}
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
Query the List of Scheduling Instances
- Description
You can specify schedule IP, region, status, and query the list of scheduling instances with specified conditions.
region must be private.
You can query the scheduling instances in different scheduling states according to the status field.
-
Request syntax
GET /v{version}/schedule?scheduleIp={scheduleIp}®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) |
scheduleIp | String | No | Query parameter | Scheduling instance IP to query is dotted decimal |
region | String | Yes | Query parameter | Query area |
status | String | No | Query parameter | Status of the scheduling instance to query |
marker | String | No | Query parameter | The starting location of query for batch acquisition of lists, and is one string generated by the system. |
maxKeys | int | No | Query parameter | Maximum number contained in each page, generally not exceeding 1000. The default value is 1000. |
clientToken | String | Yes | Query parameter | Idempotent Token |
- Response return 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 |
---|---|---|
scheduleList | list<ScheduleInstanceModel> | Scheduling instance list |
marker | String | Mark the starting position of the query. The item does not exist if the result list is empty |
isTruncated | boolean | True means there are additional data in the following pages and false means the current page is the last page. |
nextMarker | String | The marker value requiring to be passed in order to acquire the next page. The domain doesn't appear when isTruncated is false. |
maxKeys | int | Maximum number contained in each page. |
Request example
GET /v1/schedule?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
{
"nextMarker": "sche-62a7vb3m",
"marker": "sche-1234abcd",
"maxKeys": 1000,
"isTruncated": true,
"scheduleList": [
{
'scheduleId': 'sche-1234abcd',
'scheduleIp': '1.2.3.4',
'region': 'private',
'scheduleBandwidthInGbps': 5,
'cname': '1234abcd.baiduads.com',
'status': "normal",
'rsIp': '180.76.1.1',
'healthCheckPort': 80,
'ADASBgpIp': '180.76.198.100',
'ADASId': 'ADAS-0343ebb9',
'updateTime': "2018-04-23 14:14:16",
'scheduleStartTime': "2018-04-23 14:14:16",
},
...
]
}
Query the Scheduling Instance Details
- Description
Specify the scheduling instance ID to query the scheduling instance details.
-
Request syntax
GET /v{version}/schedule/{scheduleId}?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) |
scheduleId | String | Yes | Query parameter | Scheduling instance ID |
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 |
---|---|---|
schedule | ScheduleInstanceModel | Scheduling instance information |
Request example
GET /v1/schedule/{sche-1234abcd}?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
{
"schedule": {
'scheduleId': 'sche-1234abcd',
'scheduleIp': '1.2.3.4',
'region': 'private',
'scheduleBandwidthInGbps': "5",
'cname': '1234abcd.baiduads.com',
'status': "normal",
'healthCheckPort': "",
'ADASBgpIp': '180.76.198.100',
'ADASId': 'ADAS-0343ebb9',
'updateTime': "2018-04-23 14:14:16",
'scheduleStartTime': "2018-04-23 14:14:16",
}
}
Delete Scheduling Instance
- Description
Delete the scheduling instance.
-
Request syntax
DELETE /v{version}/schedule/{scheduleId}?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) |
scheduleId | String | Yes | Query parameter | Scheduling instance ID |
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/schedule/sche-1234abcd?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
Trigger and Stop Schedule Actions
- Description
When an attack occurs, the schedule is triggered to switch the traffic to the ADAS instance IP.
When an attack ends, the schedule is stopped to switch the traffic to the schedule instance IP.
-
Request syntax
PUT /v{version}/schedule/public/action?clientToken={clientToken} HTTP/1.1 Host: ADAS.baidubce.com Authorization: authorization string
{ "scheduleList": { "sche-1111aaaa": { "message": "ATTACK_STARTED", }, "sche-2222bbbb": { "message": "ATTACK_STOPPED", }, ...
} } - 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) |
scheduleId | String | Yes | Query parameter | Scheduling instance ID |
clientToken | String | Yes | Query parameter | Idempotent Token |
scheduleList | list<ScheduleActionModel> | Yes | RequestBody parameter | List of actions executed by schedule instance |
- Response return 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
PUT /v{version}/schedule/public/action?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
{
"scheduleList": {
"sche-1111aaaa": {
"message": "ATTACK_STARTED",
},
"sche-2222bbbb": {
"message": "ATTACK_STOPPED",
},
...
}
}
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