Skip to main content

authorization_policies

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

Overview

Nameauthorization_policies
TypeResource
Idgoogle.networksecurity.authorization_policies

Fields

NameDatatypeDescription
namestringRequired. Name of the AuthorizationPolicy resource. It matches pattern projects/{project}/locations/{location}/authorizationPolicies/.
descriptionstringOptional. Free-text description of the resource.
actionstringRequired. The action to take when a rule match is found. Possible values are "ALLOW" or "DENY".
createTimestringOutput only. The timestamp when the resource was created.
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.
updateTimestringOutput only. The timestamp when the resource was updated.

Methods

NameAccessible byRequired ParamsDescription
projects_locations_authorization_policies_getSELECTauthorizationPoliciesId, locationsId, projectsIdGets details of a single AuthorizationPolicy.
projects_locations_authorization_policies_listSELECTlocationsId, projectsIdLists AuthorizationPolicies in a given project and location.
projects_locations_authorization_policies_createINSERTlocationsId, projectsIdCreates a new AuthorizationPolicy in a given project and location.
projects_locations_authorization_policies_deleteDELETEauthorizationPoliciesId, locationsId, projectsIdDeletes a single AuthorizationPolicy.
projects_locations_authorization_policies_patchUPDATEauthorizationPoliciesId, locationsId, projectsIdUpdates the parameters of a single AuthorizationPolicy.

SELECT examples

Lists AuthorizationPolicies in a given project and location.

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

INSERT example

Use the following StackQL query and manifest file to create a new authorization_policies resource.

/*+ create */
INSERT INTO google.networksecurity.authorization_policies (
locationsId,
projectsId,
name,
description,
labels,
action,
rules
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ name }}',
'{{ description }}',
'{{ labels }}',
'{{ action }}',
'{{ rules }}'
;

UPDATE example

Updates a authorization_policies resource.

/*+ update */
UPDATE google.networksecurity.authorization_policies
SET
name = '{{ name }}',
description = '{{ description }}',
labels = '{{ labels }}',
action = '{{ action }}',
rules = '{{ rules }}'
WHERE
authorizationPoliciesId = '{{ authorizationPoliciesId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

DELETE example

Deletes the specified authorization_policies resource.

/*+ delete */
DELETE FROM google.networksecurity.authorization_policies
WHERE authorizationPoliciesId = '{{ authorizationPoliciesId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';