查询分身数字人模型训练任务列表
功能介绍
该接口用于查询分身数字人模型训练任务列表。
调用方法
请参见如何调用API。
URI
GET /v1/{project_id}/digital-human-training-manage/user/jobs
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
project_id |
是 |
String |
项目ID,获取方法请参考获取项目ID。 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
offset |
否 |
Integer |
偏移量,表示从此偏移量开始查询。 取值范围: 0-2147483647 默认取值: 0 |
limit |
否 |
Integer |
每页显示的条目数量。 取值范围: 1-100 默认取值: 10 |
sort_key |
否 |
String |
排序字段,支持的排序方式有:
|
sort_dir |
否 |
String |
排序方式。
默认asc升序。 |
create_until |
否 |
String |
过滤创建时间<=输入时间的记录。 |
create_since |
否 |
String |
过滤创建时间>=输入时间的记录。 |
state |
否 |
String |
任务状态,默认所有状态。 可多个状态查询,使用英文逗号分隔。 如state=CREATING,PUBLISHED |
query_project_id |
否 |
String |
查询租户id。 |
batch_name |
否 |
String |
任务批次名称。 |
tag |
否 |
String |
任务标签。 |
job_id |
否 |
String |
任务ID。 |
name |
否 |
String |
分身数字人模型名称 |
model_resolution |
否 |
String |
模型分辨率 |
is_flexus |
否 |
Boolean |
是否是flexus任务 |
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
X-Auth-Token |
否 |
String |
用户Token。使用Token鉴权方式时必选。 通过调用IAM服务获取用户Token接口获取。 响应消息头中X-Subject-Token的值。 |
Authorization |
否 |
String |
使用AK/SK方式认证时必选,携带的鉴权信息。 |
X-Sdk-Date |
否 |
String |
使用AK/SK方式认证时必选,请求的发生时间。 格式为(YYYYMMDD'T'HHMMSS'Z')。 |
X-Project-Id |
否 |
String |
使用AK/SK方式认证时必选,携带项目ID信息。 |
X-App-UserId |
否 |
String |
第三方用户ID。不允许输入中文。 |
响应参数
状态码: 200
参数 |
参数类型 |
描述 |
---|---|---|
X-Request-Id |
String |
请求ID。 |
参数 |
参数类型 |
描述 |
---|---|---|
count |
Integer |
分身数字人模型训练任务数量。 取值范围: 0-2147483647 |
jobs |
Array of TrainingJobBasicInfo objects |
分身数字人模型训练任务列表。 |
参数 |
参数类型 |
描述 |
---|---|---|
job_id |
String |
任务ID。 |
name |
String |
分身数字人模型名称。该名称会作为资产库中分身数字人模型资产名称。 |
state |
String |
任务的状态。 与MetaStudio Console上用户看到的状态映射关系如下:
|
asset_id |
String |
模型资产ID。 |
project_id |
String |
模型资产所属项目ID。 |
cover_download_url |
String |
分身数字人模型封面下载URL。URL有效期24小时。 |
last_update_time |
String |
用户最近一次更新任务的时间(包括租户创建或者重新提交),格式遵循:RFC 3339。 例 “2020-07-30T10:43:17Z” |
create_time |
String |
创建时间,格式遵循:RFC 3339。 例 “2020-07-30T10:43:17Z” |
contact |
String |
分身数字人训练任务创建者的手机号。 |
batch_name |
String |
分身数字人训练任务的批次名称。 |
tags |
Array of strings |
分身数字人训练任务标签。 |
model_version |
String |
分身数字人模型版本。默认是V3.2版本模型。
说明:
取值范围: 0-64 默认取值: V3.2 |
matting_type |
String |
抠图类型。默认是AI。
默认取值: AI |
model_resolution |
String |
分身数字人模型分辨率。默认是1080P。
|
app_user_id |
String |
自定义用户id(如创建任务时设置了X-App-UserId则会携带)。 |
is_flexus |
Boolean |
是否是基础版的形象训练 |
is_only_human_model |
Boolean |
是否只训练形象模型,不训练声音模型。仅Flexus版本时有效,默认false。 默认取值: false |
状态码: 400
参数 |
参数类型 |
描述 |
---|---|---|
BadRequest |
AnyType |
请求传参异常,包含错误码及对应描述。 |
状态码: 500
参数 |
参数类型 |
描述 |
---|---|---|
InternalServiceError |
AnyType |
内部服务错误。 |
请求示例
https://example.com/rest/v1/***/digital-human-training-manage/user/jobs?query_project_id=***&offset=0&limit=10
响应示例
状态码: 200
处理成功返回。
{ "count" : 101, "jobs" : [ { "job_id" : "646682facddb4912976f19a4d61c6a91", "name" : "名字1", "state" : "TRAINING", "project_id" : "***", "cover_download_url" : "https://example.com/646682facddb4912976f19a4d61c6a91_cover?param1=XXX¶m2=YYY", "last_update_time" : "2023-12-09T07:38:09Z", "create_time" : "2023-12-08T08:30:56Z", "contact" : "1**********", "tags" : [ ], "model_version" : "V3.2", "matting_type" : "AI" }, { "job_id" : "efc5300ecdba4ea48d1ff13a9d907bc0", "name" : "名字2", "state" : "MANUAL_VERIFYING", "project_id" : "***", "cover_download_url" : "https://example.com/efc5300ecdba4ea48d1ff13a9d907bc0_cover?param1=XXX¶m2=YYY", "last_update_time" : "2023-12-09T07:32:46Z", "create_time" : "2023-12-09T07:31:37Z", "contact" : "1**********", "model_version" : "V3", "matting_type" : "AI" }, { "job_id" : "7889dfd55bf14834a35e78c7f0aa0516", "name" : "名字3", "state" : "INFERENCE_DATA_PREPROCESS_FAILED", "project_id" : "***", "cover_download_url" : "https://example.com/7889dfd55bf14834a35e78c7f0aa0516_cover?param1=XXX¶m2=YYY", "last_update_time" : "2023-12-09T07:09:02Z", "create_time" : "2023-12-08T08:34:12Z", "contact" : "1**********", "tags" : [ ], "model_version" : "V3.2", "matting_type" : "AI" }, { "job_id" : "222509ed63c2498599f519d5ec7ef462", "name" : "名字4", "state" : "TRAINING_DATA_PREPROCESS_SUCCESS", "project_id" : "***", "cover_download_url" : "https://example.com/222509ed63c2498599f519d5ec7ef462_cover?param1=XXX¶m2=YYY", "last_update_time" : "2023-12-09T07:08:21Z", "create_time" : "2023-12-08T08:33:24Z", "contact" : "1**********", "tags" : [ ], "model_version" : "V3.2", "matting_type" : "AI" }, { "job_id" : "dd4a596edc2c44dd881b5e9eff485e21", "name" : "名字5", "state" : "TRAINING_DATA_PREPROCESS_SUCCESS", "project_id" : "***", "cover_download_url" : "https://example.com/dd4a596edc2c44dd881b5e9eff485e21_cover?param1=XXX¶m2=YYY", "last_update_time" : "2023-12-09T02:12:01Z", "create_time" : "2023-12-08T08:29:25Z", "contact" : "1**********", "model_version" : "V3.2", "matting_type" : "AI" }, { "job_id" : "bf46c9f335b14e84bd028f6acb52686b", "name" : "名字6", "state" : "JOB_FINISH", "asset_id" : "3174263c6199e0a10d83a257b272ac71", "project_id" : "***", "cover_download_url" : "https://example.com/bf46c9f335b14e84bd028f6acb52686b_cover?param1=XXX¶m2=YYY", "last_update_time" : "2023-12-08T08:37:39Z", "create_time" : "2023-11-29T09:39:25Z", "contact" : "1**********", "model_version" : "V3", "matting_type" : "AI" }, { "job_id" : "2f96ddd4fdda40af977c1b1d3b6adca8", "name" : "名字7", "state" : "INFERENCE_DATA_PREPROCESS_FAILED", "asset_id" : "22741ee4bc4130282835bdc2a4b4ac79", "project_id" : "***", "cover_download_url" : "https://example.com/2f96ddd4fdda40af977c1b1d3b6adca8_cover?param1=XXX¶m2=YYY", "last_update_time" : "2023-12-08T07:26:53Z", "create_time" : "2023-10-19T01:13:24Z", "contact" : "15312090046", "batch_name" : "234", "model_version" : "V3", "matting_type" : "AI" }, { "job_id" : "e477dcf363234b2f8aa2aad4d8bad46b", "name" : "名字8", "state" : "INFERENCE_DATA_PREPROCESS_FAILED", "asset_id" : "d36e8df774ae88315911724d4467cb6d", "project_id" : "***", "cover_download_url" : "https://example.com/e477dcf363234b2f8aa2aad4d8bad46b_cover?param1=XXX¶m2=YYY", "last_update_time" : "2023-12-08T01:58:52Z", "create_time" : "2023-11-27T06:39:46Z", "contact" : "1**********", "model_version" : "V3.2", "matting_type" : "AI" }, { "job_id" : "d8ca20175d5b4ae6b0056c62e4553d36", "name" : "名字9", "state" : "INFERENCE_DATA_PREPROCESS_FAILED", "asset_id" : "5ff8e2893ffa8ef848050260eb08faa9", "project_id" : "***", "cover_download_url" : "https://example.com/d8ca20175d5b4ae6b0056c62e4553d36_cover?param1=XXX¶m2=YYY", "last_update_time" : "2023-12-04T05:39:24Z", "create_time" : "2023-11-06T13:51:09Z", "contact" : "1**********", "model_version" : "V3.2", "matting_type" : "AI" }, { "job_id" : "65e9fb9ac78546268e7d60d5003bfbdc", "name" : "名字10", "state" : "INFERENCE_DATA_PREPROCESS_FAILED", "asset_id" : "71a0df4bd5966a33818af2b5094cf197", "project_id" : "***", "cover_download_url" : "https://example.com/65e9fb9ac78546268e7d60d5003bfbdc_cover?param1=XXX¶m2=YYY", "last_update_time" : "2023-12-01T07:58:26Z", "create_time" : "2023-11-29T11:19:22Z", "contact" : "1**********", "model_version" : "V3", "matting_type" : "AI" } ] }
状态码: 400
请求传参异常,包含错误码及对应描述。
{ "error_code" : "MSS.00000003", "error_msg" : "Invalid parameter" }
状态码: 500
内部服务错误。
{ "error_code" : "MSS.00000004", "error_msg" : "Internal Error" }
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 List2dModelTrainingJobSolution { 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(); List2dModelTrainingJobRequest request = new List2dModelTrainingJobRequest(); try { List2dModelTrainingJobResponse response = client.list2dModelTrainingJob(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 = List2dModelTrainingJobRequest() response = client.list2d_model_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.List2dModelTrainingJobRequest{} response, err := client.List2dModelTrainingJob(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } } |
更多编程语言的SDK代码示例,请参见API Explorer的代码示例页签,可生成自动对应的SDK代码示例。
状态码
状态码 |
描述 |
---|---|
200 |
处理成功返回。 |
400 |
请求传参异常,包含错误码及对应描述。 |
500 |
内部服务错误。 |
错误码
请参见错误码。