[compute] Add migrate_server request

This commit is contained in:
Alvin Garcia
2013-09-25 10:28:41 +08:00
parent 450bcba87c
commit 9bcfefcc93
8 changed files with 644 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
module Aviator
define_request :migrate_server, inherit: [:openstack, :common, :v2, :admin, :base] do
meta :service, :compute
link 'documentation',
'http://docs.openstack.org/api/openstack-compute/2/content/POST_migrate_v2__tenant_id__servers__server_id__action_ext-os-admin-actions.html'
param :id, required: true
def body
{ migrate: nil }
end
def headers
super
end
def http_method
:post
end
def url
"#{ base_url_for :admin }/servers/#{ params[:id] }/action"
end
end
end

View File

@@ -0,0 +1,125 @@
require 'test_helper'
class Aviator::Test
describe 'aviator/openstack/compute/v2/admin/migrate_server' do
def create_request(session_data = get_session_data, &block)
block ||= lambda { |params| params[:id] = 0 }
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', 'compute', 'v2', 'admin', 'migrate_server.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
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
request.headers.must_equal headers
end
validate_attr :http_method do
create_request.http_method.must_equal :post
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] == 'compute' }
server_id = 'sampleId'
url = "#{ service_spec[:endpoints][0][:adminURL] }/servers/#{ server_id }/action"
request = create_request do |params|
params[:id] = server_id
end
request.url.must_equal url
end
validate_response 'valid params are provided' do
service = session.compute_service
server = service.request(:list_servers).body[:servers].first
response = service.request :migrate_server do |params|
params[:id] = server[:id]
end
response.status.must_equal 202
response.headers.wont_be_nil
end
validate_response 'invalid server id is provided' do
server_id = 'abogusserveridthatdoesnotexist'
response = session.compute_service.request :migrate_server do |params|
params[:id] = server_id
end
response.status.must_equal 404
response.body.wont_be_nil
response.headers.wont_be_nil
end
end
end

View File

@@ -0,0 +1,98 @@
---
http_interactions:
- request:
method: post
uri: <OPENSTACK_ADMIN_HOST_URI>:5000/v2.0/tokens
body:
encoding: UTF-8
string: ! '{"auth":{"passwordCredentials":{"username":"<OPENSTACK_ADMIN_USERNAME>","password":"<OPENSTACK_ADMIN_PASSWORD>"},"tenantName":"<OPENSTACK_ADMIN_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:
- '2593'
date:
- Wed, 25 Sep 2013 02:27:36 GMT
connection:
- close
body:
encoding: US-ASCII
string: ! '{"access": {"token": {"issued_at": "2013-09-25T02:27:36.745445",
"expires": "2013-09-26T02:27:36Z", "id": "29c02530be744f869874ed85c23aca5a",
"tenant": {"description": "", "enabled": true, "id": "87b582d56d3f4ed19a25c919bb59a6f0",
"name": "<OPENSTACK_ADMIN_TENANTNAME>"}}, "serviceCatalog": [{"endpoints":
[{"adminURL": "http://127.0.0.1:8774/v2/87b582d56d3f4ed19a25c919bb59a6f0",
"region": "RegionOne", "internalURL": "http://127.0.0.1:8774/v2/87b582d56d3f4ed19a25c919bb59a6f0",
"id": "1ee1c2c29f8640ab9c3f8654209873f6", "publicURL": "http://127.0.0.1:8774/v2/87b582d56d3f4ed19a25c919bb59a6f0"}],
"endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL":
"http://127.0.0.1:3333", "region": "RegionOne", "internalURL": "http://127.0.0.1:3333",
"id": "3cc6591515c24569bc5342bc82159a77", "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": "6842e55991f14f66b1ccf7c924d83ca6", "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": "1edf8d85bb7047beb66c7630b04b01e6", "publicURL": "http://127.0.0.1:8777"}],
"endpoints_links": [], "type": "metering", "name": "ceilometer"}, {"endpoints":
[{"adminURL": "http://127.0.0.1:8776/v1/87b582d56d3f4ed19a25c919bb59a6f0",
"region": "RegionOne", "internalURL": "http://127.0.0.1:8776/v1/87b582d56d3f4ed19a25c919bb59a6f0",
"id": "301c46cc88384348a5415d478162d51e", "publicURL": "http://127.0.0.1:8776/v1/87b582d56d3f4ed19a25c919bb59a6f0"}],
"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": "3c91fce7434e4a798e8093841d09c6cc",
"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":
"836cef616b644e2da8b0f39dd1aa78e1", "publicURL": "http://127.0.0.1:5000/v2.0"}],
"endpoints_links": [], "type": "identity", "name": "keystone"}], "user": {"username":
"<OPENSTACK_ADMIN_USERNAME>", "roles_links": [], "id": "b0924472662c43919761ec5274f67a1a",
"roles": [{"name": "admin"}], "name": "<OPENSTACK_ADMIN_USERNAME>"}, "metadata":
{"is_admin": 0, "roles": ["564b9bfe08954d8483f6b3cdafbd0518"]}}}'
http_version:
recorded_at: Wed, 25 Sep 2013 02:27:36 GMT
- request:
method: post
uri: http://127.0.0.1:8774/v2/87b582d56d3f4ed19a25c919bb59a6f0/servers/abogusserveridthatdoesnotexist/action
body:
encoding: UTF-8
string: ! '{"migrate":null}'
headers:
Content-Type:
- application/json
User-Agent:
- Faraday v0.8.8
X-Auth-Token:
- 29c02530be744f869874ed85c23aca5a
response:
status:
code: 404
message:
headers:
content-length:
- '73'
content-type:
- application/json; charset=UTF-8
x-compute-request-id:
- req-5410e297-21e9-48ae-be85-5b0668ee0996
date:
- Wed, 25 Sep 2013 02:27:36 GMT
connection:
- close
body:
encoding: US-ASCII
string: ! '{"itemNotFound": {"message": "Instance could not be found", "code":
404}}'
http_version:
recorded_at: Wed, 25 Sep 2013 02:27:36 GMT
recorded_with: VCR 2.5.0

View File

@@ -0,0 +1,131 @@
---
http_interactions:
- request:
method: post
uri: <OPENSTACK_ADMIN_HOST_URI>:5000/v2.0/tokens
body:
encoding: UTF-8
string: ! '{"auth":{"passwordCredentials":{"username":"<OPENSTACK_ADMIN_USERNAME>","password":"<OPENSTACK_ADMIN_PASSWORD>"},"tenantName":"<OPENSTACK_ADMIN_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:
- '2593'
date:
- Wed, 25 Sep 2013 02:27:37 GMT
connection:
- close
body:
encoding: US-ASCII
string: ! '{"access": {"token": {"issued_at": "2013-09-25T02:27:37.019100",
"expires": "2013-09-26T02:27:36Z", "id": "7f0e3bbac9514e0b9162d4ef08f69519",
"tenant": {"description": "", "enabled": true, "id": "87b582d56d3f4ed19a25c919bb59a6f0",
"name": "<OPENSTACK_ADMIN_TENANTNAME>"}}, "serviceCatalog": [{"endpoints":
[{"adminURL": "http://127.0.0.1:8774/v2/87b582d56d3f4ed19a25c919bb59a6f0",
"region": "RegionOne", "internalURL": "http://127.0.0.1:8774/v2/87b582d56d3f4ed19a25c919bb59a6f0",
"id": "1ee1c2c29f8640ab9c3f8654209873f6", "publicURL": "http://127.0.0.1:8774/v2/87b582d56d3f4ed19a25c919bb59a6f0"}],
"endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL":
"http://127.0.0.1:3333", "region": "RegionOne", "internalURL": "http://127.0.0.1:3333",
"id": "3cc6591515c24569bc5342bc82159a77", "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": "6842e55991f14f66b1ccf7c924d83ca6", "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": "1edf8d85bb7047beb66c7630b04b01e6", "publicURL": "http://127.0.0.1:8777"}],
"endpoints_links": [], "type": "metering", "name": "ceilometer"}, {"endpoints":
[{"adminURL": "http://127.0.0.1:8776/v1/87b582d56d3f4ed19a25c919bb59a6f0",
"region": "RegionOne", "internalURL": "http://127.0.0.1:8776/v1/87b582d56d3f4ed19a25c919bb59a6f0",
"id": "301c46cc88384348a5415d478162d51e", "publicURL": "http://127.0.0.1:8776/v1/87b582d56d3f4ed19a25c919bb59a6f0"}],
"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": "3c91fce7434e4a798e8093841d09c6cc",
"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":
"836cef616b644e2da8b0f39dd1aa78e1", "publicURL": "http://127.0.0.1:5000/v2.0"}],
"endpoints_links": [], "type": "identity", "name": "keystone"}], "user": {"username":
"<OPENSTACK_ADMIN_USERNAME>", "roles_links": [], "id": "b0924472662c43919761ec5274f67a1a",
"roles": [{"name": "admin"}], "name": "<OPENSTACK_ADMIN_USERNAME>"}, "metadata":
{"is_admin": 0, "roles": ["564b9bfe08954d8483f6b3cdafbd0518"]}}}'
http_version:
recorded_at: Wed, 25 Sep 2013 02:27:37 GMT
- request:
method: get
uri: http://127.0.0.1:8774/v2/87b582d56d3f4ed19a25c919bb59a6f0/servers
body:
encoding: US-ASCII
string: ''
headers:
Content-Type:
- application/json
User-Agent:
- Faraday v0.8.8
X-Auth-Token:
- 7f0e3bbac9514e0b9162d4ef08f69519
response:
status:
code: 200
message:
headers:
x-compute-request-id:
- req-ba24d3c5-401a-4f40-bc7d-4c4a9c4c9ebb
content-type:
- application/json
content-length:
- '360'
date:
- Wed, 25 Sep 2013 02:27:37 GMT
connection:
- close
body:
encoding: US-ASCII
string: ! '{"servers": [{"id": "7c50b184-8534-47ca-ab62-62a755a842d6", "links":
[{"href": "http://127.0.0.1:8774/v2/87b582d56d3f4ed19a25c919bb59a6f0/servers/7c50b184-8534-47ca-ab62-62a755a842d6",
"rel": "self"}, {"href": "http://127.0.0.1:8774/87b582d56d3f4ed19a25c919bb59a6f0/servers/7c50b184-8534-47ca-ab62-62a755a842d6",
"rel": "bookmark"}], "name": "test-instance"}]}'
http_version:
recorded_at: Wed, 25 Sep 2013 02:27:37 GMT
- request:
method: post
uri: http://127.0.0.1:8774/v2/87b582d56d3f4ed19a25c919bb59a6f0/servers/7c50b184-8534-47ca-ab62-62a755a842d6/action
body:
encoding: UTF-8
string: ! '{"migrate":null}'
headers:
Content-Type:
- application/json
User-Agent:
- Faraday v0.8.8
X-Auth-Token:
- 7f0e3bbac9514e0b9162d4ef08f69519
response:
status:
code: 202
message:
headers:
content-type:
- text/html; charset=UTF-8
content-length:
- '0'
date:
- Wed, 25 Sep 2013 02:27:37 GMT
connection:
- close
body:
encoding: US-ASCII
string: ''
http_version:
recorded_at: Wed, 25 Sep 2013 02:27:37 GMT
recorded_with: VCR 2.5.0

View File

@@ -0,0 +1,64 @@
---
http_interactions:
- request:
method: post
uri: <OPENSTACK_ADMIN_HOST_URI>:5000/v2.0/tokens
body:
encoding: UTF-8
string: ! '{"auth":{"passwordCredentials":{"username":"<OPENSTACK_ADMIN_USERNAME>","password":"<OPENSTACK_ADMIN_PASSWORD>"},"tenantName":"<OPENSTACK_ADMIN_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:
- '2593'
date:
- Wed, 25 Sep 2013 02:27:36 GMT
connection:
- close
body:
encoding: US-ASCII
string: ! '{"access": {"token": {"issued_at": "2013-09-25T02:27:36.290831",
"expires": "2013-09-26T02:27:36Z", "id": "24cb4c8c94574ca4a2b951414d355ae9",
"tenant": {"description": "", "enabled": true, "id": "87b582d56d3f4ed19a25c919bb59a6f0",
"name": "<OPENSTACK_ADMIN_TENANTNAME>"}}, "serviceCatalog": [{"endpoints":
[{"adminURL": "http://127.0.0.1:8774/v2/87b582d56d3f4ed19a25c919bb59a6f0",
"region": "RegionOne", "internalURL": "http://127.0.0.1:8774/v2/87b582d56d3f4ed19a25c919bb59a6f0",
"id": "1ee1c2c29f8640ab9c3f8654209873f6", "publicURL": "http://127.0.0.1:8774/v2/87b582d56d3f4ed19a25c919bb59a6f0"}],
"endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL":
"http://127.0.0.1:3333", "region": "RegionOne", "internalURL": "http://127.0.0.1:3333",
"id": "3cc6591515c24569bc5342bc82159a77", "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": "6842e55991f14f66b1ccf7c924d83ca6", "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": "1edf8d85bb7047beb66c7630b04b01e6", "publicURL": "http://127.0.0.1:8777"}],
"endpoints_links": [], "type": "metering", "name": "ceilometer"}, {"endpoints":
[{"adminURL": "http://127.0.0.1:8776/v1/87b582d56d3f4ed19a25c919bb59a6f0",
"region": "RegionOne", "internalURL": "http://127.0.0.1:8776/v1/87b582d56d3f4ed19a25c919bb59a6f0",
"id": "301c46cc88384348a5415d478162d51e", "publicURL": "http://127.0.0.1:8776/v1/87b582d56d3f4ed19a25c919bb59a6f0"}],
"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": "3c91fce7434e4a798e8093841d09c6cc",
"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":
"836cef616b644e2da8b0f39dd1aa78e1", "publicURL": "http://127.0.0.1:5000/v2.0"}],
"endpoints_links": [], "type": "identity", "name": "keystone"}], "user": {"username":
"<OPENSTACK_ADMIN_USERNAME>", "roles_links": [], "id": "b0924472662c43919761ec5274f67a1a",
"roles": [{"name": "admin"}], "name": "<OPENSTACK_ADMIN_USERNAME>"}, "metadata":
{"is_admin": 0, "roles": ["564b9bfe08954d8483f6b3cdafbd0518"]}}}'
http_version:
recorded_at: Wed, 25 Sep 2013 02:27:36 GMT
recorded_with: VCR 2.5.0

View File

@@ -0,0 +1,64 @@
---
http_interactions:
- request:
method: post
uri: <OPENSTACK_ADMIN_HOST_URI>:5000/v2.0/tokens
body:
encoding: UTF-8
string: ! '{"auth":{"passwordCredentials":{"username":"<OPENSTACK_ADMIN_USERNAME>","password":"<OPENSTACK_ADMIN_PASSWORD>"},"tenantName":"<OPENSTACK_ADMIN_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:
- '2593'
date:
- Wed, 25 Sep 2013 02:27:36 GMT
connection:
- close
body:
encoding: US-ASCII
string: ! '{"access": {"token": {"issued_at": "2013-09-25T02:27:36.448766",
"expires": "2013-09-26T02:27:36Z", "id": "a4bdb14fcc7e43178b57fe754e7f3081",
"tenant": {"description": "", "enabled": true, "id": "87b582d56d3f4ed19a25c919bb59a6f0",
"name": "<OPENSTACK_ADMIN_TENANTNAME>"}}, "serviceCatalog": [{"endpoints":
[{"adminURL": "http://127.0.0.1:8774/v2/87b582d56d3f4ed19a25c919bb59a6f0",
"region": "RegionOne", "internalURL": "http://127.0.0.1:8774/v2/87b582d56d3f4ed19a25c919bb59a6f0",
"id": "1ee1c2c29f8640ab9c3f8654209873f6", "publicURL": "http://127.0.0.1:8774/v2/87b582d56d3f4ed19a25c919bb59a6f0"}],
"endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL":
"http://127.0.0.1:3333", "region": "RegionOne", "internalURL": "http://127.0.0.1:3333",
"id": "3cc6591515c24569bc5342bc82159a77", "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": "6842e55991f14f66b1ccf7c924d83ca6", "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": "1edf8d85bb7047beb66c7630b04b01e6", "publicURL": "http://127.0.0.1:8777"}],
"endpoints_links": [], "type": "metering", "name": "ceilometer"}, {"endpoints":
[{"adminURL": "http://127.0.0.1:8776/v1/87b582d56d3f4ed19a25c919bb59a6f0",
"region": "RegionOne", "internalURL": "http://127.0.0.1:8776/v1/87b582d56d3f4ed19a25c919bb59a6f0",
"id": "301c46cc88384348a5415d478162d51e", "publicURL": "http://127.0.0.1:8776/v1/87b582d56d3f4ed19a25c919bb59a6f0"}],
"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": "3c91fce7434e4a798e8093841d09c6cc",
"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":
"836cef616b644e2da8b0f39dd1aa78e1", "publicURL": "http://127.0.0.1:5000/v2.0"}],
"endpoints_links": [], "type": "identity", "name": "keystone"}], "user": {"username":
"<OPENSTACK_ADMIN_USERNAME>", "roles_links": [], "id": "b0924472662c43919761ec5274f67a1a",
"roles": [{"name": "admin"}], "name": "<OPENSTACK_ADMIN_USERNAME>"}, "metadata":
{"is_admin": 0, "roles": ["564b9bfe08954d8483f6b3cdafbd0518"]}}}'
http_version:
recorded_at: Wed, 25 Sep 2013 02:27:36 GMT
recorded_with: VCR 2.5.0

View File

@@ -0,0 +1,64 @@
---
http_interactions:
- request:
method: post
uri: <OPENSTACK_ADMIN_HOST_URI>:5000/v2.0/tokens
body:
encoding: UTF-8
string: ! '{"auth":{"passwordCredentials":{"username":"<OPENSTACK_ADMIN_USERNAME>","password":"<OPENSTACK_ADMIN_PASSWORD>"},"tenantName":"<OPENSTACK_ADMIN_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:
- '2593'
date:
- Wed, 25 Sep 2013 02:27:36 GMT
connection:
- close
body:
encoding: US-ASCII
string: ! '{"access": {"token": {"issued_at": "2013-09-25T02:27:36.586258",
"expires": "2013-09-26T02:27:36Z", "id": "36603c770733490fa6a74a0342084473",
"tenant": {"description": "", "enabled": true, "id": "87b582d56d3f4ed19a25c919bb59a6f0",
"name": "<OPENSTACK_ADMIN_TENANTNAME>"}}, "serviceCatalog": [{"endpoints":
[{"adminURL": "http://127.0.0.1:8774/v2/87b582d56d3f4ed19a25c919bb59a6f0",
"region": "RegionOne", "internalURL": "http://127.0.0.1:8774/v2/87b582d56d3f4ed19a25c919bb59a6f0",
"id": "1ee1c2c29f8640ab9c3f8654209873f6", "publicURL": "http://127.0.0.1:8774/v2/87b582d56d3f4ed19a25c919bb59a6f0"}],
"endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL":
"http://127.0.0.1:3333", "region": "RegionOne", "internalURL": "http://127.0.0.1:3333",
"id": "3cc6591515c24569bc5342bc82159a77", "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": "6842e55991f14f66b1ccf7c924d83ca6", "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": "1edf8d85bb7047beb66c7630b04b01e6", "publicURL": "http://127.0.0.1:8777"}],
"endpoints_links": [], "type": "metering", "name": "ceilometer"}, {"endpoints":
[{"adminURL": "http://127.0.0.1:8776/v1/87b582d56d3f4ed19a25c919bb59a6f0",
"region": "RegionOne", "internalURL": "http://127.0.0.1:8776/v1/87b582d56d3f4ed19a25c919bb59a6f0",
"id": "301c46cc88384348a5415d478162d51e", "publicURL": "http://127.0.0.1:8776/v1/87b582d56d3f4ed19a25c919bb59a6f0"}],
"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": "3c91fce7434e4a798e8093841d09c6cc",
"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":
"836cef616b644e2da8b0f39dd1aa78e1", "publicURL": "http://127.0.0.1:5000/v2.0"}],
"endpoints_links": [], "type": "identity", "name": "keystone"}], "user": {"username":
"<OPENSTACK_ADMIN_USERNAME>", "roles_links": [], "id": "b0924472662c43919761ec5274f67a1a",
"roles": [{"name": "admin"}], "name": "<OPENSTACK_ADMIN_USERNAME>"}, "metadata":
{"is_admin": 0, "roles": ["564b9bfe08954d8483f6b3cdafbd0518"]}}}'
http_version:
recorded_at: Wed, 25 Sep 2013 02:27:36 GMT
recorded_with: VCR 2.5.0

View File

@@ -0,0 +1,64 @@
---
http_interactions:
- request:
method: post
uri: <OPENSTACK_ADMIN_HOST_URI>:5000/v2.0/tokens
body:
encoding: UTF-8
string: ! '{"auth":{"passwordCredentials":{"username":"<OPENSTACK_ADMIN_USERNAME>","password":"<OPENSTACK_ADMIN_PASSWORD>"},"tenantName":"<OPENSTACK_ADMIN_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:
- '2593'
date:
- Wed, 25 Sep 2013 02:27:36 GMT
connection:
- close
body:
encoding: US-ASCII
string: ! '{"access": {"token": {"issued_at": "2013-09-25T02:27:36.134619",
"expires": "2013-09-26T02:27:36Z", "id": "3de5ed64ed034ff5be9bfa494b0d9deb",
"tenant": {"description": "", "enabled": true, "id": "87b582d56d3f4ed19a25c919bb59a6f0",
"name": "<OPENSTACK_ADMIN_TENANTNAME>"}}, "serviceCatalog": [{"endpoints":
[{"adminURL": "http://127.0.0.1:8774/v2/87b582d56d3f4ed19a25c919bb59a6f0",
"region": "RegionOne", "internalURL": "http://127.0.0.1:8774/v2/87b582d56d3f4ed19a25c919bb59a6f0",
"id": "1ee1c2c29f8640ab9c3f8654209873f6", "publicURL": "http://127.0.0.1:8774/v2/87b582d56d3f4ed19a25c919bb59a6f0"}],
"endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL":
"http://127.0.0.1:3333", "region": "RegionOne", "internalURL": "http://127.0.0.1:3333",
"id": "3cc6591515c24569bc5342bc82159a77", "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": "6842e55991f14f66b1ccf7c924d83ca6", "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": "1edf8d85bb7047beb66c7630b04b01e6", "publicURL": "http://127.0.0.1:8777"}],
"endpoints_links": [], "type": "metering", "name": "ceilometer"}, {"endpoints":
[{"adminURL": "http://127.0.0.1:8776/v1/87b582d56d3f4ed19a25c919bb59a6f0",
"region": "RegionOne", "internalURL": "http://127.0.0.1:8776/v1/87b582d56d3f4ed19a25c919bb59a6f0",
"id": "301c46cc88384348a5415d478162d51e", "publicURL": "http://127.0.0.1:8776/v1/87b582d56d3f4ed19a25c919bb59a6f0"}],
"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": "3c91fce7434e4a798e8093841d09c6cc",
"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":
"836cef616b644e2da8b0f39dd1aa78e1", "publicURL": "http://127.0.0.1:5000/v2.0"}],
"endpoints_links": [], "type": "identity", "name": "keystone"}], "user": {"username":
"<OPENSTACK_ADMIN_USERNAME>", "roles_links": [], "id": "b0924472662c43919761ec5274f67a1a",
"roles": [{"name": "admin"}], "name": "<OPENSTACK_ADMIN_USERNAME>"}, "metadata":
{"is_admin": 0, "roles": ["564b9bfe08954d8483f6b3cdafbd0518"]}}}'
http_version:
recorded_at: Wed, 25 Sep 2013 02:27:36 GMT
recorded_with: VCR 2.5.0