hpeOneView.resources.search package
Submodules
hpeOneView.resources.search.index_resources module
- class hpeOneView.resources.search.index_resources.IndexResources(connection, data=None)[source]
Bases:
Resource
Index Resources API client.
- URI = '/rest/index/resources'
- get_aggregated(attribute, category, child_limit=6, filter='', query='', user_query='', attribute_query='', scope_query='')[source]
Gets a list of index resources based on optional sorting and filtering and is constrained by start and count parameters.
- Parameters
attribute (list or str) – Attribute to pass in as query filter.
category (str) – Category of resources. Multiple Category parameters are applied with an OR condition.
child_limit (int) – Number of resources to be retrieved. Default=6.
filter (list or str) – A general filter/query string to narrow the list of items returned. The default is no filter; all resources are returned.
query (str) – A general query string to narrow the list of resources returned. The default is no query - all resources are returned.
user_query (str) – Free text Query string to search the resources. This will match the string in any field that is indexed.
attribute_query (list or str) – attributeQuery is used along with query parameter to filter out the details by attributes. One or more attributeQuery should be used.
scope_query (str) – ScopeQuery is used to filter the dashboard view by scope. ScopeQuery can be a single scope or a valid scope expression.
- Returns
An aggregated list of index resources.
- Return type
list
- get_all(category='', count=-1, fields='', filter='', padding=0, query='', reference_uri='', sort='', start=0, user_query='', view='')[source]
Gets a list of index resources based on optional sorting and filtering and is constrained by start and count parameters.
- Parameters
category (str or list) – Category of resources. Multiple Category parameters are applied with OR condition.
count (int) – The number of resources to return. A count of -1 requests all items. The actual number of items in the response might differ from the requested count if the sum of start and count exceeds the total number of items.
fields (str) – Specifies which fields should be returned in the result set.
filter (list or str) – A general filter/query string to narrow the list of items returned. The default is no filter; all resources are returned.
padding (int) – Number of resources to be returned before the reference URI resource.
query (str) – A general query string to narrow the list of resources returned. The default is no query - all resources are returned.
reference_uri (str) – Load one page of resources, pagination is applied with reference to referenceUri provided.
sort (str) – The sort order of the returned data set. By default, the sort order is based on create time with the oldest entry first.
start (int) – The first item to return, using 0-based indexing. If not specified, the default is 0 - start with the first available item.
user_query (str) – Free text Query string to search the resources. This will match the string in any field that is indexed.
view (str) – Return a specific subset of the attributes of the resource or collection, by specifying the name of a predefined view.
- Returns
A list of index resources.
- Return type
list
hpeOneView.resources.search.labels module
- class hpeOneView.resources.search.labels.Labels(connection, data=None)[source]
Bases:
Resource
Labels API client.
- RESOURCES_PATH = '/resources'
- URI = '/rest/labels'
- create(resource, timeout=-1)[source]
Set all the labels for a resource.
- Parameters
resource – The object containing the resource URI and a list of labels
- Returns
Resource Labels
- Return type
dict
- get_all(count=-1, sort='', start=0, view='', fields='', filter='', name_prefix='', category=[])[source]
Gets all items according with the given arguments. :param start: The first item to return, using 0-based indexing.
If not specified, the default is 0 - start with the first available item.
- Parameters
count – The number of resources to return. A count of -1 requests all items (default).
sort – The sort order of the returned data set. By default, the sort order is based on create time with the oldest entry first.
view – Returns a specific subset of the attributes of the resource or collection by specifying the name of a predefined view. The default view is expand (show all attributes of the resource and all elements of the collections or resources).
fields – Name of the fields.
- Returns
A list of items matching the specified filter.
- Return type
list