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::Appliance::Vmon::Service Class Reference
Inheritance diagram for Com::Vmware::Appliance::Vmon::Service:

## Classes
class | Health
class | Info
class | StartupType
class | State
class | UpdateSpec

## Avaliable Methods
public method | restart ()
public method | stop ()
public method | get ()
public method | list_details ()
public method | new ()
public method | update ()
public method | start ()

## Detailed Description

The `Com::Vmware::Appliance::Vmon::Service` interface provides methods to manage a single/set of services that are managed by vMon.

## Member Function Documentation

public method Com::Vmware::Appliance::Vmon::Service::get | ( |  | ) |

Returns the state of a service.

Parameters

  service | [REQUIRED] identifier of the service whose state is being queried. The value must be an identifier for the resource type getQualifiedName(com.vmware.appliance.vmon.Service). . The value must be str.

Return values

  Service | Info structure. The return type will be Com::Vmware::Appliance::Vmon::Service::Info

Exceptions

  Com::Vmware::Vapi::Std::Errors::NotFound | if the service associated with `service` does not exist.
  Com::Vmware::Vapi::Std::Errors::Error | if any other error occurs during the execution of the operation.

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

public method Com::Vmware::Appliance::Vmon::Service::list_details | ( |  | ) |

Lists details of services managed by vMon.

Return values

  Map | of service identifiers to service Info structures. The value will be an identifier for the resource type getQualifiedName(com.vmware.appliance.vmon.Service). The return type will be Dictionary of str and Com::Vmware::Appliance::Vmon::Service::Info

Exceptions

  Com::Vmware::Vapi::Std::Errors::Error | if any error occurs during the execution of the operation.

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

public method Com::Vmware::Appliance::Vmon::Service::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::Appliance::Vmon::Service::restart | ( |  | ) |

Restarts a service

Parameters

  service | [REQUIRED] identifier of the service to restart The value must be an identifier for the resource type getQualifiedName(com.vmware.appliance.vmon.Service). . The value must be str.

Exceptions

  Com::Vmware::Vapi::Std::Errors::NotFound | if the service associated with `service` does not exist.
  Com::Vmware::Vapi::Std::Errors::TimedOut | if any timeout occurs during the execution of the restart operation.
  Com::Vmware::Vapi::Std::Errors::NotAllowedInCurrentState | if the operation is denied in the current state of the service. If a stop or start operation is in progress, issuing a restart operation will lead to this error.
  Com::Vmware::Vapi::Std::Errors::NotAllowedInCurrentState | if a restart operation is issued on a service which has startup type :attr:`Com::Vmware::Appliance::Vmon::Service::StartupType.DISABLED`
  Com::Vmware::Vapi::Std::Errors::Error | if any other error occurs during the execution of the operation.

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

public method Com::Vmware::Appliance::Vmon::Service::start | ( |  | ) |

Starts a service

Parameters

  service | [REQUIRED] identifier of the service to start The value must be an identifier for the resource type getQualifiedName(com.vmware.appliance.vmon.Service). . The value must be str.

Exceptions

  Com::Vmware::Vapi::Std::Errors::NotFound | if the service associated with `service` does not exist.
  Com::Vmware::Vapi::Std::Errors::NotAllowedInCurrentState | if the operation is denied in the current state of the service. If a stop or restart operation is in progress, the start operation will not be allowed.
  Com::Vmware::Vapi::Std::Errors::NotAllowedInCurrentState | if start operation is issued on a service which has startup type :attr:`Com::Vmware::Appliance::Vmon::Service::StartupType.DISABLED` .
  Com::Vmware::Vapi::Std::Errors::TimedOut | if any timeout occurs during the execution of the start operation. Timeout occurs when the service takes longer than StartTimeout to start.
  Com::Vmware::Vapi::Std::Errors::Error | if any other error occurs during the execution of the operation.

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

public method Com::Vmware::Appliance::Vmon::Service::stop | ( |  | ) |

Stops a service

Parameters

  service | [REQUIRED] identifier of the service to stop The value must be an identifier for the resource type getQualifiedName(com.vmware.appliance.vmon.Service). . The value must be str.

Exceptions

  Com::Vmware::Vapi::Std::Errors::NotFound | if the service associated with `service` does not exist.
  Com::Vmware::Vapi::Std::Errors::Error | if any other error occurs during the execution of the operation.
  Com::Vmware::Vapi::Std::Errors::NotAllowedInCurrentState | if the operation is denied in the current state of the service. If a stop operation is in progress, issuing another stop operation will lead to this error.

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

public method Com::Vmware::Appliance::Vmon::Service::update | ( |  | ) |

Updates the properties of a service.

Parameters

  service | [REQUIRED] identifier of the service whose properties are being updated. The value must be an identifier for the resource type getQualifiedName(com.vmware.appliance.vmon.Service). . The value must be str.
  spec | [REQUIRED] Service Update specification. . The value must be Com::Vmware::Appliance::Vmon::Service::UpdateSpec.

Exceptions

  Com::Vmware::Vapi::Std::Errors::NotFound | if the service associated with `service` does not exist.
  Com::Vmware::Vapi::Std::Errors::Error | if any other error occurs during the execution of the operation.
  Com::Vmware::Vapi::Std::Errors::NotAllowedInCurrentState | if the operation is denied in the current state of the service. If a start, stop or restart operation is in progress, update operation will fail with this error.
  Com::Vmware::Vapi::Std::Errors::NotAllowedInCurrentState | if a request to set the :attr:`Com::Vmware::Appliance::Vmon::Service::UpdateSpec.startup_type` field of `spec` to :attr:`Com::Vmware::Appliance::Vmon::Service::StartupType.DISABLED` comes in for a service that is not in :attr:`Com::Vmware::Appliance::Vmon::Service::State.STOPPED` state.

Code:
click to view
# Number of lines of code in update: 11
sub update {
my ($self, %args) = @_;
my $service = $args {service};
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/Appliance/Vmon/Service.pm