Skip to content

Latest commit

 

History

History
96 lines (69 loc) · 2.5 KB

PackageApi.md

File metadata and controls

96 lines (69 loc) · 2.5 KB

Fastly.PackageApi

const apiInstance = new Fastly.PackageApi();

Methods

Note

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

Method HTTP request Description
getPackage GET /service/{service_id}/version/{version_id}/package Get details of the service's Compute package.
putPackage PUT /service/{service_id}/version/{version_id}/package Upload a Compute package.

getPackage

getPackage({ service_id, version_id })

List detailed information about the Compute package for the specified service.

Example

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

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

PackageResponse

putPackage

putPackage({ service_id, version_id, [expect, ][_package] })

Upload a Compute package associated with the specified service version.

Example

const options = {
  service_id: "service_id_example", // required
  version_id: 56, // required
  expect: 100-continue,
  _package: "/path/to/file",
};

apiInstance.putPackage(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.
expect String We recommend using the Expect header because it may identify issues with the request based upon the headers alone instead of requiring you to wait until the entire binary package upload has completed. [optional]
_package File****File The content of the Wasm binary package. [optional]

Return type

PackageResponse

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