curl commands for unified file and object access related user tasks
The following are the curl commands for performing user tasks related to unified file and object access.
For the following commands, it is assumed that:
- A token is generated and it is exported as an environment variable auth_token.
- A swift endpoint URL for the project (tenant) for which token has been generated.
- A unified file and object access storage policy named SwiftOnFileFS is already created.
Create a container named unified_access with unified file and object access storage policy using curl as follows.
curl -v -i -H "X-Auth-Token: $auth_token" -X PUT http://specscaleswift.example.com:8080/v1/AUTH_cd1a29013b6842939a959dbda95835df/unified_access/ -H "X-Storage-Policy: SwiftOnFileFS"
In this command, http://specscaleswift.example.com:8080/v1/AUTH_cd1a29013b6842939a959dbda95835df/ is the endpoint URL for a project (tenant) using which a container unified_access is created with SwiftOnFileFS as the storage policy.
Upload an object in the container associated with the unified file and object access storage policy using curl as follows.
curl -v -i -H "X-Auth-Token: $auth_token" -X PUT http://specscaleswift.example.com:8080/v1/AUTH_cd1a29013b6842939a959dbda95835df /unified_access/object1 --data-binary @imageA.jpg
Download object residing in the unified file and object access container using curl as follows.
curl -v -i -H "X-Auth-Token: $auth_token" -X GET http://specscaleswift.example.com:8080/v1/AUTH_cd1a29013b6842939a959dbda95835df /unified_access/samplefile.txt
List the contents of the unified file and object access container using curl as follows.
curl -v -i -H "X-Auth-Token: $auth_token" -X GET http://specscaleswift.example.com:8080/v1/AUTH_cd1a29013b6842939a959dbda95835df /unified_access/