Class List Method List File List

# Class: Com::Vmware::Content::LibraryService

Inherits:
  VAPI::Bindings::VapiService
  - Object
  - VAPI::Bindings::VapiService
  - Com::Vmware::Content::LibraryService
  show all
Defined in:
  /build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content.rb

## Overview

The ``Com::Vmware::Content::Library`` class provides methods to manage and find :class:`Com::Vmware::Content::LibraryModel` entities.

     The  ``Com::Vmware::Content::Library``   class  provides support for generic functionality which can be applied equally to all types of libraries. The functionality provided by this  class  will not affect the properties specific to the type of library. See also   :class:`Com::Vmware::Content::LocalLibrary`   and   :class:`Com::Vmware::Content::SubscribedLibrary`  .

## Defined Under Namespace

Classes: FindSpec

## Constant Summary

RESOURCE_TYPE =

      'com.vmware.content.Library'

## Instance Method Summary (collapse)

- - (Array<String>) find(spec)

  Returns a list of all the visible (as determined by authorization policy) libraries matching the requested :class:`Com::Vmware::Content::Library::FindSpec` .

- - (Com::Vmware::Content::LibraryModel) get(library_id)

  Returns a given :class:`Com::Vmware::Content::LibraryModel` .

- - (LibraryService) initialize(config) constructor

  Constructs a new instance.

- - (Array<String>) list

  Returns the identifiers of all libraries of any type in the Content Library.

- - (Void) update(library_id, update_spec)

  Updates the properties of a library.

## Constructor Details

### - (`LibraryService`) initialize(config)

Constructs a new instance.

Parameters:

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

  A hash with the api provider details.

    159
    160
    161
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content.rb', line 159

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

## Instance Method Details

### - (`Array<String>`) find(spec)

Returns a list of all the visible (as determined by authorization policy) libraries matching the requested :class:`Com::Vmware::Content::Library::FindSpec` .

Parameters:

- spec (`Com::Vmware::Content::Library::FindSpec`) —

  Specification describing what properties to filter on.

Returns:

- (`Array<String>`) —

  The list of identifiers of all the visible libraries matching the given ``spec`` .

Raises:

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

  if no properties are specified in the ``spec`` .

    198
    199
    200
    201
    202
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content.rb', line 198

    def find(spec)
        invoke_with_info(@@find_info, {
            'spec' => spec,
        })
    end

### - (`Com::Vmware::Content::LibraryModel`) get(library_id)

Returns a given :class:`Com::Vmware::Content::LibraryModel` .

Parameters:

- library_id (`String`) —

  Identifier of the library to return.

Returns:

- (`Com::Vmware::Content::LibraryModel`) —

  The :class:`Com::Vmware::Content::LibraryModel` instance with the specified ``library_id`` .

Raises:

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

  if the specified library does not exist.

    174
    175
    176
    177
    178
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content.rb', line 174

    def get(library_id)
        invoke_with_info(@@get_info, {
            'library_id' => library_id,
        })
    end

### - (`Array<String>`) list

Returns the identifiers of all libraries of any type in the Content Library.

Returns:

- (`Array<String>`) —

  The list of all identifiers of all libraries in the Content Library.

    185
    186
    187
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content.rb', line 185

    def list()
        invoke_with_info(@@list_info)
    end

### - (`Void`) update(library_id, update_spec)

Updates the properties of a library.

     This is an incremental update to the library. Any  field  in the   :class:`Com::Vmware::Content::LibraryModel`    class  that is  nil  will not be modified.

     This  method  will only update the common properties for all library types. This will not, for example, update the   :attr:`Com::Vmware::Content::LibraryModel.publish_info`   of a local library, nor the   :attr:`Com::Vmware::Content::LibraryModel.subscription_info`   of a subscribed library. Specific properties are updated in   :func:`Com::Vmware::Content::LocalLibrary.update`   and   :func:`Com::Vmware::Content::SubscribedLibrary.update`  .

Parameters:

- library_id (`String`) —

  Identifier of the library to update.

- update_spec (`Com::Vmware::Content::LibraryModel`) —

  Specification of the new property values to set on the library.

Returns:

- (`Void`)

Raises:

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

  if the library associated with ``library_id`` does not exist.

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

  if the ``update_spec`` is not valid.

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

  if the :attr:`Com::Vmware::Content::LibraryModel.version` of ``update_spec`` is not equal to the current version of the library.

    222
    223
    224
    225
    226
    227
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content.rb', line 222

    def update(library_id, update_spec)
        invoke_with_info(@@update_info, {
            'library_id' => library_id,
            'update_spec' => update_spec,
        })
    end