DataCatalogClient(
transport=None,
channel=None,
credentials=None,
client_config=None,
client_info=None,
client_options=None,
)
Data Catalog API service allows clients to discover, understand, and manage their data.
Methods
DataCatalogClient
DataCatalogClient(
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_entry
create_entry(parent, entry_id, entry, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Creates an entry. Only entries of 'FILESET' type or user-specified type can be created.
Users should enable the Data Catalog API in the project identified by
the parent
parameter (see Data Catalog Resource Project
for more information).
A maximum of 100,000 entries may be created per entry group.
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.DataCatalogClient()
parent = client.entry_group_path('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]')
TODO: Initialize
entry_id
:entry_id = ''
TODO: Initialize
entry
:entry = {}
response = client.create_entry(parent, entry_id, entry)
Parameters | |
---|---|
Name | Description |
parent |
str
Required. The name of the entry group this entry is in. Example: - projects/{project_id}/locations/{location}/entryGroups/{entry_group_id} Note that this Entry and its child resources may not actually be stored in the location in this name. |
entry_id |
str
Required. The id of the entry to create. |
entry |
Union[dict, Entry]
Required. The entry to create. If a dict is provided, it must be of the same form as the protobuf message Entry |
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_entry_group
create_entry_group(parent, entry_group_id, entry_group=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
A maximum of 10,000 entry groups may be created per organization across all locations.
Users should enable the Data Catalog API in the project identified by
the parent
parameter (see Data Catalog Resource Project
for more information).
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.DataCatalogClient()
parent = client.location_path('[PROJECT]', '[LOCATION]')
TODO: Initialize
entry_group_id
:entry_group_id = ''
response = client.create_entry_group(parent, entry_group_id)
Parameters | |
---|---|
Name | Description |
parent |
str
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. |
entry_group_id |
str
Required. The id of the entry group to create. The id must begin with a letter or underscore, contain only English letters, numbers and underscores, and be at most 64 characters. |
entry_group |
Union[dict, EntryGroup]
The entry group to create. Defaults to an empty entry group. If a dict is provided, it must be of the same form as the protobuf message EntryGroup |
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_tag
create_tag(parent, tag, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Creates a tag on an Entry
. Note: The project identified by the
parent
parameter for the
tag <https://cloud.google.com/data-catalog/docs/reference/rest/v1beta1/projects.locations.entryGroups.entries.tags/create#path-parameters>
and the tag
template <https://cloud.google.com/data-catalog/docs/reference/rest/v1beta1/projects.locations.tagTemplates/create#path-parameters>
used to create the tag must be from the same organization.
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.DataCatalogClient()
parent = client.tag_path('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]', '[ENTRY]', '[TAG]')
TODO: Initialize
tag
:tag = {}
response = client.create_tag(parent, tag)
Parameters | |
---|---|
Name | Description |
parent |
str
Required. The name of the resource to attach this tag to. Tags can be attached to Entries. Example: - projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id} Note that this Tag and its child resources may not actually be stored in the location in this name. |
tag |
Union[dict, Tag]
Required. The tag to create. If a dict is provided, it must be of the same form as the protobuf message 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. |
create_tag_template
create_tag_template(parent, tag_template_id, tag_template, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Creates a tag template. The user should enable the Data Catalog API
in the project identified by the parent
parameter (see Data Catalog
Resource
Project <https://cloud.google.com/data-catalog/docs/concepts/resource-project>
__
for more information).
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.DataCatalogClient()
parent = client.location_path('[PROJECT]', '[LOCATION]')
TODO: Initialize
tag_template_id
:tag_template_id = ''
TODO: Initialize
tag_template
:tag_template = {}
response = client.create_tag_template(parent, tag_template_id, tag_template)
Parameters | |
---|---|
Name | Description |
parent |
str
Required. The name of the project and the template location [region](https://cloud.google.com/data-catalog/docs/concepts/regions. Example: - projects/{project_id}/locations/us-central1 |
tag_template_id |
str
Required. The id of the tag template to create. |
tag_template |
Union[dict, TagTemplate]
Required. The tag template to create. If a dict is provided, it must be of the same form as the protobuf message TagTemplate |
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_tag_template_field
create_tag_template_field(parent, tag_template_field_id, tag_template_field, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Creates a field in a tag template. The user should enable the Data
Catalog API in the project identified by the parent
parameter (see
Data Catalog Resource
Project <https://cloud.google.com/data-catalog/docs/concepts/resource-project>
__
for more information).
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.DataCatalogClient()
parent = client.tag_template_path('[PROJECT]', '[LOCATION]', '[TAG_TEMPLATE]')
TODO: Initialize
tag_template_field_id
:tag_template_field_id = ''
TODO: Initialize
tag_template_field
:tag_template_field = {}
response = client.create_tag_template_field(parent, tag_template_field_id, tag_template_field)
Parameters | |
---|---|
Name | Description |
parent |
str
Required. The name of the project and the template location |
tag_template_field_id |
str
Required. The ID of the tag template field to create. Field ids can contain letters (both uppercase and lowercase), numbers (0-9), underscores (_) and dashes (-). Field IDs must be at least 1 character long and at most 128 characters long. Field IDs must also be unique within their template. |
tag_template_field |
Union[dict, TagTemplateField]
Required. The tag template field to create. If a dict is provided, it must be of the same form as the protobuf message TagTemplateField |
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_entry
delete_entry(name, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Deletes an existing entry. Only entries created through
CreateEntry
method can be deleted. Users should enable the Data
Catalog API in the project identified by the name
parameter (see
Data Catalog Resource Project
for more information).
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.DataCatalogClient()
name = client.entry_path('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]', '[ENTRY]')
client.delete_entry(name)
Parameters | |
---|---|
Name | Description |
name |
str
Required. The name of the entry. Example: - projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id} |
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_entry_group
delete_entry_group(name, force=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Deletes an EntryGroup. Only entry groups that do not contain entries
can be deleted. Users should enable the Data Catalog API in the project
identified by the name
parameter (see Data Catalog Resource
Project
for more information).
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.DataCatalogClient()
name = client.entry_group_path('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]')
client.delete_entry_group(name)
Parameters | |
---|---|
Name | Description |
name |
str
Required. The name of the entry group. For example, |
force |
bool
Optional. If true, deletes all entries in the entry group. |
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_tag
delete_tag(name, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Deletes a tag.
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.DataCatalogClient()
name = client.entry_path('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]', '[ENTRY]')
client.delete_tag(name)
Parameters | |
---|---|
Name | Description |
name |
str
Required. The name of the tag to delete. Example: - projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}/tags/{tag_id} |
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_tag_template
delete_tag_template(name, force, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Deletes a tag template and all tags using the template. Users should
enable the Data Catalog API in the project identified by the name
parameter (see Data Catalog Resource Project
for more information).
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.DataCatalogClient()
name = client.tag_template_path('[PROJECT]', '[LOCATION]', '[TAG_TEMPLATE]')
TODO: Initialize
force
:force = False
client.delete_tag_template(name, force)
Parameters | |
---|---|
Name | Description |
name |
str
Required. The name of the tag template to delete. Example: - projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id} |
force |
bool
Required. Currently, this field must always be set to |
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_tag_template_field
delete_tag_template_field(name, force, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Deletes a field in a tag template and all uses of that field. Users
should enable the Data Catalog API in the project identified by the
name
parameter (see Data Catalog Resource Project
for more information).
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.DataCatalogClient()
name = client.tag_template_field_path('[PROJECT]', '[LOCATION]', '[TAG_TEMPLATE]', '[FIELD]')
TODO: Initialize
force
:force = False
client.delete_tag_template_field(name, force)
Parameters | |
---|---|
Name | Description |
name |
str
Required. The name of the tag template field to delete. Example: - projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id} |
force |
bool
Required. Currently, this field must always be set to |
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. |
entry_group_path
entry_group_path(project, location, entry_group)
Return a fully-qualified entry_group string.
entry_path
entry_path(project, location, entry_group, entry)
Return a fully-qualified entry string.
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 |
DataCatalogClient | 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 |
DataCatalogClient | The constructed client. |
get_entry
get_entry(name, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Gets an entry.
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.DataCatalogClient()
name = client.entry_path('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]', '[ENTRY]')
response = client.get_entry(name)
Parameters | |
---|---|
Name | Description |
name |
str
Required. The name of the entry. Example: - projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id} |
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_entry_group
get_entry_group(name, read_mask=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Gets an EntryGroup.
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.DataCatalogClient()
name = client.entry_group_path('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]')
response = client.get_entry_group(name)
Parameters | |
---|---|
Name | Description |
name |
str
Required. The name of the entry group. For example, |
read_mask |
Union[dict, FieldMask]
The fields to return. If not set or empty, all fields are returned. 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. |
get_iam_policy
get_iam_policy(resource, options_=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Gets the access control policy for a resource. A NOT_FOUND
error
is returned if the resource does not exist. An empty policy is returned
if the resource exists but does not have a policy set on it.
Supported resources are:
- Tag templates.
- Entries.
- Entry groups. Note, this method cannot be used to manage policies for BigQuery, Pub/Sub and any external Google Cloud Platform resources synced to Data Catalog.
Callers must have following Google IAM permission
datacatalog.tagTemplates.getIamPolicy
to get policies on tag templates.datacatalog.entries.getIamPolicy
to get policies on entries.datacatalog.entryGroups.getIamPolicy
to get policies on entry groups.
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.DataCatalogClient()
TODO: Initialize
resource
:resource = ''
response = client.get_iam_policy(resource)
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_tag_template
get_tag_template(name, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Gets a tag template.
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.DataCatalogClient()
name = client.tag_template_path('[PROJECT]', '[LOCATION]', '[TAG_TEMPLATE]')
response = client.get_tag_template(name)
Parameters | |
---|---|
Name | Description |
name |
str
Required. The name of the tag template. Example: - projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id} |
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_entries
list_entries(parent, page_size=None, read_mask=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Lists entries.
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.DataCatalogClient()
parent = client.entry_group_path('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]')
Iterate over all results
for element in client.list_entries(parent): ... # process element ... pass
Alternatively:
Iterate over results one page at a time
for page in client.list_entries(parent).pages: ... for element in page: ... # process element ... pass
Parameters | |
---|---|
Name | Description |
parent |
str
Required. The name of the entry group that contains the entries, which can be provided in URL format. Example: - projects/{project_id}/locations/{location}/entryGroups/{entry_group_id} |
page_size |
int
The maximum number of resources contained in the underlying API response. If page streaming is performed per- resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page. |
read_mask |
Union[dict, FieldMask]
The fields to return for each Entry. If not set or empty, all fields are returned. For example, setting read_mask to contain only one path "name" will cause ListEntries to return a list of Entries with only "name" field. 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. |
list_entry_groups
list_entry_groups(parent, page_size=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Lists entry groups.
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.DataCatalogClient()
parent = client.entry_group_path('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]')
Iterate over all results
for element in client.list_entry_groups(parent): ... # process element ... pass
Alternatively:
Iterate over results one page at a time
for page in client.list_entry_groups(parent).pages: ... for element in page: ... # process element ... pass
Parameters | |
---|---|
Name | Description |
parent |
str
Required. The name of the location that contains the entry groups, which can be provided in URL format. Example: - projects/{project_id}/locations/{location} |
page_size |
int
The maximum number of resources contained in the underlying API response. If page streaming is performed per- resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page. |
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_tags
list_tags(parent, page_size=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Lists the tags on an Entry
.
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.DataCatalogClient()
parent = client.entry_path('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]', '[ENTRY]')
Iterate over all results
for element in client.list_tags(parent): ... # process element ... pass
Alternatively:
Iterate over results one page at a time
for page in client.list_tags(parent).pages: ... for element in page: ... # process element ... pass
Parameters | |
---|---|
Name | Description |
parent |
str
Required. The name of the Data Catalog resource to list the tags of. The resource could be an |
page_size |
int
The maximum number of resources contained in the underlying API response. If page streaming is performed per- resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page. |
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. |
location_path
location_path(project, location)
Return a fully-qualified location string.
lookup_entry
lookup_entry(linked_resource=None, sql_resource=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Get an entry by target resource name. This method allows clients to use the resource name from the source Google Cloud Platform service to get the Data Catalog Entry.
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.DataCatalogClient()
response = client.lookup_entry()
Parameters | |
---|---|
Name | Description |
linked_resource |
str
The full name of the Google Cloud Platform resource the Data Catalog entry represents. See: https://cloud.google.com/apis/design/resource_names#full_resource_name. Full names are case-sensitive. Examples: - //bigquery.googleapis.com/projects/projectId/datasets/datasetId/tables/tableId - //pubsub.googleapis.com/projects/projectId/topics/topicId |
sql_resource |
str
The SQL name of the entry. SQL names are case-sensitive. Examples: - |
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. |
rename_tag_template_field
rename_tag_template_field(name, new_tag_template_field_id, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
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).
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.DataCatalogClient()
name = client.tag_template_field_path('[PROJECT]', '[LOCATION]', '[TAG_TEMPLATE]', '[FIELD]')
TODO: Initialize
new_tag_template_field_id
:new_tag_template_field_id = ''
response = client.rename_tag_template_field(name, new_tag_template_field_id)
Parameters | |
---|---|
Name | Description |
name |
str
Required. The name of the tag template. Example: - projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id} |
new_tag_template_field_id |
str
Required. The new ID of this tag template field. 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. |
search_catalog
search_catalog(scope, query, page_size=None, order_by=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Searches Data Catalog for multiple resources like entries, tags that match a query.
This is a custom method
(https://cloud.google.com/apis/design/custom_methods) and does not
return the complete resource, only the resource identifier and high
level fields. Clients can subsequentally call Get
methods.
Note that Data Catalog search queries do not guarantee full recall. Query results that match your query may not be returned, even in subsequent result pages. Also note that results returned (and not returned) can vary across repeated search queries.
See Data Catalog Search
Syntax <https://cloud.google.com/data-catalog/docs/how-to/search-reference>
__
for more information.
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.DataCatalogClient()
TODO: Initialize
scope
:scope = {}
TODO: Initialize
query
:query = ''
Iterate over all results
for element in client.search_catalog(scope, query): ... # process element ... pass
Alternatively:
Iterate over results one page at a time
for page in client.search_catalog(scope, query).pages: ... for element in page: ... # process element ... pass
Parameters | |
---|---|
Name | Description |
scope |
Union[dict, Scope]
Required. The scope of this search request. A |
query |
str
Required. The query string in search query syntax. The query must be non-empty. Query strings can be simple as "x" or more qualified as: - name:x - column:x - description:y Note: Query tokens need to have a minimum of 3 characters for substring matching to work correctly. See |
page_size |
int
The maximum number of resources contained in the underlying API response. If page streaming is performed per- resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page. |
order_by |
str
Specifies the ordering of results, currently supported case-sensitive choices are: - |
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, policy, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
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, Pub/Sub and any external Google Cloud Platform resources synced to 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.
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.DataCatalogClient()
TODO: Initialize
resource
:resource = ''
TODO: Initialize
policy
:policy = {}
response = client.set_iam_policy(resource, 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. |
tag_path
tag_path(project, location, entry_group, entry, tag)
Return a fully-qualified tag string.
tag_template_field_path
tag_template_field_path(project, location, tag_template, field)
Return a fully-qualified tag_template_field string.
tag_template_path
tag_template_path(project, location, tag_template)
Return a fully-qualified tag_template string.
test_iam_permissions
test_iam_permissions(resource, permissions, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Returns the caller's permissions on a resource. If the resource does
not exist, an empty set of permissions is returned (We don't return a
NOT_FOUND
error).
Supported resources are:
- Tag templates.
- Entries.
- Entry groups. Note, this method cannot be used to manage policies for BigQuery, Pub/Sub and any external Google Cloud Platform resources synced to Data Catalog.
A caller is not required to have Google IAM permission to make this request.
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.DataCatalogClient()
TODO: Initialize
resource
:resource = ''
TODO: Initialize
permissions
:permissions = []
response = client.test_iam_permissions(resource, 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_entry
update_entry(entry, update_mask=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Updates an existing entry. Users should enable the Data Catalog API
in the project identified by the entry.name
parameter (see Data
Catalog Resource Project
for more information).
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.DataCatalogClient()
TODO: Initialize
entry
:entry = {}
response = client.update_entry(entry)
Parameters | |
---|---|
Name | Description |
entry |
Union[dict, Entry]
Required. The updated entry. The "name" field must be set. If a dict is provided, it must be of the same form as the protobuf message Entry |
update_mask |
Union[dict, FieldMask]
The fields to update on the entry. If absent or empty, all modifiable fields are updated. The following fields are modifiable: - For entries with 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. |
update_entry_group
update_entry_group(entry_group, update_mask=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Updates an EntryGroup. The user should enable the Data Catalog API
in the project identified by the entry_group.name
parameter (see
Data Catalog Resource Project
for more information).
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.DataCatalogClient()
TODO: Initialize
entry_group
:entry_group = {}
response = client.update_entry_group(entry_group)
Parameters | |
---|---|
Name | Description |
entry_group |
Union[dict, EntryGroup]
Required. The updated entry group. "name" field must be set. If a dict is provided, it must be of the same form as the protobuf message EntryGroup |
update_mask |
Union[dict, FieldMask]
The fields to update on the entry group. If absent or empty, all modifiable fields are updated. 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. |
update_tag
update_tag(tag, update_mask=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Updates an existing tag.
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.DataCatalogClient()
TODO: Initialize
tag
:tag = {}
response = client.update_tag(tag)
Parameters | |
---|---|
Name | Description |
tag |
Union[dict, Tag]
Required. The updated tag. The "name" field must be set. If a dict is provided, it must be of the same form as the protobuf message Tag |
update_mask |
Union[dict, FieldMask]
The fields to update on the Tag. If absent or empty, all modifiable fields are updated. Currently the only modifiable field is the field |
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_tag_template
update_tag_template(tag_template, update_mask=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Updates a tag template. This method cannot be used to update the
fields of a template. The tag template fields are represented as
separate resources and should be updated using their own
create/update/delete methods. Users should enable the Data Catalog API
in the project identified by the tag_template.name
parameter (see
Data Catalog Resource Project
for more information).
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.DataCatalogClient()
TODO: Initialize
tag_template
:tag_template = {}
response = client.update_tag_template(tag_template)
Parameters | |
---|---|
Name | Description |
tag_template |
Union[dict, TagTemplate]
Required. The template to update. The "name" field must be set. If a dict is provided, it must be of the same form as the protobuf message TagTemplate |
update_mask |
Union[dict, FieldMask]
The field mask specifies the parts of the template to overwrite. Allowed fields: - |
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_tag_template_field
update_tag_template_field(name, tag_template_field, update_mask=None, retry=<_MethodDefault._DEFAULT_VALUE: <object object>>, timeout=<_MethodDefault._DEFAULT_VALUE: <object object>>, metadata=None)
Updates a field in a tag template. This method cannot be used to
update the field type. Users should enable the Data Catalog API in the
project identified by the name
parameter (see Data Catalog Resource
Project
for more information).
.. rubric:: Example
from google.cloud import datacatalog_v1beta1
client = datacatalog_v1beta1.DataCatalogClient()
name = client.tag_template_field_path('[PROJECT]', '[LOCATION]', '[TAG_TEMPLATE]', '[FIELD]')
TODO: Initialize
tag_template_field
:tag_template_field = {}
response = client.update_tag_template_field(name, tag_template_field)
Parameters | |
---|---|
Name | Description |
name |
str
Required. The name of the tag template field. Example: - projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id} |
tag_template_field |
Union[dict, TagTemplateField]
Required. The template to update. If a dict is provided, it must be of the same form as the protobuf message TagTemplateField |
update_mask |
Union[dict, FieldMask]
Optional. The field mask specifies the parts of the template to be updated. Allowed fields: - |
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. |