云服务器内容精选

  • 响应参数 状态码:200 表3 响应Body参数 参数 参数类型 描述 quotas Array of TrainingQuotaResponse objects 训练作业配额组。 表4 TrainingQuotaResponse 参数 参数类型 描述 resource String 配额的资源类型,当前支持:job-num,作业的个数配额。 quota Integer 配额个数。 used Integer 已使用的个数。
  • URI GET /v2/{project_id}/training-quotas 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 用户项目ID。获取方法请参见获取项目ID和名称。 表2 Query参数 参数 是否必选 参数类型 描述 user_id 否 String 用户ID。 resource 否 String 配额的资源类型,当前支持的传参:job-num,作业个数的配额。
  • URI GET /v2/{project_id}/training-jobs/{training_job_id}/tasks/{task_id}/logs/preview 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 用户项目ID。获取方法请参见获取项目ID和名称。 training_job_id 是 String 训练作业ID。获取方法请参见查询训练作业列表。 task_id 是 String 训练作业的任务名称。可从训练作业详情中的status.tasks字段中获取。
  • 响应示例 状态码:200 ok { "content" : "[Modelarts Service Log]collect and upload ascend logs end at 2021-05-18-14:28:13\n[Modelarts Service Log]exiting..:\n [Modelarts Service Log]exiting...\n[Modelarts Service Log]exiting..:\n [Modelarts Service Log]exiting...\n[Modelarts Service Log]exit with :\n [Modelarts Service Log]exit with 0\n[Modelarts Service Log]exit with :\n [Modelarts Service Log]exit with 0\n[ModelArts Service Log][INFO][2021/05/18 14:28:14,207]:\n output-handler finalizing due to: [training finished]\n[ModelArts Service Log][INFO][2021/05/18 14:28:14,207]:\n output-handler finalized\n[Modelarts Service Log][sidecar] exiting at 2021-05-18-14:28:14\n[Modelarts Service Log][sidecar] wait python processes exit..:\n [Modelarts Service Log][sidecar] wait python processes exit...\n[Modelarts Service Log][sidecar] exit with :\n [Modelarts Service Log][sidecar] exit with 0", "current_size" : 126548, "full_size" : 5242880 }
  • 响应参数 状态码:200 表2 响应Body参数 参数 参数类型 描述 content String 日志内容。如果日志大小没有超过上限(n兆)则返回全部内容,如果日志超过了上限(n兆)则返回最新的n兆的日志。2022/03/01 00:00:00 (GMT+08:00)后,此参数名称由“context”改为“content”。 current_size Integer 当前返回的日志大小(单位:字节)。最大为5兆。 full_size Integer 完整的日志大小(单位:字节)。
  • 作业状态参考 作业状态如表1所示。 表1 作业状态 状态值 作业状态说明 0 JOBSTAT_UNKNOWN,作业状态未知。 1 JOBSTAT_INIT,作业初始化状态。 2 JOBSTAT_IMAGE_CREATING,作业镜像正在创建。 3 JOBSTAT_IMAGE_FAILED,作业镜像创建失败。 4 JOBSTAT_SUBMIT_TRYING,作业正在提交。 5 JOBSTAT_SUBMIT_FAILED,作业提交失败。 6 JOBSTAT_DELETE_FAILED,作业删除失败。 7 JOBSTAT_WAITING,作业正在排队中。 8 JOBSTAT_RUNNING,作业正在运行中。 9 JOBSTAT_KILLING,作业正在取消。 10 JOBSTAT_COMPLETED,作业已经完成。 11 JOBSTAT_FAILED,作业运行失败。 12 JOBSTAT_KILLED,作业取消成功。 13 JOBSTAT_CANCELED,作业取消。 14 JOBSTAT_LOST,作业丢失。 15 JOBSTAT_SCALING,作业正在扩容。 16 JOBSTAT_SUBMIT_MODEL_FAILED,提交模型失败。 17 JOBSTAT_DEPLOY_SERVICE_FAILED,部署服务失败。 18 JOBSTAT_CHECK_INIT,审核作业初始化。 19 JOBSTAT_CHECK_RUNNING,审核作业正在运行中。 20 JOBSTAT_CHECK_RUNNING_COMPLETED,审核作业已经完成。 21 JOBSTAT_CHECK_FAILED,审核作业失败。 父主题: 训练管理(旧版)
  • 请求示例 如下以修改uuid为2e5451fe-913f-4492-821a-2981031382f7的算法为例。 PUT https://endpoint/v2/{project_id}/algorithms/2e5451fe-913f-4492-821a-2981031382f7 { "metadata" : { "name" : "TestModelArtsalgorithm", "description" : "This is a ModelArts algorithm modified" }, "job_config" : { "code_dir" : "/algo-test/pytorch/work1/code/", "boot_file" : "/algo-test/pytorch/work1/code/test-pytorch.py", "parameters" : [ { "name" : "test-parameter", "value" : "10", "constraint" : { "type" : "String", "editable" : true, "required" : false, "sensitive" : false, "valid_type" : "None", "valid_range" : [ ] } } ], "parameters_customization" : true, "inputs" : [ { "name" : "data_url", "description" : "data source." } ], "outputs" : [ { "name" : "train_url", "description" : "model output." } ], "engine" : { "engine_name" : "PyTorch", "engine_version" : "PyTorch-1.3.0-python3.6" } } }
  • 响应示例 状态码:201 ok { "metadata" : { "id" : "2e5451fe-913f-4492-821a-2981031382f7", "name" : "TestModelArtsalgorithm", "description" : "This is a ModelArts algorithm modified", "create_time" : 1636600721742, "workspace_id" : "0", "ai_project" : "default-ai-project", "user_name" : "", "domain_id" : "xxxxxxxxxxxxxxxxxxxxxxxxxx", "source" : "custom", "api_version" : "", "is_valid" : true, "state" : "", "size" : 4791, "tags" : null, "attr_list" : null, "version_num" : 0, "update_time" : 0 }, "job_config" : { "code_dir" : "/algo-test/pytorch/work1/code/", "boot_file" : "/algo-test/pytorch/work1/code/test-pytorch.py", "command" : "", "parameters" : [ { "name" : "test-parameter", "description" : "", "i18n_description" : null, "value" : "10", "constraint" : { "type" : "String", "editable" : true, "required" : false, "sensitive" : false, "valid_type" : "None", "valid_range" : [ ] } } ], "parameters_customization" : true, "inputs" : [ { "name" : "data_url", "description" : "name to translate" } ], "outputs" : [ { "name" : "train_url", "description" : "name to translate" } ], "engine" : { "engine_id" : "pytorch-cp36-1.3.0", "engine_name" : "PyTorch", "engine_version" : "PyTorch-1.3.0-python3.6" }, "code_tree" : { "name" : "code/", "children" : [ { "name" : "test-pytorch.py" } ] } }, "resource_requirements" : null, "advanced_config" : { } }
  • 响应示例 状态码:200 OK { "metadata" : { "id" : "6ccc15e6-8a81-4d8e-8bee-53401d850639", "name" : "test", "description" : "demo", "create_time" : 1731552542622, "workspace_id" : "0", "update_time" : 1731552542000 }, "statistic" : { "job_count" : 0 } }
  • 响应参数 状态码:200 表4 响应Body参数 参数 参数类型 描述 metadata TrainingExperimentResponseMetadata object 训练实验数据。 statistic TrainingExperimentStatistic object 训练实验的统计数据。 表5 TrainingExperimentResponseMetadata 参数 参数类型 描述 name String 实验名称,最大长度64,不支持特殊字符。 description String 描述信息,最大长度256,不支持特殊字符。 workspace_id String 工作空间ID,默认为0。 create_time Integer 创建时间。 update_time Integer 更新时间。 id String 实验ID。 表6 TrainingExperimentStatistic 参数 参数类型 描述 job_count Integer 当前实验下的训练作业总个数。
  • 请求参数 表2 请求Body参数 参数 是否必选 参数类型 描述 metadata 是 TrainingExperimentRequestMetadata object 训练实验创建参数 表3 TrainingExperimentRequestMetadata 参数 是否必选 参数类型 描述 name 是 String 实验名称,最大长度64,不支持特殊字符。 description 否 String 描述信息,最大长度256,不支持特殊字符。 workspace_id 否 String 工作空间ID,默认为0。
提示

您即将访问非华为云网站,请注意账号财产安全