Querying Content Libraries
Last Updated December 16, 2024

You can create queries to find libraries that match your criteria. You can also retrieve a list of all libraries or only the libraries of a specific type.

Listing All Content Libraries

You can retrieve a list of all content library IDs in your virtual environment, regardless of their type, by using the
Library
service. You can use the
List Library
operation to retrieve all local and subscribed libraries in your system.

Listing Content Libraries of a Specific Type

You can use the
vSphere Automation
API to retrieve content libraries of a specific type. For example, you can list only the local libraries in your virtual environment.
If you want to retrieve only a list of the local libraries, you must retrieve the
LocalLibrary
service and use the
List Local Library
operation on the
LocalLibrary
service. To list only subscribed libraries, you must retrieve the
SubscribedLibrary
service and call the
List Subscribed Library
operation on the
SubscribedLibrary
service.

Listing Content Libraries by Using Specific Search Criteria

You can filter the list of content libraries and retrieve only the libraries that match your specific criteria. For example, you might want to publish all local libraries with a specific name.
To filter with specific search criteria, use the
Find Library
operation of the
Library
service. Specify the properties of the
LibraryFindSpec
data structure that contains your search criteria. Upon a successful completion of the operation, you receive a list of all content libraries that match your search criteria.