你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Document Translation - Get Translation Status

返回文档翻译请求的状态。 状态包括总体请求状态,以及作为该请求的一部分翻译的文档的状态。

GET {endpoint}/translator/text/batch/v1.0/batches/{id}

URI 参数

名称 必需 类型 说明
endpoint
path True

string

支持的认知服务终结点(协议和主机名,例如:https://westus.api.cognitive.microsoft.com)。

id
path True

string (uuid)

格式 - uuid。 操作 ID

请求头

名称 必需 类型 说明
Ocp-Apim-Subscription-Key True

string

在此处提供认知服务订阅密钥。

响应

名称 类型 说明
200 OK

TranslationStatus

成功请求并返回批处理转换操作的状态

标头

  • Retry-After: integer
  • ETag: string
401 Unauthorized

TranslationErrorResponse

未经 授权。 请检查凭据

404 Not Found

TranslationErrorResponse

找不到资源

429 Too Many Requests

TranslationErrorResponse

请求过多

500 Internal Server Error

TranslationErrorResponse

内部服务器错误

Other Status Codes

TranslationErrorResponse

服务器临时不可用

安全性

Ocp-Apim-Subscription-Key

在此处提供认知服务订阅密钥。

类型: apiKey
在: header

示例

Get Batch Operation Status

示例请求

GET {endpoint}/translator/text/batch/v1.0/batches/727BF148-F327-47A0-9481-ABAE6362F11E

示例响应

{
  "error": {
    "code": "Unauthorized",
    "message": "User is not authorized",
    "target": "Operation",
    "innerError": {
      "code": "Unauthorized",
      "message": "Operation is not authorized"
    }
  }
}
{
  "error": {
    "code": "RequestRateTooHigh",
    "message": "User's request rate is too high",
    "target": "Operation",
    "innerError": {
      "code": "RateTooHigh",
      "message": "Request rate is too high"
    }
  }
}
{
  "error": {
    "code": "InternalServerError",
    "message": "Internal Server Error",
    "target": "Operation",
    "innerError": {
      "code": "InternalServerError",
      "message": "Unexpected internal server error has occurred"
    }
  }
}
{
  "error": {
    "code": "ServiceUnavailable",
    "message": "Service is temporary unavailable",
    "target": "Operation",
    "innerError": {
      "code": "ServiceTemporaryUnavailable",
      "message": "Service is currently unavailable.  Please try again later"
    }
  }
}
{
  "error": {
    "code": "ResourceNotFound",
    "message": "id not found",
    "target": "Operation",
    "innerError": {
      "code": "ResourceNotFound",
      "message": "Resource requested is not found"
    }
  }
}
retry-after: 30
ETag: 686897696a7c876b7e
{
  "id": "727bf148-f327-47a0-9481-abae6362f11e",
  "createdDateTimeUtc": "2020-03-26T00:00:00Z",
  "lastActionDateTimeUtc": "2020-03-26T01:00:00Z",
  "status": "Succeeded",
  "summary": {
    "total": 10,
    "failed": 1,
    "success": 9,
    "inProgress": 0,
    "notYetStarted": 0,
    "cancelled": 0,
    "totalCharacterCharged": 0
  }
}

定义

名称 说明
InnerTranslationError

符合认知服务 API 准则的新内部错误格式,可在 https://microsoft.sharepoint.com/%3Aw%3A/t/CognitiveServicesPMO/EUoytcrjuJdKpeOKIK_QRC8BPtUYQpKBi8JsWyeDMRsWlQ?e=CPq8ow获取。 这包括必需的属性 ErrorCode、消息和可选属性目标、详细信息(键值对)、内部错误(可嵌套)。

Status

作业或文档的可能状态列表

StatusSummary
TranslationError

这包含一个外部错误,其中包含错误代码、消息、详细信息、目标和内部错误,其中包含更具描述性的详细信息。

TranslationErrorCode

包含高级错误代码的枚举。

TranslationErrorResponse

包含用于跨任何认知服务的 HTTP 响应的统一错误信息。 可以通过 Microsoft.CloudAI.Containers.HttpStatusExceptionV2 或通过直接从控制器返回实例来创建实例。

TranslationStatus

转换作业状态响应

InnerTranslationError

符合认知服务 API 准则的新内部错误格式,可在 https://microsoft.sharepoint.com/%3Aw%3A/t/CognitiveServicesPMO/EUoytcrjuJdKpeOKIK_QRC8BPtUYQpKBi8JsWyeDMRsWlQ?e=CPq8ow获取。 这包括必需的属性 ErrorCode、消息和可选属性目标、详细信息(键值对)、内部错误(可嵌套)。

名称 类型 说明
code

string

获取代码错误代码字符串。

innerError

InnerTranslationError

符合认知服务 API 准则的新内部错误格式,可在 https://microsoft.sharepoint.com/%3Aw%3A/t/CognitiveServicesPMO/EUoytcrjuJdKpeOKIK_QRC8BPtUYQpKBi8JsWyeDMRsWlQ?e=CPq8ow获取。 这包括必需的属性 ErrorCode、消息和可选属性目标、详细信息(键值对)、内部错误(可嵌套)。

message

string

获取高级别错误消息。

target

string

获取错误的源。 例如,如果文档无效,则为“documents”或“document id”。

Status

作业或文档的可能状态列表

说明
Cancelled
Cancelling
Failed
NotStarted
Running
Succeeded
ValidationFailed

StatusSummary

名称 类型 说明
cancelled

integer (int32)

已取消的数量

failed

integer (int32)

失败计数

inProgress

integer (int32)

正在进行次数

notYetStarted

integer (int32)

尚未启动的计数

success

integer (int32)

成功次数

total

integer (int32)

总计计数

totalCharacterCharged

integer (int64)

API 收费的字符总数

TranslationError

这包含一个外部错误,其中包含错误代码、消息、详细信息、目标和内部错误,其中包含更具描述性的详细信息。

名称 类型 说明
code

TranslationErrorCode

包含高级错误代码的枚举。

innerError

InnerTranslationError

符合认知服务 API 准则的新内部错误格式,可在 https://microsoft.sharepoint.com/%3Aw%3A/t/CognitiveServicesPMO/EUoytcrjuJdKpeOKIK_QRC8BPtUYQpKBi8JsWyeDMRsWlQ?e=CPq8ow获取。 这包括必需的属性 ErrorCode、消息和可选属性目标、详细信息(键值对)、内部错误(可嵌套)。

message

string

获取高级别错误消息。

target

string

获取错误的源。 例如,如果文档无效,则为“documents”或“document id”。

TranslationErrorCode

包含高级错误代码的枚举。

说明
InternalServerError
InvalidArgument
InvalidRequest
RequestRateTooHigh
ResourceNotFound
ServiceUnavailable
Unauthorized

TranslationErrorResponse

包含用于跨任何认知服务的 HTTP 响应的统一错误信息。 可以通过 Microsoft.CloudAI.Containers.HttpStatusExceptionV2 或通过直接从控制器返回实例来创建实例。

名称 类型 说明
error

TranslationError

这包含一个外部错误,其中包含错误代码、消息、详细信息、目标和内部错误,其中包含更具描述性的详细信息。

TranslationStatus

转换作业状态响应

名称 类型 说明
createdDateTimeUtc

string (date-time)

操作创建的日期时间

error

TranslationError

这包含一个外部错误,其中包含错误代码、消息、详细信息、目标和内部错误,其中包含更具描述性的详细信息。

id

string (uuid)

操作的 ID。

lastActionDateTimeUtc

string (date-time)

操作状态已更新的日期时间

status

Status

作业或文档的可能状态列表

summary

StatusSummary