Creating a Consumer Group or Batch Deleting Consumer Groups
Function
This API is used to create a consumer group or batch deleting consumer groups.
URI
POST /v2/{project_id}/instances/{instance_id}/groups
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. |
instance_id |
Yes |
String |
Instance ID. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
action |
No |
String |
This parameter is used to delete topics in batches. If it is not set, a topic will be created. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
groups |
No |
Array of strings |
List of consumer groups to be deleted. |
enabled |
No |
Boolean |
Whether consumption is allowed. |
broadcast |
No |
Boolean |
Whether to broadcast. |
brokers |
No |
Array of strings |
List of associated brokers. |
name |
No |
String |
Consumer group name. |
retry_max_time |
No |
Number |
Maximum number of retries. |
from_beginning |
No |
Boolean |
Whether consumption starts from the beginning. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
job_id |
String |
ID of the job for deleting consumer groups. |
name |
String |
ID of the consumer group that is successfully created. |
Example Requests
-
Creating a consumer group
POST https://{endpoint}/v2/{project_id}/instances/{instance_id}/groups { "name" : "consumer-group-test", "brokers" : [ "broker-0" ], "from_beginning" : false, "broadcast" : false, "retry_max_time" : 16 }
-
Deleting consumer groups
POST https://{endpoint}/v2/{project_id}/instances/{instance_id}/groups?action=delete { "groups" : [ "consumer-group-test" ] }
Example Responses
Status code: 200
A consumer group is created or multiple consumer groups are deleted in batches.
{ "name" : "consumer-group-test" }
Status Codes
Status Code |
Description |
---|---|
200 |
A consumer group is created or multiple consumer groups are deleted in batches. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot