Class: Com::Vmware::Content::Library::Item::UpdateSession
- Inherits:
-
VAPI::Bindings::VapiService
- Object
- VAPI::Bindings::VapiService
- Com::Vmware::Content::Library::Item::UpdateSession
- 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::UpdateSession`` class manipulates sessions that are used to upload content into the Content Library Service, and/or to remove files from a library item.
An update session is a resource which tracks changes to content. An update session is created with a set of files that are intended to be uploaded to a specific :class:`Com::Vmware::Content::Library::ItemModel` , or removed from an item. The session object can be used to track the uploads and inspect the changes that are being made to the item by that upload. It can also serve as a channel to check on the result of the upload, and status messages such as errors and warnings for the upload.
Modifications are not visible to other clients unless the session is completed and all necessary files have been received.
The management of the files within the session is done through the :class:`Com::Vmware::Content::Library::Item::Updatesession::File` class .
Constant Summary
- RESOURCE_TYPE =
'com.vmware.content.library.item.UpdateSession'
Instance Method Summary (collapse)
-
- (Void) cancel(update_session_id)
Cancels the update session and deletes it.
-
- (Void) complete(update_session_id)
Completes the update session.
-
- (String) create(create_spec, client_token = nil)
Creates a new update session.
-
- (Void) delete(update_session_id)
Deletes an update session.
-
- (Void) fail(update_session_id, client_error_message)
Terminates the update session with a client specified error message.
-
- (Com::Vmware::Content::Library::Item::UpdateSessionModel) get(update_session_id)
Gets the update session with the specified identifier, including the most up-to-date status information for the session.
-
- (UpdateSession) initialize(config)
constructor
Constructs a new instance.
-
- (Void) keep_alive(update_session_id, client_progress = nil)
Keeps an update session alive.
-
- (Array<String>) list(library_item_id = nil)
Lists the identifiers of the update session created by the calling user.
Constructor Details
- (UpdateSession) initialize(config)
Constructs a new instance.
805 806 807 |
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content/library/item.rb', line 805 def initialize(config) super(config, @@service_info) end |
Instance Method Details
- (Void) cancel(update_session_id)
Cancels the update session and deletes it. This method will free up any temporary resources currently associated with the session.
This method is not allowed if the session has been already completed.
Cancelling an update session will cancel any in progress transfers (either uploaded by the client or pulled by the server). Any content that has been already received will be scheduled for deletion.
929 930 931 932 933 |
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content/library/item.rb', line 929 def cancel(update_session_id) invoke_with_info(@@cancel_info, { 'update_session_id' => update_session_id, }) end |
- (Void) complete(update_session_id)
Completes the update session. This indicates that the client has finished making all the changes required to the underlying library item. If the client is pushing the content to the server, the library item will be updated once this call returns. If the server is pulling the content, the call may return before the changes become visible. In that case, the client can track the session to know when the server is done.
This method requires the session to be in the :attr:`Com::Vmware::Content::Library::Item::UpdateSessionModel::State.ACTIVE` state.
Depending on the type of the library item associated with this session, a type adapter may be invoked to verify the validity of the files uploaded. The user can explicitly validate the session before completing the session by using the :func:`Com::Vmware::Content::Library::Item::Updatesession::File.validate` method .
Modifications are not visible to other clients unless the session is completed and all necessary files have been received.
887 888 889 890 891 |
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content/library/item.rb', line 887 def complete(update_session_id) invoke_with_info(@@complete_info, { 'update_session_id' => update_session_id, }) end |
- (String) create(create_spec, client_token = nil)
Creates a new update session. An update session is used to make modifications to a library item. Modifications are not visible to other clients unless the session is completed and all necessary files have been received.
Content Library Service allows only one single update session to be active for a specific library item.
If not specified creation is not idempotent.
833 834 835 836 837 838 |
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content/library/item.rb', line 833 def create(create_spec, client_token=nil) invoke_with_info(@@create_info, { 'client_token' => client_token, 'create_spec' => create_spec, }) end |
- (Void) delete(update_session_id)
Deletes an update session. This removes the session and all information associated with it.
Removing an update session leaves any current transfers for that session in an indeterminate state (there is no guarantee that the server will terminate the transfers, or that the transfers can be completed). However there will no longer be a means of inspecting the status of those uploads except by seeing the effect on the library item.
Update sessions for which there is no upload activity or which are complete will automatically be deleted after a period of time.
970 971 972 973 974 |
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content/library/item.rb', line 970 def delete(update_session_id) invoke_with_info(@@delete_info, { 'update_session_id' => update_session_id, }) end |
- (Void) fail(update_session_id, client_error_message)
Terminates the update session with a client specified error message.
This is useful in transmitting client side failures (for example, not being able to access a file) to the server side.
949 950 951 952 953 954 |
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content/library/item.rb', line 949 def fail(update_session_id, ) invoke_with_info(@@fail_info, { 'update_session_id' => update_session_id, 'client_error_message' => , }) end |
- (Com::Vmware::Content::Library::Item::UpdateSessionModel) get(update_session_id)
Gets the update session with the specified identifier, including the most up-to-date status information for the session.
849 850 851 852 853 |
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content/library/item.rb', line 849 def get(update_session_id) invoke_with_info(@@get_info, { 'update_session_id' => update_session_id, }) end |
- (Void) keep_alive(update_session_id, client_progress = nil)
Keeps an update session alive.
If there is no activity for an update session after a period of time, the update session will expire, then be deleted. The update 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 the update session.
If not specified the progress is not updated.
908 909 910 911 912 913 |
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content/library/item.rb', line 908 def keep_alive(update_session_id, client_progress=nil) invoke_with_info(@@keep_alive_info, { 'update_session_id' => update_session_id, 'client_progress' => client_progress, }) end |
- (Array<String>) list(library_item_id = nil)
Lists the identifiers of the update session created by the calling user. Optionally may filter by library item.
If not specified the results are not filtered.
865 866 867 868 869 |
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content/library/item.rb', line 865 def list(library_item_id=nil) invoke_with_info(@@list_info, { 'library_item_id' => library_item_id, }) end |