$apiInstance = new Fastly\Api\KvStoreItemApi(
// 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 |
---|---|---|
kvStoreDeleteItem() | DELETE /resources/stores/kv/{store_id}/keys/{key} | Delete an item. |
kvStoreGetItem() | GET /resources/stores/kv/{store_id}/keys/{key} | Get an item. |
kvStoreListItemKeys() | GET /resources/stores/kv/{store_id}/keys | List item keys. |
kvStoreUpsertItem() | PUT /resources/stores/kv/{store_id}/keys/{key} | Insert or update an item. |
kvStoreDeleteItem($options) // Delete an item.
Delete an item.
$options['store_id'] = 'store_id_example'; // string
$options['key'] = 'key_example'; // string
$options['if_generation_match'] = 56; // int
$options['force'] = false; // bool
try {
$apiInstance->kvStoreDeleteItem($options);
} catch (Exception $e) {
echo 'Exception when calling KvStoreItemApi->kvStoreDeleteItem: ', $e->getMessage(), PHP_EOL;
}
Note: the input parameter is an associative array with the keys listed below.
Name | Type | Description | Notes |
---|---|---|---|
store_id | string | ||
key | string | ||
if_generation_match | int | [optional] | |
force | bool | [optional] [defaults to false] |
void (empty response body)
[Back to top] [Back to API list] [Back to README]
kvStoreGetItem($options): string // Get an item.
Get an item, including its value, metadata (if any), and generation marker.
$options['store_id'] = 'store_id_example'; // string
$options['key'] = 'key_example'; // string
try {
$result = $apiInstance->kvStoreGetItem($options);
} catch (Exception $e) {
echo 'Exception when calling KvStoreItemApi->kvStoreGetItem: ', $e->getMessage(), PHP_EOL;
}
Note: the input parameter is an associative array with the keys listed below.
Name | Type | Description | Notes |
---|---|---|---|
store_id | string | ||
key | string |
string
[Back to top] [Back to API list] [Back to README]
kvStoreListItemKeys($options): \Fastly\Model\InlineResponse2004 // List item keys.
Lists the matching item keys (or all item keys, if no prefix is supplied).
$options['store_id'] = 'store_id_example'; // string
$options['cursor'] = 'cursor_example'; // string
$options['limit'] = 100; // int
$options['prefix'] = 'prefix_example'; // string
$options['consistency'] = 'strong'; // string
try {
$result = $apiInstance->kvStoreListItemKeys($options);
} catch (Exception $e) {
echo 'Exception when calling KvStoreItemApi->kvStoreListItemKeys: ', $e->getMessage(), PHP_EOL;
}
Note: the input parameter is an associative array with the keys listed below.
Name | Type | Description | Notes |
---|---|---|---|
store_id | string | ||
cursor | string | [optional] | |
limit | int | [optional] [defaults to 100] | |
prefix | string | [optional] | |
consistency | string | [optional] [one of: 'strong', 'eventual'] [defaults to 'strong'] |
\Fastly\Model\InlineResponse2004
[Back to top] [Back to API list] [Back to README]
kvStoreUpsertItem($options) // Insert or update an item.
Inserts or updates an item's value and metadata.
$options['store_id'] = 'store_id_example'; // string
$options['key'] = 'key_example'; // string
$options['if_generation_match'] = 56; // int
$options['time_to_live_sec'] = 56; // int
$options['metadata'] = 'metadata_example'; // string
$options['add'] = false; // bool
$options['append'] = false; // bool
$options['prepend'] = false; // bool
$options['background_fetch'] = false; // bool
$options['body'] = 'body_example'; // string
try {
$apiInstance->kvStoreUpsertItem($options);
} catch (Exception $e) {
echo 'Exception when calling KvStoreItemApi->kvStoreUpsertItem: ', $e->getMessage(), PHP_EOL;
}
Note: the input parameter is an associative array with the keys listed below.
Name | Type | Description | Notes |
---|---|---|---|
store_id | string | ||
key | string | ||
if_generation_match | int | [optional] | |
time_to_live_sec | int | [optional] | |
metadata | string | [optional] | |
add | bool | [optional] [defaults to false] | |
append | bool | [optional] [defaults to false] | |
prepend | bool | [optional] [defaults to false] | |
background_fetch | bool | [optional] [defaults to false] | |
body | string | [optional] |
void (empty response body)