REST API for inline and sideband ASE
ASE REST API allows you to manage adding, removing, and modifying your backend servers. The REST API payload uses a JSON format. REST API also helps in integrating ASE with third-party products. The default port for ASE REST API is 8010.
The following is a list of formats for ASE’s REST APIs:
-
Create API (POST) – Inline and sideband ASE
-
Read API (GET) – Inline and sideband ASE
-
List API (GET) – Inline and sideband ASE
-
Update API (PUT) – Inline and sideband ASE
-
Create server (POST) – Inline ASE
-
Read server (GET) – Inline ASE
-
Delete server (DELETE) – Inline ASE
-
Read cluster (GET) – Inline ASE
-
Read persistent connections (GET) – Inline ASE
-
Read firewall status (GET) – Inline and sideband ASE
-
Update firewall status (POST) – Inline and sideband ASE
-
Add attack type to blacklist (POST) – Inline and sideband ASE
-
Delete attack type from the whitelist (DELETE) – Inline and sideband ASE
-
Clear the blacklist (DELETE) – Inline and sideband ASE
-
View blacklist (GET) – Inline and sideband ASE
-
Add attack type to whitelist (POST) – Inline and sideband ASE
-
Delete attack type from the whitelist (DELETE) – Inline and sideband ASE
-
Clear whitelist (DELETE) – Inline and sideband ASE
-
View whitelist (POST) – Inline and sideband ASE
-
Read flow control of an API (GET)– Inline ASE
-
Update flow control for an API (POST) – Inline ASE
-
Update flow control for a server of an API (POST) – Inline ASE
Common request headers
Header | Value | ||
---|---|---|---|
|
admin
|
||
|
<Secret Key>
|
||
|
|
Create API (POST)
Request
|
|
|
|
|
|
|
|
|
|
REST API request
{
"api_metadata": {
"protocol": "http",
"url": "/your_rest_api",
"hostname": "*",
"cookie": "",
"cookie_idle_timeout": "200m",
"logout_api_enabled": false,
"cookie_persistence_enabled": false,
"oauth2_access_token": false,
"apikey_qs": "",
"apikey_header": "",
"login_url": "",
"enable_blocking": true,
"api_mapping": {
"internal_url": ""
},
"api_pattern_enforcement": {
"protocol_allowed": "",
"http_redirect": {
"response_code": "",
"response_def": "",
"https_url": ""
},
"methods_allowed": [],
"content_type_allowed": "",
"error_code": "401",
"error_def": "Unauthorized",
"error_message_body": "401 Unauthorized"
},
"flow_control": {
"client_spike_threshold": "0/second",
"server_connection_queueing": false
},
"api_memory_size": "128mb",
"health_check": true,
"health_check_interval": 60,
"health_retry_count": 4,
"health_url": "/health",
"server_ssl": false,
"servers": [
{
"host": "127.0.0.1",
"port": 8080,
"server_spike_threshold": "0/second",
"server_connection_quota": 0
},
{
"host": "127.0.0.1",
"port": 8081,
"server_spike_threshold": "0/second",
"server_connection_quota": 0
}
],
"decoy_config": {
"decoy_enabled": false,
"response_code": 200,
"response_def": "",
"response_message": "",
"decoy_subpaths": []
}
}
}
WebSocket API request
{
"api_metadata": {
"protocol": "ws",
"url": "/your_websocket_api",
"hostname": "*",
"cookie": "",
"cookie_idle_timeout": "200m",
"logout_api_enabled": false,
"cookie_persistence_enabled": false,
"oauth2_access_token": false,
"apikey_qs": "",
"apikey_header": "",
"login_url": "",
"enable_blocking": true,
"api_mapping": {
"internal_url": ""
},
"api_pattern_enforcement": {
"protocol_allowed": "",
"http_redirect": {
"response_code": "",
"response_def": "",
"https_url": ""
},
"methods_allowed": [],
"content_type_allowed": "",
"error_code": "401",
"error_def": "Unauthorized",
"error_message_body": "401 Unauthorized"
},
"flow_control": {
"client_spike_threshold": "0/second",
"bytes_in_threshold": "0/second",
"bytes_out_threshold": "0/second",
"server_connection_queueing": false
},
"api_memory_size": "128mb",
"health_check": true,
"health_check_interval": 60,
"health_retry_count": 4,
"health_url": "/health",
"server_ssl": false,
"servers": [
{
"host": "127.0.0.1",
"port": 8080,
"server_connection_quota": 0
},
{
"host": "127.0.0.1",
"port": 8081,
"server_connection_quota": 0
}
],
"decoy_config": {
"decoy_enabled": false,
"response_code": 200,
"response_def": "",
"response_message": "",
"decoy_subpaths": []
}
}
}
Response
HTTP Code | Status | Content body (application/json) |
---|---|---|
|
|
|
|
|
|
|
|
|
Read API (GET)
Request
|
|
|
|
|
|
|
|
Response
HTTP Code | Status | Content body (application/json) |
---|---|---|
|
|
REST API
WebSocket API
|
|
|
|
List API (GET)
Request
|
|
|
|
|
|
|
|
Response
HTTP Code | Status | Content body (application/json) |
---|---|---|
|
|
|
|
|
|
Update API (PUT)
Request
|
|
|
|
|
|
|
|
|
|
REST API request
{
"api_metadata": {
"protocol": "http",
"url": "/your_rest_api",
"hostname": "*",
"cookie": "",
"cookie_idle_timeout": "200m",
"logout_api_enabled": false,
"cookie_persistence_enabled": false,
"oauth2_access_token": false,
"apikey_qs": "",
"apikey_header": "",
"login_url": "",
"enable_blocking": true,
"api_mapping": {
"internal_url": ""
},
"api_pattern_enforcement": {
"protocol_allowed": "",
"http_redirect": {
"response_code": "",
"response_def": "",
"https_url": ""
},
"methods_allowed": [],
"content_type_allowed": "",
"error_code": "401",
"error_def": "Unauthorized",
"error_message_body": "401 Unauthorized"
},
"flow_control": {
"client_spike_threshold": "0/second",
"server_connection_queueing": false
},
"api_memory_size": "128mb",
"health_check": true,
"health_check_interval": 60,
"health_retry_count": 4,
"health_url": "/health",
"server_ssl": false,
"servers": [
{
"host": "127.0.0.1",
"port": 8080,
"server_spike_threshold": "0/second",
"server_connection_quota": 0
},
{
"host": "127.0.0.1",
"port": 8081,
"server_spike_threshold": "0/second",
"server_connection_quota": 0
}
],
"decoy_config": {
"decoy_enabled": false,
"response_code": 200,
"response_def": "",
"response_message": "",
"decoy_subpaths": []
}
}
}
WebSocket API request
{
"api_metadata": {
"protocol": "ws",
"url": "/your_websocket_api",
"hostname": "*",
"cookie": "",
"cookie_idle_timeout": "200m",
"logout_api_enabled": false,
"cookie_persistence_enabled": false,
"oauth2_access_token": false,
"apikey_qs": "",
"apikey_header": "",
"login_url": "",
"enable_blocking": true,
"api_mapping": {
"internal_url": ""
},
"api_pattern_enforcement": {
"protocol_allowed": "",
"http_redirect": {
"response_code": "",
"response_def": "",
"https_url": ""
},
"methods_allowed": [],
"content_type_allowed": "",
"error_code": "401",
"error_def": "Unauthorized",
"error_message_body": "401 Unauthorized"
},
"flow_control": {
"client_spike_threshold": "0/second",
"bytes_in_threshold": "0/second",
"bytes_out_threshold": "0/second",
"server_connection_queueing": false
},
"api_memory_size": "128mb",
"health_check": true,
"health_check_interval": 60,
"health_retry_count": 4,
"health_url": "/health",
"server_ssl": false,
"servers": [
{
"host": "127.0.0.1",
"port": 8080,
"server_connection_quota": 0
},
{
"host": "127.0.0.1",
"port": 8081,
"server_connection_quota": 0
}
],
"decoy_config": {
"decoy_enabled": false,
"response_code": 200,
"response_def": "",
"response_message": "",
"decoy_subpaths": []
}
}
}
Response
HTTP Code | Status | Content body (application/json) |
---|---|---|
|
|
|
|
|
|
Delete API (DELETE)
Request
|
|
|
<Access Key> |
|
|
|
|
Response
HTTP Code | Status | Content body (application/json) |
---|---|---|
|
|
|
|
|
|
Create server (POST)
Request
|
|
|
|
|
|
|
|
|
|
REST API request
{
"server":
{
"host": "192.168.1.100",
"port": 8080,
"server_spike_threshold": "1/second",
"server_connection_quota": 100
}
}
WebSocket API Request
{
"server":
{
"host": "192.168.1.100",
"port": 8080,
"server_connection_quota": 100
}
}
Response
HTTP Code | Status | Content body (application/json) |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Read server (GET)
Request
|
|
|
|
|
|
|
|
Response
HTTP Code | Status | Content body (application/json) |
---|---|---|
|
|
REST API
WebSocket API
|
|
|
|
Delete server (DELETE)
Request
|
|
|
|
|
|
|
|
|
|
{
“server”:
{
"host" : “192.168.1.100”,
"port" : 8080
}
}
Response
HTTP Code | Status | Content body (application/json) |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Read cluster (GET)
Request
|
|
|
|
|
|
|
|
Response
HTTP Code | Status | Content body (application/json) |
---|---|---|
|
|
|
|
|
|
Read persistent connections (GET)
Request
|
|
|
|
|
|
|
|
Response
HTTP Code | Status | Content body (application/json) |
---|---|---|
|
|
|
|
|
|
Read firewall status (GET)
Request
|
|
|
<Access Key> |
|
<Secret Key> |
|
|
Response
HTTP code | Status | Content body (application/json) |
---|---|---|
|
|
|
Update firewall status (POST)
Request
|
|
|
<Access Key> |
|
<Secret Key> |
|
|
Response
HTTP Code | Status | Content body (application/json) |
---|---|---|
|
|
If there is a status change
If there is no change in status
|
|
|
|
Add attack type to blacklist (POST)
Request
|
|
|
<Access Key> |
|
<Secret Key> |
|
|
===============for IP=============== { "type" : "ip", "value" : "1.1.1.1" } ===============for Token============= { "type" : "token", "value" : "sadjhasiufgkjdsbfkgfa" } =============for Cookie/api_key======= { "type" : "cookie/token/api_key", "name" : "JSESSIONID", "value" : "ljkhasioutfdqbjsfdmakhflia" }
Response
Status code | Response body |
---|---|
|
Cookie |
|
Cookie |
|
|
|
|
|
|
|
|
|
|
|
|
Delete attack type to blacklist (DELETE)
Request
|
|
|
<Access Key> |
|
<Secret Key> |
|
|
===============for IP=============== { "type" : "ip", "value" : "1.1.1.1" } ===============for Token============= { "type" : "token", "value" : "sadjhasiufgkjdsbfkgfa" } =============for Cookie/api_key======= { "type" : "cookie/token/api_key", "name" : "JSESSIONID", "value" : "ljkhasioutfdqbjsfdmakhflia" }
Response
Status code | Response body |
---|---|
|
Cookie |
|
Cookie |
|
|
|
|
|
|
|
|
|
|
|
|
Clear the blacklist (DELETE)
Request
|
|
|
<Access Key> |
|
<Secret Key> |
|
|
Response
Status code | Response body |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
View blacklist (GET)
Request
|
|
|
|
|
<Access Key> |
|
<Secret Key> |
|
|
Response
Status code | Response body |
---|---|
|
|
|
Cookie |
|
|
|
|
|
|
|
|
|
|
Add attack type to whitelist (POST)
Request
|
|
|
<Access Key> |
|
<Secret Key> |
|
|
===============for IP=============== { "type" : "ip", "value" : "1.1.1.1" } ===============for Token============= { "type" : "token", "value" : "sadjhasiufgkjdsbfkgfa" } =============for Cookie/api_key======= { "type" : "cookie/token/api_key", "name" : "JSESSIONID", "value" : "ljkhasioutfdqbjsfdmakhflia" }
Response
Status code | Response body |
---|---|
|
Cookie |
|
Cookie |
|
|
|
|
|
|
|
|
|
|
|
|
Delete attack type from the whitelist (DELETE)
Request
|
|
|
<Access Key> |
|
<Secret Key> |
|
|
===============for IP=============== { "type" : "ip", "value" : "1.1.1.1" } ===============for Token============= { "type" : "token", "value" : "sadjhasiufgkjdsbfkgfa" } =============for Cookie/api_key======= { "type" : "cookie/token/api_key", "name" : "JSESSIONID", "value" : "ljkhasioutfdqbjsfdmakhflia" }
Response
Status code | Response body |
---|---|
|
Cookie |
|
Cookie |
|
|
|
|
|
|
|
|
|
|
|
|
Clear whitelist (DELETE)
Request
|
|
|
<Access Key> |
|
<Secret Key> |
|
|
Response
Status code | Response body |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
View whitelist (POST)
Request
|
|
|
<Access Key> |
|
<Secret Key> |
|
|
Response
Status code | Response body |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Read flow control of an API (GET)
Request
|
|
|
<Access Key> |
|
<Secret Key> |
|
|
Response
HTTP code | Status | Content body (application/json) |
---|---|---|
|
|
Flow control for REST API
Flow control for WebSocket API
|
|
|
|
|
|
|
Update flow control for an API (POST)
Request
|
|
|
<Access Key> |
|
<Secret Key> |
|
|
REST APIs
{ "flow_control": {
"client_spike_threshold": "0/second"
}
}
WebSocket APIs
{ "flow_control": {
"client_spike_threshold": "10/second",
"bytes_in_threshold": "10/second",
"bytes_out_threshold": "10/second"
}
}
Response
HTTP code | Status | Content body (application/json) |
---|---|---|
|
|
Flow control for REST APIs
Flow control for WebSocket APIs
|
|
|
|
|
|
|
Update flow control for a server of an API (POST)
Request
|
|
|
<Access Key> |
|
|
|
|
REST APIs
{
"server":
{
"host": "127.0.0.2",
"port": 8080,
"server_connection_quota": 1000,
"server_spike_threshold": "10/second"
}
}
WebSocket APIs
{
"server":
{
"host": "127.0.0.2",
"port": 8080,
"server_connection_quota": 100000
}
}
Response
HTTP code | Status | Content body (application/json) |
---|---|---|
|
|
|
|
|
|
|
|
|