Class: Com::Vmware::Content::Library::Item::DownloadSession
- Inherits:
-
VAPI::Bindings::VapiService
- Object
- VAPI::Bindings::VapiService
- Com::Vmware::Content::Library::Item::DownloadSession
- 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)
-
- (Void) cancel(download_session_id)
Cancels the download session.
-
- (String) create(create_spec, client_token = nil)
Creates a new download session.
-
- (Void) delete(download_session_id)
Deletes a download session.
-
- (Void) fail(download_session_id, client_error_message)
Terminates the download session with a client specified error message.
-
- (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.
-
- (DownloadSession) initialize(config)
constructor
Constructs a new instance.
-
- (Void) keep_alive(download_session_id, progress = nil)
Keeps a download session alive.
-
- (Array<String>) list(library_item_id = nil)
Lists the identifiers of the download sessions created by the calling user.
Constructor Details
- (DownloadSession) initialize(config)
Constructs a new instance.
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.
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.
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.
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.
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, ) invoke_with_info(@@fail_info, { 'download_session_id' => download_session_id, '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.
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.
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.
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 |