Creates the given topic with the given name. See the [resource name rules] (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
Scopes
You will need authorization for at least one of the following scopes to make a valid call:
- https://www.googleapis.com/auth/cloud-platform
- https://www.googleapis.com/auth/pubsub
If unset, the scope for this method defaults to https://www.googleapis.com/auth/cloud-platform.
You can set the scope for this method like this: pubsub1 --scope <scope> projects topics-create ...
Required Scalar Argument
- <name> (string)
- 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"
.
- Required. The name of the topic. It must have the format
Required Request Value
The request value is a data-structure with various fields. Each field may be a simple scalar or another data-structure. In the latter case it is advised to set the field-cursor to the data-structure's field to specify values more concisely.
For example, a structure like this:
Topic:
ingestion-data-source-settings:
aws-kinesis:
aws-role-arn: string
consumer-arn: string
gcp-service-account: string
state: string
stream-arn: string
kms-key-name: string
labels: { string: string }
message-retention-duration: string
message-storage-policy:
allowed-persistence-regions: [string]
enforce-in-transit: boolean
name: string
satisfies-pzs: boolean
schema-settings:
encoding: string
first-revision-id: string
last-revision-id: string
schema: string
state: string
can be set completely with the following arguments which are assumed to be executed in the given order. Note how the cursor position is adjusted to the respective structures, allowing simple field names to be used most of the time.
-r .ingestion-data-source-settings.aws-kinesis aws-role-arn=diam
- Required. AWS role ARN to be used for Federated Identity authentication with Kinesis. Check the Pub/Sub docs for how to set up this role and the required permissions that need to be attached to it.
consumer-arn=est
- Required. The Kinesis consumer ARN to used for ingestion in Enhanced Fan-Out mode. The consumer must be already created and ready to be used.
gcp-service-account=sit
- Required. The GCP service account to be used for Federated Identity authentication with Kinesis (via a
AssumeRoleWithWebIdentity
call for the provided role). Theaws_role_arn
must be set up withaccounts.google.com:sub
equals to this service account number.
- Required. The GCP service account to be used for Federated Identity authentication with Kinesis (via a
state=sed
- Output only. An output-only field that indicates the state of the Kinesis ingestion source.
-
stream-arn=eos
- Required. The Kinesis stream ARN to ingest data from.
-
... kms-key-name=lorem
- Optional. The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. The expected format is
projects/*/locations/*/keyRings/*/cryptoKeys/*
.
- Optional. The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. The expected format is
labels=key=ea
- Optional. See [Creating and managing labels] (https://cloud.google.com/pubsub/docs/labels).
- the value will be associated with the given
key
message-retention-duration=stet
- Optional. Indicates the minimum duration to retain a message after it is published to the topic. If this field is set, messages published to the topic in the last
message_retention_duration
are always available to subscribers. For instance, it allows any attached subscription to seek to a timestamp that is up tomessage_retention_duration
in the past. If this field is not set, message retention is controlled by settings on individual subscriptions. Cannot be more than 31 days or less than 10 minutes.
- Optional. Indicates the minimum duration to retain a message after it is published to the topic. If this field is set, messages published to the topic in the last
message-storage-policy allowed-persistence-regions=dolores
- Optional. A list of IDs of Google Cloud regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed Google Cloud regions (or running outside of Google Cloud altogether) are routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.
- Each invocation of this argument appends the given value to the array.
-
enforce-in-transit=true
- Optional. If true,
allowed_persistence_regions
is also used to enforce in-transit guarantees for messages. That is, Pub/Sub will fail Publish operations on this topic and subscribe operations on any subscription attached to this topic in any region that is not inallowed_persistence_regions
.
- Optional. If true,
-
.. name=sea
- 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"
.
- Required. The name of the topic. It must have the format
satisfies-pzs=false
- Optional. Reserved for future use. This field is set only in responses from the server; it is ignored if it is set in any requests.
schema-settings encoding=at
- Optional. The encoding of messages validated against
schema
.
- Optional. The encoding of messages validated against
first-revision-id=dolore
- Optional. The minimum (inclusive) revision allowed for validating messages. If empty or not present, allow any revision to be validated against last_revision or any revision created before.
last-revision-id=eirmod
- Optional. The maximum (inclusive) revision allowed for validating messages. If empty or not present, allow any revision to be validated against first_revision or any revision created after.
-
schema=lorem
- Required. The name of the schema that messages published should be validated against. Format is
projects/{project}/schemas/{schema}
. The value of this field will be_deleted-schema_
if the schema has been deleted.
- Required. The name of the schema that messages published should be validated against. Format is
-
.. state=accusam
- Output only. An output-only field indicating the state of the topic.
About Cursors
The cursor position is key to comfortably set complex nested structures. The following rules apply:
- The cursor position is always set relative to the current one, unless the field name starts with the
.
character. Fields can be nested such as in-r f.s.o
. - The cursor position is set relative to the top-level structure if it starts with
.
, e.g.-r .s.s
- You can also set nested fields without setting the cursor explicitly. For example, to set a value relative to the current cursor position, you would specify
-r struct.sub_struct=bar
. - You can move the cursor one level up by using
..
. Each additional.
moves it up one additional level. E.g....
would go three levels up.
Optional Output Flags
The method's return value a JSON encoded structure, which will be written to standard output by default.
- -o out
- out specifies the destination to which to write the server's result to.
It will be a JSON-encoded structure.
The destination may be
-
to indicate standard output, or a filepath that is to contain the received bytes. If unset, it defaults to standard output.
- out specifies the destination to which to write the server's result to.
It will be a JSON-encoded structure.
The destination may be
Optional General Properties
The following properties can configure any call, and are not specific to this method.
-
-p $-xgafv=string
- V1 error format.
-
-p access-token=string
- OAuth access token.
-
-p alt=string
- Data format for response.
-
-p callback=string
- JSONP
-
-p fields=string
- Selector specifying which fields to include in a partial response.
-
-p key=string
- API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
-
-p oauth-token=string
- OAuth 2.0 token for the current user.
-
-p pretty-print=boolean
- Returns response with indentations and line breaks.
-
-p quota-user=string
- Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
-
-p upload-type=string
- Legacy upload protocol for media (e.g. "media", "multipart").
-
-p upload-protocol=string
- Upload protocol for media (e.g. "raw", "multipart").