[feature #25] Add root request for identity
This commit is contained in:
		
							
								
								
									
										34
									
								
								lib/aviator/openstack/identity/v2/public/root.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								lib/aviator/openstack/identity/v2/public/root.rb
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,34 @@ | |||||||
|  | module Aviator | ||||||
|  |  | ||||||
|  |   define_request :root do | ||||||
|  |  | ||||||
|  |     meta :provider,      :openstack | ||||||
|  |     meta :service,       :identity | ||||||
|  |     meta :api_version,   :v2 | ||||||
|  |     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 }/v2.0/" | ||||||
|  |     end | ||||||
|  |  | ||||||
|  |   end | ||||||
|  |  | ||||||
|  | end | ||||||
							
								
								
									
										106
									
								
								test/aviator/openstack/identity/v2/public/root_test.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										106
									
								
								test/aviator/openstack/identity/v2/public/root_test.rb
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,106 @@ | |||||||
|  | require 'test_helper' | ||||||
|  |  | ||||||
|  | class Aviator::Test | ||||||
|  |  | ||||||
|  |   describe 'aviator/openstack/identity/v2/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', 'identity', 'v2', '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 :v2 | ||||||
|  |     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] == 'identity' } | ||||||
|  |       uri          = URI(service_spec[:endpoints][0][:publicURL]) | ||||||
|  |       url          = "#{ uri.scheme }://#{ uri.host }:#{ uri.port.to_s }/v2.0/" | ||||||
|  |  | ||||||
|  |       create_request.url.must_equal url | ||||||
|  |     end | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |     validate_response 'no parameters are provided' do | ||||||
|  |       response = session.identity_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_USERNAME>123"},"tenantName":"<OPENSTACK_MEMBER_USERNAME> | ||||||
|  |         project"}}' | ||||||
|  |     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: | ||||||
|  |       - '2641' | ||||||
|  |       date: | ||||||
|  |       - Mon, 09 Sep 2013 10:08:15 GMT | ||||||
|  |       connection: | ||||||
|  |       - close | ||||||
|  |     body: | ||||||
|  |       encoding: US-ASCII | ||||||
|  |       string: ! '{"access": {"token": {"issued_at": "2013-09-09T10:08:15.221773", | ||||||
|  |         "expires": "2013-09-10T10:08:15Z", "id": "af36a74f61354db3be62e1470d2b3ee3", | ||||||
|  |         "tenant": {"description": "", "enabled": true, "id": "74380c5a11c84d1dacbdc0621cf43c45", | ||||||
|  |         "name": "<OPENSTACK_MEMBER_USERNAME> project"}}, "serviceCatalog": [{"endpoints": | ||||||
|  |         [{"<OPENSTACK_ADMIN_USERNAME>URL": "http://127.0.0.1:8774/v2/74380c5a11c84d1dacbdc0621cf43c45", | ||||||
|  |         "region": "RegionOne", "internalURL": "http://127.0.0.1:8774/v2/74380c5a11c84d1dacbdc0621cf43c45", | ||||||
|  |         "id": "5c217f7dabfc4405b2f19fb9ce36633d", "publicURL": "http://127.0.0.1:8774/v2/74380c5a11c84d1dacbdc0621cf43c45"}], | ||||||
|  |         "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/74380c5a11c84d1dacbdc0621cf43c45", | ||||||
|  |         "region": "RegionOne", "internalURL": "http://127.0.0.1:8776/v1/74380c5a11c84d1dacbdc0621cf43c45", | ||||||
|  |         "id": "24601679ac7d41c697130686e9d3fce2", "publicURL": "http://127.0.0.1:8776/v1/74380c5a11c84d1dacbdc0621cf43c45"}], | ||||||
|  |         "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": "3357724510a749838714df36db5bdc03", | ||||||
|  |         "roles": [{"name": "_<OPENSTACK_MEMBER_USERNAME>_"}, {"name": "project_manager"}], | ||||||
|  |         "name": "<OPENSTACK_MEMBER_USERNAME>"}, "metadata": {"is_<OPENSTACK_ADMIN_USERNAME>": | ||||||
|  |         0, "roles": ["9fe2ff9ee4384b1894a90878d3e92bab", "45bb4b03d99a43c1bc4e48d5e1ab9d72"]}}}' | ||||||
|  |     http_version:  | ||||||
|  |   recorded_at: Mon, 09 Sep 2013 10:08:15 GMT | ||||||
|  | - request: | ||||||
|  |     method: get | ||||||
|  |     uri: http://127.0.0.1:5000/v2.0/ | ||||||
|  |     body: | ||||||
|  |       encoding: US-ASCII | ||||||
|  |       string: '' | ||||||
|  |     headers: | ||||||
|  |       Content-Type: | ||||||
|  |       - application/json | ||||||
|  |       User-Agent: | ||||||
|  |       - Faraday v0.8.8 | ||||||
|  |       X-Auth-Token: | ||||||
|  |       - af36a74f61354db3be62e1470d2b3ee3 | ||||||
|  |   response: | ||||||
|  |     status: | ||||||
|  |       code: 200 | ||||||
|  |       message:  | ||||||
|  |     headers: | ||||||
|  |       vary: | ||||||
|  |       - X-Auth-Token | ||||||
|  |       content-type: | ||||||
|  |       - application/json | ||||||
|  |       content-length: | ||||||
|  |       - '612' | ||||||
|  |       date: | ||||||
|  |       - Mon, 09 Sep 2013 10:08:15 GMT | ||||||
|  |       connection: | ||||||
|  |       - close | ||||||
|  |     body: | ||||||
|  |       encoding: US-ASCII | ||||||
|  |       string: ! '{"version": {"status": "stable", "updated": "2013-03-06T00:00:00Z", | ||||||
|  |         "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}, | ||||||
|  |         {"base": "application/xml", "type": "application/vnd.openstack.identity-v2.0+xml"}], | ||||||
|  |         "id": "v2.0", "links": [{"href": "<OPENSTACK_ADMIN_HOST_URI>:5000/v2.0/", | ||||||
|  |         "rel": "self"}, {"href": "http://docs.openstack.org/api/openstack-identity-service/2.0/content/", | ||||||
|  |         "type": "text/html", "rel": "describedby"}, {"href": "http://docs.openstack.org/api/openstack-identity-service/2.0/identity-dev-guide-2.0.pdf", | ||||||
|  |         "type": "application/pdf", "rel": "describedby"}]}}' | ||||||
|  |     http_version:  | ||||||
|  |   recorded_at: Mon, 09 Sep 2013 10:08:15 GMT | ||||||
|  | recorded_with: VCR 2.5.0 | ||||||
| @@ -0,0 +1,66 @@ | |||||||
|  | --- | ||||||
|  | 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_USERNAME>123"},"tenantName":"<OPENSTACK_MEMBER_USERNAME> | ||||||
|  |         project"}}' | ||||||
|  |     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: | ||||||
|  |       - '2641' | ||||||
|  |       date: | ||||||
|  |       - Mon, 09 Sep 2013 10:08:14 GMT | ||||||
|  |       connection: | ||||||
|  |       - close | ||||||
|  |     body: | ||||||
|  |       encoding: US-ASCII | ||||||
|  |       string: ! '{"access": {"token": {"issued_at": "2013-09-09T10:08:14.592160", | ||||||
|  |         "expires": "2013-09-10T10:08:14Z", "id": "430e892745b647ecaab526e7377f5ad5", | ||||||
|  |         "tenant": {"description": "", "enabled": true, "id": "74380c5a11c84d1dacbdc0621cf43c45", | ||||||
|  |         "name": "<OPENSTACK_MEMBER_USERNAME> project"}}, "serviceCatalog": [{"endpoints": | ||||||
|  |         [{"<OPENSTACK_ADMIN_USERNAME>URL": "http://127.0.0.1:8774/v2/74380c5a11c84d1dacbdc0621cf43c45", | ||||||
|  |         "region": "RegionOne", "internalURL": "http://127.0.0.1:8774/v2/74380c5a11c84d1dacbdc0621cf43c45", | ||||||
|  |         "id": "5c217f7dabfc4405b2f19fb9ce36633d", "publicURL": "http://127.0.0.1:8774/v2/74380c5a11c84d1dacbdc0621cf43c45"}], | ||||||
|  |         "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/74380c5a11c84d1dacbdc0621cf43c45", | ||||||
|  |         "region": "RegionOne", "internalURL": "http://127.0.0.1:8776/v1/74380c5a11c84d1dacbdc0621cf43c45", | ||||||
|  |         "id": "24601679ac7d41c697130686e9d3fce2", "publicURL": "http://127.0.0.1:8776/v1/74380c5a11c84d1dacbdc0621cf43c45"}], | ||||||
|  |         "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": "3357724510a749838714df36db5bdc03", | ||||||
|  |         "roles": [{"name": "_<OPENSTACK_MEMBER_USERNAME>_"}, {"name": "project_manager"}], | ||||||
|  |         "name": "<OPENSTACK_MEMBER_USERNAME>"}, "metadata": {"is_<OPENSTACK_ADMIN_USERNAME>": | ||||||
|  |         0, "roles": ["9fe2ff9ee4384b1894a90878d3e92bab", "45bb4b03d99a43c1bc4e48d5e1ab9d72"]}}}' | ||||||
|  |     http_version:  | ||||||
|  |   recorded_at: Mon, 09 Sep 2013 10:08:14 GMT | ||||||
|  | recorded_with: VCR 2.5.0 | ||||||
| @@ -0,0 +1,66 @@ | |||||||
|  | --- | ||||||
|  | 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_USERNAME>123"},"tenantName":"<OPENSTACK_MEMBER_USERNAME> | ||||||
|  |         project"}}' | ||||||
|  |     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: | ||||||
|  |       - '2641' | ||||||
|  |       date: | ||||||
|  |       - Mon, 09 Sep 2013 10:08:14 GMT | ||||||
|  |       connection: | ||||||
|  |       - close | ||||||
|  |     body: | ||||||
|  |       encoding: US-ASCII | ||||||
|  |       string: ! '{"access": {"token": {"issued_at": "2013-09-09T10:08:14.924846", | ||||||
|  |         "expires": "2013-09-10T10:08:14Z", "id": "e51ebe07efe847f0b5d60ba5caaf3009", | ||||||
|  |         "tenant": {"description": "", "enabled": true, "id": "74380c5a11c84d1dacbdc0621cf43c45", | ||||||
|  |         "name": "<OPENSTACK_MEMBER_USERNAME> project"}}, "serviceCatalog": [{"endpoints": | ||||||
|  |         [{"<OPENSTACK_ADMIN_USERNAME>URL": "http://127.0.0.1:8774/v2/74380c5a11c84d1dacbdc0621cf43c45", | ||||||
|  |         "region": "RegionOne", "internalURL": "http://127.0.0.1:8774/v2/74380c5a11c84d1dacbdc0621cf43c45", | ||||||
|  |         "id": "5c217f7dabfc4405b2f19fb9ce36633d", "publicURL": "http://127.0.0.1:8774/v2/74380c5a11c84d1dacbdc0621cf43c45"}], | ||||||
|  |         "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/74380c5a11c84d1dacbdc0621cf43c45", | ||||||
|  |         "region": "RegionOne", "internalURL": "http://127.0.0.1:8776/v1/74380c5a11c84d1dacbdc0621cf43c45", | ||||||
|  |         "id": "24601679ac7d41c697130686e9d3fce2", "publicURL": "http://127.0.0.1:8776/v1/74380c5a11c84d1dacbdc0621cf43c45"}], | ||||||
|  |         "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": "3357724510a749838714df36db5bdc03", | ||||||
|  |         "roles": [{"name": "_<OPENSTACK_MEMBER_USERNAME>_"}, {"name": "project_manager"}], | ||||||
|  |         "name": "<OPENSTACK_MEMBER_USERNAME>"}, "metadata": {"is_<OPENSTACK_ADMIN_USERNAME>": | ||||||
|  |         0, "roles": ["9fe2ff9ee4384b1894a90878d3e92bab", "45bb4b03d99a43c1bc4e48d5e1ab9d72"]}}}' | ||||||
|  |     http_version:  | ||||||
|  |   recorded_at: Mon, 09 Sep 2013 10:08:15 GMT | ||||||
|  | recorded_with: VCR 2.5.0 | ||||||
| @@ -0,0 +1,66 @@ | |||||||
|  | --- | ||||||
|  | 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_USERNAME>123"},"tenantName":"<OPENSTACK_MEMBER_USERNAME> | ||||||
|  |         project"}}' | ||||||
|  |     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: | ||||||
|  |       - '2641' | ||||||
|  |       date: | ||||||
|  |       - Mon, 09 Sep 2013 10:08:15 GMT | ||||||
|  |       connection: | ||||||
|  |       - close | ||||||
|  |     body: | ||||||
|  |       encoding: US-ASCII | ||||||
|  |       string: ! '{"access": {"token": {"issued_at": "2013-09-09T10:08:15.074591", | ||||||
|  |         "expires": "2013-09-10T10:08:15Z", "id": "c19f7ed5835343eba8f07ed00c87dab9", | ||||||
|  |         "tenant": {"description": "", "enabled": true, "id": "74380c5a11c84d1dacbdc0621cf43c45", | ||||||
|  |         "name": "<OPENSTACK_MEMBER_USERNAME> project"}}, "serviceCatalog": [{"endpoints": | ||||||
|  |         [{"<OPENSTACK_ADMIN_USERNAME>URL": "http://127.0.0.1:8774/v2/74380c5a11c84d1dacbdc0621cf43c45", | ||||||
|  |         "region": "RegionOne", "internalURL": "http://127.0.0.1:8774/v2/74380c5a11c84d1dacbdc0621cf43c45", | ||||||
|  |         "id": "5c217f7dabfc4405b2f19fb9ce36633d", "publicURL": "http://127.0.0.1:8774/v2/74380c5a11c84d1dacbdc0621cf43c45"}], | ||||||
|  |         "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/74380c5a11c84d1dacbdc0621cf43c45", | ||||||
|  |         "region": "RegionOne", "internalURL": "http://127.0.0.1:8776/v1/74380c5a11c84d1dacbdc0621cf43c45", | ||||||
|  |         "id": "24601679ac7d41c697130686e9d3fce2", "publicURL": "http://127.0.0.1:8776/v1/74380c5a11c84d1dacbdc0621cf43c45"}], | ||||||
|  |         "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": "3357724510a749838714df36db5bdc03", | ||||||
|  |         "roles": [{"name": "_<OPENSTACK_MEMBER_USERNAME>_"}, {"name": "project_manager"}], | ||||||
|  |         "name": "<OPENSTACK_MEMBER_USERNAME>"}, "metadata": {"is_<OPENSTACK_ADMIN_USERNAME>": | ||||||
|  |         0, "roles": ["9fe2ff9ee4384b1894a90878d3e92bab", "45bb4b03d99a43c1bc4e48d5e1ab9d72"]}}}' | ||||||
|  |     http_version:  | ||||||
|  |   recorded_at: Mon, 09 Sep 2013 10:08:15 GMT | ||||||
|  | recorded_with: VCR 2.5.0 | ||||||
| @@ -0,0 +1,66 @@ | |||||||
|  | --- | ||||||
|  | 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_USERNAME>123"},"tenantName":"<OPENSTACK_MEMBER_USERNAME> | ||||||
|  |         project"}}' | ||||||
|  |     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: | ||||||
|  |       - '2641' | ||||||
|  |       date: | ||||||
|  |       - Mon, 09 Sep 2013 10:08:14 GMT | ||||||
|  |       connection: | ||||||
|  |       - close | ||||||
|  |     body: | ||||||
|  |       encoding: US-ASCII | ||||||
|  |       string: ! '{"access": {"token": {"issued_at": "2013-09-09T10:08:14.753557", | ||||||
|  |         "expires": "2013-09-10T10:08:14Z", "id": "9f12dfe89b6e434dacc0abd95bdf3b8e", | ||||||
|  |         "tenant": {"description": "", "enabled": true, "id": "74380c5a11c84d1dacbdc0621cf43c45", | ||||||
|  |         "name": "<OPENSTACK_MEMBER_USERNAME> project"}}, "serviceCatalog": [{"endpoints": | ||||||
|  |         [{"<OPENSTACK_ADMIN_USERNAME>URL": "http://127.0.0.1:8774/v2/74380c5a11c84d1dacbdc0621cf43c45", | ||||||
|  |         "region": "RegionOne", "internalURL": "http://127.0.0.1:8774/v2/74380c5a11c84d1dacbdc0621cf43c45", | ||||||
|  |         "id": "5c217f7dabfc4405b2f19fb9ce36633d", "publicURL": "http://127.0.0.1:8774/v2/74380c5a11c84d1dacbdc0621cf43c45"}], | ||||||
|  |         "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/74380c5a11c84d1dacbdc0621cf43c45", | ||||||
|  |         "region": "RegionOne", "internalURL": "http://127.0.0.1:8776/v1/74380c5a11c84d1dacbdc0621cf43c45", | ||||||
|  |         "id": "24601679ac7d41c697130686e9d3fce2", "publicURL": "http://127.0.0.1:8776/v1/74380c5a11c84d1dacbdc0621cf43c45"}], | ||||||
|  |         "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": "3357724510a749838714df36db5bdc03", | ||||||
|  |         "roles": [{"name": "_<OPENSTACK_MEMBER_USERNAME>_"}, {"name": "project_manager"}], | ||||||
|  |         "name": "<OPENSTACK_MEMBER_USERNAME>"}, "metadata": {"is_<OPENSTACK_ADMIN_USERNAME>": | ||||||
|  |         0, "roles": ["9fe2ff9ee4384b1894a90878d3e92bab", "45bb4b03d99a43c1bc4e48d5e1ab9d72"]}}}' | ||||||
|  |     http_version:  | ||||||
|  |   recorded_at: Mon, 09 Sep 2013 10:08:14 GMT | ||||||
|  | recorded_with: VCR 2.5.0 | ||||||
		Reference in New Issue
	
	Block a user
	 Alvin Garcia
					Alvin Garcia