Class: Com::Vmware::Content::Library::Item::DownloadSession

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

Overview

The ``Com::Vmware::Content::Library::Item::DownloadSession`` class manipulates download sessions, which are used to download content from the Content Library Service.


 A download session is an object that tracks the download of content (that is, downloading content from the Content Library Service) and acts as a lease to keep the download links available.  

 The   :class:`Com::Vmware::Content::Library::Item::Downloadsession::File`    class  provides access to the download links.

Constant Summary

RESOURCE_TYPE =
'com.vmware.content.library.item.DownloadSession'

Instance Method Summary (collapse)

Constructor Details

- (DownloadSession) initialize(config)

Constructs a new instance.

Parameters:

  • config (VAPI::Bindings::StubConfig)

    A hash with the api provider details.



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

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

Instance Method Details

- (Void) cancel(download_session_id)

Cancels the download session. This method will abort any ongoing transfers and invalidate transfer urls that the client may be downloading from.

Parameters:

  • download_session_id (String)

    Identifer of the download session that should be canceled.

Returns:

  • (Void)

Raises:



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

def cancel(download_session_id)
    invoke_with_info(@@cancel_info, {
        'download_session_id' => download_session_id,
    })
end

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

Creates a new download session.


    If not specified creation is not idempotent.

Parameters:

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

    A unique token generated by 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::Item::DownloadSessionModel)

    Specification for the new download session to be created.

Returns:

  • (String)

    Identifier of the new download session being created.

Raises:



165
166
167
168
169
170
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content/library/item.rb', line 165

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

- (Void) delete(download_session_id)

Deletes a download session. This removes the session and all information associated with it.


 Removing a download session leaves any current transfers for that session in an indeterminate state (there is no guarantee that the transfers will be able to complete). However there will no longer be a means of inspecting the status of those downloads except by seeing the effect on the library item.  

 Download sessions for which there is no download activity or which are complete will automatically be expired and then deleted after a period of time.

Parameters:

  • download_session_id (String)

    Identifier of the download session to be deleted.

Returns:

  • (Void)

Raises:



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

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

- (Void) fail(download_session_id, client_error_message)

Terminates the download session with a client specified error message.


 This is useful in transmitting client side failures (for example, not being able to download a file) to the server side.

Parameters:

  • download_session_id (String)

    Identifier of the download session to fail.

  • client_error_message (String)

    Client side error message. This can be useful in providing some extra details about the client side failure. Note that the message won’t be translated to the user’s locale.

Returns:

  • (Void)

Raises:



273
274
275
276
277
278
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content/library/item.rb', line 273

def fail(download_session_id, client_error_message)
    invoke_with_info(@@fail_info, {
        'download_session_id' => download_session_id,
        'client_error_message' => client_error_message,
    })
end

- (Com::Vmware::Content::Library::Item::DownloadSessionModel) get(download_session_id)

Gets the download session with the specified identifier, including the most up-to-date status information for the session.

Parameters:

  • download_session_id (String)

    Identifier of the download session to retrieve.

Returns:

Raises:



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

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

- (Void) keep_alive(download_session_id, progress = nil)

Keeps a download session alive. This operation is allowed only if the session is in the :attr:`Com::Vmware::Content::Library::Item::DownloadSessionModel::State.ACTIVE` state.


 If there is no activity for a download session for a certain period of time, the download session will expire. The download session expiration timeout is configurable in the Content Library Service system configuration. The default is five minutes. Invoking this  method  enables a client to specifically extend the lifetime of an active download session.

    If not specified the progress is not updated.

Parameters:

  • download_session_id (String)

    Identifier of the download session whose lifetime should be extended.

  • progress (Fixnum, nil) (defaults to: nil)

    Optional update to the progress property of the session. If specified, the new progress should be greater then the current progress. See :attr:`Com::Vmware::Content::Library::Item::DownloadSessionModel.client_progress` .

Returns:

  • (Void)

Raises:



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

def keep_alive(download_session_id, progress=nil)
    invoke_with_info(@@keep_alive_info, {
        'download_session_id' => download_session_id,
        'progress' => progress,
    })
end

- (Array<String>) list(library_item_id = nil)

Lists the identifiers of the download sessions created by the calling user. Optionally may filter by library item.


    If not specified all download session identifiers are listed.

Parameters:

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

    Library item identifier on which to filter results.

Returns:

  • (Array<String>)

    The list of identifiers of all download sessions created by the calling user.

Raises:



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

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