require 'fastly'
api_instance = Fastly::CacheSettingsApi.newNote
All URIs are relative to https://api.fastly.com
| Method | HTTP request | Description |
|---|---|---|
| create_cache_settings | POST /service/{service_id}/version/{version_id}/cache_settings | Create a cache settings object |
| delete_cache_settings | DELETE /service/{service_id}/version/{version_id}/cache_settings/{cache_settings_name} | Delete a cache settings object |
| get_cache_settings | GET /service/{service_id}/version/{version_id}/cache_settings/{cache_settings_name} | Get a cache settings object |
| list_cache_settings | GET /service/{service_id}/version/{version_id}/cache_settings | List cache settings objects |
| update_cache_settings | PUT /service/{service_id}/version/{version_id}/cache_settings/{cache_settings_name} | Update a cache settings object |
create_cache_settings(opts): <CacheSettingResponse> # Create a cache settings objectCreate a cache settings object.
api_instance = Fastly::CacheSettingsApi.new
opts = {
service_id: 'service_id_example', # String | Alphanumeric string identifying the service.
version_id: 56, # Integer | Integer identifying a service version.
action: 'pass', # String | If set, will cause vcl_fetch to terminate after processing this rule with the return state specified. If not set, other configuration logic in vcl_fetch with a lower priority will run after this rule.
cache_condition: 'cache_condition_example', # String | Name of the cache condition controlling when this configuration applies.
name: 'name_example', # String | Name for the cache settings object.
stale_ttl: 'stale_ttl_example', # String | Maximum time in seconds to continue to use a stale version of the object if future requests to your backend server fail (also known as 'stale if error').
ttl: 'ttl_example', # String | Maximum time to consider the object fresh in the cache (the cache 'time to live').
}
begin
# Create a cache settings object
result = api_instance.create_cache_settings(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling CacheSettingsApi->create_cache_settings: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| service_id | String | Alphanumeric string identifying the service. | |
| version_id | Integer | Integer identifying a service version. | |
| action | String | If set, will cause vcl_fetch to terminate after processing this rule with the return state specified. If not set, other configuration logic in vcl_fetch with a lower priority will run after this rule. | [optional] |
| cache_condition | String | Name of the cache condition controlling when this configuration applies. | [optional] |
| name | String | Name for the cache settings object. | [optional] |
| stale_ttl | String | Maximum time in seconds to continue to use a stale version of the object if future requests to your backend server fail (also known as 'stale if error'). | [optional] |
| ttl | String | Maximum time to consider the object fresh in the cache (the cache 'time to live'). | [optional] |
[Back to top] [Back to API list] [Back to README]
delete_cache_settings(opts): <InlineResponse200> # Delete a cache settings objectDelete a specific cache settings object.
api_instance = Fastly::CacheSettingsApi.new
opts = {
service_id: 'service_id_example', # String | Alphanumeric string identifying the service.
version_id: 56, # Integer | Integer identifying a service version.
cache_settings_name: 'cache_settings_name_example', # String | Name for the cache settings object.
}
begin
# Delete a cache settings object
result = api_instance.delete_cache_settings(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling CacheSettingsApi->delete_cache_settings: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| service_id | String | Alphanumeric string identifying the service. | |
| version_id | Integer | Integer identifying a service version. | |
| cache_settings_name | String | Name for the cache settings object. |
[Back to top] [Back to API list] [Back to README]
get_cache_settings(opts): <CacheSettingResponse> # Get a cache settings objectGet a specific cache settings object.
api_instance = Fastly::CacheSettingsApi.new
opts = {
service_id: 'service_id_example', # String | Alphanumeric string identifying the service.
version_id: 56, # Integer | Integer identifying a service version.
cache_settings_name: 'cache_settings_name_example', # String | Name for the cache settings object.
}
begin
# Get a cache settings object
result = api_instance.get_cache_settings(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling CacheSettingsApi->get_cache_settings: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| service_id | String | Alphanumeric string identifying the service. | |
| version_id | Integer | Integer identifying a service version. | |
| cache_settings_name | String | Name for the cache settings object. |
[Back to top] [Back to API list] [Back to README]
list_cache_settings(opts): <Array<CacheSettingResponse>> # List cache settings objectsGet a list of all cache settings for a particular service and version.
api_instance = Fastly::CacheSettingsApi.new
opts = {
service_id: 'service_id_example', # String | Alphanumeric string identifying the service.
version_id: 56, # Integer | Integer identifying a service version.
}
begin
# List cache settings objects
result = api_instance.list_cache_settings(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling CacheSettingsApi->list_cache_settings: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| service_id | String | Alphanumeric string identifying the service. | |
| version_id | Integer | Integer identifying a service version. |
[Back to top] [Back to API list] [Back to README]
update_cache_settings(opts): <CacheSettingResponse> # Update a cache settings objectUpdate a specific cache settings object.
api_instance = Fastly::CacheSettingsApi.new
opts = {
service_id: 'service_id_example', # String | Alphanumeric string identifying the service.
version_id: 56, # Integer | Integer identifying a service version.
cache_settings_name: 'cache_settings_name_example', # String | Name for the cache settings object.
action: 'pass', # String | If set, will cause vcl_fetch to terminate after processing this rule with the return state specified. If not set, other configuration logic in vcl_fetch with a lower priority will run after this rule.
cache_condition: 'cache_condition_example', # String | Name of the cache condition controlling when this configuration applies.
name: 'name_example', # String | Name for the cache settings object.
stale_ttl: 'stale_ttl_example', # String | Maximum time in seconds to continue to use a stale version of the object if future requests to your backend server fail (also known as 'stale if error').
ttl: 'ttl_example', # String | Maximum time to consider the object fresh in the cache (the cache 'time to live').
}
begin
# Update a cache settings object
result = api_instance.update_cache_settings(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling CacheSettingsApi->update_cache_settings: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| service_id | String | Alphanumeric string identifying the service. | |
| version_id | Integer | Integer identifying a service version. | |
| cache_settings_name | String | Name for the cache settings object. | |
| action | String | If set, will cause vcl_fetch to terminate after processing this rule with the return state specified. If not set, other configuration logic in vcl_fetch with a lower priority will run after this rule. | [optional] |
| cache_condition | String | Name of the cache condition controlling when this configuration applies. | [optional] |
| name | String | Name for the cache settings object. | [optional] |
| stale_ttl | String | Maximum time in seconds to continue to use a stale version of the object if future requests to your backend server fail (also known as 'stale if error'). | [optional] |
| ttl | String | Maximum time to consider the object fresh in the cache (the cache 'time to live'). | [optional] |