const apiInstance = new Fastly.KvStoreApi();
Note
All URIs are relative to https://api.fastly.com
Method | HTTP request | Description |
---|---|---|
kvStoreCreate | POST /resources/stores/kv | Create a KV store. |
kvStoreDelete | DELETE /resources/stores/kv/{store_id} | Delete a KV store. |
kvStoreGet | GET /resources/stores/kv/{store_id} | Describe a KV store. |
kvStoreList | GET /resources/stores/kv | List all KV stores. |
kvStoreCreate({ , [location, ][kv_store_request_create] })
Create a KV store.
const options = {
location: "US",
kv_store_request_create: {"name":"my-store"},
};
apiInstance.kvStoreCreate(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
location | String | [optional] [one of: "US", "EU", "ASIA", "AUS"] | |
kv_store_request_create | KvStoreRequestCreate | [optional] |
kvStoreDelete({ store_id })
A KV store must be empty before it can be deleted. Attempting to delete a KV store that contains items will result in a response with a 409
status code.
const options = {
store_id: "store_id_example", // required
};
apiInstance.kvStoreDelete(options)
.then(() => {
console.log('API called successfully.');
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
store_id | String |
null (empty response body)
kvStoreGet({ store_id })
Get details of a KV store.
const options = {
store_id: "store_id_example", // required
};
apiInstance.kvStoreGet(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
store_id | String |
kvStoreList({ , [cursor, ][limit] })
List all KV stores.
const options = {
cursor: "cursor_example",
limit: 1000,
};
apiInstance.kvStoreList(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
cursor | String | [optional] | |
limit | Number | [optional] [defaults to 1000] |