VMware vSphere Automation SDK Perl The VMware vSphere Automation SDK for Perl supports the client-side vSphere Automation API for access to vSphere services and capabilities

- Main Page
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Files Functions
List of all members
Com::Vmware::Content::Library::Item::UpdateSession Class Reference
Inheritance diagram for Com::Vmware::Content::Library::Item::UpdateSession:

## Avaliable Methods
public method | create ()
public method | fail ()
public method | get ()
public method | delete ()
public method | new ()
public method | cancel ()
public method | list ()
public method | complete ()
public method | keep_alive ()

## Detailed Description

The `Com::Vmware::Content::Library::Item::UpdateSession` interface 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 interface .

Constant String::RESOURCE_TYPE # Resource type for an update session.

## Member Function Documentation

public method Com::Vmware::Content::Library::Item::UpdateSession::cancel | ( |  | ) |

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.

Parameters

  update_session_id | [REQUIRED] Identifier of the update session that should be canceled. The value must be an identifier for the resource type getQualifiedName(com.vmware.content.library.item.UpdateSession). . The value must be str.

Exceptions

  Com::Vmware::Vapi::Std::Errors::NotFound | if no update session with the given identifier exists.
  Com::Vmware::Vapi::Std::Errors::NotAllowedInCurrentState | if the update session is not in the :attr:`Com::Vmware::Content::Library::Item::UpdateSessionModel::State.ACTIVE` state.

Code:
click to view
# Number of lines of code in cancel: 10
sub cancel {
my ($self, %args) = @_;
my $update_session_id = $args {update_session_id};
$self->validate_args (method_name => 'cancel',
method_args => \%args);
return $self->invoke (method_name => 'cancel',
method_args => \%args);
}

public method Com::Vmware::Content::Library::Item::UpdateSession::complete | ( |  | ) |

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.

Parameters

  update_session_id | [REQUIRED] Identifier of the update session that should be completed. The value must be an identifier for the resource type getQualifiedName(com.vmware.content.library.item.UpdateSession). . The value must be str.

Exceptions

  Com::Vmware::Vapi::Std::Errors::NotFound | if no update session with the given identifier exists.
  Com::Vmware::Vapi::Std::Errors::NotAllowedInCurrentState | if the update session is not in the :attr:`Com::Vmware::Content::Library::Item::UpdateSessionModel::State.ACTIVE` state, or if some of the files that will be uploaded by the client aren't received correctly.

Code:
click to view
# Number of lines of code in complete: 10
sub complete {
my ($self, %args) = @_;
my $update_session_id = $args {update_session_id};
$self->validate_args (method_name => 'complete',
method_args => \%args);
return $self->invoke (method_name => 'complete',
method_args => \%args);
}

public method Com::Vmware::Content::Library::Item::UpdateSession::create | ( |  | ) |

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.

Parameters

  client_token | [OPTIONAL] 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. If not specified creation is not idempotent. . The value must be String or None.
  create_spec | [REQUIRED] Specification for the new update session to be created. . The value must be Com::Vmware::Content::Library::Item::UpdateSessionModel.

Return values

  Identifier | of the new update session being created. The value will be an identifier for the resource type getQualifiedName(com.vmware.content.library.item.UpdateSession). The return type will be str

Exceptions

  Com::Vmware::Vapi::Std::Errors::InvalidArgument | if the session specification is not valid.
  Com::Vmware::Vapi::Std::Errors::InvalidArgument | if the `client_token` does not conform to the UUID format.
  Com::Vmware::Vapi::Std::Errors::InvalidElementType | if the update session is being created on a subscribed library item.
  Com::Vmware::Vapi::Std::Errors::NotFound | if the item targeted for update does not exist.
  Com::Vmware::Vapi::Std::Errors::ResourceBusy | if there is another update session on the same library item.

Code:
click to view
# Number of lines of code in create: 11
sub create {
my ($self, %args) = @_;
my $client_token = $args {client_token};
my $create_spec = $args {create_spec};
$self->validate_args (method_name => 'create',
method_args => \%args);
return $self->invoke (method_name => 'create',
method_args => \%args);
}

public method Com::Vmware::Content::Library::Item::UpdateSession::delete | ( |  | ) |

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.

Parameters

  update_session_id | [REQUIRED] Identifer of the update session to delete. The value must be an identifier for the resource type getQualifiedName(com.vmware.content.library.item.UpdateSession). . The value must be str.

Exceptions

  Com::Vmware::Vapi::Std::Errors::NotFound | if the update session does not exist.
  Com::Vmware::Vapi::Std::Errors::NotAllowedInCurrentState | if the update session is in the :attr:`Com::Vmware::Content::Library::Item::UpdateSessionModel::State.ACTIVE` state.

Code:
click to view
# Number of lines of code in delete: 10
sub delete {
my ($self, %args) = @_;
my $update_session_id = $args {update_session_id};
$self->validate_args (method_name => 'delete',
method_args => \%args);
return $self->invoke (method_name => 'delete',
method_args => \%args);
}

public method Com::Vmware::Content::Library::Item::UpdateSession::fail | ( |  | ) |

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.

Parameters

  update_session_id | [REQUIRED] Identifier of the update session to fail. The value must be an identifier for the resource type getQualifiedName(com.vmware.content.library.item.UpdateSession). . The value must be str.
  client_error_message | [REQUIRED] 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. . The value must be String.

Exceptions

  Com::Vmware::Vapi::Std::Errors::NotFound | if the update session does not exist.
  Com::Vmware::Vapi::Std::Errors::NotAllowedInCurrentState | if the update session is not in the :attr:`Com::Vmware::Content::Library::Item::UpdateSessionModel::State.ACTIVE` state.

Code:
click to view
# Number of lines of code in fail: 11
sub fail {
my ($self, %args) = @_;
my $update_session_id = $args {update_session_id};
my $client_error_message = $args {client_error_message};
$self->validate_args (method_name => 'fail',
method_args => \%args);
return $self->invoke (method_name => 'fail',
method_args => \%args);
}

public method Com::Vmware::Content::Library::Item::UpdateSession::get | ( |  | ) |

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

Parameters

  update_session_id | [REQUIRED] Identifier of the update session to retrieve. The value must be an identifier for the resource type getQualifiedName(com.vmware.content.library.item.UpdateSession). . The value must be str.

Return values

  The | class Com::Vmware::Content::Library::Item::UpdateSessionModel instance with the given `update_session_id` . The return type will be Com::Vmware::Content::Library::Item::UpdateSessionModel

Exceptions

  Com::Vmware::Vapi::Std::Errors::NotFound | if no update session with the given identifier exists.

Code:
click to view
# Number of lines of code in get: 10
sub get {
my ($self, %args) = @_;
my $update_session_id = $args {update_session_id};
$self->validate_args (method_name => 'get',
method_args => \%args);
return $self->invoke (method_name => 'get',
method_args => \%args);
}

public method Com::Vmware::Content::Library::Item::UpdateSession::keep_alive | ( |  | ) |

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.

Parameters

  update_session_id | [REQUIRED] Identifier of the update session whose lifetime should be extended. The value must be an identifier for the resource type getQualifiedName(com.vmware.content.library.item.UpdateSession). . The value must be str.
  client_progress | [OPTIONAL] 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::UpdateSessionModel.client_progress` . If not specified the progress is not updated. . The value must be Long or None.

Exceptions

  Com::Vmware::Vapi::Std::Errors::NotFound | if no update session with the given identifier exists.
  Com::Vmware::Vapi::Std::Errors::NotAllowedInCurrentState | if the update session is not in the :attr:`Com::Vmware::Content::Library::Item::UpdateSessionModel::State.ACTIVE` state.

Code:
click to view
# Number of lines of code in keep_alive: 11
sub keep_alive {
my ($self, %args) = @_;
my $update_session_id = $args {update_session_id};
my $client_progress = $args {client_progress};
$self->validate_args (method_name => 'keep_alive',
method_args => \%args);
return $self->invoke (method_name => 'keep_alive',
method_args => \%args);
}

public method Com::Vmware::Content::Library::Item::UpdateSession::list | ( |  | ) |

Lists the identifiers of the update session created by the calling user. Optionally may filter by library item.

Parameters

  library_item_id | [OPTIONAL] Optional library item identifier on which to filter results. The value must be an identifier for the resource type getQualifiedName(com.vmware.content.library.item.UpdateSession). If not specified the results are not filtered. . The value must be str or None.

Return values

  The | list of identifiers of all update sessions created by the calling user. The value will be an identifier for the resource type getQualifiedName(com.vmware.content.library.item.UpdateSession). The return type will be Array of str

Exceptions

  Com::Vmware::Vapi::Std::Errors::NotFound | if a library item identifier is given for an item which does not exist.

Code:
click to view
# Number of lines of code in list: 10
sub list {
my ($self, %args) = @_;
my $library_item_id = $args {library_item_id};
$self->validate_args (method_name => 'list',
method_args => \%args);
return $self->invoke (method_name => 'list',
method_args => \%args);
}

public method Com::Vmware::Content::Library::Item::UpdateSession::new | ( |  | ) |

Constructor to initialize the object

Parameters

  api_provider | - protocol connection to use with stubs created by this factory
  StubConfig | - Stub's additional configuration

Return values

  Blessed | object

Code:
click to view
# Number of lines of code in new: 11
sub new {
my ($class, %args) = @_;
$class = ref($class) || $class;
my $stub_config = $args {stub_config};
my $api_provider = $args {api_provider};
my $self = $class->SUPER::new('stub_config' => $stub_config,
'api_provider' => $api_provider);
bless $self, $class;
return $self;
}

The documentation for this class was generated from the following file:

- Com/Vmware/Content/Library/Item/UpdateSession.pm