CreateStream
Written by
Updated at February 10, 2023
Creates a stream.
If successful, the method initiates the creation of a stream, changes its status to CREATING
, and returns HTTP code 200. Reads and writes are only allowed for a stream in the ACTIVE
status. To find out the status of a stream, use the DescribeStream method.
If you try to create more streams than set in the quota for your account, the request returns LimitExceededException
.
Request
The request contains data in JSON format.
{
"StreamName": "string",
"ShardCount": number,
"WriteQuotaKbPerSec": number,
"RetentionPeriodHours": number
}
Request parameters
Parameter | Description |
---|---|
StreamName |
The name of the stream being created. Type: String Size: 1 -128 characters.Possible values: [a-zA-Z][a-zA-Z0-9-]+*(?<!-)$ Required: Yes |
ShardCount |
Number of shards in a stream. Type: Integer Minimum value: 1 .Required: Yes |
WriteQuotaKbPerSec |
The limit on writing data to a stream, KB/s. Type: Integer Possible values: 128 , 512 , 1024 .Required: No |
RetentionPeriodHours |
The message retention period, hours. Type: Integer Possible values 4 , 12 , 24 .Required: No |
Response
If successful, HTTP 200 code and an empty body are returned.
Errors
Error type | Description | HTTP code |
---|---|---|
InvalidArgumentException |
The argument is invalid. For more information, see the error message. | 400 |
LimitExceededException |
The request limit is exceeded. | 400 |
ResourceInUseException |
The resource is being used by another operation. | 400 |
Errors that are common to all methods may occur.