system.mes.meter.findMeterTypes
Description
Retrieves Meter Type records based on the specified pagination, sort, and column constraint parameters.
Permissions
This method requires the METERING.READ.GET permission.
Syntax
system.mes.meter.findMeterTypes(**queryRequest)
Parameters
Using Python keyword arguments, a Query Request can be passed to the findMeterTypes function without specifying each parameter individually. Please refer to the Query Request documentation for a list of parameters.
| Parameter | Type | Nullable | Description |
|---|---|---|---|
queryRequest | Query Request | False | A Query Request with the desired pagination, sorting, and filtering parameters. |
Returns
Returns a Query Result object with the following properties:
| Name | Type | Description |
|---|---|---|
content | List | The list of all Meter Type records found that meet the specified criteria. |
totalPages | Integer | If pagination is used, this is the number of total pages of records in the database for the specified page size. |
totalElements | Long | If pagination is used, this is the number of records in the database that meet the specified criteria. |
pageSize | Integer | If pagination is used, this is the specified page size. |
pageIndex | Integer | If pagination is used, this is the specified page index. |
hasContent | Boolean | True if any records were found that meet the specified criteria. |
isFirst | Boolean | If pagination is used, this is true if the first page was returned. |
isLast | Boolean | If pagination is used, this is true if the last page was returned. |
hasNext | Boolean | If pagination is used, this is true if there is a page of content available after this one. |
hasPrevious | Boolean | If pagination is used, this is true if there is a page of content available before this one. |
Code Examples
Here is an example of how to use a Query Request to retrieve the first ten Meter Types sorted by name.
# Generate the object structure for a new query request
queryRequest = system.mes.query.newQueryRequest()
# Set the basic attributes of the query request
queryRequest['pageSize'] = 10
queryRequest['pageIndex'] = 0
queryRequest['sortFields'] = ['name']
queryRequest['sortDirections'] = ['Ascending']
# Retrieve the Meter Types that match the query
result = system.mes.meter.findMeterTypes(**queryRequest)
# Output the Meter Types that match the query
print(result)