Skip to main content

data_policies_grantees

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

Overview

Namedata_policies_grantees
TypeResource
Idgoogle.bigquerydatapolicy.data_policies_grantees

Fields

The following fields are returned by SELECT queries:

SELECT not supported for this resource, use SHOW METHODS to view available operations for the resource.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
add_granteesinsertprojectsId, locationsId, dataPoliciesIdAdds new grantees to a data policy. The new grantees will be added to the existing grantees. If the request contains a duplicate grantee, the grantee will be ignored. If the request contains a grantee that already exists, the grantee will be ignored.
remove_granteesdeleteprojectsId, locationsId, dataPoliciesIdRemoves grantees from a data policy. The grantees will be removed from the existing grantees. If the request contains a grantee that does not exist, the grantee will be ignored.

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
dataPoliciesIdstring
locationsIdstring
projectsIdstring

INSERT examples

Adds new grantees to a data policy. The new grantees will be added to the existing grantees. If the request contains a duplicate grantee, the grantee will be ignored. If the request contains a grantee that already exists, the grantee will be ignored.

INSERT INTO google.bigquerydatapolicy.data_policies_grantees (
data__grantees,
projectsId,
locationsId,
dataPoliciesId
)
SELECT
'{{ grantees }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ dataPoliciesId }}'
RETURNING
name,
dataMaskingPolicy,
dataPolicyId,
dataPolicyType,
etag,
grantees,
policyTag,
version
;

DELETE examples

Removes grantees from a data policy. The grantees will be removed from the existing grantees. If the request contains a grantee that does not exist, the grantee will be ignored.

DELETE FROM google.bigquerydatapolicy.data_policies_grantees
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND dataPoliciesId = '{{ dataPoliciesId }}' --required
;