Skip to content

Latest commit

 

History

History
212 lines (152 loc) · 5.89 KB

WafFirewallsApi.md

File metadata and controls

212 lines (152 loc) · 5.89 KB

Fastly.WafFirewallsApi

const apiInstance = new Fastly.WafFirewallsApi();

Methods

Note

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

Method HTTP request Description
createWafFirewall POST /waf/firewalls Create a firewall
deleteWafFirewall DELETE /waf/firewalls/{firewall_id} Delete a firewall
getWafFirewall GET /waf/firewalls/{firewall_id} Get a firewall
listWafFirewalls GET /waf/firewalls List firewalls
updateWafFirewall PATCH /waf/firewalls/{firewall_id} Update a firewall

createWafFirewall

createWafFirewall({ , [waf_firewall] })

Create a firewall object for a particular service and service version using a defined prefetch_condition and response. If the prefetch_condition or the response is missing from the request body, Fastly will generate a default object on your service.

Example

const options = {
  waf_firewall: {"data":{"type":"waf_firewall","attributes":{"prefetch_condition":"WAF_Condition","response":"WAF_Error","service_id":"SU1Z0isxPaozGVKXdv0eY","service_version_number":1}}},
};

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

Options

Name Type Description Notes
waf_firewall WafFirewall [optional]

Return type

WafFirewallResponse

deleteWafFirewall

deleteWafFirewall({ firewall_id, [waf_firewall] })

Delete the firewall object for a particular service and service version.

Example

const options = {
  firewall_id: "firewall_id_example", // required
  waf_firewall: {"data":{"id":"fW7g2uUGZzb2W9Euo4Mo0r","type":"waf_firewall","attributes":{"service_version_number":1}}},
};

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

Options

Name Type Description Notes
firewall_id String Alphanumeric string identifying a WAF Firewall.
waf_firewall WafFirewall [optional]

Return type

null (empty response body)

getWafFirewall

getWafFirewall({ firewall_id, [filter_service_version_number, ][include] })

Get a specific firewall object.

Example

const options = {
  firewall_id: "firewall_id_example", // required
  filter_service_version_number: "filter_service_version_number_example",
  include: "waf_firewall_versions",
};

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

Options

Name Type Description Notes
firewall_id String Alphanumeric string identifying a WAF Firewall.
filter_service_version_number String Limit the results returned to a specific service version. [optional]
include String Include related objects. Optional. [optional] [one of: "waf_firewall_versions"]

Return type

WafFirewallResponse

listWafFirewalls

listWafFirewalls({ , [page_number, ][page_size, ][filter_service_id, ][filter_service_version_number, ][include] })

List all firewall objects.

Example

const options = {
  page_number: 1,
  page_size: 20,
  filter_service_id: "filter_service_id_example",
  filter_service_version_number: "filter_service_version_number_example",
  include: "waf_firewall_versions",
};

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

Options

Name Type Description Notes
page_number Number Current page. [optional]
page_size Number Number of records per page. [optional] [defaults to 20]
filter_service_id String Limit the results returned to a specific service. [optional]
filter_service_version_number String Limit the results returned to a specific service version. [optional]
include String Include related objects. Optional. [optional] [one of: "waf_firewall_versions"]

Return type

WafFirewallsResponse

updateWafFirewall

updateWafFirewall({ firewall_id, [waf_firewall] })

Update a firewall object for a particular service and service version. Specifying a service_version_number is required.

Example

const options = {
  firewall_id: "firewall_id_example", // required
  waf_firewall: {"data":{"id":"fW7g2uUGZzb2W9Euo4Mo0r","type":"waf_firewall","attributes":{"response":"NEW_RESPONSE","service_version_number":1}}},
};

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

Options

Name Type Description Notes
firewall_id String Alphanumeric string identifying a WAF Firewall.
waf_firewall WafFirewall [optional]

Return type

WafFirewallResponse

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