Skip to content

Latest commit

 

History

History
220 lines (160 loc) · 6.35 KB

DictionaryApi.md

File metadata and controls

220 lines (160 loc) · 6.35 KB

Fastly.DictionaryApi

const apiInstance = new Fastly.DictionaryApi();

Methods

Note

All URIs are relative to https://api.fastly.com

Method HTTP request Description
createDictionary POST /service/{service_id}/version/{version_id}/dictionary Create an edge dictionary
deleteDictionary DELETE /service/{service_id}/version/{version_id}/dictionary/{dictionary_name} Delete an edge dictionary
getDictionary GET /service/{service_id}/version/{version_id}/dictionary/{dictionary_name} Get an edge dictionary
listDictionaries GET /service/{service_id}/version/{version_id}/dictionary List edge dictionaries
updateDictionary PUT /service/{service_id}/version/{version_id}/dictionary/{dictionary_name} Update an edge dictionary

createDictionary

createDictionary({ service_id, version_id, [name, ][write_only] })

Create named dictionary for a particular service and version.

Example

const options = {
  service_id: "service_id_example", // required
  version_id: 56, // required
  name: "name_example",
  write_only: false,
};

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

Options

Name Type Description Notes
service_id String Alphanumeric string identifying the service.
version_id Number Integer identifying a service version.
name String Name for the Dictionary (must start with an alphabetic character and can contain only alphanumeric characters, underscores, and whitespace). [optional]
write_only Boolean Determines if items in the dictionary are readable or not. [optional] [defaults to false]

Return type

DictionaryResponse

deleteDictionary

deleteDictionary({ service_id, version_id, dictionary_name })

Delete named dictionary for a particular service and version.

Example

const options = {
  service_id: "service_id_example", // required
  version_id: 56, // required
  dictionary_name: "dictionary_name_example", // required
};

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

Options

Name Type Description Notes
service_id String Alphanumeric string identifying the service.
version_id Number Integer identifying a service version.
dictionary_name String Name for the Dictionary (must start with an alphabetic character and can contain only alphanumeric characters, underscores, and whitespace).

Return type

InlineResponse200

getDictionary

getDictionary({ service_id, version_id, dictionary_name })

Retrieve a single dictionary by name for the version and service.

Example

const options = {
  service_id: "service_id_example", // required
  version_id: 56, // required
  dictionary_name: "dictionary_name_example", // required
};

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

Options

Name Type Description Notes
service_id String Alphanumeric string identifying the service.
version_id Number Integer identifying a service version.
dictionary_name String Name for the Dictionary (must start with an alphabetic character and can contain only alphanumeric characters, underscores, and whitespace).

Return type

DictionaryResponse

listDictionaries

listDictionaries({ service_id, version_id })

List all dictionaries for the version of the service.

Example

const options = {
  service_id: "service_id_example", // required
  version_id: 56, // required
};

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

Options

Name Type Description Notes
service_id String Alphanumeric string identifying the service.
version_id Number Integer identifying a service version.

Return type

[DictionaryResponse]

updateDictionary

updateDictionary({ service_id, version_id, dictionary_name, [name, ][write_only] })

Update named dictionary for a particular service and version.

Example

const options = {
  service_id: "service_id_example", // required
  version_id: 56, // required
  dictionary_name: "dictionary_name_example", // required
  name: "name_example",
  write_only: false,
};

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

Options

Name Type Description Notes
service_id String Alphanumeric string identifying the service.
version_id Number Integer identifying a service version.
dictionary_name String Name for the Dictionary (must start with an alphabetic character and can contain only alphanumeric characters, underscores, and whitespace).
name String Name for the Dictionary (must start with an alphabetic character and can contain only alphanumeric characters, underscores, and whitespace). [optional]
write_only Boolean Determines if items in the dictionary are readable or not. [optional] [defaults to false]

Return type

DictionaryResponse

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