Class: Com::Vmware::Vcenter::VM

Inherits:
VAPI::Bindings::VapiService
  • Object
show all
Defined in:
/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter.rb

Overview

The ``Com::Vmware::Vcenter::VM`` class provides methods for managing the lifecycle of a virtual machine.

Defined Under Namespace

Classes: CreateSpec, FilterSpec, Info, PlacementSpec, Summary

Instance Method Summary (collapse)

Constructor Details

- (VM) initialize(config)

Constructs a new instance.

Parameters:

  • config (VAPI::Bindings::StubConfig)

    A hash with the api provider details.



2488
2489
2490
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter.rb', line 2488

def initialize(config)
    super(config, @@service_info)
end

Instance Method Details

- (String) create(spec)

Creates a virtual machine.

Parameters:

Returns:

  • (String)

    ID of newly-created virtual machine.

Raises:



2521
2522
2523
2524
2525
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter.rb', line 2521

def create(spec)
    invoke_with_info(@@create_info, {
        'spec' => spec,
    })
end

- (Void) delete(vm)

Deletes a virtual machine.

Parameters:

  • vm (String)

    Virtual machine identifier.

Returns:

  • (Void)

Raises:



2572
2573
2574
2575
2576
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter.rb', line 2572

def delete(vm)
    invoke_with_info(@@delete_info, {
        'vm' => vm,
    })
end

- (Com::Vmware::Vcenter::VM::Info) get(vm)

Returns information about a virtual machine.

Parameters:

  • vm (String)

    Virtual machine identifier.

Returns:

Raises:



2546
2547
2548
2549
2550
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter.rb', line 2546

def get(vm)
    invoke_with_info(@@get_info, {
        'vm' => vm,
    })
end

- (Array<Com::Vmware::Vcenter::VM::Summary>) list(filter = nil)

Returns information about at most 1000 visible (subject to permission checks) virtual machines in vCenter matching the :class:`Com::Vmware::Vcenter::VM::FilterSpec` .

Parameters:

  • filter (Com::Vmware::Vcenter::VM::FilterSpec, nil) (defaults to: nil)

    Specification of matching virtual machines for which information should be returned. If nil , the behavior is equivalent to a :class:`Com::Vmware::Vcenter::VM::FilterSpec` with all fields nil which means all virtual machines match the filter.

Returns:

Raises:



2596
2597
2598
2599
2600
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter.rb', line 2596

def list(filter=nil)
    invoke_with_info(@@list_info, {
        'filter' => filter,
    })
end