ServiceCache
Resource URI
/services/{serviceId}/cache
Items in curly braces represent variables.
Description
The Cache resource allows for the configuration of cache-related properties for the Service.
Resource Schema
Property | Characteristics | |
---|---|---|
cacheTtl | Type | integer |
Sub-type | ||
Create Rule | Optional | |
Update Rule | Optional | |
Fetch Rule | Implicit | |
Description | Content Cache Time-to-live in minutes |
fetch [GET]
Retrieves the identified Cache for the Service Definition.
Parameters
Parameter | Required | Type | Description |
---|---|---|---|
serviceId | true | string | Service identifier. |
fields | false | string | Comma-separated list of property paths to include in response. Each property path is a dot-separated list of object property names. fields=<property\[.property...\]>\[,...\]\[&fields=...\] |
filter | false | string | Colon-separated name/value pair specifying the name of property whose value must contain the given value (as a substring). Results may also be filtered by nested collections' properties by specifying a dot-separated property path. filter=<property\[.property...\]>:<value>\[&filter=...\] |
sort | false | string | Comma-separated list of properties to sort by. Only root-level properties are supported. Each property name may be optionally followed by :asc or :desc to specify sort direction (defaults to asc). sort=<property\[:(asc\|desc)\]>\[,...\]\[&sort=...\] |
limit | false | int | Number of objects to return in the result. Defaults to 100. |
offset | false | int | 0-based index of first object in the list to return. Defaults to 0. |
Returns
Success
Cache for the Service If fields request parameter is not included, only those fields with "Fetch Rule" equal to "Implicit" will be returned. Otherwise, the fields contained in the URL parameter will be included in the response.
Failure
Array of validation responses
Examples
Request
curl -k 'https://api.mashery.com/v3/rest/services/0fcc39d1c7ee470780e6cbe6/cache' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json"
Response
[ { "cacheTtl": 82 } ]
Request
curl -k 'https://api.mashery.com/v3/rest/services/0fcc39d1c7ee470780e6cbe6/cache' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json"
Response
[ { "cacheTtl": 55 } ]
create [POST]
Assigns Cache to a Service Definition.
Parameters
Parameter | Required | Type | Description |
---|---|---|---|
serviceId | true | string | Service identifier. |
cache | true | object | Service Cache object |
Returns
Success
Cache for the Service If fields request parameter is not included, only those fields with "Fetch Rule" equal to "Implicit" will be returned. Otherwise, the fields contained in the URL parameter will be included in the response.
Failure
Array of validation responses
Examples
Request
curl -k 'https://api.mashery.com/v3/rest/services/0fcc39d1c7ee470780e6cbe6/cache' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request POST --data '{"cacheTtl":50}
Response
[ { "cacheTtl": 73 } ]
Request
curl -k 'https://api.mashery.com/v3/rest/services/0fcc39d1c7ee470780e6cbe6/cache' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request POST --data '{"cacheTtl":48}
Response
[ { "cacheTtl": 23 } ]
update [PUT]
Updates the Cache assigned to the identified Service Definition.
Parameters
Parameter | Required | Type | Description |
---|---|---|---|
serviceId | true | string | Service identifier. |
cache | true | object | Service Cache object |
Returns
Success
Cache for the Service If fields request parameter is not included, only those fields with "Fetch Rule" equal to "Implicit" will be returned. Otherwise, the fields contained in the URL parameter will be included in the response.
Failure
Array of validation responses
Examples
Request
curl -k 'https://api.mashery.com/v3/rest/services/0fcc39d1c7ee470780e6cbe6/cache' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request PUT --data '{"cacheTtl":43}
Response
[ { "cacheTtl": 94 } ]
Request
curl -k 'https://api.mashery.com/v3/rest/services/0fcc39d1c7ee470780e6cbe6/cache' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request PUT --data '{"cacheTtl":24}
Response
[ { "cacheTtl": 70 } ]
delete [DELETE]
Deletes the Cache assigned to the identified Service Definition.
Parameters
Parameter | Required | Type | Description |
---|---|---|---|
serviceId | true | string | Service identifier. |
Returns
Success
Empty response
Failure
Array of validation responses
Examples
Request
curl -k 'https://api.mashery.com/v3/rest/services/0fcc39d1c7ee470780e6cbe6/cache' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request DELETE
Response
[ "" ]
Request
curl -k 'https://api.mashery.com/v3/rest/services/0fcc39d1c7ee470780e6cbe6/cache' -H "Authorization: Bearer <insert your token here>" -H "Content-Type:application/json" --request DELETE
Response
[ "" ]
Docs Navigation
- API Documentation Portal
- IO Docs Definition
- Mashery API Documentation
- Mashery 3.0 API Guide
- Mashery 2.0 API Guide
- OAuth Supporting Methods
- Examples
- JSON RPC
- Authentication
- API Objects
- Fetching Objects
- Query Language
- Creating Objects
- Updating Objects
- Validating Fields
- Deleting Objects
- Applications
- General Object Methods
- Members
- Packages
- Plans
- Package Keys
- Keys
- Developer Classes
- Services
- Roles
- Mashery 2.0 Reporting API Guide
- Event Trigger API
- Differences between Roles and Portal Access Groups
- Managing a Portal Access Group Using Mashery V2 or V3 API
- Mashery Reporting Event Post API Guide
- Tips and Tricks
- Your Portal
- API Traffic Manager
- I/O Docs WSDL requirements