Reference returned from entity events?

14 views
Skip to first unread message

Sam Brenton

unread,
Sep 26, 2022, 10:54:37 AM9/26/22
to pyPreservica
Hi,

I'm hoping to use the ingest events feature to check that's nothing's been missed after bulk ingests, but I'm having trouble when feeding the reference given by the events response back into the entity api to get it's details???

Does the reference refer to something else? 

(pic attached) 

Thanks
Sam
pypresevents.PNG

James Carr

unread,
Oct 10, 2022, 7:41:40 AM10/10/22
to pyPreservica
The reference is the event reference not the entity reference.

I have released a new version 1.5.6 which has an API call to convert the event ref to the entity ref 'entity_from_event'

If you update your version of pyPreservica using PIP you should get the new method.


from pyPreservica import *
logging.basicConfig(level=logging.FATAL)

client = EntityAPI()

for ingest_event in client.all_ingest_events(previous_days=14):
    event_ref = ingest_event['Ref']

    for ref in client.entity_from_event(event_ref):
        try:
            asset = client.asset(ref)
            print(asset)
        except ReferenceNotFoundException:
            # The ref is a not an Asset
            # It will be a Content Object or Folder
            pass

Reply all
Reply to author
Forward
0 new messages