class ResourcePolicies extends Resource (View source)

The "resourcePolicies" collection of methods.

Typical usage is:

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

Methods

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

Retrieves an aggregated list of resource policies. To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.

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

Deletes the specified resource policy. (resourcePolicies.delete)

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

Retrieves all information of the specified resource policy.

getIamPolicy(string $project, string $region, string $resource, array $optParams = [])

Gets the access control policy for a resource. May be empty if no such policy or resource exists. (resourcePolicies.getIamPolicy)

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

Creates a new resource policy. (resourcePolicies.insert)

listResourcePolicies(string $project, string $region, array $optParams = [])

A list all the resource policies that have been configured for the specified project in specified region. (resourcePolicies.listResourcePolicies)

patch(string $project, string $region, string $resourcePolicy, ResourcePolicy $postBody, array $optParams = [])

Modify the specified resource policy. (resourcePolicies.patch)

setIamPolicy(string $project, string $region, string $resource, RegionSetPolicyRequest $postBody, array $optParams = [])

Sets the access control policy on the specified resource. Replaces any existing policy. (resourcePolicies.setIamPolicy)

testIamPermissions(string $project, string $region, string $resource, TestPermissionsRequest $postBody, array $optParams = [])

Returns permissions that a caller has on the specified resource.

Details

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

Retrieves an aggregated list of resource policies. To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.

(resourcePolicies.aggregatedList)

Parameters

string $project

Project ID for this request.

array $optParams

Optional parameters.

Return Value

ResourcePolicyAggregatedList

Exceptions

Exception

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

Deletes the specified resource policy. (resourcePolicies.delete)

Parameters

string $project

Project ID for this request.

string $region

Name of the region for this request.

string $resourcePolicy

Name of the resource policy to delete.

array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

ResourcePolicy get(string $project, string $region, string $resourcePolicy, array $optParams = [])

Retrieves all information of the specified resource policy.

(resourcePolicies.get)

Parameters

string $project

Project ID for this request.

string $region

Name of the region for this request.

string $resourcePolicy

Name of the resource policy to retrieve.

array $optParams

Optional parameters.

Return Value

ResourcePolicy

Exceptions

Exception

Policy getIamPolicy(string $project, string $region, string $resource, array $optParams = [])

Gets the access control policy for a resource. May be empty if no such policy or resource exists. (resourcePolicies.getIamPolicy)

Parameters

string $project

Project ID for this request.

string $region

The name of the region for this request.

string $resource

Name or id of the resource for this request.

array $optParams

Optional parameters.

Return Value

Policy

Exceptions

Exception

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

Creates a new resource policy. (resourcePolicies.insert)

Parameters

string $project

Project ID for this request.

string $region

Name of the region for this request.

ResourcePolicy $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

ResourcePolicyList listResourcePolicies(string $project, string $region, array $optParams = [])

A list all the resource policies that have been configured for the specified project in specified region. (resourcePolicies.listResourcePolicies)

Parameters

string $project

Project ID for this request.

string $region

Name of the region for this request.

array $optParams

Optional parameters.

Return Value

ResourcePolicyList

Exceptions

Exception

Operation patch(string $project, string $region, string $resourcePolicy, ResourcePolicy $postBody, array $optParams = [])

Modify the specified resource policy. (resourcePolicies.patch)

Parameters

string $project

Project ID for this request.

string $region

Name of the region for this request.

string $resourcePolicy

Id of the resource policy to patch.

ResourcePolicy $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

Policy setIamPolicy(string $project, string $region, string $resource, RegionSetPolicyRequest $postBody, array $optParams = [])

Sets the access control policy on the specified resource. Replaces any existing policy. (resourcePolicies.setIamPolicy)

Parameters

string $project

Project ID for this request.

string $region

The name of the region for this request.

string $resource

Name or id of the resource for this request.

RegionSetPolicyRequest $postBody
array $optParams

Optional parameters.

Return Value

Policy

Exceptions

Exception

TestPermissionsResponse testIamPermissions(string $project, string $region, string $resource, TestPermissionsRequest $postBody, array $optParams = [])

Returns permissions that a caller has on the specified resource.

(resourcePolicies.testIamPermissions)

Parameters

string $project

Project ID for this request.

string $region

The name of the region for this request.

string $resource

Name or id of the resource for this request.

TestPermissionsRequest $postBody
array $optParams

Optional parameters.

Return Value

TestPermissionsResponse

Exceptions

Exception