查询语音训练任务列表
功能介绍
查询语音训练任务列表
调用方法
请参见如何调用API。
URI
GET /v1/{project_id}/voice-training-manage/user/jobs
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
project_id |
是 |
String |
项目ID,获取方法请参考获取项目ID。 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
offset |
否 |
Integer |
偏移量,表示从此偏移量开始查询。 取值范围: 0-2147483647 默认取值: 0 |
limit |
否 |
Integer |
每页显示的条目数量。 取值范围: 1-100 默认取值: 10 |
create_until |
否 |
String |
过滤创建时间<=输入时间的记录。 |
create_since |
否 |
String |
过滤创建时间>=输入时间的记录。 |
state |
否 |
String |
任务状态,默认所有状态。 可多个状态查询,使用英文逗号分隔。 如state=FAILED,WAITING |
job_id |
否 |
String |
任务id。 |
voice_name |
否 |
String |
声音名称。 |
tag |
否 |
String |
任务标签。 |
job_type |
否 |
String |
训练类型。
|
batch_name |
否 |
String |
批次名称。 |
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
X-App-UserId |
否 |
String |
第三方用户ID。不允许输入中文。 |
响应参数
状态码: 200
参数 |
参数类型 |
描述 |
---|---|---|
count |
Integer |
满足查询要求的任务总数。 取值范围: 0-2147483647 |
jobs |
Array of TrainingJobInfo objects |
分身数字人模型训练任务列表。 |
参数 |
参数类型 |
描述 |
---|---|---|
job_type |
String |
训练类型。
|
job_id |
String |
任务id。 |
app_user_id |
String |
用户id。 |
voice_name |
String |
音色名称。该名称会作为资产库中音色模型资产名称。 |
sex |
String |
性别。
|
language |
String |
语言。 |
state |
String |
任务状态。
|
reject_times |
Integer |
本次任务中该状态出现的次数 取值范围: 1-10 |
asset_id |
String |
当任务状态为成功时呈现,音色模型在资产库中的id。 |
job_failed_code |
String |
当任务失败时呈现,失败错误码。 |
job_failed_reason |
String |
当任务失败时呈现,失败原因。 |
create_time |
Long |
任务创建时间。 取值范围: 1-2147483647 |
lastupdate_time |
Long |
任务状态更新时间。 取值范围: 1-2147483647 |
voice_authorization_url |
String |
用户授权书连接。 |
create_type |
String |
任务创建方式。
|
tag |
String |
任务标签。
|
phone |
String |
手机号 |
dhtms_job_id |
String |
形象制作任务id |
batch_name |
String |
批次名称 |
allocated_resource |
||
output_language |
String |
模型输出语言类型 |
参数 |
参数类型 |
描述 |
---|---|---|
resource_id |
String |
资源ID。 |
charge_mode |
String |
资源计费类型。
说明:
|
expire_time |
String |
资源过期时间,格式遵循:RFC 3339 如"2021-01-10T08:43:17Z" |
状态码: 400
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
错误码。 |
error_msg |
String |
错误描述。 |
请求示例
GET https://{endpoint}/v1/3f0924078d1b471c884a5383d4dec9fa/voice-training-manage/user/jobs
响应示例
状态码: 200
处理成功返回。
{ "count" : 2147483647, "jobs" : [ { "job_type" : "BASIC", "job_id" : "abcdefg", "app_user_id" : "123qwe", "voice_name" : "女声", "sex" : "FEMALE", "language" : "CN", "state" : "WAITING", "asset_id" : "my_asset_id", "job_failed_code" : "MSS.00000000", "job_failed_reason" : "error reason", "create_time" : 2147483647, "lastupdate_time" : 2147483647, "voice_authorization_url" : "https://bucket/data", "create_type" : "PACKAGE", "tag" : "ECOMMERCE" } ] }
SDK代码示例
SDK代码示例如下。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
package com.huaweicloud.sdk.test; import com.huaweicloud.sdk.core.auth.ICredential; import com.huaweicloud.sdk.core.auth.BasicCredentials; import com.huaweicloud.sdk.core.exception.ConnectionException; import com.huaweicloud.sdk.core.exception.RequestTimeoutException; import com.huaweicloud.sdk.core.exception.ServiceResponseException; import com.huaweicloud.sdk.metastudio.v1.region.MetaStudioRegion; import com.huaweicloud.sdk.metastudio.v1.*; import com.huaweicloud.sdk.metastudio.v1.model.*; public class ListVoiceTrainingJobSolution { public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment String ak = System.getenv("CLOUD_SDK_AK"); String sk = System.getenv("CLOUD_SDK_SK"); String projectId = "{project_id}"; ICredential auth = new BasicCredentials() .withProjectId(projectId) .withAk(ak) .withSk(sk); MetaStudioClient client = MetaStudioClient.newBuilder() .withCredential(auth) .withRegion(MetaStudioRegion.valueOf("<YOUR REGION>")) .build(); ListVoiceTrainingJobRequest request = new ListVoiceTrainingJobRequest(); try { ListVoiceTrainingJobResponse response = client.listVoiceTrainingJob(request); System.out.println(response.toString()); } catch (ConnectionException e) { e.printStackTrace(); } catch (RequestTimeoutException e) { e.printStackTrace(); } catch (ServiceResponseException e) { e.printStackTrace(); System.out.println(e.getHttpStatusCode()); System.out.println(e.getRequestId()); System.out.println(e.getErrorCode()); System.out.println(e.getErrorMsg()); } } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# coding: utf-8 import os from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdkmetastudio.v1.region.metastudio_region import MetaStudioRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkmetastudio.v1 import * if __name__ == "__main__": # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak = os.environ["CLOUD_SDK_AK"] sk = os.environ["CLOUD_SDK_SK"] projectId = "{project_id}" credentials = BasicCredentials(ak, sk, projectId) client = MetaStudioClient.new_builder() \ .with_credentials(credentials) \ .with_region(MetaStudioRegion.value_of("<YOUR REGION>")) \ .build() try: request = ListVoiceTrainingJobRequest() response = client.list_voice_training_job(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
package main import ( "fmt" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" metastudio "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/metastudio/v1" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/metastudio/v1/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/metastudio/v1/region" ) func main() { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak := os.Getenv("CLOUD_SDK_AK") sk := os.Getenv("CLOUD_SDK_SK") projectId := "{project_id}" auth := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). WithProjectId(projectId). Build() client := metastudio.NewMetaStudioClient( metastudio.MetaStudioClientBuilder(). WithRegion(region.ValueOf("<YOUR REGION>")). WithCredential(auth). Build()) request := &model.ListVoiceTrainingJobRequest{} response, err := client.ListVoiceTrainingJob(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } } |
更多编程语言的SDK代码示例,请参见API Explorer的代码示例页签,可生成自动对应的SDK代码示例。
状态码
状态码 |
描述 |
---|---|
200 |
处理成功返回。 |
400 |
参数异常。 |
错误码
请参见错误码。