Querying User or Client Quotas

Updated on 2025-03-07 GMT+08:00

Function

This API is used to query quotas of a Kafka instance. A list of quotas is returned if the query succeeds.

Calling Method

For details, see Calling APIs.

URI

GET /v2/kafka/{project_id}/instances/{instance_id}/kafka-user-client-quota

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details, see Obtaining a Project ID.

instance_id

Yes

String

Instance ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

offset

No

Integer

Offset. The records after this offset will be queried.

limit

No

Integer

Maximum number of records that can be returned.

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

quotas

Array of Quota objects

Client quotas.

count

Integer

Number of user or client quotas.

Table 4 Quota

Parameter

Type

Description

user

String

Username.

Either the username or the client ID must be specified if the quotas are not applied to all users or clients.

client

String

Client ID.

Either the username or the client ID must be specified if the quotas are not applied to all users or clients.

user-default

Boolean

Indicates whether to use the default user settings.

  • Yes: Apply the quota to all users. In this case, the username cannot be set.

  • No: Apply the quota to specific users. In this case, set the username.

client-default

Boolean

Indicates whether to use the default client settings.

  • Yes: Apply the quota to all clients. In this case, the client ID cannot be set.

  • No: Apply the quota to specific clients. In this case, set the client ID.

producer-byte-rate

Long

Production rate limit. The unit is byte/s.

consumer-byte-rate

Long

Consumption rate limit. The unit is byte/s.

NOTE:

Either the production rate limit or the consumption rate limit must be specified.

Example Requests

None

Example Responses

Status code: 200

Client quotas queried.

{
  "quotas" : [ {
    "user" : "",
    "client" : "",
    "user-default" : false,
    "client-default" : true,
    "producer-byte-rate" : 2097152,
    "consumer-byte-rate" : 2097152
  } ],
  "count" : 1
}

Status Codes

Status Code

Description

200

Client quotas queried.

Error Codes

See Error Codes.

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback