Application Policies (Collection)


Get all Application throttle policies
GET https://apis.wso2.com/api/am/admin/v0.14/throttling/policies/application

This operation can be used to retrieve all application level throttle policies.

OAuth 2.0 Scope

apim:tier_viewi

Request

GET https://localhost:9443/api/am/admin/v0.14/throttling/policies/application Authorization: Bearer e59e2657-4c2a-3cd0-8b48-0f4f39940c41

Response

HTTP/1.1 200 OK Content-Type: application/json { "count": 4, "list": [ { "policyId": "aef4447a-f996-4b3c-9c47-d0a401ab913c", "policyName": "50PerMin", "displayName": "50PerMin", "description": "Allows 50 request per minute", "isDeployed": true, "defaultLimit": { "type": "RequestCountLimit", "timeUnit": "min", "unitTime": 1, "requestCount": 50 } }, { "policyId": "472b573d-b162-4ac9-9984-531ee03d9d7c", "policyName": "20PerMin", "displayName": "20PerMin", "description": "Allows 20 request per minute", "isDeployed": true, "defaultLimit": { "type": "RequestCountLimit", "timeUnit": "min", "unitTime": 1, "requestCount": 20 } }, { "policyId": "251d4f70-29f8-40f4-8aad-f2d1e7b8cfc2", "policyName": "10PerMin", "displayName": "10PerMin", "description": "Allows 10 request per minute", "isDeployed": true, "defaultLimit": { "type": "RequestCountLimit", "timeUnit": "min", "unitTime": 1, "requestCount": 10 } }, { "policyId": "aaaef257-5453-42e6-b4a6-c48567864f92", "policyName": "Unlimited", "displayName": "Unlimited", "description": "Allows unlimited requests", "isDeployed": true, "defaultLimit": { "type": "RequestCountLimit", "timeUnit": "min", "unitTime": 1, "requestCount": 2147483647 } } ] }

Sample CURL

curl -k -H "Authorization: Bearer e59e2657-4c2a-3cd0-8b48-0f4f39940c41" https://localhost:9443/api/am/admin/v0.14/throttling/policies/application

Parameters

Type Name Description Schema Default
Header

Accept

optional

Media types acceptable for the response. Default is application/json.

String

application/json

Header

If-None-Match

optional

Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resourec.

String

Header

If-Modified-Since

optional

Validator for conditional requests; based on Last Modified header of the formerly retrieved variant of the resource.

String

Responses

HTTP Code Description Schema

200

OK. Policies returned

ApplicationThrottlePolicyList

304

Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future).

406

Not Acceptable. The requested media type is not supported.

Error

Add an Application level throttle policy
POST https://apis.wso2.com/api/am/admin/v0.14/throttling/policies/application

This operation can be used to add an application level throttle policy

OAuth 2.0 Scope

apim:tier_managei

Request

POST https://localhost:9443/api/am/admin/v0.14/throttling/policies/application Authorization: Bearer 0c6439fd-9b16-3c2e-be6e-1086e0b9aa93 Content-Type: application/json { "policyName": "1PerMin", "displayName": "1PerMin", "description": "Allows 1 request per minute", "defaultLimit": { "type": "RequestCountLimit", "timeUnit": "min", "unitTime": 1, "requestCount": 1 } }

Response

HTTP/1.1 201 Created Location: https://localhost:9443/api/am/admin/v0.14/throttling/policies/application/f7becc49-9cc1-463f-bc2b-fc4c82582479 Content-Type: application/json { "policyId": "f7becc49-9cc1-463f-bc2b-fc4c82582479", "policyName": "1PerMin", "displayName": "1PerMin", "description": "Allows 1 request per minute", "isDeployed": true, "defaultLimit": { "type": "RequestCountLimit", "timeUnit": "min", "unitTime": 1, "requestCount": 1 } }

Sample CURL

curl -k -H "Authorization: Bearer 0c6439fd-9b16-3c2e-be6e-1086e0b9aa93" -H "Content-Type: application/json" https://localhost:9443/api/am/admin/v0.14/throttling/policies/application -d @data.json

Parameters

Type Name Description Schema Default
Body

body

required

Application level policy object that should to be added

ApplicationThrottlePolicy (ApplicationThrottlePolicy)

Header

Content-Type

required

Media type of the entity in the body. Default is application/json.

String

application/json

Responses

HTTP Code Description Schema

201

Created. Successful response with the newly created object as entity in the body. Location header contains URL of newly created entity.

ApplicationThrottlePolicy

400

Bad Request. Invalid request or validation error

Error

415

Unsupported media type. The entity of the request was in a not supported format.