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
Classes | List of all members
Com::Vmware::Content::Library::Item::Downloadsession::File Class Reference
Inheritance diagram for Com::Vmware::Content::Library::Item::Downloadsession::File:

## Classes
class | EndpointType
class | Info
class | PrepareStatus

## Avaliable Methods
public method | get ()
public method | new ()
public method | prepare ()
public method | list ()

## Detailed Description

The `Com::Vmware::Content::Library::Item::Downloadsession::File` interface provides methods for accessing files within a download session.

After a download session is created against a library item, the `Com::Vmware::Content::Library::Item::Downloadsession::File` interface can be used to retrieve all downloadable content within the library item. Since the content may not be available immediately in a downloadable form on the server side, the client will have to prepare the file and wait for the file status to become :attr:`Com::Vmware::Content::Library::Item::Downloadsession::File::PrepareStatus.PREPARED` .

See class Com::Vmware::Content::Library::Item::DownloadSession .

## Member Function Documentation

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

Retrieves file download information for a specific file.

Parameters

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

Return values

  The | class Com::Vmware::Content::Library::Item::Downloadsession::File::Info instance containing the status of the file and its download link if available. The return type will be Com::Vmware::Content::Library::Item::Downloadsession::File::Info

Exceptions

  Com::Vmware::Vapi::Std::Errors::NotFound | if the download session associated with `download_session_id` does not exist.
  Com::Vmware::Vapi::Std::Errors::InvalidArgument | if there is no file with the specified `file_name` .

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

Lists the information of all the files in the library item associated with the download session.

Parameters

  download_session_id | [REQUIRED] Identifier of the download session. 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 | list of class Com::Vmware::Content::Library::Item::Downloadsession::File::Info instances. The return type will be Array of Com::Vmware::Content::Library::Item::Downloadsession::File::Info

Exceptions

  Com::Vmware::Vapi::Std::Errors::NotFound | if the download session associated with `download_session_id` doesn't exist.

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

public method Com::Vmware::Content::Library::Item::Downloadsession::File::prepare | ( |  | ) |

Requests a file to be prepared for download.

Parameters

  download_session_id | [REQUIRED] Identifier of the download session. The value must be an identifier for the resource type getQualifiedName(com.vmware.content.library.item.DownloadSession). . The value must be str.
  file_name | [REQUIRED] Name of the file requested for download. . The value must be String.
  endpoint_type | [OPTIONAL] Endpoint type request, one of HTTPS, DIRECT. This will determine the type of the :attr:`Com::Vmware::Content::Library::Item::Downloadsession::File::Info.download_endpoint` that is generated when the file is prepared. The :attr:`Com::Vmware::Content::Library::Item::Downloadsession::File::EndpointType.DIRECT` is only available to users who have the ContentLibrary.ReadStorage privilege. If not specified the default is :attr:`Com::Vmware::Content::Library::Item::Downloadsession::File::EndpointType.HTTPS`. The value must be Com::Vmware::Content::Library::Item::Downloadsession::File::EndpointType or None.

Return values

  File | information containing the status of the request and the download link to the file. The return type will be Com::Vmware::Content::Library::Item::Downloadsession::File::Info

Exceptions

  Com::Vmware::Vapi::Std::Errors::NotFound | if the download session does not exist.
  Com::Vmware::Vapi::Std::Errors::InvalidArgument | if there is no file with the specified `file_name` .
  Com::Vmware::Vapi::Std::Errors::Unauthorized | if the the download session wasn't created with the ContentLibrary.ReadStorage privilege and the caller requested a :attr:`Com::Vmware::Content::Library::Item::Downloadsession::File::EndpointType.DIRECT` endpoint type.

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

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

- Com/Vmware/Content/Library/Item/Downloadsession/File.pm