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

## Avaliable Methods
public method | evict ()
public method | sync ()
public method | new ()

## Detailed Description

The `Com::Vmware::Content::Library::SubscribedItem` interface manages the unique features of library items that are members of a subscribed library.

## Member Function Documentation

public method Com::Vmware::Content::Library::SubscribedItem::evict | ( |  | ) |

Evicts the cached content of a library item in a subscribed library.

This method allows the cached content of a library item to be removed to free up storage capacity. This method will only work when a library item is synchronized on-demand. When a library is not synchronized on-demand, it always attempts to keep its cache up-to-date with the published source. Evicting the library item will set :attr:`Com::Vmware::Content::Library::ItemModel.cached` to false.

Parameters

  library_item_id | [REQUIRED] Identifier of the library item whose content should be evicted. The value must be an identifier for the resource type getQualifiedName(com.vmware.content.library.Item). . The value must be str.

Exceptions

  Com::Vmware::Vapi::Std::Errors::NotFound | if the library item specified by `library_item_id` does not exist.
  Com::Vmware::Vapi::Std::Errors::InvalidElementType | if the library item specified by `library_item_id` is not a member of a subscribed library.
  Com::Vmware::Vapi::Std::Errors::InvalidElementConfiguration | if the library item specified by `library_item_id` is a member of a subscribed library that does not synchronize on-demand.

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

public method Com::Vmware::Content::Library::SubscribedItem::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::SubscribedItem::sync | ( |  | ) |

Forces the synchronization of an individual library item in a subscribed library.

Synchronizing an individual item will update that item's metadata from the remote source. If the source library item on the remote library has been deleted, this method will delete the library item from the subscribed library as well.

The default behavior of the synchronization is determined by the class Com::Vmware::Content::Library::SubscriptionInfo of the library which owns the library item.

- If :attr:`Com::Vmware::Content::Library::SubscriptionInfo.on_demand` is true, then the file content is not synchronized by default. In this case, only the library item metadata is synchronized. The file content may still be forcefully synchronized by passing true for the `force_sync_content` parameter .
- If :attr:`Com::Vmware::Content::Library::SubscriptionInfo.on_demand` is false, then this call will always synchronize the file content. The `force_sync_content` parameter* is ignored when the subscription is not on-demand.

When the file content has been synchronized, the :attr:`Com::Vmware::Content::Library::ItemModel.cached` field will be true.

This method will return immediately and create an asynchronous task to perform the synchronization.

Parameters

  library_item_id | [REQUIRED] Identifier of the library item to synchronize. The value must be an identifier for the resource type getQualifiedName(com.vmware.content.library.Item). . The value must be str.
  force_sync_content | [REQUIRED] Whether to synchronize file content as well as metadata. This parameter applies only if the subscription is on-demand. . The value must be Boolean.

Exceptions

  Com::Vmware::Vapi::Std::Errors::NotFound | if the library item specified by `library_item_id` could not be found.
  Com::Vmware::Vapi::Std::Errors::InvalidElementType | if the library item specified by `library_item_id` is not a member of a subscribed library.

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

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

- Com/Vmware/Content/Library/SubscribedItem.pm