v1

latestOpenAPI 3.0.0Creative Commons Attribution 3.02026-07-13356598.3 KB
projects

Creates a new topic in a given project and location.

post/v1/{+parent}/topics

Path parameters

parentstring required

Required. The parent cluster in which to create the topic. Structured like projects/{project}/locations/{location}/clusters/{cluster}.

Query parameters

topicIdstring

Required. The ID to use for the topic, which will become the final component of the topic's name. This value is structured like: my-topic-name.

Request body

namestring

Identifier. The name of the topic. The topic segment is used when connecting directly to the cluster. Structured like: projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}

partitionCountinteger

Required. The number of partitions this topic has. The partition count can only be increased, not decreased. Please note that if partitions are increased for a topic that has a key, the partitioning logic or the ordering of the messages will be affected.

replicationFactorinteger

Required. Immutable. The number of replicas of each partition. A replication factor of 3 is recommended for high availability.

configsobject

Optional. Configurations for the topic that are overridden from the cluster defaults. The key of the map is a Kafka topic property name, for example: cleanup.policy, compression.type.

Response

Successful response