Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
"operationId": "Jobs_List",
"parameters": {
"api-version": "2024-01-31-preview",
"top": 10,
"skip": 10,
"maxpagesize": 10,
"continuationToken": "K1JJRDpzOEtaQWZabUQrQUNBQUFBQUFBQUFBQT09I1JUOjEjVFJDOjEwI0ZQQzpBZ0VBQUFBTUFDUUFBQUFBQUE9PQ==",
"x-ms-client-request-id": "00000000-0000-0000-0000-000000000000"
},
"responses": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
"parameters": {
"api-version": "2024-01-31-preview",
"name": "documents_smith_1",
"top": 10,
"skip": 10,
"maxpagesize": 10,
"continuationToken": "K1JJRDpzOEtaQWZabUQrQUNBQUFBQUFBQUFBQT09I1JUOjEjVFJDOjEwI0ZQQzpBZ0VBQUFBTUFDUUFBQUFBQUE9PQ==",
"x-ms-client-request-id": "00000000-0000-0000-0000-000000000000"
},
"responses": {
Expand All @@ -16,6 +15,7 @@
{
"path": "/documents/patient_doc_1",
"status": "Failed",
"errorCode": "FileNotFound",
"explanation": "File was moved after job started.",
"etag": "0x8DB638EEA0CC717"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ model Job {
@visibility("read")
createdAt: utcDateTime;

@doc("Error code for complete job failures.")
@visibility("read")
errorCode?: string;

@doc("Error message for complete job failures.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it only available when job fails?

There is a recommended error type as described here https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors, do you want to follow the same data structure?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhhh great point, I figured that could only be used for error responses. I've updated the PR to use this for jobStatuses as well.

Also Yes, this field will only be available when the job has Failed.

@visibility("read")
explanation?: string;

@doc("Date and time when the job was started.")
@visibility("read")
startedAt?: utcDateTime;
Expand Down Expand Up @@ -78,8 +86,10 @@ model File {
@doc("Status of the file.")
status: Azure.Core.Foundations.OperationState;

// TODO: Maybe this should be called reason?
@doc("Explanation of current status. If needed.")
@doc("Error code if the file has failed.")
errorCode?: string;

@doc("Explanation of current status and/or errorCode. If needed.")
explanation?: string;

...EtagProperty;
Expand Down Expand Up @@ -326,3 +336,12 @@ model PhiEntity {
@doc("Confidence score of the text/type pairing.")
confidenceScore?: float64;
}

@doc("Query parameters for listing jobs.")
model PaginationByTokenQueryParameters {
...MaxPageSizeQueryParameter;

@query
@doc("Token to continue a previous query.")
continuationToken?: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ interface Jobs {
@summary("List DeID Jobs")
list is DeidOperations.ResourceList<
Job,
ListQueryParametersTrait<StandardListQueryParameters>
ListQueryParametersTrait<PaginationByTokenQueryParameters>
>;

@summary("List processed files within a Job")
listFiles is DeidOperations.ResourceList<
File,
ListQueryParametersTrait<StandardListQueryParameters>
ListQueryParametersTrait<PaginationByTokenQueryParameters>
>;

@summary("Cancel a DeID Job")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,10 @@
"$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter"
},
{
"$ref": "#/parameters/Azure.Core.TopQueryParameter"
},
{
"$ref": "#/parameters/Azure.Core.SkipQueryParameter"
"$ref": "#/parameters/Azure.Core.MaxPageSizeQueryParameter"
},
{
"$ref": "#/parameters/Azure.Core.MaxPageSizeQueryParameter"
"$ref": "#/parameters/PaginationByTokenQueryParameters.continuationToken"
},
{
"$ref": "#/parameters/Azure.Core.ClientRequestIdHeader"
Expand Down Expand Up @@ -431,13 +428,10 @@
"pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]+[a-zA-Z0-9]$"
},
{
"$ref": "#/parameters/Azure.Core.TopQueryParameter"
"$ref": "#/parameters/Azure.Core.MaxPageSizeQueryParameter"
},
{
"$ref": "#/parameters/Azure.Core.SkipQueryParameter"
},
{
"$ref": "#/parameters/Azure.Core.MaxPageSizeQueryParameter"
"$ref": "#/parameters/PaginationByTokenQueryParameters.continuationToken"
},
{
"$ref": "#/parameters/Azure.Core.ClientRequestIdHeader"
Expand Down Expand Up @@ -676,9 +670,13 @@
"$ref": "#/definitions/Azure.Core.Foundations.OperationState",
"description": "Status of the file."
},
"errorCode": {
"type": "string",
"description": "Error code if the file has failed."
},
"explanation": {
"type": "string",
"description": "Explanation of current status. If needed."
"description": "Explanation of current status and/or errorCode. If needed."
},
"etag": {
"$ref": "#/definitions/Azure.Core.eTag",
Expand Down Expand Up @@ -739,6 +737,16 @@
"description": "Date and time when the job was created.",
"readOnly": true
},
"errorCode": {
"type": "string",
"description": "Error code for complete job failures.",
"readOnly": true
},
"explanation": {
"type": "string",
"description": "Error message for complete job failures.",
"readOnly": true
},
"startedAt": {
"type": "string",
"format": "date-time",
Expand Down Expand Up @@ -1325,23 +1333,12 @@
"format": "int32",
"x-ms-parameter-location": "method"
},
"Azure.Core.SkipQueryParameter": {
"name": "skip",
"PaginationByTokenQueryParameters.continuationToken": {
"name": "continuationToken",
"in": "query",
"description": "The number of result items to skip.",
"description": "Token to continue a previous query.",
"required": false,
"type": "integer",
"format": "int32",
"default": 0,
"x-ms-parameter-location": "method"
},
"Azure.Core.TopQueryParameter": {
"name": "top",
"in": "query",
"description": "The number of result items to return.",
"required": false,
"type": "integer",
"format": "int32",
"type": "string",
"x-ms-parameter-location": "method"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
"operationId": "Jobs_List",
"parameters": {
"api-version": "2024-01-31-preview",
"top": 10,
"skip": 10,
"maxpagesize": 10,
"continuationToken": "K1JJRDpzOEtaQWZabUQrQUNBQUFBQUFBQUFBQT09I1JUOjEjVFJDOjEwI0ZQQzpBZ0VBQUFBTUFDUUFBQUFBQUE9PQ==",
"x-ms-client-request-id": "00000000-0000-0000-0000-000000000000"
},
"responses": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
"parameters": {
"api-version": "2024-01-31-preview",
"name": "documents_smith_1",
"top": 10,
"skip": 10,
"maxpagesize": 10,
"continuationToken": "K1JJRDpzOEtaQWZabUQrQUNBQUFBQUFBQUFBQT09I1JUOjEjVFJDOjEwI0ZQQzpBZ0VBQUFBTUFDUUFBQUFBQUE9PQ==",
"x-ms-client-request-id": "00000000-0000-0000-0000-000000000000"
},
"responses": {
Expand All @@ -16,6 +15,7 @@
{
"path": "/documents/patient_doc_1",
"status": "Failed",
"errorCode": "FileNotFound",
"explanation": "File was moved after job started.",
"etag": "0x8DB638EEA0CC717"
}
Expand Down