Searches Data Catalog for multiple resources like entries and tags that match a query. This is a [Custom Method] (https://cloud.google.com/apis/design/custom_methods) that doesn't return all information on a resource, only its ID and high level fields. To get more information, you can subsequently call specific get methods. Note: Data Catalog search queries don't guarantee full recall. Results that match your query might not be returned, even in subsequent result pages. Additionally, returned (and not returned) results can vary if you repeat search queries. For more information, see [Data Catalog search syntax] (https://cloud.google.com/data-catalog/docs/how-to/search-reference).

Scopes

You will need authorization for the https://www.googleapis.com/auth/cloud-platform scope to make a valid call.

If unset, the scope for this method defaults to https://www.googleapis.com/auth/cloud-platform. You can set the scope for this method like this: datacatalog1 --scope <scope> catalog search ...

Required Request Value

The request value is a data-structure with various fields. Each field may be a simple scalar or another data-structure. In the latter case it is advised to set the field-cursor to the data-structure's field to specify values more concisely.

For example, a structure like this:

GoogleCloudDatacatalogV1SearchCatalogRequest:
  admin-search: boolean
  order-by: string
  page-size: integer
  page-token: string
  query: string
  scope:
    include-gcp-public-datasets: boolean
    include-org-ids: [string]
    include-project-ids: [string]
    include-public-tag-templates: boolean
    restricted-locations: [string]
    starred-only: boolean

can be set completely with the following arguments which are assumed to be executed in the given order. Note how the cursor position is adjusted to the respective structures, allowing simple field names to be used most of the time.

  • -r . admin-search=true
    • Optional. If set, use searchAll permission granted on organizations from include_org_ids and projects from include_project_ids instead of the fine grained per resource permissions when filtering the search results. The only allowed order_by criteria for admin_search mode is default. Using this flags guarantees a full recall of the search results.
  • order-by=voluptua.
    • Specifies the order of results. Currently supported case-sensitive values are: * relevance that can only be descending * last_modified_timestamp [asc|desc] with descending (desc) as default * default that can only be descending Search queries don't guarantee full recall. Results that match your query might not be returned, even in subsequent result pages. Additionally, returned (and not returned) results can vary if you repeat search queries. If you are experiencing recall issues and you don't have to fetch the results in any specific order, consider setting this parameter to default. If this parameter is omitted, it defaults to the descending relevance.
  • page-size=74
    • Upper bound on the number of results you can get in a single response. Can't be negative or 0, defaults to 10 in this case. The maximum number is 1000. If exceeded, throws an "invalid argument" exception.
  • page-token=sanctus
    • Optional. Pagination token that, if specified, returns the next page of search results. If empty, returns the first page. This token is returned in the SearchCatalogResponse.next_page_token field of the response to a previous SearchCatalogRequest call.
  • query=sed
    • Optional. The query string with a minimum of 3 characters and specific syntax. For more information, see Data Catalog search syntax. An empty query string returns all data assets (in the specified scope) that you have access to. A query string can be a simple xyz or qualified by predicates: * name:x * column:y * description:z
  • scope include-gcp-public-datasets=true
    • If true, include Google Cloud public datasets in search results. By default, they are excluded. See Google Cloud Public Datasets for more information.
  • include-org-ids=amet.
    • The list of organization IDs to search within. To find your organization ID, follow the steps from [Creating and managing organizations] (/resource-manager/docs/creating-managing-organization).
    • Each invocation of this argument appends the given value to the array.
  • include-project-ids=duo
    • The list of project IDs to search within. For more information on the distinction between project names, IDs, and numbers, see Projects.
    • Each invocation of this argument appends the given value to the array.
  • include-public-tag-templates=true
    • Optional. This field is deprecated. The search mechanism for public and private tag templates is the same.
  • restricted-locations=gubergren
    • Optional. The list of locations to search within. If empty, all locations are searched. Returns an error if any location in the list isn't one of the Supported regions. If a location is unreachable, its name is returned in the SearchCatalogResponse.unreachable field. To get additional information on the error, repeat the search request and set the location name as the value of this parameter.
    • Each invocation of this argument appends the given value to the array.
  • starred-only=true
    • Optional. If true, search only among starred entries. By default, all results are returned, starred or not.

About Cursors

The cursor position is key to comfortably set complex nested structures. The following rules apply:

  • The cursor position is always set relative to the current one, unless the field name starts with the . character. Fields can be nested such as in -r f.s.o .
  • The cursor position is set relative to the top-level structure if it starts with ., e.g. -r .s.s
  • You can also set nested fields without setting the cursor explicitly. For example, to set a value relative to the current cursor position, you would specify -r struct.sub_struct=bar.
  • You can move the cursor one level up by using ... Each additional . moves it up one additional level. E.g. ... would go three levels up.

Optional Output Flags

The method's return value a JSON encoded structure, which will be written to standard output by default.

  • -o out
    • out specifies the destination to which to write the server's result to. It will be a JSON-encoded structure. The destination may be - to indicate standard output, or a filepath that is to contain the received bytes. If unset, it defaults to standard output.

Optional General Properties

The following properties can configure any call, and are not specific to this method.

  • -p $-xgafv=string

    • V1 error format.
  • -p access-token=string

    • OAuth access token.
  • -p alt=string

    • Data format for response.
  • -p callback=string

    • JSONP
  • -p fields=string

    • Selector specifying which fields to include in a partial response.
  • -p key=string

    • API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
  • -p oauth-token=string

    • OAuth 2.0 token for the current user.
  • -p pretty-print=boolean

    • Returns response with indentations and line breaks.
  • -p quota-user=string

    • Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
  • -p upload-type=string

    • Legacy upload protocol for media (e.g. "media", "multipart").
  • -p upload-protocol=string

    • Upload protocol for media (e.g. "raw", "multipart").