Class: Com::Vmware::Content::Library::ItemService

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

Overview

The ``Com::Vmware::Content::Library::Item`` class provides methods for managing library items.

Defined Under Namespace

Classes: FindSpec

Constant Summary

RESOURCE_TYPE =
'com.vmware.content.library.Item'

Instance Method Summary (collapse)

Constructor Details

- (ItemService) initialize(config)

Constructs a new instance.

Parameters:

  • config (VAPI::Bindings::StubConfig)

    A hash with the api provider details.



142
143
144
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content/library.rb', line 142

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

Instance Method Details

- (String) copy(source_library_item_id, destination_create_spec, client_token = nil)

Copies a library item.


 Copying a library item allows a duplicate to be made within the same or different library. The copy occurs by first creating a new library item, whose identifier is returned. The content of the library item is then copied asynchronously. This copy can be tracked as a task.  

 If the copy fails, Content Library Service will roll back the copy by deleting any content that was already copied, and removing the new library item. A failure during rollback may require manual cleanup by an administrator.  

 A library item cannot be copied into a subscribed library.

    If not specified copy is not idempotent.

Parameters:

  • client_token (String, nil) (defaults to: nil)

    A unique token generated on the client for each copy 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 copy.

  • source_library_item_id (String)

    Identifier of the existing library item from which the content will be copied.

  • destination_create_spec (Com::Vmware::Content::Library::ItemModel)

    Specification for the new library item to be created.

Returns:

  • (String)

    The identifier of the new library item into which the content is being copied.

Raises:



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

def copy(source_library_item_id, destination_create_spec, client_token=nil)
    invoke_with_info(@@copy_info, {
        'client_token' => client_token,
        'source_library_item_id' => source_library_item_id,
        'destination_create_spec' => destination_create_spec,
    })
end

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

Creates a new library item.


 A new library item is created without any content. After creation, content can be added through the   :class:`Com::Vmware::Content::Library::Item::UpdateSession`   and   :class:`Com::Vmware::Content::Library::Item::Updatesession::File`    classs .  

 A library item cannot be created in a subscribed 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::Library::ItemModel)

    Specification that defines the properties of the new library item.

Returns:

  • (String)

    Identifier of the new library item.

Raises:



216
217
218
219
220
221
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content/library.rb', line 216

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

- (Void) delete(library_item_id)

Deletes a library item.


 This  method  will immediately remove the item from the library that owns it. The content of the item will be asynchronously removed from the storage backings. The content deletion can be tracked with a task. In the event that the task fails, an administrator may need to manually remove the files from the storage backing.  

 This  method  cannot be used to delete a library item that is a member of a subscribed library. Removing an item from a subscribed library requires deleting the item from the original published local library and syncing the subscribed library.

Parameters:

  • library_item_id (String)

    Identifier of the library item to delete.

Returns:

  • (Void)

Raises:



237
238
239
240
241
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content/library.rb', line 237

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

- (Array<String>) find(spec)

Returns identifiers of all the visible (as determined by authorization policy) library items matching the requested :class:`Com::Vmware::Content::Library::Item::FindSpec` .

Parameters:

  • spec (Com::Vmware::Content::Library::Item::FindSpec)

    Specification describing what properties to filter on.

Returns:

  • (Array<String>)

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

Raises:



282
283
284
285
286
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content/library.rb', line 282

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

- (Com::Vmware::Content::Library::ItemModel) get(library_item_id)

Returns the :class:`Com::Vmware::Content::Library::ItemModel` with the given identifier.

Parameters:

  • library_item_id (String)

    Identifier of the library item to return.

Returns:

Raises:



252
253
254
255
256
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content/library.rb', line 252

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

- (Array<String>) list(library_id)

Returns the identifiers of all items in the given library.

Parameters:

  • library_id (String)

    Identifier of the library whose items should be returned.

Returns:

  • (Array<String>)

    The list of identifiers of the items in the library specified by ``library_id`` .

Raises:



267
268
269
270
271
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content/library.rb', line 267

def list(library_id)
    invoke_with_info(@@list_info, {
        'library_id' => library_id,
    })
end

- (Void) update(library_item_id, update_spec)

Updates the specified properties of a library item.


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

 This  method  cannot update a library item that is a member of a subscribed library. Those items must be updated in the source published library and synchronized to the subscribed library.

Parameters:

Returns:

  • (Void)

Raises:



312
313
314
315
316
317
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content/library.rb', line 312

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