Advanced Policy (Collection)


Get all Advanced throttling policies.
GET https://apis.wso2.com/api/am/admin/v0.11/throttling/policies/advanced

Retrieves all existing Advanced level throttling policies.

OAuth 2.0 Scope

apim:tier_viewi

Request

GET https://localhost:9443/api/am/admin/v0.11/throttling/policies/advanced Authorization: Bearer aa5195d9-3977-33f4-839e-5779dabfe826

Response

HTTP/1.1 200 OK Content-Type: application/json { "count": 4, "list": [ { "policyId": "85c69cbe-05b7-4293-abff-56f424d51c9c", "policyName": "50KPerMin", "displayName": "50KPerMin", "description": "Allows 50000 requests per minute", "isDeployed": true, "defaultLimit": { "type": "RequestCountLimit", "timeUnit": "min", "unitTime": 1, "requestCount": 50000 } }, { "policyId": "46062a74-edfa-431a-a418-7cb52595baf8", "policyName": "20KPerMin", "displayName": "20KPerMin", "description": "Allows 20000 requests per minute", "isDeployed": true, "defaultLimit": { "type": "RequestCountLimit", "timeUnit": "min", "unitTime": 1, "requestCount": 20000 } }, { "policyId": "0637089f-2128-4a26-9bee-ffb6d85f0f81", "policyName": "10KPerMin", "displayName": "10KPerMin", "description": "Allows 10000 requests per minute", "isDeployed": true, "defaultLimit": { "type": "RequestCountLimit", "timeUnit": "min", "unitTime": 1, "requestCount": 10000 } }, { "policyId": "c461d87e-dba1-4f57-bc5a-67b97025c1c8", "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 aa5195d9-3977-33f4-839e-5779dabfe826" https://localhost:9443/api/am/admin/v0.11/throttling/policies/advanced

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 resource (Will be supported in future).

String

Header

If-Modified-Since

optional

Validator for conditional requests; based on Last Modified header of the formerly retrieved variant of the resource (Will be supported in future).

String

Responses

HTTP Code Description Schema

200

OK. Policies returned

AdvancedThrottlePolicyList

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 Advanced Throttling Policy
POST https://apis.wso2.com/api/am/admin/v0.11/throttling/policies/advanced

Add a new Advanced level throttling policy.

OAuth 2.0 Scope

apim:tier_managei

Request

POST https://localhost:9443/api/am/admin/v0.11/throttling/policies/advanced Authorization: Bearer f7058af8-65a3-36c0-8d61-bc30476755c7 Content-Type: application/json { "policyName": "100KBP2Min", "displayName": "100KBP2Min", "description": "description of the policy", "defaultLimit": { "type": "BandwidthLimit", "timeUnit": "min", "unitTime": 2, "dataAmount": 100, "dataUnit": "KB" }, "conditionalGroups": [ { "description": "Sample description about condition group", "conditions": [ { "type": "IPCondition", "invertCondition": false, "ipConditionType": "IPSpecific", "specificIP": "10.100.1.22", "startingIP": null, "endingIP": null }, { "type": "HeaderCondition", "invertCondition": false, "headerName": "Location", "headerValue": "google.com" }, { "type": "HeaderCondition", "invertCondition": false, "headerName": "Host", "headerValue": "10.100.7.77" }, { "type": "QueryParameterCondition", "invertCondition": false, "parameterName": "name", "parameterValue": "admin" }, { "type": "QueryParameterCondition", "invertCondition": false, "parameterName": "lastAccess", "parameterValue": "25-02-2016" }, { "type": "JWTClaimsCondition", "invertCondition": true, "claimUrl": "claimUrl0", "attribute": "claimAttr0" }, { "type": "JWTClaimsCondition", "invertCondition": true, "claimUrl": "claimUrl1", "attribute": "claimAttr" } ], "limit": { "type": "RequestCountLimit", "timeUnit": "sec", "unitTime": 60, "requestCount": 0 } }, { "description": "Sample description about condition group", "conditions": [ { "type": "IPCondition", "invertCondition": true, "ipConditionType": "IPRange", "specificIP": null, "startingIP": "0.0.0.0", "endingIP": "1.1.1.1" }], "limit": { "type": "RequestCountLimit", "timeUnit": "sec", "unitTime": 60, "requestCount": 0 } } ] }

Response

HTTP/1.1 201 Created Location: https://localhost:9443/api/am/admin/v0.11/throttling/policies/advanced/a0c9f368-b7d2-4eec-a757-f67034160208 Content-Type: application/json { "policyId": "a0c9f368-b7d2-4eec-a757-f67034160208", "policyName": "100KBP2Min", "displayName": "100KBP2Min", "description": "description of the policy", "isDeployed": true, "defaultLimit": { "type": "BandwidthLimit", "timeUnit": "min", "unitTime": 2, "dataAmount": 100, "dataUnit": "KB" }, "conditionalGroups": [ { "description": "Sample description about condition group", "conditions": [ { "type": "IPCondition", "invertCondition": false, "ipConditionType": "IPSpecific", "specificIP": "10.100.1.22", "startingIP": null, "endingIP": null }, { "type": "HeaderCondition", "invertCondition": false, "headerName": "Location", "headerValue": "google.com" }, { "type": "HeaderCondition", "invertCondition": false, "headerName": "Host", "headerValue": "10.100.7.77" }, { "type": "QueryParameterCondition", "invertCondition": false, "parameterName": "name", "parameterValue": "admin" }, { "type": "QueryParameterCondition", "invertCondition": false, "parameterName": "lastAccess", "parameterValue": "25-02-2016" }, { "type": "JWTClaimsCondition", "invertCondition": true, "claimUrl": "claimUrl0", "attribute": "claimAttr0" }, { "type": "JWTClaimsCondition", "invertCondition": true, "claimUrl": "claimUrl1", "attribute": "claimAttr" } ], "limit": { "type": "RequestCountLimit", "timeUnit": "sec", "unitTime": 60, "requestCount": 0 } }, { "description": "Sample description about condition group", "conditions": [ { "type": "IPCondition", "invertCondition": true, "ipConditionType": "IPRange", "specificIP": null, "startingIP": "0.0.0.0", "endingIP": "1.1.1.1" } ], "limit": { "type": "RequestCountLimit", "timeUnit": "sec", "unitTime": 60, "requestCount": 0 } } ] }

Sample CURL

curl -k -X POST -H "Authorization: Bearer f7058af8-65a3-36c0-8d61-bc30476755c7" -H "Content-Type: application/json" https://localhost:9443/api/am/admin/v0.11/throttling/policies/advanced -d @data.json

Parameters

Type Name Description Schema Default
Body

body

required

Advanced level policy object that should to be added

AdvancedThrottlePolicy (AdvancedThrottlePolicy)

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.

AdvancedThrottlePolicy

400

Bad Request. Invalid request or validation error

Error

415

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