Class: VCloud::Vdc
- Inherits:
-
BaseVCloudEntity
- Object
- BaseVCloudEntity
- VCloud::Vdc
- Includes:
- ParsesXml
- Defined in:
- lib/vcloud/user/vdc.rb
Overview
Represents the user view of an organization vDC
Instance Method Summary collapse
-
#get_network_references_by_name ⇒ Hash{String => VCloud::Reference}
Returns a hash of of all Network references, keyed by the name.
-
#instantiate_vapp_template(instantiate_vapp_template_params, session = self.session) ⇒ VCloud::VApp
Create a vApp from a vApp template.
Methods included from ParsesXml
Methods inherited from BaseVCloudEntity
attr_accessor, attr_reader, attr_writer, from_reference, inherited, #initialize, type
Methods included from RestApi
#build_generic_http_opts, #create, #delete, #http_request, #parse_response, #post, #refresh, #update
Constructor Details
This class inherits a constructor from VCloud::BaseVCloudEntity
Instance Method Details
#get_network_references_by_name ⇒ Hash{String => VCloud::Reference}
Returns a hash of of all Network references, keyed by the name
15 16 17 |
# File 'lib/vcloud/user/vdc.rb', line 15 def get_network_references_by_name Hash[@network_references.collect{ |i| [i.name, i] }] end |
#instantiate_vapp_template(instantiate_vapp_template_params, session = self.session) ⇒ VCloud::VApp
Create a vApp from a vApp template
24 25 26 27 28 29 30 |
# File 'lib/vcloud/user/vdc.rb', line 24 def instantiate_vapp_template(instantiate_vapp_template_params, session = self.session) url = @links.select{ |l| l.type == VCloud::Constants::ContentType::INSTANTIATE_VAPP_TEMPLATE_PARAMS }.first.href response = post(url, instantiate_vapp_template_params.to_xml, VCloud::Constants::ContentType::INSTANTIATE_VAPP_TEMPLATE_PARAMS, session) vapp = VCloud::VApp.new :session => session vapp.parse_xml(response) vapp end |