require 'fastly'
api_instance = Fastly::KvStoreApi.new
Note
All URIs are relative to https://api.fastly.com
Method | HTTP request | Description |
---|---|---|
create_store | POST /resources/stores/kv | Create a KV store. |
delete_store | DELETE /resources/stores/kv/{store_id} | Delete a KV store. |
get_store | GET /resources/stores/kv/{store_id} | Describe a KV store. |
get_stores | GET /resources/stores/kv | List KV stores. |
create_store(opts): <StoreResponse> # Create a KV store.
Create a new KV store.
api_instance = Fastly::KvStoreApi.new
opts = {
location: 'location_example', # String |
store: Fastly::Store.new, # Store |
}
begin
# Create a KV store.
result = api_instance.create_store(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling KvStoreApi->create_store: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
location | String | [optional] | |
store | Store | [optional] |
[Back to top] [Back to API list] [Back to README]
delete_store(opts) # Delete a KV store.
A KV store must be empty before it can be deleted. Deleting a KV store that still contains keys will result in a 409
(Conflict).
api_instance = Fastly::KvStoreApi.new
opts = {
store_id: 'store_id_example', # String |
}
begin
# Delete a KV store.
api_instance.delete_store(opts)
rescue Fastly::ApiError => e
puts "Error when calling KvStoreApi->delete_store: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
store_id | String |
nil (empty response body)
[Back to top] [Back to API list] [Back to README]
get_store(opts): <StoreResponse> # Describe a KV store.
Get a KV store by ID.
api_instance = Fastly::KvStoreApi.new
opts = {
store_id: 'store_id_example', # String |
}
begin
# Describe a KV store.
result = api_instance.get_store(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling KvStoreApi->get_store: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
store_id | String |
[Back to top] [Back to API list] [Back to README]
get_stores(opts): <InlineResponse2003> # List KV stores.
Get all stores for a given customer.
api_instance = Fastly::KvStoreApi.new
opts = {
cursor: 'cursor_example', # String |
limit: 56, # Integer |
}
begin
# List KV stores.
result = api_instance.get_stores(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling KvStoreApi->get_stores: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
cursor | String | [optional] | |
limit | Integer | [optional][default to 1000] |