From a935efbe742104ad8c11a693ba2e64249624e86b Mon Sep 17 00:00:00 2001 From: Alvin Garcia Date: Wed, 11 Sep 2013 13:41:31 +0800 Subject: [PATCH] Add root request for image --- lib/aviator/core/service.rb | 5 +- lib/aviator/openstack/image/v1/public/root.rb | 34 ++++++ .../openstack/image/v1/public/root_test.rb | 106 ++++++++++++++++++ ...sponse_when_no_parameters_are_provided.yml | 105 +++++++++++++++++ .../returns_the_correct_value_for_body_.yml | 65 +++++++++++ ...returns_the_correct_value_for_headers_.yml | 65 +++++++++++ ...rns_the_correct_value_for_http_method_.yml | 65 +++++++++++ .../returns_the_correct_value_for_url_.yml | 65 +++++++++++ 8 files changed, 508 insertions(+), 2 deletions(-) create mode 100644 lib/aviator/openstack/image/v1/public/root.rb create mode 100644 test/aviator/openstack/image/v1/public/root_test.rb create mode 100644 test/cassettes/openstack/image/v1/public/root/leads_to_a_valid_response_when_no_parameters_are_provided.yml create mode 100644 test/cassettes/openstack/image/v1/public/root/returns_the_correct_value_for_body_.yml create mode 100644 test/cassettes/openstack/image/v1/public/root/returns_the_correct_value_for_headers_.yml create mode 100644 test/cassettes/openstack/image/v1/public/root/returns_the_correct_value_for_http_method_.yml create mode 100644 test/cassettes/openstack/image/v1/public/root/returns_the_correct_value_for_url_.yml diff --git a/lib/aviator/core/service.rb b/lib/aviator/core/service.rb index d7c7c68..c72268f 100644 --- a/lib/aviator/core/service.rb +++ b/lib/aviator/core/service.rb @@ -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 \ No newline at end of file +end diff --git a/lib/aviator/openstack/image/v1/public/root.rb b/lib/aviator/openstack/image/v1/public/root.rb new file mode 100644 index 0000000..ff7fe3c --- /dev/null +++ b/lib/aviator/openstack/image/v1/public/root.rb @@ -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 diff --git a/test/aviator/openstack/image/v1/public/root_test.rb b/test/aviator/openstack/image/v1/public/root_test.rb new file mode 100644 index 0000000..6fcdc2a --- /dev/null +++ b/test/aviator/openstack/image/v1/public/root_test.rb @@ -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 diff --git a/test/cassettes/openstack/image/v1/public/root/leads_to_a_valid_response_when_no_parameters_are_provided.yml b/test/cassettes/openstack/image/v1/public/root/leads_to_a_valid_response_when_no_parameters_are_provided.yml new file mode 100644 index 0000000..bbe75af --- /dev/null +++ b/test/cassettes/openstack/image/v1/public/root/leads_to_a_valid_response_when_no_parameters_are_provided.yml @@ -0,0 +1,105 @@ +--- +http_interactions: +- request: + method: post + uri: :5000/v2.0/tokens + body: + encoding: UTF-8 + string: ! '{"auth":{"passwordCredentials":{"username":"","password":""},"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": ""}}, "serviceCatalog": [{"endpoints": + [{"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": [{"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": [{"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": [{"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": + [{"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": + [{"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": [{"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": + "", "roles_links": [], "id": "e79d07a8b999437fb44bd3e6afe72b08", + "roles": [{"name": "_member_"}, {"name": "project_manager"}], "name": ""}, + "metadata": {"is_": 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 diff --git a/test/cassettes/openstack/image/v1/public/root/returns_the_correct_value_for_body_.yml b/test/cassettes/openstack/image/v1/public/root/returns_the_correct_value_for_body_.yml new file mode 100644 index 0000000..2f68fc8 --- /dev/null +++ b/test/cassettes/openstack/image/v1/public/root/returns_the_correct_value_for_body_.yml @@ -0,0 +1,65 @@ +--- +http_interactions: +- request: + method: post + uri: :5000/v2.0/tokens + body: + encoding: UTF-8 + string: ! '{"auth":{"passwordCredentials":{"username":"","password":""},"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": ""}}, "serviceCatalog": [{"endpoints": + [{"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": [{"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": [{"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": [{"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": + [{"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": + [{"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": [{"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": + "", "roles_links": [], "id": "e79d07a8b999437fb44bd3e6afe72b08", + "roles": [{"name": "_member_"}, {"name": "project_manager"}], "name": ""}, + "metadata": {"is_": 0, "roles": ["9fe2ff9ee4384b1894a90878d3e92bab", + "45bb4b03d99a43c1bc4e48d5e1ab9d72"]}}}' + http_version: + recorded_at: Wed, 11 Sep 2013 05:40:57 GMT +recorded_with: VCR 2.5.0 diff --git a/test/cassettes/openstack/image/v1/public/root/returns_the_correct_value_for_headers_.yml b/test/cassettes/openstack/image/v1/public/root/returns_the_correct_value_for_headers_.yml new file mode 100644 index 0000000..51c1755 --- /dev/null +++ b/test/cassettes/openstack/image/v1/public/root/returns_the_correct_value_for_headers_.yml @@ -0,0 +1,65 @@ +--- +http_interactions: +- request: + method: post + uri: :5000/v2.0/tokens + body: + encoding: UTF-8 + string: ! '{"auth":{"passwordCredentials":{"username":"","password":""},"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": ""}}, "serviceCatalog": [{"endpoints": + [{"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": [{"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": [{"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": [{"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": + [{"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": + [{"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": [{"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": + "", "roles_links": [], "id": "e79d07a8b999437fb44bd3e6afe72b08", + "roles": [{"name": "_member_"}, {"name": "project_manager"}], "name": ""}, + "metadata": {"is_": 0, "roles": ["9fe2ff9ee4384b1894a90878d3e92bab", + "45bb4b03d99a43c1bc4e48d5e1ab9d72"]}}}' + http_version: + recorded_at: Wed, 11 Sep 2013 05:40:57 GMT +recorded_with: VCR 2.5.0 diff --git a/test/cassettes/openstack/image/v1/public/root/returns_the_correct_value_for_http_method_.yml b/test/cassettes/openstack/image/v1/public/root/returns_the_correct_value_for_http_method_.yml new file mode 100644 index 0000000..9ae9c44 --- /dev/null +++ b/test/cassettes/openstack/image/v1/public/root/returns_the_correct_value_for_http_method_.yml @@ -0,0 +1,65 @@ +--- +http_interactions: +- request: + method: post + uri: :5000/v2.0/tokens + body: + encoding: UTF-8 + string: ! '{"auth":{"passwordCredentials":{"username":"","password":""},"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": ""}}, "serviceCatalog": [{"endpoints": + [{"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": [{"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": [{"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": [{"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": + [{"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": + [{"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": [{"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": + "", "roles_links": [], "id": "e79d07a8b999437fb44bd3e6afe72b08", + "roles": [{"name": "_member_"}, {"name": "project_manager"}], "name": ""}, + "metadata": {"is_": 0, "roles": ["9fe2ff9ee4384b1894a90878d3e92bab", + "45bb4b03d99a43c1bc4e48d5e1ab9d72"]}}}' + http_version: + recorded_at: Wed, 11 Sep 2013 05:40:57 GMT +recorded_with: VCR 2.5.0 diff --git a/test/cassettes/openstack/image/v1/public/root/returns_the_correct_value_for_url_.yml b/test/cassettes/openstack/image/v1/public/root/returns_the_correct_value_for_url_.yml new file mode 100644 index 0000000..27623b0 --- /dev/null +++ b/test/cassettes/openstack/image/v1/public/root/returns_the_correct_value_for_url_.yml @@ -0,0 +1,65 @@ +--- +http_interactions: +- request: + method: post + uri: :5000/v2.0/tokens + body: + encoding: UTF-8 + string: ! '{"auth":{"passwordCredentials":{"username":"","password":""},"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": ""}}, "serviceCatalog": [{"endpoints": + [{"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": [{"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": [{"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": [{"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": + [{"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": + [{"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": [{"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": + "", "roles_links": [], "id": "e79d07a8b999437fb44bd3e6afe72b08", + "roles": [{"name": "_member_"}, {"name": "project_manager"}], "name": ""}, + "metadata": {"is_": 0, "roles": ["9fe2ff9ee4384b1894a90878d3e92bab", + "45bb4b03d99a43c1bc4e48d5e1ab9d72"]}}}' + http_version: + recorded_at: Wed, 11 Sep 2013 05:40:57 GMT +recorded_with: VCR 2.5.0