This API is used to change the number of partitions in a specific stream.
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. The token can be obtained by calling the IAM API (value of X-Subject-Token in the response header). |
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. Note: A maximum of five scale-up/down operations can be performed for each stream within one hour. If a scale-up/down operation is successfully performed, you cannot perform one more scale-up/down operation 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.