Initial implementation of list_servers
This commit is contained in:
58
lib/aviator/openstack/compute/v2/public/list_servers.rb
Normal file
58
lib/aviator/openstack/compute/v2/public/list_servers.rb
Normal file
@@ -0,0 +1,58 @@
|
||||
module Aviator
|
||||
|
||||
define_request :list_servers do
|
||||
|
||||
meta :provider, :openstack
|
||||
meta :service, :compute
|
||||
meta :api_version, :v2
|
||||
meta :endpoint_type, :public
|
||||
|
||||
link 'documentation',
|
||||
'http://docs.openstack.org/api/openstack-compute/2/content/List_Servers-d1e2078.html'
|
||||
|
||||
param :details, required: false
|
||||
param :flavor, required: false
|
||||
param :image, required: false
|
||||
param :limit, required: false
|
||||
param :marker, required: false
|
||||
param :server, required: false
|
||||
param :status, required: false
|
||||
param 'changes-since', required: false
|
||||
|
||||
|
||||
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 }
|
||||
|
||||
str = "#{ service_spec[:endpoints][0][:publicURL] }/servers"
|
||||
str += "/detail" if params[:details]
|
||||
|
||||
filters = []
|
||||
|
||||
(optional_params + required_params - [:details]).each do |param_name|
|
||||
filters << "#{ param_name }=#{ params[param_name] }" if params[param_name]
|
||||
end
|
||||
|
||||
str += "?#{ filters.join('&') }" unless filters.empty?
|
||||
|
||||
str
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
178
test/aviator/openstack/compute/v2/public/list_servers_test.rb
Normal file
178
test/aviator/openstack/compute/v2/public/list_servers_test.rb
Normal file
@@ -0,0 +1,178 @@
|
||||
require 'test_helper'
|
||||
|
||||
class Aviator::Test
|
||||
|
||||
describe 'aviator/openstack/compute/v2/public/list_servers' do
|
||||
|
||||
def create_request(session_data = new_session_data)
|
||||
klass.new(session_data)
|
||||
end
|
||||
|
||||
|
||||
def new_session_data
|
||||
service = Aviator::Service.new(
|
||||
provider: Environment.openstack_admin[:provider],
|
||||
service: Environment.openstack_admin[:auth_service][:name]
|
||||
)
|
||||
|
||||
bootstrap = RequestHelper.admin_bootstrap_session_data
|
||||
|
||||
response = service.request :create_token, session_data: bootstrap do |params|
|
||||
auth_credentials = Environment.openstack_admin[:auth_credentials]
|
||||
auth_credentials.each { |key, value| params[key] = auth_credentials[key] }
|
||||
end
|
||||
|
||||
response.body
|
||||
end
|
||||
|
||||
|
||||
def helper
|
||||
Aviator::Test::RequestHelper
|
||||
end
|
||||
|
||||
|
||||
def klass
|
||||
@klass ||= helper.load_request('openstack', 'compute', 'v2', 'public', 'list_servers.rb')
|
||||
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
|
||||
klass.body?.must_equal false
|
||||
create_request.body?.must_equal false
|
||||
end
|
||||
|
||||
|
||||
validate_attr :endpoint_type do
|
||||
klass.endpoint_type.must_equal :public
|
||||
end
|
||||
|
||||
|
||||
validate_attr :headers do
|
||||
session_data = new_session_data
|
||||
|
||||
headers = { 'X-Auth-Token' => session_data[:access][:token][:id] }
|
||||
|
||||
request = create_request(session_data)
|
||||
|
||||
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 [
|
||||
:details,
|
||||
:flavor,
|
||||
:image,
|
||||
:limit,
|
||||
:marker,
|
||||
:server,
|
||||
:status,
|
||||
'changes-since'
|
||||
]
|
||||
end
|
||||
|
||||
|
||||
validate_attr :required_params do
|
||||
klass.required_params.must_equal []
|
||||
end
|
||||
|
||||
|
||||
validate_attr :url do
|
||||
session_data = new_session_data
|
||||
service_spec = session_data[:access][:serviceCatalog].find{|s| s[:type] == 'compute' }
|
||||
url = "#{ service_spec[:endpoints][0][:publicURL] }/servers"
|
||||
|
||||
params = [
|
||||
[ :details, false ],
|
||||
[ :flavor, 'm1.small' ],
|
||||
[ :image, 'cirros-0.3.1-x86_64-uec-ramdisk' ],
|
||||
[ :status, 'ACTIVE' ]
|
||||
]
|
||||
|
||||
url += "/detail" if params.first[1]
|
||||
|
||||
filters = []
|
||||
|
||||
params[1, params.length-1].each { |pair| filters << "#{ pair[0] }=#{ pair[1] }" }
|
||||
|
||||
url += "?#{ filters.join('&') }" unless filters.empty?
|
||||
|
||||
request = klass.new(session_data) do |p|
|
||||
params.each { |pair| p[pair[0]] = pair[1] }
|
||||
end
|
||||
|
||||
|
||||
request.url.must_equal url
|
||||
end
|
||||
|
||||
|
||||
validate_response 'no parameters are provided' do
|
||||
service = Aviator::Service.new(
|
||||
provider: 'openstack',
|
||||
service: 'compute',
|
||||
default_session_data: new_session_data
|
||||
)
|
||||
|
||||
response = service.request :list_servers
|
||||
|
||||
response.status.must_equal 200
|
||||
response.body.wont_be_nil
|
||||
response.body[:servers].length.wont_equal 0
|
||||
response.headers.wont_be_nil
|
||||
end
|
||||
|
||||
|
||||
validate_response 'parameters are invalid' do
|
||||
service = Aviator::Service.new(
|
||||
provider: 'openstack',
|
||||
service: 'compute',
|
||||
default_session_data: new_session_data
|
||||
)
|
||||
|
||||
response = service.request :list_servers do |params|
|
||||
params[:image] = "nonexistentimagenameherpderp"
|
||||
end
|
||||
|
||||
response.status.must_equal 200
|
||||
response.body.wont_be_nil
|
||||
response.body[:servers].length.must_equal 0
|
||||
response.headers.wont_be_nil
|
||||
end
|
||||
|
||||
|
||||
validate_response 'parameters are valid' do
|
||||
service = Aviator::Service.new(
|
||||
provider: 'openstack',
|
||||
service: 'compute',
|
||||
default_session_data: new_session_data
|
||||
)
|
||||
|
||||
response = service.request :list_servers do |params|
|
||||
params[:details] = true
|
||||
params[:image] = 'c95d4992-24b1-4c9a-93cb-5d2935503148'
|
||||
end
|
||||
|
||||
response.status.must_equal 200
|
||||
response.body.wont_be_nil
|
||||
response.body[:servers].length.must_equal 1
|
||||
response.headers.wont_be_nil
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
@@ -0,0 +1,101 @@
|
||||
---
|
||||
http_interactions:
|
||||
- request:
|
||||
method: post
|
||||
uri: <HOST_URI>:5000/v2.0/tokens
|
||||
body:
|
||||
encoding: UTF-8
|
||||
string: ! '{"auth":{"passwordCredentials":{"username":"<USERNAME>","password":"<PASSWORD>"},"tenantName":"<TENANT>"}}'
|
||||
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:
|
||||
- '2749'
|
||||
date:
|
||||
- Tue, 03 Sep 2013 21:21:27 GMT
|
||||
connection:
|
||||
- close
|
||||
body:
|
||||
encoding: US-ASCII
|
||||
string: ! '{"access": {"token": {"issued_at": "2013-09-03T21:21:27.643220",
|
||||
"expires": "2013-09-04T03:21:27Z", "id": "f08ae852cdc54961bf8e048e7feeb122",
|
||||
"tenant": {"description": "System account for Morphlabs mCloud administration",
|
||||
"enabled": true, "id": "e7b1b62aa1474f758c4974b8be44cf6c", "name": "demo"}},
|
||||
"serviceCatalog": [{"endpoints": [{"adminURL": "<HOST_URI>:8774/v2/e7b1b62aa1474f758c4974b8be44cf6c",
|
||||
"region": "RegionOne", "internalURL": "<HOST_URI>:8774/v2/e7b1b62aa1474f758c4974b8be44cf6c",
|
||||
"id": "6bb597a3738045f4b2c51a7702037cab", "publicURL": "<HOST_URI>:8774/v2/e7b1b62aa1474f758c4974b8be44cf6c"}],
|
||||
"endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL":
|
||||
"<HOST_URI>:9292", "region": "RegionOne", "internalURL": "<HOST_URI>:9292",
|
||||
"id": "2985945e07b74103bb2dfef7e426cd43", "publicURL": "<HOST_URI>:9292"}],
|
||||
"endpoints_links": [], "type": "image", "name": "glance"}, {"endpoints": [{"adminURL":
|
||||
"<HOST_URI>:8777", "region": "RegionOne", "internalURL": "<HOST_URI>:8777",
|
||||
"id": "370119dd80e84894bfe83d766fd467dd", "publicURL": "<HOST_URI>:8777"}],
|
||||
"endpoints_links": [], "type": "metering", "name": "ceilometer"}, {"endpoints":
|
||||
[{"adminURL": "<HOST_URI>:8776/v1/e7b1b62aa1474f758c4974b8be44cf6c", "region":
|
||||
"RegionOne", "internalURL": "<HOST_URI>:8776/v1/e7b1b62aa1474f758c4974b8be44cf6c",
|
||||
"id": "2492a6f5fa80466d9312e51a8f79b638", "publicURL": "<HOST_URI>:8776/v1/e7b1b62aa1474f758c4974b8be44cf6c"}],
|
||||
"endpoints_links": [], "type": "volume", "name": "cinder"}, {"endpoints":
|
||||
[{"adminURL": "<HOST_URI>:8773/services/Admin", "region": "RegionOne", "internalURL":
|
||||
"<HOST_URI>:8773/services/Cloud", "id": "1f68f3ce931946c788e487443e772fb2",
|
||||
"publicURL": "<HOST_URI>:8773/services/Cloud"}], "endpoints_links": [], "type":
|
||||
"ec2", "name": "nova_ec2"}, {"endpoints": [{"adminURL": "<HOST_URI>:35357/v2.0",
|
||||
"region": "RegionOne", "internalURL": "<HOST_URI>:5000/v2.0", "id": "12c722e9b9fb471fbea83c6157c0123a",
|
||||
"publicURL": "<HOST_URI>:5000/v2.0"}], "endpoints_links": [], "type": "identity",
|
||||
"name": "keystone"}], "user": {"username": "morphadmin", "roles_links": [],
|
||||
"id": "87f34120be394c598520744d0f4a8233", "roles": [{"name": "Member"}, {"name":
|
||||
"admin"}, {"name": "project_manager"}], "name": "morphadmin"}, "metadata":
|
||||
{"is_admin": 0, "roles": ["f970c227c0ee4512899606886348f67f", "a0d6ba8f41b746b495a6d25c69962489",
|
||||
"88141c3fd5cd48459cfe1243bfa6d4e1"]}}}'
|
||||
http_version:
|
||||
recorded_at: Tue, 03 Sep 2013 21:21:27 GMT
|
||||
- request:
|
||||
method: get
|
||||
uri: <HOST_URI>:8774/v2/e7b1b62aa1474f758c4974b8be44cf6c/servers
|
||||
body:
|
||||
encoding: US-ASCII
|
||||
string: ''
|
||||
headers:
|
||||
Content-Type:
|
||||
- application/json
|
||||
User-Agent:
|
||||
- Faraday v0.8.8
|
||||
X-Auth-Token:
|
||||
- f08ae852cdc54961bf8e048e7feeb122
|
||||
response:
|
||||
status:
|
||||
code: 200
|
||||
message:
|
||||
headers:
|
||||
x-compute-request-id:
|
||||
- req-a29e1a74-515d-4ebe-8a08-6a9e68ea2316
|
||||
content-type:
|
||||
- application/json
|
||||
content-length:
|
||||
- '753'
|
||||
date:
|
||||
- Tue, 03 Sep 2013 21:21:28 GMT
|
||||
connection:
|
||||
- close
|
||||
body:
|
||||
encoding: US-ASCII
|
||||
string: ! '{"servers": [{"id": "2b8b852f-df7a-496e-b480-d2eea625016b", "links":
|
||||
[{"href": "<HOST_URI>:8774/v2/e7b1b62aa1474f758c4974b8be44cf6c/servers/2b8b852f-df7a-496e-b480-d2eea625016b",
|
||||
"rel": "self"}, {"href": "<HOST_URI>:8774/e7b1b62aa1474f758c4974b8be44cf6c/servers/2b8b852f-df7a-496e-b480-d2eea625016b",
|
||||
"rel": "bookmark"}], "name": "launching"}, {"id": "41b7cac5-f718-4a3c-a727-5edf0f69ff70",
|
||||
"links": [{"href": "<HOST_URI>:8774/v2/e7b1b62aa1474f758c4974b8be44cf6c/servers/41b7cac5-f718-4a3c-a727-5edf0f69ff70",
|
||||
"rel": "self"}, {"href": "<HOST_URI>:8774/e7b1b62aa1474f758c4974b8be44cf6c/servers/41b7cac5-f718-4a3c-a727-5edf0f69ff70",
|
||||
"rel": "bookmark"}], "name": "test101"}]}'
|
||||
http_version:
|
||||
recorded_at: Tue, 03 Sep 2013 21:21:28 GMT
|
||||
recorded_with: VCR 2.5.0
|
||||
@@ -0,0 +1,95 @@
|
||||
---
|
||||
http_interactions:
|
||||
- request:
|
||||
method: post
|
||||
uri: <HOST_URI>:5000/v2.0/tokens
|
||||
body:
|
||||
encoding: UTF-8
|
||||
string: ! '{"auth":{"passwordCredentials":{"username":"<USERNAME>","password":"<PASSWORD>"},"tenantName":"<TENANT>"}}'
|
||||
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:
|
||||
- '2749'
|
||||
date:
|
||||
- Tue, 03 Sep 2013 21:24:31 GMT
|
||||
connection:
|
||||
- close
|
||||
body:
|
||||
encoding: US-ASCII
|
||||
string: ! '{"access": {"token": {"issued_at": "2013-09-03T21:24:31.344753",
|
||||
"expires": "2013-09-04T03:24:31Z", "id": "e32225931f064f1cbec963a362dd9a5f",
|
||||
"tenant": {"description": "System account for Morphlabs mCloud administration",
|
||||
"enabled": true, "id": "e7b1b62aa1474f758c4974b8be44cf6c", "name": "demo"}},
|
||||
"serviceCatalog": [{"endpoints": [{"adminURL": "<HOST_URI>:8774/v2/e7b1b62aa1474f758c4974b8be44cf6c",
|
||||
"region": "RegionOne", "internalURL": "<HOST_URI>:8774/v2/e7b1b62aa1474f758c4974b8be44cf6c",
|
||||
"id": "6bb597a3738045f4b2c51a7702037cab", "publicURL": "<HOST_URI>:8774/v2/e7b1b62aa1474f758c4974b8be44cf6c"}],
|
||||
"endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL":
|
||||
"<HOST_URI>:9292", "region": "RegionOne", "internalURL": "<HOST_URI>:9292",
|
||||
"id": "2985945e07b74103bb2dfef7e426cd43", "publicURL": "<HOST_URI>:9292"}],
|
||||
"endpoints_links": [], "type": "image", "name": "glance"}, {"endpoints": [{"adminURL":
|
||||
"<HOST_URI>:8777", "region": "RegionOne", "internalURL": "<HOST_URI>:8777",
|
||||
"id": "370119dd80e84894bfe83d766fd467dd", "publicURL": "<HOST_URI>:8777"}],
|
||||
"endpoints_links": [], "type": "metering", "name": "ceilometer"}, {"endpoints":
|
||||
[{"adminURL": "<HOST_URI>:8776/v1/e7b1b62aa1474f758c4974b8be44cf6c", "region":
|
||||
"RegionOne", "internalURL": "<HOST_URI>:8776/v1/e7b1b62aa1474f758c4974b8be44cf6c",
|
||||
"id": "2492a6f5fa80466d9312e51a8f79b638", "publicURL": "<HOST_URI>:8776/v1/e7b1b62aa1474f758c4974b8be44cf6c"}],
|
||||
"endpoints_links": [], "type": "volume", "name": "cinder"}, {"endpoints":
|
||||
[{"adminURL": "<HOST_URI>:8773/services/Admin", "region": "RegionOne", "internalURL":
|
||||
"<HOST_URI>:8773/services/Cloud", "id": "1f68f3ce931946c788e487443e772fb2",
|
||||
"publicURL": "<HOST_URI>:8773/services/Cloud"}], "endpoints_links": [], "type":
|
||||
"ec2", "name": "nova_ec2"}, {"endpoints": [{"adminURL": "<HOST_URI>:35357/v2.0",
|
||||
"region": "RegionOne", "internalURL": "<HOST_URI>:5000/v2.0", "id": "12c722e9b9fb471fbea83c6157c0123a",
|
||||
"publicURL": "<HOST_URI>:5000/v2.0"}], "endpoints_links": [], "type": "identity",
|
||||
"name": "keystone"}], "user": {"username": "morphadmin", "roles_links": [],
|
||||
"id": "87f34120be394c598520744d0f4a8233", "roles": [{"name": "Member"}, {"name":
|
||||
"admin"}, {"name": "project_manager"}], "name": "morphadmin"}, "metadata":
|
||||
{"is_admin": 0, "roles": ["f970c227c0ee4512899606886348f67f", "a0d6ba8f41b746b495a6d25c69962489",
|
||||
"88141c3fd5cd48459cfe1243bfa6d4e1"]}}}'
|
||||
http_version:
|
||||
recorded_at: Tue, 03 Sep 2013 21:24:31 GMT
|
||||
- request:
|
||||
method: get
|
||||
uri: <HOST_URI>:8774/v2/e7b1b62aa1474f758c4974b8be44cf6c/servers?image=nonexistentimagenameherpderp
|
||||
body:
|
||||
encoding: US-ASCII
|
||||
string: ''
|
||||
headers:
|
||||
Content-Type:
|
||||
- application/json
|
||||
User-Agent:
|
||||
- Faraday v0.8.8
|
||||
X-Auth-Token:
|
||||
- e32225931f064f1cbec963a362dd9a5f
|
||||
response:
|
||||
status:
|
||||
code: 200
|
||||
message:
|
||||
headers:
|
||||
x-compute-request-id:
|
||||
- req-7a1bee45-7627-49df-ac1d-0fbb3b57fcb3
|
||||
content-type:
|
||||
- application/json
|
||||
content-length:
|
||||
- '15'
|
||||
date:
|
||||
- Tue, 03 Sep 2013 21:24:31 GMT
|
||||
connection:
|
||||
- close
|
||||
body:
|
||||
encoding: US-ASCII
|
||||
string: ! '{"servers": []}'
|
||||
http_version:
|
||||
recorded_at: Tue, 03 Sep 2013 21:24:31 GMT
|
||||
recorded_with: VCR 2.5.0
|
||||
@@ -0,0 +1,109 @@
|
||||
---
|
||||
http_interactions:
|
||||
- request:
|
||||
method: post
|
||||
uri: <HOST_URI>:5000/v2.0/tokens
|
||||
body:
|
||||
encoding: UTF-8
|
||||
string: ! '{"auth":{"passwordCredentials":{"username":"<USERNAME>","password":"<PASSWORD>"},"tenantName":"<TENANT>"}}'
|
||||
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:
|
||||
- '2749'
|
||||
date:
|
||||
- Tue, 03 Sep 2013 21:27:08 GMT
|
||||
connection:
|
||||
- close
|
||||
body:
|
||||
encoding: US-ASCII
|
||||
string: ! '{"access": {"token": {"issued_at": "2013-09-03T21:27:08.696582",
|
||||
"expires": "2013-09-04T03:27:08Z", "id": "df7fc83f89ba4d07b24c86fddb33c5f5",
|
||||
"tenant": {"description": "System account for Morphlabs mCloud administration",
|
||||
"enabled": true, "id": "e7b1b62aa1474f758c4974b8be44cf6c", "name": "demo"}},
|
||||
"serviceCatalog": [{"endpoints": [{"adminURL": "<HOST_URI>:8774/v2/e7b1b62aa1474f758c4974b8be44cf6c",
|
||||
"region": "RegionOne", "internalURL": "<HOST_URI>:8774/v2/e7b1b62aa1474f758c4974b8be44cf6c",
|
||||
"id": "6bb597a3738045f4b2c51a7702037cab", "publicURL": "<HOST_URI>:8774/v2/e7b1b62aa1474f758c4974b8be44cf6c"}],
|
||||
"endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL":
|
||||
"<HOST_URI>:9292", "region": "RegionOne", "internalURL": "<HOST_URI>:9292",
|
||||
"id": "2985945e07b74103bb2dfef7e426cd43", "publicURL": "<HOST_URI>:9292"}],
|
||||
"endpoints_links": [], "type": "image", "name": "glance"}, {"endpoints": [{"adminURL":
|
||||
"<HOST_URI>:8777", "region": "RegionOne", "internalURL": "<HOST_URI>:8777",
|
||||
"id": "370119dd80e84894bfe83d766fd467dd", "publicURL": "<HOST_URI>:8777"}],
|
||||
"endpoints_links": [], "type": "metering", "name": "ceilometer"}, {"endpoints":
|
||||
[{"adminURL": "<HOST_URI>:8776/v1/e7b1b62aa1474f758c4974b8be44cf6c", "region":
|
||||
"RegionOne", "internalURL": "<HOST_URI>:8776/v1/e7b1b62aa1474f758c4974b8be44cf6c",
|
||||
"id": "2492a6f5fa80466d9312e51a8f79b638", "publicURL": "<HOST_URI>:8776/v1/e7b1b62aa1474f758c4974b8be44cf6c"}],
|
||||
"endpoints_links": [], "type": "volume", "name": "cinder"}, {"endpoints":
|
||||
[{"adminURL": "<HOST_URI>:8773/services/Admin", "region": "RegionOne", "internalURL":
|
||||
"<HOST_URI>:8773/services/Cloud", "id": "1f68f3ce931946c788e487443e772fb2",
|
||||
"publicURL": "<HOST_URI>:8773/services/Cloud"}], "endpoints_links": [], "type":
|
||||
"ec2", "name": "nova_ec2"}, {"endpoints": [{"adminURL": "<HOST_URI>:35357/v2.0",
|
||||
"region": "RegionOne", "internalURL": "<HOST_URI>:5000/v2.0", "id": "12c722e9b9fb471fbea83c6157c0123a",
|
||||
"publicURL": "<HOST_URI>:5000/v2.0"}], "endpoints_links": [], "type": "identity",
|
||||
"name": "keystone"}], "user": {"username": "morphadmin", "roles_links": [],
|
||||
"id": "87f34120be394c598520744d0f4a8233", "roles": [{"name": "Member"}, {"name":
|
||||
"admin"}, {"name": "project_manager"}], "name": "morphadmin"}, "metadata":
|
||||
{"is_admin": 0, "roles": ["f970c227c0ee4512899606886348f67f", "a0d6ba8f41b746b495a6d25c69962489",
|
||||
"88141c3fd5cd48459cfe1243bfa6d4e1"]}}}'
|
||||
http_version:
|
||||
recorded_at: Tue, 03 Sep 2013 21:27:08 GMT
|
||||
- request:
|
||||
method: get
|
||||
uri: <HOST_URI>:8774/v2/e7b1b62aa1474f758c4974b8be44cf6c/servers/detail?image=c95d4992-24b1-4c9a-93cb-5d2935503148
|
||||
body:
|
||||
encoding: US-ASCII
|
||||
string: ''
|
||||
headers:
|
||||
Content-Type:
|
||||
- application/json
|
||||
User-Agent:
|
||||
- Faraday v0.8.8
|
||||
X-Auth-Token:
|
||||
- df7fc83f89ba4d07b24c86fddb33c5f5
|
||||
response:
|
||||
status:
|
||||
code: 200
|
||||
message:
|
||||
headers:
|
||||
x-compute-request-id:
|
||||
- req-293d592c-136b-4a6c-8b22-ab37e1036b11
|
||||
content-type:
|
||||
- application/json
|
||||
content-length:
|
||||
- '1578'
|
||||
date:
|
||||
- Tue, 03 Sep 2013 21:27:10 GMT
|
||||
connection:
|
||||
- close
|
||||
body:
|
||||
encoding: US-ASCII
|
||||
string: ! '{"servers": [{"status": "ACTIVE", "updated": "2013-08-05T07:10:50Z",
|
||||
"hostId": "199dd5dd1a58ad0485af047fe8ef2dbe13ed8bd69283f3aad90fc512", "OS-EXT-SRV-ATTR:host":
|
||||
"cn26.la-1-2.morphlabs.net", "addresses": {"novanetwork": [{"version": 4,
|
||||
"addr": "10.2.0.15", "OS-EXT-IPS:type": "fixed"}]}, "links": [{"href": "<HOST_URI>:8774/v2/e7b1b62aa1474f758c4974b8be44cf6c/servers/2b8b852f-df7a-496e-b480-d2eea625016b",
|
||||
"rel": "self"}, {"href": "<HOST_URI>:8774/e7b1b62aa1474f758c4974b8be44cf6c/servers/2b8b852f-df7a-496e-b480-d2eea625016b",
|
||||
"rel": "bookmark"}], "key_name": "", "image": {"id": "c95d4992-24b1-4c9a-93cb-5d2935503148",
|
||||
"links": [{"href": "<HOST_URI>:8774/e7b1b62aa1474f758c4974b8be44cf6c/images/c95d4992-24b1-4c9a-93cb-5d2935503148",
|
||||
"rel": "bookmark"}]}, "OS-EXT-STS:task_state": null, "OS-EXT-STS:vm_state":
|
||||
"active", "OS-EXT-SRV-ATTR:instance_name": "instance-00000018", "OS-EXT-SRV-ATTR:hypervisor_hostname":
|
||||
"cn26.la-1-2.morphlabs.net", "flavor": {"id": "2", "links": [{"href": "<HOST_URI>:8774/e7b1b62aa1474f758c4974b8be44cf6c/flavors/2",
|
||||
"rel": "bookmark"}]}, "id": "2b8b852f-df7a-496e-b480-d2eea625016b", "security_groups":
|
||||
[{"name": "default"}], "OS-EXT-AZ:availability_zone": "nova", "user_id": "ab263d5e1c6343bd9d56d694a71e8ac0",
|
||||
"name": "launching", "created": "2013-08-05T07:08:41Z", "tenant_id": "e7b1b62aa1474f758c4974b8be44cf6c",
|
||||
"OS-DCF:diskConfig": "MANUAL", "accessIPv4": "", "accessIPv6": "", "progress":
|
||||
0, "OS-EXT-STS:power_state": 1, "config_drive": "", "metadata": {}}]}'
|
||||
http_version:
|
||||
recorded_at: Tue, 03 Sep 2013 21:27:10 GMT
|
||||
recorded_with: VCR 2.5.0
|
||||
@@ -0,0 +1,62 @@
|
||||
---
|
||||
http_interactions:
|
||||
- request:
|
||||
method: post
|
||||
uri: <HOST_URI>:5000/v2.0/tokens
|
||||
body:
|
||||
encoding: UTF-8
|
||||
string: ! '{"auth":{"passwordCredentials":{"username":"<USERNAME>","password":"<PASSWORD>"},"tenantName":"<TENANT>"}}'
|
||||
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:
|
||||
- '2749'
|
||||
date:
|
||||
- Tue, 03 Sep 2013 21:21:30 GMT
|
||||
connection:
|
||||
- close
|
||||
body:
|
||||
encoding: US-ASCII
|
||||
string: ! '{"access": {"token": {"issued_at": "2013-09-03T21:21:30.309056",
|
||||
"expires": "2013-09-04T03:21:30Z", "id": "1df8146f7ba34ab7a311157433cf079b",
|
||||
"tenant": {"description": "System account for Morphlabs mCloud administration",
|
||||
"enabled": true, "id": "e7b1b62aa1474f758c4974b8be44cf6c", "name": "demo"}},
|
||||
"serviceCatalog": [{"endpoints": [{"adminURL": "<HOST_URI>:8774/v2/e7b1b62aa1474f758c4974b8be44cf6c",
|
||||
"region": "RegionOne", "internalURL": "<HOST_URI>:8774/v2/e7b1b62aa1474f758c4974b8be44cf6c",
|
||||
"id": "6bb597a3738045f4b2c51a7702037cab", "publicURL": "<HOST_URI>:8774/v2/e7b1b62aa1474f758c4974b8be44cf6c"}],
|
||||
"endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL":
|
||||
"<HOST_URI>:9292", "region": "RegionOne", "internalURL": "<HOST_URI>:9292",
|
||||
"id": "2985945e07b74103bb2dfef7e426cd43", "publicURL": "<HOST_URI>:9292"}],
|
||||
"endpoints_links": [], "type": "image", "name": "glance"}, {"endpoints": [{"adminURL":
|
||||
"<HOST_URI>:8777", "region": "RegionOne", "internalURL": "<HOST_URI>:8777",
|
||||
"id": "370119dd80e84894bfe83d766fd467dd", "publicURL": "<HOST_URI>:8777"}],
|
||||
"endpoints_links": [], "type": "metering", "name": "ceilometer"}, {"endpoints":
|
||||
[{"adminURL": "<HOST_URI>:8776/v1/e7b1b62aa1474f758c4974b8be44cf6c", "region":
|
||||
"RegionOne", "internalURL": "<HOST_URI>:8776/v1/e7b1b62aa1474f758c4974b8be44cf6c",
|
||||
"id": "2492a6f5fa80466d9312e51a8f79b638", "publicURL": "<HOST_URI>:8776/v1/e7b1b62aa1474f758c4974b8be44cf6c"}],
|
||||
"endpoints_links": [], "type": "volume", "name": "cinder"}, {"endpoints":
|
||||
[{"adminURL": "<HOST_URI>:8773/services/Admin", "region": "RegionOne", "internalURL":
|
||||
"<HOST_URI>:8773/services/Cloud", "id": "1f68f3ce931946c788e487443e772fb2",
|
||||
"publicURL": "<HOST_URI>:8773/services/Cloud"}], "endpoints_links": [], "type":
|
||||
"ec2", "name": "nova_ec2"}, {"endpoints": [{"adminURL": "<HOST_URI>:35357/v2.0",
|
||||
"region": "RegionOne", "internalURL": "<HOST_URI>:5000/v2.0", "id": "12c722e9b9fb471fbea83c6157c0123a",
|
||||
"publicURL": "<HOST_URI>:5000/v2.0"}], "endpoints_links": [], "type": "identity",
|
||||
"name": "keystone"}], "user": {"username": "morphadmin", "roles_links": [],
|
||||
"id": "87f34120be394c598520744d0f4a8233", "roles": [{"name": "Member"}, {"name":
|
||||
"admin"}, {"name": "project_manager"}], "name": "morphadmin"}, "metadata":
|
||||
{"is_admin": 0, "roles": ["f970c227c0ee4512899606886348f67f", "a0d6ba8f41b746b495a6d25c69962489",
|
||||
"88141c3fd5cd48459cfe1243bfa6d4e1"]}}}'
|
||||
http_version:
|
||||
recorded_at: Tue, 03 Sep 2013 21:21:30 GMT
|
||||
recorded_with: VCR 2.5.0
|
||||
@@ -0,0 +1,62 @@
|
||||
---
|
||||
http_interactions:
|
||||
- request:
|
||||
method: post
|
||||
uri: <HOST_URI>:5000/v2.0/tokens
|
||||
body:
|
||||
encoding: UTF-8
|
||||
string: ! '{"auth":{"passwordCredentials":{"username":"<USERNAME>","password":"<PASSWORD>"},"tenantName":"<TENANT>"}}'
|
||||
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:
|
||||
- '2749'
|
||||
date:
|
||||
- Tue, 03 Sep 2013 21:21:29 GMT
|
||||
connection:
|
||||
- close
|
||||
body:
|
||||
encoding: US-ASCII
|
||||
string: ! '{"access": {"token": {"issued_at": "2013-09-03T21:21:29.361372",
|
||||
"expires": "2013-09-04T03:21:29Z", "id": "be886bbd36a441369561da14b1a1993d",
|
||||
"tenant": {"description": "System account for Morphlabs mCloud administration",
|
||||
"enabled": true, "id": "e7b1b62aa1474f758c4974b8be44cf6c", "name": "demo"}},
|
||||
"serviceCatalog": [{"endpoints": [{"adminURL": "<HOST_URI>:8774/v2/e7b1b62aa1474f758c4974b8be44cf6c",
|
||||
"region": "RegionOne", "internalURL": "<HOST_URI>:8774/v2/e7b1b62aa1474f758c4974b8be44cf6c",
|
||||
"id": "6bb597a3738045f4b2c51a7702037cab", "publicURL": "<HOST_URI>:8774/v2/e7b1b62aa1474f758c4974b8be44cf6c"}],
|
||||
"endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL":
|
||||
"<HOST_URI>:9292", "region": "RegionOne", "internalURL": "<HOST_URI>:9292",
|
||||
"id": "2985945e07b74103bb2dfef7e426cd43", "publicURL": "<HOST_URI>:9292"}],
|
||||
"endpoints_links": [], "type": "image", "name": "glance"}, {"endpoints": [{"adminURL":
|
||||
"<HOST_URI>:8777", "region": "RegionOne", "internalURL": "<HOST_URI>:8777",
|
||||
"id": "370119dd80e84894bfe83d766fd467dd", "publicURL": "<HOST_URI>:8777"}],
|
||||
"endpoints_links": [], "type": "metering", "name": "ceilometer"}, {"endpoints":
|
||||
[{"adminURL": "<HOST_URI>:8776/v1/e7b1b62aa1474f758c4974b8be44cf6c", "region":
|
||||
"RegionOne", "internalURL": "<HOST_URI>:8776/v1/e7b1b62aa1474f758c4974b8be44cf6c",
|
||||
"id": "2492a6f5fa80466d9312e51a8f79b638", "publicURL": "<HOST_URI>:8776/v1/e7b1b62aa1474f758c4974b8be44cf6c"}],
|
||||
"endpoints_links": [], "type": "volume", "name": "cinder"}, {"endpoints":
|
||||
[{"adminURL": "<HOST_URI>:8773/services/Admin", "region": "RegionOne", "internalURL":
|
||||
"<HOST_URI>:8773/services/Cloud", "id": "1f68f3ce931946c788e487443e772fb2",
|
||||
"publicURL": "<HOST_URI>:8773/services/Cloud"}], "endpoints_links": [], "type":
|
||||
"ec2", "name": "nova_ec2"}, {"endpoints": [{"adminURL": "<HOST_URI>:35357/v2.0",
|
||||
"region": "RegionOne", "internalURL": "<HOST_URI>:5000/v2.0", "id": "12c722e9b9fb471fbea83c6157c0123a",
|
||||
"publicURL": "<HOST_URI>:5000/v2.0"}], "endpoints_links": [], "type": "identity",
|
||||
"name": "keystone"}], "user": {"username": "morphadmin", "roles_links": [],
|
||||
"id": "87f34120be394c598520744d0f4a8233", "roles": [{"name": "Member"}, {"name":
|
||||
"admin"}, {"name": "project_manager"}], "name": "morphadmin"}, "metadata":
|
||||
{"is_admin": 0, "roles": ["f970c227c0ee4512899606886348f67f", "a0d6ba8f41b746b495a6d25c69962489",
|
||||
"88141c3fd5cd48459cfe1243bfa6d4e1"]}}}'
|
||||
http_version:
|
||||
recorded_at: Tue, 03 Sep 2013 21:21:29 GMT
|
||||
recorded_with: VCR 2.5.0
|
||||
@@ -0,0 +1,62 @@
|
||||
---
|
||||
http_interactions:
|
||||
- request:
|
||||
method: post
|
||||
uri: <HOST_URI>:5000/v2.0/tokens
|
||||
body:
|
||||
encoding: UTF-8
|
||||
string: ! '{"auth":{"passwordCredentials":{"username":"<USERNAME>","password":"<PASSWORD>"},"tenantName":"<TENANT>"}}'
|
||||
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:
|
||||
- '2749'
|
||||
date:
|
||||
- Tue, 03 Sep 2013 21:21:26 GMT
|
||||
connection:
|
||||
- close
|
||||
body:
|
||||
encoding: US-ASCII
|
||||
string: ! '{"access": {"token": {"issued_at": "2013-09-03T21:21:26.618764",
|
||||
"expires": "2013-09-04T03:21:26Z", "id": "cc555b6c5ddb4f9db10fc863e26edfa1",
|
||||
"tenant": {"description": "System account for Morphlabs mCloud administration",
|
||||
"enabled": true, "id": "e7b1b62aa1474f758c4974b8be44cf6c", "name": "demo"}},
|
||||
"serviceCatalog": [{"endpoints": [{"adminURL": "<HOST_URI>:8774/v2/e7b1b62aa1474f758c4974b8be44cf6c",
|
||||
"region": "RegionOne", "internalURL": "<HOST_URI>:8774/v2/e7b1b62aa1474f758c4974b8be44cf6c",
|
||||
"id": "6bb597a3738045f4b2c51a7702037cab", "publicURL": "<HOST_URI>:8774/v2/e7b1b62aa1474f758c4974b8be44cf6c"}],
|
||||
"endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL":
|
||||
"<HOST_URI>:9292", "region": "RegionOne", "internalURL": "<HOST_URI>:9292",
|
||||
"id": "2985945e07b74103bb2dfef7e426cd43", "publicURL": "<HOST_URI>:9292"}],
|
||||
"endpoints_links": [], "type": "image", "name": "glance"}, {"endpoints": [{"adminURL":
|
||||
"<HOST_URI>:8777", "region": "RegionOne", "internalURL": "<HOST_URI>:8777",
|
||||
"id": "370119dd80e84894bfe83d766fd467dd", "publicURL": "<HOST_URI>:8777"}],
|
||||
"endpoints_links": [], "type": "metering", "name": "ceilometer"}, {"endpoints":
|
||||
[{"adminURL": "<HOST_URI>:8776/v1/e7b1b62aa1474f758c4974b8be44cf6c", "region":
|
||||
"RegionOne", "internalURL": "<HOST_URI>:8776/v1/e7b1b62aa1474f758c4974b8be44cf6c",
|
||||
"id": "2492a6f5fa80466d9312e51a8f79b638", "publicURL": "<HOST_URI>:8776/v1/e7b1b62aa1474f758c4974b8be44cf6c"}],
|
||||
"endpoints_links": [], "type": "volume", "name": "cinder"}, {"endpoints":
|
||||
[{"adminURL": "<HOST_URI>:8773/services/Admin", "region": "RegionOne", "internalURL":
|
||||
"<HOST_URI>:8773/services/Cloud", "id": "1f68f3ce931946c788e487443e772fb2",
|
||||
"publicURL": "<HOST_URI>:8773/services/Cloud"}], "endpoints_links": [], "type":
|
||||
"ec2", "name": "nova_ec2"}, {"endpoints": [{"adminURL": "<HOST_URI>:35357/v2.0",
|
||||
"region": "RegionOne", "internalURL": "<HOST_URI>:5000/v2.0", "id": "12c722e9b9fb471fbea83c6157c0123a",
|
||||
"publicURL": "<HOST_URI>:5000/v2.0"}], "endpoints_links": [], "type": "identity",
|
||||
"name": "keystone"}], "user": {"username": "morphadmin", "roles_links": [],
|
||||
"id": "87f34120be394c598520744d0f4a8233", "roles": [{"name": "Member"}, {"name":
|
||||
"admin"}, {"name": "project_manager"}], "name": "morphadmin"}, "metadata":
|
||||
{"is_admin": 0, "roles": ["f970c227c0ee4512899606886348f67f", "a0d6ba8f41b746b495a6d25c69962489",
|
||||
"88141c3fd5cd48459cfe1243bfa6d4e1"]}}}'
|
||||
http_version:
|
||||
recorded_at: Tue, 03 Sep 2013 21:21:26 GMT
|
||||
recorded_with: VCR 2.5.0
|
||||
@@ -0,0 +1,62 @@
|
||||
---
|
||||
http_interactions:
|
||||
- request:
|
||||
method: post
|
||||
uri: <HOST_URI>:5000/v2.0/tokens
|
||||
body:
|
||||
encoding: UTF-8
|
||||
string: ! '{"auth":{"passwordCredentials":{"username":"<USERNAME>","password":"<PASSWORD>"},"tenantName":"<TENANT>"}}'
|
||||
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:
|
||||
- '2749'
|
||||
date:
|
||||
- Tue, 03 Sep 2013 21:21:31 GMT
|
||||
connection:
|
||||
- close
|
||||
body:
|
||||
encoding: US-ASCII
|
||||
string: ! '{"access": {"token": {"issued_at": "2013-09-03T21:21:31.135715",
|
||||
"expires": "2013-09-04T03:21:31Z", "id": "92b81d51dd0249a4a375123a37eb4c65",
|
||||
"tenant": {"description": "System account for Morphlabs mCloud administration",
|
||||
"enabled": true, "id": "e7b1b62aa1474f758c4974b8be44cf6c", "name": "demo"}},
|
||||
"serviceCatalog": [{"endpoints": [{"adminURL": "<HOST_URI>:8774/v2/e7b1b62aa1474f758c4974b8be44cf6c",
|
||||
"region": "RegionOne", "internalURL": "<HOST_URI>:8774/v2/e7b1b62aa1474f758c4974b8be44cf6c",
|
||||
"id": "6bb597a3738045f4b2c51a7702037cab", "publicURL": "<HOST_URI>:8774/v2/e7b1b62aa1474f758c4974b8be44cf6c"}],
|
||||
"endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL":
|
||||
"<HOST_URI>:9292", "region": "RegionOne", "internalURL": "<HOST_URI>:9292",
|
||||
"id": "2985945e07b74103bb2dfef7e426cd43", "publicURL": "<HOST_URI>:9292"}],
|
||||
"endpoints_links": [], "type": "image", "name": "glance"}, {"endpoints": [{"adminURL":
|
||||
"<HOST_URI>:8777", "region": "RegionOne", "internalURL": "<HOST_URI>:8777",
|
||||
"id": "370119dd80e84894bfe83d766fd467dd", "publicURL": "<HOST_URI>:8777"}],
|
||||
"endpoints_links": [], "type": "metering", "name": "ceilometer"}, {"endpoints":
|
||||
[{"adminURL": "<HOST_URI>:8776/v1/e7b1b62aa1474f758c4974b8be44cf6c", "region":
|
||||
"RegionOne", "internalURL": "<HOST_URI>:8776/v1/e7b1b62aa1474f758c4974b8be44cf6c",
|
||||
"id": "2492a6f5fa80466d9312e51a8f79b638", "publicURL": "<HOST_URI>:8776/v1/e7b1b62aa1474f758c4974b8be44cf6c"}],
|
||||
"endpoints_links": [], "type": "volume", "name": "cinder"}, {"endpoints":
|
||||
[{"adminURL": "<HOST_URI>:8773/services/Admin", "region": "RegionOne", "internalURL":
|
||||
"<HOST_URI>:8773/services/Cloud", "id": "1f68f3ce931946c788e487443e772fb2",
|
||||
"publicURL": "<HOST_URI>:8773/services/Cloud"}], "endpoints_links": [], "type":
|
||||
"ec2", "name": "nova_ec2"}, {"endpoints": [{"adminURL": "<HOST_URI>:35357/v2.0",
|
||||
"region": "RegionOne", "internalURL": "<HOST_URI>:5000/v2.0", "id": "12c722e9b9fb471fbea83c6157c0123a",
|
||||
"publicURL": "<HOST_URI>:5000/v2.0"}], "endpoints_links": [], "type": "identity",
|
||||
"name": "keystone"}], "user": {"username": "morphadmin", "roles_links": [],
|
||||
"id": "87f34120be394c598520744d0f4a8233", "roles": [{"name": "Member"}, {"name":
|
||||
"admin"}, {"name": "project_manager"}], "name": "morphadmin"}, "metadata":
|
||||
{"is_admin": 0, "roles": ["f970c227c0ee4512899606886348f67f", "a0d6ba8f41b746b495a6d25c69962489",
|
||||
"88141c3fd5cd48459cfe1243bfa6d4e1"]}}}'
|
||||
http_version:
|
||||
recorded_at: Tue, 03 Sep 2013 21:21:31 GMT
|
||||
recorded_with: VCR 2.5.0
|
||||
Reference in New Issue
Block a user