pubsub: v1 add client config annotations and retry config

PiperOrigin-RevId: 295158776
This commit is contained in:
Google APIs 2020-02-14 09:07:50 -08:00 committed by Copybara-Service
parent 5169f46d9f
commit 6cdd74dcdb
6 changed files with 549 additions and 164 deletions

View File

@ -2,7 +2,7 @@ common:
api_name: pubsub
api_version: v1
organization_name: google-cloud
service_yaml: pubsub.yaml
service_yaml: v1/pubsub_v1.yaml
gapic_yaml: v1/pubsub_gapic.yaml
src_proto_paths:
- v1

View File

@ -1,67 +0,0 @@
type: google.api.Service
config_version: 3
name: pubsub.googleapis.com
title: Google Cloud Pub/Sub API
apis:
- name: google.pubsub.v1.Publisher
- name: google.pubsub.v1.Subscriber
documentation:
summary: |-
Provides reliable, many-to-many, asynchronous messaging between
applications.
rules:
- selector: >
google.pubsub.v1.Topic.name,
description: |
The name of the topic. It must have the format
`"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter,
and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent
signs (`%`). It must be between 3 and 255 characters in length, and it
must not start with `"goog"`.
- selector: >
google.pubsub.v1.Subscription.name,
description: |
The name of the subscription. It must have the format
`"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must
start with a letter, and contain only letters (`[A-Za-z]`), numbers
(`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
in length, and it must not start with `"goog"`
http:
rules:
- selector: google.iam.v1.IAMPolicy.SetIamPolicy
post: '/v1/{resource=projects/*/topics/*}:setIamPolicy'
body: '*'
additional_bindings:
- post: '/v1/{resource=projects/*/subscriptions/*}:setIamPolicy'
body: '*'
- post: '/v1/{resource=projects/*/snapshots/*}:setIamPolicy'
body: '*'
- selector: google.iam.v1.IAMPolicy.GetIamPolicy
get: '/v1/{resource=projects/*/topics/*}:getIamPolicy'
additional_bindings:
- get: '/v1/{resource=projects/*/subscriptions/*}:getIamPolicy'
- get: '/v1/{resource=projects/*/snapshots/*}:getIamPolicy'
- selector: google.iam.v1.IAMPolicy.TestIamPermissions
post: '/v1/{resource=projects/*/subscriptions/*}:testIamPermissions'
body: '*'
additional_bindings:
- post: '/v1/{resource=projects/*/topics/*}:testIamPermissions'
body: '*'
- post: '/v1/{resource=projects/*/snapshots/*}:testIamPermissions'
body: '*'
authentication:
rules:
- selector: '*'
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform,
https://www.googleapis.com/auth/pubsub

View File

@ -14,6 +14,8 @@ proto_library(
deps = [
"//google/api:annotations_proto",
"//google/api:client_proto",
"//google/api:field_behavior_proto",
"//google/api:resource_proto",
"@com_google_protobuf//:duration_proto",
"@com_google_protobuf//:empty_proto",
"@com_google_protobuf//:field_mask_proto",
@ -69,7 +71,7 @@ java_gapic_library(
src = ":pubsub_proto_with_info",
gapic_yaml = "pubsub_gapic.yaml",
gen_resource_name = False,
service_yaml = "//google/pubsub:pubsub.yaml",
service_yaml = ":pubsub_v1.yaml",
test_deps = [
":pubsub_java_grpc",
"//google/iam/v1:iam_java_grpc",
@ -120,6 +122,8 @@ moved_proto_library(
deps = [
"//google/api:annotations_proto",
"//google/api:client_proto",
"//google/api:field_behavior_proto",
"//google/api:resource_proto",
"@com_google_protobuf//:duration_proto",
"@com_google_protobuf//:empty_proto",
"@com_google_protobuf//:field_mask_proto",
@ -143,7 +147,7 @@ py_gapic_library(
name = "pubsub_py_gapic",
src = ":pubsub_proto_with_info",
gapic_yaml = "pubsub_gapic.yaml",
service_yaml = "//google/pubsub:pubsub.yaml",
service_yaml = ":pubsub_v1.yaml",
deps = [
":pubsub_py_proto",
":pubsub_py_grpc"
@ -183,7 +187,7 @@ go_gapic_library(
src = ":pubsub_proto_with_info",
gapic_yaml = "pubsub_gapic.yaml",
importpath = "cloud.google.com/go/pubsub/apiv1",
service_yaml = "//google/pubsub:pubsub.yaml",
service_yaml = ":pubsub_v1.yaml",
deps = [":pubsub_go_proto"],
)
@ -232,7 +236,7 @@ php_gapic_library(
name = "pubsub_php_gapic",
src = ":pubsub_proto_with_info",
gapic_yaml = "pubsub_gapic.yaml",
service_yaml = "//google/pubsub:pubsub.yaml",
service_yaml = ":pubsub_v1.yaml",
deps = [
":pubsub_php_grpc",
":pubsub_php_proto",
@ -262,7 +266,7 @@ nodejs_gapic_library(
name = "pubsub_nodejs_gapic",
src = ":pubsub_proto_with_info",
gapic_yaml = "pubsub_gapic.yaml",
service_yaml = "//google/pubsub:pubsub.yaml",
service_yaml = ":pubsub_v1.yaml",
deps = [],
)
@ -300,7 +304,7 @@ ruby_gapic_library(
name = "pubsub_ruby_gapic",
src = ":pubsub_proto_with_info",
gapic_yaml = "pubsub_gapic.yaml",
service_yaml = "//google/pubsub:pubsub.yaml",
service_yaml = ":pubsub_v1.yaml",
deps = [
":pubsub_ruby_grpc",
":pubsub_ruby_proto",
@ -343,7 +347,7 @@ csharp_gapic_library(
name = "pubsub_csharp_gapic",
src = ":pubsub_proto_with_info",
gapic_yaml = "pubsub_gapic.yaml",
service_yaml = "//google/pubsub:pubsub.yaml",
service_yaml = ":pubsub_v1.yaml",
deps = [
":pubsub_csharp_grpc",
":pubsub_csharp_proto",

View File

@ -17,12 +17,14 @@ syntax = "proto3";
package google.pubsub.v1;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";
option cc_enable_arenas = true;
option csharp_namespace = "Google.Cloud.PubSub.V1";
@ -49,6 +51,7 @@ service Publisher {
put: "/v1/{name=projects/*/topics/*}"
body: "*"
};
option (google.api.method_signature) = "name";
}
// Updates an existing topic. Note that certain properties of a
@ -67,6 +70,7 @@ service Publisher {
post: "/v1/{topic=projects/*/topics/*}:publish"
body: "*"
};
option (google.api.method_signature) = "topic,messages";
}
// Gets the configuration of a topic.
@ -74,6 +78,7 @@ service Publisher {
option (google.api.http) = {
get: "/v1/{topic=projects/*/topics/*}"
};
option (google.api.method_signature) = "topic";
}
// Lists matching topics.
@ -81,14 +86,15 @@ service Publisher {
option (google.api.http) = {
get: "/v1/{project=projects/*}/topics"
};
option (google.api.method_signature) = "project";
}
// Lists the names of the subscriptions on this topic.
rpc ListTopicSubscriptions(ListTopicSubscriptionsRequest)
returns (ListTopicSubscriptionsResponse) {
rpc ListTopicSubscriptions(ListTopicSubscriptionsRequest) returns (ListTopicSubscriptionsResponse) {
option (google.api.http) = {
get: "/v1/{topic=projects/*/topics/*}/subscriptions"
};
option (google.api.method_signature) = "topic";
}
// Lists the names of the snapshots on this topic. Snapshots are used in
@ -97,8 +103,7 @@ service Publisher {
// you to manage message acknowledgments in bulk. That is, you can set the
// acknowledgment state of messages in an existing subscription to the state
// captured by a snapshot.
rpc ListTopicSnapshots(ListTopicSnapshotsRequest)
returns (ListTopicSnapshotsResponse) {
rpc ListTopicSnapshots(ListTopicSnapshotsRequest) returns (ListTopicSnapshotsResponse) {
option (google.api.http) = {
get: "/v1/{topic=projects/*/topics/*}/snapshots"
};
@ -113,6 +118,7 @@ service Publisher {
option (google.api.http) = {
delete: "/v1/{topic=projects/*/topics/*}"
};
option (google.api.method_signature) = "topic";
}
}
@ -127,13 +133,19 @@ message MessageStoragePolicy {
// A topic resource.
message Topic {
// The name of the topic. It must have the format
option (google.api.resource) = {
type: "pubsub.googleapis.com/Topic"
pattern: "projects/{project}/topics/{topic}"
pattern: "_deleted-topic_"
};
// Required. The name of the topic. It must have the format
// `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter,
// and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
// underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent
// signs (`%`). It must be between 3 and 255 characters in length, and it
// must not start with `"goog"`.
string name = 1;
string name = 1 [(google.api.field_behavior) = REQUIRED];
// See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and
// managing labels</a>.
@ -193,32 +205,42 @@ message PubsubMessage {
// Request for the GetTopic method.
message GetTopicRequest {
// The name of the topic to get.
// Required. The name of the topic to get.
// Format is `projects/{project}/topics/{topic}`.
string topic = 1;
string topic = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "pubsub.googleapis.com/Topic"
}
];
}
// Request for the UpdateTopic method.
message UpdateTopicRequest {
// The updated topic object.
Topic topic = 1;
// Required. The updated topic object.
Topic topic = 1 [(google.api.field_behavior) = REQUIRED];
// Indicates which fields in the provided topic to update. Must be specified
// Required. Indicates which fields in the provided topic to update. Must be specified
// and non-empty. Note that if `update_mask` contains
// "message_storage_policy" then the new value will be determined based on the
// policy configured at the project or organization level. The
// `message_storage_policy` must not be set in the `topic` provided above.
google.protobuf.FieldMask update_mask = 2;
google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
}
// Request for the Publish method.
message PublishRequest {
// The messages in the request will be published on this topic.
// Required. The messages in the request will be published on this topic.
// Format is `projects/{project}/topics/{topic}`.
string topic = 1;
string topic = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "pubsub.googleapis.com/Topic"
}
];
// The messages to publish.
repeated PubsubMessage messages = 2;
// Required. The messages to publish.
repeated PubsubMessage messages = 2 [(google.api.field_behavior) = REQUIRED];
}
// Response for the `Publish` method.
@ -231,9 +253,14 @@ message PublishResponse {
// Request for the `ListTopics` method.
message ListTopicsRequest {
// The name of the project in which to list topics.
// Required. The name of the project in which to list topics.
// Format is `projects/{project-id}`.
string project = 1;
string project = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "cloudresourcemanager.googleapis.com/Project"
}
];
// Maximum number of topics to return.
int32 page_size = 2;
@ -256,9 +283,14 @@ message ListTopicsResponse {
// Request for the `ListTopicSubscriptions` method.
message ListTopicSubscriptionsRequest {
// The name of the topic that subscriptions are attached to.
// Required. The name of the topic that subscriptions are attached to.
// Format is `projects/{project}/topics/{topic}`.
string topic = 1;
string topic = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "pubsub.googleapis.com/Topic"
}
];
// Maximum number of subscription names to return.
int32 page_size = 2;
@ -272,7 +304,9 @@ message ListTopicSubscriptionsRequest {
// Response for the `ListTopicSubscriptions` method.
message ListTopicSubscriptionsResponse {
// The names of the subscriptions that match the request.
repeated string subscriptions = 1;
repeated string subscriptions = 1 [(google.api.resource_reference) = {
type: "pubsub.googleapis.com/Subscription"
}];
// If not empty, indicates that there may be more subscriptions that match
// the request; this value should be passed in a new
@ -308,9 +342,14 @@ message ListTopicSnapshotsResponse {
// Request for the `DeleteTopic` method.
message DeleteTopicRequest {
// Name of the topic to delete.
// Required. Name of the topic to delete.
// Format is `projects/{project}/topics/{topic}`.
string topic = 1;
string topic = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "pubsub.googleapis.com/Topic"
}
];
}
// The service that an application uses to manipulate subscriptions and to
@ -340,6 +379,7 @@ service Subscriber {
put: "/v1/{name=projects/*/subscriptions/*}"
body: "*"
};
option (google.api.method_signature) = "name,topic,push_config,ack_deadline_seconds";
}
// Gets the configuration details of a subscription.
@ -347,6 +387,7 @@ service Subscriber {
option (google.api.http) = {
get: "/v1/{subscription=projects/*/subscriptions/*}"
};
option (google.api.method_signature) = "subscription";
}
// Updates an existing subscription. Note that certain properties of a
@ -359,11 +400,11 @@ service Subscriber {
}
// Lists matching subscriptions.
rpc ListSubscriptions(ListSubscriptionsRequest)
returns (ListSubscriptionsResponse) {
rpc ListSubscriptions(ListSubscriptionsRequest) returns (ListSubscriptionsResponse) {
option (google.api.http) = {
get: "/v1/{project=projects/*}/subscriptions"
};
option (google.api.method_signature) = "project";
}
// Deletes an existing subscription. All messages retained in the subscription
@ -371,11 +412,11 @@ service Subscriber {
// `NOT_FOUND`. After a subscription is deleted, a new one may be created with
// the same name, but the new one has no association with the old
// subscription or its topic unless the same topic is specified.
rpc DeleteSubscription(DeleteSubscriptionRequest)
returns (google.protobuf.Empty) {
rpc DeleteSubscription(DeleteSubscriptionRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1/{subscription=projects/*/subscriptions/*}"
};
option (google.api.method_signature) = "subscription";
}
// Modifies the ack deadline for a specific message. This method is useful
@ -383,12 +424,12 @@ service Subscriber {
// subscriber, or to make the message available for redelivery if the
// processing was interrupted. Note that this does not modify the
// subscription-level `ackDeadlineSeconds` used for subsequent messages.
rpc ModifyAckDeadline(ModifyAckDeadlineRequest)
returns (google.protobuf.Empty) {
rpc ModifyAckDeadline(ModifyAckDeadlineRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/v1/{subscription=projects/*/subscriptions/*}:modifyAckDeadline"
body: "*"
};
option (google.api.method_signature) = "subscription,ack_ids,ack_deadline_seconds";
}
// Acknowledges the messages associated with the `ack_ids` in the
@ -403,6 +444,7 @@ service Subscriber {
post: "/v1/{subscription=projects/*/subscriptions/*}:acknowledge"
body: "*"
};
option (google.api.method_signature) = "subscription,ack_ids";
}
// Pulls messages from the server. The server may return `UNAVAILABLE` if
@ -413,6 +455,7 @@ service Subscriber {
post: "/v1/{subscription=projects/*/subscriptions/*}:pull"
body: "*"
};
option (google.api.method_signature) = "subscription,return_immediately,max_messages";
}
// Establishes a stream with the server, which sends messages down to the
@ -422,8 +465,8 @@ service Subscriber {
// reassign server-side resources, in which case, the client should
// re-establish the stream. Flow control can be achieved by configuring the
// underlying RPC channel.
rpc StreamingPull(stream StreamingPullRequest)
returns (stream StreamingPullResponse) {}
rpc StreamingPull(stream StreamingPullRequest) returns (stream StreamingPullResponse) {
}
// Modifies the `PushConfig` for a specified subscription.
//
@ -431,12 +474,12 @@ service Subscriber {
// an empty `PushConfig`) or vice versa, or change the endpoint URL and other
// attributes of a push subscription. Messages will accumulate for delivery
// continuously through the call regardless of changes to the `PushConfig`.
rpc ModifyPushConfig(ModifyPushConfigRequest)
returns (google.protobuf.Empty) {
rpc ModifyPushConfig(ModifyPushConfigRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/v1/{subscription=projects/*/subscriptions/*}:modifyPushConfig"
body: "*"
};
option (google.api.method_signature) = "subscription,push_config";
}
// Gets the configuration details of a snapshot. Snapshots are used in
@ -460,6 +503,7 @@ service Subscriber {
option (google.api.http) = {
get: "/v1/{project=projects/*}/snapshots"
};
option (google.api.method_signature) = "project";
}
// Creates a snapshot from the requested subscription. Snapshots are used in
@ -485,6 +529,7 @@ service Subscriber {
put: "/v1/{name=projects/*/snapshots/*}"
body: "*"
};
option (google.api.method_signature) = "name,subscription";
}
// Updates an existing snapshot. Snapshots are used in
@ -514,6 +559,7 @@ service Subscriber {
option (google.api.http) = {
delete: "/v1/{snapshot=projects/*/snapshots/*}"
};
option (google.api.method_signature) = "snapshot";
}
// Seeks an existing subscription to a point in time or to a given snapshot,
@ -534,19 +580,29 @@ service Subscriber {
// A subscription resource.
message Subscription {
// The name of the subscription. It must have the format
option (google.api.resource) = {
type: "pubsub.googleapis.com/Subscription"
pattern: "projects/{project}/subscriptions/{subscription}"
};
// Required. The name of the subscription. It must have the format
// `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must
// start with a letter, and contain only letters (`[A-Za-z]`), numbers
// (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`),
// plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters
// in length, and it must not start with `"goog"`.
string name = 1;
string name = 1 [(google.api.field_behavior) = REQUIRED];
// The name of the topic from which this subscription is receiving messages.
// Required. The name of the topic from which this subscription is receiving messages.
// Format is `projects/{project}/topics/{topic}`.
// The value of this field will be `_deleted-topic_` if the topic has been
// deleted.
string topic = 2;
string topic = 2 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "pubsub.googleapis.com/Topic"
}
];
// If push delivery is used with this subscription, this field is
// used to configure it. An empty `pushConfig` signifies that the subscriber
@ -762,26 +818,36 @@ message ReceivedMessage {
// Request for the GetSubscription method.
message GetSubscriptionRequest {
// The name of the subscription to get.
// Required. The name of the subscription to get.
// Format is `projects/{project}/subscriptions/{sub}`.
string subscription = 1;
string subscription = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "pubsub.googleapis.com/Subscription"
}
];
}
// Request for the UpdateSubscription method.
message UpdateSubscriptionRequest {
// The updated subscription object.
Subscription subscription = 1;
// Required. The updated subscription object.
Subscription subscription = 1 [(google.api.field_behavior) = REQUIRED];
// Indicates which fields in the provided subscription to update.
// Required. Indicates which fields in the provided subscription to update.
// Must be specified and non-empty.
google.protobuf.FieldMask update_mask = 2;
google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
}
// Request for the `ListSubscriptions` method.
message ListSubscriptionsRequest {
// The name of the project in which to list subscriptions.
// Required. The name of the project in which to list subscriptions.
// Format is `projects/{project-id}`.
string project = 1;
string project = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "cloudresourcemanager.googleapis.com/Project"
}
];
// Maximum number of subscriptions to return.
int32 page_size = 2;
@ -805,31 +871,46 @@ message ListSubscriptionsResponse {
// Request for the DeleteSubscription method.
message DeleteSubscriptionRequest {
// The subscription to delete.
// Required. The subscription to delete.
// Format is `projects/{project}/subscriptions/{sub}`.
string subscription = 1;
string subscription = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "pubsub.googleapis.com/Subscription"
}
];
}
// Request for the ModifyPushConfig method.
message ModifyPushConfigRequest {
// The name of the subscription.
// Required. The name of the subscription.
// Format is `projects/{project}/subscriptions/{sub}`.
string subscription = 1;
string subscription = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "pubsub.googleapis.com/Subscription"
}
];
// The push configuration for future deliveries.
// Required. The push configuration for future deliveries.
//
// An empty `pushConfig` indicates that the Pub/Sub system should
// stop pushing messages from the given subscription and allow
// messages to be pulled and acknowledged - effectively pausing
// the subscription if `Pull` or `StreamingPull` is not called.
PushConfig push_config = 2;
PushConfig push_config = 2 [(google.api.field_behavior) = REQUIRED];
}
// Request for the `Pull` method.
message PullRequest {
// The subscription from which messages should be pulled.
// Required. The subscription from which messages should be pulled.
// Format is `projects/{project}/subscriptions/{sub}`.
string subscription = 1;
string subscription = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "pubsub.googleapis.com/Subscription"
}
];
// If this field set to true, the system will respond immediately even if
// it there are no messages available to return in the `Pull` response.
@ -837,10 +918,10 @@ message PullRequest {
// least one message is available, rather than returning no messages.
bool return_immediately = 2;
// The maximum number of messages to return for this request. Must be a
// Required. The maximum number of messages to return for this request. Must be a
// positive integer. The Pub/Sub system may return fewer than the number
// specified.
int32 max_messages = 3;
int32 max_messages = 3 [(google.api.field_behavior) = REQUIRED];
}
// Response for the `Pull` method.
@ -854,14 +935,19 @@ message PullResponse {
// Request for the ModifyAckDeadline method.
message ModifyAckDeadlineRequest {
// The name of the subscription.
// Required. The name of the subscription.
// Format is `projects/{project}/subscriptions/{sub}`.
string subscription = 1;
string subscription = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "pubsub.googleapis.com/Subscription"
}
];
// List of acknowledgment IDs.
repeated string ack_ids = 4;
// Required. List of acknowledgment IDs.
repeated string ack_ids = 4 [(google.api.field_behavior) = REQUIRED];
// The new ack deadline with respect to the time this request was sent to
// Required. The new ack deadline with respect to the time this request was sent to
// the Pub/Sub system. For example, if the value is 10, the new
// ack deadline will expire 10 seconds after the `ModifyAckDeadline` call
// was made. Specifying zero might immediately make the message available for
@ -869,29 +955,39 @@ message ModifyAckDeadlineRequest {
// increase in the rate of message redeliveries (that is, duplicates).
// The minimum deadline you can specify is 0 seconds.
// The maximum deadline you can specify is 600 seconds (10 minutes).
int32 ack_deadline_seconds = 3;
int32 ack_deadline_seconds = 3 [(google.api.field_behavior) = REQUIRED];
}
// Request for the Acknowledge method.
message AcknowledgeRequest {
// The subscription whose message is being acknowledged.
// Required. The subscription whose message is being acknowledged.
// Format is `projects/{project}/subscriptions/{sub}`.
string subscription = 1;
string subscription = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "pubsub.googleapis.com/Subscription"
}
];
// The acknowledgment ID for the messages being acknowledged that was returned
// Required. The acknowledgment ID for the messages being acknowledged that was returned
// by the Pub/Sub system in the `Pull` response. Must not be empty.
repeated string ack_ids = 2;
repeated string ack_ids = 2 [(google.api.field_behavior) = REQUIRED];
}
// Request for the `StreamingPull` streaming RPC method. This request is used to
// establish the initial stream as well as to stream acknowledgements and ack
// deadline modifications from the client to the server.
message StreamingPullRequest {
// The subscription for which to initialize the new stream. This must be
// Required. The subscription for which to initialize the new stream. This must be
// provided in the first request on the stream, and must not be set in
// subsequent requests from client to server.
// Format is `projects/{project}/subscriptions/{sub}`.
string subscription = 1;
string subscription = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "pubsub.googleapis.com/Subscription"
}
];
// List of acknowledgement IDs for acknowledging previously received messages
// (received on this stream or a different stream). If an ack ID has expired,
@ -920,11 +1016,11 @@ message StreamingPullRequest {
// processing was interrupted.
repeated string modify_deadline_ack_ids = 4;
// The ack deadline to use for the stream. This must be provided in the
// Required. The ack deadline to use for the stream. This must be provided in the
// first request on the stream, but it can also be updated on subsequent
// requests from client to server. The minimum deadline you can specify is 10
// seconds. The maximum deadline you can specify is 600 seconds (10 minutes).
int32 stream_ack_deadline_seconds = 5;
int32 stream_ack_deadline_seconds = 5 [(google.api.field_behavior) = REQUIRED];
// A unique identifier that is used to distinguish client instances from each
// other. Only needs to be provided on the initial request. When a stream
@ -944,15 +1040,20 @@ message StreamingPullResponse {
// Request for the `CreateSnapshot` method.
message CreateSnapshotRequest {
// User-provided name for this snapshot. If the name is not provided in the
// Required. User-provided name for this snapshot. If the name is not provided in the
// request, the server will assign a random name for this snapshot on the same
// project as the subscription. Note that for REST API requests, you must
// specify a name. See the <a
// href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource
// name rules</a>. Format is `projects/{project}/snapshots/{snap}`.
string name = 1;
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "pubsub.googleapis.com/Snapshot"
}
];
// The subscription whose backlog the snapshot retains.
// Required. The subscription whose backlog the snapshot retains.
// Specifically, the created snapshot is guaranteed to retain:
// (a) The existing backlog on the subscription. More precisely, this is
// defined as the messages in the subscription's backlog that are
@ -961,7 +1062,12 @@ message CreateSnapshotRequest {
// (b) Any messages published to the subscription's topic following the
// successful completion of the CreateSnapshot request.
// Format is `projects/{project}/subscriptions/{sub}`.
string subscription = 2;
string subscription = 2 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "pubsub.googleapis.com/Subscription"
}
];
// See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and
// managing labels</a>.
@ -970,12 +1076,12 @@ message CreateSnapshotRequest {
// Request for the UpdateSnapshot method.
message UpdateSnapshotRequest {
// The updated snapshot object.
Snapshot snapshot = 1;
// Required. The updated snapshot object.
Snapshot snapshot = 1 [(google.api.field_behavior) = REQUIRED];
// Indicates which fields in the provided snapshot to update.
// Required. Indicates which fields in the provided snapshot to update.
// Must be specified and non-empty.
google.protobuf.FieldMask update_mask = 2;
google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
}
// A snapshot resource. Snapshots are used in
@ -985,11 +1091,18 @@ message UpdateSnapshotRequest {
// acknowledgment state of messages in an existing subscription to the state
// captured by a snapshot.
message Snapshot {
option (google.api.resource) = {
type: "pubsub.googleapis.com/Snapshot"
pattern: "projects/{project}/snapshots/{snapshot}"
};
// The name of the snapshot.
string name = 1;
// The name of the topic from which this snapshot is retaining messages.
string topic = 2;
string topic = 2 [(google.api.resource_reference) = {
type: "pubsub.googleapis.com/Topic"
}];
// The snapshot is guaranteed to exist up until this time.
// A newly-created snapshot expires no later than 7 days from the time of its
@ -1010,16 +1123,26 @@ message Snapshot {
// Request for the GetSnapshot method.
message GetSnapshotRequest {
// The name of the snapshot to get.
// Required. The name of the snapshot to get.
// Format is `projects/{project}/snapshots/{snap}`.
string snapshot = 1;
string snapshot = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "pubsub.googleapis.com/Snapshot"
}
];
}
// Request for the `ListSnapshots` method.
message ListSnapshotsRequest {
// The name of the project in which to list snapshots.
// Required. The name of the project in which to list snapshots.
// Format is `projects/{project-id}`.
string project = 1;
string project = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "cloudresourcemanager.googleapis.com/Project"
}
];
// Maximum number of snapshots to return.
int32 page_size = 2;
@ -1042,15 +1165,25 @@ message ListSnapshotsResponse {
// Request for the `DeleteSnapshot` method.
message DeleteSnapshotRequest {
// The name of the snapshot to delete.
// Required. The name of the snapshot to delete.
// Format is `projects/{project}/snapshots/{snap}`.
string snapshot = 1;
string snapshot = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "pubsub.googleapis.com/Snapshot"
}
];
}
// Request for the `Seek` method.
message SeekRequest {
// The subscription to affect.
string subscription = 1;
// Required. The subscription to affect.
string subscription = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "pubsub.googleapis.com/Subscription"
}
];
oneof target {
// The time to seek to.
@ -1069,9 +1202,13 @@ message SeekRequest {
// The snapshot to seek to. The snapshot's topic must be the same as that of
// the provided subscription.
// Format is `projects/{project}/snapshots/{snap}`.
string snapshot = 3;
string snapshot = 3 [(google.api.resource_reference) = {
type: "pubsub.googleapis.com/Snapshot"
}];
}
}
// Response for the `Seek` method (this response is empty).
message SeekResponse {}
message SeekResponse {
}

View File

@ -0,0 +1,214 @@
{
"methodConfig": [
{
"name": [
{
"service": "google.pubsub.v1.Publisher",
"method": "CreateTopic"
},
{
"service": "google.pubsub.v1.Publisher",
"method": "UpdateTopic"
},
{
"service": "google.pubsub.v1.Publisher",
"method": "DeleteTopic"
},
{
"service": "google.pubsub.v1.Publisher",
"method": "SetIamPolicy"
},
{
"service": "google.pubsub.v1.Publisher",
"method": "TestIamPermissions"
}
],
"timeout": "60s",
"retryPolicy": {
"maxAttempts": 5,
"initialBackoff": "0.100s",
"maxBackoff": "60s",
"backoffMultiplier": 1.3,
"retryableStatusCodes": [
"UNAVAILABLE"
]
}
},
{
"name": [
{
"service": "google.pubsub.v1.Publisher",
"method": "Publish"
}
],
"timeout": "60s",
"retryPolicy": {
"maxAttempts": 5,
"initialBackoff": "0.100s",
"maxBackoff": "60s",
"backoffMultiplier": 1.3,
"retryableStatusCodes": [
"ABORTED",
"CANCELLED",
"INTERNAL",
"RESOURCE_EXHAUSTED",
"UNKNOWN",
"UNAVAILABLE",
"DEADLINE_EXCEEDED"
]
}
},
{
"name": [
{
"service": "google.pubsub.v1.Publisher",
"method": "GetTopic"
},
{
"service": "google.pubsub.v1.Publisher",
"method": "ListTopics"
},
{
"service": "google.pubsub.v1.Publisher",
"method": "ListTopicSubscriptions"
},
{
"service": "google.pubsub.v1.Publisher",
"method": "GetIamPolicy"
}
],
"timeout": "60s",
"retryPolicy": {
"maxAttempts": 5,
"initialBackoff": "0.100s",
"maxBackoff": "60s",
"backoffMultiplier": 1.3,
"retryableStatusCodes": [
"UNKNOWN",
"ABORTED",
"UNAVAILABLE"
]
}
},
{
"name": [
{
"service": "google.pubsub.v1.Subscriber",
"method": "StreamingPull"
}
],
"timeout": "900s",
"retryPolicy": {
"maxAttempts": 5,
"initialBackoff": "0.100s",
"maxBackoff": "60s",
"backoffMultiplier": 1.3,
"retryableStatusCodes": [
"DEADLINE_EXCEEDED",
"RESOURCE_EXHAUSTED",
"ABORTED",
"INTERNAL",
"UNAVAILABLE"
]
}
},
{
"name": [
{
"service": "google.pubsub.v1.Subscriber",
"method": "CreateSubscription"
},
{
"service": "google.pubsub.v1.Subscriber",
"method": "GetSubscription"
},
{
"service": "google.pubsub.v1.Subscriber",
"method": "ListSubscriptions"
},
{
"service": "google.pubsub.v1.Subscriber",
"method": "ListSnapshots"
},
{
"service": "google.pubsub.v1.Subscriber",
"method": "Seek"
},
{
"service": "google.pubsub.v1.Subscriber",
"method": "Pull"
},
{
"service": "google.pubsub.v1.Subscriber",
"method": "GetIamPolicy"
}
],
"timeout": "60s",
"retryPolicy": {
"maxAttempts": 5,
"initialBackoff": "0.100s",
"maxBackoff": "60s",
"backoffMultiplier": 1.3,
"retryableStatusCodes": [
"UNKNOWN",
"ABORTED",
"UNAVAILABLE"
]
}
},
{
"name": [
{
"service": "google.pubsub.v1.Subscriber",
"method": "UpdateSubscription"
},
{
"service": "google.pubsub.v1.Subscriber",
"method": "DeleteSubscription"
},
{
"service": "google.pubsub.v1.Subscriber",
"method": "ModifyAckDeadline"
},
{
"service": "google.pubsub.v1.Subscriber",
"method": "ModifyPushConfig"
},
{
"service": "google.pubsub.v1.Subscriber",
"method": "CreateSnapshot"
},
{
"service": "google.pubsub.v1.Subscriber",
"method": "UpdateSnapshot"
},
{
"service": "google.pubsub.v1.Subscriber",
"method": "DeleteSnapshot"
},
{
"service": "google.pubsub.v1.Subscriber",
"method": "Acknowledge"
},
{
"service": "google.pubsub.v1.Subscriber",
"method": "SetIamPolicy"
},
{
"service": "google.pubsub.v1.Subscriber",
"method": "TestIamPermissions"
}
],
"timeout": "60s",
"retryPolicy": {
"maxAttempts": 5,
"initialBackoff": "0.100s",
"maxBackoff": "60s",
"backoffMultiplier": 1.3,
"retryableStatusCodes": [
"UNAVAILABLE"
]
}
}
]
}

View File

@ -0,0 +1,97 @@
type: google.api.Service
config_version: 3
name: pubsub.googleapis.com
title: Cloud Pub/Sub API
apis:
- name: google.pubsub.v1.Publisher
- name: google.pubsub.v1.Subscriber
documentation:
summary: |-
Provides reliable, many-to-many, asynchronous messaging between
applications.
rules:
- selector: google.iam.v1.IAMPolicy.GetIamPolicy
description: |-
Gets the access control policy for a resource. Returns an empty policy
if the resource exists and does not have a policy set.
- selector: google.iam.v1.IAMPolicy.SetIamPolicy
description: |-
Sets the access control policy on the specified resource. Replaces
any existing policy.
Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and
PERMISSION_DENIED
- selector: google.iam.v1.IAMPolicy.TestIamPermissions
description: |-
Returns permissions that a caller has on the specified resource. If the
resource does not exist, this will return an empty set of
permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building
permission-aware UIs and command-line tools, not for authorization
checking. This operation may "fail open" without warning.
backend:
rules:
- selector: 'google.pubsub.v1.Publisher.*'
deadline: 120.0
- selector: google.pubsub.v1.Publisher.Publish
deadline: 20.0
- selector: 'google.pubsub.v1.Subscriber.*'
deadline: 120.0
http:
rules:
- selector: google.iam.v1.IAMPolicy.GetIamPolicy
get: '/v1beta2/{resource=projects/*/topics/*}:getIamPolicy'
additional_bindings:
- get: '/v1beta2/{resource=projects/*/subscriptions/*}:getIamPolicy'
- get: '/v1/{resource=projects/*/topics/*}:getIamPolicy'
- get: '/v1/{resource=projects/*/subscriptions/*}:getIamPolicy'
- get: '/v1/{resource=projects/*/snapshots/*}:getIamPolicy'
- selector: google.iam.v1.IAMPolicy.SetIamPolicy
post: '/v1beta2/{resource=projects/*/topics/*}:setIamPolicy'
body: '*'
additional_bindings:
- post: '/v1beta2/{resource=projects/*/subscriptions/*}:setIamPolicy'
body: '*'
- post: '/v1/{resource=projects/*/topics/*}:setIamPolicy'
body: '*'
- post: '/v1/{resource=projects/*/subscriptions/*}:setIamPolicy'
body: '*'
- post: '/v1/{resource=projects/*/snapshots/*}:setIamPolicy'
body: '*'
- selector: google.iam.v1.IAMPolicy.TestIamPermissions
post: '/v1beta2/{resource=projects/*/subscriptions/*}:testIamPermissions'
body: '*'
additional_bindings:
- post: '/v1beta2/{resource=projects/*/topics/*}:testIamPermissions'
body: '*'
- post: '/v1/{resource=projects/*/subscriptions/*}:testIamPermissions'
body: '*'
- post: '/v1/{resource=projects/*/topics/*}:testIamPermissions'
body: '*'
- post: '/v1/{resource=projects/*/snapshots/*}:testIamPermissions'
body: '*'
authentication:
rules:
- selector: 'google.iam.v1.IAMPolicy.*'
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform,
https://www.googleapis.com/auth/pubsub
- selector: 'google.pubsub.v1.Publisher.*'
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform,
https://www.googleapis.com/auth/pubsub
- selector: 'google.pubsub.v1.Subscriber.*'
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform,
https://www.googleapis.com/auth/pubsub