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
List of all members
Com::Vmware::Vcenter::Vm::Power::Info Class Reference
Inheritance diagram for Com::Vmware::Vcenter::Vm::Power::Info:

## Avaliable Methods
public method | set_state ()
public method | set_clean_power_off ()
public method | get_clean_power_off ()
public method | new ()
public method | get_state ()

## Detailed Description

The `Com::Vmware::Vcenter::Vm::Power::Info` class contains information about the power state of a virtual machine.

## Member Function Documentation

public method Com::Vmware::Vcenter::Vm::Power::Info::get_clean_power_off | ( |  | ) |

Gets the value of 'clean_power_off' property.

Return values

  clean_power_off | - The current value of the field. Flag indicating whether the virtual machine was powered off cleanly. This field may be used to detect that the virtual machine crashed unexpectedly and should be restarted. optional#

Code:
click to view
# Number of lines of code in get_clean_power_off: 4
sub get_clean_power_off {
my ($self, %args) = @_;
return $self->{'clean_power_off'};
}

public method Com::Vmware::Vcenter::Vm::Power::Info::get_state | ( |  | ) |

Gets the value of 'state' property.

Return values

  state | - The current value of the field. Power state of the virtual machine. State#

Code:
click to view
# Number of lines of code in get_state: 4
sub get_state {
my ($self, %args) = @_;
return $self->{'state'};
}

public method Com::Vmware::Vcenter::Vm::Power::Info::new | ( |  | ) |

Constructor to initialize the Com::Vmware::Vcenter::Vm::Power::Info structure

Return values

  Blessed | object

Code:
click to view
# Number of lines of code in new: 27
sub new {
my ($class, %args) = @_;
$class = ref($class) || $class;
my $validatorList = [];
$validatorList = [
new Com::Vmware::Vapi::Data::UnionValidator(
'discriminant_name' => 'state',
'case_map' => {
'POWERED_OFF' => ['clean_power_off'],
'POWERED_ON' => [],
'SUSPENDED' => [],
}),
];
my $self = $class->SUPER::new('validator_list' => $validatorList, %args);
$self->{state} = $args{'state'};
$self->{clean_power_off} = $args{'clean_power_off'};
$self->set_binding_class('binding_class' => 'Com::Vmware::Vcenter::Vm::Power::Info');
$self->set_binding_name('name' => 'com.vmware.vcenter.vm.power.info');
$self->set_binding_field('key' => 'state', 'value' => new Com::Vmware::Vapi::Bindings::Type::ReferenceType('module_ctx' => 'Com::Vmware::Vcenter::Vm', 'type_name' => 'Power::State'));
$self->set_binding_field('key' => 'clean_power_off', 'value' => new Com::Vmware::Vapi::Bindings::Type::OptionalType('element_type' => new Com::Vmware::Vapi::Bindings::Type::BooleanType()));
bless $self, $class;
return $self;
}

public method Com::Vmware::Vcenter::Vm::Power::Info::set_clean_power_off | ( |  | ) |

Sets the given value for 'clean_power_off' property.

Parameters

  clean_power_off | - New value for the field. Flag indicating whether the virtual machine was powered off cleanly. This field may be used to detect that the virtual machine crashed unexpectedly and should be restarted.

Code:
click to view
# Number of lines of code in set_clean_power_off: 5
sub set_clean_power_off {
my ($self, %args) = @_;
$self->{'clean_power_off'} = $args{'clean_power_off'};
return;
}

public method Com::Vmware::Vcenter::Vm::Power::Info::set_state | ( |  | ) |

Sets the given value for 'state' property.

Parameters

  state | - New value for the field. Power state of the virtual machine.

Code:
click to view
# Number of lines of code in set_state: 5
sub set_state {
my ($self, %args) = @_;
$self->{'state'} = $args{'state'};
return;
}

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

- Com/Vmware/Vcenter/Vm/Power.pm