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. |
StoreResponse create_store()
Create a KV store.
Create a new KV store.
- Api Key Authentication (token):
import time
import fastly
from fastly.api import kv_store_api
from fastly.model.store_response import StoreResponse
from fastly.model.store import Store
from pprint import pprint
# Defining the host is optional and defaults to https://api.fastly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = fastly.Configuration(
host = "https://api.fastly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: token
configuration.api_key['token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['token'] = 'Bearer'
# Enter a context with an instance of the API client
with fastly.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = kv_store_api.KvStoreApi(api_client)
location = "location_example" # str | (optional)
store = Store(
name="name_example",
) # Store | (optional)
# example passing only required values which don't have defaults set
# and optional values
try:
# Create a KV store.
api_response = api_instance.create_store(location=location, store=store)
pprint(api_response)
except fastly.ApiException as e:
print("Exception when calling KvStoreApi->create_store: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
location | str | [optional] | |
store | Store | [optional] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | Created | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_store(store_id)
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 Key Authentication (token):
import time
import fastly
from fastly.api import kv_store_api
from pprint import pprint
# Defining the host is optional and defaults to https://api.fastly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = fastly.Configuration(
host = "https://api.fastly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: token
configuration.api_key['token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['token'] = 'Bearer'
# Enter a context with an instance of the API client
with fastly.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = kv_store_api.KvStoreApi(api_client)
store_id = "store_id_example" # str |
# example passing only required values which don't have defaults set
try:
# Delete a KV store.
api_instance.delete_store(store_id)
except fastly.ApiException as e:
print("Exception when calling KvStoreApi->delete_store: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
store_id | str |
void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
Status code | Description | Response headers |
---|---|---|
204 | No Content | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
StoreResponse get_store(store_id)
Describe a KV store.
Get a KV store by ID.
- Api Key Authentication (token):
import time
import fastly
from fastly.api import kv_store_api
from fastly.model.store_response import StoreResponse
from pprint import pprint
# Defining the host is optional and defaults to https://api.fastly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = fastly.Configuration(
host = "https://api.fastly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: token
configuration.api_key['token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['token'] = 'Bearer'
# Enter a context with an instance of the API client
with fastly.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = kv_store_api.KvStoreApi(api_client)
store_id = "store_id_example" # str |
# example passing only required values which don't have defaults set
try:
# Describe a KV store.
api_response = api_instance.get_store(store_id)
pprint(api_response)
except fastly.ApiException as e:
print("Exception when calling KvStoreApi->get_store: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
store_id | str |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
InlineResponse2003 get_stores()
List KV stores.
Get all stores for a given customer.
- Api Key Authentication (token):
import time
import fastly
from fastly.api import kv_store_api
from fastly.model.inline_response2003 import InlineResponse2003
from pprint import pprint
# Defining the host is optional and defaults to https://api.fastly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = fastly.Configuration(
host = "https://api.fastly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: token
configuration.api_key['token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['token'] = 'Bearer'
# Enter a context with an instance of the API client
with fastly.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = kv_store_api.KvStoreApi(api_client)
cursor = "cursor_example" # str | (optional)
limit = 1000 # int | (optional) if omitted the server will use the default value of 1000
# example passing only required values which don't have defaults set
# and optional values
try:
# List KV stores.
api_response = api_instance.get_stores(cursor=cursor, limit=limit)
pprint(api_response)
except fastly.ApiException as e:
print("Exception when calling KvStoreApi->get_stores: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
cursor | str | [optional] | |
limit | int | [optional] if omitted the server will use the default value of 1000 |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]