From: Martyn Taylor <mtaylor(a)redhat.com>
---
lib/aeolus_cli/command/list_command.rb | 197 +++++++++---------
spec/command/list_command_spec.rb | 113 ++++++++++-
.../command/list_command/list_all_accounts.yml | 81 +++++++
.../list_command/list_all_builds_for_image.yml | 40 ++++
.../command/list_command/list_all_images.yml | 227 ++++++++++++++++++++
.../list_all_provider_images_for_target_image.yml | 44 ++++
.../command/list_command/list_all_providers.yml | 43 ++++
.../list_all_target_images_for_build.yml | 45 ++++
.../command/list_command/list_all_targets.yml | 69 ++++++
9 files changed, 758 insertions(+), 101 deletions(-)
create mode 100644 spec/vcr/cassettes/command/list_command/list_all_accounts.yml
create mode 100644 spec/vcr/cassettes/command/list_command/list_all_builds_for_image.yml
create mode 100644 spec/vcr/cassettes/command/list_command/list_all_images.yml
create mode 100644
spec/vcr/cassettes/command/list_command/list_all_provider_images_for_target_image.yml
create mode 100644 spec/vcr/cassettes/command/list_command/list_all_providers.yml
create mode 100644
spec/vcr/cassettes/command/list_command/list_all_target_images_for_build.yml
create mode 100644 spec/vcr/cassettes/command/list_command/list_all_targets.yml
diff --git a/lib/aeolus_cli/command/list_command.rb
b/lib/aeolus_cli/command/list_command.rb
index 09d029e..fbc4ee4 100644
--- a/lib/aeolus_cli/command/list_command.rb
+++ b/lib/aeolus_cli/command/list_command.rb
@@ -20,144 +20,141 @@ module Aeolus
end
def images
- check_bucket_exists("images")
- images = [["IMAGE ID", "LASTEST PUSHED BUILD",
"NAME", "OS", "OS VERSION", "ARCH",
"DESCRIPTION"]]
- Image.all.each do |i|
- images << [i.uuid, (i.latest_pushed_build.nil? ? "" :
i.latest_pushed_build.uuid), i.name, i.os.name, i.os.version, i.os.arch, i.description]
+ begin
+ headers = ActiveSupport::OrderedHash.new
+ headers[:id] = "ID"
+ headers[:name] = "Name"
+ headers[:os] = "OS"
+ headers[:os_version] = "OS Version"
+ headers[:arch] = "Arch"
+ headers[:description] = "Description"
+ print_collection(Aeolus::CLI::Image.all, headers)
+ quit(0)
+ rescue => e
+ handle_exception(e)
end
- format_print(images)
- quit(0)
end
def builds
- builds = [["Build ID"]]
- image = Image.find(@options[:id])
- if image
- image.image_builds.each do |b|
- builds << [b.uuid]
- end
- format_print(builds)
- else
- puts "ERROR: could not find Image with ID: " + options[:id]
+ begin
+ headers = ActiveSupport::OrderedHash.new
+ headers[:id] = "ID"
+ headers[:image] = "Image"
+ collection = @options[:id].nil? ? Aeolus::CLI::Build.all :
Aeolus::CLI::Build.find(:all, :from => Aeolus::CLI::Base.site.path +
"/images/" + @options[:id] + "/builds.xml")
+ print_collection(collection, headers)
+ quit(0)
+ rescue => e
+ handle_exception(e)
end
- quit(0)
end
def targetimages
- targetimages = [["Target Image Id"]]
- build = ImageBuild.find(@options[:id])
- if build
- build.target_images.each do |ti|
- targetimages << [ti.uuid]
- end
- format_print(targetimages)
- else
- puts "ERROR: could not find Build with ID: " + options[:id]
+ begin
+ headers = ActiveSupport::OrderedHash.new
+ headers[:id] = "ID"
+ headers[:status] = "Status"
+ headers[:build] = "Build"
+ collection = @options[:id].nil? ? Aeolus::CLI::TargetImage.all :
Aeolus::CLI::TargetImage.find(:all, :from => Aeolus::CLI::Base.site.path +
"/builds/" + @options[:id] + "/target_images.xml")
+ print_collection(collection, headers)
+ quit(0)
+ rescue => e
+ handle_exception(e)
end
- quit(0)
end
def providerimages
- providerimages = [["PROVIDER IMAGE", "PROVIDER", "TARGET
IMAGE", "TARGET IDENTIFIER"]]
- target_image = TargetImage.find(@options[:id])
- if target_image
- target_image.provider_images.each do |pi|
- providerimages << [pi.uuid, pi.provider_name, target_image.uuid,
target_image.target]
- end
- format_print(providerimages)
- else
- puts "ERROR: could not find Target Image with ID: " + options[:id]
+ begin
+ headers = ActiveSupport::OrderedHash.new
+ headers[:id] = "ID"
+ headers[:target_identifier] = "Target Identifier"
+ headers[:provider] = "Provider"
+ headers[:status] = "Status"
+ headers[:target_image] = "Target Image"
+ collection = @options[:id].nil? ? Aeolus::CLI::ProviderImage.all :
Aeolus::CLI::ProviderImage.find(:all, :from => Aeolus::CLI::Base.site.path +
"/target_images/" + @options[:id] + "/provider_images.xml")
+ print_collection(collection, headers)
+ quit(0)
+ rescue => e
+ handle_exception(e)
end
- quit(0)
end
def targets
- targets = [["NAME", "TARGET CODE"]]
- targets << ["Mock", "mock"]
- targets << ["Amazon EC2", "ec2"]
- targets << ["RHEV-M", "rhevm"]
- targets << ["VMware vSphere", "vsphere"]
- targets << ["Condor Cloud", "condor_cloud"]
- format_print(targets)
- quit(0)
+ begin
+ headers = ActiveSupport::OrderedHash.new
+ headers[:name] = "Name"
+ headers[:deltacloud_driver] = "Reference"
+ print_collection(Aeolus::CLI::ProviderType.all, headers)
+ quit(0)
+ rescue => e
+ handle_exception(e)
+ end
end
def providers
- print_values = [["NAME", "TYPE", "URL"]]
-
- doc = Nokogiri::XML conductor['/providers'].get
- doc.xpath("/providers/provider").each do |provider|
- print_values << [provider.xpath("name").text,
provider.xpath("provider_type").text, provider.xpath("url").text]
+ begin
+ headers = ActiveSupport::OrderedHash.new
+ headers[:name] = "Name"
+ headers[:provider_type] = "Type"
+ headers[:deltacloud_provider] = "Target Reference"
+ print_collection(Aeolus::CLI::Provider.all, headers)
+ quit(0)
+ rescue => e
+ handle_exception(e)
end
-
- format_print(print_values)
- quit(0)
end
def accounts
- print_values = [["NAME", "PROVIDER", "PROVIDER
TYPE"]]
- doc = Nokogiri::XML conductor['/provider_accounts/'].get
- doc.xpath("/provider_accounts/provider_account").each do |account|
- print_values << [account.xpath("name").text,
account.xpath("provider").text, account.xpath("provider_type").text]
+ begin
+ headers = ActiveSupport::OrderedHash.new
+ headers[:name] = "Name"
+ headers[:provider] = "Provider"
+ headers[:provider_type] = "Provider Type"
+ print_collection(Aeolus::CLI::ProviderAccount.all, headers)
+ quit(0)
+ rescue => e
+ handle_exception(e)
end
-
- format_print(print_values)
- quit(0)
end
private
- # Takes a 2D array of strings and neatly prints them to STDOUT
- def format_print(print_values)
- widths = Array.new(print_values[0].size, 0)
- print_values.each do |print_value|
- widths = widths.zip(print_value).map! {|width, value| value.length > width ?
value.length : width }
- end
+ # Print Collection to STDOUT in a column layout
+ def print_collection(collection, headers)
+ widths = column_widths(collection, headers)
- print_values.each do |print_value|
- widths.zip(print_value) do |width, value|
- printf("%-#{width + 5}s", value)
- end
- puts ""
+ # Print Headers
+ widths.each_pair do |header, width|
+ printf("%-#{width + 5}s", headers[header])
end
- end
+ puts ""
- def get_template_info(image, targetimage)
- begin
- template = Nokogiri::XML iwhd["/templates/" +
iwhd["/target_images/" + targetimage + "/template"].get].get
- [template.xpath("/template/name").text,
- iwhd["/target_images/" + targetimage + "/target"].get,
- template.xpath("/template/os/name").text,
- template.xpath("/template/os/version").text,
- template.xpath("/template/os/arch").text,
- template.xpath("/template/description").text]
- rescue
+ # Print Underlines
+ widths.each_pair do |header, width|
+ printf("%-#{width + 5}s", "-" * width)
end
- end
+ puts ""
- def get_image_name(image)
- begin
- template_xml = Nokogiri::XML iwhd["images/" + image].get
- template_xml.xpath("/image/name").text
- rescue
- ""
+ # Print collection information
+ collection.each do |resource|
+ widths.each_pair do |attr, width|
+ printf("%-#{width + 5}s", resource.attributes.include?(attr) ?
resource.attributes[attr].to_s : "")
+ end
+ puts ""
end
+ puts ""
end
- def lastest_pushed(image)
- begin
- build = iwhd["/images/" + image + "/latest_build"].get
- build.nil? ? "" : build
- rescue
- ""
+ def column_widths(collection, headers)
+ widths = ActiveSupport::OrderedHash.new
+ headers.each_pair do |attr, header|
+ widths[attr] = header.length
end
- end
- def check_bucket_exists(bucket)
- begin
- iwhd["/" + bucket].get
- rescue
- nil
+ collection.each do |resource|
+ headers.keys.each do |attr|
+ widths[attr] = widths[attr] > resource.attributes[attr].to_s.length ?
widths[attr] : resource.attributes[attr].to_s.length
+ end
end
+ widths
end
end
end
diff --git a/spec/command/list_command_spec.rb b/spec/command/list_command_spec.rb
index 9a7bbbb..aaed5b7 100644
--- a/spec/command/list_command_spec.rb
+++ b/spec/command/list_command_spec.rb
@@ -17,6 +17,117 @@ require 'spec_helper'
module Aeolus
module CLI
describe ListCommand do
+ it "should list all account" do
+ VCR.use_cassette('command/list_command/list_all_accounts') do
+ lc = ListCommand.new
+ begin
+ lc.accounts
+ rescue SystemExit => e
+ e.status.should == 0
+ end
+ headers = ["Name", "Provider", "Provider Type"]
+ content = ["ec2-acc", "ec2-us-east-1", "ec2"]
+ (headers + content).each do |expected_text|
+ $stdout.string.should include(expected_text)
+ end
+ end
+ end
+
+ it "should list all targets" do
+ VCR.use_cassette('command/list_command/list_all_targets') do
+ lc = ListCommand.new
+ begin
+ lc.targets
+ rescue SystemExit => e
+ e.status.should == 0
+ end
+ headers = ["Name", "Reference"]
+ content = ["Mock", "mock", "Amazon EC2",
"ec2", "VMware vSphere", "vsphere"]
+ (headers + content).each do |expected_text|
+ $stdout.string.should include(expected_text)
+ end
+ end
+ end
+
+ it "should list all providers" do
+ VCR.use_cassette('command/list_command/list_all_providers') do
+ lc = ListCommand.new
+ begin
+ lc.providers
+ rescue SystemExit => e
+ e.status.should == 0
+ end
+ headers = ["Name", "Type", "Target Reference"]
+ content = ["ec2-us-east-1", "ec2", "us-east-1"]
+ (headers + content).each do |expected_text|
+ $stdout.string.should include(expected_text)
+ end
+ end
+ end
+
+ it "should list all images" do
+ VCR.use_cassette('command/list_command/list_all_images') do
+ lc = ListCommand.new
+ begin
+ lc.images
+ rescue SystemExit => e
+ e.status.should == 0
+ end
+ headers = ["ID", "Name", "OS", "OS
Version", "Arch", "Description"]
+ content = ["7e6d409b-11d5-446d-99e8-656deb4f28ca",
"a2da41eb-4bec-410c-b59d-afca5ea94c21", "Fedora", "14",
"x86_64", "foo"]
+ (headers + content).each do |expected_text|
+ $stdout.string.should include(expected_text)
+ end
+ end
+ end
+
+ it "should list all build for a particular images" do
+ VCR.use_cassette('command/list_command/list_all_builds_for_image') do
+ lc = ListCommand.new({:id =>
"7e6d409b-11d5-446d-99e8-656deb4f28ca"})
+ begin
+ lc.builds
+ rescue SystemExit => e
+ e.status.should == 0
+ end
+ headers = ["ID", "Image"]
+ content = ["7e6d409b-11d5-446d-99e8-656deb4f28ca",
"98632297-1d3b-4493-8643-e37beb29204c"]
+ (headers + content).each do |expected_text|
+ $stdout.string.should include(expected_text)
+ end
+ end
+ end
+
+ it "should list all target images for a particular build" do
+ VCR.use_cassette('command/list_command/list_all_target_images_for_build')
do
+ lc = ListCommand.new({:id =>
"3eeb6c8f-9dd0-4a5b-bd13-e96daef435f9"})
+ begin
+ lc.targetimages
+ rescue SystemExit => e
+ e.status.should == 0
+ end
+ headers = ["ID", "Status", "Build"]
+ content = ["3a548835-3008-473b-a4c6-6618f82e026f",
"COMPLETE", "3eeb6c8f-9dd0-4a5b-bd13-e96daef435f9"]
+ (headers + content).each do |expected_text|
+ $stdout.string.should include(expected_text)
+ end
+ end
+ end
+
+ it "should list all provider images for a particular target image" do
+
VCR.use_cassette('command/list_command/list_all_provider_images_for_target_image')
do
+ lc = ListCommand.new({:id =>
"d7cab2b2-eeb8-459e-b739-a1844a5d5a62"})
+ begin
+ lc.providerimages
+ rescue SystemExit => e
+ e.status.should == 0
+ end
+ headers = ["ID", "Target Identifier", "Provider",
"Status", "Target Image"]
+ content = ["9ac21235-81f4-4140-ac25-18a19ebcb2f8",
"ami-test", "ec2-us-east-1", "COMPLETE",
"d7cab2b2-eeb8-459e-b739-a1844a5d5a62"]
+ (headers + content).each do |expected_text|
+ $stdout.string.should include(expected_text)
+ end
+ end
+ end
end
end
-end
+end
\ No newline at end of file
diff --git a/spec/vcr/cassettes/command/list_command/list_all_accounts.yml
b/spec/vcr/cassettes/command/list_command/list_all_accounts.yml
new file mode 100644
index 0000000..b8c9967
--- /dev/null
+++ b/spec/vcr/cassettes/command/list_command/list_all_accounts.yml
@@ -0,0 +1,81 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri:
https://admin:password@localhost/conductor/api/provider_accounts.xml
+ body:
+ headers:
+ accept:
+ - application/xml
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 200
+ message: OK
+ headers:
+ x-ua-compatible:
+ - IE=Edge
+ etag:
+ - "\"cc06d592201615534db0988bbe9d9032\""
+ content-type:
+ - application/xml; charset=utf-8
+ server:
+ - WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30)
+ date:
+ - Tue, 18 Oct 2011 11:58:20 GMT
+ x-runtime:
+ - "1.437227"
+ content-length:
+ - "2435"
+ set-cookie:
+ -
_session_id=BAh7CCIPc2Vzc2lvbl9pZCIlZmQyODRiMDEwOWYwZGY2YmM4NWQ2NTJiYWZiYjFmNmQiGXdhcmRlbi51c2VyLnVzZXIua2V5aQYiEGJyZWFkY3J1bWJzWwZ7CToKY2xhc3MiFnByb3ZpZGVyX2FjY291bnRzOg52aWV3c3RhdGUwOgluYW1lQAw6CXBhdGgiFy9wcm92aWRlcl9hY2NvdW50cw%3D%3D--89f7b144b8e02f5792f60dd2165b0f0fcd5f3b14;
path=/; HttpOnly
+ cache-control:
+ - max-age=0, private, must-revalidate
+ body: |
+ <?xml version="1.0"?>
+ <provider_accounts>
+ <provider_account>
+ <name>ec2-acc</name>
+ <provider>ec2-us-east-1</provider>
+ <provider_type>ec2</provider_type>
+ <provider_credentials>
+ <ec2_credentials>
+ <access_key>AKIAI5HJ6ZDO6KLRG7YA</access_key>
+ <account_number>8637-5181-7422</account_number>
+ <certificate>-----BEGIN CERTIFICATE-----
+ MIICdzCCAeCgAwIBAgIGANSQ1b/JMA0GCSqGSIb3DQEBBQUAMFMxCzAJBgNVBAYT
+ AlVTMRMwEQYDVQQKEwpBbWF6b24uY29tMQwwCgYDVQQLEwNBV1MxITAfBgNVBAMT
+ GEFXUyBMaW1pdGVkLUFzc3VyYW5jZSBDQTAeFw0xMDEwMTMxNDU4MzVaFw0xMTEw
+ MTMxNDU4MzVaMFIxCzAJBgNVBAYTAlVTMRMwEQYDVQQKEwpBbWF6b24uY29tMRcw
+ FQYDVQQLEw5BV1MtRGV2ZWxvcGVyczEVMBMGA1UEAxMMbjM5OHhyb2tkbWR1MIGf
+ MA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCCnLDO5ePhJCvHEJ15VUszxBm+T1LN
+ dE+NOtQ4m1/4Fswz28T+ErUxpOtvureF3REBQp8f3Fvp9BAsxRXT/mCFT0Gv5bta
+ 6hpRjv3wZrK3llDZrKrzXZCvgu5TREQOT2bwdzepoe3QupgSgdT3ZZpxf8kqiPav
+ jXKyaEKlpCgdKwIDAQABo1cwVTAOBgNVHQ8BAf8EBAMCBaAwFgYDVR0lAQH/BAww
+ CgYIKwYBBQUHAwIwDAYDVR0TAQH/BAIwADAdBgNVHQ4EFgQUAg2H+zIo4W8GQL+K
+ aGAA1moHQ/owDQYJKoZIhvcNAQEFBQADgYEAX984N/YrujDpwhRczBiFYEwqWT0r
+ gNEw1urbUUsHy6t2+t0tjJJsKjvkdgM6Syc1VsgI2EnRaGfbOrzuoRC0Zrb+TSrB
+ JLE/dz3KCvHoq1kHeQF42HKuJJc0nTc+b1BQEefZxEpeFQrI01/Ghln5EFF7Cwje
+ laRVOzOtE+1n9nw=
+ -----END CERTIFICATE-----
+ </certificate>
+ <key>-----BEGIN PRIVATE KEY-----
+
MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAIKcsM7l4+EkK8cQnXlVSzPEGb5P
+
Us10T4061DibX/gWzDPbxP4StTGk62+6t4XdEQFCnx/cW+n0ECzFFdP+YIVPQa/lu1rqGlGO/fBm
+
sreWUNmsqvNdkK+C7lNERA5PZvB3N6mh7dC6mBKB1PdlmnF/ySqI9q+NcrJoQqWkKB0rAgMBAAEC
+
gYB19XVpJg4sYzJ2UfcmgXWthsmJKrKpgwXlkt/fT9PYhx5dJ3o9zD+AWmWXPpZIe2LENJrpd2Y7
+
YITLKiOQlggskdIXQgBYACZauRhlMS8iRNWS1QgEA7EoLqg90l7NJt+MWhu9rfwgCWWYuk1awKDq
+
W9Nn6/5gx1eYo/3pn+oF4QJBAMfjO0MkUmXO47ORSan5h6Vo0PP5f0Ihacb8ucgurOPa2R/BeQoO
+
VZc36B3P0rjI7ag0WAEXmY1VspUDF4DTfVUCQQCnRwaRJwlYVyWKygf6aqlJ/SjoMFm1GGfVuFlf
+
uYzJNfQt4y+QppZUFnALT1MVpTq1Wkt7t2CTpyV0ysj8yTB/AkEAvXjNcgV5/XsxJ8NuWipnxAkp
+
GDrFwD+/7pkc2X407/9AlPNl8nxH8YFTCv82NWZwsGJ9kPt32BsFnm5B1yGhyQJAU9q6AwezmpJN
+
Io72guT3Kjz7RbH/NlYerzdzrhXg6njeiCZMENJBp7N7xV+lgcNLc9/o2QLrKflvQGXrbTUZ1wJA
+
NgArAS+yKRjxIt7orNPR/JHpghhS7xQ1KIg/v1j9HHz0Pmwg3+ZN7ejrI2miERv5CcwYYx2ZGkMs
+ Dc1go5/qpA==
+ -----END PRIVATE KEY-----</key>
+
<secret_access_key>Hz3uYk+xf9z2KGX7iOufi5XAZ9OU7CvQZEc4bm0K</secret_access_key>
+ </ec2_credentials>
+ </provider_credentials>
+ </provider_account>
+ </provider_accounts>
+
+ http_version: "1.1"
\ No newline at end of file
diff --git a/spec/vcr/cassettes/command/list_command/list_all_builds_for_image.yml
b/spec/vcr/cassettes/command/list_command/list_all_builds_for_image.yml
new file mode 100644
index 0000000..2e21a89
--- /dev/null
+++ b/spec/vcr/cassettes/command/list_command/list_all_builds_for_image.yml
@@ -0,0 +1,40 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri:
https://admin:password@localhost/conductor/api/images/7e6d409b-11d5-446d-...
+ body:
+ headers:
+ accept:
+ - application/xml
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 200
+ message: OK
+ headers:
+ x-ua-compatible:
+ - IE=Edge
+ etag:
+ - "\"718de78be3e4f17668a63f15dfefd218\""
+ content-type:
+ - application/xml; charset=utf-8
+ server:
+ - WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30)
+ date:
+ - Tue, 18 Oct 2011 11:08:35 GMT
+ x-runtime:
+ - "0.665386"
+ content-length:
+ - "309"
+ set-cookie:
+ -
_session_id=BAh7CCIPc2Vzc2lvbl9pZCIlMTQxYWU0YTU3ZGQzMzlhYjJlYmYzZDBhOTJmOWQxMTEiGXdhcmRlbi51c2VyLnVzZXIua2V5aQYiEGJyZWFkY3J1bWJzWwA%3D--bc5cdc5ac1fc4f786de97db6c2dd7cdf742293fd;
path=/; HttpOnly
+ cache-control:
+ - max-age=0, private, must-revalidate
+ body: |
+ <builds>
+ <build
href='http://localhost:3000/api/builds/98632297-1d3b-4493-8643-e37beb29204c'
id='98632297-1d3b-4493-8643-e37beb29204c'>
+ <image
href='http://localhost:3000/api/images/7e6d409b-11d5-446d-99e8-656deb4f28ca'
type='xs:string'>7e6d409b-11d5-446d-99e8-656deb4f28ca</image>
+ </build>
+ </builds>
+
+ http_version: "1.1"
\ No newline at end of file
diff --git a/spec/vcr/cassettes/command/list_command/list_all_images.yml
b/spec/vcr/cassettes/command/list_command/list_all_images.yml
new file mode 100644
index 0000000..16d0596
--- /dev/null
+++ b/spec/vcr/cassettes/command/list_command/list_all_images.yml
@@ -0,0 +1,227 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri:
https://admin:password@localhost/conductor/api/images.xml
+ body:
+ headers:
+ accept:
+ - application/xml
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 200
+ message: OK
+ headers:
+ x-ua-compatible:
+ - IE=Edge
+ etag:
+ - "\"72facb643bc9af0ba0bc08772d40b761\""
+ content-type:
+ - application/xml; charset=utf-8
+ server:
+ - WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30)
+ date:
+ - Tue, 18 Oct 2011 10:51:12 GMT
+ x-runtime:
+ - "55.063563"
+ content-length:
+ - "8443"
+ set-cookie:
+ -
_session_id=BAh7CCIPc2Vzc2lvbl9pZCIlMmY1ODVkNTk3MmY3MTdiOWE3NmUyMjdlMDNiMDdlN2IiGXdhcmRlbi51c2VyLnVzZXIua2V5aQYiEGJyZWFkY3J1bWJzWwA%3D--ed789d17e117d57cd4c4a6ccf452edc9c79572dd;
path=/; HttpOnly
+ cache-control:
+ - max-age=0, private, must-revalidate
+ body: |
+ <images>
+ <image
href='http://localhost:3000/api/images/7e6d409b-11d5-446d-99e8-656deb4f28ca'
id='7e6d409b-11d5-446d-99e8-656deb4f28ca'>
+ <name>tmpl1</name>
+ <description></description>
+ <os></os>
+ <os_version></os_version>
+ <arch></arch>
+ <builds type='xs:list'>
+ <build
href='http://localhost:3000/api/builds/98632297-1d3b-4493-8643-e37beb29204c'
id='98632297-1d3b-4493-8643-e37beb29204c'></build>
+ </builds>
+ </image>
+ <image
href='http://localhost:3000/api/images/a2da41eb-4bec-410c-b59d-afca5ea94c21'
id='a2da41eb-4bec-410c-b59d-afca5ea94c21'>
+ <name>tmpl1</name>
+ <description>foo</description>
+ <os>Fedora</os>
+ <os_version>14</os_version>
+ <arch>x86_64</arch>
+ <builds type='xs:list'>
+ <build
href='http://localhost:3000/api/builds/3eeb6c8f-9dd0-4a5b-bd13-e96daef435f9'
id='3eeb6c8f-9dd0-4a5b-bd13-e96daef435f9'></build>
+ </builds>
+ </image>
+ <image
href='http://localhost:3000/api/images/11ffb46d-61c1-418e-b080-9f9f56cfb32e'
id='11ffb46d-61c1-418e-b080-9f9f56cfb32e'>
+ <name>tmpl1</name>
+ <description>foo</description>
+ <os>Fedora</os>
+ <os_version>14</os_version>
+ <arch>x86_64</arch>
+ <builds type='xs:list'>
+ <build
href='http://localhost:3000/api/builds/6942a36c-ffaa-488c-9f87-908a4516f71b'
id='6942a36c-ffaa-488c-9f87-908a4516f71b'></build>
+ </builds>
+ </image>
+ <image
href='http://localhost:3000/api/images/d257caa1-6ac0-40b0-9621-d9ea0703f85d'
id='d257caa1-6ac0-40b0-9621-d9ea0703f85d'>
+ <name>tmpl1</name>
+ <description>foo</description>
+ <os>Fedora</os>
+ <os_version>14</os_version>
+ <arch>x86_64</arch>
+ <builds type='xs:list'>
+ <build
href='http://localhost:3000/api/builds/2cf2acbc-6a45-4027-b695-093356e56f4d'
id='2cf2acbc-6a45-4027-b695-093356e56f4d'></build>
+ </builds>
+ </image>
+ <image
href='http://localhost:3000/api/images/a0f44026-6d7e-49ee-80f8-c7e48e3b9eb9'
id='a0f44026-6d7e-49ee-80f8-c7e48e3b9eb9'>
+ <name>ami-test</name>
+ <description></description>
+ <os></os>
+ <os_version></os_version>
+ <arch></arch>
+ <builds type='xs:list'>
+ <build
href='http://localhost:3000/api/builds/3268f30a-9a39-4dc6-9cd9-7891cb7f9d53'
id='3268f30a-9a39-4dc6-9cd9-7891cb7f9d53'></build>
+ </builds>
+ </image>
+ <image
href='http://localhost:3000/api/images/7b21febc-12d7-40b5-9b35-5b2731bfd914'
id='7b21febc-12d7-40b5-9b35-5b2731bfd914'>
+ <name>ami-test</name>
+ <description></description>
+ <os></os>
+ <os_version></os_version>
+ <arch></arch>
+ <builds type='xs:list'>
+ <build
href='http://localhost:3000/api/builds/6f274fa6-dc93-487c-8f0c-0a57b56f7dd5'
id='6f274fa6-dc93-487c-8f0c-0a57b56f7dd5'></build>
+ </builds>
+ </image>
+ <image
href='http://localhost:3000/api/images/4c83ad1c-af84-49d3-9011-2379295c09f7'
id='4c83ad1c-af84-49d3-9011-2379295c09f7'>
+ <name>ami-test</name>
+ <description></description>
+ <os></os>
+ <os_version></os_version>
+ <arch></arch>
+ <builds type='xs:list'>
+ <build
href='http://localhost:3000/api/builds/bdc69bdc-96d2-41c1-9748-9bd9ebbcee13'
id='bdc69bdc-96d2-41c1-9748-9bd9ebbcee13'></build>
+ </builds>
+ </image>
+ <image
href='http://localhost:3000/api/images/0cf58ea2-ec1e-43c9-88cf-18be84c6d21c'
id='0cf58ea2-ec1e-43c9-88cf-18be84c6d21c'>
+ <name>ami-test</name>
+ <description></description>
+ <os></os>
+ <os_version></os_version>
+ <arch></arch>
+ <builds type='xs:list'>
+ <build
href='http://localhost:3000/api/builds/c4d71108-de11-4cb0-a920-3bff25c55497'
id='c4d71108-de11-4cb0-a920-3bff25c55497'></build>
+ </builds>
+ </image>
+ <image
href='http://localhost:3000/api/images/648ae2c2-f42c-4f7b-8fcf-22aaeb359c67'
id='648ae2c2-f42c-4f7b-8fcf-22aaeb359c67'>
+ <name></name>
+ <description></description>
+ <os></os>
+ <os_version></os_version>
+ <arch></arch>
+ <builds type='xs:list'>
+ <build
href='http://localhost:3000/api/builds/29f88b96-1394-4da6-a639-c56fbe02f08b'
id='29f88b96-1394-4da6-a639-c56fbe02f08b'></build>
+ </builds>
+ </image>
+ <image
href='http://localhost:3000/api/images/f22d96a7-5d73-4a58-86bf-180fdc620306'
id='f22d96a7-5d73-4a58-86bf-180fdc620306'>
+ <name>ami-test</name>
+ <description></description>
+ <os></os>
+ <os_version></os_version>
+ <arch></arch>
+ <builds type='xs:list'>
+ <build
href='http://localhost:3000/api/builds/0092660e-f4d3-4c8e-a86b-3a0c438d28e2'
id='0092660e-f4d3-4c8e-a86b-3a0c438d28e2'></build>
+ </builds>
+ </image>
+ <image
href='http://localhost:3000/api/images/65554d9a-af72-4c88-a7d9-15b5a76da99e'
id='65554d9a-af72-4c88-a7d9-15b5a76da99e'>
+ <name>ami-test</name>
+ <description></description>
+ <os></os>
+ <os_version></os_version>
+ <arch></arch>
+ <builds type='xs:list'>
+ <build
href='http://localhost:3000/api/builds/0d8190d8-7a47-4d79-82ae-ff1a847dbd9a'
id='0d8190d8-7a47-4d79-82ae-ff1a847dbd9a'></build>
+ </builds>
+ </image>
+ <image
href='http://localhost:3000/api/images/977e5a5e-e2b2-45a5-8a4b-52d4bcc9a343'
id='977e5a5e-e2b2-45a5-8a4b-52d4bcc9a343'>
+ <name></name>
+ <description></description>
+ <os></os>
+ <os_version></os_version>
+ <arch></arch>
+ <builds type='xs:list'>
+ <build
href='http://localhost:3000/api/builds/2bbba518-bfc1-4e32-b2a4-d4c1d2c4979d'
id='2bbba518-bfc1-4e32-b2a4-d4c1d2c4979d'></build>
+ </builds>
+ </image>
+ <image
href='http://localhost:3000/api/images/6b6f7970-b0b6-4fc5-95e1-1d35f99a026e'
id='6b6f7970-b0b6-4fc5-95e1-1d35f99a026e'>
+ <name>ami-test</name>
+ <description></description>
+ <os></os>
+ <os_version></os_version>
+ <arch></arch>
+ <builds type='xs:list'>
+ <build
href='http://localhost:3000/api/builds/bd91c2ba-0a81-4b6c-b1e1-69d441d14a82'
id='bd91c2ba-0a81-4b6c-b1e1-69d441d14a82'></build>
+ </builds>
+ </image>
+ <image
href='http://localhost:3000/api/images/4368776e-6dc6-4356-840e-c89ef98451b3'
id='4368776e-6dc6-4356-840e-c89ef98451b3'>
+ <name>ami-test</name>
+ <description></description>
+ <os></os>
+ <os_version></os_version>
+ <arch></arch>
+ <builds type='xs:list'>
+ <build
href='http://localhost:3000/api/builds/279ed048-a538-4f0b-8d8f-900c2004ac90'
id='279ed048-a538-4f0b-8d8f-900c2004ac90'></build>
+ </builds>
+ </image>
+ <image
href='http://localhost:3000/api/images/ef629b3f-0391-412f-840c-3243e2615f37'
id='ef629b3f-0391-412f-840c-3243e2615f37'>
+ <name>ami-test</name>
+ <description></description>
+ <os></os>
+ <os_version></os_version>
+ <arch></arch>
+ <builds type='xs:list'>
+ <build
href='http://localhost:3000/api/builds/5ea2f3aa-71de-48ce-b4fe-b218da4620a7'
id='5ea2f3aa-71de-48ce-b4fe-b218da4620a7'></build>
+ </builds>
+ </image>
+ <image
href='http://localhost:3000/api/images/feb79997-82a2-4782-aa6d-cc20f27d0a6c'
id='feb79997-82a2-4782-aa6d-cc20f27d0a6c'>
+ <name>ami-test</name>
+ <description></description>
+ <os></os>
+ <os_version></os_version>
+ <arch></arch>
+ <builds type='xs:list'>
+ <build
href='http://localhost:3000/api/builds/4da378c7-c551-41bc-b0fd-275ecb93ed8e'
id='4da378c7-c551-41bc-b0fd-275ecb93ed8e'></build>
+ </builds>
+ </image>
+ <image
href='http://localhost:3000/api/images/f823fc3f-7cb1-47cd-90da-8bdc83319ed4'
id='f823fc3f-7cb1-47cd-90da-8bdc83319ed4'>
+ <name></name>
+ <description></description>
+ <os></os>
+ <os_version></os_version>
+ <arch></arch>
+ <builds type='xs:list'>
+ <build
href='http://localhost:3000/api/builds/09c64c44-ba14-45eb-b3bd-2a21b3adab05'
id='09c64c44-ba14-45eb-b3bd-2a21b3adab05'></build>
+ </builds>
+ </image>
+ <image
href='http://localhost:3000/api/images/6611686e-36a5-4ce9-b5a5-f9e6154d6ec4'
id='6611686e-36a5-4ce9-b5a5-f9e6154d6ec4'>
+ <name>ami-test</name>
+ <description></description>
+ <os></os>
+ <os_version></os_version>
+ <arch></arch>
+ <builds type='xs:list'>
+ <build
href='http://localhost:3000/api/builds/b1a43374-6549-46c3-9295-a26c38891c85'
id='b1a43374-6549-46c3-9295-a26c38891c85'></build>
+ </builds>
+ </image>
+ <image
href='http://localhost:3000/api/images/10bf9309-1521-4f48-8ed5-a637a449da02'
id='10bf9309-1521-4f48-8ed5-a637a449da02'>
+ <name></name>
+ <description></description>
+ <os></os>
+ <os_version></os_version>
+ <arch></arch>
+ <builds type='xs:list'>
+ <build
href='http://localhost:3000/api/builds/4273e39c-4cd5-4d17-9628-84be69ef0355'
id='4273e39c-4cd5-4d17-9628-84be69ef0355'></build>
+ </builds>
+ </image>
+ </images>
+
+ http_version: "1.1"
\ No newline at end of file
diff --git
a/spec/vcr/cassettes/command/list_command/list_all_provider_images_for_target_image.yml
b/spec/vcr/cassettes/command/list_command/list_all_provider_images_for_target_image.yml
new file mode 100644
index 0000000..d101db0
--- /dev/null
+++
b/spec/vcr/cassettes/command/list_command/list_all_provider_images_for_target_image.yml
@@ -0,0 +1,44 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri:
https://admin:password@localhost/conductor/api/target_images/d7cab2b2-eeb...
+ body:
+ headers:
+ accept:
+ - application/xml
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 200
+ message: OK
+ headers:
+ x-ua-compatible:
+ - IE=Edge
+ etag:
+ - "\"855846ee4e6fa812b8eeb8748ccfddf4\""
+ content-type:
+ - application/xml; charset=utf-8
+ server:
+ - WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30)
+ date:
+ - Tue, 18 Oct 2011 11:57:31 GMT
+ x-runtime:
+ - "2.116507"
+ content-length:
+ - "531"
+ set-cookie:
+ -
_session_id=BAh7CCIPc2Vzc2lvbl9pZCIlMTZiYTUyZDVkNTBmYTdmZGIxYzU5YmFkZGVhYjNjYjYiGXdhcmRlbi51c2VyLnVzZXIua2V5aQYiEGJyZWFkY3J1bWJzWwA%3D--5a3c05dfa32122391f5d91677e09dfa97c21f008;
path=/; HttpOnly
+ cache-control:
+ - max-age=0, private, must-revalidate
+ body: |
+ <provider_images>
+ <provider_image
href='http://localhost:3000/api/provider_images/9ac21235-81f4-4140-ac25-18a19ebcb2f8'
id='9ac21235-81f4-4140-ac25-18a19ebcb2f8'>
+ <object_type>provider_image</object_type>
+ <target_identifier>ami-test</target_identifier>
+ <status>COMPLETE</status>
+ <provider>ec2-us-east-1</provider>
+ <target_image
href='http://localhost:3000/api/target_images/d7cab2b2-eeb8-459e-b739-a1844a5d5a62'
id='d7cab2b2-eeb8-459e-b739-a1844a5d5a62'></target_image>
+ </provider_image>
+ </provider_images>
+
+ http_version: "1.1"
\ No newline at end of file
diff --git a/spec/vcr/cassettes/command/list_command/list_all_providers.yml
b/spec/vcr/cassettes/command/list_command/list_all_providers.yml
new file mode 100644
index 0000000..e28ad1f
--- /dev/null
+++ b/spec/vcr/cassettes/command/list_command/list_all_providers.yml
@@ -0,0 +1,43 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri:
https://admin:password@localhost/conductor/api/providers.xml
+ body:
+ headers:
+ accept:
+ - application/xml
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 200
+ message: OK
+ headers:
+ x-ua-compatible:
+ - IE=Edge
+ etag:
+ - "\"04602dfcad799d278e6505da25c3fc10\""
+ content-type:
+ - application/xml; charset=utf-8
+ server:
+ - WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30)
+ date:
+ - Tue, 18 Oct 2011 10:09:44 GMT
+ x-runtime:
+ - "0.927343"
+ content-length:
+ - "220"
+ set-cookie:
+ -
_session_id=BAh7CCIPc2Vzc2lvbl9pZCIlYWI2NzExNThkNGEwNDhiNDNmMjA3ZWMyZWMwZTE5ZGQiGXdhcmRlbi51c2VyLnVzZXIua2V5aQYiEGJyZWFkY3J1bWJzWwA%3D--f8fb8d355ab22bc17f1ed28fb9d5785189da7c72;
path=/; HttpOnly
+ cache-control:
+ - max-age=0, private, must-revalidate
+ body: |
+ <providers>
+ <provider>
+ <name>ec2-us-east-1</name>
+ <url>http://localhost:3003/api</url>
+ <provider_type>ec2</provider_type>
+ <deltacloud_provider>us-east-1</deltacloud_provider>
+ </provider>
+ </providers>
+
+ http_version: "1.1"
\ No newline at end of file
diff --git a/spec/vcr/cassettes/command/list_command/list_all_target_images_for_build.yml
b/spec/vcr/cassettes/command/list_command/list_all_target_images_for_build.yml
new file mode 100644
index 0000000..c4f0619
--- /dev/null
+++ b/spec/vcr/cassettes/command/list_command/list_all_target_images_for_build.yml
@@ -0,0 +1,45 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri:
https://admin:password@localhost/conductor/api/builds/3eeb6c8f-9dd0-4a5b-...
+ body:
+ headers:
+ accept:
+ - application/xml
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 200
+ message: OK
+ headers:
+ x-ua-compatible:
+ - IE=Edge
+ etag:
+ - "\"b7c72662449414da41af737e6e3f14d0\""
+ content-type:
+ - application/xml; charset=utf-8
+ server:
+ - WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30)
+ date:
+ - Tue, 18 Oct 2011 11:44:14 GMT
+ x-runtime:
+ - "4.349364"
+ content-length:
+ - "512"
+ set-cookie:
+ -
_session_id=BAh7CCIPc2Vzc2lvbl9pZCIlYzQ1Nzc1N2U3YmRjYjZhMmNhYWE0OGI3ZDNhM2Y2YjgiGXdhcmRlbi51c2VyLnVzZXIua2V5aQYiEGJyZWFkY3J1bWJzWwA%3D--6e1392bcc118e6236d1b06c92b782023b84d57f5;
path=/; HttpOnly
+ cache-control:
+ - max-age=0, private, must-revalidate
+ body: |
+ <target_images>
+ <target_image
href='http://localhost:3000/api/target_images/3a548835-3008-473b-a4c6-6618f82e026f'
id='3a548835-3008-473b-a4c6-6618f82e026f'>
+ <object_type>target_image</object_type>
+ <template>cdb9f6fa-2c5c-4d6e-a34b-9c7e7840e492</template>
+ <build
href='http://localhost:3000/api/builds/3eeb6c8f-9dd0-4a5b-bd13-e96daef435f9'
id='3eeb6c8f-9dd0-4a5b-bd13-e96daef435f9'></build>
+ <status>COMPLETE</status>
+ <provider_image>
+ </provider_image>
+ </target_image>
+ </target_images>
+
+ http_version: "1.1"
\ No newline at end of file
diff --git a/spec/vcr/cassettes/command/list_command/list_all_targets.yml
b/spec/vcr/cassettes/command/list_command/list_all_targets.yml
new file mode 100644
index 0000000..1c589bc
--- /dev/null
+++ b/spec/vcr/cassettes/command/list_command/list_all_targets.yml
@@ -0,0 +1,69 @@
+---
+- !ruby/struct:VCR::HTTPInteraction
+ request: !ruby/struct:VCR::Request
+ method: :get
+ uri:
https://admin:password@localhost/conductor/api/provider_types.xml
+ body:
+ headers:
+ accept:
+ - application/xml
+ response: !ruby/struct:VCR::Response
+ status: !ruby/struct:VCR::ResponseStatus
+ code: 200
+ message: OK
+ headers:
+ x-ua-compatible:
+ - IE=Edge
+ etag:
+ - "\"f25d404caae9be653699c553fb3cb65f\""
+ content-type:
+ - application/xml; charset=utf-8
+ server:
+ - WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30)
+ date:
+ - Tue, 18 Oct 2011 10:09:43 GMT
+ x-runtime:
+ - "0.471728"
+ content-length:
+ - "948"
+ set-cookie:
+ -
_session_id=BAh7CCIPc2Vzc2lvbl9pZCIlNGM3MGJjYWZhNjMyNmFiZjcwYWVkNjRiOTI1YTE3OTUiGXdhcmRlbi51c2VyLnVzZXIua2V5aQYiEGJyZWFkY3J1bWJzWwA%3D--ac8b6cdef14a502539476127e36bc0c28a263078;
path=/; HttpOnly
+ cache-control:
+ - max-age=0, private, must-revalidate
+ body: |
+ <provider_types>
+ <provider_type>
+ <name>Mock</name>
+ <deltacloud_driver>mock</deltacloud_driver>
+ </provider_type>
+ <provider_type>
+ <name>Amazon EC2</name>
+ <deltacloud_driver>ec2</deltacloud_driver>
+ </provider_type>
+ <provider_type>
+ <name>GoGrid</name>
+ <deltacloud_driver>gogrid</deltacloud_driver>
+ </provider_type>
+ <provider_type>
+ <name>Rackspace</name>
+ <deltacloud_driver>rackspace</deltacloud_driver>
+ </provider_type>
+ <provider_type>
+ <name>RHEV-M</name>
+ <deltacloud_driver>rhevm</deltacloud_driver>
+ </provider_type>
+ <provider_type>
+ <name>OpenNebula</name>
+ <deltacloud_driver>opennebula</deltacloud_driver>
+ </provider_type>
+ <provider_type>
+ <name>Condor Cloud</name>
+ <deltacloud_driver>condor</deltacloud_driver>
+ </provider_type>
+ <provider_type>
+ <name>VMware vSphere</name>
+ <deltacloud_driver>vsphere</deltacloud_driver>
+ </provider_type>
+ </provider_types>
+
+ http_version: "1.1"
\ No newline at end of file
--
1.7.6.2