Class List Method List File List

# Class: Com::Vmware::Appliance::Techpreview::ServicesService

Inherits:
  VAPI::Bindings::VapiService
  - Object
  - VAPI::Bindings::VapiService
  - Com::Vmware::Appliance::Techpreview::ServicesService
  show all
Defined in:
  /build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/appliance/techpreview.rb

## Overview

``Com::Vmware::Appliance::Techpreview::Services`` class provides methods Manages services.

## Defined Under Namespace

Classes: ServiceInfo, ServiceOps

## Instance Method Summary (collapse)

- - (Void) control(args, name, timeout)

  Manage a service with arbitrary command and arguments.

- - (ServicesService) initialize(config) constructor

  Constructs a new instance.

- - (Array<Com::Vmware::Appliance::Techpreview::Services::ServiceInfo>) list

  Get a list of all known services.

- - (Void) restart(name, timeout)

  start or restart a service.

- - (Void) stop(name, timeout)

  Stop a service.

## Constructor Details

### - (`ServicesService`) initialize(config)

Constructs a new instance.

Parameters:

- config (`VAPI::Bindings::StubConfig`) —

  A hash with the api provider details.

    470
    471
    472
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/appliance/techpreview.rb', line 470

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

## Instance Method Details

### - (`Void`) control(args, name, timeout)

Manage a service with arbitrary command and arguments.

Parameters:

- args (`Array<String>`) —

  Array of arguments.

- name (`String`) —

  Name of the service.

- timeout (`Fixnum`) —

  Timeout in seconds. Zero (0) means no timeout.

Returns:

- (`Void`)

Raises:

- (`Com::Vmware::Vapi::Std::Errors::Error`) —

  Generic error

    486
    487
    488
    489
    490
    491
    492
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/appliance/techpreview.rb', line 486

    def control(args, name, timeout)
        invoke_with_info(@@control_info, {
            'args' => args,
            'name' => name,
            'timeout' => timeout,
        })
    end

### - (`Array<Com::Vmware::Appliance::Techpreview::Services::ServiceInfo>`) list

Get a list of all known services.

Returns:

- (`Array<Com::Vmware::Appliance::Techpreview::Services::ServiceInfo>`) —

  List of services.

Raises:

- (`Com::Vmware::Vapi::Std::Errors::Error`) —

  Generic error

    501
    502
    503
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/appliance/techpreview.rb', line 501

    def list()
        invoke_with_info(@@list_info)
    end

### - (`Void`) restart(name, timeout)

start or restart a service

Parameters:

- name (`String`) —

  Name of the service to start or restart.

- timeout (`Fixnum`) —

  Timeout in seconds. Zero (0) means no timeout.

Returns:

- (`Void`)

Raises:

- (`Com::Vmware::Vapi::Std::Errors::Error`) —

  Generic error

    532
    533
    534
    535
    536
    537
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/appliance/techpreview.rb', line 532

    def restart(name, timeout)
        invoke_with_info(@@restart_info, {
            'name' => name,
            'timeout' => timeout,
        })
    end

### - (`Void`) stop(name, timeout)

Stop a service

Parameters:

- name (`String`) —

  Name of service.

- timeout (`Fixnum`) —

  Timeout in seconds. Zero (0) means no timeout.

Returns:

- (`Void`)

Raises:

- (`Com::Vmware::Vapi::Std::Errors::Error`) —

  Generic error

    515
    516
    517
    518
    519
    520
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/appliance/techpreview.rb', line 515

    def stop(name, timeout)
        invoke_with_info(@@stop_info, {
            'name' => name,
            'timeout' => timeout,
        })
    end