Home > openstack, Uncategorized > Retrieve Swift URL and Swift Token

Retrieve Swift URL and Swift Token

export TOKEN=`keystone token-get | grep id | head -n 1 | awk ‘{print $4}’`
s_url=`keystone –os-username=admin –os-password=nova endpoint-list | grep AUTH_ | awk ‘{print $6}’ | sed ‘s/\$(tenant_id)s//’`

tenant_id=`keystone –os-username=admin –os-password=nova tenant-get $OS_TENANT_NAME | grep id | awk ‘{print $4}’`

export STORAGE_URL=$s_url$tenant_id

 

**** Explanation **** :

 

# Get token with this command:

export TOKEN=`keystone token-get | grep id | head -n 1 | awk ‘{print $4}’`

#Getting Swift storage URL is two steps process:

 

#Step 1: get the Swift end point without tenant/account specified:
s_url=`keystone –os-username=admin –os-password=nova endpoint-list | grep AUTH_ | awk ‘{print $6}’ | sed ‘s/\$(tenant_id)s//’`

#Step 2: find tenant name

tenant_id=`keystone –os-username=admin –os-password=nova tenant-get $OS_TENANT_NAME | grep id | awk ‘{print $4}’`

#step 3: contant step1 and step2 value.
export STORAGE_URL=$s_url$tenant_id

Advertisements
Categories: openstack, Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: