Perl Example of Retrieving a List of All Local Libraries with a Specific Name

This example retrieves a list of all local libraries with the name
AcmeLibrary
that exist in your virtual environment.
For related code samples, see the vSphere Automation SDK Perl samples at GitHub.
... # Create a FindSpec object to specify your search criteria. my $find_spec = new Com::Vmware::Content::Library::FindSpec(); $find_spec->set_name('name' => 'AcmeLibrary'); $find_spec->set_type('type' => Com::Vmware::Content::LibraryModel::LibraryType::LOCAL); # Create client stub for general library functions. my $library_stub = $my_stub_factory->create_stub( 'service_name' => 'Com::Vmware::Content::Library', 'stub_config' => $my_stub_config ); # List content libraries. my @library_ids = $library_stub->find('spec' => $find_spec);