Class: Com::Vmware::Vcenter::Datacenter

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::Datacenter`` class provides methods to manage datacenters in the vCenter Server.

Defined Under Namespace

Classes: CreateSpec, FilterSpec, Info, Summary

Constant Summary

RESOURCE_TYPE =
'Datacenter'

Instance Method Summary (collapse)

Constructor Details

- (Datacenter) initialize(config)

Constructs a new instance.

Parameters:

  • config (VAPI::Bindings::StubConfig)

    A hash with the api provider details.



349
350
351
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter.rb', line 349

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

Instance Method Details

- (String) create(spec)

Create a new datacenter in the vCenter inventory

Parameters:

Returns:

  • (String)

    The identifier of the newly created datacenter

Raises:



378
379
380
381
382
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter.rb', line 378

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

- (Void) delete(datacenter, force = nil)

Delete an empty datacenter from the vCenter Server

Parameters:

  • datacenter (String)

    Identifier of the datacenter to be deleted.

  • force (Boolean, nil) (defaults to: nil)

    If true, delete the datacenter even if it is not empty. If nil a :class:`Com::Vmware::Vapi::Std::Errors::ResourceInUse` error will be reported if the datacenter is not empty. This is the equivalent of passing the value false.

Returns:

  • (Void)

Raises:



405
406
407
408
409
410
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter.rb', line 405

def delete(datacenter, force=nil)
    invoke_with_info(@@delete_info, {
        'datacenter' => datacenter,
        'force' => force,
    })
end

- (Com::Vmware::Vcenter::Datacenter::Info) get(datacenter)

Retrieves information about the datacenter corresponding to ``datacenter`` .

Parameters:

  • datacenter (String)

    Identifier of the datacenter.

Returns:

Raises:



451
452
453
454
455
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter.rb', line 451

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

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

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

Parameters:

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

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

Returns:

Raises:



428
429
430
431
432
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vcenter.rb', line 428

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