Skip to content

Latest commit

 

History

History
164 lines (115 loc) · 3.27 KB

KvStoreApi.md

File metadata and controls

164 lines (115 loc) · 3.27 KB

Fastly.KvStoreApi

const apiInstance = new Fastly.KvStoreApi();

Methods

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

kvStoreCreate({ , [location, ][kv_store_request_create] })

Create a KV store.

Example

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);
  });

Options

Name Type Description Notes
location String [optional] [one of: "US", "EU", "ASIA", "AUS"]
kv_store_request_create KvStoreRequestCreate [optional]

Return type

KvStoreDetails

kvStoreDelete

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.

Example

const options = {
  store_id: "store_id_example", // required
};

apiInstance.kvStoreDelete(options)
  .then(() => {
    console.log('API called successfully.');
  })
  .catch((error) => {
    console.error(error);
  });

Options

Name Type Description Notes
store_id String

Return type

null (empty response body)

kvStoreGet

kvStoreGet({ store_id })

Get details of a KV store.

Example

const options = {
  store_id: "store_id_example", // required
};

apiInstance.kvStoreGet(options)
  .then((data) => {
    console.log(data, "API called successfully.");
  })
  .catch((error) => {
    console.error(error);
  });

Options

Name Type Description Notes
store_id String

Return type

KvStoreDetails

kvStoreList

kvStoreList({ , [cursor, ][limit] })

List all KV stores.

Example

const options = {
  cursor: "cursor_example",
  limit: 1000,
};

apiInstance.kvStoreList(options)
  .then((data) => {
    console.log(data, "API called successfully.");
  })
  .catch((error) => {
    console.error(error);
  });

Options

Name Type Description Notes
cursor String [optional]
limit Number [optional] [defaults to 1000]

Return type

InlineResponse2003

[Back to top] [Back to API list] [Back to README]