Skip to main content

authorization_policies

Creates, updates, deletes, gets or lists an authorization_policies resource.

Overview

Nameauthorization_policies
TypeResource
Idgoogle.networksecurity.authorization_policies

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringRequired. Name of the AuthorizationPolicy resource. It matches pattern projects/{project}/locations/{location}/authorizationPolicies/.
actionstringRequired. The action to take when a rule match is found. Possible values are "ALLOW" or "DENY".
createTimestring (google-datetime)Output only. The timestamp when the resource was created.
descriptionstringOptional. Free-text description of the resource.
labelsobjectOptional. Set of label tags associated with the AuthorizationPolicy resource.
rulesarrayOptional. List of rules to match. Note that at least one of the rules must match in order for the action specified in the 'action' field to be taken. A rule is a match if there is a matching source and destination. If left blank, the action specified in the action field will be applied on every request.
updateTimestring (google-datetime)Output only. The timestamp when the resource was updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_authorization_policies_getselectprojectsId, locationsId, authorizationPoliciesIdGets details of a single AuthorizationPolicy.
projects_locations_authorization_policies_listselectprojectsId, locationsIdpageSize, pageTokenLists AuthorizationPolicies in a given project and location.
projects_locations_authorization_policies_createinsertprojectsId, locationsIdauthorizationPolicyIdCreates a new AuthorizationPolicy in a given project and location.
projects_locations_authorization_policies_patchupdateprojectsId, locationsId, authorizationPoliciesIdupdateMaskUpdates the parameters of a single AuthorizationPolicy.
projects_locations_authorization_policies_deletedeleteprojectsId, locationsId, authorizationPoliciesIdDeletes a single AuthorizationPolicy.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
authorizationPoliciesIdstring
locationsIdstring
projectsIdstring
authorizationPolicyIdstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets details of a single AuthorizationPolicy.

SELECT
name,
action,
createTime,
description,
labels,
rules,
updateTime
FROM google.networksecurity.authorization_policies
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND authorizationPoliciesId = '{{ authorizationPoliciesId }}' -- required;

INSERT examples

Creates a new AuthorizationPolicy in a given project and location.

INSERT INTO google.networksecurity.authorization_policies (
data__name,
data__description,
data__labels,
data__action,
data__rules,
projectsId,
locationsId,
authorizationPolicyId
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ labels }}',
'{{ action }}',
'{{ rules }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ authorizationPolicyId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates the parameters of a single AuthorizationPolicy.

UPDATE google.networksecurity.authorization_policies
SET
data__name = '{{ name }}',
data__description = '{{ description }}',
data__labels = '{{ labels }}',
data__action = '{{ action }}',
data__rules = '{{ rules }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND authorizationPoliciesId = '{{ authorizationPoliciesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a single AuthorizationPolicy.

DELETE FROM google.networksecurity.authorization_policies
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND authorizationPoliciesId = '{{ authorizationPoliciesId }}' --required;