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::Vm::Hardware::Cpu Class Reference
Inheritance diagram for Com::Vmware::Vcenter::Vm::Hardware::Cpu:

## Classes
class | Info
class | UpdateSpec

## Avaliable Methods
public method | get ()
public method | new ()
public method | update ()

## Detailed Description

The `Com::Vmware::Vcenter::Vm::Hardware::Cpu` interface provides methods for configuring the CPU settings of a virtual machine.

## Member Function Documentation

public method Com::Vmware::Vcenter::Vm::Hardware::Cpu::get | ( |  | ) |

Returns the CPU-related settings of a virtual machine.

Parameters

  vm | [REQUIRED] Virtual machine identifier. The value must be an identifier for the resource type getQualifiedName(VirtualMachine). . The value must be str.

Return values

  CPU-related | settings of the virtual machine. The return type will be Com::Vmware::Vcenter::Vm::Hardware::Cpu::Info

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 the virtual machine is not found.
  Com::Vmware::Vapi::Std::Errors::ResourceInaccessible | if the virtual machine's configuration state cannot be accessed.
  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 get: 10
sub get {
my ($self, %args) = @_;
my $vm = $args {vm};
$self->validate_args (method_name => 'get',
method_args => \%args);
return $self->invoke (method_name => 'get',
method_args => \%args);
}

public method Com::Vmware::Vcenter::Vm::Hardware::Cpu::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;
}

public method Com::Vmware::Vcenter::Vm::Hardware::Cpu::update | ( |  | ) |

Updates the CPU-related settings of a virtual machine.

Parameters

  vm | [REQUIRED] Virtual machine identifier. The value must be an identifier for the resource type getQualifiedName(VirtualMachine). . The value must be str.
  spec | [REQUIRED] Specification for updating the CPU-related settings of the virtual machine. . The value must be Com::Vmware::Vcenter::Vm::Hardware::Cpu::UpdateSpec.

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 the virtual machine is not found.
  Com::Vmware::Vapi::Std::Errors::InvalidArgument | if one of the provided settings is not permitted; for example, specifying a negative value for `count` .
  Com::Vmware::Vapi::Std::Errors::NotAllowedInCurrentState | if `hotAddEnabled` or `hotRemoveEnabled` is specified and the virtual machine is not powered off.
  Com::Vmware::Vapi::Std::Errors::NotAllowedInCurrentState | if `count` is specified and is greater than `count` , `hotAddEnabled` is false, and the virtual machine is not powered off.
  Com::Vmware::Vapi::Std::Errors::NotAllowedInCurrentState | if `count` is specified and is less than `count` , `hotRemoveEnabled` is false, and the virtual machine is not powered off.
  Com::Vmware::Vapi::Std::Errors::ResourceBusy | if the virtual machine is busy performing another operation.
  Com::Vmware::Vapi::Std::Errors::ResourceInaccessible | if the virtual machine's configuration state cannot be accessed.
  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 update: 11
sub update {
my ($self, %args) = @_;
my $vm = $args {vm};
my $spec = $args {spec};
$self->validate_args (method_name => 'update',
method_args => \%args);
return $self->invoke (method_name => 'update',
method_args => \%args);
}

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

- Com/Vmware/Vcenter/Vm/Hardware/Cpu.pm