Skip to content

Latest commit

 

History

History
766 lines (540 loc) · 23.7 KB

File metadata and controls

766 lines (540 loc) · 23.7 KB

Fastly\Api\ClientSideProtectionApi

$apiInstance = new Fastly\Api\ClientSideProtectionApi(
    // 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
cspCreatePage() POST /client-side-protection/v1/pages Create page
cspCreatePolicy() POST /client-side-protection/v1/pages/{page_id}/policies Create policy
cspCreateWebsite() POST /client-side-protection/v1/websites Create website
cspDeletePage() DELETE /client-side-protection/v1/pages/{page_id} Delete page
cspDeleteWebsite() DELETE /client-side-protection/v1/websites/{website_id} Delete website
cspGetPage() GET /client-side-protection/v1/pages/{page_id} Get page
cspGetPolicy() GET /client-side-protection/v1/pages/{page_id}/policies/{policy_id} Get policy
cspGetScript() GET /client-side-protection/v1/pages/{page_id}/scripts/{script_id} Get script
cspGetWebsite() GET /client-side-protection/v1/websites/{website_id} Get website
cspListHeaderEvents() GET /client-side-protection/v1/pages/{page_id}/events List header events
cspListHeaders() GET /client-side-protection/v1/pages/{page_id}/headers List security headers
cspListPages() GET /client-side-protection/v1/pages List pages
cspListPolicies() GET /client-side-protection/v1/pages/{page_id}/policies List policies
cspListPolicyReports() GET /client-side-protection/v1/pages/{page_id}/policies/{policy_id}/reports List policy reports
cspListScripts() GET /client-side-protection/v1/pages/{page_id}/scripts List scripts
cspListWebsites() GET /client-side-protection/v1/websites List websites
cspUpdatePage() PATCH /client-side-protection/v1/pages/{page_id} Update page
cspUpdatePolicy() PATCH /client-side-protection/v1/pages/{page_id}/policies/{policy_id} Update policy
cspUpdateScript() PATCH /client-side-protection/v1/pages/{page_id}/scripts/{script_id} Update script
cspUpdateWebsite() PATCH /client-side-protection/v1/websites/{website_id} Update website

cspCreatePage()

cspCreatePage($options): \Fastly\Model\Page // Create page

Create a new page for monitoring.

Example

    $options['page_create'] = new \Fastly\Model\PageCreate(); // \Fastly\Model\PageCreate

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

Options

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

Name Type Description Notes
page_create \Fastly\Model\PageCreate [optional]

Return type

\Fastly\Model\Page

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

cspCreatePolicy()

cspCreatePolicy($options): \Fastly\Model\Policy // Create policy

Create a new Content Security Policy for a page.

Example

    $options['page_id'] = 3Yl0KhQDlg2OaWtOnLsFDq; // string | Page identifier
$options['policy_create'] = new \Fastly\Model\PolicyCreate(); // \Fastly\Model\PolicyCreate

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

Options

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

Name Type Description Notes
page_id string Page identifier
policy_create \Fastly\Model\PolicyCreate [optional]

Return type

\Fastly\Model\Policy

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

cspCreateWebsite()

cspCreateWebsite($options): \Fastly\Model\Website // Create website

Create a new website for Client-Side Protection monitoring.

Example

    $options['website_create'] = new \Fastly\Model\WebsiteCreate(); // \Fastly\Model\WebsiteCreate

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

Options

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

Name Type Description Notes
website_create \Fastly\Model\WebsiteCreate [optional]

Return type

\Fastly\Model\Website

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

cspDeletePage()

cspDeletePage($options) // Delete page

Delete a page and all associated scripts and policies.

Example

    $options['page_id'] = 3Yl0KhQDlg2OaWtOnLsFDq; // string | Page identifier

try {
    $apiInstance->cspDeletePage($options);
} catch (Exception $e) {
    echo 'Exception when calling ClientSideProtectionApi->cspDeletePage: ', $e->getMessage(), PHP_EOL;
}

Options

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

Name Type Description Notes
page_id string Page identifier

Return type

void (empty response body)

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

cspDeleteWebsite()

cspDeleteWebsite($options) // Delete website

Delete a website and all associated pages, scripts, and policies.

Example

    $options['website_id'] = 2Xk9JgPCkf1NzVsNmKrECp; // string | Website identifier

try {
    $apiInstance->cspDeleteWebsite($options);
} catch (Exception $e) {
    echo 'Exception when calling ClientSideProtectionApi->cspDeleteWebsite: ', $e->getMessage(), PHP_EOL;
}

Options

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

Name Type Description Notes
website_id string Website identifier

Return type

void (empty response body)

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

cspGetPage()

cspGetPage($options): \Fastly\Model\Page // Get page

Get details for a specific page.

Example

    $options['page_id'] = 3Yl0KhQDlg2OaWtOnLsFDq; // string | Page identifier

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

Options

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

Name Type Description Notes
page_id string Page identifier

Return type

\Fastly\Model\Page

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

cspGetPolicy()

cspGetPolicy($options): \Fastly\Model\Policy // Get policy

Get details for a specific policy.

Example

    $options['page_id'] = 3Yl0KhQDlg2OaWtOnLsFDq; // string | Page identifier
$options['policy_id'] = 7Cp4OlUHqj6SfAwSrQwJHu; // string | Policy identifier

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

Options

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

Name Type Description Notes
page_id string Page identifier
policy_id string Policy identifier

Return type

\Fastly\Model\Policy

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

cspGetScript()

cspGetScript($options): \Fastly\Model\Script // Get script

Get details for a specific script.

Example

    $options['page_id'] = 3Yl0KhQDlg2OaWtOnLsFDq; // string | Page identifier
$options['script_id'] = 5An2MjSFoh4QcYvQpNuHFs; // string | Script identifier

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

Options

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

Name Type Description Notes
page_id string Page identifier
script_id string Script identifier

Return type

\Fastly\Model\Script

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

cspGetWebsite()

cspGetWebsite($options): \Fastly\Model\Website // Get website

Get details for a specific website.

Example

    $options['website_id'] = 2Xk9JgPCkf1NzVsNmKrECp; // string | Website identifier

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

Options

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

Name Type Description Notes
website_id string Website identifier

Return type

\Fastly\Model\Website

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

cspListHeaderEvents()

cspListHeaderEvents($options): \Fastly\Model\InlineResponse20011 // List header events

List security header change events for a page.

Example

    $options['page_id'] = 3Yl0KhQDlg2OaWtOnLsFDq; // string | Page identifier
$options['limit'] = 100; // int | Limit how many results are returned.
$options['page'] = 1; // int | Page number of the collection to request.

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

Options

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

Name Type Description Notes
page_id string Page identifier
limit int Limit how many results are returned. [optional] [defaults to 100]
page int Page number of the collection to request. [optional] [defaults to 0]

Return type

\Fastly\Model\InlineResponse20011

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

cspListHeaders()

cspListHeaders($options): \Fastly\Model\InlineResponse20010 // List security headers

List security headers detected on a page.

Example

    $options['page_id'] = 3Yl0KhQDlg2OaWtOnLsFDq; // string | Page identifier
$options['limit'] = 100; // int | Limit how many results are returned.
$options['page'] = 1; // int | Page number of the collection to request.

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

Options

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

Name Type Description Notes
page_id string Page identifier
limit int Limit how many results are returned. [optional] [defaults to 100]
page int Page number of the collection to request. [optional] [defaults to 0]

Return type

\Fastly\Model\InlineResponse20010

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

cspListPages()

cspListPages($options): \Fastly\Model\InlineResponse2006 // List pages

List all pages. Optionally filter by website.

Example

    $options['website_id'] = 'website_id_example'; // string | Filter pages by website ID
$options['limit'] = 100; // int | Limit how many results are returned.
$options['page'] = 1; // int | Page number of the collection to request.

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

Options

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

Name Type Description Notes
website_id string Filter pages by website ID [optional]
limit int Limit how many results are returned. [optional] [defaults to 100]
page int Page number of the collection to request. [optional] [defaults to 0]

Return type

\Fastly\Model\InlineResponse2006

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

cspListPolicies()

cspListPolicies($options): \Fastly\Model\InlineResponse2008 // List policies

List all Content Security Policies for a page.

Example

    $options['page_id'] = 3Yl0KhQDlg2OaWtOnLsFDq; // string | Page identifier
$options['limit'] = 100; // int | Limit how many results are returned.
$options['page'] = 1; // int | Page number of the collection to request.

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

Options

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

Name Type Description Notes
page_id string Page identifier
limit int Limit how many results are returned. [optional] [defaults to 100]
page int Page number of the collection to request. [optional] [defaults to 0]

Return type

\Fastly\Model\InlineResponse2008

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

cspListPolicyReports()

cspListPolicyReports($options): \Fastly\Model\InlineResponse2009 // List policy reports

List CSP violation reports for a policy.

Example

    $options['page_id'] = 3Yl0KhQDlg2OaWtOnLsFDq; // string | Page identifier
$options['policy_id'] = 7Cp4OlUHqj6SfAwSrQwJHu; // string | Policy identifier
$options['limit'] = 100; // int | Limit how many results are returned.
$options['page'] = 1; // int | Page number of the collection to request.

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

Options

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

Name Type Description Notes
page_id string Page identifier
policy_id string Policy identifier
limit int Limit how many results are returned. [optional] [defaults to 100]
page int Page number of the collection to request. [optional] [defaults to 0]

Return type

\Fastly\Model\InlineResponse2009

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

cspListScripts()

cspListScripts($options): \Fastly\Model\InlineResponse2007 // List scripts

List all scripts detected on a page.

Example

    $options['page_id'] = 3Yl0KhQDlg2OaWtOnLsFDq; // string | Page identifier
$options['limit'] = 100; // int | Limit how many results are returned.
$options['page'] = 1; // int | Page number of the collection to request.

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

Options

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

Name Type Description Notes
page_id string Page identifier
limit int Limit how many results are returned. [optional] [defaults to 100]
page int Page number of the collection to request. [optional] [defaults to 0]

Return type

\Fastly\Model\InlineResponse2007

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

cspListWebsites()

cspListWebsites($options): \Fastly\Model\InlineResponse2005 // List websites

List all websites configured for Client-Side Protection.

Example

    $options['limit'] = 100; // int | Limit how many results are returned.
$options['page'] = 1; // int | Page number of the collection to request.

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

Options

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

Name Type Description Notes
limit int Limit how many results are returned. [optional] [defaults to 100]
page int Page number of the collection to request. [optional] [defaults to 0]

Return type

\Fastly\Model\InlineResponse2005

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

cspUpdatePage()

cspUpdatePage($options): \Fastly\Model\Page // Update page

Update a page's configuration.

Example

    $options['page_id'] = 3Yl0KhQDlg2OaWtOnLsFDq; // string | Page identifier
$options['page_update'] = new \Fastly\Model\PageUpdate(); // \Fastly\Model\PageUpdate

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

Options

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

Name Type Description Notes
page_id string Page identifier
page_update \Fastly\Model\PageUpdate [optional]

Return type

\Fastly\Model\Page

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

cspUpdatePolicy()

cspUpdatePolicy($options): \Fastly\Model\Policy // Update policy

Update a policy's configuration.

Example

    $options['page_id'] = 3Yl0KhQDlg2OaWtOnLsFDq; // string | Page identifier
$options['policy_id'] = 7Cp4OlUHqj6SfAwSrQwJHu; // string | Policy identifier
$options['policy_update'] = new \Fastly\Model\PolicyUpdate(); // \Fastly\Model\PolicyUpdate

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

Options

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

Name Type Description Notes
page_id string Page identifier
policy_id string Policy identifier
policy_update \Fastly\Model\PolicyUpdate [optional]

Return type

\Fastly\Model\Policy

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

cspUpdateScript()

cspUpdateScript($options): \Fastly\Model\Script // Update script

Update a script's authorization status or justification.

Example

    $options['page_id'] = 3Yl0KhQDlg2OaWtOnLsFDq; // string | Page identifier
$options['script_id'] = 5An2MjSFoh4QcYvQpNuHFs; // string | Script identifier
$options['script_update'] = new \Fastly\Model\ScriptUpdate(); // \Fastly\Model\ScriptUpdate

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

Options

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

Name Type Description Notes
page_id string Page identifier
script_id string Script identifier
script_update \Fastly\Model\ScriptUpdate [optional]

Return type

\Fastly\Model\Script

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

cspUpdateWebsite()

cspUpdateWebsite($options): \Fastly\Model\Website // Update website

Update a website's configuration.

Example

    $options['website_id'] = 2Xk9JgPCkf1NzVsNmKrECp; // string | Website identifier
$options['website_update'] = new \Fastly\Model\WebsiteUpdate(); // \Fastly\Model\WebsiteUpdate

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

Options

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

Name Type Description Notes
website_id string Website identifier
website_update \Fastly\Model\WebsiteUpdate [optional]

Return type

\Fastly\Model\Website

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