diff --git a/google/longrunning/operations.proto b/google/longrunning/operations.proto index c22d54bd7..a358d0a38 100644 --- a/google/longrunning/operations.proto +++ b/google/longrunning/operations.proto @@ -16,6 +16,7 @@ syntax = "proto3"; package google.longrunning; +import "google/api/annotations.proto"; import "google/protobuf/any.proto"; import "google/protobuf/empty.proto"; import "google/rpc/status.proto"; @@ -39,12 +40,16 @@ service Operations { // Gets the latest state of a long-running operation. Clients may use this // method to poll the operation result at intervals as recommended by the API // service. - rpc GetOperation(GetOperationRequest) returns (Operation); + rpc GetOperation(GetOperationRequest) returns (Operation) { + option (google.api.http) = { get: "/v1/{name=operations/**}" }; + } // Lists operations that match the specified filter in the request. If the // server doesn't support this method, it returns // `google.rpc.Code.UNIMPLEMENTED`. - rpc ListOperations(ListOperationsRequest) returns (ListOperationsResponse); + rpc ListOperations(ListOperationsRequest) returns (ListOperationsResponse) { + option (google.api.http) = { get: "/v1/{name=operations}" }; + } // Starts asynchronous cancellation on a long-running operation. The server // makes a best effort to cancel the operation, but success is not @@ -52,11 +57,15 @@ service Operations { // `google.rpc.Code.UNIMPLEMENTED`. Clients may use // [Operations.GetOperation] or other methods to check whether the // cancellation succeeded or the operation completed despite cancellation. - rpc CancelOperation(CancelOperationRequest) returns (google.protobuf.Empty); + rpc CancelOperation(CancelOperationRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { post: "/v1/{name=operations/**}:cancel" body: "*" }; + } // Deletes a long-running operation. It indicates the client is no longer // interested in the operation result. It does not cancel the operation. - rpc DeleteOperation(DeleteOperationRequest) returns (google.protobuf.Empty); + rpc DeleteOperation(DeleteOperationRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { delete: "/v1/{name=operations/**}" }; + } } // This resource represents a long-running operation that is the result of a