|
@@ -1,3 +1,6 @@
|
|
|
+from enum import Enum
|
|
|
+
|
|
|
+
|
|
|
class EntityContainer(object):
|
|
|
def __init__(self, root):
|
|
|
self.entities = {e.tag: e.text for e in root.findall('./entities/entity/*')}
|
|
@@ -32,6 +35,20 @@ class Credentials(object):
|
|
|
self.secret = entities['rest.secret']
|
|
|
|
|
|
|
|
|
+class IngestStatus(Enum):
|
|
|
+ UNKNOWN = 0
|
|
|
+ PREPARING = 1
|
|
|
+ PREPARATION_FAILED = 2
|
|
|
+ PRE_INGEST_SCHEDULED = 4
|
|
|
+ PRE_INGEST_RUNNING = 8
|
|
|
+ PRE_INGEST_FINISHED = 16
|
|
|
+ PRE_INGEST_FAILED = 32
|
|
|
+ INGEST_RUNNING = 64
|
|
|
+ INGEST_FINISHED = 128
|
|
|
+ INGEST_FAILED = 256
|
|
|
+ INGEST_REMOVED = 512
|
|
|
+
|
|
|
+
|
|
|
class Ingest(EntityContainer):
|
|
|
def __init__(self, root):
|
|
|
super(Ingest, self).__init__(root)
|
|
@@ -39,6 +56,7 @@ class Ingest(EntityContainer):
|
|
|
self.staging_url = self.entities.get('stagingUrl')
|
|
|
self.object_uuid = self.entities.get('digitalObjectUuid')
|
|
|
self.owner_uuid = self.entities.get('owernUuid')
|
|
|
+ self.status = IngestStatus(int(self.entities.get('status', 0)))
|
|
|
|
|
|
|
|
|
class Investigation(EntityContainer):
|