Class: VagrantPlugins::VCloud::Driver::Base
- Inherits:
-
Object
- Object
- VagrantPlugins::VCloud::Driver::Base
- Includes:
- Vagrant::Util::Retryable
- Defined in:
- lib/vagrant-vcloud/driver/base.rb
Overview
Main class to access vCloud rest APIs
Direct Known Subclasses
Instance Method Summary collapse
-
#compose_vapp_from_vm(vdc, vapp_name, vapp_description, vm_list = {}, network_config = {}) ⇒ Object
Compose a vapp using existing virtual machines.
-
#create_vapp_from_template(vdc, vapp_name, vapp_description, vapp_templateid, poweron = false) ⇒ Object
Create a vapp starting from a template.
-
#delete_vapp(vAppId) ⇒ Object
Delete a given vapp NOTE: It doesn’t verify that the vapp is shutdown.
-
#get_catalog(catalogId) ⇒ Object
Fetch details about a given catalog.
-
#get_catalog_by_name(organization, catalogName) ⇒ Object
Friendly helper method to fetch an catalog by name - organization hash (from get_organization/get_organization_by_name) - catalog name.
-
#get_catalog_id_by_name(organization, catalogName) ⇒ Object
Friendly helper method to fetch an catalog id by name - organization hash (from get_organization/get_organization_by_name) - catalog name.
-
#get_catalog_item(catalogItemId) ⇒ Object
Fetch details about a given catalog item: - description - vApp templates.
-
#get_catalog_item_by_name(catalogId, catalogItemName) ⇒ Object
friendly helper method to fetch an catalogItem by name - catalogId (use get_catalog_name(org, name)) - catalagItemName.
-
#get_organization(orgId) ⇒ Object
Fetch details about an organization: - catalogs - vdcs - networks.
-
#get_organization_by_name(name) ⇒ Object
friendly helper method to fetch an Organization by name - name (this isn’t case sensitive).
-
#get_organization_id_by_name(name) ⇒ Object
friendly helper method to fetch an Organization Id by name - name (this isn’t case sensitive).
-
#get_organizations ⇒ Object
Fetch existing organizations and their IDs.
-
#get_task(taskid) ⇒ Object
Fetch information for a given task.
-
#get_vapp(vAppId) ⇒ Object
Fetch details about a given vapp: - name - description - status - IP - Children VMs: – IP addresses – status – ID.
-
#get_vapp_edge_public_ip(vAppId) ⇒ Object
get vApp edge public IP from the vApp ID Only works when: - vApp needs to be poweredOn - FenceMode is set to “natRouted” - NatType“ is set to ”portForwarding This will be required to know how to connect to VMs behind the Edge device.
-
#get_vapp_port_forwarding_rules(vAppId) ⇒ Object
Get vApp port forwarding rules.
-
#get_vapp_template(vAppId) ⇒ Object
Fetch details about a given vapp template: - name - description - Children VMs: – ID.
-
#get_vdc(vdcId) ⇒ Object
Fetch details about a given vdc: - description - vapps - networks.
-
#get_vdc_by_name(organization, vdcName) ⇒ Object
Friendly helper method to fetch a Organization VDC by name - Organization object - Organization VDC Name.
-
#get_vdc_id_by_name(organization, vdcName) ⇒ Object
Friendly helper method to fetch a Organization VDC Id by name - Organization object - Organization VDC Name.
-
#get_vm(vmId) ⇒ Object
Fetch details about a given VM.
-
#initialize ⇒ Base
constructor
A new instance of Base.
-
#login ⇒ Object
Authenticate against the specified server.
-
#logout ⇒ Object
Destroy the current session.
-
#poweron_vapp(vAppId) ⇒ Object
Boot a given vapp.
-
#reboot_vapp(vAppId) ⇒ Object
reboot a given vapp This will basically initial a guest OS reboot, and will only work if VMware-tools are installed on the underlying VMs.
-
#reset_vapp(vAppId) ⇒ Object
reset a given vapp This will basically reset the VMs within the vApp vShield Edge devices are not affected.
-
#set_vapp_network_config(vappid, network_name, config = {}) ⇒ Object
Set vApp Network Config.
-
#set_vapp_port_forwarding_rules(vappid, network_name, config = {}) ⇒ Object
Set vApp port forwarding rules.
-
#set_vm_guest_customization(vmid, computer_name, config = {}) ⇒ Object
Set VM Guest Customization Config.
-
#set_vm_network_config(vmid, network_name, config = {}) ⇒ Object
Set VM Network Config.
-
#suspend_vapp(vAppId) ⇒ Object
Suspend a given vapp.
-
#upload_ovf(vdcId, vappName, vappDescription, ovfFile, catalogId, uploadOptions = {}) ⇒ Object
Upload an OVF package - vdcId - vappName - vappDescription - ovfFile - catalogId - uploadOptions {}.
-
#wait_task_completion(taskid) ⇒ Object
Poll a given task until completion.
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
39 40 41 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 39 def initialize @logger = Log4r::Logger.new("vagrant::provider::vcloud::base") end |
Instance Method Details
#compose_vapp_from_vm(vdc, vapp_name, vapp_description, vm_list = {}, network_config = {}) ⇒ Object
Compose a vapp using existing virtual machines
Params:
-
vdc: the associated VDC
-
vapp_name: name of the target vapp
-
vapp_description: description of the target vapp
-
vm_list: hash with IDs of the VMs to be used in the composing process
-
network_config: hash of the network configuration for the vapp
198 199 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 198 def compose_vapp_from_vm(vdc, vapp_name, vapp_description, vm_list={}, network_config={}) end |
#create_vapp_from_template(vdc, vapp_name, vapp_description, vapp_templateid, poweron = false) ⇒ Object
Create a vapp starting from a template
Params:
-
vdc: the associated VDC
-
vapp_name: name of the target vapp
-
vapp_description: description of the target vapp
-
vapp_templateid: ID of the vapp template
186 187 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 186 def create_vapp_from_template(vdc, vapp_name, vapp_description, vapp_templateid, poweron=false) end |
#delete_vapp(vAppId) ⇒ Object
Delete a given vapp NOTE: It doesn’t verify that the vapp is shutdown
150 151 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 150 def delete_vapp(vAppId) end |
#get_catalog(catalogId) ⇒ Object
Fetch details about a given catalog
81 82 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 81 def get_catalog(catalogId) end |
#get_catalog_by_name(organization, catalogName) ⇒ Object
Friendly helper method to fetch an catalog by name
-
organization hash (from get_organization/get_organization_by_name)
-
catalog name
95 96 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 95 def get_catalog_by_name(organization, catalogName) end |
#get_catalog_id_by_name(organization, catalogName) ⇒ Object
Friendly helper method to fetch an catalog id by name
-
organization hash (from get_organization/get_organization_by_name)
-
catalog name
88 89 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 88 def get_catalog_id_by_name(organization, catalogName) end |
#get_catalog_item(catalogItemId) ⇒ Object
Fetch details about a given catalog item:
-
description
-
vApp templates
124 125 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 124 def get_catalog_item(catalogItemId) end |
#get_catalog_item_by_name(catalogId, catalogItemName) ⇒ Object
friendly helper method to fetch an catalogItem by name
-
catalogId (use get_catalog_name(org, name))
-
catalagItemName
131 132 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 131 def get_catalog_item_by_name(catalogId, catalogItemName) end |
#get_organization(orgId) ⇒ Object
Fetch details about an organization:
-
catalogs
-
vdcs
-
networks
76 77 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 76 def get_organization(orgId) end |
#get_organization_by_name(name) ⇒ Object
friendly helper method to fetch an Organization by name
-
name (this isn’t case sensitive)
68 69 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 68 def get_organization_by_name(name) end |
#get_organization_id_by_name(name) ⇒ Object
friendly helper method to fetch an Organization Id by name
-
name (this isn’t case sensitive)
61 62 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 61 def get_organization_id_by_name(name) end |
#get_organizations ⇒ Object
Fetch existing organizations and their IDs
55 56 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 55 def get_organizations end |
#get_task(taskid) ⇒ Object
Fetch information for a given task
248 249 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 248 def get_task(taskid) end |
#get_vapp(vAppId) ⇒ Object
Fetch details about a given vapp:
-
name
-
description
-
status
-
IP
-
Children VMs: – IP addresses – status – ID
144 145 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 144 def get_vapp(vAppId) end |
#get_vapp_edge_public_ip(vAppId) ⇒ Object
get vApp edge public IP from the vApp ID Only works when:
-
vApp needs to be poweredOn
-
FenceMode is set to “natRouted”
-
NatType“ is set to ”portForwarding
This will be required to know how to connect to VMs behind the Edge device.
232 233 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 232 def get_vapp_edge_public_ip(vAppId) end |
#get_vapp_port_forwarding_rules(vAppId) ⇒ Object
Get vApp port forwarding rules
-
vappid: id of the vApp
222 223 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 222 def get_vapp_port_forwarding_rules(vAppId) end |
#get_vapp_template(vAppId) ⇒ Object
Fetch details about a given vapp template:
-
name
-
description
-
Children VMs: – ID
206 207 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 206 def get_vapp_template(vAppId) end |
#get_vdc(vdcId) ⇒ Object
Fetch details about a given vdc:
-
description
-
vapps
-
networks
103 104 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 103 def get_vdc(vdcId) end |
#get_vdc_by_name(organization, vdcName) ⇒ Object
Friendly helper method to fetch a Organization VDC by name
-
Organization object
-
Organization VDC Name
117 118 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 117 def get_vdc_by_name(organization, vdcName) end |
#get_vdc_id_by_name(organization, vdcName) ⇒ Object
Friendly helper method to fetch a Organization VDC Id by name
-
Organization object
-
Organization VDC Name
110 111 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 110 def get_vdc_id_by_name(organization, vdcName) end |
#get_vm(vmId) ⇒ Object
Fetch details about a given VM
274 275 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 274 def get_vm(vmId) end |
#login ⇒ Object
Authenticate against the specified server
45 46 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 45 def login end |
#logout ⇒ Object
Destroy the current session
50 51 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 50 def logout end |
#poweron_vapp(vAppId) ⇒ Object
Boot a given vapp
175 176 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 175 def poweron_vapp(vAppId) end |
#reboot_vapp(vAppId) ⇒ Object
reboot a given vapp This will basically initial a guest OS reboot, and will only work if VMware-tools are installed on the underlying VMs. vShield Edge devices are not affected
163 164 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 163 def reboot_vapp(vAppId) end |
#reset_vapp(vAppId) ⇒ Object
reset a given vapp This will basically reset the VMs within the vApp vShield Edge devices are not affected.
170 171 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 170 def reset_vapp(vAppId) end |
#set_vapp_network_config(vappid, network_name, config = {}) ⇒ Object
Set vApp Network Config
258 259 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 258 def set_vapp_network_config(vappid, network_name, config={}) end |
#set_vapp_port_forwarding_rules(vappid, network_name, config = {}) ⇒ Object
Set vApp port forwarding rules
-
vappid: id of the vapp to be modified
-
network_name: name of the vapp network to be modified
-
config: hash with network configuration specifications, must contain an array inside :nat_rules with the nat rules to be applied.
215 216 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 215 def set_vapp_port_forwarding_rules(vappid, network_name, config={}) end |
#set_vm_guest_customization(vmid, computer_name, config = {}) ⇒ Object
Set VM Guest Customization Config
269 270 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 269 def set_vm_guest_customization(vmid, computer_name, config={}) end |
#set_vm_network_config(vmid, network_name, config = {}) ⇒ Object
Set VM Network Config
263 264 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 263 def set_vm_network_config(vmid, network_name, config={}) end |
#suspend_vapp(vAppId) ⇒ Object
Suspend a given vapp
155 156 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 155 def suspend_vapp(vAppId) end |
#upload_ovf(vdcId, vappName, vappDescription, ovfFile, catalogId, uploadOptions = {}) ⇒ Object
Upload an OVF package
-
vdcId
-
vappName
-
vappDescription
-
ovfFile
-
catalogId
-
uploadOptions {}
243 244 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 243 def upload_ovf(vdcId, vappName, vappDescription, ovfFile, catalogId, uploadOptions={}) end |
#wait_task_completion(taskid) ⇒ Object
Poll a given task until completion
253 254 |
# File 'lib/vagrant-vcloud/driver/base.rb', line 253 def wait_task_completion(taskid) end |