ModifyKafkaTopic
In this article:
ModifyKafkaTopic#
Description#
Request to change a Kafka topic.
Request Parameters#
parameters — The parameters of the Kafka topic.
Type: Dict
Required: Yes
serviceId — The PaaS service ID.
Type: String
Required: Yes
topicId — The ID of the Kafka topic.
Type: String
Required: Yes
Response Elements#
kafkaTopic — The modified Kafka topic.
Type: KafkaTopic object
Examples#
Managing PaaS services in K2 Cloud via API requires a customized version of the boto3 library:
import boto3
session = boto3.Session(
aws_access_key_id="<AWS_ACCESS_KEY_ID>",
aws_secret_access_key="<AWS_SECRET_ACCESS_KEY>",
region_name="",
)
paas_client = session.client(
'paas',
endpoint_url='https://paas.k2.cloud/',
)
topic = paas_client.modify_kafka_topic(
serviceId='fm-cluster-1ACD3963',
topicId="my-topic",
parameters={
"partitions": 3,
"replicationFactor": 3
}
)
Or c2-paas utility from K2 Cloud API Client software suite:
c2-paas ModifyKafkaTopic serviceId fm-cluster-1ACD3963 topicId my-topic parameters.partitions 3 parameters.replicationFactor 3