authorization_policies
Creates, updates, deletes, gets or lists an authorization_policies
resource.
Overview
Name | authorization_policies |
Type | Resource |
Id | google.networksecurity.authorization_policies |
Fields
The following fields are returned by SELECT
queries:
- projects_locations_authorization_policies_get
- projects_locations_authorization_policies_list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Required. Name of the AuthorizationPolicy resource. It matches pattern projects/{project}/locations/{location}/authorizationPolicies/ . |
action | string | Required. The action to take when a rule match is found. Possible values are "ALLOW" or "DENY". |
createTime | string (google-datetime) | Output only. The timestamp when the resource was created. |
description | string | Optional. Free-text description of the resource. |
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 (google-datetime) | Output only. The timestamp when the resource was updated. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Required. Name of the AuthorizationPolicy resource. It matches pattern projects/{project}/locations/{location}/authorizationPolicies/ . |
action | string | Required. The action to take when a rule match is found. Possible values are "ALLOW" or "DENY". |
createTime | string (google-datetime) | Output only. The timestamp when the resource was created. |
description | string | Optional. Free-text description of the resource. |
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 (google-datetime) | Output only. The timestamp when the resource was updated. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
projects_locations_authorization_policies_get | select | projectsId , locationsId , authorizationPoliciesId | Gets details of a single AuthorizationPolicy. | |
projects_locations_authorization_policies_list | select | projectsId , locationsId | pageSize , pageToken | Lists AuthorizationPolicies in a given project and location. |
projects_locations_authorization_policies_create | insert | projectsId , locationsId | authorizationPolicyId | Creates a new AuthorizationPolicy in a given project and location. |
projects_locations_authorization_policies_patch | update | projectsId , locationsId , authorizationPoliciesId | updateMask | Updates the parameters of a single AuthorizationPolicy. |
projects_locations_authorization_policies_delete | delete | projectsId , locationsId , authorizationPoliciesId | Deletes 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.
Name | Datatype | Description |
---|---|---|
authorizationPoliciesId | string | |
locationsId | string | |
projectsId | string | |
authorizationPolicyId | string | |
pageSize | integer (int32) | |
pageToken | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- projects_locations_authorization_policies_get
- projects_locations_authorization_policies_list
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;
Lists AuthorizationPolicies in a given project and location.
SELECT
name,
action,
createTime,
description,
labels,
rules,
updateTime
FROM google.networksecurity.authorization_policies
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';
INSERT
examples
- projects_locations_authorization_policies_create
- Manifest
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
;
# Description fields are for documentation purposes
- name: authorization_policies
props:
- name: projectsId
value: string
description: Required parameter for the authorization_policies resource.
- name: locationsId
value: string
description: Required parameter for the authorization_policies resource.
- name: name
value: string
description: >
Required. Name of the AuthorizationPolicy resource. It matches pattern `projects/{project}/locations/{location}/authorizationPolicies/`.
- name: description
value: string
description: >
Optional. Free-text description of the resource.
- name: labels
value: object
description: >
Optional. Set of label tags associated with the AuthorizationPolicy resource.
- name: action
value: string
description: >
Required. The action to take when a rule match is found. Possible values are "ALLOW" or "DENY".
valid_values: ['ACTION_UNSPECIFIED', 'ALLOW', 'DENY']
- name: rules
value: array
description: >
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.
- name: authorizationPolicyId
value: string
UPDATE
examples
- projects_locations_authorization_policies_patch
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
- projects_locations_authorization_policies_delete
Deletes a single AuthorizationPolicy.
DELETE FROM google.networksecurity.authorization_policies
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND authorizationPoliciesId = '{{ authorizationPoliciesId }}' --required;