Red Hat Training
A Red Hat training course is available for Red Hat Virtualization
3.3. Retrieving Resources from a Collection
Resources are retrieved from a collection using the
get
and list
methods.
- get
- Retrieves a single resource from the collection. The item to retrieve is determined based on the name provided as an argument. The
get
method takes these arguments:name
- The name of the resource to retrieve from the collection.id
- The globally unique identifier (GUID) of the resource to retrieve from the collection.
- list
- Retrieves any number of resources from the collection. The items to retrieve are determined based on the criteria provided. The
list
method takes these arguments:**kwargs
- A dictionary of additional arguments allowing keyword based filtering.query
- A query written in the same format as that used for searches executed using the Red Hat Virtualization user interfaces.max
- The maximum number of resources to retrieve.case_sensitive
- Whether or not search terms are to be treated as case sensitive (True
orFalse
, the default isTrue
).