PolicyTagManagerClient(
transport=None,
channel=None,
credentials=None,
client_config=None,
client_info=None,
client_options=None,
)
Policy tag manager API service allows clients to manage their taxonomies and policy tags data.
Methods
PolicyTagManagerClient
PolicyTagManagerClient(
transport=None,
channel=None,
credentials=None,
client_config=None,
client_info=None,
client_options=None,
)
Constructor.
Parameters | |
---|---|
Name | Description |
channel |
grpc.Channel
DEPRECATED. A |
credentials |
google.auth.credentials.Credentials
The authorization credentials to attach to requests. These credentials identify this application to the service. If none are specified, the client will attempt to ascertain the credentials from the environment. This argument is mutually exclusive with providing a transport instance to |
client_config |
dict
DEPRECATED. A dictionary of call options for each method. If not specified, the default configuration is used. |
client_info |
google.api_core.gapic_v1.client_info.ClientInfo
The client info used to send a user-agent string along with API requests. If |
client_options |
Union[dict, google.api_core.client_options.ClientOptions]
Client options used to set user options on the client. API Endpoint should be set through client_options. |
create_policy_tag
create_policy_tag(parent=None, policy_tag=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Creates a policy tag in a taxonomy.
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.PolicyTagManagerClient()
response = client.create_policy_tag()
Parameters | |
---|---|
Name | Description |
parent |
str
Required. Resource name of the taxonomy that the newly created policy tag belongs to. |
policy_tag |
Union[dict, PolicyTag]
The policy tag to be created. The name, and taxonomy_display_name field must be left blank. The display_name field is mandatory and must not be duplicated with existing policy tags in the same taxonomy. If a dict is provided, it must be of the same form as the protobuf message PolicyTag |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
create_taxonomy
create_taxonomy(parent=None, taxonomy=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Creates a new taxonomy in a given project.
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.PolicyTagManagerClient()
response = client.create_taxonomy()
Parameters | |
---|---|
Name | Description |
parent |
str
Required. Resource name of the project that the newly created taxonomy belongs to. |
taxonomy |
Union[dict, Taxonomy]
The taxonomy to be created. The name field must be left blank. The display_name field is mandatory. If a dict is provided, it must be of the same form as the protobuf message Taxonomy |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
delete_policy_tag
delete_policy_tag(name=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Deletes a policy tag. Also deletes all of its descendant policy tags.
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.PolicyTagManagerClient()
client.delete_policy_tag()
Parameters | |
---|---|
Name | Description |
name |
str
Required. Resource name of the policy tag to be deleted. All its descendant policy tags will also be deleted. |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
delete_taxonomy
delete_taxonomy(name=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Deletes a taxonomy. This operation will also delete all policy tags in this taxonomy.
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.PolicyTagManagerClient()
client.delete_taxonomy()
Parameters | |
---|---|
Name | Description |
name |
str
Required. Resource name of the taxonomy to be deleted. All policy tags in this taxonomy will also be deleted. |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
from_service_account_file
from_service_account_file(filename, *args, **kwargs)
Creates an instance of this client using the provided credentials file.
Parameter | |
---|---|
Name | Description |
filename |
str
The path to the service account private key json file. |
Returns | |
---|---|
Type | Description |
PolicyTagManagerClient | The constructed client. |
from_service_account_json
from_service_account_json(filename, *args, **kwargs)
Creates an instance of this client using the provided credentials file.
Parameter | |
---|---|
Name | Description |
filename |
str
The path to the service account private key json file. |
Returns | |
---|---|
Type | Description |
PolicyTagManagerClient | The constructed client. |
get_iam_policy
get_iam_policy(resource=None, options_=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Gets the IAM policy for a taxonomy or a policy tag.
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.PolicyTagManagerClient()
response = client.get_iam_policy()
Parameters | |
---|---|
Name | Description |
resource |
str
REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
options_ |
Union[dict, GetPolicyOptions]
OPTIONAL: A |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
get_policy_tag
get_policy_tag(name=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Gets a policy tag.
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.PolicyTagManagerClient()
response = client.get_policy_tag()
Parameters | |
---|---|
Name | Description |
name |
str
Required. Resource name of the policy tag to be returned. |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
get_taxonomy
get_taxonomy(name=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Gets a taxonomy.
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.PolicyTagManagerClient()
response = client.get_taxonomy()
Parameters | |
---|---|
Name | Description |
name |
str
Required. Resource name of the taxonomy to be returned. |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
list_policy_tags
list_policy_tags(parent=None, page_size=None, page_token=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Lists all policy tags in a taxonomy.
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.PolicyTagManagerClient()
response = client.list_policy_tags()
Parameters | |
---|---|
Name | Description |
parent |
str
Required. Resource name of a taxonomy to list the policy tags of. |
page_size |
int
The maximum number of items to return. If not set, defaults to 50. |
page_token |
str
The next_page_token value returned from a previous List request, if any. If not set, defaults to an empty string. |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
list_taxonomies
list_taxonomies(parent=None, page_size=None, page_token=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Lists all taxonomies in a project in a particular location.
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.PolicyTagManagerClient()
response = client.list_taxonomies()
Parameters | |
---|---|
Name | Description |
parent |
str
Required. Resource name of a project to list the taxonomies of. |
page_size |
int
The maximum number of items to return. If not set, defaults to 50. |
page_token |
str
The next_page_token value returned from a previous list request, if any. If not set, defaults to an empty string. |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
set_iam_policy
set_iam_policy(resource=None, policy=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Sets the IAM policy for a taxonomy or a policy tag.
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.PolicyTagManagerClient()
response = client.set_iam_policy()
Parameters | |
---|---|
Name | Description |
resource |
str
REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
policy |
Union[dict, Policy]
REQUIRED: The complete policy to be applied to the |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
test_iam_permissions
test_iam_permissions(resource=None, permissions=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Returns permissions that a caller has on specified resources.
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.PolicyTagManagerClient()
response = client.test_iam_permissions()
Parameters | |
---|---|
Name | Description |
resource |
str
REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. |
permissions |
list[str]
The set of permissions to check for the |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
update_policy_tag
update_policy_tag(policy_tag=None, update_mask=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Updates a policy tag.
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.PolicyTagManagerClient()
response = client.update_policy_tag()
Parameters | |
---|---|
Name | Description |
policy_tag |
Union[dict, PolicyTag]
The policy tag to update. Only the description, display_name, and parent_policy_tag fields can be updated. If a dict is provided, it must be of the same form as the protobuf message PolicyTag |
update_mask |
Union[dict, FieldMask]
The update mask applies to the resource. Only display_name, description and parent_policy_tag can be updated and thus can be listed in the mask. If update_mask is not provided, all allowed fields (i.e. display_name, description and parent) will be updated. For more information including the |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |
update_taxonomy
update_taxonomy(taxonomy=None, update_mask=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Updates a taxonomy.
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.PolicyTagManagerClient()
response = client.update_taxonomy()
Parameters | |
---|---|
Name | Description |
taxonomy |
Union[dict, Taxonomy]
The taxonomy to update. Only description, display_name, and activated policy types can be updated. If a dict is provided, it must be of the same form as the protobuf message Taxonomy |
update_mask |
Union[dict, FieldMask]
The update mask applies to the resource. For the |
retry |
Optional[google.api_core.retry.Retry]
A retry object used to retry requests. If |
timeout |
Optional[float]
The amount of time, in seconds, to wait for the request to complete. Note that if |
metadata |
Optional[Sequence[Tuple[str, str]]]
Additional metadata that is provided to the method. |
Exceptions | |
---|---|
Type | Description |
google.api_core.exceptions.GoogleAPICallError | If the request failed for any reason. |
google.api_core.exceptions.RetryError | If the request failed due to a retryable error and retry attempts failed. |
ValueError | If the parameters are invalid. |