From fcdec366bb4076be75649031706548128a01fc02 Mon Sep 17 00:00:00 2001 From: Google APIs Date: Fri, 27 Sep 2019 13:30:54 -0700 Subject: [PATCH] Synchronize new proto/yaml changes. PiperOrigin-RevId: 271635926 --- .../artman_datacatalog_v1beta1.yaml | 1 + .../datacatalog/v1beta1/datacatalog.proto | 649 ++++++++++++++---- .../v1beta1/datacatalog_gapic.yaml | 74 +- .../v1beta1/gcs_fileset_spec.proto | 57 ++ google/cloud/datacatalog/v1beta1/schema.proto | 12 +- google/cloud/datacatalog/v1beta1/search.proto | 15 +- .../datacatalog/v1beta1/table_spec.proto | 49 +- google/cloud/datacatalog/v1beta1/tags.proto | 98 ++- .../datacatalog/v1beta1/timestamps.proto | 9 +- 9 files changed, 752 insertions(+), 212 deletions(-) create mode 100644 google/cloud/datacatalog/v1beta1/gcs_fileset_spec.proto diff --git a/google/cloud/datacatalog/artman_datacatalog_v1beta1.yaml b/google/cloud/datacatalog/artman_datacatalog_v1beta1.yaml index e3fdc8ca..8465a93c 100644 --- a/google/cloud/datacatalog/artman_datacatalog_v1beta1.yaml +++ b/google/cloud/datacatalog/artman_datacatalog_v1beta1.yaml @@ -4,6 +4,7 @@ common: organization_name: google-cloud proto_deps: - name: google-common-protos + - name: google-iam-v1 src_proto_paths: - v1beta1 service_yaml: datacatalog_v1beta1.yaml diff --git a/google/cloud/datacatalog/v1beta1/datacatalog.proto b/google/cloud/datacatalog/v1beta1/datacatalog.proto index e89e7ad6..7abd9eae 100644 --- a/google/cloud/datacatalog/v1beta1/datacatalog.proto +++ b/google/cloud/datacatalog/v1beta1/datacatalog.proto @@ -18,6 +18,10 @@ syntax = "proto3"; package google.cloud.datacatalog.v1beta1; import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/datacatalog/v1beta1/gcs_fileset_spec.proto"; import "google/cloud/datacatalog/v1beta1/schema.proto"; import "google/cloud/datacatalog/v1beta1/search.proto"; import "google/cloud/datacatalog/v1beta1/table_spec.proto"; @@ -27,7 +31,6 @@ import "google/iam/v1/iam_policy.proto"; import "google/iam/v1/policy.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; -import "google/api/client.proto"; option cc_enable_arenas = true; option go_package = "google.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog"; @@ -46,7 +49,7 @@ service DataCatalog { // 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. + // 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 @@ -60,14 +63,82 @@ service DataCatalog { post: "/v1beta1/catalog:search" body: "*" }; + option (google.api.method_signature) = "scope,query,order_by"; + } + + // 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] + // (/data-catalog/docs/concepts/resource-project) for more information). + rpc CreateEntryGroup(CreateEntryGroupRequest) returns (EntryGroup) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/entryGroups" + body: "entry_group" + }; + option (google.api.method_signature) = "parent,entry_group_id,entry_group"; + } + + // Alpha feature. + // Gets an EntryGroup. + rpc GetEntryGroup(GetEntryGroupRequest) returns (EntryGroup) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/entryGroups/*}" + }; + option (google.api.method_signature) = "name"; + option (google.api.method_signature) = "name,read_mask"; + } + + // 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] + // (/data-catalog/docs/concepts/resource-project) for more information). + rpc DeleteEntryGroup(DeleteEntryGroupRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/entryGroups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // 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] + // (/data-catalog/docs/concepts/resource-project) for more information). + rpc CreateEntry(CreateEntryRequest) returns (Entry) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/entryGroups/*}/entries" + body: "entry" + }; + option (google.api.method_signature) = "parent,entry_id,entry"; } // 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] + // (/data-catalog/docs/concepts/resource-project) for more information). rpc UpdateEntry(UpdateEntryRequest) returns (Entry) { option (google.api.http) = { patch: "/v1beta1/{entry.name=projects/*/locations/*/entryGroups/*/entries/*}" body: "entry" }; + option (google.api.method_signature) = "entry"; + option (google.api.method_signature) = "entry,update_mask"; + } + + // 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] + // (/data-catalog/docs/concepts/resource-project) for more information). + rpc DeleteEntry(DeleteEntryRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/entryGroups/*/entries/*}" + }; + option (google.api.method_signature) = "name"; } // Gets an entry. @@ -75,6 +146,7 @@ service DataCatalog { option (google.api.http) = { get: "/v1beta1/{name=projects/*/locations/*/entryGroups/*/entries/*}" }; + option (google.api.method_signature) = "name"; } // Get an entry by target resource name. This method allows clients to use @@ -86,12 +158,16 @@ service DataCatalog { }; } - // Creates a tag template. + // 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](/data-catalog/docs/concepts/resource-project) for more + // information). rpc CreateTagTemplate(CreateTagTemplateRequest) returns (TagTemplate) { option (google.api.http) = { post: "/v1beta1/{parent=projects/*/locations/*}/tagTemplates" body: "tag_template" }; + option (google.api.method_signature) = "parent,tag_template_id,tag_template"; } // Gets a tag template. @@ -99,63 +175,97 @@ service DataCatalog { option (google.api.http) = { get: "/v1beta1/{name=projects/*/locations/*/tagTemplates/*}" }; + option (google.api.method_signature) = "name"; } // 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] + // (/data-catalog/docs/concepts/resource-project) for more information). rpc UpdateTagTemplate(UpdateTagTemplateRequest) returns (TagTemplate) { option (google.api.http) = { patch: "/v1beta1/{tag_template.name=projects/*/locations/*/tagTemplates/*}" body: "tag_template" }; + option (google.api.method_signature) = "tag_template"; + option (google.api.method_signature) = "tag_template,update_mask"; } // 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] + // (/data-catalog/docs/concepts/resource-project) for more information). rpc DeleteTagTemplate(DeleteTagTemplateRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1beta1/{name=projects/*/locations/*/tagTemplates/*}" }; + option (google.api.method_signature) = "name,force"; } - // Creates a field in a tag template. + // 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](/data-catalog/docs/concepts/resource-project) for more + // information). rpc CreateTagTemplateField(CreateTagTemplateFieldRequest) returns (TagTemplateField) { option (google.api.http) = { post: "/v1beta1/{parent=projects/*/locations/*/tagTemplates/*}/fields" body: "tag_template_field" }; + option (google.api.method_signature) = "parent,tag_template_field_id,tag_template_field"; } // Updates a field in a tag template. This method cannot be used to update the - // field type. + // field type. The user should enable the Data Catalog API in the project + // identified by the `name` parameter (see [Data Catalog Resource Project] + // (/data-catalog/docs/concepts/resource-project) for more information). rpc UpdateTagTemplateField(UpdateTagTemplateFieldRequest) returns (TagTemplateField) { option (google.api.http) = { patch: "/v1beta1/{name=projects/*/locations/*/tagTemplates/*/fields/*}" body: "tag_template_field" }; + option (google.api.method_signature) = "name,tag_template_field"; + option (google.api.method_signature) = "name,tag_template_field,update_mask"; } - // Renames a field in a tag template. + // 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](/data-catalog/docs/concepts/resource-project) for more + // information). rpc RenameTagTemplateField(RenameTagTemplateFieldRequest) returns (TagTemplateField) { option (google.api.http) = { post: "/v1beta1/{name=projects/*/locations/*/tagTemplates/*/fields/*}:rename" body: "*" }; + option (google.api.method_signature) = "name,new_tag_template_field_id"; } // 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] + // (/data-catalog/docs/concepts/resource-project) for more information). rpc DeleteTagTemplateField(DeleteTagTemplateFieldRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1beta1/{name=projects/*/locations/*/tagTemplates/*/fields/*}" }; + option (google.api.method_signature) = "name,force"; } // Creates a tag on an [Entry][google.cloud.datacatalog.v1beta1.Entry]. + // Note: The project identified by the `parent` parameter for the + // [tag](/data-catalog/docs/reference/rest/v1beta1/projects.locations.entryGroups.entries.tags/create#path-parameters) + // and the + // [tag + // template](/data-catalog/docs/reference/rest/v1beta1/projects.locations.tagTemplates/create#path-parameters) + // used to create the tag must be from the same organization. rpc CreateTag(CreateTagRequest) returns (Tag) { option (google.api.http) = { post: "/v1beta1/{parent=projects/*/locations/*/entryGroups/*/entries/*}/tags" body: "tag" }; + option (google.api.method_signature) = "parent,tag"; } // Updates an existing tag. @@ -164,6 +274,8 @@ service DataCatalog { patch: "/v1beta1/{tag.name=projects/*/locations/*/entryGroups/*/entries/*/tags/*}" body: "tag" }; + option (google.api.method_signature) = "tag"; + option (google.api.method_signature) = "tag,update_mask"; } // Deletes a tag. @@ -171,6 +283,7 @@ service DataCatalog { option (google.api.http) = { delete: "/v1beta1/{name=projects/*/locations/*/entryGroups/*/entries/*/tags/*}" }; + option (google.api.method_signature) = "name"; } // Lists the tags on an [Entry][google.cloud.datacatalog.v1beta1.Entry]. @@ -178,22 +291,36 @@ service DataCatalog { option (google.api.http) = { get: "/v1beta1/{parent=projects/*/locations/*/entryGroups/*/entries/*}/tags" }; + option (google.api.method_signature) = "parent"; } // 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.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. rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1beta1/{resource=projects/*/locations/*/tagTemplates/*}:setIamPolicy" body: "*" + additional_bindings { + post: "/v1beta1/{resource=projects/*/locations/*/entryGroups/*}:setIamPolicy" + body: "*" + } + additional_bindings { + post: "/v1beta1/{resource=projects/*/locations/*/entryGroups/*/entries/*}:setIamPolicy" + body: "*" + } }; } @@ -203,16 +330,29 @@ service DataCatalog { // // 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.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. rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1beta1/{resource=projects/*/locations/*/tagTemplates/*}:getIamPolicy" body: "*" + additional_bindings { + post: "/v1beta1/{resource=projects/*/locations/*/entryGroups/*}:getIamPolicy" + body: "*" + } + additional_bindings { + post: "/v1beta1/{resource=projects/*/locations/*/entryGroups/*/entries/*}:getIamPolicy" + body: "*" + } }; } @@ -220,8 +360,10 @@ service DataCatalog { // If the resource does not exist, an empty set of permissions is returned // (We don't return a `NOT_FOUND` error). // - // Supported resource are: - // - tag templates. + // 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. @@ -232,6 +374,14 @@ service DataCatalog { option (google.api.http) = { post: "/v1beta1/{resource=projects/*/locations/*/tagTemplates/*}:testIamPermissions" body: "*" + additional_bindings { + post: "/v1beta1/{resource=projects/*/locations/*/entryGroups/*}:testIamPermissions" + body: "*" + } + additional_bindings { + post: "/v1beta1/{resource=projects/*/locations/*/entryGroups/*/entries/*}:testIamPermissions" + body: "*" + } }; } } @@ -242,21 +392,21 @@ message SearchCatalogRequest { message Scope { // Data Catalog tries to automatically choose the right corpus of data to // search through. You can ensure an organization is included by adding it - // to "include_org_ids". You can ensure a project's org is included with - // "include_project_ids". You must specify at least one organization - // using "include_org_ids" or "include_project_ids" in all search requests. + // to `include_org_ids`. You can ensure a project's org is included with + // `include_project_ids`. You must specify at least one organization + // using `include_org_ids` or `include_project_ids` in all search requests. // // List of organization IDs to search within. To find your organization ID, // follow instructions in - // https://cloud.google.com/resource-manager/docs/creating-managing-organization + // https://cloud.google.com/resource-manager/docs/creating-managing-organization. repeated string include_org_ids = 2; // List of project IDs to search within. To learn more about the // distinction between project names/IDs/numbers, go to - // https://cloud.google.com/docs/overview/#projects + // https://cloud.google.com/docs/overview/#projects. repeated string include_project_ids = 3; - // If true, include Google Cloud Platform (GCP) public datasets in the + // If `true`, include Google Cloud Platform (GCP) public datasets in the // search results. Info on GCP public datasets is available at // https://cloud.google.com/public-datasets/. By default, GCP public // datasets are excluded. @@ -264,7 +414,7 @@ message SearchCatalogRequest { } // Required. The scope of this search request. - Scope scope = 6; + Scope scope = 6 [(google.api.field_behavior) = REQUIRED]; // Required. The query string in search query syntax. The query must be // non-empty. @@ -278,69 +428,163 @@ message SearchCatalogRequest { // Note: Query tokens need to have a minimum of 3 characters for substring // matching to work correctly. See [Data Catalog Search // Syntax](/data-catalog/docs/how-to/search-reference) for more information. - string query = 1; + string query = 1 [(google.api.field_behavior) = REQUIRED]; // 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. int32 page_size = 2; // Optional pagination token returned in an earlier - // [SearchCatalogResponse.next_page_token][google.cloud.datacatalog.v1beta1.DataCatalog.SearchCatalogResponse.next_page_token]; + // [SearchCatalogResponse.next_page_token][google.cloud.datacatalog.v1beta1.SearchCatalogResponse.next_page_token], which // indicates that this is a continuation of a prior - // [SearchCatalog][google.cloud.datacatalog.v1beta1.DataCatalog.SearchCatalog] - // call, and that the system should return the next page of data. If empty - // then the first page is returned. + // [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. string page_token = 3; // 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. string order_by = 5; } // Response message for // [SearchCatalog][google.cloud.datacatalog.v1beta1.DataCatalog.SearchCatalog]. message SearchCatalogResponse { - // Search results in descending order of relevance. + // Search results. repeated SearchCatalogResult results = 1; // The token that can be used to retrieve the next page of results. string next_page_token = 3; } +// Request message for +// [CreateEntryGroup][google.cloud.datacatalog.v1beta1.DataCatalog.CreateEntryGroup]. +message CreateEntryGroupRequest { + // 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. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datacatalog.googleapis.com/EntryGroup" + } + ]; + + // Required. The id of the entry group to create. + string entry_group_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The entry group to create. Defaults to an empty entry group. + EntryGroup entry_group = 2; +} + +// Request message for +// [GetEntryGroup][google.cloud.datacatalog.v1beta1.DataCatalog.GetEntryGroup]. +message GetEntryGroupRequest { + // Required. The name of the entry group. For example, + // `projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datacatalog.googleapis.com/EntryGroup" + } + ]; + + // Optional. The fields to return. If not set or empty, all fields are + // returned. + google.protobuf.FieldMask read_mask = 2; +} + +// Request message for +// [DeleteEntryGroup][google.cloud.datacatalog.v1beta1.DataCatalog.DeleteEntryGroup]. +message DeleteEntryGroupRequest { + // Required. The name of the entry group. For example, + // `projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datacatalog.googleapis.com/EntryGroup" + } + ]; +} + +// Request message for +// [CreateEntry][google.cloud.datacatalog.v1beta1.DataCatalog.CreateEntry]. +message CreateEntryRequest { + // 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. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datacatalog.googleapis.com/EntryGroup" + } + ]; + + // Required. The id of the entry to create. + string entry_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The entry to create. + Entry entry = 2 [(google.api.field_behavior) = REQUIRED]; +} + // Request message for // [UpdateEntry][google.cloud.datacatalog.v1beta1.DataCatalog.UpdateEntry]. message UpdateEntryRequest { - // Required. The updated Entry. - Entry entry = 1; + // Required. The updated entry. + Entry entry = 1 [(google.api.field_behavior) = REQUIRED]; - // Optional. The fields to update on the entry. If absent or empty, all + // Optional. The fields to update on the entry. If absent or empty, all // modifiable fields are updated. // - // Modifiable fields in synced entries: - // - // 1. schema (Pub/Sub topics only) - // - // Modifiable fields in native entries: - // - // 1. display_name - // 2. description - // 3. schema + // Currently only `schema` field in Cloud Pub/Sub topic entries is modifiable. google.protobuf.FieldMask update_mask = 2; } +// Request message for +// [DeleteEntry][google.cloud.datacatalog.v1beta1.DataCatalog.DeleteEntry]. +message DeleteEntryRequest { + // Required. The name of the entry. Example: + // + // * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datacatalog.googleapis.com/Entry" + } + ]; +} + // Request message for // [GetEntry][google.cloud.datacatalog.v1beta1.DataCatalog.GetEntry]. message GetEntryRequest { - // Required. The name of the entry. For example, - // "projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}". - string name = 1; + // 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. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datacatalog.googleapis.com/Entry" + } + ]; } // Request message for @@ -351,69 +595,86 @@ message LookupEntryRequest { oneof target_name { // 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 + // 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" + // + // * //bigquery.googleapis.com/projects/projectId/datasets/datasetId/tables/tableId + // * //pubsub.googleapis.com/projects/projectId/topics/topicId string linked_resource = 1; // The SQL name of the entry. SQL names are case-sensitive. // // Examples: - // - // *_ids shoud satisfy the standard SQL rules for identifiers. - // https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical + // + // * `cloud_pubsub.project_id.topic_id` + // * ``pubsub.project_id.`topic.id.with.dots` `` + // * `bigquery.project_id.dataset_id.table_id` + // * `datacatalog.project_id.location_id.entry_group_id.entry_id` + // + // `*_id`s shoud satisfy the standard SQL rules for identifiers. + // https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical. string sql_resource = 3; } } // Entry Metadata. // A Data Catalog Entry resource represents another resource in Google -// Cloud Platform, such as a BigQuery Dataset or a Pub/Sub Topic. Clients can -// use the `linked_resource` field in the Entry resource to refer to the -// original resource id of the source system. +// Cloud Platform, such as a BigQuery dataset or a Cloud Pub/Sub topic. +// Clients can use the `linked_resource` field in the Entry resource to refer to +// the original resource ID of the source system. // // An Entry resource contains resource details, such as its schema. An Entry can // also be used to attach flexible metadata, such as a // [Tag][google.cloud.datacatalog.v1beta1.Tag]. message Entry { + option (google.api.resource) = { + type: "datacatalog.googleapis.com/Entry" + pattern: "projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}" + }; + // Required when used in // [UpdateEntryRequest][google.cloud.datacatalog.v1beta1.UpdateEntryRequest]. - // The Data Catalog resource name of the entry in URL format. For example, - // "projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}". + // The Data Catalog resource name of the entry in URL format. Example: + // + // * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id} + // // Note that this Entry and its child resources may not actually be stored in // the location in this name. - string name = 1; + string name = 1 [(google.api.resource_reference) = { + type: "datacatalog.googleapis.com/EntryGroup" + }]; - // Output only. The full name of the cloud resource the entry belongs to. See: - // https://cloud.google.com/apis/design/resource_names#full_resource_name + // Output only. The resource this metadata entry refers to. // - // Data Catalog supports resources from select Google Cloud Platform systems. - // `linked_resource` is the full name of the Google Cloud Platform resource. + // For Google Cloud Platform resources, `linked_resource` is the [full name of + // the + // resource](https://cloud.google.com/apis/design/resource_names#full_resource_name). // For example, the `linked_resource` for a table resource from BigQuery is: // - // "//bigquery.googleapis.com/projects/projectId/datasets/datasetId/tables/tableId". + // * //bigquery.googleapis.com/projects/projectId/datasets/datasetId/tables/tableId string linked_resource = 9; - // Required. Type of entry. - EntryType type = 2; + // Required. Entry type. + oneof entry_type { + // The type of the entry. + EntryType type = 2; + } // Optional. Type specification information. oneof type_spec { + // Specification that applies to a Cloud Storage fileset. This is only valid + // on entries of type FILESET. + GcsFilesetSpec gcs_fileset_spec = 6; + // Specification that applies to a BigQuery table. This is only valid on - // entries of type TABLE. + // entries of type `TABLE`. BigQueryTableSpec bigquery_table_spec = 12; // Specification for a group of BigQuery tables with name pattern - // [prefix]YYYYMMDD. Context: - // https://cloud.google.com/bigquery/docs/partitioned-tables#partitioning_versus_sharding + // `[prefix]YYYYMMDD`. Context: + // https://cloud.google.com/bigquery/docs/partitioned-tables#partitioning_versus_sharding. BigQueryDateShardedSpec bigquery_date_sharded_spec = 15; } @@ -430,86 +691,165 @@ message Entry { // to it. Schema schema = 5; - // Output only. Timestamps about the underlying Google Cloud Platform resource - // -- not about this Data Catalog Entry. + // Output only. Timestamps about the underlying Google Cloud Platform + // resource, not about this Data Catalog Entry. SystemTimestamps source_system_timestamps = 7; } +// EntryGroup Metadata. +// An EntryGroup resource represents a logical grouping of zero or more +// Data Catalog [Entry][google.cloud.datacatalog.v1beta1.Entry] resources. +message EntryGroup { + option (google.api.resource) = { + type: "datacatalog.googleapis.com/EntryGroup" + pattern: "projects/{project}/locations/{location}/entryGroups/{entry_group}" + }; + + // Required when used in + // [UpdateEntryGroupRequest][google.cloud.datacatalog.v1beta1.UpdateEntryGroupRequest]. + // The resource name of the entry group in URL format. Example: + // + // * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id} + // + // Note that this EntryGroup and its child resources may not actually be + // stored in the location in this name. + string name = 1; + + // Optional. A short name to identify the entry group, for example, + // "analytics data - jan 2011". Default value is an empty string. + string display_name = 2; + + // Optional. Entry group description, which can consist of several sentences + // or paragraphs that describe entry group contents. Default value is an empty + // string. + string description = 3; + + // Output only. Timestamps about this EntryGroup. Default value is empty + // timestamps. + SystemTimestamps data_catalog_timestamps = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + // Request message for // [CreateTagTemplate][google.cloud.datacatalog.v1beta1.DataCatalog.CreateTagTemplate]. message CreateTagTemplateRequest { // Required. The name of the project and the location this template is in. - // Example: "projects/{project_id}/locations/{location}". Note that this + // Example: + // + // * projects/{project_id}/locations/{location} + // // TagTemplate and its child resources may not actually be stored in the // location in this name. - string parent = 1; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datacatalog.googleapis.com/TagTemplate" + } + ]; // Required. The id of the tag template to create. - string tag_template_id = 3; + string tag_template_id = 3 [(google.api.field_behavior) = REQUIRED]; // Required. The tag template to create. - TagTemplate tag_template = 2; + TagTemplate tag_template = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Entry resources in Data Catalog can be of different types e.g. a BigQuery +// Table entry is of type `TABLE`. This enum describes all the possible types +// Data Catalog contains. +enum EntryType { + // Default unknown type + ENTRY_TYPE_UNSPECIFIED = 0; + + // Output only. The type of entry that has a GoogleSQL schema, including + // logical views. + TABLE = 2; + + // Output only. An entry type which is used for streaming entries. Example: + // Cloud Pub/Sub topic. + DATA_STREAM = 3; + + // An entry type which is a set of files or objects. Example: Cloud Storage + // fileset. + FILESET = 4; } // Request message for // [GetTagTemplate][google.cloud.datacatalog.v1beta1.DataCatalog.GetTagTemplate]. message GetTagTemplateRequest { - // Required. The name of the tag template. For example, - // "projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}". - string name = 1; + // Required. The name of the tag template. Example: + // + // * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datacatalog.googleapis.com/TagTemplate" + } + ]; } // Request message for // [UpdateTagTemplate][google.cloud.datacatalog.v1beta1.DataCatalog.UpdateTagTemplate]. message UpdateTagTemplateRequest { // Required. The template to update. - TagTemplate tag_template = 1; + TagTemplate tag_template = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. The field mask specifies the parts of the template to overwrite. // // Allowed fields: // - // * display_name + // * `display_name` // - // If update_mask is omitted, all of the allowed fields above will be updated. + // If absent or empty, all of the allowed fields above will be updated. google.protobuf.FieldMask update_mask = 2; } // Request message for // [DeleteTagTemplate][google.cloud.datacatalog.v1beta1.DataCatalog.DeleteTagTemplate]. message DeleteTagTemplateRequest { - // Required. The name of the tag template to delete. For example, - // "projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}". - string name = 1; + // Required. The name of the tag template to delete. Example: + // + // * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datacatalog.googleapis.com/TagTemplate" + } + ]; - // Required. Currently, this field must always be set to true. + // 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. - bool force = 2; + // `force = false` will be supported in the future. + bool force = 2 [(google.api.field_behavior) = REQUIRED]; } // Request message for // [CreateTag][google.cloud.datacatalog.v1beta1.DataCatalog.CreateTag]. message CreateTagRequest { - // 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}"). + // 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. - string parent = 1; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datacatalog.googleapis.com/Tag" + } + ]; // Required. The tag to create. - Tag tag = 2; + Tag tag = 2 [(google.api.field_behavior) = REQUIRED]; } // Request message for // [UpdateTag][google.cloud.datacatalog.v1beta1.DataCatalog.UpdateTag]. message UpdateTagRequest { // Required. The updated tag. - Tag tag = 1; + Tag tag = 1 [(google.api.field_behavior) = REQUIRED]; - // Optional. The fields to update on the Tag. If absent or empty, all + // Optional. 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`. google.protobuf.FieldMask update_mask = 2; @@ -518,48 +858,68 @@ message UpdateTagRequest { // Request message for // [DeleteTag][google.cloud.datacatalog.v1beta1.DataCatalog.DeleteTag]. message DeleteTagRequest { - // Required. The name of the tag to delete. For example, - // "projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}/tags/{tag_id}". - string name = 1; + // Required. The name of the tag to delete. Example: + // + // * projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}/tags/{tag_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datacatalog.googleapis.com/Tag" + } + ]; } // Request message for // [CreateTagTemplateField][google.cloud.datacatalog.v1beta1.DataCatalog.CreateTagTemplateField]. message CreateTagTemplateFieldRequest { // Required. The name of the project this template is in. Example: - // "projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}". + // + // * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id} + // // Note that this TagTemplateField may not actually be stored in the location // in this name. - string parent = 1; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datacatalog.googleapis.com/TagTemplate" + } + ]; - // Required. The id of the tag template field to create. + // 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 to their template. - string tag_template_field_id = 2; + // (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. + string tag_template_field_id = 2 [(google.api.field_behavior) = REQUIRED]; // Required. The tag template field to create. - TagTemplateField tag_template_field = 3; + TagTemplateField tag_template_field = 3 [(google.api.field_behavior) = REQUIRED]; } // Request message for // [UpdateTagTemplateField][google.cloud.datacatalog.v1beta1.DataCatalog.UpdateTagTemplateField]. message UpdateTagTemplateFieldRequest { - // Required. The name of the tag template field. For example, - // "projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id}". - string name = 1; + // Required. The name of the tag template field. Example: + // + // * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datacatalog.googleapis.com/TagTemplateField" + } + ]; // Required. The template to update. - TagTemplateField tag_template_field = 2; + TagTemplateField tag_template_field = 2 [(google.api.field_behavior) = REQUIRED]; - // Optional. The field mask specifies the parts of the template to overwrite. + // Optional. The field mask specifies the parts of the template to be updated. // Allowed fields: // - // * display_name - // * type.enum_type + // * `display_name` + // * `type.enum_type` // - // If update_mask is omitted, all of the allowed fields above will be updated. + // 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 @@ -570,40 +930,38 @@ message UpdateTagTemplateFieldRequest { // Request message for // [RenameTagTemplateField][google.cloud.datacatalog.v1beta1.DataCatalog.RenameTagTemplateField]. message RenameTagTemplateFieldRequest { - // Required. The name of the tag template. For example, - // "projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id}". - string name = 1; + // Required. The name of the tag template. Example: + // + // * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datacatalog.googleapis.com/TagTemplateField" + } + ]; // Required. The new ID of this tag template field. For example, - // "my_new_field". - string new_tag_template_field_id = 2; -} - -// Entry resources in Data Catalog can be of different types e.g. BigQuery -// Table entry is of type 'TABLE'. This enum describes all the possible types -// Data Catalog contains. -enum EntryType { - // Default unknown type - ENTRY_TYPE_UNSPECIFIED = 0; - - // The type of entry that has a GoogleSQL schema, including logical views. - TABLE = 2; - - // An entry type which is used for streaming entries. Example - Pub/Sub. - DATA_STREAM = 3; + // `my_new_field`. + string new_tag_template_field_id = 2 [(google.api.field_behavior) = REQUIRED]; } // Request message for // [DeleteTagTemplateField][google.cloud.datacatalog.v1beta1.DataCatalog.DeleteTagTemplateField]. message DeleteTagTemplateFieldRequest { - // Required. The name of the tag template field to delete. For example, - // "projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}/fields/{tag_template_field_id}". - string name = 1; + // 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} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datacatalog.googleapis.com/TagTemplateField" + } + ]; - // Required. Currently, this field must always be set to true. + // 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. - bool force = 2; + // `force = false` will be supported in the future. + bool force = 2 [(google.api.field_behavior) = REQUIRED]; } // Request message for @@ -611,7 +969,12 @@ message DeleteTagTemplateFieldRequest { message ListTagsRequest { // Required. The name of the Data Catalog resource to list the tags of. The // resource could be an [Entry][google.cloud.datacatalog.v1beta1.Entry]. - string parent = 1; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "datacatalog.googleapis.com/Tag" + } + ]; // Optional. The maximum number of tags to return. Default is 10. Max limit is // 1000. diff --git a/google/cloud/datacatalog/v1beta1/datacatalog_gapic.yaml b/google/cloud/datacatalog/v1beta1/datacatalog_gapic.yaml index aecb8abc..3694e95f 100644 --- a/google/cloud/datacatalog/v1beta1/datacatalog_gapic.yaml +++ b/google/cloud/datacatalog/v1beta1/datacatalog_gapic.yaml @@ -17,7 +17,6 @@ language_settings: nodejs: package_name: datacatalog.v1beta1 domain_layer_location: google-cloud - # A list of API interface configurations. interfaces: # The fully qualified name of the API interface. @@ -35,6 +34,8 @@ interfaces: collections: - name_pattern: projects/{project}/locations/{location} entity_name: location + - name_pattern: projects/{project}/locations/{location}/entryGroups/{entry_group} + entity_name: entry_group - name_pattern: projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry} entity_name: entry - name_pattern: projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}/tags/{tag} @@ -117,6 +118,7 @@ interfaces: required_fields: - scope - query + - order_by page_streaming: request: page_size_field: page_size @@ -157,6 +159,63 @@ interfaces: - 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: CreateEntryGroup + flattening: + groups: + - parameters: + - parent + - entry_group_id + - entry_group + required_fields: + - parent + - entry_group_id + - entry_group + retry_codes_name: non_idempotent + retry_params_name: default + field_name_patterns: + parent: location + timeout_millis: 60000 + - name: GetEntryGroup + flattening: + groups: + - parameters: + - name + - read_mask + required_fields: + - name + retry_codes_name: idempotent + retry_params_name: default + field_name_patterns: + name: entry_group + timeout_millis: 60000 + - name: DeleteEntryGroup + flattening: + groups: + - parameters: + - name + required_fields: + - name + retry_codes_name: idempotent + retry_params_name: default + field_name_patterns: + name: entry_group + timeout_millis: 60000 + - name: CreateEntry + flattening: + groups: + - parameters: + - parent + - entry_id + - entry + required_fields: + - parent + - entry_id + - entry + retry_codes_name: non_idempotent + retry_params_name: default + field_name_patterns: + parent: entry_group + timeout_millis: 60000 - name: UpdateEntry flattening: groups: @@ -170,6 +229,18 @@ interfaces: field_name_patterns: entry.name: entry timeout_millis: 60000 + - name: DeleteEntry + flattening: + groups: + - parameters: + - name + required_fields: + - name + retry_codes_name: idempotent + retry_params_name: default + field_name_patterns: + name: entry + timeout_millis: 60000 - name: GetEntry flattening: groups: @@ -454,6 +525,7 @@ interfaces: groups: - parameters: - resource + - options required_fields: - resource retry_codes_name: non_idempotent diff --git a/google/cloud/datacatalog/v1beta1/gcs_fileset_spec.proto b/google/cloud/datacatalog/v1beta1/gcs_fileset_spec.proto new file mode 100644 index 00000000..50144663 --- /dev/null +++ b/google/cloud/datacatalog/v1beta1/gcs_fileset_spec.proto @@ -0,0 +1,57 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.datacatalog.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/cloud/datacatalog/v1beta1/timestamps.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog"; +option java_multiple_files = true; +option java_package = "com.google.cloud.datacatalog"; + +// Describes a Cloud Storage fileset entry. +message GcsFilesetSpec { + // Required. Patterns to identify a set of files in Google Cloud Storage. + // + // Examples of valid file_patterns: + // + // * `gs://bucket_name/*`: matches all files in `bucket_name` + // * `gs://bucket_name/file*`: matches files prefixed by `file` in + // `bucket_name` + // * `gs://bucket_name/a/*/b`: matches all files in `bucket_name` that match + // `a/*/b` pattern, such as `a/c/b`, `a/d/b` + // * `gs://another_bucket/a.txt`: matches `gs://another_bucket/a.txt` + repeated string file_patterns = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Sample files contained in this fileset, not all files contained in this + // fileset are represented here. + repeated GcsFileSpec sample_gcs_file_specs = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Specifications of a single file in GCS. +message GcsFileSpec { + // Required. The full file path. Example: `gs://bucket_name/a/b.txt`. + string file_path = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Timestamps about the GCS file. + SystemTimestamps gcs_timestamps = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The size of the file, in bytes. + int64 size_bytes = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/google/cloud/datacatalog/v1beta1/schema.proto b/google/cloud/datacatalog/v1beta1/schema.proto index 839ef1d8..7530f626 100644 --- a/google/cloud/datacatalog/v1beta1/schema.proto +++ b/google/cloud/datacatalog/v1beta1/schema.proto @@ -17,6 +17,8 @@ syntax = "proto3"; package google.cloud.datacatalog.v1beta1; +import "google/api/field_behavior.proto"; + option cc_enable_arenas = true; option go_package = "google.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog"; option java_multiple_files = true; @@ -26,24 +28,24 @@ option java_package = "com.google.cloud.datacatalog"; message Schema { // Required. Schema of columns. A maximum of 10,000 columns and sub-columns // can be specified. - repeated ColumnSchema columns = 2; + repeated ColumnSchema columns = 2 [(google.api.field_behavior) = REQUIRED]; } // Representation of a column within a schema. Columns could be nested inside // other columns. message ColumnSchema { // Required. Name of the column. - string column = 6; + string column = 6 [(google.api.field_behavior) = REQUIRED]; // Required. Type of the column. - string type = 1; + string type = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. Description of the column. Default value is an empty string. string description = 2; // Optional. A column's mode indicates whether the values in this column are - // required, nullable, etc. Only 'NULLABLE', 'REQUIRED' and 'REPEATED' are - // supported. Default mode is 'NULLABLE'. + // required, nullable, etc. Only `NULLABLE`, `REQUIRED` and `REPEATED` are + // supported. Default mode is `NULLABLE`. string mode = 3; // Optional. Schema of sub-columns. A column can have zero or more diff --git a/google/cloud/datacatalog/v1beta1/search.proto b/google/cloud/datacatalog/v1beta1/search.proto index 2a31dd94..30dd6fba 100644 --- a/google/cloud/datacatalog/v1beta1/search.proto +++ b/google/cloud/datacatalog/v1beta1/search.proto @@ -17,7 +17,6 @@ syntax = "proto3"; package google.cloud.datacatalog.v1beta1; -import "google/api/annotations.proto"; import "google/protobuf/timestamp.proto"; option cc_enable_arenas = true; @@ -34,20 +33,22 @@ message SearchCatalogResult { // Sub-type of the search result. This is a dot-delimited description of the // resource's full type, and is the same as the value callers would provide in - // the "type" search facet. Examples: "entry.table", "entry.dataStream", - // "tagTemplate" + // the "type" search facet. Examples: `entry.table`, `entry.dataStream`, + // `tagTemplate`. string search_result_subtype = 2; // The relative resource name of the resource in URL format. // Examples: - // "projects/{project_id}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}". - // "projects/{project_id}/tagTemplates/{tag_template_id}". + // + // * `projects/{project_id}/locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id}` + // * `projects/{project_id}/tagTemplates/{tag_template_id}` string relative_resource_name = 3; // The full name of the cloud resource the entry belongs to. See: - // https://cloud.google.com/apis/design/resource_names#full_resource_name + // https://cloud.google.com/apis/design/resource_names#full_resource_name. // Example: - // "//bigquery.googleapis.com/projects/projectId/datasets/datasetId/tables/tableId". + // + // * `//bigquery.googleapis.com/projects/projectId/datasets/datasetId/tables/tableId` string linked_resource = 4; } diff --git a/google/cloud/datacatalog/v1beta1/table_spec.proto b/google/cloud/datacatalog/v1beta1/table_spec.proto index 8e9547fe..fec33ee3 100644 --- a/google/cloud/datacatalog/v1beta1/table_spec.proto +++ b/google/cloud/datacatalog/v1beta1/table_spec.proto @@ -17,6 +17,9 @@ syntax = "proto3"; package google.cloud.datacatalog.v1beta1; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + option cc_enable_arenas = true; option go_package = "google.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog"; option java_multiple_files = true; @@ -25,16 +28,16 @@ option java_package = "com.google.cloud.datacatalog"; // Describes a BigQuery table. message BigQueryTableSpec { // Output only. The table source type. - TableSourceType table_source_type = 1; + TableSourceType table_source_type = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. oneof type_spec { // Table view specification. This field should only be populated if - // table_source_type is BIGQUERY_VIEW. + // `table_source_type` is `BIGQUERY_VIEW`. ViewSpec view_spec = 2; // Spec of a BigQuery table. This field should only be populated if - // table_source_type is BIGQUERY_TABLE. + // `table_source_type` is `BIGQUERY_TABLE`. TableSpec table_spec = 3; } } @@ -53,34 +56,42 @@ enum TableSourceType { // Table view specification. message ViewSpec { - // Output only. The query that defines the table view. - string view_query = 1; + // Required. Output only. The query that defines the table view. + string view_query = 1 [(google.api.field_behavior) = REQUIRED]; } // Normal BigQuery table spec. message TableSpec { - // Output only. If the table is a dated shard, i.e. with name pattern - // [prefix]YYYYMMDD, grouped_entry is the Data Catalog resource name of the - // date sharded grouped entry, e.g. - // projects/{project_id}/locations/{location}/entrygroups/{entry_group_id} - // /entries/{entry_id}. - // Otherwise, grouped_entry will be empty. - string grouped_entry = 1; + // Output only. If the table is a dated shard, i.e., with name pattern + // `[prefix]YYYYMMDD`, `grouped_entry` is the Data Catalog resource name of + // the date sharded grouped entry, for example, + // `projects/{project_id}/locations/{location}/entrygroups/{entry_group_id}/entries/{entry_id}`. + // Otherwise, `grouped_entry` is empty. + string grouped_entry = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "datacatalog.googleapis.com/Entry" + } + ]; } -// Spec for a group of BigQuery tables with name pattern [prefix]YYYYMMDD. +// Spec for a group of BigQuery tables with name pattern `[prefix]YYYYMMDD`. // Context: // https://cloud.google.com/bigquery/docs/partitioned-tables#partitioning_versus_sharding message BigQueryDateShardedSpec { // Output only. The Data Catalog resource name of the dataset entry the - // current table belongs to, e.g. - // projects/{project_id}/locations/{location}/entrygroups/{entry_group_id} - // /entries/{entry_id} - string dataset = 1; + // current table belongs to, for example, + // `projects/{project_id}/locations/{location}/entrygroups/{entry_group_id}/entries/{entry_id}`. + string dataset = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "datacatalog.googleapis.com/Entry" + } + ]; // Output only. The table name prefix of the shards. The name of any given - // shard is [table_prefix]YYYYMMDD, e.g. for shard MyTable20180101, the - // table_prefix is "MyTable" + // shard is `[table_prefix]YYYYMMDD`, for example, for shard + // `MyTable20180101`, the `table_prefix` is `MyTable`. string table_prefix = 2; // Output only. Total number of shards. diff --git a/google/cloud/datacatalog/v1beta1/tags.proto b/google/cloud/datacatalog/v1beta1/tags.proto index f01843c2..ea1e9f6b 100644 --- a/google/cloud/datacatalog/v1beta1/tags.proto +++ b/google/cloud/datacatalog/v1beta1/tags.proto @@ -17,6 +17,8 @@ syntax = "proto3"; package google.cloud.datacatalog.v1beta1; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; import "google/protobuf/timestamp.proto"; option cc_enable_arenas = true; @@ -27,22 +29,31 @@ option java_package = "com.google.cloud.datacatalog"; // Tags are used to attach custom metadata to Data Catalog resources. Tags // conform to the specifications within their tag template. message Tag { + option (google.api.resource) = { + type: "datacatalog.googleapis.com/Tag" + pattern: "projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}/tags/{tag}" + }; + // Required when used in // [UpdateTagRequest][google.cloud.datacatalog.v1beta1.UpdateTagRequest]. The - // resource name of the tag in URL format. For example, - // projects/{project_id}/locations/{location}/entrygroups/{entry_group_id}/entries/{entry_id}/tags/{tag_id}", - // where tag_id is a system-generated identifier. Note that this Tag may not - // actually be stored in the location in this name. + // resource name of the tag in URL format. Example: + // + // * projects/{project_id}/locations/{location}/entrygroups/{entry_group_id}/entries/{entry_id}/tags/{tag_id} + // + // where `tag_id` is a system-generated identifier. + // Note that this Tag may not actually be stored in the location in this name. string name = 1; - // Required. The resource name of the tag template that this tag uses. For - // example, - // projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}. + // Required. The resource name of the tag template that this tag uses. + // Example: + // + // * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id} + // // This field cannot be modified after creation. - string template = 2; + string template = 2 [(google.api.field_behavior) = REQUIRED]; // Output only. The display name of the tag template. - string template_display_name = 5; + string template_display_name = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; // Optional. The scope within the parent resource that this tag is attached // to. If not provided, the tag is attached to the parent resource itself. @@ -52,15 +63,17 @@ message Tag { // Resources like Entry can have schemas associated with them. This scope // allows users to attach tags to an individual column based on that schema. // - // For attaching a tag to a nested column, use '.' to separate the column - // names: "outer_column.inner_column". + // For attaching a tag to a nested column, use `.` to separate the column + // names. Example: + // + // * `outer_column.inner_column` string column = 4; } - // Required. This maps the id of a tag field to the value of & additional + // Required. This maps the ID of a tag field to the value of and additional // information about that field. Valid field IDs are defined by the tag's // template. A tag must have at least 1 field and at most 500 fields. - map fields = 3; + map fields = 3 [(google.api.field_behavior) = REQUIRED]; } // Contains the value and supporting information for a field within @@ -73,7 +86,7 @@ message TagField { } // Output only. The display name of this field. - string display_name = 1; + string display_name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // Required. The value of this field. oneof kind { @@ -95,41 +108,60 @@ message TagField { } } -// Tag templates defines the schema of the tags used to attach to Data Catalog +// A tag template defines the schema of the tags used to attach to Data Catalog // resources. It defines the mapping of accepted field names and types that can // be used within the tag. The tag template also controls the access to the tag. message TagTemplate { + option (google.api.resource) = { + type: "datacatalog.googleapis.com/TagTemplate" + pattern: "projects/{project}/locations/{location}/tagTemplates/{tag_template}" + }; + // Required when used in // [UpdateTagTemplateRequest][google.cloud.datacatalog.v1beta1.UpdateTagTemplateRequest]. - // The resource name of the tag template in URL format. For example, - // projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id}. + // The resource name of the tag template in URL format. Example: + // + // * projects/{project_id}/locations/{location}/tagTemplates/{tag_template_id} + // // Note that this TagTemplate and its child resources may not actually be // stored in the location in this name. string name = 1; - // Optional. The display name for this template. Default value is an empty - // string. + // Optional. The display name for this template. Defaults to an empty string. string display_name = 2; - // Required. Map of tag template field ids to the settings for the field. + // Required. Map of tag template field IDs to the settings for the field. // This map is an exhaustive list of the allowed fields. This map must contain // at least one field and at most 500 fields. // // The keys to this map are tag template field IDs. Field IDs can contain // letters (both uppercase and lowercase), numbers (0-9) and underscores (_). - // Field IDs must be at least 1 character long and at most 64 characters long. - // Field IDs must start with a letter or underscore. - map fields = 3; + // Field IDs must be at least 1 character long and at most + // 64 characters long. Field IDs must start with a letter or underscore. + map fields = 3 [(google.api.field_behavior) = REQUIRED]; } // The template for an individual field within a tag template. message TagTemplateField { - // Optional. The display name for this field. Default value is an empty - // string. + option (google.api.resource) = { + type: "datacatalog.googleapis.com/TagTemplateField" + pattern: "projects/{project}/locations/{location}/tagTemplates/{tag_template}/fields/{field}" + }; + + // Output only. The resource name of the tag template field in URL format. + // Example: + // + // * projects/{project_id}/locations/{location}/tagTemplates/{tag_template}/fields/{field} + // + // Note that this TagTemplateField may not actually be stored in the location + // in this name. + string name = 6; + + // Optional. The display name for this field. Defaults to an empty string. string display_name = 1; // Required. The type of value this tag field can contain. - FieldType type = 2; + FieldType type = 2 [(google.api.field_behavior) = REQUIRED]; } message FieldType { @@ -137,15 +169,15 @@ message FieldType { message EnumValue { // Required. The display name of the enum value. Must not be an empty // string. - string display_name = 1; + string display_name = 1 [(google.api.field_behavior) = REQUIRED]; } - // Required. The set of allowed values for this enum. This set must not be - // empty, the display names of the values in this set must not be empty and - // the display names of the values must be case-insensitively unique within - // this set. Currently, enum values can only be added to the list of allowed - // values. Deletion and renaming of enum values are not supported. Can have - // up to 500 allowed values. + // Required on create; optional on update. The set of allowed values for + // this enum. This set must not be empty, the display names of the values in + // this set must not be empty and the display names of the values must be + // case-insensitively unique within this set. Currently, enum values can + // only be added to the list of allowed values. Deletion and renaming of + // enum values are not supported. Can have up to 500 allowed values. repeated EnumValue allowed_values = 1; } diff --git a/google/cloud/datacatalog/v1beta1/timestamps.proto b/google/cloud/datacatalog/v1beta1/timestamps.proto index bb048b91..52d5f6ac 100644 --- a/google/cloud/datacatalog/v1beta1/timestamps.proto +++ b/google/cloud/datacatalog/v1beta1/timestamps.proto @@ -17,6 +17,7 @@ syntax = "proto3"; package google.cloud.datacatalog.v1beta1; +import "google/api/field_behavior.proto"; import "google/protobuf/timestamp.proto"; option cc_enable_arenas = true; @@ -26,13 +27,13 @@ option java_package = "com.google.cloud.datacatalog"; // Timestamps about this resource according to a particular system. message SystemTimestamps { - // Output only. The creation time of the resource within the given system. + // The creation time of the resource within the given system. google.protobuf.Timestamp create_time = 1; - // Output only. The last-modified time of the resource within the given - // system. + // The last-modified time of the resource within the given system. google.protobuf.Timestamp update_time = 2; // Output only. The expiration time of the resource within the given system. - google.protobuf.Timestamp expire_time = 3; + // Currently only apllicable to BigQuery resources. + google.protobuf.Timestamp expire_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; }