From ec379e9da970e32e911020c794ecfee2656f87d5 Mon Sep 17 00:00:00 2001 From: Google APIs Date: Thu, 25 Jul 2019 12:34:14 -0700 Subject: [PATCH] Synchronize new proto/yaml changes. PiperOrigin-RevId: 259999391 --- .../v1beta1/datacatalog_gapic.yaml | 30 +++++++++++++++++++ .../samples/datacatalog_search.test.yaml | 25 ++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 google/cloud/datacatalog/v1beta1/samples/datacatalog_search.test.yaml diff --git a/google/cloud/datacatalog/v1beta1/datacatalog_gapic.yaml b/google/cloud/datacatalog/v1beta1/datacatalog_gapic.yaml index b49de152..aecb8abc 100644 --- a/google/cloud/datacatalog/v1beta1/datacatalog_gapic.yaml +++ b/google/cloud/datacatalog/v1beta1/datacatalog_gapic.yaml @@ -127,6 +127,36 @@ interfaces: retry_codes_name: non_idempotent retry_params_name: default timeout_millis: 60000 + samples: + standalone: + - value_sets: [datacatalog_search] + region_tag: datacatalog_search + sample_value_sets: + - id: datacatalog_search + description: Search Catalog + parameters: + defaults: + - scope.include_project_ids[0] = "[Google Cloud Project ID]" + - scope.include_gcp_public_datasets = false + - query = "[String in search query syntax]" + attributes: + - parameter: scope.include_project_ids[0] + description: Your Google Cloud project ID. + sample_argument_name: include_project_id + - parameter: scope.include_gcp_public_datasets + description: If true, include Google Cloud Platform (GCP) public datasets in the search results. + sample_argument_name: include_gcp_public_datasets + - parameter: query + description: | + Your query string. + See: https://cloud.google.com/data-catalog/docs/how-to/search-reference + Example: system=bigquery type=dataset + sample_argument_name: query + on_success: + - print: ["Result type: %s", $resp.search_result_type] + - print: ["Result subtype: %s", $resp.search_result_subtype] + - print: ["Relative resource name: %s", $resp.relative_resource_name] + - print: ["Linked resource: %s\n", $resp.linked_resource] - name: UpdateEntry flattening: groups: diff --git a/google/cloud/datacatalog/v1beta1/samples/datacatalog_search.test.yaml b/google/cloud/datacatalog/v1beta1/samples/datacatalog_search.test.yaml new file mode 100644 index 00000000..7877a036 --- /dev/null +++ b/google/cloud/datacatalog/v1beta1/samples/datacatalog_search.test.yaml @@ -0,0 +1,25 @@ +test: + suites: + - name: Data Catalog v1beta1 Search sample tests + setup: + # Get project ID from environment variable. + - env: + name: GOOGLE_PROJECT_ID + variable: project_id + cases: + - name: Search Catalog + spec: + - call: + sample: datacatalog_search + params: + include_project_id: + variable: project_id + include_gcp_public_datasets: + literal: "true" + query: + literal: "system=bigquery type=dataset name:trips" + - assert_contains: + - literal: "Result type: ENTRY" + - literal: "Result subtype: entry.dataset" + - literal: "Relative resource name: projects/bigquery-public-data" + - literal: "Linked resource: //bigquery.googleapis.com/projects/bigquery-public-data/datasets"