Class: MockSmartCloud
- Inherits:
-
Object
- Object
- MockSmartCloud
- Defined in:
- lib/mock_smartcloud.rb
Overview
Copyright © 2011, Cohesive Flexible Technologies, Inc. This copyrighted material is the property of Cohesive Flexible Technologies and is subject to the license terms of the product it is contained within, whether in text or compiled form. It is licensed under the terms expressed in the accompanying README and LICENSE files.
This program is AS IS and WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Instance Method Summary collapse
- #clone_volume(*args) ⇒ Object
- #create_instance(*args) ⇒ Object
- #create_volume(*args) ⇒ Object
- #delete_instance(*args) ⇒ Object
- #describe_image(*args) ⇒ Object
- #describe_instance(*args) ⇒ Object
- #describe_volume(*args) ⇒ Object
- #poll_for_instance_state(*args) ⇒ Object
- #poll_for_volume_state(*args) ⇒ Object
- #restart_instance(*args) ⇒ Object
Instance Method Details
#clone_volume(*args) ⇒ Object
44 45 46 |
# File 'lib/mock_smartcloud.rb', line 44 def clone_volume(*args) "555555" end |
#create_instance(*args) ⇒ Object
14 15 16 |
# File 'lib/mock_smartcloud.rb', line 14 def create_instance(*args) describe_instance end |
#create_volume(*args) ⇒ Object
36 37 38 |
# File 'lib/mock_smartcloud.rb', line 36 def create_volume(*args) "12345" end |
#delete_instance(*args) ⇒ Object
52 53 54 |
# File 'lib/mock_smartcloud.rb', line 52 def delete_instance(*args) true end |
#describe_image(*args) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/mock_smartcloud.rb', line 18 def describe_image(*args) {"CreatedTime"=>"2011-02-25T01:22:57.000Z", "Owner"=>"SYSTEM", "SupportedInstanceTypes"=>{"InstanceType"=>[ {"Label"=>"Bronze 32 bit", "ID"=>"BRZ32.1/2048/60*175", "Price"=>{"Rate"=>"0.21", "PricePerQuantity"=>"1", "UnitOfMeasure"=>"UHR ", "CountryCode"=>"897", "CurrencyCode"=>"USD"}}, {"Label"=>"Copper 32 bit", "ID"=>"COP32.1/2048/60", "Price"=>{"Rate"=>"0.21", "PricePerQuantity"=>"1", "UnitOfMeasure"=>"UHR ", "CountryCode"=>"897", "CurrencyCode"=>"USD"}}, {"Label"=>"Silver 32 bit", "ID"=>"SLV32.2/4096/60*350", "Price"=>{"Rate"=>"0.21", "PricePerQuantity"=>"1", "UnitOfMeasure"=>"UHR ", "CountryCode"=>"897", "CurrencyCode"=>"USD"}}, ] }, "Name"=>"CohesiveFT VPN-Cubed Datacenter Connect V2.0.0 - BYOL (TOR)", "Location"=>"101", "ProductCodes"=>{"ProductCode"=>"caondc13bV97Kg5TLyGNodD9or7gA"}, "Documentation"=>"https://www-147.ibm.com/cloud/enterprise/ram.ws/RAMSecure/artifact/{974E595E-566E-87E3-A483-AC0FC468C4D9}/1.0/GettingStarted.html", "ID"=>"20016530", "Manifest"=>"https://www-147.ibm.com/cloud/enterprise/ram.ws/RAMSecure/artifact/{974E595E-566E-87E3-A483-AC0FC468C4D9}/1.0/parameters.xml", "Description"=>"CohesiveFT VPN-Cubed 2.0.0 UL - for TOR datacenter", "State"=>"AVAILABLE", "Visibility"=>"PUBLIC", "Platform"=>"Red Hat Enterprise Linux/5.4"} end |
#describe_instance(*args) ⇒ Object
32 33 34 |
# File 'lib/mock_smartcloud.rb', line 32 def describe_instance(*args) {"Status"=>"NEW", "PrimaryIP"=>{"IP"=>{}, "Hostname"=>{}, "Type"=>"DYNAMIC"}, "ImageID"=>"20015391", "DiskSize"=>"60", "Owner"=>"[email protected]", "RequestID"=>{"name"=>"sir_19_rhel5532-bit-1zGS", "content"=>"102271"}, "Name"=>"MockInstance", "ProductCodes"=>{}, "KeyName"=>"si-tempkey-rhel5532-bit-1zGS-eDY4T", "Location"=>"101", "LaunchTime"=>"2011-07-07T22:13:49.891Z", "Volumes"=>{}, "ID"=>"101971", "MiniEphemeral"=>"false", "Software"=>{"Application"=>{"Version"=>"5.5", "Name"=>"Red Hat Enterprise Linux", "Type"=>"OS"}}, "IP"=>{}, "InstanceType"=>"COP32.1/2048/60", "Hostname"=>{}} end |
#describe_volume(*args) ⇒ Object
40 41 42 |
# File 'lib/mock_smartcloud.rb', line 40 def describe_volume(*args) {:ID => "12345", :State => "5", :Name => "foobar"} end |
#poll_for_instance_state(*args) ⇒ Object
60 61 62 |
# File 'lib/mock_smartcloud.rb', line 60 def poll_for_instance_state(*args) describe_instance(*args) end |
#poll_for_volume_state(*args) ⇒ Object
56 57 58 |
# File 'lib/mock_smartcloud.rb', line 56 def poll_for_volume_state(*args) describe_volume(*args) end |
#restart_instance(*args) ⇒ Object
48 49 50 |
# File 'lib/mock_smartcloud.rb', line 48 def restart_instance(*args) true end |