Class PolicyTagManagerClient (0.7.0)

PolicyTagManagerClient(
    transport=None,
    channel=None,
    credentials=None,
    client_config=None,
    client_info=None,
    client_options=None,
)

The policy tag manager API service allows clients to manage their taxonomies and policy tags.

Methods

PolicyTagManagerClient

PolicyTagManagerClient(
    transport=None,
    channel=None,
    credentials=None,
    client_config=None,
    client_info=None,
    client_options=None,
)

Constructor.

Parameters
NameDescription
channel grpc.Channel

DEPRECATED. A Channel instance through which to make calls. This argument is mutually exclusive with credentials; providing both will raise an exception.

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 transport; doing so will raise an exception.

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 None, then default info will be used. Generally, you only need to set this if you're developing your own client library.

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 the specified taxonomy.

.. rubric:: Example

from google.cloud import datacatalog_v1beta1

client = datacatalog_v1beta1.PolicyTagManagerClient()

response = client.create_policy_tag()

Parameters
NameDescription
parent str

Required. Resource name of the taxonomy that the policy tag will belong to.

policy_tag Union[dict, PolicyTag]

The policy tag to be created. 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 None is specified, requests will be retried using a default configuration.

timeout Optional[float]

The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt.

metadata Optional[Sequence[Tuple[str, str]]]

Additional metadata that is provided to the method.

Exceptions
TypeDescription
google.api_core.exceptions.GoogleAPICallErrorIf the request failed for any reason.
google.api_core.exceptions.RetryErrorIf the request failed due to a retryable error and retry attempts failed.
ValueErrorIf 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 taxonomy in the specified project.

.. rubric:: Example

from google.cloud import datacatalog_v1beta1

client = datacatalog_v1beta1.PolicyTagManagerClient()

response = client.create_taxonomy()

Parameters
NameDescription
parent str

Required. Resource name of the project that the taxonomy will belong to.

taxonomy Union[dict, Taxonomy]

The taxonomy to be created. 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 None is specified, requests will be retried using a default configuration.

timeout Optional[float]

The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt.

metadata Optional[Sequence[Tuple[str, str]]]

Additional metadata that is provided to the method.

Exceptions
TypeDescription
google.api_core.exceptions.GoogleAPICallErrorIf the request failed for any reason.
google.api_core.exceptions.RetryErrorIf the request failed due to a retryable error and retry attempts failed.
ValueErrorIf 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
NameDescription
name str

Required. Resource name of the policy tag to be deleted. All of its descendant policy tags will also be deleted.

retry Optional[google.api_core.retry.Retry]

A retry object used to retry requests. If None is specified, requests will be retried using a default configuration.

timeout Optional[float]

The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt.

metadata Optional[Sequence[Tuple[str, str]]]

Additional metadata that is provided to the method.

Exceptions
TypeDescription
google.api_core.exceptions.GoogleAPICallErrorIf the request failed for any reason.
google.api_core.exceptions.RetryErrorIf the request failed due to a retryable error and retry attempts failed.
ValueErrorIf 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 along with their associated policies.

.. rubric:: Example

from google.cloud import datacatalog_v1beta1

client = datacatalog_v1beta1.PolicyTagManagerClient()

client.delete_taxonomy()

Parameters
NameDescription
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 None is specified, requests will be retried using a default configuration.

timeout Optional[float]

The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt.

metadata Optional[Sequence[Tuple[str, str]]]

Additional metadata that is provided to the method.

Exceptions
TypeDescription
google.api_core.exceptions.GoogleAPICallErrorIf the request failed for any reason.
google.api_core.exceptions.RetryErrorIf the request failed due to a retryable error and retry attempts failed.
ValueErrorIf 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
NameDescription
filename str

The path to the service account private key json file.

Returns
TypeDescription
PolicyTagManagerClientThe 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
NameDescription
filename str

The path to the service account private key json file.

Returns
TypeDescription
PolicyTagManagerClientThe 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
NameDescription
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]

Renames a field in a tag template. The user should enable the Data Catalog API in the project identified by the name parameter (see Data Catalog Resource Project https://cloud.google.com/data-catalog/docs/concepts/resource-project__ for more information). If a dict is provided, it must be of the same form as the protobuf message GetPolicyOptions

retry Optional[google.api_core.retry.Retry]

A retry object used to retry requests. If None is specified, requests will be retried using a default configuration.

timeout Optional[float]

The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt.

metadata Optional[Sequence[Tuple[str, str]]]

Additional metadata that is provided to the method.

Exceptions
TypeDescription
google.api_core.exceptions.GoogleAPICallErrorIf the request failed for any reason.
google.api_core.exceptions.RetryErrorIf the request failed due to a retryable error and retry attempts failed.
ValueErrorIf 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
NameDescription
name str

Required. Resource name of the requested policy tag.

retry Optional[google.api_core.retry.Retry]

A retry object used to retry requests. If None is specified, requests will be retried using a default configuration.

timeout Optional[float]

The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt.

metadata Optional[Sequence[Tuple[str, str]]]

Additional metadata that is provided to the method.

Exceptions
TypeDescription
google.api_core.exceptions.GoogleAPICallErrorIf the request failed for any reason.
google.api_core.exceptions.RetryErrorIf the request failed due to a retryable error and retry attempts failed.
ValueErrorIf 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
NameDescription
name str

Required. Resource name of the requested taxonomy.

retry Optional[google.api_core.retry.Retry]

A retry object used to retry requests. If None is specified, requests will be retried using a default configuration.

timeout Optional[float]

The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt.

metadata Optional[Sequence[Tuple[str, str]]]

Additional metadata that is provided to the method.

Exceptions
TypeDescription
google.api_core.exceptions.GoogleAPICallErrorIf the request failed for any reason.
google.api_core.exceptions.RetryErrorIf the request failed due to a retryable error and retry attempts failed.
ValueErrorIf 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
NameDescription
parent str

Required. Resource name of the taxonomy to list the policy tags of.

page_size int

The maximum number of items to return. Must be a value between 1 and 1000. If not set, defaults to 50.

page_token str

Sets the access control policy for a resource. Replaces any existing policy. Supported resources are: - Tag templates. - Entries. - Entry groups. Note, this method cannot be used to manage policies for BigQuery, Cloud Pub/Sub and any external Google Cloud Platform resources synced to Cloud Data Catalog. Callers must have following Google IAM permission - datacatalog.tagTemplates.setIamPolicy to set policies on tag templates. - datacatalog.entries.setIamPolicy to set policies on entries. - datacatalog.entryGroups.setIamPolicy to set policies on entry groups.

retry Optional[google.api_core.retry.Retry]

A retry object used to retry requests. If None is specified, requests will be retried using a default configuration.

timeout Optional[float]

The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt.

metadata Optional[Sequence[Tuple[str, str]]]

Additional metadata that is provided to the method.

Exceptions
TypeDescription
google.api_core.exceptions.GoogleAPICallErrorIf the request failed for any reason.
google.api_core.exceptions.RetryErrorIf the request failed due to a retryable error and retry attempts failed.
ValueErrorIf 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 that the caller has permission to view.

.. rubric:: Example

from google.cloud import datacatalog_v1beta1

client = datacatalog_v1beta1.PolicyTagManagerClient()

response = client.list_taxonomies()

Parameters
NameDescription
parent str

Required. Resource name of the project to list the taxonomies of.

page_size int

The maximum number of items to return. Must be a value between 1 and 1000. If not set, defaults to 50.

page_token str

Input and output type names. These are resolved in the same way as FieldDescriptorProto.type_name, but must refer to a message type.

retry Optional[google.api_core.retry.Retry]

A retry object used to retry requests. If None is specified, requests will be retried using a default configuration.

timeout Optional[float]

The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt.

metadata Optional[Sequence[Tuple[str, str]]]

Additional metadata that is provided to the method.

Exceptions
TypeDescription
google.api_core.exceptions.GoogleAPICallErrorIf the request failed for any reason.
google.api_core.exceptions.RetryErrorIf the request failed due to a retryable error and retry attempts failed.
ValueErrorIf 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
NameDescription
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 name of the entry group. For example, projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}. If a dict is provided, it must be of the same form as the protobuf message Policy

retry Optional[google.api_core.retry.Retry]

A retry object used to retry requests. If None is specified, requests will be retried using a default configuration.

timeout Optional[float]

The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt.

metadata Optional[Sequence[Tuple[str, str]]]

Additional metadata that is provided to the method.

Exceptions
TypeDescription
google.api_core.exceptions.GoogleAPICallErrorIf the request failed for any reason.
google.api_core.exceptions.RetryErrorIf the request failed due to a retryable error and retry attempts failed.
ValueErrorIf 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 the permissions that a caller has on the specified taxonomy or policy tag.

.. rubric:: Example

from google.cloud import datacatalog_v1beta1

client = datacatalog_v1beta1.PolicyTagManagerClient()

response = client.test_iam_permissions()

Parameters
NameDescription
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]

An annotation that describes a resource reference, see ResourceReference.

retry Optional[google.api_core.retry.Retry]

A retry object used to retry requests. If None is specified, requests will be retried using a default configuration.

timeout Optional[float]

The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt.

metadata Optional[Sequence[Tuple[str, str]]]

Additional metadata that is provided to the method.

Exceptions
TypeDescription
google.api_core.exceptions.GoogleAPICallErrorIf the request failed for any reason.
google.api_core.exceptions.RetryErrorIf the request failed due to a retryable error and retry attempts failed.
ValueErrorIf 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
NameDescription
policy_tag Union[dict, PolicyTag]

Resources like Entry can have schemas associated with them. This scope allows users to attach tags to an individual column based on that schema. For attaching a tag to a nested column, use . to separate the column names. Example: - outer_column.inner_column If a dict is provided, it must be of the same form as the protobuf message PolicyTag

update_mask Union[dict, FieldMask]

Associates members with a role. If a dict is provided, it must be of the same form as the protobuf message FieldMask

retry Optional[google.api_core.retry.Retry]

A retry object used to retry requests. If None is specified, requests will be retried using a default configuration.

timeout Optional[float]

The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt.

metadata Optional[Sequence[Tuple[str, str]]]

Additional metadata that is provided to the method.

Exceptions
TypeDescription
google.api_core.exceptions.GoogleAPICallErrorIf the request failed for any reason.
google.api_core.exceptions.RetryErrorIf the request failed due to a retryable error and retry attempts failed.
ValueErrorIf 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
NameDescription
taxonomy Union[dict, Taxonomy]

Request message for CreateEntryGroup. If a dict is provided, it must be of the same form as the protobuf message Taxonomy

update_mask Union[dict, FieldMask]

Required. The name of the project this entry group is in. Example: - projects/{project_id}/locations/{location} Note that this EntryGroup and its child resources may not actually be stored in the location in this name. If a dict is provided, it must be of the same form as the protobuf message FieldMask

retry Optional[google.api_core.retry.Retry]

A retry object used to retry requests. If None is specified, requests will be retried using a default configuration.

timeout Optional[float]

The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt.

metadata Optional[Sequence[Tuple[str, str]]]

Additional metadata that is provided to the method.

Exceptions
TypeDescription
google.api_core.exceptions.GoogleAPICallErrorIf the request failed for any reason.
google.api_core.exceptions.RetryErrorIf the request failed due to a retryable error and retry attempts failed.
ValueErrorIf the parameters are invalid.