Skip to content

Latest commit

 

History

History
365 lines (262 loc) · 8.85 KB

VersionApi.md

File metadata and controls

365 lines (262 loc) · 8.85 KB

Fastly.VersionApi

const apiInstance = new Fastly.VersionApi();

Methods

Method Fastly API endpoint Description
activateServiceVersion PUT /service/{service_id}/version/{version_id}/activate Activate a service version
cloneServiceVersion PUT /service/{service_id}/version/{version_id}/clone Clone a service version
createServiceVersion POST /service/{service_id}/version Create a service version
deactivateServiceVersion PUT /service/{service_id}/version/{version_id}/deactivate Deactivate a service version
getServiceVersion GET /service/{service_id}/version/{version_id} Get a version of a service
listServiceVersions GET /service/{service_id}/version List versions of a service
lockServiceVersion PUT /service/{service_id}/version/{version_id}/lock Lock a service version
updateServiceVersion PUT /service/{service_id}/version/{version_id} Update a service version
validateServiceVersion GET /service/{service_id}/version/{version_id}/validate Validate a service version

activateServiceVersion

activateServiceVersion({ service_id, version_id })

Activate the current version.

Example

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

apiInstance.activateServiceVersion(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

VersionResponse

cloneServiceVersion

cloneServiceVersion({ service_id, version_id })

Clone the current configuration into a new version.

Example

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

apiInstance.cloneServiceVersion(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

Version

createServiceVersion

createServiceVersion({ service_id })

Create a version for a particular service.

Example

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

apiInstance.createServiceVersion(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.

Return type

VersionCreateResponse

deactivateServiceVersion

deactivateServiceVersion({ service_id, version_id })

Deactivate the current version.

Example

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

apiInstance.deactivateServiceVersion(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

VersionResponse

getServiceVersion

getServiceVersion({ service_id, version_id })

Get the version for a particular service.

Example

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

apiInstance.getServiceVersion(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

VersionResponse

listServiceVersions

listServiceVersions({ service_id })

List the versions for a particular service.

Example

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

apiInstance.listServiceVersions(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.

Return type

[VersionResponse]

lockServiceVersion

lockServiceVersion({ service_id, version_id })

Locks the specified version.

Example

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

apiInstance.lockServiceVersion(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

Version

updateServiceVersion

updateServiceVersion({ service_id, version_id, [active, ][comment, ][deployed, ][locked, ][number, ][staging, ][testing] })

Update a particular version for a particular service.

Example

const options = {
  service_id: "service_id_example", // required
  version_id: 56, // required
  active: false,
  comment: "comment_example",
  deployed: true,
  locked: false,
  number: 56,
  staging: false,
  testing: false,
};

apiInstance.updateServiceVersion(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.
active Boolean Whether this is the active version or not. [optional] [defaults to false]
comment String A freeform descriptive note. [optional]
deployed Boolean Unused at this time. [optional]
locked Boolean Whether this version is locked or not. Objects can not be added or edited on locked versions. [optional] [defaults to false]
number Number The number of this version. [optional]
staging Boolean Unused at this time. [optional] [defaults to false]
testing Boolean Unused at this time. [optional] [defaults to false]

Return type

VersionResponse

validateServiceVersion

validateServiceVersion({ service_id, version_id })

Validate the version for a particular service and version.

Example

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

apiInstance.validateServiceVersion(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

InlineResponse200

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