Returns the requested location within the specified stream shard, for use
in a subsequent
POST /<container>/<resource> HTTP/1.1
Host: <web-APIs URL>
Content-Type: application/json
X-v3io-function: Seek
<Authorization OR X-v3io-session-key>: <value>
url = "http://<web-APIs URL>/<container>/<resource>"
headers = {
"Content-Type": "application/json",
"X-v3io-function": "Seek",
"<Authorization OR X-v3io-session-key>": "<value>"
}
The path to the target stream shard.
The path includes the stream path and the shard ID.
You can optionally set the stream name and shard ID, or only the shard ID, in the request's
{
"StreamName": "string",
"ShardId": number,
"Type": "string",
"TimestampSec": number,
"TimestampNSec": number,
"StartingSequenceNumber": number
}
payload = {
"StreamName": "string",
"ShardId": number,
"Type": "string",
"TimestampSec": number,
"TimestampNSec": number,
"StartingSequenceNumber": number
}
The name of the stream that contains the shard resource.
The ID of the shard for which to obtain the requested location.
The shard ID is an integer between 0 and one less than the stream's shard count.
The seek type, which determines the location in the specified stream shard to retrieve.
The following seek types are supported:
The base time for a time-based seek operation (1511260205
sets the search base time to 21 Nov 2017 at 10:30:05 AM UTC.
The
When the
The nanoseconds unit of the 1511260205
and 500000000
, seek should search for the earliest ingested record since 21 Nov 2017 at 10:30 AM and 5.5 seconds.
Record sequence number for a sequence-number based seek operation —
{
"Location": "blob"
}
The requested location within the specified stream shard (see the
Error 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. | |
The specified shard does not exist in this stream. |
Obtain the location of the earliest ingested record in shard 199 of a MyStream stream:
POST /mycontainer/MyDirectory/MyStream/199 HTTP/1.1
Host: https://default-tenant.app.mycluster.iguazio.com:8443
Content-Type: application/json
X-v3io-function: Seek
X-v3io-session-key: e8bd4ca2-537b-4175-bf01-8c74963e90bf
{
"Type": "EARLIEST"
}
import requests
url = "https://default-tenant.app.mycluster.iguazio.com:8443/mycontainer/MyDirectory/MyStream/199"
headers = {
"Content-Type": "application/json",
"X-v3io-function": "Seek",
"X-v3io-session-key": "e8bd4ca2-537b-4175-bf01-8c74963e90bf"
}
payload = {"Type": "EARLIEST"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
HTTP/1.1 200 OK
Content-Type: application/json
...
{"Location": "AQAAAAAAAAAAAAAAAAAAAA=="}