DescribeStream
Description
Retrieves a stream's configuration, including the shard count and retention period.
Request
Request Header
POST /<container>/<resource> HTTP/1.1
Host: <web-APIs URL>
Content-Type: application/json
X-v3io-function: DescribeStream
<Authorization OR X-v3io-session-key>: <value>
url = "http://<web-APIs URL>/<container>/<resource>"
headers = {
"Content-Type": "application/json",
"X-v3io-function": "DescribeStream",
"<Authorization OR X-v3io-session-key>": "<value>"
}
The path to the target stream.
You can optionally set the stream name in the request's
Request Data
{
"StreamName": "string",
}
payload = {"StreamName": "string"}
- StreamName
The name of the stream for which to retrieve the description.
- Type: String
- Requirement: Required if not set in the request URL
Response
Response Data
{
"ShardCount": number,
"RetentionPeriodHours": number
}
- ShardCount
The steam's shard count (the total number of shards in the stream).
- Type: Number
- RetentionPeriodHours
The stream's retention period, in hours. After this period elapses, when new records are added to the stream, the earliest ingested records are deleted.
- Type: Number
Errors
In the event of an error, the response includes a JSON object with anError Message | Description |
---|---|
A provided request parameter is not valid for this request. | |
The sender of the request does not have the required permissions to perform the operation. | |
The specified resource does not exist. |
Examples
Retrieve configuration information for a MyStream stream:
POST /mycontainer/MyStream/ HTTP/1.1
Host: https://default-tenant.app.mycluster.iguazio.com:8443
Content-Type: application/json
X-v3io-function: DescribeStream
X-v3io-session-key: e8bd4ca2-537b-4175-bf01-8c74963e90bf
import requests
url = "https://default-tenant.app.mycluster.iguazio.com:8443/mycontainer/MyStream/"
headers = {
"Content-Type": "application/json",
"X-v3io-function": "DescribeStream",
"X-v3io-session-key": "e8bd4ca2-537b-4175-bf01-8c74963e90bf"
}
response = requests.post(url, headers=headers)
print(response.text)
HTTP/1.1 200 OK
Content-Type: application/json
...
{
"RetentionPeriodHours": 1,
"ShardCount": 1000
}