Class: Fog::Compute::VcloudDirector::Vapp
- Defined in:
- lib/fog/vcloud_director/models/compute/vapp.rb
Instance Attribute Summary
Attributes inherited from Model
Instance Method Summary collapse
- #destroy ⇒ Object
-
#power_off ⇒ Object
Power off all VMs in the vApp.
-
#power_on ⇒ Object
Power on all VMs in the vApp.
-
#reboot ⇒ Object
Reboot all VMs in the vApp.
-
#reset ⇒ Object
Reset all VMs in the vApp.
-
#shutdown ⇒ Object
Shut down all VMs in the vApp.
-
#suspend ⇒ Object
Suspend all VMs in the vApp.
- #tags ⇒ Object
-
#undeploy(action = 'powerOff') ⇒ Object
-
powerOff (Power off the virtual machines. This is the default action if this attribute is missing or empty) * suspend (Suspend the virtual machines) * shutdown (Shut down the virtual machines) * force (Attempt to power off the virtual machines. Failures in undeploying the virtual machine or associated networks are ignored. All references to the vApp and its virtual machines are removed from the database) * default (Use the actions, order, and delay specified in the StartupSection).
-
- #vms ⇒ Object
Methods inherited from Model
#initialize, #inspect, #lazy_load_attrs, #make_attr_loaded_method, #make_lazy_load_method
Methods inherited from Model
#initialize, #inspect, #reload, #symbolize_keys, #to_json, #wait_for
Methods included from Attributes::ClassMethods
#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes
Methods included from Fog::Core::DeprecatedConnectionAccessors
#connection, #connection=, #prepare_service_value
Methods included from Attributes::InstanceMethods
#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one
Constructor Details
This class inherits a constructor from Fog::Compute::VcloudDirector::Model
Instance Method Details
#destroy ⇒ Object
128 129 130 131 132 133 134 135 136 137 |
# File 'lib/fog/vcloud_director/models/compute/vapp.rb', line 128 def destroy requires :id begin response = service.delete_vapp(id) rescue Fog::Compute::VcloudDirector::BadRequest => ex Fog::Logger.debug(ex.) return false end service.process_task(response.body) end |
#power_off ⇒ Object
Power off all VMs in the vApp.
57 58 59 60 61 62 63 64 65 66 |
# File 'lib/fog/vcloud_director/models/compute/vapp.rb', line 57 def power_off requires :id begin response = service.post_power_off_vapp(id) rescue Fog::Compute::VcloudDirector::BadRequest => ex Fog::Logger.debug(ex.) return false end service.process_task(response.body) end |
#power_on ⇒ Object
Power on all VMs in the vApp.
69 70 71 72 73 74 75 76 77 78 |
# File 'lib/fog/vcloud_director/models/compute/vapp.rb', line 69 def power_on requires :id begin response = service.post_power_on_vapp(id) rescue Fog::Compute::VcloudDirector::BadRequest => ex Fog::Logger.debug(ex.) return false end service.process_task(response.body) end |
#reboot ⇒ Object
Reboot all VMs in the vApp.
81 82 83 84 85 86 87 88 89 90 |
# File 'lib/fog/vcloud_director/models/compute/vapp.rb', line 81 def reboot requires :id begin response = service.post_reboot_vapp(id) rescue Fog::Compute::VcloudDirector::BadRequest => ex Fog::Logger.debug(ex.) return false end service.process_task(response.body) end |
#reset ⇒ Object
Reset all VMs in the vApp.
93 94 95 96 97 98 99 100 101 102 |
# File 'lib/fog/vcloud_director/models/compute/vapp.rb', line 93 def reset requires :id begin response = service.post_reset_vapp(id) rescue Fog::Compute::VcloudDirector::BadRequest => ex Fog::Logger.debug(ex.) return false end service.process_task(response.body) end |
#shutdown ⇒ Object
Shut down all VMs in the vApp.
105 106 107 108 109 110 111 112 113 114 |
# File 'lib/fog/vcloud_director/models/compute/vapp.rb', line 105 def shutdown requires :id begin response = service.post_shutdown_vapp(id) rescue Fog::Compute::VcloudDirector::BadRequest => ex Fog::Logger.debug(ex.) return false end service.process_task(response.body) end |
#suspend ⇒ Object
Suspend all VMs in the vApp.
117 118 119 120 121 122 123 124 125 126 |
# File 'lib/fog/vcloud_director/models/compute/vapp.rb', line 117 def suspend requires :id begin response = service.post_suspend_vapp(id) rescue Fog::Compute::VcloudDirector::BadRequest => ex Fog::Logger.debug(ex.) return false end service.process_task(response.body) end |
#tags ⇒ Object
28 29 30 31 |
# File 'lib/fog/vcloud_director/models/compute/vapp.rb', line 28 def requires :id service.(:vm => self) end |
#undeploy(action = 'powerOff') ⇒ Object
-
powerOff (Power off the virtual machines. This is the default action if this attribute is missing or empty)
-
suspend (Suspend the virtual machines)
-
shutdown (Shut down the virtual machines)
-
force (Attempt to power off the virtual machines. Failures in undeploying the virtual machine or associated networks are ignored. All references to the vApp and its virtual machines are removed from the database)
-
default (Use the actions, order, and delay specified in the StartupSection)
46 47 48 49 50 51 52 53 54 |
# File 'lib/fog/vcloud_director/models/compute/vapp.rb', line 46 def undeploy(action='powerOff') begin response = service.post_undeploy_vapp(id, :UndeployPowerAction => action) rescue Fog::Compute::VcloudDirector::BadRequest => ex Fog::Logger.debug(ex.) return false end service.process_task(response.body) end |
#vms ⇒ Object
23 24 25 26 |
# File 'lib/fog/vcloud_director/models/compute/vapp.rb', line 23 def vms requires :id service.vms(:vapp => self) end |