Test Swift REST API configuration
You can use the Swift CLI to test your connection to the StorageGRID system and to verify that you can read and write objects.
-
You have downloaded and installed the Swift command-line client: SwiftStack: python-swiftclient
-
Optionally, you have created a load balancer endpoint. Otherwise, you know the IP address of the Storage Node you want to connect to and the port number to use. See IP addresses and ports for client connections.
-
You have created a Swift tenant account.
-
You have signed in to the tenant account and created at least one group and user. See Create groups for a Swift tenant.
Swift tenant users must have the Administrator group permission to authenticate into the Swift REST API.
If you have not configured security, you must add the --insecure
flag to each of these commands.
-
Query the info URL for your StorageGRID Swift deployment:
swift -U <Tenant_Account_ID:Account_User_Name> -K <User_Password> -A https://<FQDN | IP>:<Port>/info capabilities
This is sufficient to test that your Swift deployment is functional. To further test account configuration by storing an object, continue with the additional steps.
-
Put an object in the container:
touch test_object swift -U <Tenant_Account_ID:Account_User_Name> -K <User_Password> -A https://<FQDN | IP>:<Port>/auth/v1.0 upload test_container test_object --object-name test_object
-
Get the container to verify the object:
swift -U <Tenant_Account_ID:Account_User_Name> -K <User_Password> -A https://<FQDN | IP>:<Port>/auth/v1.0 list test_container
-
Delete the object:
swift -U <Tenant_Account_ID:Account_User_Name> -K <User_Password> -A https://<FQDN | IP>:<Port>/auth/v1.0 delete test_container test_object
-
Delete the container:
swift -U `<_Tenant_Account_ID:Account_User_Name_>` -K `<_User_Password_>` -A `\https://<_FQDN_ | _IP_>:<_Port_>/auth/v1.0' delete test_container