$apiInstance = new Fastly\Api\KvStoreApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
Note
All URIs are relative to https://api.fastly.com
Method | HTTP request | Description |
---|---|---|
createStore() | POST /resources/stores/kv | Create a KV store. |
deleteStore() | DELETE /resources/stores/kv/{store_id} | Delete a KV store. |
getStore() | GET /resources/stores/kv/{store_id} | Describe a KV store. |
getStores() | GET /resources/stores/kv | List KV stores. |
createStore($options): \Fastly\Model\StoreResponse // Create a KV store.
Create a new KV store.
$options['location'] = 'location_example'; // string
$options['store'] = {"name":"my-store"}; // \Fastly\Model\Store
try {
$result = $apiInstance->createStore($options);
} catch (Exception $e) {
echo 'Exception when calling KvStoreApi->createStore: ', $e->getMessage(), PHP_EOL;
}
Note: the input parameter is an associative array with the keys listed below.
Name | Type | Description | Notes |
---|---|---|---|
location | string | [optional] | |
store | \Fastly\Model\Store | [optional] |
[Back to top] [Back to API list] [Back to README]
deleteStore($options) // 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).
$options['store_id'] = 'store_id_example'; // string
try {
$apiInstance->deleteStore($options);
} catch (Exception $e) {
echo 'Exception when calling KvStoreApi->deleteStore: ', $e->getMessage(), PHP_EOL;
}
Note: the input parameter is an associative array with the keys listed below.
Name | Type | Description | Notes |
---|---|---|---|
store_id | string |
void (empty response body)
[Back to top] [Back to API list] [Back to README]
getStore($options): \Fastly\Model\StoreResponse // Describe a KV store.
Get a KV store by ID.
$options['store_id'] = 'store_id_example'; // string
try {
$result = $apiInstance->getStore($options);
} catch (Exception $e) {
echo 'Exception when calling KvStoreApi->getStore: ', $e->getMessage(), PHP_EOL;
}
Note: the input parameter is an associative array with the keys listed below.
Name | Type | Description | Notes |
---|---|---|---|
store_id | string |
[Back to top] [Back to API list] [Back to README]
getStores($options): \Fastly\Model\InlineResponse2003 // List KV stores.
Get all stores for a given customer.
$options['cursor'] = 'cursor_example'; // string
$options['limit'] = 1000; // int
try {
$result = $apiInstance->getStores($options);
} catch (Exception $e) {
echo 'Exception when calling KvStoreApi->getStores: ', $e->getMessage(), PHP_EOL;
}
Note: the input parameter is an associative array with the keys listed below.
Name | Type | Description | Notes |
---|---|---|---|
cursor | string | [optional] | |
limit | int | [optional] [defaults to 1000] |