Class List Method List File List

# Class: Com::Vmware::Content::LocalLibrary

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

## Overview

The ``Com::Vmware::Content::LocalLibrary`` class manages local libraries.

     The  ``Com::Vmware::Content::LocalLibrary``   class  provides support for creating and maintaining local library instances. A local library may also use the   :class:`Com::Vmware::Content::Library`    class  to manage general library functionality.

## Instance Method Summary (collapse)

- - (String) create(create_spec, client_token = nil)

  Creates a new local library.

- - (Void) delete(library_id)

  Deletes the specified local library.

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

  Returns a given local library.

- - (LocalLibrary) initialize(config) constructor

  Constructs a new instance.

- - (Array<String>) list

  Returns the identifiers of all local libraries in the Content Library.

- - (Void) update(library_id, update_spec)

  Updates the properties of a local library.

## Constructor Details

### - (`LocalLibrary`) initialize(config)

Constructs a new instance.

Parameters:

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

  A hash with the api provider details.

    360
    361
    362
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content.rb', line 360

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

## Instance Method Details

### - (`String`) create(create_spec, client_token = nil)

Creates a new local library.

        If not specified creation is not idempotent.

Parameters:

- client_token (`String`, `nil`) (defaults to: `nil`) —

  A unique token generated on the client for each creation request. The token should be a universally unique identifier (UUID), for example: ``b8a2a2e3-2314-43cd-a871-6ede0f429751`` . This token can be used to guarantee idempotent creation.

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

  Specification for the new local library.

Returns:

- (`String`) —

  Identifier of the newly created :class:`Com::Vmware::Content::LibraryModel` .

Raises:

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

  if the ``create_spec`` is not valid.

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

  if the ``client_token`` does not conform to the UUID format.

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

  if using multiple storage backings.

    380
    381
    382
    383
    384
    385
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content.rb', line 380

    def create(create_spec, client_token=nil)
        invoke_with_info(@@create_info, {
            'client_token' => client_token,
            'create_spec' => create_spec,
        })
    end

### - (`Void`) delete(library_id)

Deletes the specified local library.

     Deleting a local library will remove the entry immediately and begin an asynchronous task to remove all cached content for the library. If the asynchronous task fails, file content may remain on the storage backing. This content will require manual removal.

Parameters:

- library_id (`String`) —

  Identifier of the local library to delete.

Returns:

- (`Void`)

Raises:

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

  if the library specified by ``library_id`` is not a local library.

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

  if the library specified by ``library_id`` does not exist.

    399
    400
    401
    402
    403
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content.rb', line 399

    def delete(library_id)
        invoke_with_info(@@delete_info, {
            'library_id' => library_id,
        })
    end

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

Returns a given local library.

Parameters:

- library_id (`String`) —

  Identifier of the local library to return.

Returns:

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

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

Raises:

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

  if the library specified by ``library_id`` does not exist.

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

  if the library specified by ``library_id`` is not a local library.

    416
    417
    418
    419
    420
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content.rb', line 416

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

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

Returns the identifiers of all local libraries in the Content Library.

Returns:

- (`Array<String>`) —

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

    427
    428
    429
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content.rb', line 427

    def list()
        invoke_with_info(@@list_info)
    end

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

Updates the properties of a local library.

     This is an incremental update to the local library.  Fields  that are  nil  in the update specification will be left unchanged.

Parameters:

- library_id (`String`) —

  Identifier of the local library to update.

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

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

Returns:

- (`Void`)

Raises:

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

  if the library specified by ``library_id`` does not exist.

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

  if the library specified by ``library_id`` is not a local library.

- (`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.

    449
    450
    451
    452
    453
    454
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content.rb', line 449

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