class SecurityPolicies extends Resource (View source)

The "securityPolicies" collection of methods.

Typical usage is:

 $computeService = new Google\Service\Compute(...);
 $securityPolicies = $computeService->securityPolicies;

Methods

addRule(string $project, string $securityPolicy, SecurityPolicyRule $postBody, array $optParams = [])

Inserts a rule into a security policy. (securityPolicies.addRule)

aggregatedList(string $project, array $optParams = [])

Retrieves the list of all SecurityPolicy resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.

delete(string $project, string $securityPolicy, array $optParams = [])

Deletes the specified policy. (securityPolicies.delete)

get(string $project, string $securityPolicy, array $optParams = [])

List all of the ordered rules present in a single specified policy.

getRule(string $project, string $securityPolicy, array $optParams = [])

Gets a rule at the specified priority. (securityPolicies.getRule)

insert(string $project, SecurityPolicy $postBody, array $optParams = [])

Creates a new policy in the specified project using the data included in the request. (securityPolicies.insert)

listSecurityPolicies(string $project, array $optParams = [])

List all the policies that have been configured for the specified project.

listPreconfiguredExpressionSets(string $project, array $optParams = [])

Gets the current list of preconfigured Web Application Firewall (WAF) expressions. (securityPolicies.listPreconfiguredExpressionSets)

patch(string $project, string $securityPolicy, SecurityPolicy $postBody, array $optParams = [])

Patches the specified policy with the data included in the request. To clear fields in the policy, leave the fields empty and specify them in the updateMask. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead.

patchRule(string $project, string $securityPolicy, SecurityPolicyRule $postBody, array $optParams = [])

Patches a rule at the specified priority. To clear fields in the rule, leave the fields empty and specify them in the updateMask.

removeRule(string $project, string $securityPolicy, array $optParams = [])

Deletes a rule at the specified priority. (securityPolicies.removeRule)

setLabels(string $project, string $resource, GlobalSetLabelsRequest $postBody, array $optParams = [])

Sets the labels on a security policy. To learn more about labels, read the Labeling Resources documentation. (securityPolicies.setLabels)

Details

Operation addRule(string $project, string $securityPolicy, SecurityPolicyRule $postBody, array $optParams = [])

Inserts a rule into a security policy. (securityPolicies.addRule)

Parameters

string $project

Project ID for this request.

string $securityPolicy

Name of the security policy to update.

SecurityPolicyRule $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

SecurityPoliciesAggregatedList aggregatedList(string $project, array $optParams = [])

Retrieves the list of all SecurityPolicy resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.

(securityPolicies.aggregatedList)

Parameters

string $project

Name of the project scoping this request.

array $optParams

Optional parameters.

Return Value

SecurityPoliciesAggregatedList

Exceptions

Exception

Operation delete(string $project, string $securityPolicy, array $optParams = [])

Deletes the specified policy. (securityPolicies.delete)

Parameters

string $project

Project ID for this request.

string $securityPolicy

Name of the security policy to delete.

array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

SecurityPolicy get(string $project, string $securityPolicy, array $optParams = [])

List all of the ordered rules present in a single specified policy.

(securityPolicies.get)

Parameters

string $project

Project ID for this request.

string $securityPolicy

Name of the security policy to get.

array $optParams

Optional parameters.

Return Value

SecurityPolicy

Exceptions

Exception

SecurityPolicyRule getRule(string $project, string $securityPolicy, array $optParams = [])

Gets a rule at the specified priority. (securityPolicies.getRule)

Parameters

string $project

Project ID for this request.

string $securityPolicy

Name of the security policy to which the queried rule belongs.

array $optParams

Optional parameters.

Return Value

SecurityPolicyRule

Exceptions

Exception

Operation insert(string $project, SecurityPolicy $postBody, array $optParams = [])

Creates a new policy in the specified project using the data included in the request. (securityPolicies.insert)

Parameters

string $project

Project ID for this request.

SecurityPolicy $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

SecurityPolicyList listSecurityPolicies(string $project, array $optParams = [])

List all the policies that have been configured for the specified project.

(securityPolicies.listSecurityPolicies)

Parameters

string $project

Project ID for this request.

array $optParams

Optional parameters.

Return Value

SecurityPolicyList

Exceptions

Exception

SecurityPoliciesListPreconfiguredExpressionSetsResponse listPreconfiguredExpressionSets(string $project, array $optParams = [])

Gets the current list of preconfigured Web Application Firewall (WAF) expressions. (securityPolicies.listPreconfiguredExpressionSets)

Parameters

string $project

Project ID for this request.

array $optParams

Optional parameters.

Return Value

SecurityPoliciesListPreconfiguredExpressionSetsResponse

Exceptions

Exception

Operation patch(string $project, string $securityPolicy, SecurityPolicy $postBody, array $optParams = [])

Patches the specified policy with the data included in the request. To clear fields in the policy, leave the fields empty and specify them in the updateMask. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead.

(securityPolicies.patch)

Parameters

string $project

Project ID for this request.

string $securityPolicy

Name of the security policy to update.

SecurityPolicy $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

Operation patchRule(string $project, string $securityPolicy, SecurityPolicyRule $postBody, array $optParams = [])

Patches a rule at the specified priority. To clear fields in the rule, leave the fields empty and specify them in the updateMask.

(securityPolicies.patchRule)

Parameters

string $project

Project ID for this request.

string $securityPolicy

Name of the security policy to update.

SecurityPolicyRule $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

Operation removeRule(string $project, string $securityPolicy, array $optParams = [])

Deletes a rule at the specified priority. (securityPolicies.removeRule)

Parameters

string $project

Project ID for this request.

string $securityPolicy

Name of the security policy to update.

array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

Operation setLabels(string $project, string $resource, GlobalSetLabelsRequest $postBody, array $optParams = [])

Sets the labels on a security policy. To learn more about labels, read the Labeling Resources documentation. (securityPolicies.setLabels)

Parameters

string $project

Project ID for this request.

string $resource

Name or id of the resource for this request.

GlobalSetLabelsRequest $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception