Class: VCloud::Vdc

Inherits:
BaseVCloudEntity show all
Includes:
ParsesXml
Defined in:
lib/vcloud/user/vdc.rb

Overview

Represents the user view of an organization vDC

Instance Method Summary collapse

Methods included from ParsesXml

included, #parse_xml

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_nameHash{String => VCloud::Reference}

Returns a hash of of all Network references, keyed by the name

Returns:

  • (Hash{String => VCloud::Reference})

    Reference to all Networks in the vDC, keyed by 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

Parameters:

Returns:



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