eventarc.proto 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. // Copyright 2021 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.cloud.eventarc.v1;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/resource.proto";
  20. import "google/cloud/eventarc/v1/trigger.proto";
  21. import "google/longrunning/operations.proto";
  22. import "google/protobuf/field_mask.proto";
  23. import "google/protobuf/timestamp.proto";
  24. option go_package = "google.golang.org/genproto/googleapis/cloud/eventarc/v1;eventarc";
  25. option java_multiple_files = true;
  26. option java_outer_classname = "EventarcProto";
  27. option java_package = "com.google.cloud.eventarc.v1";
  28. option csharp_namespace = "Google.Cloud.Eventarc.V1";
  29. option php_namespace = "Google\\Cloud\\Eventarc\\V1";
  30. option ruby_package = "Google::Cloud::Eventarc::V1";
  31. // Eventarc allows users to subscribe to various events that are provided by
  32. // Google Cloud services and forward them to supported destinations.
  33. service Eventarc {
  34. option (google.api.default_host) = "eventarc.googleapis.com";
  35. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  36. // Get a single trigger.
  37. rpc GetTrigger(GetTriggerRequest) returns (Trigger) {
  38. option (google.api.http) = {
  39. get: "/v1/{name=projects/*/locations/*/triggers/*}"
  40. };
  41. option (google.api.method_signature) = "name";
  42. }
  43. // List triggers.
  44. rpc ListTriggers(ListTriggersRequest) returns (ListTriggersResponse) {
  45. option (google.api.http) = {
  46. get: "/v1/{parent=projects/*/locations/*}/triggers"
  47. };
  48. option (google.api.method_signature) = "parent";
  49. }
  50. // Create a new trigger in a particular project and location.
  51. rpc CreateTrigger(CreateTriggerRequest) returns (google.longrunning.Operation) {
  52. option (google.api.http) = {
  53. post: "/v1/{parent=projects/*/locations/*}/triggers"
  54. body: "trigger"
  55. };
  56. option (google.api.method_signature) = "parent,trigger,trigger_id";
  57. option (google.longrunning.operation_info) = {
  58. response_type: "Trigger"
  59. metadata_type: "OperationMetadata"
  60. };
  61. }
  62. // Update a single trigger.
  63. rpc UpdateTrigger(UpdateTriggerRequest) returns (google.longrunning.Operation) {
  64. option (google.api.http) = {
  65. patch: "/v1/{trigger.name=projects/*/locations/*/triggers/*}"
  66. body: "trigger"
  67. };
  68. option (google.api.method_signature) = "trigger,update_mask,allow_missing";
  69. option (google.longrunning.operation_info) = {
  70. response_type: "Trigger"
  71. metadata_type: "OperationMetadata"
  72. };
  73. }
  74. // Delete a single trigger.
  75. rpc DeleteTrigger(DeleteTriggerRequest) returns (google.longrunning.Operation) {
  76. option (google.api.http) = {
  77. delete: "/v1/{name=projects/*/locations/*/triggers/*}"
  78. };
  79. option (google.api.method_signature) = "name,allow_missing";
  80. option (google.longrunning.operation_info) = {
  81. response_type: "Trigger"
  82. metadata_type: "OperationMetadata"
  83. };
  84. }
  85. }
  86. // The request message for the GetTrigger method.
  87. message GetTriggerRequest {
  88. // Required. The name of the trigger to get.
  89. string name = 1 [
  90. (google.api.field_behavior) = REQUIRED,
  91. (google.api.resource_reference) = {
  92. type: "eventarc.googleapis.com/Trigger"
  93. }
  94. ];
  95. }
  96. // The request message for the ListTriggers method.
  97. message ListTriggersRequest {
  98. // Required. The parent collection to list triggers on.
  99. string parent = 1 [
  100. (google.api.field_behavior) = REQUIRED,
  101. (google.api.resource_reference) = {
  102. child_type: "eventarc.googleapis.com/Trigger"
  103. }
  104. ];
  105. // The maximum number of triggers to return on each page.
  106. // Note: The service may send fewer.
  107. int32 page_size = 2;
  108. // The page token; provide the value from the `next_page_token` field in a
  109. // previous `ListTriggers` call to retrieve the subsequent page.
  110. //
  111. // When paginating, all other parameters provided to `ListTriggers` must match
  112. // the call that provided the page token.
  113. string page_token = 3;
  114. // The sorting order of the resources returned. Value should be a comma
  115. // separated list of fields. The default sorting oder is ascending. To specify
  116. // descending order for a field, append a ` desc` suffix; for example:
  117. // `name desc, trigger_id`.
  118. string order_by = 4;
  119. }
  120. // The response message for the ListTriggers method.
  121. message ListTriggersResponse {
  122. // The requested triggers, up to the number specified in `page_size`.
  123. repeated Trigger triggers = 1;
  124. // A page token that can be sent to ListTriggers to request the next page.
  125. // If this is empty, then there are no more pages.
  126. string next_page_token = 2;
  127. // Unreachable resources, if any.
  128. repeated string unreachable = 3;
  129. }
  130. // The request message for the CreateTrigger method.
  131. message CreateTriggerRequest {
  132. // Required. The parent collection in which to add this trigger.
  133. string parent = 1 [
  134. (google.api.field_behavior) = REQUIRED,
  135. (google.api.resource_reference) = {
  136. child_type: "eventarc.googleapis.com/Trigger"
  137. }
  138. ];
  139. // Required. The trigger to create.
  140. Trigger trigger = 2 [(google.api.field_behavior) = REQUIRED];
  141. // Required. The user-provided ID to be assigned to the trigger.
  142. string trigger_id = 3 [(google.api.field_behavior) = REQUIRED];
  143. // Required. If set, validate the request and preview the review, but do not actually
  144. // post it.
  145. bool validate_only = 4 [(google.api.field_behavior) = REQUIRED];
  146. }
  147. // The request message for the UpdateTrigger method.
  148. message UpdateTriggerRequest {
  149. // The trigger to be updated.
  150. Trigger trigger = 1;
  151. // The fields to be updated; only fields explicitly provided will be updated.
  152. // If no field mask is provided, all provided fields in the request will be
  153. // updated. To update all fields, provide a field mask of "*".
  154. google.protobuf.FieldMask update_mask = 2;
  155. // If set to true, and the trigger is not found, a new trigger will be
  156. // created. In this situation, `update_mask` is ignored.
  157. bool allow_missing = 3;
  158. // Required. If set, validate the request and preview the review, but do not actually
  159. // post it.
  160. bool validate_only = 4 [(google.api.field_behavior) = REQUIRED];
  161. }
  162. // The request message for the DeleteTrigger method.
  163. message DeleteTriggerRequest {
  164. // Required. The name of the trigger to be deleted.
  165. string name = 1 [
  166. (google.api.field_behavior) = REQUIRED,
  167. (google.api.resource_reference) = {
  168. type: "eventarc.googleapis.com/Trigger"
  169. }
  170. ];
  171. // If provided, the trigger will only be deleted if the etag matches the
  172. // current etag on the resource.
  173. string etag = 2;
  174. // If set to true, and the trigger is not found, the request will succeed
  175. // but no action will be taken on the server.
  176. bool allow_missing = 3;
  177. // Required. If set, validate the request and preview the review, but do not actually
  178. // post it.
  179. bool validate_only = 4 [(google.api.field_behavior) = REQUIRED];
  180. }
  181. // Represents the metadata of the long-running operation.
  182. message OperationMetadata {
  183. // Output only. The time the operation was created.
  184. google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  185. // Output only. The time the operation finished running.
  186. google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  187. // Output only. Server-defined resource path for the target of the operation.
  188. string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  189. // Output only. Name of the verb executed by the operation.
  190. string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  191. // Output only. Human-readable status of the operation, if any.
  192. string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  193. // Output only. Identifies whether the user has requested cancellation
  194. // of the operation. Operations that have successfully been cancelled
  195. // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
  196. // corresponding to `Code.CANCELLED`.
  197. bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  198. // Output only. API version used to start the operation.
  199. string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  200. }