Add root request for image
This commit is contained in:
@@ -149,7 +149,8 @@ module Aviator
|
||||
|
||||
elsif session_data.has_key? :access
|
||||
service_spec = session_data[:access][:serviceCatalog].find{|s| s[:type] == service }
|
||||
service_spec[:endpoints][0][:publicURL].match(/(v\d+)\.?\d*/)[1].to_sym
|
||||
version = service_spec[:endpoints][0][:publicURL].match(/(v\d+)\.?\d*/)
|
||||
version ? version[1].to_sym : :v1
|
||||
end
|
||||
end
|
||||
|
||||
@@ -185,4 +186,4 @@ module Aviator
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
34
lib/aviator/openstack/image/v1/public/root.rb
Normal file
34
lib/aviator/openstack/image/v1/public/root.rb
Normal file
@@ -0,0 +1,34 @@
|
||||
module Aviator
|
||||
|
||||
define_request :root do
|
||||
|
||||
meta :provider, :openstack
|
||||
meta :service, :image
|
||||
meta :api_version, :v1
|
||||
meta :endpoint_type, :public
|
||||
|
||||
def headers
|
||||
h = {}
|
||||
|
||||
unless self.anonymous?
|
||||
h['X-Auth-Token'] = session_data[:access][:token][:id]
|
||||
end
|
||||
|
||||
h
|
||||
end
|
||||
|
||||
|
||||
def http_method
|
||||
:get
|
||||
end
|
||||
|
||||
|
||||
def url
|
||||
service_spec = session_data[:access][:serviceCatalog].find{|s| s[:type] == service.to_s }
|
||||
uri = URI(service_spec[:endpoints][0][:publicURL])
|
||||
"#{ uri.scheme }://#{ uri.host }:#{ uri.port.to_s }/v1/"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
106
test/aviator/openstack/image/v1/public/root_test.rb
Normal file
106
test/aviator/openstack/image/v1/public/root_test.rb
Normal file
@@ -0,0 +1,106 @@
|
||||
require 'test_helper'
|
||||
|
||||
class Aviator::Test
|
||||
|
||||
describe 'aviator/openstack/image/v1/public/root' do
|
||||
|
||||
def create_request(session_data = get_session_data)
|
||||
klass.new(session_data)
|
||||
end
|
||||
|
||||
|
||||
def get_session_data
|
||||
session.send :auth_info
|
||||
end
|
||||
|
||||
|
||||
def helper
|
||||
Aviator::Test::RequestHelper
|
||||
end
|
||||
|
||||
|
||||
def klass
|
||||
@klass ||= helper.load_request('openstack', 'image', 'v1', 'public', 'root.rb')
|
||||
end
|
||||
|
||||
|
||||
def session
|
||||
unless @session
|
||||
@session = Aviator::Session.new(
|
||||
config_file: Environment.path,
|
||||
environment: 'openstack_member'
|
||||
)
|
||||
@session.authenticate
|
||||
end
|
||||
|
||||
@session
|
||||
end
|
||||
|
||||
|
||||
validate_attr :anonymous? do
|
||||
klass.anonymous?.must_equal false
|
||||
end
|
||||
|
||||
|
||||
validate_attr :api_version do
|
||||
klass.api_version.must_equal :v1
|
||||
end
|
||||
|
||||
|
||||
validate_attr :body do
|
||||
request = create_request
|
||||
|
||||
klass.body?.must_equal false
|
||||
request.body?.must_equal false
|
||||
end
|
||||
|
||||
|
||||
validate_attr :endpoint_type do
|
||||
klass.endpoint_type.must_equal :public
|
||||
end
|
||||
|
||||
|
||||
validate_attr :headers do
|
||||
headers = { 'X-Auth-Token' => get_session_data[:access][:token][:id] }
|
||||
|
||||
request = create_request
|
||||
|
||||
request.headers.must_equal headers
|
||||
end
|
||||
|
||||
|
||||
validate_attr :http_method do
|
||||
create_request.http_method.must_equal :get
|
||||
end
|
||||
|
||||
|
||||
validate_attr :optional_params do
|
||||
klass.optional_params.must_equal []
|
||||
end
|
||||
|
||||
|
||||
validate_attr :required_params do
|
||||
klass.required_params.must_equal []
|
||||
end
|
||||
|
||||
|
||||
validate_attr :url do
|
||||
service_spec = get_session_data[:access][:serviceCatalog].find{|s| s[:type] == 'image' }
|
||||
uri = URI(service_spec[:endpoints][0][:publicURL])
|
||||
url = "#{ uri.scheme }://#{ uri.host }:#{ uri.port.to_s }/v1/"
|
||||
|
||||
create_request.url.must_equal url
|
||||
end
|
||||
|
||||
|
||||
|
||||
validate_response 'no parameters are provided' do
|
||||
response = session.image_service.request :root
|
||||
|
||||
response.status.must_equal 200
|
||||
response.body.wont_be_nil
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
@@ -0,0 +1,105 @@
|
||||
---
|
||||
http_interactions:
|
||||
- request:
|
||||
method: post
|
||||
uri: <OPENSTACK_ADMIN_HOST_URI>:5000/v2.0/tokens
|
||||
body:
|
||||
encoding: UTF-8
|
||||
string: ! '{"auth":{"passwordCredentials":{"username":"<OPENSTACK_MEMBER_USERNAME>","password":"<OPENSTACK_MEMBER_PASSWORD>"},"tenantName":"<OPENSTACK_MEMBER_TENANTNAME>"}}'
|
||||
headers:
|
||||
Content-Type:
|
||||
- application/json
|
||||
User-Agent:
|
||||
- Faraday v0.8.8
|
||||
response:
|
||||
status:
|
||||
code: 200
|
||||
message:
|
||||
headers:
|
||||
vary:
|
||||
- X-Auth-Token
|
||||
content-type:
|
||||
- application/json
|
||||
content-length:
|
||||
- '2644'
|
||||
date:
|
||||
- Wed, 11 Sep 2013 05:40:51 GMT
|
||||
connection:
|
||||
- close
|
||||
body:
|
||||
encoding: US-ASCII
|
||||
string: ! '{"access": {"token": {"issued_at": "2013-09-11T05:40:51.423696",
|
||||
"expires": "2013-09-12T05:40:51Z", "id": "70c40d220c8f41ae969fa6c62e051e5b",
|
||||
"tenant": {"description": "", "enabled": true, "id": "c03f067db0db447e9dcaa83d89ac123a",
|
||||
"name": "<OPENSTACK_MEMBER_TENANTNAME>"}}, "serviceCatalog": [{"endpoints":
|
||||
[{"<OPENSTACK_ADMIN_USERNAME>URL": "http://127.0.0.1:8774/v2/c03f067db0db447e9dcaa83d89ac123a",
|
||||
"region": "RegionOne", "internalURL": "http://127.0.0.1:8774/v2/c03f067db0db447e9dcaa83d89ac123a",
|
||||
"id": "5c217f7dabfc4405b2f19fb9ce36633d", "publicURL": "http://127.0.0.1:8774/v2/c03f067db0db447e9dcaa83d89ac123a"}],
|
||||
"endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"<OPENSTACK_ADMIN_USERNAME>URL":
|
||||
"http://127.0.0.1:3333", "region": "RegionOne", "internalURL": "http://127.0.0.1:3333",
|
||||
"id": "2cc9517596534387a120fc6090be0529", "publicURL": "http://127.0.0.1:3333"}],
|
||||
"endpoints_links": [], "type": "s3", "name": "s3"}, {"endpoints": [{"<OPENSTACK_ADMIN_USERNAME>URL":
|
||||
"http://127.0.0.1:9292", "region": "RegionOne", "internalURL": "http://127.0.0.1:9292",
|
||||
"id": "73a8f755f9504369bae5487e95baa8d1", "publicURL": "http://127.0.0.1:9292"}],
|
||||
"endpoints_links": [], "type": "image", "name": "glance"}, {"endpoints": [{"<OPENSTACK_ADMIN_USERNAME>URL":
|
||||
"http://127.0.0.1:8777", "region": "RegionOne", "internalURL": "http://127.0.0.1:8777",
|
||||
"id": "1bdf9a67f08d4ad1bb51037e6b8522ba", "publicURL": "http://127.0.0.1:8777"}],
|
||||
"endpoints_links": [], "type": "metering", "name": "ceilometer"}, {"endpoints":
|
||||
[{"<OPENSTACK_ADMIN_USERNAME>URL": "http://127.0.0.1:8776/v1/c03f067db0db447e9dcaa83d89ac123a",
|
||||
"region": "RegionOne", "internalURL": "http://127.0.0.1:8776/v1/c03f067db0db447e9dcaa83d89ac123a",
|
||||
"id": "24601679ac7d41c697130686e9d3fce2", "publicURL": "http://127.0.0.1:8776/v1/c03f067db0db447e9dcaa83d89ac123a"}],
|
||||
"endpoints_links": [], "type": "volume", "name": "cinder"}, {"endpoints":
|
||||
[{"<OPENSTACK_ADMIN_USERNAME>URL": "http://127.0.0.1:8773/services/Admin",
|
||||
"region": "RegionOne", "internalURL": "http://127.0.0.1:8773/services/Cloud",
|
||||
"id": "3843111b94ec47cc9d306291e3bc1051", "publicURL": "http://127.0.0.1:8773/services/Cloud"}],
|
||||
"endpoints_links": [], "type": "ec2", "name": "ec2"}, {"endpoints": [{"<OPENSTACK_ADMIN_USERNAME>URL":
|
||||
"http://127.0.0.1:35357/v2.0", "region": "RegionOne", "internalURL": "http://127.0.0.1:5000/v2.0",
|
||||
"id": "5f9312cbe04c4034b3aca6cf83f96160", "publicURL": "http://127.0.0.1:5000/v2.0"}],
|
||||
"endpoints_links": [], "type": "identity", "name": "keystone"}], "user": {"username":
|
||||
"<OPENSTACK_MEMBER_USERNAME>", "roles_links": [], "id": "e79d07a8b999437fb44bd3e6afe72b08",
|
||||
"roles": [{"name": "_member_"}, {"name": "project_manager"}], "name": "<OPENSTACK_MEMBER_USERNAME>"},
|
||||
"metadata": {"is_<OPENSTACK_ADMIN_USERNAME>": 0, "roles": ["9fe2ff9ee4384b1894a90878d3e92bab",
|
||||
"45bb4b03d99a43c1bc4e48d5e1ab9d72"]}}}'
|
||||
http_version:
|
||||
recorded_at: Wed, 11 Sep 2013 05:40:57 GMT
|
||||
- request:
|
||||
method: get
|
||||
uri: http://127.0.0.1:9292/v1/
|
||||
body:
|
||||
encoding: US-ASCII
|
||||
string: ''
|
||||
headers:
|
||||
Content-Type:
|
||||
- application/json
|
||||
User-Agent:
|
||||
- Faraday v0.8.8
|
||||
X-Auth-Token:
|
||||
- 70c40d220c8f41ae969fa6c62e051e5b
|
||||
response:
|
||||
status:
|
||||
code: 200
|
||||
message:
|
||||
headers:
|
||||
content-type:
|
||||
- application/json; charset=UTF-8
|
||||
content-length:
|
||||
- '619'
|
||||
x-openstack-request-id:
|
||||
- req-9a178b15-8729-4858-88d6-8a81988a5af4
|
||||
date:
|
||||
- Wed, 11 Sep 2013 05:40:51 GMT
|
||||
connection:
|
||||
- close
|
||||
body:
|
||||
encoding: US-ASCII
|
||||
string: ! '{"images": [{"name": "cirros-0.3.1-x86_64-uec", "container_format":
|
||||
"ami", "disk_format": "ami", "checksum": "f8a2eeee2dc65b3d9b6e63678955bd83",
|
||||
"id": "b94c3265-5557-4993-abf9-6306b06f2a52", "size": 25165824}, {"name":
|
||||
"cirros-0.3.1-x86_64-uec-kernel", "container_format": "aki", "disk_format":
|
||||
"aki", "checksum": "c352f4e7121c6eae958bc1570324f17e", "id": "f1c2b26d-f655-4267-8c9e-101fa48528a2",
|
||||
"size": 4955792}, {"name": "cirros-0.3.1-x86_64-uec-ramdisk", "container_format":
|
||||
"ari", "disk_format": "ari", "checksum": "69c33642f44ca552ba4bb8b66ad97e85",
|
||||
"id": "371d1672-9f85-4d9f-863e-4d9643d2d70d", "size": 3714968}]}'
|
||||
http_version:
|
||||
recorded_at: Wed, 11 Sep 2013 05:40:57 GMT
|
||||
recorded_with: VCR 2.5.0
|
||||
@@ -0,0 +1,65 @@
|
||||
---
|
||||
http_interactions:
|
||||
- request:
|
||||
method: post
|
||||
uri: <OPENSTACK_ADMIN_HOST_URI>:5000/v2.0/tokens
|
||||
body:
|
||||
encoding: UTF-8
|
||||
string: ! '{"auth":{"passwordCredentials":{"username":"<OPENSTACK_MEMBER_USERNAME>","password":"<OPENSTACK_MEMBER_PASSWORD>"},"tenantName":"<OPENSTACK_MEMBER_TENANTNAME>"}}'
|
||||
headers:
|
||||
Content-Type:
|
||||
- application/json
|
||||
User-Agent:
|
||||
- Faraday v0.8.8
|
||||
response:
|
||||
status:
|
||||
code: 200
|
||||
message:
|
||||
headers:
|
||||
vary:
|
||||
- X-Auth-Token
|
||||
content-type:
|
||||
- application/json
|
||||
content-length:
|
||||
- '2644'
|
||||
date:
|
||||
- Wed, 11 Sep 2013 05:40:50 GMT
|
||||
connection:
|
||||
- close
|
||||
body:
|
||||
encoding: US-ASCII
|
||||
string: ! '{"access": {"token": {"issued_at": "2013-09-11T05:40:50.802642",
|
||||
"expires": "2013-09-12T05:40:50Z", "id": "4ae65ccbb4684234ae7ec54bc60c7d8a",
|
||||
"tenant": {"description": "", "enabled": true, "id": "c03f067db0db447e9dcaa83d89ac123a",
|
||||
"name": "<OPENSTACK_MEMBER_TENANTNAME>"}}, "serviceCatalog": [{"endpoints":
|
||||
[{"<OPENSTACK_ADMIN_USERNAME>URL": "http://127.0.0.1:8774/v2/c03f067db0db447e9dcaa83d89ac123a",
|
||||
"region": "RegionOne", "internalURL": "http://127.0.0.1:8774/v2/c03f067db0db447e9dcaa83d89ac123a",
|
||||
"id": "5c217f7dabfc4405b2f19fb9ce36633d", "publicURL": "http://127.0.0.1:8774/v2/c03f067db0db447e9dcaa83d89ac123a"}],
|
||||
"endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"<OPENSTACK_ADMIN_USERNAME>URL":
|
||||
"http://127.0.0.1:3333", "region": "RegionOne", "internalURL": "http://127.0.0.1:3333",
|
||||
"id": "2cc9517596534387a120fc6090be0529", "publicURL": "http://127.0.0.1:3333"}],
|
||||
"endpoints_links": [], "type": "s3", "name": "s3"}, {"endpoints": [{"<OPENSTACK_ADMIN_USERNAME>URL":
|
||||
"http://127.0.0.1:9292", "region": "RegionOne", "internalURL": "http://127.0.0.1:9292",
|
||||
"id": "73a8f755f9504369bae5487e95baa8d1", "publicURL": "http://127.0.0.1:9292"}],
|
||||
"endpoints_links": [], "type": "image", "name": "glance"}, {"endpoints": [{"<OPENSTACK_ADMIN_USERNAME>URL":
|
||||
"http://127.0.0.1:8777", "region": "RegionOne", "internalURL": "http://127.0.0.1:8777",
|
||||
"id": "1bdf9a67f08d4ad1bb51037e6b8522ba", "publicURL": "http://127.0.0.1:8777"}],
|
||||
"endpoints_links": [], "type": "metering", "name": "ceilometer"}, {"endpoints":
|
||||
[{"<OPENSTACK_ADMIN_USERNAME>URL": "http://127.0.0.1:8776/v1/c03f067db0db447e9dcaa83d89ac123a",
|
||||
"region": "RegionOne", "internalURL": "http://127.0.0.1:8776/v1/c03f067db0db447e9dcaa83d89ac123a",
|
||||
"id": "24601679ac7d41c697130686e9d3fce2", "publicURL": "http://127.0.0.1:8776/v1/c03f067db0db447e9dcaa83d89ac123a"}],
|
||||
"endpoints_links": [], "type": "volume", "name": "cinder"}, {"endpoints":
|
||||
[{"<OPENSTACK_ADMIN_USERNAME>URL": "http://127.0.0.1:8773/services/Admin",
|
||||
"region": "RegionOne", "internalURL": "http://127.0.0.1:8773/services/Cloud",
|
||||
"id": "3843111b94ec47cc9d306291e3bc1051", "publicURL": "http://127.0.0.1:8773/services/Cloud"}],
|
||||
"endpoints_links": [], "type": "ec2", "name": "ec2"}, {"endpoints": [{"<OPENSTACK_ADMIN_USERNAME>URL":
|
||||
"http://127.0.0.1:35357/v2.0", "region": "RegionOne", "internalURL": "http://127.0.0.1:5000/v2.0",
|
||||
"id": "5f9312cbe04c4034b3aca6cf83f96160", "publicURL": "http://127.0.0.1:5000/v2.0"}],
|
||||
"endpoints_links": [], "type": "identity", "name": "keystone"}], "user": {"username":
|
||||
"<OPENSTACK_MEMBER_USERNAME>", "roles_links": [], "id": "e79d07a8b999437fb44bd3e6afe72b08",
|
||||
"roles": [{"name": "_member_"}, {"name": "project_manager"}], "name": "<OPENSTACK_MEMBER_USERNAME>"},
|
||||
"metadata": {"is_<OPENSTACK_ADMIN_USERNAME>": 0, "roles": ["9fe2ff9ee4384b1894a90878d3e92bab",
|
||||
"45bb4b03d99a43c1bc4e48d5e1ab9d72"]}}}'
|
||||
http_version:
|
||||
recorded_at: Wed, 11 Sep 2013 05:40:57 GMT
|
||||
recorded_with: VCR 2.5.0
|
||||
@@ -0,0 +1,65 @@
|
||||
---
|
||||
http_interactions:
|
||||
- request:
|
||||
method: post
|
||||
uri: <OPENSTACK_ADMIN_HOST_URI>:5000/v2.0/tokens
|
||||
body:
|
||||
encoding: UTF-8
|
||||
string: ! '{"auth":{"passwordCredentials":{"username":"<OPENSTACK_MEMBER_USERNAME>","password":"<OPENSTACK_MEMBER_PASSWORD>"},"tenantName":"<OPENSTACK_MEMBER_TENANTNAME>"}}'
|
||||
headers:
|
||||
Content-Type:
|
||||
- application/json
|
||||
User-Agent:
|
||||
- Faraday v0.8.8
|
||||
response:
|
||||
status:
|
||||
code: 200
|
||||
message:
|
||||
headers:
|
||||
vary:
|
||||
- X-Auth-Token
|
||||
content-type:
|
||||
- application/json
|
||||
content-length:
|
||||
- '2644'
|
||||
date:
|
||||
- Wed, 11 Sep 2013 05:40:51 GMT
|
||||
connection:
|
||||
- close
|
||||
body:
|
||||
encoding: US-ASCII
|
||||
string: ! '{"access": {"token": {"issued_at": "2013-09-11T05:40:51.261650",
|
||||
"expires": "2013-09-12T05:40:51Z", "id": "b370a1a25e6e417087233bdda97eb3b4",
|
||||
"tenant": {"description": "", "enabled": true, "id": "c03f067db0db447e9dcaa83d89ac123a",
|
||||
"name": "<OPENSTACK_MEMBER_TENANTNAME>"}}, "serviceCatalog": [{"endpoints":
|
||||
[{"<OPENSTACK_ADMIN_USERNAME>URL": "http://127.0.0.1:8774/v2/c03f067db0db447e9dcaa83d89ac123a",
|
||||
"region": "RegionOne", "internalURL": "http://127.0.0.1:8774/v2/c03f067db0db447e9dcaa83d89ac123a",
|
||||
"id": "5c217f7dabfc4405b2f19fb9ce36633d", "publicURL": "http://127.0.0.1:8774/v2/c03f067db0db447e9dcaa83d89ac123a"}],
|
||||
"endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"<OPENSTACK_ADMIN_USERNAME>URL":
|
||||
"http://127.0.0.1:3333", "region": "RegionOne", "internalURL": "http://127.0.0.1:3333",
|
||||
"id": "2cc9517596534387a120fc6090be0529", "publicURL": "http://127.0.0.1:3333"}],
|
||||
"endpoints_links": [], "type": "s3", "name": "s3"}, {"endpoints": [{"<OPENSTACK_ADMIN_USERNAME>URL":
|
||||
"http://127.0.0.1:9292", "region": "RegionOne", "internalURL": "http://127.0.0.1:9292",
|
||||
"id": "73a8f755f9504369bae5487e95baa8d1", "publicURL": "http://127.0.0.1:9292"}],
|
||||
"endpoints_links": [], "type": "image", "name": "glance"}, {"endpoints": [{"<OPENSTACK_ADMIN_USERNAME>URL":
|
||||
"http://127.0.0.1:8777", "region": "RegionOne", "internalURL": "http://127.0.0.1:8777",
|
||||
"id": "1bdf9a67f08d4ad1bb51037e6b8522ba", "publicURL": "http://127.0.0.1:8777"}],
|
||||
"endpoints_links": [], "type": "metering", "name": "ceilometer"}, {"endpoints":
|
||||
[{"<OPENSTACK_ADMIN_USERNAME>URL": "http://127.0.0.1:8776/v1/c03f067db0db447e9dcaa83d89ac123a",
|
||||
"region": "RegionOne", "internalURL": "http://127.0.0.1:8776/v1/c03f067db0db447e9dcaa83d89ac123a",
|
||||
"id": "24601679ac7d41c697130686e9d3fce2", "publicURL": "http://127.0.0.1:8776/v1/c03f067db0db447e9dcaa83d89ac123a"}],
|
||||
"endpoints_links": [], "type": "volume", "name": "cinder"}, {"endpoints":
|
||||
[{"<OPENSTACK_ADMIN_USERNAME>URL": "http://127.0.0.1:8773/services/Admin",
|
||||
"region": "RegionOne", "internalURL": "http://127.0.0.1:8773/services/Cloud",
|
||||
"id": "3843111b94ec47cc9d306291e3bc1051", "publicURL": "http://127.0.0.1:8773/services/Cloud"}],
|
||||
"endpoints_links": [], "type": "ec2", "name": "ec2"}, {"endpoints": [{"<OPENSTACK_ADMIN_USERNAME>URL":
|
||||
"http://127.0.0.1:35357/v2.0", "region": "RegionOne", "internalURL": "http://127.0.0.1:5000/v2.0",
|
||||
"id": "5f9312cbe04c4034b3aca6cf83f96160", "publicURL": "http://127.0.0.1:5000/v2.0"}],
|
||||
"endpoints_links": [], "type": "identity", "name": "keystone"}], "user": {"username":
|
||||
"<OPENSTACK_MEMBER_USERNAME>", "roles_links": [], "id": "e79d07a8b999437fb44bd3e6afe72b08",
|
||||
"roles": [{"name": "_member_"}, {"name": "project_manager"}], "name": "<OPENSTACK_MEMBER_USERNAME>"},
|
||||
"metadata": {"is_<OPENSTACK_ADMIN_USERNAME>": 0, "roles": ["9fe2ff9ee4384b1894a90878d3e92bab",
|
||||
"45bb4b03d99a43c1bc4e48d5e1ab9d72"]}}}'
|
||||
http_version:
|
||||
recorded_at: Wed, 11 Sep 2013 05:40:57 GMT
|
||||
recorded_with: VCR 2.5.0
|
||||
@@ -0,0 +1,65 @@
|
||||
---
|
||||
http_interactions:
|
||||
- request:
|
||||
method: post
|
||||
uri: <OPENSTACK_ADMIN_HOST_URI>:5000/v2.0/tokens
|
||||
body:
|
||||
encoding: UTF-8
|
||||
string: ! '{"auth":{"passwordCredentials":{"username":"<OPENSTACK_MEMBER_USERNAME>","password":"<OPENSTACK_MEMBER_PASSWORD>"},"tenantName":"<OPENSTACK_MEMBER_TENANTNAME>"}}'
|
||||
headers:
|
||||
Content-Type:
|
||||
- application/json
|
||||
User-Agent:
|
||||
- Faraday v0.8.8
|
||||
response:
|
||||
status:
|
||||
code: 200
|
||||
message:
|
||||
headers:
|
||||
vary:
|
||||
- X-Auth-Token
|
||||
content-type:
|
||||
- application/json
|
||||
content-length:
|
||||
- '2644'
|
||||
date:
|
||||
- Wed, 11 Sep 2013 05:40:51 GMT
|
||||
connection:
|
||||
- close
|
||||
body:
|
||||
encoding: US-ASCII
|
||||
string: ! '{"access": {"token": {"issued_at": "2013-09-11T05:40:51.117602",
|
||||
"expires": "2013-09-12T05:40:51Z", "id": "0f883f46953a47469022e9f2e75faf82",
|
||||
"tenant": {"description": "", "enabled": true, "id": "c03f067db0db447e9dcaa83d89ac123a",
|
||||
"name": "<OPENSTACK_MEMBER_TENANTNAME>"}}, "serviceCatalog": [{"endpoints":
|
||||
[{"<OPENSTACK_ADMIN_USERNAME>URL": "http://127.0.0.1:8774/v2/c03f067db0db447e9dcaa83d89ac123a",
|
||||
"region": "RegionOne", "internalURL": "http://127.0.0.1:8774/v2/c03f067db0db447e9dcaa83d89ac123a",
|
||||
"id": "5c217f7dabfc4405b2f19fb9ce36633d", "publicURL": "http://127.0.0.1:8774/v2/c03f067db0db447e9dcaa83d89ac123a"}],
|
||||
"endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"<OPENSTACK_ADMIN_USERNAME>URL":
|
||||
"http://127.0.0.1:3333", "region": "RegionOne", "internalURL": "http://127.0.0.1:3333",
|
||||
"id": "2cc9517596534387a120fc6090be0529", "publicURL": "http://127.0.0.1:3333"}],
|
||||
"endpoints_links": [], "type": "s3", "name": "s3"}, {"endpoints": [{"<OPENSTACK_ADMIN_USERNAME>URL":
|
||||
"http://127.0.0.1:9292", "region": "RegionOne", "internalURL": "http://127.0.0.1:9292",
|
||||
"id": "73a8f755f9504369bae5487e95baa8d1", "publicURL": "http://127.0.0.1:9292"}],
|
||||
"endpoints_links": [], "type": "image", "name": "glance"}, {"endpoints": [{"<OPENSTACK_ADMIN_USERNAME>URL":
|
||||
"http://127.0.0.1:8777", "region": "RegionOne", "internalURL": "http://127.0.0.1:8777",
|
||||
"id": "1bdf9a67f08d4ad1bb51037e6b8522ba", "publicURL": "http://127.0.0.1:8777"}],
|
||||
"endpoints_links": [], "type": "metering", "name": "ceilometer"}, {"endpoints":
|
||||
[{"<OPENSTACK_ADMIN_USERNAME>URL": "http://127.0.0.1:8776/v1/c03f067db0db447e9dcaa83d89ac123a",
|
||||
"region": "RegionOne", "internalURL": "http://127.0.0.1:8776/v1/c03f067db0db447e9dcaa83d89ac123a",
|
||||
"id": "24601679ac7d41c697130686e9d3fce2", "publicURL": "http://127.0.0.1:8776/v1/c03f067db0db447e9dcaa83d89ac123a"}],
|
||||
"endpoints_links": [], "type": "volume", "name": "cinder"}, {"endpoints":
|
||||
[{"<OPENSTACK_ADMIN_USERNAME>URL": "http://127.0.0.1:8773/services/Admin",
|
||||
"region": "RegionOne", "internalURL": "http://127.0.0.1:8773/services/Cloud",
|
||||
"id": "3843111b94ec47cc9d306291e3bc1051", "publicURL": "http://127.0.0.1:8773/services/Cloud"}],
|
||||
"endpoints_links": [], "type": "ec2", "name": "ec2"}, {"endpoints": [{"<OPENSTACK_ADMIN_USERNAME>URL":
|
||||
"http://127.0.0.1:35357/v2.0", "region": "RegionOne", "internalURL": "http://127.0.0.1:5000/v2.0",
|
||||
"id": "5f9312cbe04c4034b3aca6cf83f96160", "publicURL": "http://127.0.0.1:5000/v2.0"}],
|
||||
"endpoints_links": [], "type": "identity", "name": "keystone"}], "user": {"username":
|
||||
"<OPENSTACK_MEMBER_USERNAME>", "roles_links": [], "id": "e79d07a8b999437fb44bd3e6afe72b08",
|
||||
"roles": [{"name": "_member_"}, {"name": "project_manager"}], "name": "<OPENSTACK_MEMBER_USERNAME>"},
|
||||
"metadata": {"is_<OPENSTACK_ADMIN_USERNAME>": 0, "roles": ["9fe2ff9ee4384b1894a90878d3e92bab",
|
||||
"45bb4b03d99a43c1bc4e48d5e1ab9d72"]}}}'
|
||||
http_version:
|
||||
recorded_at: Wed, 11 Sep 2013 05:40:57 GMT
|
||||
recorded_with: VCR 2.5.0
|
||||
@@ -0,0 +1,65 @@
|
||||
---
|
||||
http_interactions:
|
||||
- request:
|
||||
method: post
|
||||
uri: <OPENSTACK_ADMIN_HOST_URI>:5000/v2.0/tokens
|
||||
body:
|
||||
encoding: UTF-8
|
||||
string: ! '{"auth":{"passwordCredentials":{"username":"<OPENSTACK_MEMBER_USERNAME>","password":"<OPENSTACK_MEMBER_PASSWORD>"},"tenantName":"<OPENSTACK_MEMBER_TENANTNAME>"}}'
|
||||
headers:
|
||||
Content-Type:
|
||||
- application/json
|
||||
User-Agent:
|
||||
- Faraday v0.8.8
|
||||
response:
|
||||
status:
|
||||
code: 200
|
||||
message:
|
||||
headers:
|
||||
vary:
|
||||
- X-Auth-Token
|
||||
content-type:
|
||||
- application/json
|
||||
content-length:
|
||||
- '2644'
|
||||
date:
|
||||
- Wed, 11 Sep 2013 05:40:50 GMT
|
||||
connection:
|
||||
- close
|
||||
body:
|
||||
encoding: US-ASCII
|
||||
string: ! '{"access": {"token": {"issued_at": "2013-09-11T05:40:50.960147",
|
||||
"expires": "2013-09-12T05:40:50Z", "id": "4cb7691c0db34f4aa927d7bb72e09091",
|
||||
"tenant": {"description": "", "enabled": true, "id": "c03f067db0db447e9dcaa83d89ac123a",
|
||||
"name": "<OPENSTACK_MEMBER_TENANTNAME>"}}, "serviceCatalog": [{"endpoints":
|
||||
[{"<OPENSTACK_ADMIN_USERNAME>URL": "http://127.0.0.1:8774/v2/c03f067db0db447e9dcaa83d89ac123a",
|
||||
"region": "RegionOne", "internalURL": "http://127.0.0.1:8774/v2/c03f067db0db447e9dcaa83d89ac123a",
|
||||
"id": "5c217f7dabfc4405b2f19fb9ce36633d", "publicURL": "http://127.0.0.1:8774/v2/c03f067db0db447e9dcaa83d89ac123a"}],
|
||||
"endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"<OPENSTACK_ADMIN_USERNAME>URL":
|
||||
"http://127.0.0.1:3333", "region": "RegionOne", "internalURL": "http://127.0.0.1:3333",
|
||||
"id": "2cc9517596534387a120fc6090be0529", "publicURL": "http://127.0.0.1:3333"}],
|
||||
"endpoints_links": [], "type": "s3", "name": "s3"}, {"endpoints": [{"<OPENSTACK_ADMIN_USERNAME>URL":
|
||||
"http://127.0.0.1:9292", "region": "RegionOne", "internalURL": "http://127.0.0.1:9292",
|
||||
"id": "73a8f755f9504369bae5487e95baa8d1", "publicURL": "http://127.0.0.1:9292"}],
|
||||
"endpoints_links": [], "type": "image", "name": "glance"}, {"endpoints": [{"<OPENSTACK_ADMIN_USERNAME>URL":
|
||||
"http://127.0.0.1:8777", "region": "RegionOne", "internalURL": "http://127.0.0.1:8777",
|
||||
"id": "1bdf9a67f08d4ad1bb51037e6b8522ba", "publicURL": "http://127.0.0.1:8777"}],
|
||||
"endpoints_links": [], "type": "metering", "name": "ceilometer"}, {"endpoints":
|
||||
[{"<OPENSTACK_ADMIN_USERNAME>URL": "http://127.0.0.1:8776/v1/c03f067db0db447e9dcaa83d89ac123a",
|
||||
"region": "RegionOne", "internalURL": "http://127.0.0.1:8776/v1/c03f067db0db447e9dcaa83d89ac123a",
|
||||
"id": "24601679ac7d41c697130686e9d3fce2", "publicURL": "http://127.0.0.1:8776/v1/c03f067db0db447e9dcaa83d89ac123a"}],
|
||||
"endpoints_links": [], "type": "volume", "name": "cinder"}, {"endpoints":
|
||||
[{"<OPENSTACK_ADMIN_USERNAME>URL": "http://127.0.0.1:8773/services/Admin",
|
||||
"region": "RegionOne", "internalURL": "http://127.0.0.1:8773/services/Cloud",
|
||||
"id": "3843111b94ec47cc9d306291e3bc1051", "publicURL": "http://127.0.0.1:8773/services/Cloud"}],
|
||||
"endpoints_links": [], "type": "ec2", "name": "ec2"}, {"endpoints": [{"<OPENSTACK_ADMIN_USERNAME>URL":
|
||||
"http://127.0.0.1:35357/v2.0", "region": "RegionOne", "internalURL": "http://127.0.0.1:5000/v2.0",
|
||||
"id": "5f9312cbe04c4034b3aca6cf83f96160", "publicURL": "http://127.0.0.1:5000/v2.0"}],
|
||||
"endpoints_links": [], "type": "identity", "name": "keystone"}], "user": {"username":
|
||||
"<OPENSTACK_MEMBER_USERNAME>", "roles_links": [], "id": "e79d07a8b999437fb44bd3e6afe72b08",
|
||||
"roles": [{"name": "_member_"}, {"name": "project_manager"}], "name": "<OPENSTACK_MEMBER_USERNAME>"},
|
||||
"metadata": {"is_<OPENSTACK_ADMIN_USERNAME>": 0, "roles": ["9fe2ff9ee4384b1894a90878d3e92bab",
|
||||
"45bb4b03d99a43c1bc4e48d5e1ab9d72"]}}}'
|
||||
http_version:
|
||||
recorded_at: Wed, 11 Sep 2013 05:40:57 GMT
|
||||
recorded_with: VCR 2.5.0
|
||||
Reference in New Issue
Block a user