From f5f268f5293e60143ac742a4eeb7dd6306ebf505 Mon Sep 17 00:00:00 2001 From: Google APIs Date: Tue, 26 May 2020 15:11:32 -0700 Subject: [PATCH] Add DetachSubscription RPC PiperOrigin-RevId: 313276022 --- google/pubsub/v1/pubsub.proto | 29 +++++++++++++++++-- .../pubsub/v1/pubsub_grpc_service_config.json | 4 +++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/google/pubsub/v1/pubsub.proto b/google/pubsub/v1/pubsub.proto index a42d0322..0311cc5b 100644 --- a/google/pubsub/v1/pubsub.proto +++ b/google/pubsub/v1/pubsub.proto @@ -88,7 +88,7 @@ service Publisher { option (google.api.method_signature) = "project"; } - // Lists the names of the subscriptions on this topic. + // Lists the names of the attached subscriptions on this topic. rpc ListTopicSubscriptions(ListTopicSubscriptionsRequest) returns (ListTopicSubscriptionsResponse) { option (google.api.http) = { @@ -122,6 +122,17 @@ service Publisher { }; option (google.api.method_signature) = "topic"; } + + // Detaches a subscription from this topic. All messages retained in the + // subscription are dropped. Subsequent `Pull` and `StreamingPull` requests + // will return FAILED_PRECONDITION. If the subscription is a push + // subscription, pushes to the endpoint will stop. + rpc DetachSubscription(DetachSubscriptionRequest) + returns (DetachSubscriptionResponse) { + option (google.api.http) = { + post: "/v1/{subscription=projects/*/subscriptions/*}:detach" + }; + } } message MessageStoragePolicy { @@ -300,7 +311,7 @@ message ListTopicSubscriptionsRequest { // Response for the `ListTopicSubscriptions` method. message ListTopicSubscriptionsResponse { - // The names of the subscriptions that match the request. + // The names of subscriptions attached to the topic specified in the request. repeated string subscriptions = 1 [(google.api.resource_reference) = { type: "pubsub.googleapis.com/Subscription" }]; @@ -350,6 +361,20 @@ message DeleteTopicRequest { ]; } +// Request for the DetachSubscription method. +message DetachSubscriptionRequest { + // Required. The subscription to detach. + // Format is `projects/{project}/subscriptions/{subscription}`. + string subscription = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } + ]; +} + +// Response for the DetachSubscription method. +// Reserved for future use. +message DetachSubscriptionResponse {} + // The service that an application uses to manipulate subscriptions and to // consume messages from a subscription via the `Pull` method or by // establishing a bi-directional stream using the `StreamingPull` method. diff --git a/google/pubsub/v1/pubsub_grpc_service_config.json b/google/pubsub/v1/pubsub_grpc_service_config.json index 15abf6f9..aba23982 100755 --- a/google/pubsub/v1/pubsub_grpc_service_config.json +++ b/google/pubsub/v1/pubsub_grpc_service_config.json @@ -14,6 +14,10 @@ "service": "google.pubsub.v1.Publisher", "method": "DeleteTopic" }, + { + "service": "google.pubsub.v1.Publisher", + "method": "DetachSubscription" + }, { "service": "google.pubsub.v1.Publisher", "method": "SetIamPolicy"