Class: Com::Vmware::Content::Library::Item::Updatesession::File

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

Overview

The ``Com::Vmware::Content::Library::Item::Updatesession::File`` class provides methods for accessing files within an update session.


 After an update session is created against a library item, the  ``Com::Vmware::Content::Library::Item::Updatesession::File``   class  can be used to make changes to the underlying library item metadata as well as the content of the files. The following changes can be made:  

  * deleting an existing file within the library item. This deletes both the metadata and the content.
   * updating an existing file with new content.
   * adding a new file to the library item.
  
   

 The above changes are not applied or visible until the session is completed. See   :class:`Com::Vmware::Content::Library::Item::UpdateSession`  .

Defined Under Namespace

Classes: AddSpec, Info, SourceType, ValidationError, ValidationResult

Instance Method Summary (collapse)

Constructor Details

- (File) initialize(config)

Constructs a new instance.

Parameters:

  • config (VAPI::Bindings::StubConfig)

    A hash with the api provider details.



126
127
128
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/content/library/item/updatesession.rb', line 126

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

Instance Method Details

- (Com::Vmware::Content::Library::Item::Updatesession::File::Info) add(update_session_id, file_spec)

Requests file content to be changed (either created, or updated). Depending on the source type of the file, this method will either return an upload endpoint where the client can push the content, or the server will pull from the provided source endpoint. If a file with the same name already exists in this session, this method will be used to update the content of the existing file.


 When importing a file directly from storage, where the source endpoint is a file or datastore URI, you will need to have the ContentLibrary.ReadStorage privilege on the library item. If the file is located in the same directory as the library storage backing folder, the server will move the file instead of copying it, thereby allowing instantaneous import of files for efficient backup and restore scenarios. In all other cases, a copy is performed rather than a move.

Parameters:

Returns:

Raises:



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

def add(update_session_id, file_spec)
    invoke_with_info(@@add_info, {
        'update_session_id' => update_session_id,
        'file_spec' => file_spec,
    })
end

- (Com::Vmware::Content::Library::Item::Updatesession::File::Info) get(update_session_id, file_name)

Retrieves information about a specific file in the snapshot of the library item at the time when the update session was created.

Parameters:

  • update_session_id (String)

    Identifier of the update session.

  • file_name (String)

    Name of the file.

Returns:

Raises:



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

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

- (Array<Com::Vmware::Content::Library::Item::Updatesession::File::Info>) list(update_session_id)

Lists all files in the library item associated with the update session.

Parameters:

  • update_session_id (String)

    Identifier of the update session.

Returns:

  • (Array<Com::Vmware::Content::Library::Item::Updatesession::File::Info>)

    The list of the files in the library item associated with the update session. This list may be empty if the caller has removed all the files as part of this session (in which case completing the update session will result in an empty library item).

Raises:



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

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

- (Void) remove(update_session_id, file_name)

Requests a file to be removed. The file will only be effectively removed when the update session is completed.

Parameters:

  • update_session_id (String)

    Identifier of the update session.

  • file_name (String)

    Name of the file to be removed.

Returns:

  • (Void)

Raises:



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

def remove(update_session_id, file_name)
    invoke_with_info(@@remove_info, {
        'update_session_id' => update_session_id,
        'file_name' => file_name,
    })
end

- (Com::Vmware::Content::Library::Item::Updatesession::File::ValidationResult) validate(update_session_id)

Validates the files in the update session with the referenced identifier and ensures all necessary files are received. In the case where a file is missing, this method will return its name in the :attr:`Com::Vmware::Content::Library::Item::Updatesession::File::ValidationResult.missing_files` set. The user can add the missing files and try re-validating. For other type of errors, :attr:`Com::Vmware::Content::Library::Item::Updatesession::File::ValidationResult.invalid_files` will contain the list of invalid files.

Parameters:

  • update_session_id (String)

    Identifier of the update session to validate.

Returns:

Raises:



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

def validate(update_session_id)
    invoke_with_info(@@validate_info, {
        'update_session_id' => update_session_id,
    })
end