Class DataCatalogClient (1.55.0)

GitHub RepositoryProduct Reference

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

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   String entryGroupId = "entryGroupId1228924712";
   EntryGroup entryGroup = EntryGroup.newBuilder().build();
   EntryGroup response = dataCatalogClient.createEntryGroup(parent, entryGroupId, entryGroup);
 }
 

Note: close() needs to be called on the DataCatalogClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

Methods
Method Description Method Variants

SearchCatalog

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

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • searchCatalog(SearchCatalogRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • searchCatalog(SearchCatalogRequest.Scope scope, String query)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • searchCatalogPagedCallable()

  • searchCatalogCallable()

CreateEntryGroup

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).

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createEntryGroup(CreateEntryGroupRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • createEntryGroup(LocationName parent, String entryGroupId, EntryGroup entryGroup)

  • createEntryGroup(String parent, String entryGroupId, EntryGroup entryGroup)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createEntryGroupCallable()

UpdateEntryGroup

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).

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateEntryGroup(UpdateEntryGroupRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • updateEntryGroup(EntryGroup entryGroup)

  • updateEntryGroup(EntryGroup entryGroup, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateEntryGroupCallable()

GetEntryGroup

Gets an EntryGroup.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getEntryGroup(GetEntryGroupRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getEntryGroup(EntryGroupName name)

  • getEntryGroup(String name)

  • getEntryGroup(EntryGroupName name, FieldMask readMask)

  • getEntryGroup(String name, FieldMask readMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getEntryGroupCallable()

DeleteEntryGroup

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).

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteEntryGroup(DeleteEntryGroupRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • deleteEntryGroup(EntryGroupName name)

  • deleteEntryGroup(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteEntryGroupCallable()

ListEntryGroups

Lists entry groups.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listEntryGroups(ListEntryGroupsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listEntryGroups(LocationName parent)

  • listEntryGroups(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listEntryGroupsPagedCallable()

  • listEntryGroupsCallable()

CreateEntry

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.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createEntry(CreateEntryRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • createEntry(EntryGroupName parent, String entryId, Entry entry)

  • createEntry(String parent, String entryId, Entry entry)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createEntryCallable()

UpdateEntry

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).

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateEntry(UpdateEntryRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • updateEntry(Entry entry)

  • updateEntry(Entry entry, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateEntryCallable()

DeleteEntry

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).

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteEntry(DeleteEntryRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • deleteEntry(EntryName name)

  • deleteEntry(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteEntryCallable()

GetEntry

Gets an entry.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getEntry(GetEntryRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getEntry(EntryName name)

  • getEntry(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getEntryCallable()

LookupEntry

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.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • lookupEntry(LookupEntryRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • lookupEntryCallable()

ListEntries

Lists entries.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listEntries(ListEntriesRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listEntries(EntryGroupName parent)

  • listEntries(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listEntriesPagedCallable()

  • listEntriesCallable()

CreateTagTemplate

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).

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createTagTemplate(CreateTagTemplateRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • createTagTemplate(LocationName parent, String tagTemplateId, TagTemplate tagTemplate)

  • createTagTemplate(String parent, String tagTemplateId, TagTemplate tagTemplate)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createTagTemplateCallable()

GetTagTemplate

Gets a tag template.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getTagTemplate(GetTagTemplateRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getTagTemplate(TagTemplateName name)

  • getTagTemplate(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getTagTemplateCallable()

UpdateTagTemplate

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).

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateTagTemplate(UpdateTagTemplateRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • updateTagTemplate(TagTemplate tagTemplate)

  • updateTagTemplate(TagTemplate tagTemplate, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateTagTemplateCallable()

DeleteTagTemplate

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).

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteTagTemplate(DeleteTagTemplateRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • deleteTagTemplate(TagTemplateName name, boolean force)

  • deleteTagTemplate(String name, boolean force)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteTagTemplateCallable()

CreateTagTemplateField

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).

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createTagTemplateField(CreateTagTemplateFieldRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • createTagTemplateField(TagTemplateName parent, String tagTemplateFieldId, TagTemplateField tagTemplateField)

  • createTagTemplateField(String parent, String tagTemplateFieldId, TagTemplateField tagTemplateField)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createTagTemplateFieldCallable()

UpdateTagTemplateField

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).

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateTagTemplateField(UpdateTagTemplateFieldRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • updateTagTemplateField(TagTemplateFieldName name, TagTemplateField tagTemplateField)

  • updateTagTemplateField(String name, TagTemplateField tagTemplateField)

  • updateTagTemplateField(TagTemplateFieldName name, TagTemplateField tagTemplateField, FieldMask updateMask)

  • updateTagTemplateField(String name, TagTemplateField tagTemplateField, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateTagTemplateFieldCallable()

RenameTagTemplateField

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).

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • renameTagTemplateField(RenameTagTemplateFieldRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • renameTagTemplateField(TagTemplateFieldName name, String newTagTemplateFieldId)

  • renameTagTemplateField(String name, String newTagTemplateFieldId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • renameTagTemplateFieldCallable()

RenameTagTemplateFieldEnumValue

Renames an enum value in a tag template. The enum values have to be unique within one enum field. Thus, an enum value cannot be renamed with a name used in any other enum value within the same enum field.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • renameTagTemplateFieldEnumValue(RenameTagTemplateFieldEnumValueRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • renameTagTemplateFieldEnumValue(TagTemplateFieldEnumValueName name, String newEnumValueDisplayName)

  • renameTagTemplateFieldEnumValue(String name, String newEnumValueDisplayName)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • renameTagTemplateFieldEnumValueCallable()

DeleteTagTemplateField

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).

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteTagTemplateField(DeleteTagTemplateFieldRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • deleteTagTemplateField(TagTemplateFieldName name, boolean force)

  • deleteTagTemplateField(String name, boolean force)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteTagTemplateFieldCallable()

CreateTag

Creates a tag on an 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.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createTag(CreateTagRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • createTag(EntryName parent, Tag tag)

  • createTag(String parent, Tag tag)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createTagCallable()

UpdateTag

Updates an existing tag.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateTag(UpdateTagRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • updateTag(Tag tag)

  • updateTag(Tag tag, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateTagCallable()

DeleteTag

Deletes a tag.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteTag(DeleteTagRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • deleteTag(EntryName name)

  • deleteTag(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteTagCallable()

ListTags

Lists tags assigned to an Entry. The columns in the response are lowercased.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listTags(ListTagsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listTags(EntryName parent)

  • listTags(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listTagsPagedCallable()

  • listTagsCallable()

SetIamPolicy

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.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • setIamPolicy(SetIamPolicyRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • setIamPolicy(ResourceName resource, Policy policy)

  • setIamPolicy(String resource, Policy policy)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • setIamPolicyCallable()

GetIamPolicy

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.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getIamPolicy(GetIamPolicyRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getIamPolicy(ResourceName resource)

  • getIamPolicy(String resource)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getIamPolicyCallable()

TestIamPermissions

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.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • testIamPermissions(TestIamPermissionsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • testIamPermissionsCallable()

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of DataCatalogSettings to create(). For example:

To customize credentials:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 DataCatalogSettings dataCatalogSettings =
     DataCatalogSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 DataCatalogClient dataCatalogClient = DataCatalogClient.create(dataCatalogSettings);
 

To customize the endpoint:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 DataCatalogSettings dataCatalogSettings =
     DataCatalogSettings.newBuilder().setEndpoint(myEndpoint).build();
 DataCatalogClient dataCatalogClient = DataCatalogClient.create(dataCatalogSettings);
 

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 DataCatalogSettings dataCatalogSettings = DataCatalogSettings.newHttpJsonBuilder().build();
 DataCatalogClient dataCatalogClient = DataCatalogClient.create(dataCatalogSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

Inheritance

java.lang.Object > DataCatalogClient

Static Methods

create()

public static final DataCatalogClient create()

Constructs an instance of DataCatalogClient with default settings.

Returns
Type Description
DataCatalogClient
Exceptions
Type Description
IOException

create(DataCatalogSettings settings)

public static final DataCatalogClient create(DataCatalogSettings settings)

Constructs an instance of DataCatalogClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.

Parameter
Name Description
settings DataCatalogSettings
Returns
Type Description
DataCatalogClient
Exceptions
Type Description
IOException

create(DataCatalogStub stub)

public static final DataCatalogClient create(DataCatalogStub stub)

Constructs an instance of DataCatalogClient, using the given stub for making calls. This is for advanced usage - prefer using create(DataCatalogSettings).

Parameter
Name Description
stub DataCatalogStub
Returns
Type Description
DataCatalogClient

Constructors

DataCatalogClient(DataCatalogSettings settings)

protected DataCatalogClient(DataCatalogSettings settings)

Constructs an instance of DataCatalogClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.

Parameter
Name Description
settings DataCatalogSettings

DataCatalogClient(DataCatalogStub stub)

protected DataCatalogClient(DataCatalogStub stub)
Parameter
Name Description
stub DataCatalogStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
Name Description
duration long
unit TimeUnit
Returns
Type Description
boolean
Exceptions
Type Description
InterruptedException

close()

public final void close()

createEntry(CreateEntryRequest request)

public final Entry createEntry(CreateEntryRequest request)

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.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   CreateEntryRequest request =
       CreateEntryRequest.newBuilder()
           .setParent(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString())
           .setEntryId("entryId-1591558867")
           .setEntry(Entry.newBuilder().build())
           .build();
   Entry response = dataCatalogClient.createEntry(request);
 }
 
Parameter
Name Description
request CreateEntryRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Entry

createEntry(EntryGroupName parent, String entryId, Entry entry)

public final Entry createEntry(EntryGroupName parent, String entryId, Entry entry)

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.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   EntryGroupName parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]");
   String entryId = "entryId-1591558867";
   Entry entry = Entry.newBuilder().build();
   Entry response = dataCatalogClient.createEntry(parent, entryId, entry);
 }
 
Parameters
Name Description
parent EntryGroupName

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 Entry

Required. The entry to create.

Returns
Type Description
Entry

createEntry(String parent, String entryId, Entry entry)

public final Entry createEntry(String parent, String entryId, Entry entry)

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.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   String parent = EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString();
   String entryId = "entryId-1591558867";
   Entry entry = Entry.newBuilder().build();
   Entry response = dataCatalogClient.createEntry(parent, entryId, entry);
 }
 
Parameters
Name 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 Entry

Required. The entry to create.

Returns
Type Description
Entry

createEntryCallable()

public final UnaryCallable<CreateEntryRequest,Entry> createEntryCallable()

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.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   CreateEntryRequest request =
       CreateEntryRequest.newBuilder()
           .setParent(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString())
           .setEntryId("entryId-1591558867")
           .setEntry(Entry.newBuilder().build())
           .build();
   ApiFuture<Entry> future = dataCatalogClient.createEntryCallable().futureCall(request);
   // Do something.
   Entry response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateEntryRequest,Entry>

createEntryGroup(CreateEntryGroupRequest request)

public final EntryGroup createEntryGroup(CreateEntryGroupRequest request)

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).

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   CreateEntryGroupRequest request =
       CreateEntryGroupRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setEntryGroupId("entryGroupId1228924712")
           .setEntryGroup(EntryGroup.newBuilder().build())
           .build();
   EntryGroup response = dataCatalogClient.createEntryGroup(request);
 }
 
Parameter
Name Description
request CreateEntryGroupRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
EntryGroup

createEntryGroup(LocationName parent, String entryGroupId, EntryGroup entryGroup)

public final EntryGroup createEntryGroup(LocationName parent, String entryGroupId, EntryGroup entryGroup)

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).

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   String entryGroupId = "entryGroupId1228924712";
   EntryGroup entryGroup = EntryGroup.newBuilder().build();
   EntryGroup response = dataCatalogClient.createEntryGroup(parent, entryGroupId, entryGroup);
 }
 
Parameters
Name Description
parent LocationName

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 EntryGroup

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

Returns
Type Description
EntryGroup

createEntryGroup(String parent, String entryGroupId, EntryGroup entryGroup)

public final EntryGroup createEntryGroup(String parent, String entryGroupId, EntryGroup entryGroup)

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).

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   String entryGroupId = "entryGroupId1228924712";
   EntryGroup entryGroup = EntryGroup.newBuilder().build();
   EntryGroup response = dataCatalogClient.createEntryGroup(parent, entryGroupId, entryGroup);
 }
 
Parameters
Name 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 EntryGroup

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

Returns
Type Description
EntryGroup

createEntryGroupCallable()

public final UnaryCallable<CreateEntryGroupRequest,EntryGroup> createEntryGroupCallable()

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).

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   CreateEntryGroupRequest request =
       CreateEntryGroupRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setEntryGroupId("entryGroupId1228924712")
           .setEntryGroup(EntryGroup.newBuilder().build())
           .build();
   ApiFuture<EntryGroup> future =
       dataCatalogClient.createEntryGroupCallable().futureCall(request);
   // Do something.
   EntryGroup response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateEntryGroupRequest,EntryGroup>

createTag(CreateTagRequest request)

public final Tag createTag(CreateTagRequest request)

Creates a tag on an 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.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   CreateTagRequest request =
       CreateTagRequest.newBuilder()
           .setParent(
               EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString())
           .setTag(Tag.newBuilder().build())
           .build();
   Tag response = dataCatalogClient.createTag(request);
 }
 
Parameter
Name Description
request CreateTagRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Tag

createTag(EntryName parent, Tag tag)

public final Tag createTag(EntryName parent, Tag tag)

Creates a tag on an 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.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   EntryName parent = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]");
   Tag tag = Tag.newBuilder().build();
   Tag response = dataCatalogClient.createTag(parent, tag);
 }
 
Parameters
Name Description
parent EntryName

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 Tag

Required. The tag to create.

Returns
Type Description
Tag

createTag(String parent, Tag tag)

public final Tag createTag(String parent, Tag tag)

Creates a tag on an 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.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   String parent =
       EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString();
   Tag tag = Tag.newBuilder().build();
   Tag response = dataCatalogClient.createTag(parent, tag);
 }
 
Parameters
Name 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 Tag

Required. The tag to create.

Returns
Type Description
Tag

createTagCallable()

public final UnaryCallable<CreateTagRequest,Tag> createTagCallable()

Creates a tag on an 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.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   CreateTagRequest request =
       CreateTagRequest.newBuilder()
           .setParent(
               EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString())
           .setTag(Tag.newBuilder().build())
           .build();
   ApiFuture<Tag> future = dataCatalogClient.createTagCallable().futureCall(request);
   // Do something.
   Tag response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateTagRequest,Tag>

createTagTemplate(CreateTagTemplateRequest request)

public final TagTemplate createTagTemplate(CreateTagTemplateRequest request)

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).

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   CreateTagTemplateRequest request =
       CreateTagTemplateRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setTagTemplateId("tagTemplateId-1438776721")
           .setTagTemplate(TagTemplate.newBuilder().build())
           .build();
   TagTemplate response = dataCatalogClient.createTagTemplate(request);
 }
 
Parameter
Name Description
request CreateTagTemplateRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
TagTemplate

createTagTemplate(LocationName parent, String tagTemplateId, TagTemplate tagTemplate)

public final TagTemplate createTagTemplate(LocationName parent, String tagTemplateId, TagTemplate tagTemplate)

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).

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   String tagTemplateId = "tagTemplateId-1438776721";
   TagTemplate tagTemplate = TagTemplate.newBuilder().build();
   TagTemplate response =
       dataCatalogClient.createTagTemplate(parent, tagTemplateId, tagTemplate);
 }
 
Parameters
Name Description
parent LocationName

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

tagTemplateId String

Required. The id of the tag template to create.

tagTemplate TagTemplate

Required. The tag template to create.

Returns
Type Description
TagTemplate

createTagTemplate(String parent, String tagTemplateId, TagTemplate tagTemplate)

public final TagTemplate createTagTemplate(String parent, String tagTemplateId, TagTemplate tagTemplate)

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).

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   String tagTemplateId = "tagTemplateId-1438776721";
   TagTemplate tagTemplate = TagTemplate.newBuilder().build();
   TagTemplate response =
       dataCatalogClient.createTagTemplate(parent, tagTemplateId, tagTemplate);
 }
 
Parameters
Name Description
parent