VMware vSphere Automation SDK Perl The VMware vSphere Automation SDK for Perl supports the client-side vSphere Automation API for access to vSphere services and capabilities

- Main Page
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Files Functions
Classes | List of all members
Com::Vmware::Vcenter::Host Class Reference
Inheritance diagram for Com::Vmware::Vcenter::Host:

## Classes
class | ConnectionState
class | CreateSpec
class | FilterSpec
class | PowerState
class | Summary

## Avaliable Methods
public method | create ()
public method | delete ()
public method | disconnect ()
public method | new ()
public method | connect ()
public method | list ()

## Detailed Description

The `Com::Vmware::Vcenter::Host` interface provides methods to manage hosts in the vCenter Server. Constant String::RESOURCE_TYPE # The resource type for the vCenter Host.

## Member Function Documentation

public method Com::Vmware::Vcenter::Host::connect | ( |  | ) |

Connect to the host corresponding to `host` previously added to the vCenter server.

Parameters

  host | [REQUIRED] Identifier of the host to be reconnected. The value must be an identifier for the resource type getQualifiedName(HostSystem). . The value must be str.

Exceptions

  Com::Vmware::Vapi::Std::Errors::AlreadyInDesiredState | if the host associated with `host` is already connected.
  Com::Vmware::Vapi::Std::Errors::Error | if the system reports an error while responding to the request.
  Com::Vmware::Vapi::Std::Errors::NotFound | if there is no host associated with `host` in the system.
  Com::Vmware::Vapi::Std::Errors::ServiceUnavailable | if the system is unable to communicate with a service to complete the request.
  Com::Vmware::Vapi::Std::Errors::Unauthenticated | if the user can not be authenticated.
  Com::Vmware::Vapi::Std::Errors::Unauthorized | if the user doesn't have the required privileges.

Code:
click to view
# Number of lines of code in connect: 10
sub connect {
my ($self, %args) = @_;
my $host = $args {host};
$self->validate_args (method_name => 'connect',
method_args => \%args);
return $self->invoke (method_name => 'connect',
method_args => \%args);
}

public method Com::Vmware::Vcenter::Host::create | ( |  | ) |

Add a new standalone host in the vCenter inventory. The newly connected host will be in connected state. The vCenter Server will verify the SSL certificate before adding the host to its inventory. In the case where the SSL certificate cannot be verified because the Certificate Authority is not recognized or the certificate is self signed, the vCenter Server will fall back to thumbprint verification mode as defined by class Com::Vmware::Vcenter::Host::CreateSpec::ThumbprintVerification .

Parameters

  spec | [REQUIRED] Specification for the new host to be created. . The value must be Com::Vmware::Vcenter::Host::CreateSpec.

Return values

  The | newly created identifier of the host in vCenter. The value will be an identifier for the resource type getQualifiedName(HostSystem). The return type will be str

Exceptions

  Com::Vmware::Vapi::Std::Errors::AlreadyExists | if the host with the same name is already present.
  Com::Vmware::Vapi::Std::Errors::Error | if installation of VirtualCenter agent on a host fails.
  Com::Vmware::Vapi::Std::Errors::Error | if the system reports an error while responding to the request.
  Com::Vmware::Vapi::Std::Errors::InvalidArgument | if the host name is invalid.
  Com::Vmware::Vapi::Std::Errors::InvalidArgument | if the host folder is invalid.
  Com::Vmware::Vapi::Std::Errors::InvalidArgument | if the SSL thumbprint specified is invalid.
  Com::Vmware::Vapi::Std::Errors::InvalidElementType | if the host folder id does not support vSphere compute resource as its children type.
  Com::Vmware::Vapi::Std::Errors::ResourceInUse | if the host is already being managed by another vCenter Server
  Com::Vmware::Vapi::Std::Errors::UnableToAllocateResource | if there are not enough licenses to add the host.
  Com::Vmware::Vapi::Std::Errors::Unauthenticated | if the user name or password for the administration account on the host are invalid.
  Com::Vmware::Vapi::Std::Errors::Unauthenticated | if the user can not be authenticated.
  Com::Vmware::Vapi::Std::Errors::Unsupported | if the software version on the host is not supported.
  Com::Vmware::Vapi::Std::Errors::ServiceUnavailable | if the system is unable to communicate with a service to complete the request.
  Com::Vmware::Vapi::Std::Errors::Unauthorized | if the user doesn't have the required privileges.

Code:
click to view
# Number of lines of code in create: 10
sub create {
my ($self, %args) = @_;
my $spec = $args {spec};
$self->validate_args (method_name => 'create',
method_args => \%args);
return $self->invoke (method_name => 'create',
method_args => \%args);
}

public method Com::Vmware::Vcenter::Host::delete | ( |  | ) |

Remove a standalone host from the vCenter Server.

Parameters

  host | [REQUIRED] Identifier of the host to be deleted. The value must be an identifier for the resource type getQualifiedName(HostSystem). . The value must be str.

Exceptions

  Com::Vmware::Vapi::Std::Errors::Error | if the system reports an error while responding to the request.
  Com::Vmware::Vapi::Std::Errors::NotFound | if there is no host associated with `host` in the system.
  Com::Vmware::Vapi::Std::Errors::ResourceInUse | if the host associated with `host` is in a vCenter cluster
  Com::Vmware::Vapi::Std::Errors::ServiceUnavailable | if the system is unable to communicate with a service to complete the request.
  Com::Vmware::Vapi::Std::Errors::Unauthenticated | if the user can not be authenticated.
  Com::Vmware::Vapi::Std::Errors::Unauthorized | if the user doesn't have the required privileges.

Code:
click to view
# Number of lines of code in delete: 10
sub delete {
my ($self, %args) = @_;
my $host = $args {host};
$self->validate_args (method_name => 'delete',
method_args => \%args);
return $self->invoke (method_name => 'delete',
method_args => \%args);
}

public method Com::Vmware::Vcenter::Host::disconnect | ( |  | ) |

Disconnect the host corresponding to `host` from the vCenter server

Parameters

  host | [REQUIRED] Identifier of the host to be disconnected. The value must be an identifier for the resource type getQualifiedName(HostSystem). . The value must be str.

Exceptions

  Com::Vmware::Vapi::Std::Errors::AlreadyInDesiredState | if the host associated with `host` is already disconnected.
  Com::Vmware::Vapi::Std::Errors::Error | if the system reports an error while responding to the request.
  Com::Vmware::Vapi::Std::Errors::NotFound | if there is no host associated with `host` in the system.
  Com::Vmware::Vapi::Std::Errors::ServiceUnavailable | if the system is unable to communicate with a service to complete the request.
  Com::Vmware::Vapi::Std::Errors::Unauthenticated | if the user can not be authenticated.
  Com::Vmware::Vapi::Std::Errors::Unauthorized | if the user doesn't have the required privileges.

Code:
click to view
# Number of lines of code in disconnect: 10
sub disconnect {
my ($self, %args) = @_;
my $host = $args {host};
$self->validate_args (method_name => 'disconnect',
method_args => \%args);
return $self->invoke (method_name => 'disconnect',
method_args => \%args);
}

public method Com::Vmware::Vcenter::Host::list | ( |  | ) |

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

Parameters

  filter | [OPTIONAL] Specification of matching hosts for which information should be returned. If null , the behavior is equivalent to a class Com::Vmware::Vcenter::Host::FilterSpec with all fields null which means all hosts match the filter. . The value must be Com::Vmware::Vcenter::Host::FilterSpec or None.

Return values

  Commonly | used information about the hosts matching the class Com::Vmware::Vcenter::Host::FilterSpec . The return type will be Array of Com::Vmware::Vcenter::Host::Summary

Exceptions

  Com::Vmware::Vapi::Std::Errors::InvalidArgument | if the :attr:`Com::Vmware::Vcenter::Host::FilterSpec.connection_states` field contains a value that is not supported by the server.
  Com::Vmware::Vapi::Std::Errors::UnableToAllocateResource | if more than 1000 hosts match the class Com::Vmware::Vcenter::Host::FilterSpec .
  Com::Vmware::Vapi::Std::Errors::ServiceUnavailable | if the system is unable to communicate with a service to complete the request.
  Com::Vmware::Vapi::Std::Errors::Unauthenticated | if the user can not be authenticated.
  Com::Vmware::Vapi::Std::Errors::Unauthorized | if the user doesn't have the required privileges.

Code:
click to view
# Number of lines of code in list: 10
sub list {
my ($self, %args) = @_;
my $filter = $args {filter};
$self->validate_args (method_name => 'list',
method_args => \%args);
return $self->invoke (method_name => 'list',
method_args => \%args);
}

public method Com::Vmware::Vcenter::Host::new | ( |  | ) |

Constructor to initialize the object

Parameters

  api_provider | - protocol connection to use with stubs created by this factory
  StubConfig | - Stub's additional configuration

Return values

  Blessed | object

Code:
click to view
# Number of lines of code in new: 11
sub new {
my ($class, %args) = @_;
$class = ref($class) || $class;
my $stub_config = $args {stub_config};
my $api_provider = $args {api_provider};
my $self = $class->SUPER::new('stub_config' => $stub_config,
'api_provider' => $api_provider);
bless $self, $class;
return $self;
}

The documentation for this class was generated from the following file:

- Com/Vmware/Vcenter/Host.pm