Versioning Examples

Versioning Examples

These examples show how to use cURL commands for working with versioning.

Enable Versioning on a Cluster

There are three ways to enable versioning at the cluster level:

  • Navigate to Storage UI > Settings > Cluster > policy versioning. Select the checkbox to allow versioning, which is by default disallowed in the cluster.

  • Use the below command where replace ‘password’ with the cluster's admin password.

    swarmctl -C policy.versioning -V allowed -d [node ip] -p "admin:password"
  • Use an SNMP set command, adjusted for the environment. Here, use a different password than the cluster’s admin password.

    snmpset -m +CARINGO-CASTOR-MIB -v2c -M +/usr/share/snmp/mib2c-data -c<snmp r/w community password> -OQs {cluster} clusterConfig.policyVersioning s "allowed"

Enable Versioning on a Domain

Set the Policy-Versioning header to enable versioning for an existing domain:

Enable versioning on an existing domain via Swarm
# curl -i --location-trusted -X PUT --data-binary '' -H "Policy-Versioning: enabled" "$NODEIP?domain=sample&preserve" HTTP/1.1 201 Created Castor-System-Cluster: [cluster] Location: http://192.168.203.190:80/?domain=sample Volume: 89d81040b7874fcfa139de754241bf8a Castor-System-Cluster: [cluster] Location: http://192.168.203.174:80/?domain=sample Volume: c561ae012e1ae663986bb0c6b5baa0de Stored-Digest: aaae8a6e741ae71ea7506b0ce42d37ad Last-Modified: Wed, 21 Dec 2022 15:46:18 GMT Content-UUID: 0cfe794730795e60f185ce3d0e81aa1d Entity-MD5: qq6KbnQa5x6nUGsM5C03rQ== Castor-System-Version: 1671637578.023 Etag: "af39faa06369ac30870c3e2b66a3b000" Castor-System-Alias: 0cfe794730795e60f185ce3d0e81aa1d Replica-Count: 2 Date: Wed, 21 Dec 2022 15:46:18 GMT Server: CAStor Cluster/15.0.0 Content-Length: 54 Content-Type: text/html Keep-Alive: timeout=14400 <html><body>New stream version created</body></html>
Enable versioning on an existing domain via Gateway

The rest of the examples will also be via Gateway as a best practice.

# curl -i -u admin:password -H 'Content-Type: application/castorcontext' -X PUT --data-binary '' -H "Policy-Versioning: enabled" "$GATEWAYIP?domain=sample2&preserve" HTTP/1.1 201 Created Date: Wed, 21 Dec 2022 16:10:11 GMT Gateway-Request-Id: DFBB0F9EB128E296 Server: CAStor Cluster/15.0.0 Via: 1.1 10.1.1.194 (Cloud Gateway SCSP/7.10.1) Gateway-Protocol: scsp Castor-System-Cluster: [cluster] Location: http://10.1.1.194:80/?domain=sample2 Volume: c561ae012e1ae663986bb0c6b5baa0de Castor-System-Cluster: [cluster] Volume: 66be989fe273740f6bc97f9be4ea9c94 Entity-MD5: 66+MUvedXG6wbxmTw7Dd3g== Content-UUID: eebe5c4bdeb252c86828d94da0de0d16 Last-Modified: Wed, 21 Dec 2022 16:10:11 GMT Stored-Digest: ebaf8c52f79d5c6eb06f1993c3b0ddde Content-MD5: 1B2M2Y8AsgTpgAmY7PhCfg== Castor-System-Version: 1671639011.138 ETag: "49b2e909daa86020c58eab806ddd1ad1" Castor-System-Alias: eebe5c4bdeb252c86828d94da0de0d16 Replica-Count: 2 Content-Type: text/html Content-Length: 54 <html><body>New stream version created</body></html>

Review the headers returned to verify the versioning state for a domain:

# curl -si -u admin:password -I "$GATEWAYIP?domain=sample2" | grep Versioning Policy-Versioning: enabled Policy-Versioning-Evaluated: enabled Policy-Versioning-Evaluated-Constrained: no Policy-Versioning-Unnamed-Evaluated: disabled Policy-Versioning-Unnamed-Evaluated-Constrained: no

Notice Policy-Version-Evaluated is enabled. All tenanted alias objects in the domain are versioned.

Enable Versioning on a Bucket

# curl -i -u admin:password -X PUT --data-binary '' -H 'Content-Type: application/castorcontext' -H "Policy-Versioning: enabled" "$GATEWAYIP/mybucket?domain=sample2&preserve" HTTP/1.1 201 Created Date: Wed, 21 Dec 2022 20:49:34 GMT Gateway-Request-Id: 5D330C6C47BC1FAE Server: CAStor Cluster/15.0.0 Via: 1.1 10.1.1.194 (Cloud Gateway SCSP/7.10.1) Gateway-Protocol: scsp Castor-System-Cluster: [cluster] Location: http://10.1.1.194:80/mybucket?domain=sample2 Volume: e9b1c7c95951dda0457da891311b295e Castor-System-Cluster: [cluster] Volume: 66be989fe273740f6bc97f9be4ea9c94 Stored-Digest: a9006f97c09bc19f8e7d87a6f95ac7b5 Entity-MD5: qQBvl8CbwZ+OfYem+VrHtQ== Last-Modified: Wed, 21 Dec 2022 20:49:34 GMT Content-UUID: b443e93b52178fb23388ec45c2ac2def Content-MD5: 1B2M2Y8AsgTpgAmY7PhCfg== Castor-System-Version: 1671655774.096 ETag: "7a5d13e0f28914bf5ca9aab7f1a3722b" Castor-System-Alias: b443e93b52178fb23388ec45c2ac2def Replica-Count: 2 Content-Type: text/html Content-Length: 54 <html><body>New stream version created</body></html>

Verify the versioning state of the bucket:

# curl -si -uadmin:password -I "$GATEWAYIP/mybucket?domain=sample2" | grep -i Policy-Versioning Policy-Versioning: enabled Policy-Versioning-Evaluated: enabled Policy-Versioning-Evaluated-Constrained: no

Notice Policy-Version-Evaluated is also enabled. All named objects in the bucket are versioned.

Create a Named Object in the Bucket

This request has typical headers.

# curl -si -uadmin:password -X POST --post301 --data-binary "<html><body>First version's content.</body></html>" -H 'Content-type: text/html' "$GATEWAYIP/mybucket/hello%20world.html?domain=sample2" HTTP/1.1 201 Created Date: Wed, 21 Dec 2022 22:40:10 GMT Gateway-Request-Id: DB5421FA96C99A98 Server: CAStor Cluster/15.0.0 Via: 1.1 10.1.1.194 (Cloud Gateway SCSP/7.10.1) Gateway-Protocol: scsp Castor-System-Cluster: [cluster] Location: http://10.1.1.194:80/mybucket/hello%20world.html?domain=sample2 Volume: c561ae012e1ae663986bb0c6b5baa0de Castor-System-Cluster: [cluster] Volume: 66be989fe273740f6bc97f9be4ea9c94 Stored-Digest: e4b22c28f2f6cc0eaff4946ac5ded872 Entity-MD5: 5LIsKPL2zA6v9JRqxd7Ycg== Last-Modified: Wed, 21 Dec 2022 22:40:10 GMT Content-MD5: b6t5pSGMP6IKdfDUN5fSKA== Castor-System-Version: 1671662410.687 ETag: "e98dabd2f4c7a6c3cdd84ae139112fe2" Replica-Count: 2 Content-Type: text/html Content-Length: 46 <html><body>New stream created</body></html>

Verify the new object:

# curl -i "http://$GATEWAYIP:80/mybucket/hello%20world.html?domain=sample2" HTTP/1.1 200 OK Date: Wed, 21 Dec 2022 22:42:13 GMT Gateway-Request-Id: CDDA321C42C8C9B9 Server: CAStor Cluster/15.0.0 Via: 1.1 10.1.1.194 (Cloud Gateway SCSP/7.10.1) Gateway-Protocol: scsp Castor-System-CID: b443e93b52178fb23388ec45c2ac2def Castor-System-Cluster: [cluster] Castor-System-Created: Wed, 21 Dec 2022 22:40:10 GMT Castor-System-IsVersioned: True Castor-System-Name: hello%20world.html Castor-System-Version: 1671662410.687 Content-Type: text/html Last-Modified: Wed, 21 Dec 2022 22:40:10 GMT X-Last-Modified-By-Meta: admin@ X-Owner-Meta: admin Castor-System-Path: /sample2/mybucket/hello%20world.html Castor-System-Domain: sample2 Volume: 66be989fe273740f6bc97f9be4ea9c94 Volume-Hint: c561ae012e1ae663986bb0c6b5baa0de Feed-0-Status: 0 Feed-0-StatusTime: Wed, 21 Dec 2022 22:40:11 GMT MinReps: 2 Policy-Versioning-Evaluated: enabled Policy-Versioning-Evaluated-Constrained: no Policy-ECMinStreamSize-Evaluated: 1000000 Policy-ECMinStreamSize-Evaluated-Constrained: yes Policy-ECEncoding-Evaluated: 2:1 Policy-ECEncoding-Evaluated-Constrained: disabled,k:p (k+p <= 16, p >= 1) Policy-Replicas-Evaluated: min:2 max:16 default:2 Policy-Replicas-Evaluated-Constrained: yes Policy-Lifecycle-Evaluated: disabled Policy-Lifecycle-Evaluated-Constrained: yes Content-MD5: b6t5pSGMP6IKdfDUN5fSKA== Castor-System-Persisted-Headers: x-last-modified-by-meta, content-md5, x-owner-meta, content-type, content-length ETag: "e98dabd2f4c7a6c3cdd84ae139112fe2" Content-Length: 50 <html><body>First version's content.</body></html>

List Versions in the Bucket

Elasticsearch must be enabled to use listing operations. 

Tip

Always add &sort=tmborn:DESC,etag:DESC to listing operations to retrieve the versions in the precise order Swarm is maintaining, starting with the current version.

# curl -i "http://$GATEWAYIP/mybucket?domain=sample2&format=json&name=hello%20world.html&versions&sort=tmborn:DESC,etag:DESC" HTTP/1.1 200 OK Date: Wed, 21 Dec 2022 23:06:24 GMT Gateway-Request-Id: ED556FDB95E491A4 Server: CAStor Cluster/15.0.0 Via: 1.1 10.1.1.194 (Cloud Gateway SCSP/7.10.1) Gateway-Protocol: scsp Allow-Encoding: *;q=0 Castor-System-Alias: b443e93b52178fb23388ec45c2ac2def Castor-System-CID: eebe5c4bdeb252c86828d94da0de0d16 Castor-System-Cluster: [cluster] Castor-System-Created: Wed, 21 Dec 2022 20:49:34 GMT Castor-System-Name: mybucket Castor-System-Version: 1671655774.096 Policy-Versioning: enabled X-Last-Modified-By-Meta: admin@ X-Owner-Meta: admin X-Timestamp: Wed, 21 Dec 2022 20:49:34 GMT X-timestamp: Wed, 21 Dec 2022 23:06:24 GMT Content-Type: application/json;charset=utf-8 Castor-Object-Count: 1 Castor-System-Object-Count: 1 Last-Modified: Wed, 21 Dec 2022 23:06:24 GMT Transfer-Encoding: chunked [ {"last_modified": "2022-12-21T22:40:10.684000Z", "bytes": 50, "versioned": "true", "name": "hello world.html", "hash": "e98dabd2f4c7a6c3cdd84ae139112fe2", "written": "2022-12-21T22:40:10.684000Z", "accessed": "2022-12-21T22:40:10.684000Z", "content_type": "text/html"} ]

Update the Named Object (Updated Twice, Only Once Shown)

# curl -si -uadmin:password -X PUT --post301 --data-binary "<html><body>Second version's content.</body></html>" "$GATEWAYIP/mybucket/hello%20world.html?domain=sample2&preserve" HTTP/1.1 201 Created Date: Wed, 21 Dec 2022 23:11:35 GMT Gateway-Request-Id: 9EAD2CBB3F9369D2 Server: CAStor Cluster/15.0.0 Via: 1.1 10.1.1.194 (Cloud Gateway SCSP/7.10.1) Gateway-Protocol: scsp Castor-System-Cluster: [cluster] Location: http://10.1.1.194:80/mybucket/hello%20world.html?domain=sample2 Volume: d4504566ed67a87859434ac3c50bfbe0 Castor-System-Cluster: [cluster] Volume: c561ae012e1ae663986bb0c6b5baa0de Stored-Digest: 4e03ba04fe79174a2917224ba563b76f Last-Modified: Wed, 21 Dec 2022 23:11:34 GMT Entity-MD5: TgO6BP55F0opFyJLpWO3bw== Content-MD5: 1CUcVg3EvQ/iY+jeluDZwA== Castor-System-Version: 1671664294.839 ETag: "46fdddc9896e3f4800587e146f17143b" Replica-Count: 2 Content-Type: text/html Content-Length: 54 <html><body>New stream version created</body></html>

Verify the change to the named object:

# curl -i "http://$GATEWAYIP/mybucket/hello%20world.html?domain=sample2" HTTP/1.1 200 OK Date: Thu, 22 Dec 2022 03:49:37 GMT Gateway-Request-Id: 2ACB41593842C0D9 Server: CAStor Cluster/15.0.0 Via: 1.1 10.1.1.194 (Cloud Gateway SCSP/7.10.1) Gateway-Protocol: scsp Castor-System-CID: b443e93b52178fb23388ec45c2ac2def Castor-System-Cluster: [cluster] Castor-System-Created: Wed, 21 Dec 2022 23:13:12 GMT Castor-System-IsVersioned: True Castor-System-Name: hello%20world.html Castor-System-Version: 1671664392.715 Last-Modified: Wed, 21 Dec 2022 23:13:12 GMT X-Last-Modified-By-Meta: caringoadmin@ Content-Type: text/html x-owner-meta: admin ETag: "3e4beb34f333637de16abc33bf01656b" Castor-System-Path: /sample2/mybucket/hello%20world.html Castor-System-Domain: sample2 Volume: 89d81040b7874fcfa139de754241bf8a Content-MD5: 1CUcVg3EvQ/iY+jeluDZwA== Content-Length: 51 <html><body>Second version's content.</body></html>

View the New Version in the Listing

# curl -i "http://$GATEWAYIP/mybucket?domain=sample2&format=json&name=hello%20world.html&versions&sort=tmborn:DESC,etag:DESC" HTTP/1.1 200 OK Date: Thu, 22 Dec 2022 03:50:15 GMT Gateway-Request-Id: 7DA849568377ABF5 Server: CAStor Cluster/15.0.0 Via: 1.1 10.1.1.194 (Cloud Gateway SCSP/7.10.1) Gateway-Protocol: scsp Allow-Encoding: *;q=0 Castor-System-Alias: b443e93b52178fb23388ec45c2ac2def Castor-System-CID: eebe5c4bdeb252c86828d94da0de0d16 Castor-System-Cluster: [cluster] Castor-System-Created: Wed, 21 Dec 2022 20:49:34 GMT Castor-System-Name: mybucket Castor-System-Version: 1671655774.096 Policy-Versioning: enabled X-Last-Modified-By-Meta: admin@ X-Owner-Meta: admin X-Timestamp: Wed, 21 Dec 2022 20:49:34 GMT X-timestamp: Thu, 22 Dec 2022 03:50:15 GMT Content-Type: application/json;charset=utf-8 Castor-Object-Count: 3 Castor-System-Object-Count: 3 Last-Modified: Thu, 22 Dec 2022 03:50:15 GMT Transfer-Encoding: chunked [ {"last_modified": "2022-12-21T23:13:12.712000Z", "bytes": 51, "versioned": "true", "name": "hello world.html", "hash": "3e4beb34f333637de16abc33bf01656b", "written": "2022-12-21T23:13:12.712000Z", "accessed": "2022-12-21T23:13:12.712000Z", "content_type": "text/html"}, {"last_modified": "2022-12-21T23:11:34.836000Z", "bytes": 51, "versioned": "true", "name": "hello world.html", "hash": "46fdddc9896e3f4800587e146f17143b", "written": "2022-12-21T23:11:34.836000Z", "accessed": "2022-12-21T23:11:34.836000Z", "content_type": "application/x-www-form-urlencoded", "version": "46fdddc9896e3f4800587e146f17143b"}, {"last_modified": "2022-12-21T22:40:10.684000Z", "bytes": 50, "versioned": "true", "name": "hello world.html", "hash": "e98dabd2f4c7a6c3cdd84ae139112fe2", "written": "2022-12-21T22:40:10.684000Z", "accessed": "2022-12-21T22:40:10.684000Z", "content_type": "text/html", "version": "e98dabd2f4c7a6c3cdd84ae139112fe2"} ]

Read the First Version-Notice the Content

[root@c-scs2 ~]# curl -i "http://$GATEWAYIP/mybucket/hello%20world.html?domain=sample2&version=e98dabd2f4c7a6c3cdd84ae139112fe2" HTTP/1.1 200 OK Date: Thu, 22 Dec 2022 04:09:30 GMT Gateway-Request-Id: 170D625BE7343EFC Server: CAStor Cluster/15.0.0 Via: 1.1 10.1.1.194 (Cloud Gateway SCSP/7.10.1) Gateway-Protocol: scsp Castor-System-CID: b443e93b52178fb23388ec45c2ac2def Castor-System-Cluster: [cluster] Castor-System-Created: Wed, 21 Dec 2022 22:40:10 GMT Castor-System-IsVersioned: True Castor-System-Name: hello%20world.html Castor-System-Version: 1671662410.687 Content-Type: text/html Last-Modified: Wed, 21 Dec 2022 22:40:10 GMT X-Last-Modified-By-Meta: admin@ X-Owner-Meta: admin ETag: "e98dabd2f4c7a6c3cdd84ae139112fe2" Castor-System-Path: /sample2/mybucket/hello%20world.html Castor-System-Domain: sample2 Volume: c561ae012e1ae663986bb0c6b5baa0de Content-MD5: b6t5pSGMP6IKdfDUN5fSKA== Content-Length: 50 <html><body>First version's content.</body></html>

Delete the Prior Version

Deleting that historical version permanently erases it:

# curl -i -X DELETE "http://$GATEWAYIP/mybucket/hello%20world.html?domain=sample2&version=e98dabd2f4c7a6c3cdd84ae139112fe2" HTTP/1.1 200 OK Date: Thu, 22 Dec 2022 04:17:44 GMT Gateway-Request-Id: BD12E54ED7BE6E5C Server: CAStor Cluster/15.0.0 Via: 1.1 10.1.1.194 (Cloud Gateway SCSP/7.10.1) Gateway-Protocol: scsp Castor-System-CID: b443e93b52178fb23388ec45c2ac2def Castor-System-Cluster: [cluster] Castor-System-Created: Wed, 21 Dec 2022 22:40:10 GMT Castor-System-IsVersioned: True Castor-System-Name: hello%20world.html Castor-System-Version: 1671662410.687 Content-Type: text/html Last-Modified: Wed, 21 Dec 2022 22:40:10 GMT X-Last-Modified-By-Meta: admin@ X-Owner-Meta: admin ETag: "e98dabd2f4c7a6c3cdd84ae139112fe2" Castor-System-Path: /sample2/mybucket/hello%20world.html Castor-System-Domain: sample2 Volume: c561ae012e1ae663986bb0c6b5baa0de Content-Length: 0

List the versions again to verify the deletion:

# curl -i "http://$GATEWAYIP/mybucket?domain=sample2&format=json&name=hello%20world.html&versions&sort=tmborn:DESC,etag:DESC" HTTP/1.1 200 OK Date: Thu, 22 Dec 2022 04:18:13 GMT Gateway-Request-Id: BC7BB8A927B13301 Server: CAStor Cluster/15.0.0 Via: 1.1 10.1.1.194 (Cloud Gateway SCSP/7.10.1) Gateway-Protocol: scsp Allow-Encoding: *;q=0 Castor-System-Alias: b443e93b52178fb23388ec45c2ac2def Castor-System-CID: eebe5c4bdeb252c86828d94da0de0d16 Castor-System-Cluster: [cluster] Castor-System-Created: Wed, 21 Dec 2022 20:49:34 GMT Castor-System-Name: mybucket Castor-System-Version: 1671655774.096 Policy-Versioning: enabled X-Last-Modified-By-Meta: admin@ X-Owner-Meta: admin X-Timestamp: Wed, 21 Dec 2022 20:49:34 GMT X-timestamp: Thu, 22 Dec 2022 04:18:13 GMT Content-Type: application/json;charset=utf-8 Castor-Object-Count: 2 Castor-System-Object-Count: 2 Last-Modified: Thu, 22 Dec 2022 04:18:13 GMT Transfer-Encoding: chunked [ {"last_modified": "2022-12-21T23:13:12.712000Z", "bytes": 51, "versioned": "true", "name": "hello world.html", "hash": "3e4beb34f333637de16abc33bf01656b", "written": "2022-12-21T23:13:12.712000Z", "accessed": "2022-12-21T23:13:12.712000Z", "content_type": "text/html"}, {"last_modified": "2022-12-21T23:11:34.836000Z", "bytes": 51, "versioned": "true", "name": "hello world.html", "hash": "46fdddc9896e3f4800587e146f17143b", "written": "2022-12-21T23:11:34.836000Z", "accessed": "2022-12-21T23:11:34.836000Z", "content_type": "application/x-www-form-urlencoded", "version": "46fdddc9896e3f4800587e146f17143b"} ]

Delete the Current Version

Deleting the current version adds a delete marker:

# curl -i -X DELETE "http://$GATEWAYIP/mybucket/hello%20world.html?domain=sample2" HTTP/1.1 200 OK Date: Thu, 22 Dec 2022 04:23:03 GMT Gateway-Request-Id: 21713A8E6BA4DB52 Server: CAStor Cluster/15.0.0 Via: 1.1 10.1.1.194 (Cloud Gateway SCSP/7.10.1) Gateway-Protocol: scsp Castor-System-CID: b443e93b52178fb23388ec45c2ac2def Castor-System-Cluster: [cluster] Castor-System-Created: Wed, 21 Dec 2022 23:13:12 GMT Castor-System-IsVersioned: True Castor-System-Name: hello%20world.html Castor-System-Version: 1671664392.715 Last-Modified: Wed, 21 Dec 2022 23:13:12 GMT X-Last-Modified-By-Meta: caringoadmin@ Content-Type: text/html x-owner-meta: admin ETag: "3e4beb34f333637de16abc33bf01656b" Castor-System-Path: /sample2/mybucket/hello%20world.html Castor-System-Domain: sample2 Volume: e9b1c7c95951dda0457da891311b295e Castor-System-Delete-Marker-Etag: "771fc52c3e3b8171ad7e6e064ef31f43" Content-Length: 0

Listing the versions shows the addition of a new version, the delete marker:

# curl -i "http://$GATEWAYIP/mybucket?domain=sample2&format=json&name=hello%20world.html&versions&sort=tmborn:DESC,etag:DESC" HTTP/1.1 200 OK Date: Thu, 22 Dec 2022 04:23:45 GMT Gateway-Request-Id: B78CD72BE8C06C20 Server: CAStor Cluster/15.0.0 Via: 1.1 10.1.1.194 (Cloud Gateway SCSP/7.10.1) Gateway-Protocol: scsp Allow-Encoding: *;q=0 Castor-System-Alias: b443e93b52178fb23388ec45c2ac2def Castor-System-CID: eebe5c4bdeb252c86828d94da0de0d16 Castor-System-Cluster: [cluster] Castor-System-Created: Wed, 21 Dec 2022 20:49:34 GMT Castor-System-Name: mybucket Castor-System-Version: 1671655774.096 Policy-Versioning: enabled X-Last-Modified-By-Meta: admin@ X-Owner-Meta: admin X-Timestamp: Wed, 21 Dec 2022 20:49:34 GMT X-timestamp: Thu, 22 Dec 2022 04:23:45 GMT Content-Type: application/json;charset=utf-8 Castor-Object-Count: 3 Castor-System-Object-Count: 3 Last-Modified: Thu, 22 Dec 2022 04:23:45 GMT Transfer-Encoding: chunked [ {"deletemarker": "true", "last_modified": "2022-12-22T04:23:03.768000Z", "bytes": 0, "versioned": "true", "name": "hello world.html", "hash": "771fc52c3e3b8171ad7e6e064ef31f43", "written": "2022-12-22T04:23:03.768000Z", "accessed": "2022-12-22T04:23:03.768000Z"}, {"last_modified": "2022-12-21T23:13:12.712000Z", "bytes": 51, "versioned": "true", "name": "hello world.html", "hash": "3e4beb34f333637de16abc33bf01656b", "written": "2022-12-21T23:13:12.712000Z", "accessed": "2022-12-21T23:13:12.712000Z", "version": "3e4beb34f333637de16abc33bf01656b", "content_type": "text/html"}, {"last_modified": "2022-12-21T23:11:34.836000Z", "bytes": 51, "versioned": "true", "name": "hello world.html", "hash": "46fdddc9896e3f4800587e146f17143b", "written": "2022-12-21T23:11:34.836000Z", "accessed": "2022-12-21T23:11:34.836000Z", "version": "46fdddc9896e3f4800587e146f17143b", "content_type": "application/x-www-form-urlencoded"} ]

Notice the delete marker has the same name but is 0 bytes and has "deletemarker":"true".

Check the Delete Marker

Getting INFO on the current version (the delete marker) results in a 404 Not Found error, but provides information about the delete marker:

# curl -iI "http://$GATEWAYIP/mybucket/hello%20world.html?domain=sample2" HTTP/1.1 404 Not Found Date: Thu, 22 Dec 2022 04:24:51 GMT Gateway-Request-Id: 7BF3F53FBCB1CC86 Server: CAStor Cluster/15.0.0 Via: 1.1 10.1.1.194 (Cloud Gateway SCSP/7.10.1) Gateway-Protocol: scsp Last-Modified: Thu, 22 Dec 2022 04:23:03 GMT ETag: "771fc52c3e3b8171ad7e6e064ef31f43" Castor-System-Error-Token: NotFoundMarker Castor-System-Error-Text: Versioned object has a delete marker. Castor-System-Error-Code: 404 Castor-System-Cluster: [cluster] Allow: POST, GET, HEAD, PUT, DELETE, COPY, APPEND, PATCH, GEN, SEND Content-Length: 0

Note the ETag (version ID) of the delete marker is returned.

© DataCore Software Corporation. · https://www.datacore.com · All rights reserved.