Skip to content

Latest commit

 

History

History
210 lines (150 loc) · 5.58 KB

EnabledProductsApi.md

File metadata and controls

210 lines (150 loc) · 5.58 KB

Fastly.EnabledProductsApi

const apiInstance = new Fastly.EnabledProductsApi();

Methods

Note

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

Method HTTP request Description
disableProduct DELETE /enabled-products/v1/{product_id}/services/{service_id} Disable a product
enableProduct PUT /enabled-products/v1/{product_id}/services/{service_id} Enable a product
getEnabledProduct GET /enabled-products/v1/{product_id}/services/{service_id} Get enabled product
getProductConfiguration GET /enabled-products/v1/{product_id}/services/{service_id}/configuration Get configuration for a product
setProductConfiguration PATCH /enabled-products/v1/{product_id}/services/{service_id}/configuration Update configuration for a product

disableProduct

disableProduct({ product_id, service_id })

Disable a product on a service. Supported product IDs: brotli_compression,domain_inspector,fanout,image_optimizer,origin_inspector, websockets, bot_management, and ngwaf.

Example

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

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

Options

Name Type Description Notes
product_id String
service_id String Alphanumeric string identifying the service.

Return type

null (empty response body)

enableProduct

enableProduct({ product_id, service_id, [set_workspace_id] })

Enable a product on a service. Supported product IDs: brotli_compression,domain_inspector,fanout,image_optimizer,origin_inspector, websockets, bot_management, and ngwaf.

Example

const options = {
  product_id: ngwaf, // required
  service_id: "service_id_example", // required
  set_workspace_id: {"workspace_id":"7JFbo4RNA0OKdFWC04r6B3"},
};

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

Options

Name Type Description Notes
product_id String
service_id String Alphanumeric string identifying the service.
set_workspace_id SetWorkspaceId [optional]

Return type

EnabledProductResponse

getEnabledProduct

getEnabledProduct({ product_id, service_id })

Get enabled product on a service. Supported product IDs: brotli_compression,domain_inspector,fanout,image_optimizer,origin_inspector, websockets, bot_management, and ngwaf.

Example

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

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

Options

Name Type Description Notes
product_id String
service_id String Alphanumeric string identifying the service.

Return type

EnabledProductResponse

getProductConfiguration

getProductConfiguration({ product_id, service_id })

Get configuration for an enabled product on a service. Supported product IDs: ngwaf.

Example

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

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

Options

Name Type Description Notes
product_id String
service_id String Alphanumeric string identifying the service.

Return type

ConfiguredProductResponse

setProductConfiguration

setProductConfiguration({ product_id, service_id, [set_configuration] })

Update configuration for an enabled product on a service. Supported product IDs: ngwaf.

Example

const options = {
  product_id: ngwaf, // required
  service_id: "service_id_example", // required
  set_configuration: {"workspace_id":"7JFbo4RNA0OKdFWC04r6B3","traffic_ramp":"20"},
};

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

Options

Name Type Description Notes
product_id String
service_id String Alphanumeric string identifying the service.
set_configuration SetConfiguration [optional]

Return type

ConfiguredProductResponse

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