system.kanoa.cmms.getWorkOrderEventImageData(paramsDict)
Returns a filtered listing of work order event image metadata, optionally including the full image and/or thumbnail byte data, based on a single paramsDict of filter criteria.
All keys in paramsDict are optional, allowing callers to look up images by id, by work order event, by name/type, or across a date range, and to control whether the (potentially large) binary payloads are included in the result set.
This is the bulk/listing counterpart to getWorkOrderEventImage and getWorkOrderEventImageThumbnail, which each fetch a single image's bytes directly.
Parameters
paramsDict Dictionary
| - imageName | String | Filter by image name |
| - imageType | String | Filter by image type |
| - includeImage | Boolean | Include image. Set to False if not supplied |
| - includeThumbnail | Boolean | Include thumbnail. Set to False if not supplied |
| - rangeEnd | DateTime | |
| - rangeStart | DateTime | |
| - workOrderEventId | Integer | Filter by workOrderEventId |
| - workOrderEventImageId | Integer | Filter by workOrderEventImageId |
Returns
imageData pyDataset
Example
# List all images attached to a work order event, including
# thumbnails (but not the full-size bytes, to keep the result light).
paramsDict = {
'workOrderEventId': 4821,
'includeThumbnail': True,
'includeImage': False,
'rangeStart': system.date.addDays(system.date.now(), -30),
'rangeEnd': system.date.now()
}
imageData = system.kanoa.cmms.getWorkOrderEventImageData(paramsDict)
for row in imageData:
print 'Image id %d: %s (%s)' % (row['workOrderEventImageId'], row['imageName'], row['imageType'])
if row['thumbnail'] is not None:
# thumbnail bytes are available for a preview grid
pass