Use data domains

As a data domain user, you can use data domains to narrow search results to specific business contexts, search for BigQuery datasets, tables, and data products, and discover metadata within specific domain boundaries.

Before you begin

Before you perform a search by domain, ensure that you have the required roles and APIs enabled.

Enable APIs

Enable the Dataplex API.

Roles required to enable APIs

To enable APIs, you need the serviceusage.services.enable permission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.

Enable the API

Required roles

To get the permissions that you need to search and discover metadata using data domains, ask your administrator to grant you the following IAM roles on the project or data domain:

For more information about granting roles, see Manage access to projects, folders, and organizations.

You might also be able to get the required permissions through custom roles or other predefined roles.

Browse the domain hierarchy

For more information on how to browse the domain hierarchy, see View data domains and subdomains in a location.

Find resources within a data domain

To search for resources with a domain, follow these steps:

Console

  1. In the Google Cloud console, go to the Knowledge Catalog > Search page.

    Go to Search

  2. Click Try natural search to activate the natural search feature.

  3. Click Filters.

  4. In the Scope field, select Domain from the list.

  5. In the Select domain field, select the domain you want to narrow the results to. Add any additional filters if necessary.

Alternatively, you can use the Search within domain menu option to find resources in the domain:

  1. In the Google Cloud console, go to the Data domains page.

    Go to Data domains

  2. Select Search within domain from the menu. This action automatically opens a search window with the domain filter applied.

  3. Use the search field to find resources in the domain.

REST

To search entries scoped to a data domain, use the projects.locations.searchEntries method and provide the domain path in the contexts parameter.

Before using any of the request data, make the following replacements:

  • PROJECT_ID: the ID of your Google Cloud project.
  • LOCATION_ID: the region for the search inquiry (or global).
  • QUERY: the search query string.
  • DOMAIN_ID: the unique identifier of the data domain defining the search scope context.

HTTP method and URL:

POST https://dataplex.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID:searchEntries

Request JSON body:

{
  "query": "QUERY",
  "contexts": [ "projects/PROJECT_ID/locations/LOCATION_ID/dataDomains/DOMAIN_ID" ],
  "semantic_search": true,
  "page_size": 100
}

To send your request, expand one of these options:

You should receive a successful status code (2xx) and an empty response.

Limitations

When you search for resources outside the domain context, for example when using a global search, the domain's discoverability permissions don't apply. You only see resources that you have access to in the underlying system, such as BigQuery.

Suppose a BigQuery dataset is included in a data domain. You have the Dataplex Data Domain Entry Reader role for the domain, but you don't have direct permission to view the dataset in BigQuery:

  • Searching within the domain: You see the dataset in your search results because the domain permissions apply.
  • Searching outside the domain: You don't see the dataset in your search results. In a general search, domain permissions don't apply, and you don't have direct access in BigQuery.

What's next