curl commands for unified file and object access related user tasks
Use the following curl commands for user tasks that are 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 is generated.
- A unified file and object access storage policy that is named SwiftOnFileFS is already created.
Create a container that is named unified_access with unified file and object access storage policy by running the curl command 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) by using the container unified_access that is created with SwiftOnFileFS as the storage policy.
Upload an object in the container that is associated with the unified file and object access storage policy by running the curl command 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 the object that is in the unified file and object access container by running the curl command 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 by running the curl command as follows:
curl -v -i -H "X-Auth-Token: $AUTH_TOKEN" -X GET http://specscaleswift.example.com:8080/v1/AUTH_cd1a29013b6842939a959dbda95835df /unified_access/