Skip to main content

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

- imageNameStringFilter by image name
- imageTypeStringFilter by image type
- includeImageBooleanInclude image. Set to False if not supplied
- includeThumbnailBooleanInclude thumbnail. Set to False if not supplied
- rangeEndDateTime
- rangeStartDateTime
- workOrderEventIdIntegerFilter by workOrderEventId
- workOrderEventImageIdIntegerFilter 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