Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
187edee
Update FormRecognizer v2.0-preview spec with new operations 'CopyCust…
krishnand Jan 8, 2020
affb869
Add claimResourceRegion. Remove move option from Copy data contract b…
krishnand Jan 13, 2020
0cd19cb
Address PR comments
krishnand Jan 14, 2020
608865c
Remove authorizationClaim from CopyRequest contract. Updated referenc…
krishnand Jan 16, 2020
131a4e9
Fixed typo in CopyRequest required attribute
krishnand Jan 16, 2020
17e7cef
Add AuthorizationClaim contract and include it with CopyRequest
krishnand Feb 4, 2020
3bf751f
AuthorizationClaim - typo in required attrib
krishnand Feb 4, 2020
7c44a2a
Rename AuthorizationClaim to Authorization
krishnand Feb 6, 2020
df47f58
Rename modelResourceId to modelId in the 'Authorization' contract. Fi…
krishnand Feb 10, 2020
df79efd
Adding source query string parameter to the POST copy request
krishnand Feb 19, 2020
0ea6232
Set 'application/json' consumes option for POST copy
krishnand Feb 19, 2020
4e1f391
Introduce models/copyAuthorization route. Added sample for the new ro…
krishnand Feb 20, 2020
02e46e3
Change expirationDateTime to expirationDateTimeTicks in the CopyAutho…
krishnand Feb 24, 2020
725dd73
Remove enum reference for targetResourceRegion. Update to a loose pat…
krishnand Mar 5, 2020
e8b2604
Address ModelValidation and Sample validation errors
krishnand Mar 5, 2020
a1eb575
Fix copy samples JSON validation issues
krishnand Mar 5, 2020
af0cf01
Run prettier on FormRecognizer.json swagger and example files
krishnand Mar 12, 2020
c191d80
Add sample for COpy operation result with errors. Fix description for…
krishnand Mar 20, 2020
020ab6a
Prettier fix for CopyOperationResultWithErrors.json
krishnand Mar 20, 2020
2a56797
Add LRO annotation to copy API
krishnand Mar 23, 2020
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 @@ -312,6 +312,117 @@
}
}
},
"/custom/models/{modelId}/copy": {
"post": {
"summary": "Copy Custom Model",
"description": "Copy custom model to user specified target Form Recognizer resource.",
Comment thread
krishnand marked this conversation as resolved.
Outdated
"operationId": "CopyCustomModel",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"parameters": [
Comment thread
krishnand marked this conversation as resolved.
{
"name": "modelId",
"in": "path",
"description": "Model identifier.",
"required": true,
"type": "string",
"format": "uuid"
},
{
"name": "source",
"in": "query",
"description": "Specify if the request is against the source Form Recognizer resource or not. Source indicates the party that has the model that is to be copied to another resource.",
"required": false,
"default": false,
"type": "boolean",
"x-nullable": false
},
{
"name": "copyRequest",
"in": "body",
"description": "Copy request parameters.",
"required": true,
"schema": {
"$ref": "#/definitions/CopyRequest"
}
}
],
"responses": {
"202": {
"description": "Copy request is queued successfully.",
"headers": {
"Operation-Location": {
Comment thread
lmazuel marked this conversation as resolved.
"type": "string",
"description": "URL containing the resultId used to track the progress and obtain the result of the copy operation."
}
}
},
"default": {
"description": "Response entity accompanying non-successful responses containing additional details about the error.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
},
"x-ms-examples": {
"Copy custom model": {
"$ref": "./examples/CopyModel.json"
}
}
}
},
"/custom/models/{modelId}/copyResults/{resultId}": {
"get": {
"summary": "Get Custom Model Copy Result",
"description": "Obtain current status and the result of a custom model copy operation.",
"operationId": "GetCustomModelCopyResult",
"consumes": [],
"produces": [
"application/json"
],
"parameters": [
{
"name": "modelId",
"in": "path",
"description": "Model identifier.",
"required": true,
"type": "string",
"format": "uuid"
},
{
"name": "resultId",
"in": "path",
"description": "Copy operation result identifier.",
"required": true,
"type": "string",
"format": "uuid"
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/CopyOperationResult"
}
},
"default": {
"description": "Response entity accompanying non-successful responses containing additional details about the error.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
},
"x-ms-examples": {
"Get copy custom model result": {
"$ref": "./examples/CopyOperationResult.json"
}
}
}
},
"/prebuilt/receipt/analyze": {
"post": {
"summary": "Analyze Receipt",
Expand Down Expand Up @@ -506,6 +617,97 @@
},
"x-nullable": false
},
"Authorization": {
"description": "Request parameter that contains claims for authorizing an operation.",
"required": [
"modelId"
],
"type": "object",
"properties": {
"modelId": {
Comment thread
krishnand marked this conversation as resolved.
"description": "Form Recognizer model identifier that will be used as a claim token to authorize the request.",
"type": "string",
"format": "uuid"
}
}
},
"CopyRequest": {
"description": "Request parameter to copy an existing custom model.",
Comment thread
krishnand marked this conversation as resolved.
Outdated
"required": [
"targetResourceId",
"targetResourceRegion"
],
"type": "object",
"properties": {
"targetResourceId": {
"description": "Azure Resource Id of the target Form Recognizer resource where the model is copied to.",
Comment thread
krishnand marked this conversation as resolved.
"maxLength": 2048,
"type": "string",
"pattern": "^/subscriptions/[^/]*/resourceGroups/[^/]*/providers/Microsoft.CognitiveServices/accounts/[^/]*$",
"x-ms-azure-resource": true
},
"targetResourceRegion": {
"description": "Location of the target Azure resource.",
"$ref": "../../../Common/ExtendedRegions.json#/parameters/AzureRegion"
Comment thread
krishnand marked this conversation as resolved.
Outdated
},
"authorization": {
"description": "Entity that encodes claims to authorize the copy request.",
"$ref": "#/definitions/Authorization"
}
}
},
"CopyOperationResult": {
"description": "Status and result of the queued copy operation.",
"type": "object",
"required": [
"status",
"createdDateTime",
"lastUpdatedDateTime"
],
"properties": {
"status": {
"description": "Operation status.",
"$ref": "#/definitions/OperationStatus"
},
"createdDateTime": {
"format": "date-time",
"description": "Date and time (UTC) when the copy operation was submitted.",
"type": "string",
"x-nullable": false
},
"lastUpdatedDateTime": {
"format": "date-time",
"description": "Date and time (UTC) when the status was last updated.",
Comment thread
krishnand marked this conversation as resolved.
"type": "string",
"x-nullable": false
},
"copyResult": {
"description": "Results of the copy operation.",
"$ref": "#/definitions/CopyResult"
}
}
},
"CopyResult": {
"description": "Custom model copy result.",
"type": "object",
"required": [
"modelId"
],
"properties": {
"modelId": {
"description": "Identifier of the target model.",
Comment thread
krishnand marked this conversation as resolved.
"type": "string",
"format": "uuid"
},
"errors": {
"description": "Errors returned during the copy operation.",
Comment thread
krishnand marked this conversation as resolved.
"type": "array",
"items": {
"$ref": "#/definitions/ErrorInformation"
}
}
}
},
"AnalyzeOperationResult": {
"description": "Status and result of the queued analyze operation.",
"type": "object",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
Comment thread
krishnand marked this conversation as resolved.
"parameters": {
"endpoint": "{endpoint}",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "{API key}",
"modelId": "{modelId}",
"body": {},
"copyRequest": {
"targetResourceId": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{resourceName}",
Comment thread
krishnand marked this conversation as resolved.
"targetResourceRegion": "{region}",
Comment thread
krishnand marked this conversation as resolved.
Outdated
"authorization": {
"modelId": "{modelId}"
}
Comment thread
krishnand marked this conversation as resolved.
}
},
"responses": {
"202": {
"headers": {
"Operation-Location": "{endpoint}/formrecognizer/v2.0-preview/custom/models/{modelId}/copyResults/{resultId}"
Comment thread
krishnand marked this conversation as resolved.
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"parameters": {
"endpoint": "{endpoint}",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "{API key}",
"modelId": "{modelId}",
"resultId": "{resultId}",
"body": {}
},
"responses": {
"200": {
"body": {
"status": "succeeded",
"createdDateTime": "2020-01-01T00:00:00Z",
"lastUpdatedDateTime": "2020-01-01T00:01:00Z",
"copyResult": {
"modelId": "{modelId}",
Comment thread
krishnand marked this conversation as resolved.
"errors": []
Comment thread
krishnand marked this conversation as resolved.
}
}
}
}
}