This API is used to change the number of partitions in a specific stream.
For details, see Calling APIs.
PUT /v2/{project_id}/streams/{stream_name}
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
project_id |
Yes |
String |
Project ID |
stream_name |
Yes |
String |
Name of the stream whose partition quantity needs to be changed Maximum: 64 |
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
stream_name |
Yes |
String |
Name of the stream whose partition quantity needs to be changed Maximum: 64 |
target_partition_count |
Yes |
Integer |
Number of the target partitions. The value is an integer greater than 0. If the value is greater than the number of current partitions, scaling-up is required. If the value is less than the number of current partitions, scale-down is required. Notes: Each stream can be scaled up and down a total of five times within one hour. After the stream is successfully scaled up or down, it cannot be scaled up or down again within the next one hour. Minimum: 0 |
None
Changing Partition Quantity
PUT https://{Endpoint}/v2/{project_id}/streams/{stream_name}
{
"stream_name" : "newstream",
"target_partition_count" : 5
}
None
Status Code |
Description |
|---|---|
200 |
Normal response |
See Error Codes.