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

Projects - Create

创建新项目。

PUT {endpoint}/customvoice/projects/{id}?api-version=2024-02-01-preview

URI 参数

名称 必需 类型 说明
endpoint
path True

string

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

id
path True

string

minLength: 3
maxLength: 64
pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$

资源的 ID。

api-version
query True

string

minLength: 1

用于此作的 API 版本。

请求头

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

string

在此处提供语音资源密钥。

请求正文

名称 必需 类型 说明
kind True

ProjectKind

项目类型

description

string

项目说明

displayName

string

minLength: 1

项目名称

id

string

minLength: 3
maxLength: 64
pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$

资源 ID

响应

名称 类型 说明
201 Created

Project

创建

Other Status Codes

ErrorResponse

发生错误。

标头

x-ms-error-code: string

安全性

Ocp-Apim-Subscription-Key

在此处提供语音资源密钥。

类型: apiKey
在: header

示例

Create a project

示例请求

PUT {endpoint}/customvoice/projects/Jessica?api-version=2024-02-01-preview


{
  "description": "Project for Jessica Voice",
  "kind": "ProfessionalVoice"
}

示例响应

{
  "id": "Jessica",
  "description": "Project for Jessica Voice",
  "kind": "ProfessionalVoice",
  "createdDateTime": "2023-04-01T05:30:00.000Z"
}

定义

名称 说明
Error

顶级错误遵循Microsoft Azure REST API 指南,https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors提供。 这包含一个顶级错误,其中包含错误代码、消息、详细信息、目标和内部错误,其中包含更具描述性的详细信息。

ErrorCode

顶级错误代码

ErrorResponse

错误响应遵循Microsoft Azure REST API 指南,https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors提供。

InnerError

内部错误遵循 Microsoft Azure REST API 指南,https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors提供。 这包含必需的属性错误代码、消息和可选属性目标、内部错误(可嵌套)。

Project

Project 对象。 许可、训练集、模型和终结点组织在项目中。

ProjectKind

项目类型

Error

顶级错误遵循Microsoft Azure REST API 指南,https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors提供。 这包含一个顶级错误,其中包含错误代码、消息、详细信息、目标和内部错误,其中包含更具描述性的详细信息。

名称 类型 说明
code

ErrorCode

顶级错误代码

details

Error[]

有关错误和/或预期策略的其他支持详细信息。

innererror

InnerError

内部错误遵循 Microsoft Azure REST API 指南,https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors提供。 这包含必需的属性错误代码、消息和可选属性目标、内部错误(可嵌套)。

message

string

顶级错误消息。

target

string

错误的源。 例如,如果模型无效,则为“model”或“model id”。

ErrorCode

顶级错误代码

说明
BadRequest
BadArgument
Unauthorized
Forbidden
NotFound
UnsupportedMediaType
TooManyRequests
InternalServerError
ServiceUnavailable

ErrorResponse

错误响应遵循Microsoft Azure REST API 指南,https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors提供。

名称 类型 说明
error

Error

顶级错误遵循Microsoft Azure REST API 指南,https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors提供。 这包含一个顶级错误,其中包含错误代码、消息、详细信息、目标和内部错误,其中包含更具描述性的详细信息。

InnerError

内部错误遵循 Microsoft Azure REST API 指南,https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors提供。 这包含必需的属性错误代码、消息和可选属性目标、内部错误(可嵌套)。

名称 类型 说明
code

string

用于帮助诊断的详细错误代码。

innererror

InnerError

内部错误遵循 Microsoft Azure REST API 指南,https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors提供。 这包含必需的属性错误代码、消息和可选属性目标、内部错误(可嵌套)。

message

string

详细的错误消息。

target

string

错误的源。 例如,如果模型无效,则为“model”或“model id”。

Project

Project 对象。 许可、训练集、模型和终结点组织在项目中。

名称 类型 说明
createdDateTime

string (date-time)

创建对象的时间戳。 时间戳编码为 ISO 8601 日期和时间格式(“YYYY-MM-DDThh:mm:ssZ”,请参阅 https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations)。

description

string

项目说明

displayName

string

minLength: 1

项目名称

id

string

minLength: 3
maxLength: 64
pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$

资源 ID

kind

ProjectKind

项目类型

ProjectKind

项目类型

说明
ProfessionalVoice
PersonalVoice