Creates the given topic with the given name. See the resource name rules.
HTTP request
PUT https://pubsub.googleapis.com/v1/{name}
Path parameters
Parameters | |
---|---|
name |
Required. Name of the topic. Format is |
Request body
The request body contains data with the following structure:
JSON representation | |
---|---|
{
"labels": {
string: string,
...
},
"messageStoragePolicy": {
object ( |
Fields | |
---|---|
labels |
See Creating and managing labels. An object containing a list of |
messageStoragePolicy |
Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect. |
kmsKeyName |
The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. The expected format is |
Response body
If successful, the response body contains a newly created instance of Topic
.
Authorization Scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/pubsub
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.