Class List Method List File List

# Class: Com::Vmware::Content::SubscribedLibrary

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

## Defined Under Namespace

Classes: ProbeResult

## Instance Method Summary (collapse)

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

  Creates a new subscribed library.

- - (Void) delete(library_id)

  Deletes the specified subscribed library.

- - (Void) evict(library_id)

  Evicts the cached content of an on-demand subscribed library.

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

  Returns a given subscribed library.

- - (SubscribedLibrary) initialize(config) constructor

  Constructs a new instance.

- - (Array<String>) list

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

- - (Com::Vmware::Content::SubscribedLibrary::ProbeResult) probe(subscription_info)

  Probes remote library subscription information, including URL, SSL certificate and password.

- - (Void) sync(library_id)

  Forces the synchronization of the subscribed library.

- - (Void) update(library_id, update_spec)

  Updates the properties of a subscribed library.

## Constructor Details

### - (`SubscribedLibrary`) initialize(config)

Constructs a new instance.

Parameters:

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

  A hash with the api provider details.

    587
    588
    589
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content.rb', line 587

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

## Instance Method Details

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

Creates a new subscribed library.

     Once created, the subscribed library will be empty. If the   :attr:`Com::Vmware::Content::LibraryModel.subscription_info`   property is set, the Content Library Service will attempt to synchronize to the remote source. This is an asynchronous operation so the content of the published library may not immediately appear.

        If not specified creation is not idempotent.

Parameters:

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

  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 subscribed library.

Returns:

- (`String`) —

  Identifier of the newly created subscribed library.

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.

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

  if subscribing to a published library which cannot be accessed.

    611
    612
    613
    614
    615
    616
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content.rb', line 611

    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 subscribed library.

     Deleting a subscribed 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 subscribed library to delete.

Returns:

- (`Void`)

Raises:

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

  if the library referenced by ``library_id`` is not a subscribed library.

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

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

    630
    631
    632
    633
    634
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content.rb', line 630

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

### - (`Void`) evict(library_id)

Evicts the cached content of an on-demand subscribed library.

     This  method  allows the cached content of a subscribed library to be removed to free up storage capacity. This  method  will only work when a subscribed library is synchronized on-demand.

Parameters:

- library_id (`String`) —

  Identifier of the subscribed library whose content should be evicted.

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 subscribed library.

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

  if the library specified by ``library_id`` does not synchronize on-demand.

    650
    651
    652
    653
    654
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content.rb', line 650

    def evict(library_id)
        invoke_with_info(@@evict_info, {
            'library_id' => library_id,
        })
    end

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

Returns a given subscribed library.

Parameters:

- library_id (`String`) —

  Identifier of the subscribed library to return.

Returns:

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

  The :class:`Com::Vmware::Content::LibraryModel` instance that corresponds to ``library_id`` .

Raises:

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

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

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

  if the library associated with ``library_id`` is not a subscribed library.

    667
    668
    669
    670
    671
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content.rb', line 667

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

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

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

Returns:

- (`Array<String>`) —

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

    678
    679
    680
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content.rb', line 678

    def list()
        invoke_with_info(@@list_info)
    end

### - (`Com::Vmware::Content::SubscribedLibrary::ProbeResult`) probe(subscription_info)

Probes remote library subscription information, including URL, SSL certificate and password. The resulting :class:`Com::Vmware::Content::SubscribedLibrary::ProbeResult` class describes whether or not the subscription configuration is successful.

Parameters:

- subscription_info (`Com::Vmware::Content::Library::SubscriptionInfo`) —

  The subscription info to be probed.

Returns:

- (`Com::Vmware::Content::SubscribedLibrary::ProbeResult`) —

  The subscription info probe result.

    738
    739
    740
    741
    742
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content.rb', line 738

    def probe(subscription_info)
        invoke_with_info(@@probe_info, {
            'subscription_info' => subscription_info,
        })
    end

### - (`Void`) sync(library_id)

Forces the synchronization of the subscribed library.

     Synchronizing a subscribed library forcefully with this  method  will perform the same synchronization behavior as would run periodically for the library. The   :attr:`Com::Vmware::Content::Library::SubscriptionInfo.on_demand`   setting is respected. Calling this  method  on a library that is already in the process of synchronizing will have no effect.

Parameters:

- library_id (`String`) —

  Identifier of the subscribed library to synchronize.

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 subscribed library.

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

  if some parameter in the subscribed library subscription info is invalid.

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

  if the published library cannot be contacted or found.

    698
    699
    700
    701
    702
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content.rb', line 698

    def sync(library_id)
        invoke_with_info(@@sync_info, {
            'library_id' => library_id,
        })
    end

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

Updates the properties of a subscribed library.

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

Parameters:

- library_id (`String`) —

  Identifier of the subscribed library to update.

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

  Specification of the new property values to set on the subscribed 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 subscribed 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.

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

  if the subscription info is being updated but the published library cannot be contacted or found.

    724
    725
    726
    727
    728
    729
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content.rb', line 724

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