From 1e98429214dbfbe6e63816d7af951f8946bfb242 Mon Sep 17 00:00:00 2001 From: Alvin Garcia Date: Mon, 16 Sep 2013 13:20:52 +0800 Subject: [PATCH] [identity] Add update_tenant request --- .../identity/v2/admin/update_tenant.rb | 57 +++++++ .../identity/v2/admin/update_tenant_test.rb | 139 +++++++++++++++++ ...nse_when_invalid_tenant_id_is_provided.yml | 98 ++++++++++++ ...ponse_when_valid_tenant_id_is_provided.yml | 140 ++++++++++++++++++ .../returns_the_correct_value_for_body_.yml | 64 ++++++++ ...returns_the_correct_value_for_headers_.yml | 64 ++++++++ ...rns_the_correct_value_for_http_method_.yml | 64 ++++++++ .../returns_the_correct_value_for_url_.yml | 64 ++++++++ 8 files changed, 690 insertions(+) create mode 100644 lib/aviator/openstack/identity/v2/admin/update_tenant.rb create mode 100644 test/aviator/openstack/identity/v2/admin/update_tenant_test.rb create mode 100644 test/cassettes/openstack/identity/v2/admin/update_tenant/leads_to_a_valid_response_when_invalid_tenant_id_is_provided.yml create mode 100644 test/cassettes/openstack/identity/v2/admin/update_tenant/leads_to_a_valid_response_when_valid_tenant_id_is_provided.yml create mode 100644 test/cassettes/openstack/identity/v2/admin/update_tenant/returns_the_correct_value_for_body_.yml create mode 100644 test/cassettes/openstack/identity/v2/admin/update_tenant/returns_the_correct_value_for_headers_.yml create mode 100644 test/cassettes/openstack/identity/v2/admin/update_tenant/returns_the_correct_value_for_http_method_.yml create mode 100644 test/cassettes/openstack/identity/v2/admin/update_tenant/returns_the_correct_value_for_url_.yml diff --git a/lib/aviator/openstack/identity/v2/admin/update_tenant.rb b/lib/aviator/openstack/identity/v2/admin/update_tenant.rb new file mode 100644 index 0000000..5b78f89 --- /dev/null +++ b/lib/aviator/openstack/identity/v2/admin/update_tenant.rb @@ -0,0 +1,57 @@ +module Aviator + + define_request :update_tenant do + + meta :provider, :openstack + meta :service, :identity + meta :api_version, :v2 + meta :endpoint_type, :admin + + + link 'documentation', + 'http://docs.openstack.org/api/openstack-identity-service/2.0/content/POST_updateTenant_v2.0_tenants__tenantId__.html' + + + param :id, required: true + param :name, required: false + param :enabled, required: false + param :description, required: false + + + def body + p = { + tenant: {} + } + + [:name, :enabled, :description].each do |key| + p[:tenant][key] = params[key] if params[key] + end + + p + end + + + def headers + h = {} + + unless self.anonymous? + h['X-Auth-Token'] = session_data[:access][:token][:id] + end + + h + end + + + def http_method + :put + end + + + def url + service_spec = session_data[:access][:serviceCatalog].find { |s| s[:type] == service.to_s } + "#{ service_spec[:endpoints][0][:adminURL] }/tenants/#{ params[:id] }" + end + + end + +end diff --git a/test/aviator/openstack/identity/v2/admin/update_tenant_test.rb b/test/aviator/openstack/identity/v2/admin/update_tenant_test.rb new file mode 100644 index 0000000..98acab2 --- /dev/null +++ b/test/aviator/openstack/identity/v2/admin/update_tenant_test.rb @@ -0,0 +1,139 @@ +require 'test_helper' + +class Aviator::Test + + describe 'aviator/openstack/identity/v2/admin/update_tenant' do + + def create_request(session_data = get_session_data, &block) + klass.new(session_data, &block) + 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', 'admin', 'update_tenant.rb') + end + + + def session + unless @session + @session = Aviator::Session.new( + config_file: Environment.path, + environment: 'openstack_admin' + ) + @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 { |p| p[:id] = 0 } + + klass.body?.must_equal true + request.body?.must_equal true + request.body.wont_be_nil + end + + + validate_attr :endpoint_type do + klass.endpoint_type.must_equal :admin + end + + + validate_attr :headers do + headers = { 'X-Auth-Token' => get_session_data[:access][:token][:id] } + + request = create_request { |p| p[:id] = 0 } + + request.headers.must_equal headers + end + + + validate_attr :http_method do + create_request { |p| p[:id] = 0 }.http_method.must_equal :put + end + + + validate_attr :optional_params do + klass.optional_params.must_equal [ + :name, + :enabled, + :description + ] + end + + + validate_attr :required_params do + klass.required_params.must_equal [:id] + end + + + validate_attr :url do + service_spec = get_session_data[:access][:serviceCatalog].find{|s| s[:type] == 'identity' } + tenant_id = '105b09f0b6500d36168480ad84' + url = "#{ service_spec[:endpoints][0][:adminURL] }/tenants/#{ tenant_id }" + + request = create_request do |params| + params[:id] = tenant_id + end + + request.url.must_equal url + end + + + validate_response 'valid tenant id is provided' do + tenant = session.identity_service.request(:list_tenants).body[:tenants].first + tenant_id = tenant[:id] + new_name = 'Updated tenant' + + response = session.identity_service.request :update_tenant do |params| + params[:id] = tenant_id + params[:name] = new_name + end + + response.status.must_equal 200 + response.body.wont_be_nil + response.body[:tenant].wont_be_nil + response.body[:tenant][:name].must_equal new_name + response.headers.wont_be_nil + end + + + validate_response 'invalid tenant id is provided' do + tenant_id = 'abogustenantidthatdoesnotexist' + + response = session.identity_service.request :update_tenant do |params| + params[:id] = tenant_id + params[:name] = 'it does not matter' + end + + response.status.must_equal 404 + response.body.wont_be_nil + response.headers.wont_be_nil + end + + + end + +end diff --git a/test/cassettes/openstack/identity/v2/admin/update_tenant/leads_to_a_valid_response_when_invalid_tenant_id_is_provided.yml b/test/cassettes/openstack/identity/v2/admin/update_tenant/leads_to_a_valid_response_when_invalid_tenant_id_is_provided.yml new file mode 100644 index 0000000..a6d4a7c --- /dev/null +++ b/test/cassettes/openstack/identity/v2/admin/update_tenant/leads_to_a_valid_response_when_invalid_tenant_id_is_provided.yml @@ -0,0 +1,98 @@ +--- +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: + - '2575' + date: + - Mon, 16 Sep 2013 05:19:46 GMT + connection: + - close + body: + encoding: US-ASCII + string: ! '{"access": {"token": {"issued_at": "2013-09-16T05:19:46.231820", + "expires": "2013-09-17T05:19:46Z", "id": "3ecfe28efa37422cae9fc51a01dca720", + "tenant": {"description": "test", "enabled": true, "id": "3aca45f5f918451683c12d70abd4c793", + "name": ""}}, "serviceCatalog": [{"endpoints": + [{"adminURL": "http://127.0.0.1:8774/v2/3aca45f5f918451683c12d70abd4c793", + "region": "RegionOne", "internalURL": "http://127.0.0.1:8774/v2/3aca45f5f918451683c12d70abd4c793", + "id": "5c217f7dabfc4405b2f19fb9ce36633d", "publicURL": "http://127.0.0.1:8774/v2/3aca45f5f918451683c12d70abd4c793"}], + "endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL": + "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": [{"adminURL": + "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": [{"adminURL": + "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": + [{"adminURL": "http://127.0.0.1:8776/v1/3aca45f5f918451683c12d70abd4c793", + "region": "RegionOne", "internalURL": "http://127.0.0.1:8776/v1/3aca45f5f918451683c12d70abd4c793", + "id": "24601679ac7d41c697130686e9d3fce2", "publicURL": "http://127.0.0.1:8776/v1/3aca45f5f918451683c12d70abd4c793"}], + "endpoints_links": [], "type": "volume", "name": "cinder"}, {"endpoints": + [{"adminURL": "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": [{"adminURL": "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": "0b085c8826f34a59ac0c43dff6f80fba", + "roles": [{"name": "admin"}], "name": ""}, "metadata": + {"is_admin": 0, "roles": ["f1b1fe5bf09d4b49ae0cb92948f3a8c9"]}}}' + http_version: + recorded_at: Mon, 16 Sep 2013 05:19:46 GMT +- request: + method: put + uri: http://127.0.0.1:35357/v2.0/tenants/abogustenantidthatdoesnotexist + body: + encoding: UTF-8 + string: ! '{"tenant":{"name":"it does not matter"}}' + headers: + Content-Type: + - application/json + User-Agent: + - Faraday v0.8.8 + X-Auth-Token: + - 3ecfe28efa37422cae9fc51a01dca720 + response: + status: + code: 404 + message: + headers: + vary: + - X-Auth-Token + content-type: + - application/json + content-length: + - '115' + date: + - Mon, 16 Sep 2013 05:19:46 GMT + connection: + - close + body: + encoding: US-ASCII + string: ! '{"error": {"message": "Could not find project: abogustenantidthatdoesnotexist", + "code": 404, "title": "Not Found"}}' + http_version: + recorded_at: Mon, 16 Sep 2013 05:19:46 GMT +recorded_with: VCR 2.5.0 diff --git a/test/cassettes/openstack/identity/v2/admin/update_tenant/leads_to_a_valid_response_when_valid_tenant_id_is_provided.yml b/test/cassettes/openstack/identity/v2/admin/update_tenant/leads_to_a_valid_response_when_valid_tenant_id_is_provided.yml new file mode 100644 index 0000000..60b65ee --- /dev/null +++ b/test/cassettes/openstack/identity/v2/admin/update_tenant/leads_to_a_valid_response_when_valid_tenant_id_is_provided.yml @@ -0,0 +1,140 @@ +--- +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: + - '2575' + date: + - Mon, 16 Sep 2013 05:19:45 GMT + connection: + - close + body: + encoding: US-ASCII + string: ! '{"access": {"token": {"issued_at": "2013-09-16T05:19:45.631347", + "expires": "2013-09-17T05:19:45Z", "id": "9fe1768945c94c39bfdea57525f10d75", + "tenant": {"description": "test", "enabled": true, "id": "3aca45f5f918451683c12d70abd4c793", + "name": ""}}, "serviceCatalog": [{"endpoints": + [{"adminURL": "http://127.0.0.1:8774/v2/3aca45f5f918451683c12d70abd4c793", + "region": "RegionOne", "internalURL": "http://127.0.0.1:8774/v2/3aca45f5f918451683c12d70abd4c793", + "id": "5c217f7dabfc4405b2f19fb9ce36633d", "publicURL": "http://127.0.0.1:8774/v2/3aca45f5f918451683c12d70abd4c793"}], + "endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL": + "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": [{"adminURL": + "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": [{"adminURL": + "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": + [{"adminURL": "http://127.0.0.1:8776/v1/3aca45f5f918451683c12d70abd4c793", + "region": "RegionOne", "internalURL": "http://127.0.0.1:8776/v1/3aca45f5f918451683c12d70abd4c793", + "id": "24601679ac7d41c697130686e9d3fce2", "publicURL": "http://127.0.0.1:8776/v1/3aca45f5f918451683c12d70abd4c793"}], + "endpoints_links": [], "type": "volume", "name": "cinder"}, {"endpoints": + [{"adminURL": "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": [{"adminURL": "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": "0b085c8826f34a59ac0c43dff6f80fba", + "roles": [{"name": "admin"}], "name": ""}, "metadata": + {"is_admin": 0, "roles": ["f1b1fe5bf09d4b49ae0cb92948f3a8c9"]}}}' + http_version: + recorded_at: Mon, 16 Sep 2013 05:19:45 GMT +- request: + method: get + uri: http://127.0.0.1:5000/v2.0/tenants + body: + encoding: US-ASCII + string: '' + headers: + Content-Type: + - application/json + User-Agent: + - Faraday v0.8.8 + X-Auth-Token: + - 9fe1768945c94c39bfdea57525f10d75 + response: + status: + code: 200 + message: + headers: + vary: + - X-Auth-Token + content-type: + - application/json + content-length: + - '650' + date: + - Mon, 16 Sep 2013 05:19:45 GMT + connection: + - close + body: + encoding: US-ASCII + string: ! '{"tenants_links": [], "tenants": [{"description": "test update", + "enabled": true, "id": "2f2a15ea1edc40b6a7372076acebb097", "name": "test project"}, + {"description": "test", "enabled": true, "id": "3aca45f5f918451683c12d70abd4c793", + "name": ""}, {"description": null, "enabled": + true, "id": "84c4dc3279514f1cb30b0fc9b0f3c090", "name": "admin"}, {"description": + "", "enabled": true, "id": "c03f067db0db447e9dcaa83d89ac123a", "name": "aviator"}, + {"description": null, "enabled": true, "id": "ced59e9539844247ba234a79d62e7904", + "name": "service"}, {"description": null, "enabled": true, "id": "db55e4723ad94aa58aacb6dcc0a59660", + "name": "alt_"}]}' + http_version: + recorded_at: Mon, 16 Sep 2013 05:19:45 GMT +- request: + method: put + uri: http://127.0.0.1:35357/v2.0/tenants/2f2a15ea1edc40b6a7372076acebb097 + body: + encoding: UTF-8 + string: ! '{"tenant":{"name":"Updated tenant"}}' + headers: + Content-Type: + - application/json + User-Agent: + - Faraday v0.8.8 + X-Auth-Token: + - 9fe1768945c94c39bfdea57525f10d75 + response: + status: + code: 200 + message: + headers: + vary: + - X-Auth-Token + content-type: + - application/json + content-length: + - '164' + date: + - Mon, 16 Sep 2013 05:19:45 GMT + connection: + - close + body: + encoding: US-ASCII + string: ! '{"tenant": {"description": "test update", "extra": {}, "enabled": + true, "id": "2f2a15ea1edc40b6a7372076acebb097", "domain_id": "default", "name": + "Updated tenant"}}' + http_version: + recorded_at: Mon, 16 Sep 2013 05:19:45 GMT +recorded_with: VCR 2.5.0 diff --git a/test/cassettes/openstack/identity/v2/admin/update_tenant/returns_the_correct_value_for_body_.yml b/test/cassettes/openstack/identity/v2/admin/update_tenant/returns_the_correct_value_for_body_.yml new file mode 100644 index 0000000..15ddd32 --- /dev/null +++ b/test/cassettes/openstack/identity/v2/admin/update_tenant/returns_the_correct_value_for_body_.yml @@ -0,0 +1,64 @@ +--- +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: + - '2575' + date: + - Mon, 16 Sep 2013 05:19:45 GMT + connection: + - close + body: + encoding: US-ASCII + string: ! '{"access": {"token": {"issued_at": "2013-09-16T05:19:45.488012", + "expires": "2013-09-17T05:19:45Z", "id": "8fa5db833698400f8dfb1a5ed971ffb3", + "tenant": {"description": "test", "enabled": true, "id": "3aca45f5f918451683c12d70abd4c793", + "name": ""}}, "serviceCatalog": [{"endpoints": + [{"adminURL": "http://127.0.0.1:8774/v2/3aca45f5f918451683c12d70abd4c793", + "region": "RegionOne", "internalURL": "http://127.0.0.1:8774/v2/3aca45f5f918451683c12d70abd4c793", + "id": "5c217f7dabfc4405b2f19fb9ce36633d", "publicURL": "http://127.0.0.1:8774/v2/3aca45f5f918451683c12d70abd4c793"}], + "endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL": + "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": [{"adminURL": + "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": [{"adminURL": + "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": + [{"adminURL": "http://127.0.0.1:8776/v1/3aca45f5f918451683c12d70abd4c793", + "region": "RegionOne", "internalURL": "http://127.0.0.1:8776/v1/3aca45f5f918451683c12d70abd4c793", + "id": "24601679ac7d41c697130686e9d3fce2", "publicURL": "http://127.0.0.1:8776/v1/3aca45f5f918451683c12d70abd4c793"}], + "endpoints_links": [], "type": "volume", "name": "cinder"}, {"endpoints": + [{"adminURL": "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": [{"adminURL": "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": "0b085c8826f34a59ac0c43dff6f80fba", + "roles": [{"name": "admin"}], "name": ""}, "metadata": + {"is_admin": 0, "roles": ["f1b1fe5bf09d4b49ae0cb92948f3a8c9"]}}}' + http_version: + recorded_at: Mon, 16 Sep 2013 05:19:45 GMT +recorded_with: VCR 2.5.0 diff --git a/test/cassettes/openstack/identity/v2/admin/update_tenant/returns_the_correct_value_for_headers_.yml b/test/cassettes/openstack/identity/v2/admin/update_tenant/returns_the_correct_value_for_headers_.yml new file mode 100644 index 0000000..72771ab --- /dev/null +++ b/test/cassettes/openstack/identity/v2/admin/update_tenant/returns_the_correct_value_for_headers_.yml @@ -0,0 +1,64 @@ +--- +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: + - '2575' + date: + - Mon, 16 Sep 2013 05:19:45 GMT + connection: + - close + body: + encoding: US-ASCII + string: ! '{"access": {"token": {"issued_at": "2013-09-16T05:19:45.918166", + "expires": "2013-09-17T05:19:45Z", "id": "1d50c7b6f6834d94be11f68cbb954b21", + "tenant": {"description": "test", "enabled": true, "id": "3aca45f5f918451683c12d70abd4c793", + "name": ""}}, "serviceCatalog": [{"endpoints": + [{"adminURL": "http://127.0.0.1:8774/v2/3aca45f5f918451683c12d70abd4c793", + "region": "RegionOne", "internalURL": "http://127.0.0.1:8774/v2/3aca45f5f918451683c12d70abd4c793", + "id": "5c217f7dabfc4405b2f19fb9ce36633d", "publicURL": "http://127.0.0.1:8774/v2/3aca45f5f918451683c12d70abd4c793"}], + "endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL": + "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": [{"adminURL": + "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": [{"adminURL": + "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": + [{"adminURL": "http://127.0.0.1:8776/v1/3aca45f5f918451683c12d70abd4c793", + "region": "RegionOne", "internalURL": "http://127.0.0.1:8776/v1/3aca45f5f918451683c12d70abd4c793", + "id": "24601679ac7d41c697130686e9d3fce2", "publicURL": "http://127.0.0.1:8776/v1/3aca45f5f918451683c12d70abd4c793"}], + "endpoints_links": [], "type": "volume", "name": "cinder"}, {"endpoints": + [{"adminURL": "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": [{"adminURL": "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": "0b085c8826f34a59ac0c43dff6f80fba", + "roles": [{"name": "admin"}], "name": ""}, "metadata": + {"is_admin": 0, "roles": ["f1b1fe5bf09d4b49ae0cb92948f3a8c9"]}}}' + http_version: + recorded_at: Mon, 16 Sep 2013 05:19:45 GMT +recorded_with: VCR 2.5.0 diff --git a/test/cassettes/openstack/identity/v2/admin/update_tenant/returns_the_correct_value_for_http_method_.yml b/test/cassettes/openstack/identity/v2/admin/update_tenant/returns_the_correct_value_for_http_method_.yml new file mode 100644 index 0000000..e3b2814 --- /dev/null +++ b/test/cassettes/openstack/identity/v2/admin/update_tenant/returns_the_correct_value_for_http_method_.yml @@ -0,0 +1,64 @@ +--- +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: + - '2575' + date: + - Mon, 16 Sep 2013 05:19:46 GMT + connection: + - close + body: + encoding: US-ASCII + string: ! '{"access": {"token": {"issued_at": "2013-09-16T05:19:46.416438", + "expires": "2013-09-17T05:19:46Z", "id": "e9a828b6f12d44c7bf9710835afd4fe6", + "tenant": {"description": "test", "enabled": true, "id": "3aca45f5f918451683c12d70abd4c793", + "name": ""}}, "serviceCatalog": [{"endpoints": + [{"adminURL": "http://127.0.0.1:8774/v2/3aca45f5f918451683c12d70abd4c793", + "region": "RegionOne", "internalURL": "http://127.0.0.1:8774/v2/3aca45f5f918451683c12d70abd4c793", + "id": "5c217f7dabfc4405b2f19fb9ce36633d", "publicURL": "http://127.0.0.1:8774/v2/3aca45f5f918451683c12d70abd4c793"}], + "endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL": + "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": [{"adminURL": + "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": [{"adminURL": + "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": + [{"adminURL": "http://127.0.0.1:8776/v1/3aca45f5f918451683c12d70abd4c793", + "region": "RegionOne", "internalURL": "http://127.0.0.1:8776/v1/3aca45f5f918451683c12d70abd4c793", + "id": "24601679ac7d41c697130686e9d3fce2", "publicURL": "http://127.0.0.1:8776/v1/3aca45f5f918451683c12d70abd4c793"}], + "endpoints_links": [], "type": "volume", "name": "cinder"}, {"endpoints": + [{"adminURL": "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": [{"adminURL": "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": "0b085c8826f34a59ac0c43dff6f80fba", + "roles": [{"name": "admin"}], "name": ""}, "metadata": + {"is_admin": 0, "roles": ["f1b1fe5bf09d4b49ae0cb92948f3a8c9"]}}}' + http_version: + recorded_at: Mon, 16 Sep 2013 05:19:46 GMT +recorded_with: VCR 2.5.0 diff --git a/test/cassettes/openstack/identity/v2/admin/update_tenant/returns_the_correct_value_for_url_.yml b/test/cassettes/openstack/identity/v2/admin/update_tenant/returns_the_correct_value_for_url_.yml new file mode 100644 index 0000000..7ea54e0 --- /dev/null +++ b/test/cassettes/openstack/identity/v2/admin/update_tenant/returns_the_correct_value_for_url_.yml @@ -0,0 +1,64 @@ +--- +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: + - '2575' + date: + - Mon, 16 Sep 2013 05:19:46 GMT + connection: + - close + body: + encoding: US-ASCII + string: ! '{"access": {"token": {"issued_at": "2013-09-16T05:19:46.088163", + "expires": "2013-09-17T05:19:46Z", "id": "7d9e9e87302b48d9a5ebb86d11e54576", + "tenant": {"description": "test", "enabled": true, "id": "3aca45f5f918451683c12d70abd4c793", + "name": ""}}, "serviceCatalog": [{"endpoints": + [{"adminURL": "http://127.0.0.1:8774/v2/3aca45f5f918451683c12d70abd4c793", + "region": "RegionOne", "internalURL": "http://127.0.0.1:8774/v2/3aca45f5f918451683c12d70abd4c793", + "id": "5c217f7dabfc4405b2f19fb9ce36633d", "publicURL": "http://127.0.0.1:8774/v2/3aca45f5f918451683c12d70abd4c793"}], + "endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL": + "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": [{"adminURL": + "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": [{"adminURL": + "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": + [{"adminURL": "http://127.0.0.1:8776/v1/3aca45f5f918451683c12d70abd4c793", + "region": "RegionOne", "internalURL": "http://127.0.0.1:8776/v1/3aca45f5f918451683c12d70abd4c793", + "id": "24601679ac7d41c697130686e9d3fce2", "publicURL": "http://127.0.0.1:8776/v1/3aca45f5f918451683c12d70abd4c793"}], + "endpoints_links": [], "type": "volume", "name": "cinder"}, {"endpoints": + [{"adminURL": "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": [{"adminURL": "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": "0b085c8826f34a59ac0c43dff6f80fba", + "roles": [{"name": "admin"}], "name": ""}, "metadata": + {"is_admin": 0, "roles": ["f1b1fe5bf09d4b49ae0cb92948f3a8c9"]}}}' + http_version: + recorded_at: Mon, 16 Sep 2013 05:19:46 GMT +recorded_with: VCR 2.5.0