aws-cli list-fragments example

0

I've retrieved the DataEndPoint for my stream using:

# aws kinesisvideo get-data-endpoint --stream-arn arn:aws:kinesisvideo:ap-southeast-2:XXXX430XXXXX:stream/astreamname/XXX267XXXX9X --api-name LIST_FRAGMENTS

which spits out:

{
    "DataEndpoint": "https://b-xxxxxxxx.kinesisvideo.ap-southeast-2.amazonaws.com"
}

I then try to retrieve any available fragments

# aws kinesis-video-archived-media  list-fragments --endpoint-url https://b-xxxxxxxx.kinesisvideo.ap-southeast-2.amazonaws.com --stream-arn arn:aws:kinesisvideo:ap-southeast-2:XXXX430XXXXX:stream/astreamname/XXXX26XXXX4XX FragmentSelectorType=Producer,TimestampRange={StartTimestamp=timestamp,EndTimestamp=timestamp}

but i'm not sure what format the timestamp should be in.

Is there an example on how to list the fragments for 1 whole day ?

I read that the result is paginated, so it shouldn't hurt to ask for a big range ?

  • I think https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-types.html#parameter-type-timestamp should be ok. so i changed it to:

    aws kinesis-video-archived-media  list-fragments --endpoint-url https://b-xxxxxxxx.kinesisvideo.ap-southeast-2.amazonaws.com --stream-arn arn:aws:kinesisvideo:ap-southeast-2:XXXX430XXXXX:stream/astreamname/XXXX26XXXX4XX --fragment-selector FragmentSelectorType=Producer,TimestampRange={StartTimestamp=2022-01-10T00:00:00.000Z,EndTimestamp=2022-01-10T23:59:59.000Z} 
    

    but that gives me : Unknown options: FragmentSelectorType=Producer,TimestampRange=EndTimestamp=2022-01-10T23:59:59.000Z

  • found it :

     aws kinesis-video-archived-media  list-fragments --endpoint-url https://b-xxxxxxxx.kinesisvideo.ap-southeast-2.amazonaws.com --stream-arn arn:aws:kinesisvideo:ap-southeast-2:XXXX430XXXXX:stream/astreamname/XXXX26XXXX4XX --fragment-selector "FragmentSelectorType=PRODUCER_TIMESTAMP,TimestampRange={StartTimestamp=2022-01-10T00:00:00.000Z,EndTimestamp=2022-01-10T23:59:59.000Z}"
    
1 Answer
0
Accepted Answer

figured it out so for anyone else looking for something like this :

aws kinesis-video-archived-media  list-fragments --endpoint-url https://b-xxxxxxxx.kinesisvideo.ap-southeast-2.amazonaws.com --stream-arn arn:aws:kinesisvideo:ap-southeast-2:XXXX430XXXXX:stream/astreamname/XXXX26XXXX4XX --fragment-selector "FragmentSelectorType=PRODUCER_TIMESTAMP,TimestampRange={StartTimestamp=2022-01-10T00:00:00.000Z,EndTimestamp=2022-01-10T23:59:59.000Z}"
clogwog
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions