Skip to content

Latest commit

 

History

History
133 lines (94 loc) · 4.54 KB

LegacyWafRulesetApi.md

File metadata and controls

133 lines (94 loc) · 4.54 KB

Fastly\Api\LegacyWafRulesetApi

$apiInstance = new Fastly\Api\LegacyWafRulesetApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

Methods

Note

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

Method HTTP request Description
getWafRuleset() GET /service/{service_id}/wafs/{firewall_id}/ruleset Get a WAF ruleset
getWafRulesetVcl() GET /service/{service_id}/wafs/{firewall_id}/ruleset/preview Generate WAF ruleset VCL
updateWafRuleset() PATCH /service/{service_id}/wafs/{firewall_id}/ruleset Update a WAF ruleset

getWafRuleset()

getWafRuleset($options): object // Get a WAF ruleset

Get a WAF ruleset for a particular service and firewall object.

Example

    $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service.
$options['firewall_id'] = 'firewall_id_example'; // string | Alphanumeric string identifying a Firewall.

try {
    $result = $apiInstance->getWafRuleset($options);
} catch (Exception $e) {
    echo 'Exception when calling LegacyWafRulesetApi->getWafRuleset: ', $e->getMessage(), PHP_EOL;
}

Options

Note: the input parameter is an associative array with the keys listed below.

Name Type Description Notes
service_id string Alphanumeric string identifying the service.
firewall_id string Alphanumeric string identifying a Firewall.

Return type

object

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

getWafRulesetVcl()

getWafRulesetVcl($options): object // Generate WAF ruleset VCL

Get a preview of the WAF ruleset VCL for a particular service and firewall object based on changes to WAF configuration before deploying the ruleset. The response will include a link to status of the background VCL generation job. Once the background job is completed, the preview WAF ruleset VCL can be retrieved from the status response.

Example

    $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service.
$options['firewall_id'] = 'firewall_id_example'; // string | Alphanumeric string identifying a Firewall.

try {
    $result = $apiInstance->getWafRulesetVcl($options);
} catch (Exception $e) {
    echo 'Exception when calling LegacyWafRulesetApi->getWafRulesetVcl: ', $e->getMessage(), PHP_EOL;
}

Options

Note: the input parameter is an associative array with the keys listed below.

Name Type Description Notes
service_id string Alphanumeric string identifying the service.
firewall_id string Alphanumeric string identifying a Firewall.

Return type

object

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

updateWafRuleset()

updateWafRuleset($options): object // Update a WAF ruleset

Update the WAF ruleset for a particular service and firewall object. Use the URL in the response to view the WAF ruleset deploy status.

Example

    $options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service.
$options['firewall_id'] = 'firewall_id_example'; // string | Alphanumeric string identifying a Firewall.
$options['request_body'] = {"data":{"id":"r5TguUGZzb2W9EuF4mo0N","type":"ruleset"}}; // array<string,object>

try {
    $result = $apiInstance->updateWafRuleset($options);
} catch (Exception $e) {
    echo 'Exception when calling LegacyWafRulesetApi->updateWafRuleset: ', $e->getMessage(), PHP_EOL;
}

Options

Note: the input parameter is an associative array with the keys listed below.

Name Type Description Notes
service_id string Alphanumeric string identifying the service.
firewall_id string Alphanumeric string identifying a Firewall.
request_body array<string,object> [optional]

Return type

object

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