Creating a Consumer Group

Function

This API is used to create a consumer group.

URI

POST /v2/{project_id}/kafka/instances/{instance_id}/group

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain it, see Obtaining a Project ID.

instance_id

Yes

String

Instance ID.

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

group_name

Yes

String

Consumer group name.

group_desc

No

String

Consumer group description.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

-

String

Specified IPv4 private IP addresses.

The number of specified IP addresses must be less than or equal to the number of new brokers.

If the number of specified IP addresses is less than the number of brokers, the unspecified brokers are randomly assigned private IP addresses.

Status code: 400

Table 4 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Example Requests

Creating a consumer group named test

POST https://{endpoint}/v2/{project_id}/kafka/instances/{instance_id}/group

{
  "group_name" : "test"
}

Example Responses

Status code: 200

Creation succeeded.

success

Status Codes

Status Code

Description

200

Creation succeeded.

400

Creation failed.

Error Codes

See Error Codes.