Ask Your Question

How can I get swift user and api_key ?

asked 2016-12-01 07:38:35 -0500

anonymous user


When I deployed openstack swift , I want to test it. I run swift -h, in the help, there is a command like this swift -A -U user -K api_key stat -v, but I don't know the user and 'api_key'.

Then I source the rc file, I run 'swift stat -v', I got this information: StorageURL: Auth Token: a2312321a63b4cd1bdd4a798c040177d Account: AUTH_54af7dd578994f988d6aaaee51144eac Containers: 4 Objects: 11 Bytes: 742944036 Containers in policy "policy-0": 4 Objects in policy "policy-0": 11 Bytes in policy "policy-0": 742944036 X-Account-Project-Domain-Id: default X-Timestamp: 1480568997.29798 X-Trans-Id: tx80a31476a2cb4c8e9fc9b-005840270a Content-Type: text/plain; charset=utf-8 Accept-Ranges: bytes

I run 'swift auth', I got this information:

export OS_STORAGE_URL= export OS_AUTH_TOKEN=9f0b357da0ed4556abb8a60d30d95cb9

I run 'swift auth -v', I got this information: export OS_IDENTITY_API_VERSION=3 export OS_AUTH_VERSION=3 export OS_AUTH_URL= export OS_PASSWORD=abc123 export OS_PROJECT_DOMAIN_NAME=default export OS_PROJECT_NAME=admin export OS_TENANT_NAME=admin export OS_USER_DOMAIN_NAME=default export OS_USERNAME=admin

Can anyone tell me which is user and api_key ?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2016-12-05 17:26:50 -0500

vern gravatar image

Your username is admin (OS_USERNAME) and your api_key is abc123 (OS_PASSWORD).

As a clarification, -U user -K api_key is v1 authentication. When you source your openstack rc file, you're effectively using --os-auth-url $OS_AUTH_URL --os-username $OS_USERNAME --os-password $OS_PASSWORD --os-tenant-name $OS_TENANT_NAME which causes swift to use v2 authentication (which basically includes the tenant) and is the way swift does authentication when installed with OpenStack.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2016-12-01 07:38:35 -0500

Seen: 169 times

Last updated: Dec 05 '16