Skip to content

Commit

Permalink
Updated CompletedAt to LastUpdatedAt for all terminal states (Azure#2…
Browse files Browse the repository at this point in the history
…8349)

* Updated CompletedAt to LastUpdatedAt for all terminal states

* Updates examples; Moves error order

* Set examples to more realistic value

* Updates File model for future expansion

* Adds Input FileLocation

---------

Co-authored-by: Graham Thomas <[email protected]>
  • Loading branch information
GrahamMThomas and Graham Thomas committed May 8, 2024
1 parent fda21b2 commit f918770
Show file tree
Hide file tree
Showing 12 changed files with 90 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"status": "Canceled",
"createdAt": "2024-01-25T23:27:43.009Z",
"startedAt": "2024-01-25T23:27:43.009Z",
"completedAt": "2024-01-25T23:27:43.009Z",
"lastUpdatedAt": "2024-01-26T01:15:00.009Z",
"summary": {
"successful": 10,
"failed": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"operation": "Redact",
"redactionFormat": "[{type}]",
"status": "NotStarted",
"createdAt": "2024-01-25T23:27:43.009Z"
"createdAt": "2024-01-25T23:27:43.009Z",
"lastUpdatedAt": "2024-01-26T01:15:00.009Z"
}
},
"201": {
Expand All @@ -65,7 +66,8 @@
"operation": "Redact",
"redactionFormat": "[{type}]",
"status": "NotStarted",
"createdAt": "2024-01-25T23:27:43.009Z"
"createdAt": "2024-01-25T23:27:43.009Z",
"lastUpdatedAt": "2024-01-26T01:15:00.009Z"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"status": "Succeeded",
"createdAt": "2024-01-25T23:27:43.009Z",
"startedAt": "2024-01-25T23:27:43.009Z",
"completedAt": "2024-01-25T23:27:43.009Z",
"lastUpdatedAt": "2024-01-26T01:15:00.009Z",
"summary": {
"successful": 10,
"failed": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"status": "Succeeded",
"createdAt": "2024-01-25T23:27:43.009Z",
"startedAt": "2024-01-25T23:27:43.009Z",
"completedAt": "2024-01-25T23:27:43.009Z",
"lastUpdatedAt": "2024-01-26T01:15:00.009Z",
"summary": {
"successful": 10,
"failed": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,22 @@
"body": {
"value": [
{
"path": "/documents/patient_doc_1",
"id": "00000000-0000-0000-0000-000000000000",
"input": {
"path": "/documents/patient_doc_1",
"etag": "0x8DB638EEA0CC717"
},
"output": {
"path": "_output/documents/patient_doc_1",
"etag": "0xAB298APO23099ZL"
},
"status": "Failed",
"error": {
"code": "FileNotFound",
"message": "File was moved after job started.",
"target": "SourceFile",
"details": []
},
"etag": "0x8DB638EEA0CC717"
}
}
],
"nextLink": "https://deidtest.api.deid.azure.com/jobs/00000000-0000-0000-0000-000000000000/files?top=10&skip=10&maxpagesize=10"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ model Job {
dataType: DocumentDataType = DocumentDataType.PlainText;

@doc("Operation to perform on the input documents.")
operation: OperationType = OperationType.Redact;
operation: OperationType = OperationType.Surrogate;

@maxLength(16)
@minLength(1)
Expand All @@ -42,14 +42,14 @@ model Job {
@visibility("read")
status: JobStatus;

@doc("Date and time when the job was created.")
@visibility("read")
createdAt: utcDateTime;

@doc("Error when job fails in it's entirety.")
@visibility("read")
error?: Azure.Core.Foundations.Error;

@doc("Date and time when the job was created.")
@visibility("read")
createdAt: utcDateTime;

@doc("Date and time when the job was started.")
@visibility("read")
startedAt?: utcDateTime;
Expand All @@ -62,7 +62,7 @@ model Job {
If the job failed, this is the time when the job failed.
""")
@visibility("read")
completedAt?: utcDateTime;
lastUpdatedAt?: utcDateTime;

@doc("Summary of a job. Exists only when the job is completed.")
@visibility("read")
Expand All @@ -74,16 +74,28 @@ model Job {
@parentResource(Job)
model File {
@key
@doc("Relative path to file from location prefix.")
@doc("Id of the file report.")
@visibility("read")
@maxLength(1024)
path: string;
id: string;

@doc("File Location for the input.")
input: FileLocation;

@doc("File Location for the output.")
output?: FileLocation;

@doc("Status of the file.")
status: Azure.Core.Foundations.OperationState;

@doc("Error when file fails.")
error?: Azure.Core.Foundations.Error;
}

@doc("Location of a file.")
model FileLocation {
@doc("Absolute path to the file in storage.")
@maxLength(1024)
path: string;

...EtagProperty;
}
Expand Down Expand Up @@ -144,9 +156,6 @@ model TargetStorageLocation {

@doc("Enum of supported Data Types.")
enum DocumentDataType {
@doc("Unknown data type.")
Unknown,

@doc("Plain text data type.")
PlainText,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -636,18 +636,12 @@
"type": "string",
"description": "Enum of supported Data Types.",
"enum": [
"Unknown",
"PlainText"
],
"x-ms-enum": {
"name": "DocumentDataType",
"modelAsString": true,
"values": [
{
"name": "Unknown",
"value": "Unknown",
"description": "Unknown data type."
},
{
"name": "PlainText",
"value": "PlainText",
Expand All @@ -660,19 +654,42 @@
"type": "object",
"description": "File report once job has completed.",
"properties": {
"path": {
"id": {
"type": "string",
"description": "Relative path to file from location prefix.",
"maxLength": 1024,
"description": "Id of the file report.",
"readOnly": true
},
"input": {
"$ref": "#/definitions/FileLocation",
"description": "File Location for the input."
},
"output": {
"$ref": "#/definitions/FileLocation",
"description": "File Location for the output."
},
"status": {
"$ref": "#/definitions/Azure.Core.Foundations.OperationState",
"description": "Status of the file."
},
"error": {
"$ref": "#/definitions/Azure.Core.Foundations.Error",
"description": "Error when file fails."
}
},
"required": [
"id",
"input",
"status"
]
},
"FileLocation": {
"type": "object",
"description": "Location of a file.",
"properties": {
"path": {
"type": "string",
"description": "Absolute path to the file in storage.",
"maxLength": 1024
},
"etag": {
"$ref": "#/definitions/Azure.Core.eTag",
Expand All @@ -682,7 +699,6 @@
},
"required": [
"path",
"status",
"etag"
]
},
Expand Down Expand Up @@ -714,7 +730,7 @@
"operation": {
"$ref": "#/definitions/OperationType",
"description": "Operation to perform on the input documents.",
"default": "Redact"
"default": "Surrogate"
},
"redactionFormat": {
"type": "string",
Expand All @@ -727,24 +743,24 @@
"description": "Current status of a job.",
"readOnly": true
},
"error": {
"$ref": "#/definitions/Azure.Core.Foundations.Error",
"description": "Error when job fails in it's entirety.",
"readOnly": true
},
"createdAt": {
"type": "string",
"format": "date-time",
"description": "Date and time when the job was created.",
"readOnly": true
},
"error": {
"$ref": "#/definitions/Azure.Core.Foundations.Error",
"description": "Error when job fails in it's entirety.",
"readOnly": true
},
"startedAt": {
"type": "string",
"format": "date-time",
"description": "Date and time when the job was started.",
"readOnly": true
},
"completedAt": {
"lastUpdatedAt": {
"type": "string",
"format": "date-time",
"description": "Date and time when the job was completed.\n\nIf the job is canceled, this is the time when the job was canceled.\n\nIf the job failed, this is the time when the job failed.",
Expand Down Expand Up @@ -786,7 +802,7 @@
"operation": {
"$ref": "#/definitions/OperationType",
"description": "Operation to perform on the input documents.",
"default": "Redact"
"default": "Surrogate"
},
"redactionFormat": {
"type": "string",
Expand Down Expand Up @@ -927,8 +943,7 @@
"description": "The File items on this page",
"items": {
"$ref": "#/definitions/File"
},
"x-ms-identifiers": []
}
},
"nextLink": {
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"status": "Canceled",
"createdAt": "2024-01-25T23:27:43.009Z",
"startedAt": "2024-01-25T23:27:43.009Z",
"completedAt": "2024-01-25T23:27:43.009Z",
"lastUpdatedAt": "2024-01-26T01:15:00.009Z",
"summary": {
"successful": 10,
"failed": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"operation": "Redact",
"redactionFormat": "[{type}]",
"status": "NotStarted",
"createdAt": "2024-01-25T23:27:43.009Z"
"createdAt": "2024-01-25T23:27:43.009Z",
"lastUpdatedAt": "2024-01-26T01:15:00.009Z"
}
},
"201": {
Expand All @@ -65,7 +66,8 @@
"operation": "Redact",
"redactionFormat": "[{type}]",
"status": "NotStarted",
"createdAt": "2024-01-25T23:27:43.009Z"
"createdAt": "2024-01-25T23:27:43.009Z",
"lastUpdatedAt": "2024-01-26T01:15:00.009Z"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"status": "Succeeded",
"createdAt": "2024-01-25T23:27:43.009Z",
"startedAt": "2024-01-25T23:27:43.009Z",
"completedAt": "2024-01-25T23:27:43.009Z",
"lastUpdatedAt": "2024-01-26T01:15:00.009Z",
"summary": {
"successful": 10,
"failed": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"status": "Succeeded",
"createdAt": "2024-01-25T23:27:43.009Z",
"startedAt": "2024-01-25T23:27:43.009Z",
"completedAt": "2024-01-25T23:27:43.009Z",
"lastUpdatedAt": "2024-01-26T01:15:00.009Z",
"summary": {
"successful": 10,
"failed": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,22 @@
"body": {
"value": [
{
"path": "/documents/patient_doc_1",
"id": "00000000-0000-0000-0000-000000000000",
"input": {
"path": "/documents/patient_doc_1",
"etag": "0x8DB638EEA0CC717"
},
"output": {
"path": "_output/documents/patient_doc_1",
"etag": "0xAB298APO23099ZL"
},
"status": "Failed",
"error": {
"code": "FileNotFound",
"message": "File was moved after job started.",
"target": "SourceFile",
"details": []
},
"etag": "0x8DB638EEA0CC717"
}
}
],
"nextLink": "https://deidtest.api.deid.azure.com/jobs/00000000-0000-0000-0000-000000000000/files?top=10&skip=10&maxpagesize=10"
Expand Down

0 comments on commit f918770

Please sign in to comment.