Advanced Policy (Individual)


Delete an Advanced Throttling Policy

DELETE https://apis.wso2.com/api/am/admin/v0.14/throttling/policies/advanced/{policyId}

Deletes an Advanced level throttling policy.

OAuth 2.0 Scope

apim:tier_managei

Request

DELETE https://localhost:9443/api/am/admin/v0.14/throttling/policies/advanced/a0c9f368-b7d2-4eec-a757-f67034160208 Authorization: Bearer f7058af8-65a3-36c0-8d61-bc30476755c7

Response

HTTP/1.1 200 OK

Sample CURL

curl -k -X DELETE -H "Authorization: Bearer f7058af8-65a3-36c0-8d61-bc30476755c7" https://localhost:9443/api/am/admin/v0.14/throttling/policies/advanced/a0c9f368-b7d2-4eec-a757-f67034160208

Parameters

Type Name Description Schema Default
Path

policyId

required

Thorttle policy UUID

String

Header

If-Match

optional

Validator for conditional requests; based on ETag (Will be supported in future).

String

Header

If-Unmodified-Since

optional

Validator for conditional requests; based on Last Modified header (Will be supported in future).

String

Responses

HTTP Code Description Schema

200

OK. Resource successfully deleted.

404

Not Found. Resource to be deleted does not exist.

Error

412

Precondition Failed. The request has not been performed because one of the preconditions is not met (Will be supported in future).

Error

Get an Advanced Policy

GET https://apis.wso2.com/api/am/admin/v0.14/throttling/policies/advanced/{policyId}

Retrieves an Advanced Policy.

OAuth 2.0 Scope

apim:tier_viewi

Request

GET https://localhost:9443/api/am/admin/v0.14/throttling/policies/advanced/ea4ee02d-6cfb-4eea-9e30-3f548783160b Authorization: Bearer f7058af8-65a3-36c0-8d61-bc30476755c7

Response

HTTP/1.1 200 OK Content-Type: application/json { "policyId": "ea4ee02d-6cfb-4eea-9e30-3f548783160b", "policyName": "50KPerMin", "displayName": "50KPerMin", "description": "Allows 50000 requests per minute", "isDeployed": true, "defaultLimit": { "type": "RequestCountLimit", "timeUnit": "min", "unitTime": 1, "requestCount": 50000 }, "conditionalGroups": [] }

Sample CURL

curl -k -H "Authorization: Bearer f7058af8-65a3-36c0-8d61-bc30476755c7" https://localhost:9443/api/am/admin/v0.14/throttling/policies/advanced/ea4ee02d-6cfb-4eea-9e30-3f548783160b

Parameters

Type Name Description Schema Default
Path

policyId

required

Thorttle policy UUID

String

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. Policy returned

AdvancedThrottlePolicy

304

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

404

Not Found. Requested Policy does not exist.

Error

406

Not Acceptable. The requested media type is not supported.

Error

Update an Advanced Throttling Policy

PUT https://apis.wso2.com/api/am/admin/v0.14/throttling/policies/advanced/{policyId}

Updates an existing Advanced level throttling policy.

OAuth 2.0 Scope

apim:tier_managei

Request

PUT https://localhost:9443/api/am/admin/v0.14/throttling/policies/advanced/a0c9f368-b7d2-4eec-a757-f67034160208 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": "Host", "headerValue": "10.100.7.77" }, { "type": "QueryParameterCondition", "invertCondition": false, "parameterName": "name", "parameterValue": "admin" }, { "type": "JWTClaimsCondition", "invertCondition": true, "claimUrl": "claimUrl0", "attribute": "claimAttr0" } ], "limit": { "type": "RequestCountLimit", "timeUnit": "sec", "unitTime": 60, "requestCount": 0 } } ] }

Response

HTTP/1.1 200 OK 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": "Host", "headerValue": "10.100.7.77" }, { "type": "QueryParameterCondition", "invertCondition": false, "parameterName": "name", "parameterValue": "admin" }, { "type": "JWTClaimsCondition", "invertCondition": true, "claimUrl": "claimUrl0", "attribute": "claimAttr0" } ], "limit": { "type": "RequestCountLimit", "timeUnit": "sec", "unitTime": 60, "requestCount": 0 } } ] }

Sample CURL

curl -k -X PUT -H "Authorization: Bearer f7058af8-65a3-36c0-8d61-bc30476755c7" -H "Content-Type: application/json" https://localhost:9443/api/am/admin/v0.14/throttling/policies/advanced/a0c9f368-b7d2-4eec-a757-f67034160208 -d @data.json

Parameters

Type Name Description Schema Default
Path

policyId

required

Thorttle policy UUID

String

Body

body

required

Policy object that needs to be modified

AdvancedThrottlePolicy (AdvancedThrottlePolicy)

Header

Content-Type

required

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

String

application/json

Header

If-Match

optional

Validator for conditional requests; based on ETag (Will be supported in future).

String

Header

If-Unmodified-Since

optional

Validator for conditional requests; based on Last Modified header (Will be supported in future).

String

Responses

HTTP Code Description Schema

200

OK. Policy updated.

AdvancedThrottlePolicy

400

Bad Request. Invalid request or validation error.

Error

404

Not Found. The resource to be updated does not exist.

Error

412

Precondition Failed. The request has not been performed because one of the preconditions is not met (Will be supported in future).

Error