Skip to content

Commit

Permalink
Add DetachSubscription RPC
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 313276022
  • Loading branch information
Google APIs authored and copybara-github committed May 26, 2020
1 parent af7903d commit f5f268f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
29 changes: 27 additions & 2 deletions google/pubsub/v1/pubsub.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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) = {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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"
}];
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions google/pubsub/v1/pubsub_grpc_service_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit f5f268f

Please sign in to comment.