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 | |
---|---|
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 the specified 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 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 |
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 taxonomy in the specified 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 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 |
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 of 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 along with their associated policies.
.. 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]
Renames a field in a tag template. The user should enable the Data Catalog API in the project identified by 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. |
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 requested policy tag. |
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 requested 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. |
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 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 - |
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 that the caller has permission to view.
.. 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 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 |
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 name of the entry group. For example, |
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 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 | |
---|---|
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]
An annotation that describes a resource reference, see |
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]
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 |
update_mask |
Union[dict, FieldMask]
Associates |
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]
Request message for |
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 |
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. |