Cloud DVR API Examples
This section lists a few examples of Cloud DVR APIs in ECS.
Operation name: Fanout create/overwrite
Command:
./s3curl.pl --id=personal --ord http://<hostname>:9020/buck1/file1 --put=hello.txt -- -H "x-fanout-copy-count:3" -v
Response:
> PUT /buck1/file1 HTTP/1.1
> User-Agent: curl/7.37.0
> Host: 10.247.78.184:9020
> Accept: */*
> Date: Wed, 04 Dec 2019 19:35:38 +0000
> Authorization: AWS user1:xYpE4TDv8Tj/zDZgrRTiQL6fl04=
> x-fanout-copy-count:3
> Content-Length: 11
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
* We are completely uploaded and fine
< HTTP/1.1 200 OK
< Date: Wed, 04 Dec 2019 19:35:38 GMT
* Server ViPR/1.0 is not blacklisted
< Server: ViPR/1.0
< x-amz-request-id: 0af74eb8:16ed21aaacd:e6:1
< x-amz-id-2: 834d1a548e92e0e2487b59a87f45c39b522ac30fffc3cf0d12d6ccaf77c04df7
< ETag: "48e10fc1163cd2c7db2bf9a4225cd5cd"
< Last-Modified: Wed, 04 Dec 2019 19:35:38 GMT
< x-emc-mtime: 1575488138240
< x-emc-previous-object-size: 33
< Content-Length: 0
Operation name: Fanout object listing
Command:
./s3curl.pl --id=personal --ord http://<hostname>:9020/buck1/file1?fanout | xmllint --format -
Response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<FanoutListingResult>
<IsTruncated>false</IsTruncated>
<FanoutObject>
<Key>file1</Key>
<Index>0</Index>
</FanoutObject>
<FanoutObject>
<Key>file1</Key>
<Index>1</Index>
</FanoutObject>
<FanoutObject>
<Key>file1</Key>
<Index>2</Index>
</FanoutObject>
</FanoutListingResult>
NOTE: 0-based index represents fanout copies.
Operation name: Fanout copy read
Command:
./s3curl.pl --id=personal --ord -- -H "x-fanout-copy-index:0" http://10.247.78.184:9020/buck1/fo1 -v
Response:
> GET /buck1/fo1 HTTP/1.1
> User-Agent: curl/7.37.0
> Host: 10.247.78.184:9020
> Accept: */*
> Date: Wed, 29 Jan 2020 03:16:27 +0000
> Authorization: AWS user1:l6u2M9zQspTIwL2wrpGuM4O+tB8=
> x-fanout-copy-index:0
>
< HTTP/1.1 206 Partial Content
< Date: Wed, 29 Jan 2020 03:16:27 GMT
* Server ViPR/1.0 is not blacklisted
< Server: ViPR/1.0
< x-amz-request-id: 0af74eb8:16fef1759e4:80:1
< x-amz-id-2: 54baf9b41b37404e6d350a806473e5d4c7a0bb10612c1dd77157abb800b9eafa
< ETag: "48e10fc1163cd2c7db2bf9a4225cd5cd"
< fanout-copy-count: 5
< fanout-copy-size: 11
< Last-Modified: Wed, 29 Jan 2020 03:14:13 GMT
< x-emc-mtime: 1580267653773
< Content-Type: application/octet-stream
< Content-Length: 11
<
HELLOOO!!!
Operation name: Fanout object HEAD
Command:
./s3curl.pl --id=personal --ord --head http://<hostname>:9020/buck1/file1
Response:
HTTP/1.1 200 OK
Date: Wed, 04 Dec 2019 19:45:41 GMT
ETag: "48e10fc1163cd2c7db2bf9a4225cd5cd"
fanout-copy-count: 3
fanout-copy-size: 11
Last-Modified: Wed, 04 Dec 2019 19:35:38 GMT
x-emc-mtime: 1575488138240
Server: ViPR/1.0
x-amz-request-id: 0af74eb8:16ed21aaacd:92:d
x-amz-id-2: 834d1a548e92e0e2487b59a87f45c39b522ac30fffc3cf0d12d6ccaf77c04df7
Content-Type: application/octet-stream
Content-Length: 33
NOTE:
Fanout-copy-size is the size of each fanout copy.
Operation name: Fanout put copy
Command:
./s3curl.pl --id=personal --ord --copysrc=buck1/file1 -- -H "x-fanout-copy-index:0" http://<hostname>:9020/buck1/file2 -v
Response:
> PUT /buck1/file2 HTTP/1.1
> User-Agent: curl/7.37.0
> Host: 10.247.78.184:9020
> Accept: */*
> Date: Wed, 04 Dec 2019 21:11:58 +0000
> Authorization: AWS user1:4gpPVJWrAR1Dbh1LVO/HgK0n/2Y=
> x-amz-copy-source: buck1/file1
> x-fanout-copy-index:0
>
< HTTP/1.1 200 OK
< Date: Wed, 04 Dec 2019 21:11:58 GMT
* Server ViPR/1.0 is not blacklisted
< Server: ViPR/1.0
< x-amz-request-id: 0af74eb8:16ed21aaacd:126:1
< x-amz-id-2: f750866dcee769ae5e0702684e42f8b8c059f074e72e5b0d5ed907f3d6723c0b
< Content-Type: application/xml
< Content-Length: 222
<
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<CopyObjectResult xmlns="http://s3.amazonaws.com/doc/2006-03-01
<LastModified>2019-12-04T21:11:59.309Z</LastModified> <ETag>"1575493919143-"</ETag>
</CopyObjectResult>
NOTE: Fanout put copy is a deep copy operation.
Operation name: Fanout copy delete
Command:
./s3curl.pl --id=personal --ord --delete -- -H "x-fanout-copy-index:0" http://<hostname>:9020/buck1/file1 -v
Response:
> DELETE /buck1/file1 HTTP/1.1
> User-Agent: curl/7.37.0
> Host: 10.247.78.184:9020
> Accept: */*
> Date: Wed, 04 Dec 2019 21:19:52 +0000
> Authorization: AWS user1:KTtMUlRmnqa0IIDF7xA2lnWtVFc=
> x-fanout-copy-index:0
>
< HTTP/1.1 204 No Content
< Date: Wed, 04 Dec 2019 21:19:53 GMT
* Server ViPR/1.0 is not blacklisted
< Server: ViPR/1.0
< x-amz-request-id: 0af74eb8:16ed21aaacd:12c:1
< x-amz-id-2: 834d1a548e92e0e2487b59a87f45c39b522ac30fffc3cf0d12d6ccaf77c04df7
< x-emc-previous-object-size: 33
< Content-Length: 0
Operation name: Fanout object delete
Command:
./s3curl.pl --id=personal --ord --delete -- -H "x-fanout-delete-all:true" http://<hostname>:9020/buck1/file1 -v
Response:
> DELETE /buck1/file1 HTTP/1.1
> User-Agent: curl/7.37.0
> Host: 10.247.78.184:9020
> Accept: */*
> Date: Wed, 04 Dec 2019 21:22:44 +0000
> Authorization: AWS user1:hpuk6ElD8fHtRFJe/ozpH4ic/BY=
> x-fanout-delete-all:true
>
< HTTP/1.1 204 No Content
< Date: Wed, 04 Dec 2019 21:22:44 GMT
* Server ViPR/1.0 is not blacklisted
< Server: ViPR/1.0
< x-amz-request-id: 0af74eb8:16ed21aaacd:130:1
< x-amz-id-2: 834d1a548e92e0e2487b59a87f45c39b522ac30fffc3cf0d12d6ccaf77c04df7
< x-emc-previous-object-size: 22
< Content-Length: 0
Operation name: Fanout bucket listing
Command:
./s3curl.pl --id=personal --ord http://<hostname>:9020/vdc1_buck1?fanout | xmllint --format -
Response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<FanoutBucketListingResult>
<IsTruncated>false</IsTruncated>
<FanoutObjects>
<Key>file1</Key>
<Index>0</Index>
</FanoutObjects>
<FanoutObjects>
<Key>file1</Key>
<Index>1</Index>
</FanoutObjects>
<FanoutObjects>
<Key>file1</Key>
<Index>2</Index>
</FanoutObjects>
<FanoutObjects>
<Key>file1</Key>
<Index>3</Index>
</FanoutObjects>
<FanoutObjects>
<Key>file1</Key>
<Index>4</Index>
</FanoutObjects>
<FanoutObjects>
<Key>file2</Key>
<Index>0</Index>
</FanoutObjects>
<FanoutObjects>
<Key>file2</Key>
<Index>1</Index>
</FanoutObjects>
<FanoutObjects>
<Key>file2</Key>
<Index>2</Index>
</FanoutObjects>
<FanoutObjects>
<Key>file2</Key>
<Index>3</Index>
</FanoutObjects>
<FanoutObjects>
<Key>file2</Key>
<Index>4</Index>
</FanoutObjects>
</FanoutBucketListingResult>
Operation name: Regular bucket listing
Command:
./s3curl.pl --id=personal --ord http://<hostname>:9020/vdc1_buck1 | xmllint --format -
Response:
<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Name>vdc1_buck1</Name>
<Prefix/>
<Marker/>
<MaxKeys>1000</MaxKeys>
<IsTruncated>false</IsTruncated>
<ServerSideEncryptionEnabled>false</ServerSideEncryptionEnabled>
<Contents>
<Key>copyfile1</Key>
<LastModified>2019-12-14T22:44:22.386Z</LastModified>
<ETag>"1576363462360-"</ETag>
<Size>11</Size>
<StorageClass>STANDARD</StorageClass>
<Owner>
<ID>user1</ID>
<DisplayName>user1</DisplayName>
</Owner>
<IsFanoutObject>false</IsFanoutObject>
</Contents>
<Contents>
<Key>file1</Key>
<LastModified>2019-12-14T22:47:34.319Z</LastModified>
<ETag>"48e10fc1163cd2c7db2bf9a4225cd5cd"</ETag>
<Size>55</Size>
<StorageClass>STANDARD</StorageClass>
<Owner>
<ID>user1</ID>
<DisplayName>user1</DisplayName>
</Owner>
<IsFanoutObject>true</IsFanoutObject>
</Contents>
<Contents>
<Key>file2</Key>
<LastModified>2019-12-14T22:47:44.763Z</LastModified>
<ETag>"48e10fc1163cd2c7db2bf9a4225cd5cd"</ETag>
<Size>55</Size>
<StorageClass>STANDARD</StorageClass>
<Owner>
<ID>user1</ID>
<DisplayName>user1</DisplayName>
</Owner>
<IsFanoutObject>true</IsFanoutObject>
</Contents>
</ListBucketResult>
Operation name: Fanout bucket listing with max-keys
Command:
./s3curl.pl --id=personal --ord "http://<hostname>:9020/vdc1_buck1?fanout&max-keys=3" | xmllint --format -
Response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<FanoutBucketListingResult>
<NextFanoutKeyMarker>file1</NextFanoutKeyMarker>
<NextFanoutIndexMarker>2</NextFanoutIndexMarker>
<IsTruncated>true</IsTruncated>
<FanoutObjects>
<Key>file1</Key>
<Index>0</Index>
</FanoutObjects>
<FanoutObjects>
<Key>file1</Key>
<Index>1</Index>
</FanoutObjects>
<FanoutObjects>
<Key>file1</Key>
<Index>2</Index>
</FanoutObjects>
</FanoutBucketListingResult>
NOTE: The token is the last key in the result set.
Operation name: Fanout bucket listing with token
Command:
./s3curl.pl --id=personal --ord "http://<hostname>:9020/vdc1_buck1?fanout&max-keys=3&fanout-key-marker=file1&fanout-index-marker=2" | xmllint --format -
Response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<FanoutBucketListingResult>
<NextFanoutKeyMarker>file2</NextFanoutKeyMarker>
<NextFanoutIndexMarker>0</NextFanoutIndexMarker>
<IsTruncated>true</IsTruncated>
<FanoutObjects>
<Key>file1</Key>
<Index>3</Index>
</FanoutObjects>
<FanoutObjects>
<Key>file1</Key>
<Index>4</Index>
</FanoutObjects>
<FanoutObjects>
<Key>file2</Key>
<Index>0</Index>
</FanoutObjects>
</FanoutBucketListingResult>
Operation name: Fanout bucket listing with prefix
Command:
./s3curl.pl --id=personal --ord "http://<hostname>:9020/vdc1_buck1?fanout&max-keys=3&prefix=file2" | xmllint --format -
Response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<FanoutBucketListingResult>
<NextFanoutKeyMarker>file2</NextFanoutKeyMarker>
<NextFanoutIndexMarker>2</NextFanoutIndexMarker>
<IsTruncated>true</IsTruncated>
<FanoutPrefix>file2</FanoutPrefix>
<FanoutObjects>
<Key>file2</Key>
<Index>0</Index>
</FanoutObjects>
<FanoutObjects>
<Key>file2</Key>
<Index>1</Index>
</FanoutObjects>
<FanoutObjects>
<Key>file2</Key>
<Index>2</Index>
</FanoutObjects>
</FanoutBucketListingResult>
Operation name: Fanout bucket listing with delimiter
Command:
./s3curl.pl --id=personal --ord "http://<hostname>:9020/vdc1_buck1?fanout&delimiter=%2f&max-keys=3" | xmllint --format -
Response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<FanoutBucketListingResult>
<NextFanoutKeyMarker>file1</NextFanoutKeyMarker>
<NextFanoutIndexMarker>0</NextFanoutIndexMarker>
<IsTruncated>true</IsTruncated>
<Delimiter>/</Delimiter>
<FanoutObjects>
<Key>file1</Key>
<Index>0</Index>
</FanoutObjects>
<FanoutCommonPrefixes>
<FanoutPrefix>dir1/</FanoutPrefix>
</FanoutCommonPrefixes>
<FanoutCommonPrefixes>
<FanoutPrefix>dir2/</FanoutPrefix>
</FanoutCommonPrefixes>
</FanoutBucketListingResult>