Resources API
Get all resources defined in the environment
| Path | Method | Protected |
|---|---|---|
/v1/envs/{environment_id}/resources | GET | Yes |
Example Response JSON
{
"values": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"revision": 0,
"environmentId": "19f5cc2e-7657-437a-9268-83cd3d563563",
"name": "string",
"limit": {
"type": "Rate",
"value": 0,
"period": "second",
"max": 0
},
"enforcementAction": "reject",
"unit": "string",
"units": "string"
}
]
}Create a new resource in the environment
| Path | Method | Protected |
|---|---|---|
/v1/envs/{environment_id}/resources | POST | Yes |
Example Request JSON
{
"name": "string",
"limit": {
"type": "Rate",
"value": 0,
"period": "second",
"max": 0
},
"enforcementAction": "reject",
"unit": "string",
"units": "string"
}Example Response JSON
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"revision": 0,
"environmentId": "19f5cc2e-7657-437a-9268-83cd3d563563",
"name": "string",
"limit": {
"type": "Rate",
"value": 0,
"period": "second",
"max": 0
},
"enforcementAction": "reject",
"unit": "string",
"units": "string"
}Get a resource in the environment by name
| Path | Method | Protected |
|---|---|---|
/v1/envs/{environment_id}/resources/{resource_name} | GET | Yes |
Example Response JSON
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"revision": 0,
"environmentId": "19f5cc2e-7657-437a-9268-83cd3d563563",
"name": "string",
"limit": {
"type": "Rate",
"value": 0,
"period": "second",
"max": 0
},
"enforcementAction": "reject",
"unit": "string",
"units": "string"
}Get a resource by id
| Path | Method | Protected |
|---|---|---|
/v1/resources/{resource_id} | GET | Yes |
Example Response JSON
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"revision": 0,
"environmentId": "19f5cc2e-7657-437a-9268-83cd3d563563",
"name": "string",
"limit": {
"type": "Rate",
"value": 0,
"period": "second",
"max": 0
},
"enforcementAction": "reject",
"unit": "string",
"units": "string"
}Delete a resource
| Path | Method | Protected |
|---|---|---|
/v1/resources/{resource_id} | DELETE | Yes |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| current_revision | integer | Yes | - |
Update a resource
| Path | Method | Protected |
|---|---|---|
/v1/resources/{resource_id} | PATCH | Yes |
Example Request JSON
{
"currentRevision": 0,
"limit": {
"type": "Rate",
"value": 0,
"period": "second",
"max": 0
},
"enforcementAction": "reject",
"unit": "string",
"units": "string"
}Example Response JSON
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"revision": 0,
"environmentId": "19f5cc2e-7657-437a-9268-83cd3d563563",
"name": "string",
"limit": {
"type": "Rate",
"value": 0,
"period": "second",
"max": 0
},
"enforcementAction": "reject",
"unit": "string",
"units": "string"
}Get specific revision of a resource
| Path | Method | Protected |
|---|---|---|
/v1/resources/{resource_id}/revisions/{revision} | GET | Yes |
Example Response JSON
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"revision": 0,
"environmentId": "19f5cc2e-7657-437a-9268-83cd3d563563",
"name": "string",
"limit": {
"type": "Rate",
"value": 0,
"period": "second",
"max": 0
},
"enforcementAction": "reject",
"unit": "string",
"units": "string"
}Resources API Errors
| Status Code | Description | Body |
|---|---|---|
| 400 | Invalid request, returning with a list of issues detected in the request | {"code":"string","errors":["string"]} |
| 401 | Unauthorized request | {"code":"string","error":"string"} |
| 403 | Forbidden Request | {"code":"string","error":"string"} |
| 404 | Entity not found | {"code":"string","error":"string"} |
| 409 | {"code":"string","error":"string"} | |
| 422 | Limits of the plan exceeded | {"code":"string","error":"string"} |
| 500 | Internal server error | {"code":"string","error":"string"} |
Last updated on