华为云用户手册

  • 请求示例 创建Notebook实例。设置实例规格为“modelarts.vm.cpu.2u”,存储类型为“EVS”,资源所属为“MANAGED”,存储容量为50G。 { "name" : "notebooks_test", "feature" : "NOTEBOOK", "workspace_id" : "0", "description" : "api-test", "flavor" : "modelarts.vm.cpu.2u", "image_id" : "e1a07296-22a8-4f05-8bc8-e936c8e54090", "volume" : { "category" : "evs", "ownership" : "managed", "capacity" : 50 } }
  • 响应消息 响应参数如表3所示。 表3 响应参数 参数 参数类型 说明 is_success Boolean 请求是否成功。 error_message String 调用失败时的错误信息。 调用成功时无此字段。 error_code String 调用失败时的错误码,具体请参见错误码。 调用成功时无此字段。 spec_total_count Integer 作业资源规格总数。 specs specs结构数组 资源规格参数列表,如表4所示。 表4 specs属性列表说明 参数 参数类型 说明 spec_id Long 资源规格的ID。 core String 资源规格的核数。 cpu String 资源规格CPU内存。 gpu_num Integer 资源规格GPU的个数。 gpu_type String 资源规格GPU的类型。 spec_code String 云资源的规格类型。 max_num Integer 可以选择的最大节点数量。 unit_num Integer 计价单元个数。 storage String 资源规格的ssd大小。 interface_type Integer 接口类型。 no_resource Boolean 所选规格资源是否充足,True代表没有资源。
  • 响应示例 成功响应示例 { "specs": [ { "spec_id": 2, "core": "2", "cpu": "8", "gpu_num": 0, "gpu_type": "", "spec_code": "modelarts.vm.cpu.2u", "unit_num": 1, "max_num": 2, "storage": "", "interface_type": 1, "no_resource": false } ], "is_success": true, "spec_total_count": 1 } 失败响应示例 { "is_success": false, "error_message": "Error string", "error_code": "ModelArts.0105" }
  • URI GET /v1/{project_id}/job/resource-specs 参数说明如表1所示。 表1 参数说明 参数 是否必选 参数类型 说明 project_id 是 String 用户项目ID。获取方法请参见获取项目ID和名称。 表2 查询检索参数说明 参数 是否为必选 参数类型 说明 job_type 否 String 指定作业的类型,可选的有“train”和“inference”。查询自动学习资源规格无需此参数。 engine_id 否 Long 指定作业的引擎ID,默认为“0”。查询自动学习资源规格无需此参数。 project_type 否 Integer 项目类型。默认为“0”。 0:非自动学习项目。 1:自动学习,图像分类。 2:自动学习,物体检测。 3:自动学习,预测分析。
  • 响应示例 状态码: 200 OK。 { "kind" : "Pool", "apiVersion" : "v2", "metadata" : { "name" : "auto-pool-os-86c13962597848eeb29c5861153a391f", "creationTimestamp" : "2022-09-16T03:10:40Z", "labels" : { "os.modelarts/name" : "auto-pool-os", "os.modelarts/workspace.id" : "0", "os.modelarts/resource.id" : "maos-auto-pool-os-72w8d" }, "annotations" : { "os.modelarts/description" : "", "os.modelarts/billing.mode" : "0" } }, "spec" : { "type" : "Dedicate", "scope" : [ "Train", "Infer" ], "resources" : [ { "flavor" : "modelarts.vm.cpu.4ud", "count" : 3 } ], "network" : { "name" : "network-maos-86c13962597848eeb29c5861153a391f" } }, "status" : { "phase" : "Running", "root" : "auto-pool-os-86c13962597848eeb29c5861153a391f", "scope" : [ { "scopeType" : "Train", "state" : "Enabled" }, { "scopeType" : "Infer", "state" : "Enabled" } ], "resources" : { "creating" : [ { "flavor" : "modelarts.vm.cpu.4ud", "count" : 1, "azs" : [ { "az" : "cn-north-7c", "count" : 1 } ] } ], "available" : [ { "flavor" : "modelarts.vm.cpu.4ud", "count" : 2, "azs" : [ { "az" : "cn-north-7c", "count" : 2 } ] } ] } } } 状态码: 400 Bad request { "error_code" : "ModelArts.50004000", "error_msg" : "Bad request" } 状态码: 404 Not Found。 { "error_code" : "ModelArts.50015001", "error_msg" : "pool not found" }
  • 响应参数 状态码: 200 表10 响应Body参数 参数 参数类型 描述 apiVersion String API版本。可选值如下: v2 kind String 资源类型。可选值如下: Pool:资源池 metadata PoolMetadata object 资源池的metadata信息。 spec PoolSpecModel object 资源池的期望信息。 status PoolStatus object 资源池的状态信息。 表11 PoolMetadata 参数 参数类型 描述 name String 系统自动生成的pool名称,相当于pool ID。 creationTimestamp String 时间戳,例如"2021-11-01T03:49:41Z"。 labels PoolMetaLabels object 资源池的标签信息。 annotations PoolMetaAnnotations object 资源池的注释信息。 表12 PoolMetaLabels 参数 参数类型 描述 os.modelarts/workspace.id String 工作空间id。 os.modelarts/name String 用户指定的pool名称。 os.modelarts/resource.id String 资源池的主资源id,通常提供给cbc使用。 os.modelarts/tenant.domain.id String 资源池的租户id,记录资源池创建在哪个租户账号下。 表13 PoolMetaAnnotations 参数 参数类型 描述 os.modelarts/description String 资源池的描述信息。 os.modelarts/billing.mode String 计费模式。可选值如下: 0:按需计费 1:包周期计费 os.modelarts/period.num String 包周期订购周期,比如2。 os.modelarts/period.type String 包周期订购类型。可选值如下: 2:月 3:年 4:小时 os.modelarts/auto.renew String 是否自动续费.可选值如下: 0:不自动续费,默认值 1:自动续费 os.modelarts/promotion.info String 用户在cbc选择的折扣信息。 os.modelarts/service.console.url String 订购订单支付完成后跳转的url地址。 os.modelarts/order.id String 订单id,包周期资源池创建或者计费模式变更的时候该参数必需。 os.modelarts/flavor.resource.ids String 每种规格对应的resourceId,主要和cbc交互使用。 os.modelarts/tms.tags String 创建的时候由用户指定的TMS标签。 表14 PoolSpecModel 参数 参数类型 描述 type String 资源池类型。可选值如下: Dedicate:物理资源池,独立的网络,支持网络打通,定制驱动,定制作业类型。 scope Array of strings 资源池支持的作业类型。至少选择一种,物理资源池支持全部选择。可选值如下: Train:训练作业 Infer:推理作业 Notebook:Notebook作业 resources Array of resources objects 资源池中的资源规格信列表,包括资源规格和相应规格的资源数量。 network network object 资源池网络参数。物理资源池时必选。 jobFlavors Array of strings 资源池支持的作业规格信息列表,内容为作业规格名称。 driver PoolDriver object 资源池的驱动信息。 controlMode Integer 资源池的受限状态。可选值如下: 0:代表不受限 1:转包周期受限 2:规格变更受限 4:服务受限 8:冻结 16:公安冻结(不可退订) 另外状态是可以叠加的,比如9代表转包周期受限+冻结状态。 表15 resources 参数 参数类型 描述 flavor String 资源规格,比如:modelarts.vm.gpu.tnt004。 count Integer 相应规格资源数量。 azs Array of PoolNodeAz objects az列表信息。 表16 PoolNodeAz 参数 参数类型 描述 az String az名称。 count Integer 指定az扩容时,指定az的节点数。 表17 network 参数 参数类型 描述 name String 网络名称;用户接口通过指定网络名称创建网络,系统会自动创建子网,用户无法创建子网。默认将创建在第一个子网下。 表18 PoolDriver 参数 参数类型 描述 gpuVersion String GPU驱动版本,物理资源池中含有GPU规格时可填,例如:"440.33"。 npuVersion String NPU驱动版本,物理资源池中含有ascend规格时可填,例如:"C78"。 updateStrategy String 驱动升级策略。可选值如下: force:强制升级,立即升级节点驱动,可能影响节点上正在运行的作业 idle:安全升级,待节点上没有作业运行时进行驱动升级 表19 PoolStatus 参数 参数类型 描述 phase String 资源池集群状态。可选值如下: Creating:创建中 Running:运行中 Abnormal:资源池不正常 Deleting:删除中 Error:资源池错误 message String 资源池处于当前状态的提示信息。 resources resources object 资源池中不同状态的资源量。 scope Array of scope objects 资源池业务状态信息。 driver driver object 资源池驱动信息。 parent String 资源池父节点名称,物理池为空。 root String 资源池根节点名称,物理池为自己的名称。 表20 resources 参数 参数类型 描述 creating PoolResourceFlavorCount object 状态为创建中状态的资源量。 available PoolResourceFlavorCount object 状态为可用状态的资源量。 abnormal PoolResourceFlavorCount object 状态为非正常状态的资源量。 deleting PoolResourceFlavorCount object 状态为删除中状态的资源量。 表21 PoolResourceFlavorCount 参数 参数类型 描述 flavor String 资源规格名称,比如:modelarts.vm.gpu.tnt004。 count Integer 规格保障使用量。 maxCount Integer 资源规格的弹性使用量,物理池该值和count相同。 azs Array of azs objects 资源所在的AZ的数量。 表22 azs 参数 参数类型 描述 az String AZ的名称。 count Integer AZ的资源数量。 表23 scope 参数 参数类型 描述 scopeType String 业务类型。可选值如下: Train:训练任务 Infer:推理任务 Notebook:Notebook作业 state String 业务状态。可选值如下: Enabling:启动中 Enabled:已启动 Disabling:关闭中 Disabled:已关闭 表24 driver 参数 参数类型 描述 gpu PoolDriverStatus object GPU驱动信息。 npu PoolDriverStatus object NPU驱动信息。 表25 PoolDriverStatus 参数 参数类型 描述 version String 当前驱动版本。 state String 当前驱动状态。可选值如下: Creating:创建中 Upgrading:升级中 Running:运行中 Abnormal:不正常 状态码: 400 表26 响应Body参数 参数 参数类型 描述 error_code String ModelArts错误码。 error_msg String 具体错误信息。 状态码: 404 表27 响应Body参数 参数 参数类型 描述 error_code String ModelArts错误码。 error_msg String 具体错误信息。
  • URI POST /v2/{project_id}/workflows/{workflow_id}/executions/{execution_id}/actions 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 用户项目ID。获取方法请参见获取项目ID和名称。 workflow_id 是 String 工作流的ID。 execution_id 是 String 工作流执行ID。
  • 响应示例 状态码: 201 OK { "created_at" : "2022-08-25T17:01:52.490825+08:00", "name" : "execution-005", "execution_id" : "4dd2a2f5-bde2-45dd-af6b-5e5d570118d1", "description" : "", "status" : "running", "workspace_id" : "0", "workflow_id" : "bd0ac50e-69b1-4d20-ae38-abb221084fc6", "workflow_name" : "workflow-service-infer", "steps_execution" : [ { "created_at" : "2022-08-25T17:01:52.500034+08:00", "uuid" : "54979c30-cc48-4eaa-8b0f-b6eb6e000bb5", "step_name" : "service_step", "step_title" : "service_step", "status" : "wait_inputs", "duration" : 1, "events" : [ "2022-08-25 17:01:53 change status from init to wait_inputs" ], "policy" : { } } ], "duration" : 1, "events" : [ "2022-08-25 17:01:53 step service_step change status from init to wait_inputs" ], "data_requirements" : [ { "name" : "si_placeholder1", "type" : "model_list", "delay" : true, "conditions" : [ { "attribute" : "model_name", "operator" : "equal", "value" : "model_test444444222222" } ], "used_steps" : [ "service_step" ] }, { "name" : "si_placeholder2", "type" : "model_list", "delay" : true, "conditions" : [ { "attribute" : "model_name", "operator" : "equal", "value" : "model_test444444222222" }, { "attribute" : "envs", "operator" : "equal", "value" : { "infer_address" : "$ref/consumptions/service_step/service_output/access_address" } } ], "used_steps" : [ "service_step2" ] } ], "parameters" : [ { "name" : "schedule_KZ27", "type" : "int", "format" : "schedule", "description" : "Set how long the deployed service will stop in hours, where -1 means the service will always run", "delay" : true, "used_steps" : [ "service_step", "service_step2" ] }, { "name" : "placeholder_name", "type" : "str", "value" : "model_test4444", "used_steps" : [ "service_step", "service_step2" ] } ], "policies" : { } }
  • URI POST /v2/{project_id}/workflows/{workflow_id}/executions/{execution_id}/step-executions/{step_execution_id}/actions 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 用户项目ID。获取方法请参见获取项目ID和名称。 workflow_id 是 String 工作流的ID。 execution_id 是 String 工作流执行ID。 step_execution_id 是 String 工作流的一次执行中一个节点的执行ID。
  • 请求示例 停止step POST https://{endpoint}/v2/{project_id}/workflows/{workflow_id}/executions/4dd2a2f5-bde2-45dd-af6b-5e5d570118d1/step_executions/255a1079-b00a-4c3a-8218-3458f7546b8d/actions { "action_name" : "stop" }
  • 响应示例 状态码: 201 OK { "created_at" : "2022-11-01T21:36:04.310635+08:00", "uuid" : "2f7ad04a-60cb-4f1c-96fd-dfc9cf96363b", "instance_id" : "{\"model_id\":\"6fe56a95-e7f1-4388-b207-c80684af0cb8\"}", "step_name" : "model_step", "step_title" : "model release", "status" : "completed", "duration" : 15, "inputs" : [ { "name" : "model_input", "type" : "obs", "data" : "$ref/data_requirements/model_input", "value" : { "object_type" : [ "DIRECTORY" ], "obs_url" : "/test-crq/train_output/" } } ], "outputs" : [ { "name" : "model_output", "type" : "model", "config" : { "model_id" : "6fe56a95-e7f1-4388-b207-c80684af0cb8" } } ], "properties" : { "model_name" : "lh-xh", "model_type" : "TensorFlow" }, "events" : [ "2022-11-01 21:36:05 change status from init to creating", "2022-11-01 21:36:09 change status from creating to created", "2022-11-01 21:36:09 change status from created to running", "2022-11-01 21:36:19 change status from running to completed" ], "policy" : { } }
  • 响应示例 状态码: 200 OK。 { "apiVersion" : "v2", "kind" : "PoolMetricsList", "items" : [ { "table" : { "allocated" : { "value" : { "cpu" : 5, "memory" : "15548Mi", "tnt004" : "1073m" }, "timestamp" : "2022-03-30T07:09:10Z", "window" : "1m" }, "capacity" : { "value" : { "cpu" : 16, "memory" : "64Gi", "tnt004" : 2 }, "maxValue" : { "cpu" : 16, "memory" : "64Gi", "tnt004" : 2 }, "timestamp" : "2022-03-30T07:09:10Z", "window" : "1m" } }, "metadata" : { "name" : "hougang-rse-pool" } } ] }
  • 响应参数 状态码: 200 表2 响应Body参数 参数 参数类型 描述 apiVersion String 资源版本。可选值如下: os.modelarts.xxxxx/v2 kind String 资源类型。可选值如下: PoolMetricsList items Array of MetricsItem objects 指标列表。 表3 MetricsItem 参数 参数类型 描述 table table object 资源列表。 metadata ResourceMetricsMetadata object 资源指标的元信息。 表4 table 参数 参数类型 描述 allocated Allocated object 资源已分配量。 capacity Capacity object 资源总容量。 表5 Allocated 参数 参数类型 描述 value Value object 资源量。 timestamp String UTC时间,格式yyyy-MM-dd'T'HH:mm:ss'Z'。 window String 统计间隔,1s表示1秒,1m表示1分钟,1h为1小时。 表6 Capacity 参数 参数类型 描述 value Value object 资源量。 maxValue Value object 最大弹性资源量。 timestamp String UTC时间,格式yyyy-MM-dd'T'HH:mm:ss'Z'。 window String 统计间隔,1s表示1秒,1m表示1分钟,1h为1小时。 表7 Value 参数 参数类型 描述 cpu String cpu量,即计算资源量。 memory String 内存。 tnt004 String GPU卡的数量。 表8 ResourceMetricsMetadata 参数 参数类型 描述 name String 资源指标的名称。 labels Object 资源指标的标签信息。
  • URI POST /v2/{project_id}/training-jobs/{training_job_id}/autosearch-trial-earlystop/{trial_id} 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 用户项目ID。获取方法请参见获取项目ID和名称。 training_job_id 是 String 训练作业ID。 trial_id 是 String 超参搜索的trial_id。
  • 请求示例 如下以training_job_id为e346206c-6fde-4c33-9dcd-55be17858ceb的作业为例,提前停止trial_id为50093e6c的trial。 POST https://endpoint/v2/{project_id}/training-jobs/e346206c-6fde-4c33-9dcd-55be17858ceb/autosearch-trial-earlystop/50093e6c
  • 响应示例 状态码: 201 定时调度信息。 { "created_at" : "2022-11-02T09:40:52.714656752+08:00", "uuid" : "fa4ac58e-088b-4fd7-ae8c-b36fee50f884", "type" : "time", "content" : { "cron" : "0 0 0 * * Thu", "method" : "fixed" }, "action" : "run", "policies" : { "on_failure" : "retry", "on_running" : "cancel" }, "workflow_id" : "f1642618-43eb-4ab1-a0b1-9cc584182c60", "user_id" : "75540c679ab44074bc100022d8a4b204", "enable" : true }
  • 请求示例 创建Workflow定时调度。设置类型为“time”,动作为“run”,调度策略on_failure为“retry”、on_running为“cancel”。 POST https://{endpoint}/v2/{project_id}/workflows/{workflow_id}/schedules { "type" : "time", "action" : "run", "content" : { "cron" : "0 0 0 * * Thu", "method" : "fixed" }, "policies" : { "on_failure" : "retry", "on_running" : "cancel" } }
  • 响应示例 状态码: 200 ok { "total" : 8, "count" : 8, "limit" : 50, "offset" : 0, "group_by" : "", "items" : { "header" : [ "", "done", "pid", "config", "trial_id", "training_iteration", "time_total_s", "worker_index", "reward_attr", "status", "acc", "loss", "best_reward" ], "data" : [ [ "0", "True", "314", { "batch_size" : 32, "learning_rate" : 0.05512301741232006, "trial_index" : 0, "param/batch_size" : 32, "param/learning_rate" : 0.05512301741232006 }, "ae544174", "2", "19.477163314819336", "", "0.0625", "TERMINATED", "0.0625", "tensor(0.0754, device='cuda:0', requires_grad=True)", "0.0625" ], [ "1", "True", "315", { "batch_size" : 32, "learning_rate" : 0.0785570955603036, "trial_index" : 1, "param/batch_size" : 32, "param/learning_rate" : 0.0785570955603036 }, "ae548666", "2", "3.601897954940796", "", "0.0", "TERMINATED", "0.0", "tensor(0.0760, device='cuda:0', requires_grad=True)", "0.0" ], [ "2", "True", "312", { "batch_size" : 16, "learning_rate" : 0.04015387428829642, "trial_index" : 2, "param/batch_size" : 16, "param/learning_rate" : 0.04015387428829642 }, "ae54c0ea", "2", "3.5978384017944336", "", "0.1875", "TERMINATED", "0.1875", "tensor(0.1469, device='cuda:0', requires_grad=True)", "0.1875" ], [ "3", "True", "313", { "batch_size" : 32, "learning_rate" : 0.0340820322164706, "trial_index" : 3, "param/batch_size" : 32, "param/learning_rate" : 0.0340820322164706 }, "ae5503c0", "2", "3.641200304031372", "", "0.25", "TERMINATED", "0.25", "tensor(0.0716, device='cuda:0', requires_grad=True)", "0.25" ], [ "4", "True", "470", { "batch_size" : 32, "learning_rate" : 0.03656488928171769, "trial_index" : 4, "param/batch_size" : 32, "param/learning_rate" : 0.03656488928171769 }, "bef46590", "2", "3.6120550632476807", "", "0.09375", "TERMINATED", "0.09375", "tensor(0.0740, device='cuda:0', requires_grad=True)", "0.09375" ], [ "5", "True", "499", { "batch_size" : 32, "learning_rate" : 0.008413169003970163, "trial_index" : 5, "param/batch_size" : 32, "param/learning_rate" : 0.008413169003970163 }, "bef578f4", "2", "3.6379287242889404", "", "0.1875", "TERMINATED", "0.1875", "tensor(0.0723, device='cuda:0', requires_grad=True)", "0.1875" ], [ "6", "True", "528", { "batch_size" : 64, "learning_rate" : 0.06297447200613912, "trial_index" : 6, "param/batch_size" : 64, "param/learning_rate" : 0.06297447200613912 }, "bef5c584", "2", "3.711118221282959", "", "0.046875", "TERMINATED", "0.046875", "tensor(0.0381, device='cuda:0', requires_grad=True)", "0.046875" ], [ "7", "True", "557", { "batch_size" : 32, "learning_rate" : 0.04426479392014276, "trial_index" : 7, "param/batch_size" : 32, "param/learning_rate" : 0.04426479392014276 }, "bef60684", "2", "3.6971280574798584", "", "0.0625", "TERMINATED", "0.0625", "tensor(0.0778, device='cuda:0', requires_grad=True)", "0.0625" ] ] } }
  • URI GET /v2/{project_id}/training-jobs/{training_job_id}/autosearch-trials 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 用户项目ID。获取方法请参见获取项目ID和名称。 training_job_id 是 String 训练作业ID。 project_id 是 String 用户项目ID。获取方法请参见获取项目ID和名称。 training_job_id 是 String 训练作业ID。 表2 Query参数 参数 是否必选 参数类型 描述 limit 否 Integer 返回的数据条目数。 offset 否 Integer 数据条目偏移量。
  • 响应示例 状态码: 201 OK { "created_at" : "2022-10-31T21:49:08.9729616+08:00", "package_id" : "33820375-d1bf-4751-93fe-9d0ee7b6829e", "status" : "available", "pool_id" : "pool-9ad2-04f258c84780d5a52f3bc00dc15aa5e7", "service_id" : "f4e78e17-5af4-4b65-b677-382d0d2e1b84", "workflow_id" : "b0f91eb4-431e-4acd-8d70-ef081435a6d0", "order" : { "id" : "CS2210201956MBE5Z", "sku" : { "code" : "modelarts.dplan.workflow", "period" : "day", "queries_limit" : 1000, "price" : 4 }, "sku_count" : 1 }, "consume_limit" : 1000 }
  • 请求示例 给指定的工作流购买资源包 POST https://{endpoint}/v2/{project_id}/workflows{workflow_id}/service/packages { "pool_id" : "pool-9ad2-04f258c84780d5a52f3bc00dc15aa5e7", "order" : { "id" : "CS2210201956MBE5Z", "sku" : { "code" : "modelarts.dplan.workflow", "period" : "day", "queries_limit" : 1000, "price" : 10 }, "sku_count" : 1 } }
  • 请求参数 表2 请求Body参数 参数 是否必选 参数类型 描述 status 否 String 服务包状态。 pool_id 是 String 资源池ID。 service_id 否 String 在线服务ID。 workflow_id 否 String 工作流ID。 order 是 WorkflowPoolOrder object 订阅信息。 consume_limit 否 Integer 消费限制。 current_consume 否 Integer 当前消费。 current_date 否 String 当前时间。 limit_enable 否 Boolean 限制开关。 created_at 否 String 创建时间。 package_id 否 String 订阅包的UUID。创建时不需要填,由后台自动生成。 表3 WorkflowPoolOrder 参数 是否必选 参数类型 描述 id 否 String 订阅ID。 sku 是 SkuInfo object 订阅计费信息。 sku_count 是 String 订阅计数。 表4 SkuInfo 参数 是否必选 参数类型 描述 code 否 String 计费码。 period 否 String 计费时期。 queries_limit 否 Long 查询次数。 price 否 Float 价格。
  • 响应参数 状态码: 201 表5 响应Body参数 参数 参数类型 描述 status String 服务包状态。 pool_id String 资源池ID。 service_id String 在线服务ID。 workflow_id String 工作流ID。 order WorkflowPoolOrder object 订阅信息。 consume_limit Integer 消费限制。 current_consume Integer 当前消费。 current_date String 当前时间。 limit_enable Boolean 限制开关。 created_at String 创建时间。 package_id String 订阅包的UUID。创建时不需要填,由后台自动生成。 表6 WorkflowPoolOrder 参数 参数类型 描述 id String 订阅ID。 sku SkuInfo object 订阅计费信息。 sku_count String 订阅计数。 表7 SkuInfo 参数 参数类型 描述 code String 计费码。 period String 计费时期。 queries_limit Long 查询次数。 price Float 价格。
  • URI GET /v2/{project_id}/workflows/{workflow_id}/schedules/{schedule_id} 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 用户项目ID。获取方法请参见获取项目ID和名称。 workflow_id 是 String 工作流的ID。 schedule_id 是 String 工作流调度信息ID。
  • 响应示例 状态码: 200 工作流调度信息 { "created_at" : "2022-11-02T09:40:52.714657+08:00", "uuid" : "fa4ac58e-088b-4fd7-ae8c-b36fee50f884", "type" : "time", "content" : { "cron" : "0 0 0 * * Thu", "method" : "fixed" }, "action" : "run", "policies" : { "on_failure" : "retry", "on_running" : "cancel" }, "workflow_id" : "f1642618-43eb-4ab1-a0b1-9cc584182c60", "user_id" : "75540c679ab44074bc100022d8a4b204", "enable" : true }
  • 响应示例 状态码: 200 OK { "created_at" : "2022-09-09T11:28:29.639658+08:00", "workflow_id" : "6b596c75-fe1f-440b-be83-fe5e240133c4", "name" : "graph-test-has-condition-step", "description" : "", "user_name" : "zuoping", "workspace_id" : "0", "steps" : [ { "created_at" : "2022-09-09T11:28:29.6438+08:00", "name" : "condition_step_test", "title" : "condition_step_test", "description" : "", "type" : "condition", "conditions" : [ { "type" : "==", "left" : "$ref/parameters/is_true", "right" : true } ], "if_then_steps" : [ "training_job1" ], "else_then_steps" : [ "training_job2" ], "policy" : { } }, { "created_at" : "2022-09-09T11:28:29.646244+08:00", "name" : "training_job1", "title" : "labeling", "description" : "", "type" : "job", "inputs" : [ { "name" : "data_url", "type" : "obs", "data" : "$ref/data/a2ff296da618452daa8243399f06db8e" } ], "outputs" : [ { "name" : "train_url", "type" : "obs", "config" : { "obs_url" : "/test-lh/test-metrics/" } }, { "name" : "service-link", "type" : "service_content", "config" : { "config_file" : "$ref/parameters/service_config1" } } ], "properties" : { "algorithm" : { "id" : "21ef85a8-5e40-4618-95ee-aa48ec224b43", "parameters" : [ ] }, "kind" : "job", "metadata" : { "name" : "workflow-b0b9fa4c06254b2ebb0e48ba1f7a916c" }, "spec" : { "resource" : { "flavor_id" : "$ref/parameters/train_spec", "node_count" : 1, "policy" : "regular" } } }, "depend_steps" : [ "condition_step_test" ], "policy" : { } }, { "created_at" : "2022-09-09T11:28:29.648868+08:00", "name" : "training_job2", "title" : "labeling", "description" : "", "type" : "job", "inputs" : [ { "name" : "data_url", "type" : "obs", "data" : "$ref/data/f78e46676a454ccdacb9907f589f8d67" } ], "outputs" : [ { "name" : "train_url", "type" : "obs", "config" : { "obs_url" : "/test-lh/test-metrics/" } }, { "name" : "service-link", "type" : "service_content", "config" : { "config_file" : "$ref/parameters/service_config2" } } ], "properties" : { "algorithm" : { "id" : "21ef85a8-5e40-4618-95ee-aa48ec224b43", "parameters" : [ ] }, "kind" : "job", "metadata" : { "name" : "workflow-4a4317eb49ad4370bd087e6b726d84cf" }, "spec" : { "resource" : { "flavor_id" : "$ref/parameters/train_spec", "node_count" : 1, "policy" : "regular" } } }, "depend_steps" : [ "condition_step_test" ], "policy" : { } }, { "created_at" : "2022-09-09T11:28:29.649982+08:00", "name" : "training_job3", "title" : "labeling", "description" : "", "type" : "job", "inputs" : [ { "name" : "data_url", "type" : "obs", "data" : "$ref/data/dee65054c96b4bf3b7ac98c0709f9ae0" } ], "outputs" : [ { "name" : "train_url", "type" : "obs", "config" : { "obs_url" : "/test-lh/test-metrics/" } }, { "name" : "service-link", "type" : "service_content", "config" : { "config_file" : "$ref/parameters/service_config3" } } ], "properties" : { "algorithm" : { "id" : "21ef85a8-5e40-4618-95ee-aa48ec224b43", "parameters" : [ ] }, "kind" : "job", "metadata" : { "name" : "workflow-3039303b3ae14f3e9eed416ba6361b1f" }, "spec" : { "resource" : { "flavor_id" : "$ref/parameters/train_spec", "node_count" : 1, "policy" : "regular" } } }, "depend_steps" : [ "training_job1", "training_job2" ], "policy" : { } } ], "labels" : [ "subgraph" ], "data" : [ { "name" : "a2ff296da618452daa8243399f06db8e", "type" : "obs", "value" : { "obs_url" : "/test-lh/test-metrics/" }, "used_steps" : [ "training_job1" ] }, { "name" : "f78e46676a454ccdacb9907f589f8d67", "type" : "obs", "value" : { "obs_url" : "/test-lh/test-metrics/" }, "used_steps" : [ "training_job2" ] }, { "name" : "dee65054c96b4bf3b7ac98c0709f9ae0", "type" : "obs", "value" : { "obs_url" : "/test-lh/test-metrics/" }, "used_steps" : [ "training_job3" ] } ], "parameters" : [ { "name" : "is_true", "type" : "bool", "delay" : true, "value" : true, "used_steps" : [ "condition_step_test" ] }, { "name" : "train_spec", "type" : "str", "format" : "flavor", "description" : "training specification", "default" : "modelarts.vm.cpu.8u", "used_steps" : [ "training_job1", "training_job2", "training_job3" ] }, { "name" : "service_config1", "type" : "str", "default" : "/test-lh/test-metrics/metrics.json", "used_steps" : [ "training_job1" ] }, { "name" : "service_config2", "type" : "str", "default" : "/test-lh/test-metrics/metrics.json", "used_steps" : [ "training_job2" ] }, { "name" : "service_config3", "type" : "str", "default" : "/test-lh/test-metrics/metrics.json", "used_steps" : [ "training_job3" ] } ], "sub_graphs" : [ { "name" : "stage_A", "steps" : [ "training_job1", "training_job2" ] } ], "policy" : { }, "last_modified_at" : "2022-10-28T16:49:13.056726+08:00", "source_workflow_id" : "05427e9d-42ac-4816-bd45-360c1bfd780b", "latest_execution" : { "execution_id" : "43e317e2-34b0-4348-9c1b-08d3083512e1", "created_at" : "2022-10-28T16:49:03.894771+08:00", "status" : "completed", "duration" : 209 }, "run_count" : 2, "param_ready" : true }
  • URI GET /v2/{project_id}/workflows/{workflow_id} 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 用户项目ID。获取方法请参见获取项目ID和名称。 workflow_id 是 String 工作流的ID。 表2 Query参数 参数 是否必选 参数类型 描述 workspace_id 否 String 工作空间ID,用于过滤具体工作空间下的条目。
  • 响应参数 状态码: 400 表4 响应Body参数 参数 参数类型 描述 error_code String ModelArts错误码。 error_msg String 具体错误信息。 状态码: 401 表5 响应Body参数 参数 参数类型 描述 error_code String ModelArts错误码。 error_msg String 具体错误信息。 状态码: 403 表6 响应Body参数 参数 参数类型 描述 error_code String ModelArts错误码。 error_msg String 具体错误信息。 状态码: 404 表7 响应Body参数 参数 参数类型 描述 error_code String ModelArts错误码。 error_msg String 具体错误信息。
  • 响应示例 状态码: 200 ok { "search_algo_count" : 3, "search_algo_list" : [ { "name" : "bayes_opt_search", "params" : [ { "key" : "kind", "value" : "ucb", "type" : "String" }, { "key" : "kappa", "value" : "2.5", "type" : "Float" }, { "key" : "xi", "value" : "0.0", "type" : "Float" }, { "key" : "num_samples", "value" : "20", "type" : "Integer" }, { "key" : "seed", "value" : "1", "type" : "Integer" } ], "description" : "Hyperparameter search using Gaussian process." }, { "name" : "tpe_search", "params" : [ { "key" : "gamma", "value" : "0.25", "type" : "Float" }, { "key" : "n_initial_points", "value" : "20", "type" : "Integer" }, { "key" : "num_samples", "value" : "20", "type" : "Integer" }, { "key" : "seed", "value" : "1", "type" : "Integer" } ], "description" : "Hyperparameter search using the tree-structured Parzen estimator algorithm." }, { "name" : "anneal_search", "params" : [ { "key" : "avg_best_idx", "value" : "2.0", "type" : "Float" }, { "key" : "shrink_coef", "value" : "0.1", "type" : "Float" }, { "key" : "num_samples", "value" : "20", "type" : "Integer" }, { "key" : "seed", "value" : "1", "type" : "Integer" } ], "description" : "Hyperparameter search using simulated annealing algorithm." } ] }
  • 响应参数 状态码: 200 表2 响应Body参数 参数 参数类型 描述 search_algo_count Integer 超参搜索算法的个数。 search_algo_list Array of search_algo_list objects 所有超参搜索算法的列表。 表3 search_algo_list 参数 参数类型 描述 name String 超参搜索算法的名称。 params Array of params objects 超参搜索算法的参数列表。 description String 超参搜索算法的描述。 表4 params 参数 参数类型 描述 key String 超参搜索算法的参数名称。 value String 超参搜索算法的参数取值。 type String 超参搜索算法的参数类型。
共100000条