Associating containers with unified file and object access storage policy

Use the following steps to associate a container with a unified file and object access storage policy.

  1. Associate a container with a unified file and object access storage policy using the following command.
    swift post container1  --os-auth-url http://specscaleswift.example.com:35357/v3 
    --os-project-name admin --os-project-domain-name Default --os-username admin 
    --os-user-domain-name Default --os-password Passw0rd --auth-version 3 
    --header "X-Storage-Policy: sof-policy1"

    In this swift post example, the storage policy is specified with the customized header X-Storage-Policy using the --header option.

  2. Upload an object in the container associated with the unified file and object access storage policy using the following command.
    swift upload container1 imageA.JPG --os-auth-url http://specscaleswift.example.com:35357/v3 
    --os-project-name admin --os-project-domain-name Default --os-username admin 
    --os-user-domain-name Default --os-password Passw0rd --auth-version 3
    object1
Note: The steps performed using swift commands can also be done using curl. For more information, see curl commands for unified file and object access related user tasks.