Add DetachSubscription RPC

PiperOrigin-RevId: 313276022
This commit is contained in:
Google APIs 2020-05-26 15:11:32 -07:00 committed by Copybara-Service
parent af7903d2fb
commit f5f268f529
2 changed files with 31 additions and 2 deletions

View File

@ -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.

View File

@ -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"