DataCatalogClient

DataCatalogClient

Data Catalog API service allows clients to discover, understand, and manage their data.

Constructor

new DataCatalogClient(optionsopt)

Construct an instance of DataCatalogClient.

Parameters:
Name Type Attributes Description
options object <optional>

The configuration object. See the subsequent parameters for more details.

Properties
Name Type Attributes Description
credentials object <optional>

Credentials object.

Properties
Name Type Attributes Description
client_email string <optional>
private_key string <optional>
email string <optional>

Account email address. Required when using a .pem or .p12 keyFilename.

keyFilename string <optional>

Full path to the a .json, .pem, or .p12 key downloaded from the Google Developers Console. If you provide a path to a JSON file, the projectId option below is not necessary. NOTE: .pem and .p12 require you to specify options.email as well.

port number <optional>

The port on which to connect to the remote host.

projectId string <optional>

The project ID from the Google Developer's Console, e.g. 'grape-spaceship-123'. We will also check the environment variable GCLOUD_PROJECT for your project ID. If your app is running in an environment which supports Application Default Credentials, your project ID will be detected automatically.

promise function <optional>

Custom promise module to use instead of native Promises.

apiEndpoint string <optional>

The domain name of the API remote host.

Source:

Members

(static) apiEndpoint

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

Source:

(static) port

The port for this API service.

Source:

(static) scopes

The scopes needed to make gRPC calls for every method defined in this service.

Source:

(static) servicePath

The DNS address for this API service.

Source:

Methods

close()

Terminate the GRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Source:

createEntry(request, optionsopt) → {Promise}

Alpha feature. Creates an entry. Currently only entries of 'FILESET' type can be created. 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).

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

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.

entryId string

Required. The id of the entry to create.

entry google.cloud.datacatalog.v1beta1.Entry

Required. The entry to create.

options object <optional>

Call options. See CallOptions for more details.

Source:

createEntryGroup(request, optionsopt) → {Promise}

Alpha feature. Creates an EntryGroup. 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).

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

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.

entryGroupId string

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.

entryGroup google.cloud.datacatalog.v1beta1.EntryGroup

The entry group to create. Defaults to an empty entry group.

options object <optional>

Call options. See CallOptions for more details.

Source:

createTag(request, optionsopt) → {Promise}

Creates a tag on an [Entry][google.cloud.datacatalog.v1beta1.Entry]. Note: The project identified by the parent parameter for the tag and the tag template used to create the tag must be from the same organization.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

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 google.cloud.datacatalog.v1beta1.Tag

Required. The tag to create.

options object <optional>

Call options. See CallOptions for more details.

Source:

createTagTemplate(request, optionsopt) → {Promise}

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 for more information).

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. The name of the project and the location this template is in. Example:

  • projects/{project_id}/locations/{location}

TagTemplate and its child resources may not actually be stored in the location in this name.

tagTemplateId string

Required. The id of the tag template to create.

tagTemplate google.cloud.datacatalog.v1beta1.TagTemplate

Required. The tag template to create.

options object <optional>

Call options. See CallOptions for more details.

Source:

createTagTemplateField(request, optionsopt) → {Promise}

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 for more information).

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. The name of the project this template is in. Example:

  • projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}

Note that this TagTemplateField may not actually be stored in the location in this name.

tagTemplateFieldId string

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.

tagTemplateField google.cloud.datacatalog.v1beta1.TagTemplateField

Required. The tag template field to create.

options object <optional>

Call options. See CallOptions for more details.

Source:

deleteEntry(request, optionsopt) → {Promise}

Alpha feature. Deletes an existing entry. Only entries created through [CreateEntry][google.cloud.datacatalog.v1beta1.DataCatalog.CreateEntry] method can be deleted. 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).

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. The name of the entry. Example:

  • projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}
options object <optional>

Call options. See CallOptions for more details.

Source:

deleteEntryGroup(request, optionsopt) → {Promise}

Alpha feature. Deletes an EntryGroup. Only entry groups that do not contain entries can be deleted. 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).

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. The name of the entry group. For example, projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}.

options object <optional>

Call options. See CallOptions for more details.

Source:

deleteTag(request, optionsopt) → {Promise}

Deletes a tag.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. The name of the tag to delete. Example:

  • projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}/tags/{tag_id}
options object <optional>

Call options. See CallOptions for more details.

Source:

deleteTagTemplate(request, optionsopt) → {Promise}

Deletes a tag template and all tags using the 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).

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. The name of the tag template to delete. Example:

  • projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}
force boolean

Required. Currently, this field must always be set to true. This confirms the deletion of any possible tags using this template. force = false will be supported in the future.

options object <optional>

Call options. See CallOptions for more details.

Source:

deleteTagTemplateField(request, optionsopt) → {Promise}

Deletes a field in a tag template and all uses of that field. 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).

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

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 boolean

Required. Currently, this field must always be set to true. This confirms the deletion of this field from any tags using this field. force = false will be supported in the future.

options object <optional>

Call options. See CallOptions for more details.

Source:

getEntry(request, optionsopt) → {Promise}

Gets an entry.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. The name of the entry. Example:

  • projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}

Entry groups are logical groupings of entries. Currently, users cannot create/modify entry groups. They are created by Data Catalog; they include @bigquery for all BigQuery entries, and @pubsub for all Cloud Pub/Sub entries.

options object <optional>

Call options. See CallOptions for more details.

Source:

getEntryGroup(request, optionsopt) → {Promise}

Alpha feature. Gets an EntryGroup.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. The name of the entry group. For example, projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}.

readMask google.protobuf.FieldMask

The fields to return. If not set or empty, all fields are returned.

options object <optional>

Call options. See CallOptions for more details.

Source:

getIamPolicy(request, optionsopt) → {Promise}

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, Cloud Pub/Sub and any external Google Cloud Platform resources synced to Cloud 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.
Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

options object <optional>

Call options. See CallOptions for more details.

Source:

getProjectId(callback)

Return the project ID used by this class.

Parameters:
Name Type Description
callback function

the callback to be called with the current project Id.

Source:

getTagTemplate(request, optionsopt) → {Promise}

Gets a tag template.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. The name of the tag template. Example:

  • projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}
options object <optional>

Call options. See CallOptions for more details.

Source:

listTags(request, optionsopt) → {Promise}

Lists the tags on an [Entry][google.cloud.datacatalog.v1beta1.Entry].

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. The name of the Data Catalog resource to list the tags of. The resource could be an [Entry][google.cloud.datacatalog.v1beta1.Entry].

pageSize number

The maximum number of tags to return. Default is 10. Max limit is 1000.

pageToken string

Token that specifies which page is requested. If empty, the first page is returned.

options object <optional>

Call options. See CallOptions for more details.

Source:

listTagsStream(request, optionsopt) → {Stream}

Equivalent to listTags, but returns a NodeJS Stream object.

This fetches the paged responses for listTags continuously and invokes the callback registered for 'data' event for each element in the responses.

The returned object has 'end' method when no more elements are required.

autoPaginate option will be ignored.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. The name of the Data Catalog resource to list the tags of. The resource could be an [Entry][google.cloud.datacatalog.v1beta1.Entry].

pageSize number

The maximum number of tags to return. Default is 10. Max limit is 1000.

pageToken string

Token that specifies which page is requested. If empty, the first page is returned.

options object <optional>

Call options. See CallOptions for more details.

Source:
See:

lookupEntry(request, optionsopt) → {Promise}

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.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
linkedResource string

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
sqlResource string

The SQL name of the entry. SQL names are case-sensitive.

Examples:

* `cloud_pubsub.project_id.topic_id`
* ``pubsub.project_id.`topic.id.with.dots` ``
* `bigquery.table.project_id.dataset_id.table_id`
* `bigquery.dataset.project_id.dataset_id`
* `datacatalog.project_id.location_id.entry_group_id.entry_id`

*_ids shoud satisfy the standard SQL rules for identifiers. https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical.

options object <optional>

Call options. See CallOptions for more details.

Source:

renameTagTemplateField(request, optionsopt) → {Promise}

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 for more information).

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. The name of the tag template. Example:

  • projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id}
newTagTemplateFieldId string

Required. The new ID of this tag template field. For example, my_new_field.

options object <optional>

Call options. See CallOptions for more details.

Source:

searchCatalog(request, optionsopt) → {Promise}

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 searches do not have full recall. There may be results that match your query but are not returned, even in subsequent pages of results. These missing results may vary across repeated calls to search. Do not rely on this method if you need to guarantee full recall.

See Data Catalog Search Syntax for more information.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
scope google.cloud.datacatalog.v1beta1.SearchCatalogRequest.Scope

Required. The scope of this search request.

query string

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 Data Catalog Search Syntax for more information.

pageSize number

Number of results in the search page. If <=0 then defaults to 10. Max limit for page_size is 1000. Throws an invalid argument for page_size > 1000.

pageToken string <optional>

Optional. Pagination token returned in an earlier [SearchCatalogResponse.next_page_token][google.cloud.datacatalog.v1beta1.SearchCatalogResponse.next_page_token], which indicates that this is a continuation of a prior [SearchCatalogRequest][google.cloud.datacatalog.v1beta1.DataCatalog.SearchCatalog] call, and that the system should return the next page of data. If empty, the first page is returned.

orderBy string

Specifies the ordering of results, currently supported case-sensitive choices are:

* `relevance`, only supports desecending
* `last_access_timestamp [asc|desc]`, defaults to descending if not
  specified
* `last_modified_timestamp [asc|desc]`, defaults to descending if not
  specified

If not specified, defaults to relevance descending.

options object <optional>

Call options. See CallOptions for more details.

Source:

searchCatalogStream(request, optionsopt) → {Stream}

Equivalent to searchCatalog, but returns a NodeJS Stream object.

This fetches the paged responses for searchCatalog continuously and invokes the callback registered for 'data' event for each element in the responses.

The returned object has 'end' method when no more elements are required.

autoPaginate option will be ignored.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
scope google.cloud.datacatalog.v1beta1.SearchCatalogRequest.Scope

Required. The scope of this search request.

query string

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 Data Catalog Search Syntax for more information.

pageSize number

Number of results in the search page. If <=0 then defaults to 10. Max limit for page_size is 1000. Throws an invalid argument for page_size > 1000.

pageToken string <optional>

Optional. Pagination token returned in an earlier [SearchCatalogResponse.next_page_token][google.cloud.datacatalog.v1beta1.SearchCatalogResponse.next_page_token], which indicates that this is a continuation of a prior [SearchCatalogRequest][google.cloud.datacatalog.v1beta1.DataCatalog.SearchCatalog] call, and that the system should return the next page of data. If empty, the first page is returned.

orderBy string

Specifies the ordering of results, currently supported case-sensitive choices are:

* `relevance`, only supports desecending
* `last_access_timestamp [asc|desc]`, defaults to descending if not
  specified
* `last_modified_timestamp [asc|desc]`, defaults to descending if not
  specified

If not specified, defaults to relevance descending.

options object <optional>

Call options. See CallOptions for more details.

Source:
See:

setIamPolicy(request, optionsopt) → {Promise}

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.
Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

options object <optional>

Call options. See CallOptions for more details.

Source:

testIamPermissions(request, optionsopt) → {Promise}

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, Cloud Pub/Sub and any external Google Cloud Platform resources synced to Cloud Data Catalog.

A caller is not required to have Google IAM permission to make this request.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

options object <optional>

Call options. See CallOptions for more details.

Source:

updateEntry(request, optionsopt) → {Promise}

Updates an existing entry. The user should enable the Data Catalog API in the project identified by the entry.name parameter (see [Data Catalog Resource Project] (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
entry google.cloud.datacatalog.v1beta1.Entry

Required. The updated entry. The "name" field must be set.

updateMask google.protobuf.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 DATA_STREAM:
    • schema
  • For entries with type FILESET
    • schema
    • display_name
    • description
    • gcs_fileset_spec
    • gcs_fileset_spec.file_patterns
options object <optional>

Call options. See CallOptions for more details.

Source:

updateTag(request, optionsopt) → {Promise}

Updates an existing tag.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
tag google.cloud.datacatalog.v1beta1.Tag

Required. The updated tag. The "name" field must be set.

updateMask google.protobuf.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 fields.

options object <optional>

Call options. See CallOptions for more details.

Source:

updateTagTemplate(request, optionsopt) → {Promise}

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. The user should enable the Data Catalog API in the project identified by the tag_template.name parameter (see [Data Catalog Resource Project] (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
tagTemplate google.cloud.datacatalog.v1beta1.TagTemplate

Required. The template to update. The "name" field must be set.

updateMask google.protobuf.FieldMask

The field mask specifies the parts of the template to overwrite.

Allowed fields:

* `display_name`

If absent or empty, all of the allowed fields above will be updated.

options object <optional>

Call options. See CallOptions for more details.

Source:

updateTagTemplateField(request, optionsopt) → {Promise}

Updates a field in a tag template. This method cannot be used to update the field type. 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).

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. The name of the tag template field. Example:

  • projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id}
tagTemplateField google.cloud.datacatalog.v1beta1.TagTemplateField

Required. The template to update.

updateMask google.protobuf.FieldMask

The field mask specifies the parts of the template to be updated. Allowed fields:

* `display_name`
* `type.enum_type`

If update_mask is not set or empty, all of the allowed fields above will be updated.

When updating an enum type, the provided values will be merged with the existing values. Therefore, enum values can only be added, existing enum values cannot be deleted nor renamed.

options object <optional>

Call options. See CallOptions for more details.

Source: