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::DownloadSession Class Reference
Inheritance diagram for Com::Vmware::Content::Library::Item::DownloadSession:

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

## Detailed Description

The `Com::Vmware::Content::Library::Item::DownloadSession` interface 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 interface provides access to the download links.

Constant String::RESOURCE_TYPE # Resource type for a download session.

## Member Function Documentation

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

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 | [REQUIRED] Identifer of the download session that should be canceled. The value must be an identifier for the resource type getQualifiedName(com.vmware.content.library.item.DownloadSession). . The value must be str.

Exceptions

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

Code:
click to view
# Number of lines of code in cancel: 10
sub cancel {
my ($self, %args) = @_;
my $download_session_id = $args {download_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::DownloadSession::create | ( |  | ) |

Creates a new download session.

Parameters

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

Return values

  Identifier | of the new download session being created. The value will be an identifier for the resource type getQualifiedName(com.vmware.content.library.item.DownloadSession). 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 | format.
  Com::Vmware::Vapi::Std::Errors::NotFound | if the library item targeted by the download does not exist.

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::DownloadSession::delete | ( |  | ) |

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 | [REQUIRED] Identifier of the download session to be deleted. The value must be an identifier for the resource type getQualifiedName(com.vmware.content.library.item.DownloadSession). . The value must be str.

Exceptions

  Com::Vmware::Vapi::Std::Errors::NotFound | if the download session does not exist.

Code:
click to view
# Number of lines of code in delete: 10
sub delete {
my ($self, %args) = @_;
my $download_session_id = $args {download_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::DownloadSession::fail | ( |  | ) |

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 | [REQUIRED] Identifier of the download session to fail. The value must be an identifier for the resource type getQualifiedName(com.vmware.content.library.item.DownloadSession). . 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 download session does not exist.
  Com::Vmware::Vapi::Std::Errors::NotAllowedInCurrentState | if the download session is not in the :attr:`Com::Vmware::Content::Library::Item::DownloadSessionModel::State.ACTIVE` state.

Code:
click to view
# Number of lines of code in fail: 11
sub fail {
my ($self, %args) = @_;
my $download_session_id = $args {download_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::DownloadSession::get | ( |  | ) |

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

Parameters

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

Return values

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

Exceptions

  Com::Vmware::Vapi::Std::Errors::NotFound | if no download session with the given `download_session_id` exists.

Code:
click to view
# Number of lines of code in get: 10
sub get {
my ($self, %args) = @_;
my $download_session_id = $args {download_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::DownloadSession::keep_alive | ( |  | ) |

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.

Parameters

  download_session_id | [REQUIRED] Identifier of the download session whose lifetime should be extended. The value must be an identifier for the resource type getQualifiedName(com.vmware.content.library.item.DownloadSession). . The value must be str.
  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::DownloadSessionModel.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 download session with the given identifier exists.
  Com::Vmware::Vapi::Std::Errors::NotAllowedInCurrentState | if the download session is not in the :attr:`Com::Vmware::Content::Library::Item::DownloadSessionModel::State.ACTIVE` state.

Code:
click to view
# Number of lines of code in keep_alive: 11
sub keep_alive {
my ($self, %args) = @_;
my $download_session_id = $args {download_session_id};
my $progress = $args {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::DownloadSession::list | ( |  | ) |

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

Parameters

  library_item_id | [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.DownloadSession). If not specified all download session identifiers are listed. . The value must be str or None.

Return values

  The | list of identifiers of all download sessions created by the calling user. The value will be an identifier for the resource type getQualifiedName(com.vmware.content.library.item.DownloadSession). 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::DownloadSession::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/DownloadSession.pm