diff --git a/google/cloud/eventarc/v1/BUILD.bazel b/google/cloud/eventarc/v1/BUILD.bazel index c863fd0092254..5c9435d6e1d5a 100644 --- a/google/cloud/eventarc/v1/BUILD.bazel +++ b/google/cloud/eventarc/v1/BUILD.bazel @@ -23,6 +23,7 @@ proto_library( srcs = [ "channel.proto", "channel_connection.proto", + "discovery.proto", "eventarc.proto", "trigger.proto", ], @@ -32,6 +33,7 @@ proto_library( "//google/api:field_behavior_proto", "//google/api:resource_proto", "//google/longrunning:operations_proto", + "//google/rpc:code_proto", "@com_google_protobuf//:field_mask_proto", "@com_google_protobuf//:timestamp_proto", ], @@ -121,6 +123,7 @@ go_proto_library( deps = [ "//google/api:annotations_go_proto", "//google/longrunning:longrunning_go_proto", + "//google/rpc:code_go_proto", ], ) @@ -170,6 +173,7 @@ py_gapic_library( name = "eventarc_py_gapic", srcs = [":eventarc_proto"], grpc_service_config = "eventarc_grpc_service_config.json", + service_yaml = "eventarc_v1.yaml", ) # Open Source Packages diff --git a/google/cloud/eventarc/v1/discovery.proto b/google/cloud/eventarc/v1/discovery.proto new file mode 100644 index 0000000000000..44633de81a3f9 --- /dev/null +++ b/google/cloud/eventarc/v1/discovery.proto @@ -0,0 +1,86 @@ +// Copyright 2022 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.eventarc.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/eventarc/v1;eventarc"; +option java_multiple_files = true; +option java_outer_classname = "DiscoveryProto"; +option java_package = "com.google.cloud.eventarc.v1"; + +// A representation of the Provider resource. +message Provider { + option (google.api.resource) = { + type: "eventarc.googleapis.com/Provider" + pattern: "projects/{project}/locations/{location}/providers/{provider}" + plural: "providers" + singular: "provider" + }; + + // Output only. In `projects/{project}/locations/{location}/providers/{provider_id}` + // format. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human friendly name for the Provider. For example "Cloud Storage". + string display_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Event types for this provider. + repeated EventType event_types = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A representation of the event type resource. +message EventType { + // Output only. The full name of the event type (for example, + // "google.cloud.storage.object.v1.finalized"). In the form of + // {provider-specific-prefix}.{resource}.{version}.{verb}. Types MUST be + // versioned and event schemas are guaranteed to remain backward compatible + // within one version. Note that event type versions and API versions do not + // need to match. + string type = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human friendly description of what the event type is about. + // For example "Bucket created in Cloud Storage". + string description = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Filtering attributes for the event type. + repeated FilteringAttribute filtering_attributes = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. URI for the event schema. + // For example + // "https://github.com/googleapis/google-cloudevents/blob/master/proto/google/events/cloud/storage/v1/events.proto" + string event_schema_uri = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A representation of the FilteringAttribute resource. +// Filtering attributes are per event type. +message FilteringAttribute { + // Output only. Attribute used for filtering the event type. + string attribute = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Description of the purpose of the attribute. + string description = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If true, the triggers for this provider should always specify a filter + // on these attributes. Trigger creation will fail otherwise. + bool required = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If true, the attribute accepts matching expressions in the Eventarc + // PathPattern format. + bool path_pattern_supported = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/google/cloud/eventarc/v1/eventarc.proto b/google/cloud/eventarc/v1/eventarc.proto index 41aa848329a6a..69310678a15cc 100644 --- a/google/cloud/eventarc/v1/eventarc.proto +++ b/google/cloud/eventarc/v1/eventarc.proto @@ -22,6 +22,7 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/eventarc/v1/channel.proto"; import "google/cloud/eventarc/v1/channel_connection.proto"; +import "google/cloud/eventarc/v1/discovery.proto"; import "google/cloud/eventarc/v1/trigger.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/field_mask.proto"; @@ -149,6 +150,22 @@ service Eventarc { }; } + // Get a single Provider. + rpc GetProvider(GetProviderRequest) returns (Provider) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/providers/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List providers. + rpc ListProviders(ListProvidersRequest) returns (ListProvidersResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/providers" + }; + option (google.api.method_signature) = "parent"; + } + // Get a single ChannelConnection. rpc GetChannelConnection(GetChannelConnectionRequest) returns (ChannelConnection) { option (google.api.http) = { @@ -409,6 +426,60 @@ message DeleteChannelRequest { bool validate_only = 2 [(google.api.field_behavior) = REQUIRED]; } +// The request message for the GetProvider method. +message GetProviderRequest { + // Required. The name of the provider to get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "eventarc.googleapis.com/Provider" + } + ]; +} + +// The request message for the ListProviders method. +message ListProvidersRequest { + // Required. The parent of the provider to get. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "eventarc.googleapis.com/Provider" + } + ]; + + // The maximum number of providers to return on each page. + int32 page_size = 2; + + // The page token; provide the value from the `next_page_token` field in a + // previous `ListProviders` call to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListProviders` must + // match the call that provided the page token. + string page_token = 3; + + // The sorting order of the resources returned. Value should be a + // comma-separated list of fields. The default sorting oder is ascending. To + // specify descending order for a field, append a `desc` suffix; for example: + // `name desc, _id`. + string order_by = 4; + + // The filter field that the list request will filter on. + string filter = 5; +} + +// The response message for the `ListProviders` method. +message ListProvidersResponse { + // The requested providers, up to the number specified in `page_size`. + repeated Provider providers = 1; + + // A page token that can be sent to ListProviders to request the next page. + // If this is empty, then there are no more pages. + string next_page_token = 2; + + // Unreachable resources, if any. + repeated string unreachable = 3; +} + // The request message for the GetChannelConnection method. message GetChannelConnectionRequest { // Required. The name of the channel connection to get. diff --git a/google/cloud/eventarc/v1/eventarc_grpc_service_config.json b/google/cloud/eventarc/v1/eventarc_grpc_service_config.json index 5cf2b78496ed4..42b801abcbe18 100644 --- a/google/cloud/eventarc/v1/eventarc_grpc_service_config.json +++ b/google/cloud/eventarc/v1/eventarc_grpc_service_config.json @@ -6,7 +6,9 @@ { "service": "google.cloud.eventarc.v1", "method": "ListChannels"}, { "service": "google.cloud.eventarc.v1", "method": "GetChannel"}, { "service": "google.cloud.eventarc.v1", "method": "ListChannelConnections"}, - { "service": "google.cloud.eventarc.v1", "method": "GetChannelConnection"} + { "service": "google.cloud.eventarc.v1", "method": "GetChannelConnection"}, + { "service": "google.cloud.eventarc.v1", "method": "ListProviders"}, + { "service": "google.cloud.eventarc.v1", "method": "GetProvider"} ], "timeout": "60s", "retryPolicy": {