This API is used to create a stream.
When creating a stream, specify a stream type (common or advanced) and the number of partitions.
By default, an account can create a maximum of 10 advanced stream partitions and 50 common stream partitions. You can submit a service ticket to increase the quota.
POST /v2/{project_id}/streams
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. |
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. The stream name can contain 1 to 64 characters, including letters, digits, underscores (_), and hyphens (-). Maximum: 64 |
partition_count |
Yes |
Integer |
Number of partitions. Partitions are the base throughput unit of a DIS stream. |
stream_type |
No |
String |
Stream type.
Enumeration values:
|
data_type |
No |
String |
Source data type.
Default value: BLOB Enumeration values:
|
data_duration |
No |
Integer |
Period of time for which data is retained in the stream. Value range: 24-72 Unit: hour Default value: 24 If this parameter is left blank, the default value is used. Maximum: 168 Default: 24 |
auto_scale_enabled |
No |
Boolean |
Specifies whether to enable auto scaling.
This function is disabled by default. Default: false |
auto_scale_min_partition_count |
No |
Long |
Minimum number of partitions for automatic scale-down when auto scaling is enabled. Minimum: 1 |
auto_scale_max_partition_count |
No |
Integer |
Maximum number of partitions for automatic scale-up when auto scaling is enabled. |
data_schema |
No |
String |
Source data structure that defines JSON and CSV formats. It is described in the syntax of the Avro schema. |
csv_properties |
No |
CSVProperties object |
Attributes of data in CSV format, such as delimiter. |
compression_format |
No |
String |
Compression type of data. Currently, the value can be:
Data is not compressed by default. Enumeration values:
|
tags |
No |
Array of Tag objects |
List of stream tags. |
sys_tags |
No |
Array of SysTag objects |
Stream enterprise projects. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
key |
No |
String |
Key.
Minimum: 1 Maximum: 36 |
value |
No |
String |
Value.
Minimum: 0 Maximum: 43 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
key |
No |
String |
Key.
Enumeration values:
|
value |
No |
String |
Value. The value is the enterprise project ID, which needs to be obtained on the enterprise management page.
|
None
Creating Streams
POST https://{Endpoint}/v2/{project_id}/streams { "stream_name" : "newstream", "partition_count" : 3, "data_duration" : 24 }
None
Status Code |
Description |
---|---|
201 |
Created |
See Error Codes.