authorization_policies
Creates, updates, deletes, gets or lists a authorization_policies
resource.
Overview
Name | authorization_policies |
Type | Resource |
Id | google.networksecurity.authorization_policies |
Fields
Name | Datatype | Description |
---|---|---|
name | string | Required. Name of the AuthorizationPolicy resource. It matches pattern projects/{project}/locations/{location}/authorizationPolicies/ . |
description | string | Optional. Free-text description of the resource. |
action | string | Required. The action to take when a rule match is found. Possible values are "ALLOW" or "DENY". |
createTime | string | Output only. The timestamp when the resource was created. |
labels | object | Optional. Set of label tags associated with the AuthorizationPolicy resource. |
rules | array | Optional. 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. |
updateTime | string | Output only. The timestamp when the resource was updated. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
projects_locations_authorization_policies_get | SELECT | authorizationPoliciesId, locationsId, projectsId | Gets details of a single AuthorizationPolicy. |
projects_locations_authorization_policies_list | SELECT | locationsId, projectsId | Lists AuthorizationPolicies in a given project and location. |
projects_locations_authorization_policies_create | INSERT | locationsId, projectsId | Creates a new AuthorizationPolicy in a given project and location. |
projects_locations_authorization_policies_delete | DELETE | authorizationPoliciesId, locationsId, projectsId | Deletes a single AuthorizationPolicy. |
projects_locations_authorization_policies_patch | UPDATE | authorizationPoliciesId, locationsId, projectsId | Updates 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.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.networksecurity.authorization_policies (
locationsId,
projectsId,
name,
description,
labels,
action,
rules
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ name }}',
'{{ description }}',
'{{ labels }}',
'{{ action }}',
'{{ rules }}'
;
- name: your_resource_model_name
props:
- name: name
value: string
- name: description
value: string
- name: createTime
value: string
- name: updateTime
value: string
- name: labels
value: object
- name: action
value: string
- name: rules
value:
- - name: sources
value:
- - name: principals
value:
- string
- name: ipBlocks
value:
- string
- name: destinations
value:
- - name: hosts
value:
- string
- name: ports
value:
- integer
- name: methods
value:
- string
- name: httpHeaderMatch
value:
- name: regexMatch
value: string
- name: headerName
value: string
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 }}';