华为云用户手册

  • URI POST /v2/{project_id}/training-jobs/{training_job_id}/tasks/{task_id}/save-image-job 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 用户项目ID。获取方法请参见获取项目ID和名称。 training_job_id 是 String 训练作业ID。 task_id 是 String 训练作业的任务名称。可从训练作业详情中的status.tasks字段中获取。
  • 请求示例 如下以创建uuid为2cd88daa-31a4-40a8-a58f-d186b0e93e4f的训练作业对应worker-0镜像保存任务为例。 POST https://endpoint/v2/{project_id}/training-jobs/2cd88daa-31a4-40a8-a58f-d186b0e93e4f/tasks/worker-0/save-image-job { "name" : "imagesave", "namespace" : "dev", "tag" : 0.1, "description" : "hello world!" }
  • 响应参数 状态码: 201 表3 响应Body参数 参数 参数类型 描述 name String 镜像名称,长度限制512个字符,支持小写字母、数字、中划线、下划线和点。 namespace String 镜像所属组织,可以在SWR控制台“组织管理”创建和查看。 tag String 镜像tag,长度限制64个字符, 支持大小写字母、数字、中划线、下划线和点。 description String 该镜像所对应的描述信息,长度限制512个字符。 status String 镜像状态。枚举值如下: INIT:初始化。 CREATING:镜像保存中,此时训练作业不可用。 CREATE_FAILED:镜像保存失败。 ACTIVE:镜像保存成功,保存的镜像可以在SWR控制台查看,同时可以基于保存的镜像创建训练作业。 message String 镜像保存操作过程中,构建信息展示。 create_time Long 镜像创建的时间,UTC毫秒。
  • 请求参数 表2 请求Body参数 参数 是否必选 参数类型 描述 name 否 String 镜像名称,长度限制512个字符,支持小写字母、数字、中划线、下划线和点。 namespace 否 String 镜像所属组织,可以在SWR控制台“组织管理”创建和查看。 tag 否 String 镜像tag,长度限制64个字符, 支持大小写字母、数字、中划线、下划线和点。 description 否 String 该镜像所对应的描述信息,长度限制512个字符。 status 否 String 镜像状态。枚举值如下: INIT:初始化。 CREATING:镜像保存中,此时训练作业不可用。 CREATE_FAILED:镜像保存失败。 ACTIVE:镜像保存成功,保存的镜像可以在SWR控制台查看,同时可以基于保存的镜像创建训练作业。 message 否 String 镜像保存操作过程中,构建信息展示。 create_time 否 Long 镜像创建的时间,UTC毫秒。
  • URI GET /v2/{project_id}/workflows/{workflow_id}/executions 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 用户项目ID。获取方法请参见获取项目ID和名称。 workflow_id 是 String 工作流的ID。 表2 Query参数 参数 是否必选 参数类型 描述 workspace_id 否 String 工作空间ID,用于过滤具体工作空间下的条目。 limit 否 String 分页参数limit,表示单次查询的条目数上限。假如要查询20~29条记录,offset为20,limit为10。 sort_by 否 String 排序依据字段,例如sort_by=create_time,则表示以条目的创建时间进行排序。 offset 否 String 分页参数offset,表示单次查询的条目偏移数量。假如要查询20~29条记录,offset为20,limit为10。 labels 否 String 执行记录标签。 status 否 String 执行记录状态。 scene_id 否 String 场景ID。 order 否 String 排序的方式。该字段必须与sort_by同时使用。 缺省值: desc 枚举值: asc:表示升序排列, desc:降序排列。
  • 响应示例 状态码: 200 OK { "total" : 1, "count" : 1, "items" : [ { "created_at" : "2022-06-17T17:08:16.91019+08:00", "name" : "execution-064", "execution_id" : "918cd9bd-62dd-4179-b5f0-773dd7184a56", "description" : "", "status" : "completed", "workspace_id" : "0", "workflow_id" : "f1642618-43eb-4ab1-a0b1-9cc584182c60", "workflow_name" : "workflow_model_service_no_modify_xiahou_copy", "steps_execution" : [ { "created_at" : "2022-06-17T17:08:16.920281+08:00", "uuid" : "d6148a4a-4a5e-47a3-bc90-3183905b4941", "instance_id" : "{\"model_id\":\"253aba02-4bd6-4f64-8d37-66022ae7af4d\"}", "step_name" : "model_step", "step_title" : "model release", "status" : "completed", "duration" : 16, "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" : "253aba02-4bd6-4f64-8d37-66022ae7af4d" } } ], "properties" : { "model_name" : "lh-xh", "model_type" : "TensorFlow" }, "events" : [ "2022-06-17 17:08:17 change status from init to creating", "2022-06-17 17:08:19 change status from creating to created", "2022-06-17 17:08:20 change status from created to running", "2022-06-17 17:08:33 change status from running to completed" ], "policy" : { } }, { "created_at" : "2022-06-17T17:08:33.038184+08:00", "uuid" : "b34b2b54-eb70-4c7f-a92d-05f849d8c39a", "instance_id" : { "type" : "deploy", "service_id" : "81f22d60-5488-4e3d-bba9-08c812ae84b0", "status" : "", "update_time" : 0 }, "step_name" : "service_step", "step_title" : "service install", "status" : "completed", "duration" : 83430, "inputs" : [ { "name" : "service_input", "type" : "model_list", "data" : "$ref/data_requirements/service_model", "value" : { "model_list" : [ { "envs" : { }, "instance_count" : 1, "model_id" : "253aba02-4bd6-4f64-8d37-66022ae7af4d", "model_name" : "lh-xh", "model_version" : "0.0.62", "specification" : "modelarts.vm.ai1", "weight" : 100 } ] } } ], "outputs" : [ { "name" : "service_output", "type" : "service", "config" : { "service_id" : "81f22d60-5488-4e3d-bba9-08c812ae84b0" } } ], "properties" : { "infer_type" : "real-time", "schedule" : -1 }, "events" : [ "2022-06-17 17:08:34 change status from init to wait_inputs", "2022-06-18 16:16:58 change status from wait_inputs to creating", "2022-06-18 16:17:01 change status from creating to created", "2022-06-18 16:17:02 change status from created to running", "2022-06-18 16:19:03 change status from running to completed" ], "policy" : { } } ], "duration" : 11852428, "events" : [ "2022-06-17 17:08:17 step model_step change status from init to creating", "2022-06-17 17:08:19 step model_step change status from creating to created", "2022-06-17 17:08:20 step model_step change status from created to running", "2022-06-17 17:08:33 step model_step change status from running to completed", "2022-06-17 17:08:34 step service_step change status from init to wait_inputs", "2022-06-18 16:16:58 step service_step change status from wait_inputs to creating", "2022-06-18 16:17:01 step service_step change status from creating to created", "2022-06-18 16:17:02 step service_step change status from created to running", "2022-06-18 16:19:03 step service_step change status from running to completed" ], "data_requirements" : [ { "name" : "model_input", "type" : "obs", "conditions" : [ { "attribute" : "object_type", "operator" : "equal", "value" : "directory" } ], "value" : { "object_type" : [ "DIRECTORY" ], "obs_url" : "/test-crq/train_output/" }, "used_steps" : [ "model_step" ] }, { "name" : "service_model", "type" : "model_list", "delay" : true, "conditions" : [ { "attribute" : "model_name", "operator" : "equal", "value" : "lh-xh" } ], "value" : { "model_list" : [ { "envs" : { }, "instance_count" : 1, "model_id" : "253aba02-4bd6-4f64-8d37-66022ae7af4d", "model_name" : "lh-xh", "model_version" : "0.0.62", "specification" : "modelarts.vm.ai1", "weight" : 100 } ] }, "used_steps" : [ "service_step" ] } ], "parameters" : [ { "name" : "schedule_d5sm", "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, "value" : -1, "used_steps" : [ "service_step" ] } ], "policies" : { } } ] }
  • 响应示例 状态码: 200 OK { "description" : "api-test", "feature" : "NOTEBOOK", "flavor" : "modelarts.vm.cpu.2u", "id" : "f9937afa-4451-42db-a76b-72d624749f66", "image" : { "description" : "description", "id" : "e1a07296-22a8-4f05-8bc8-e936c8e54090", "name" : "notebook2.0-mul-kernel-cpu-cp36", "swr_path" : "swr.xxxxx.com/atelier/notebook2.0-mul-kernel-cpu-cp36:3.3.2-release_v1", "tag" : "3.3.2-release_v1", "type" : "BUILD_IN" }, "lease" : { "create_at" : 1638841744515, "duration" : 6327212, "enable" : true, "type" : "TIMING", "update_at" : 1638844471727 }, "name" : "notebooks_test", "status" : "STARTING", "token" : "5cc60e8b-8772-7690-efd6-a5874ca387c0", "url" : "https://authoring-modelarts-xxxxx.xxxxx.com/f9937afa-4451-42db-a76b-72d624749f66/lab", "volume" : { "category" : "EFS", "ownership" : "MANAGED", "mount_path" : "/home/ma-user/work/", "capacity" : 50 }, "workspace_id" : "0" }
  • URI POST /v1/{project_id}/notebooks/{id}/start 表1 路径参数 参数 是否必选 参数类型 描述 id 是 String Notebook实例ID。 project_id 是 String 用户项目ID,获取方法请参见获取项目ID和名称。 表2 Query参数 参数 是否必选 参数类型 描述 duration 否 Long 启动后运行时长(单位:毫秒)。 type 否 String 自动停止类别,默认为timing。
  • 请求参数 表2 请求Body参数 参数 是否必选 参数类型 描述 created_at 否 String 创建时间。 subscription_id 否 String 订阅ID,唯一性标识。创建订阅时,后台自动生成。 topic_urns 是 Array of strings 订阅的主题。 entity 否 String 订阅的主体。 events 否 Array of strings 订阅的事件。
  • 请求示例 创建消息订阅。设置订阅的主题为“fengbin26”,订阅的主体为“238947895793875835893490”,订阅的事件为“[ "*:failed,completed", "job_step:stop" ]”。订阅Workflow失败、完成和job_step节点停止三个事件,发生这三个事件时,会有消息提醒。 POST https://{endpoint}/v2/{project_id}/workflows/{workflow_id}/subscriptions { "topic_urns" : [ "fengbin26" ], "entity" : "238947895793875835893490", "events" : [ "*:failed,completed", "job_step:stop" ] }
  • 响应示例 状态码: 201 OK { "created_at" : "2022-11-24T17:30:48.958322+08:00", "subscription_id" : "42e8a77a-512e-4d0e-a56e-4b003db82577", "topic_urns" : [ "fengbin26" ], "entity" : "238947895793875835893490", "events" : [ "*:failed,completed", "job_step:stop" ] }
  • 响应参数 状态码: 200 表2 响应Body参数 参数 参数类型 描述 tags Array of CombineTmsTags objects 标签的融合结构,相同key合并。 表3 CombineTmsTags 参数 参数类型 描述 key String 标签的key。 values Array of strings 相同key的标签value合并后的列表。 状态码: 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 具体错误信息。
  • 响应示例 状态码: 200 ok { "kind" : "job", "metadata" : { "id" : "3faf5c03-aaa1-4cbe-879d-24b05d997347", "name" : "trainjob--py14_mem06-108", "description" : "", "create_time" : 1636447346315, "workspace_id" : "0", "user_name" : "" }, "status" : { "phase" : "Abnormal", "secondary_phase" : "CreateFailed", "duration" : 0, "start_time" : 0, "node_count_metrics" : [ [ 1636447746000, 0 ], [ 1636447755000, 0 ], [ 1636447756000, 0 ] ], "tasks" : [ "worker-0" ], "running_records" : [ { "start_at" : 1701327093, "end_at" : 1701322341, "start_type" : "init_or_rescheduled", "end_recover" : "job_reschedule", "end_reason" : "exit with 127", "end_related_task" : "worker-2", "end_recover_before_downgrade" : "npu_proc_restart" }, { "start_at" : 1701323345, "end_at" : 1701325432, "start_type" : "init_or_rescheduled", "end_reason" : "job completed" } ] }, "algorithm" : { "code_dir" : "obs://test/economic_test/py_minist/", "boot_file" : "obs://test/economic_test/py_minist/minist_common.py", "inputs" : [ { "name" : "data_url", "local_dir" : "/home/ma-user/modelarts/inputs/data_url_0", "remote" : { "obs" : { "obs_url" : "/test/data/py_minist/" } } } ], "outputs" : [ { "name" : "train_url", "local_dir" : "/home/ma-user/modelarts/outputs/train_url_0", "remote" : { "obs" : { "obs_url" : "/test/train_output/" } } } ], "engine" : { "engine_id" : "pytorch-cp36-1.4.0-v2", "engine_name" : "PyTorch", "engine_version" : "PyTorch-1.4.0-python3.6-v2" } }, "spec" : { "resource" : { "flavor_id" : "modelarts.vm.pnt1.large.eco", "node_count" : 1, "flavor_detail" : { "flavor_type" : "GPU", "billing" : { "code" : "modelarts.vm.gpu.pnt1.eco", "unit_num" : 1 }, "flavor_info" : { "cpu" : { "arch" : "x86", "core_num" : 8 }, "gpu" : { "unit_num" : 1, "memory" : "8GB" }, "memory" : { "size" : 64, "unit" : "GB" } } } } } }
  • URI GET /v2/{project_id}/workflows/{workflow_id}/subscriptions/{subscription_id} 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 用户项目ID。获取方法请参见获取项目ID和名称。 workflow_id 是 String 工作流的ID。 subscription_id 是 String 工作流的消息订阅ID。
  • 响应示例 状态码: 200 修改工作空间配额成功的响应参数。 { "quotas" : [ { "max_quota" : 60000, "update_time" : 1574339372000, "resource" : "exemlProject.gpu_duration", "quota" : 20, "min_quota" : -1, "name_cn" : "自动学习(图像分类、物体检测、声音分类)训练时长", "unit_cn" : "分钟", "name_en" : "ExeML training duration (image classification, object detection, and sound classification)", "unit_en" : "minute" } ] }
  • 响应参数 状态码: 200 表5 响应Body参数 参数 参数类型 描述 quotas Array of WorkspaceQuotasUpdateResponse objects 工作空间配额数据。 表6 WorkspaceQuotasUpdateResponse 参数 参数类型 描述 max_quota Integer 配额允许设置的最大值。 update_time Integer 最后修改时间,UTC。如用户未修改过该资源配额,则该值默认为该工作空间的创建时间。 resource String 资源的唯一标识。 quota Integer 当前配额值。配额值为-1代表不限制配额。 min_quota Integer 配额允许设置的最小值。 name_cn String 配额名称(中文)。 unit_cn String 数量单位(中文)。 name_en String 工作空间ID,系统生成的32位UUID,不带橫线。默认的工作空间id为'0'。 unit_en String 数量单位(英文)。
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 表3 请求Body参数 参数 是否必选 参数类型 描述 quotas 是 Array of quotas objects 工作空间配额数据。 表4 quotas 参数 是否必选 参数类型 描述 resource 是 String 资源标识。 quota 是 Integer 要修改的配额值。配额值为正整数或-1,-1代表不限制配额。配额值范围不能超过配额的最大值与最小值。可通过调用查询工作空间配额接口查询配额的最大值。
  • 请求示例 DELETE https://endpoint/v2/{project_id }/modelarts-trainJob/{training_job_id}/tags/delete { "tags" : [ { "key" : "111", "value" : "v2" }, { "key" : "k3", "value" : "v2" } ] }
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 total_count Integer 工作空间的总数。 count Integer 此次请求返回的工作空间个数。 workspaces Array of WorkspaceResponse objects workspace属性列表。 表5 WorkspaceResponse 参数 参数类型 描述 owner String 创建者名称。 auth_type String 授权类型。默认值为PUBLIC。 PUBLIC:租户内部公开访问。 PRIVATE:仅创建者和主账号可访问。 INTERNAL:创建者、主账号、指定IAM子账号可访问,需要与grants参数配合使用。 enterprise_project_id String 企业项目ID。 update_time Integer 最后修改时间,UTC。 create_time Integer 创建时间,UTC。 enterprise_project_name String 企业项目名称。 name String 工作空间名称。 description String 工作空间描述。 id String 工作空间ID,系统生成的32位UUID,不带橫线。默认的工作空间id为'0'。 status String 工作空间状态。 CREATE_FAILED:创建失败。 NORMAL:状态正常。 DELETING:正在删除。 DELETE_FAILED:删除失败。 status_info String 状态描述,默认为空。该字段会补充显示状态的详细信息。如删除失败时,可通过该字段查看删除失败的原因。
  • 响应示例 状态码: 200 查询工作空间列表成功的响应参数。 { "total_count" : 10, "count" : 1, "workspaces" : [ { "id" : 0, "name" : "default", "description" : "", "owner" : "testUser", "enterprise_project_id" : "***b0091-887f-4839-9929-cbc884f1e***", "enterprise_project_name" : "default", "auth_type" : "public", "create_time" : 1460000010000, "update_time" : 1460000010000, "status" : "NORMAL", "status_info" : "" } ] }
  • URI GET /v1/{project_id}/workspaces 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 用户项目ID。获取方法请参见获取项目ID和名称。 表2 Query参数 参数 是否必选 参数类型 描述 offset 否 Integer 分页列表的起始页,默认为'0'。 limit 否 Integer 指定每一页返回的最大条目数,默认为'1000'。 sort_by 否 String 指定排序字段,可选'name'、'update_time'、'status',默认是'name'。 order 否 String 可选值。'asc'为递增排序。'desc'为递减排序,默认为'desc'。 enterprise_project_id 否 String 企业项目id,指定此参数会只返回该企业项目id下的工作空间。默认显示所有工作空间。 name 否 String 工作空间名称查询参数,指定此参数会模糊查询该名称的工作空间。默认显示所有工作空间。 filter_accessible 否 Boolean 该参数用于筛选可访问的工作空间。指定该参数为true则会筛选掉当前用户无权限访问的工作空间。该参数默认为false,既为显示所有工作空间。
  • 响应示例 状态码: 201 ok { "kind" : "job", "metadata" : { "id" : "425b7087-83de-49ed-9e40-5bb642be956f", "name" : "TestModelArtsJob", "description" : "This is a ModelArts job", "create_time" : 1637045545982, "workspace_id" : "0", "user_name" : "" }, "status" : { "phase" : "Creating", "secondary_phase" : "Creating", "duration" : 0, "start_time" : 0, "node_count_metrics" : null, "tasks" : [ "worker-0", "server-0" ] }, "algorithm" : { "id" : "3f5d6706-7b67-408d-8ba0-ec08048c45ed", "name" : "ttt-obs-gpu", "code_dir" : "/cn-north-4-rse/test/moxingtest-code/", "boot_file" : "/cn-north-4-rse/test/moxingtest-code/test_obs_gpu.py", "parameters" : [ { "name" : "input_dir", "description" : "", "i18n_description" : null, "value" : "s://cn-north-4-rse/test/moxingtest-dir/", "constraint" : { "type" : "String", "editable" : true, "required" : true, "sensitive" : false, "valid_type" : "None", "valid_range" : [ ] } }, { "name" : "input_file", "description" : "", "i18n_description" : null, "value" : "obs://cn-north-4-rse/test/moxingtest/", "constraint" : { "type" : "String", "editable" : true, "required" : true, "sensitive" : false, "valid_type" : "None", "valid_range" : [ ] } }, { "name" : "large_file_method", "description" : "", "i18n_description" : null, "value" : "1", "constraint" : { "type" : "Integer", "editable" : true, "required" : true, "sensitive" : false, "valid_type" : "None", "valid_range" : [ ] } } ], "engine" : { "engine_id" : "horovod-cp36-tf-1.16.2", "engine_name" : "Horovod", "engine_version" : "0.16.2-TF-1.13.1-python3.6" }, "policies" : { } }, "spec" : { "resource" : { "policy" : "regular", "flavor_id" : "modelarts.p3.large.public.free", "flavor_name" : "Computing GPU(Vnt1) instance", "node_count" : 1, "flavor_detail" : { "flavor_type" : "GPU", "billing" : { "code" : "modelarts.vm.gpu.free", "unit_num" : 1 }, "flavor_info" : { "cpu" : { "arch" : "x86", "core_num" : 8 }, "gpu" : { "unit_num" : 1, "product_name" : "GP-Vnt1", "memory" : "32GB" }, "memory" : { "size" : 64, "unit" : "GB" } } } }, "log_export_path" : { } } } 状态码: 400 通用的错误应答消息体格式;如下为id是3f5d6706-7b67-408d-8ba0-ec08048c45ee的算法未找到时的返回信息。 { "error_msg" : "algorithm not found.", "error_code" : "ModelArts.2755", "error_solution" : "Check whether the training project information in the request is valid." }
  • 请求示例 创建免费规格的训练作业。设置作业名称为“TestModelArtsJob”,描述为“This is a ModelArts job”。算法依赖的是id为3f5d6706-7b67-408d-8ba0-ec08048c45ed的算法,该算法未定义inputs与outputs,规格选用的是gpu免费规格。 POST https://endpoint/v2/{project_id}/training-jobs { "kind" : "job", "metadata" : { "name" : "TestModelArtsJob", "description" : "This is a ModelArts job" }, "algorithm" : { "id" : "3f5d6706-7b67-408d-8ba0-ec08048c45ed", "parameters" : [ { "name" : "input_dir", "value" : "obs://cn-north-4-rse/test/moxingtest-dir/" }, { "name" : "input_file", "value" : "obs://cn-north-4-rse/test/moxingtest/" }, { "name" : "large_file_method", "value" : "1" } ], "policies" : { "auto_search" : null }, "environments" : { } }, "spec" : { "resource" : { "flavor_id" : "modelarts.p3.large.public.free", "node_count" : 1 }, "log_export_path" : { "obs_url" : "" } } } 使用自定义镜像创建训练作业。设置作业名称为“TestModelArtsJob2”,描述为“This is a ModelArts job2”的自定义镜像训练作业。使用专属资源池和nfs挂载。 POST https://endpoint/v2/{project_id}/training-jobs { "kind" : "job", "metadata" : { "name" : "TestModelArtsJob2", "description" : "This is a ModelArts job2" }, "algorithm" : { "engine" : { "image_url" : "xxxxxxxx/fastseq:1.2" }, "command" : "cd /home/ma-user/ddp_demo && sh run_ddp.sh", "parameters" : [ ], "policies" : { "auto_search" : null }, "environments" : { "NCCL_DEBUG" : "INFO", "NCCL_IB_DISABLE" : "0" } }, "spec" : { "resource" : { "flavor_id" : "modelarts.pool.visual.xlarge", "node_count" : 1, "pool_id" : "poolfaf38d76" }, "log_export_path" : { "obs_url" : "/cn-north-4-training-test/limou/ddp-demo-log/" }, "volumes" : [ { "nfs" : { "nfs_server_path" : "192.168.0.82:/", "local_path" : "/home/ma-user/nfs/", "read_only" : false } } ] } }
  • 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" : { } }
  • 响应示例 状态码: 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" : { } }
  • 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" }
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 Content-Type 否 String 消息体的类型。设置为text/plain,返回临时预览链接。设置为application/octet-stream,返回临时下载链接。 X-Auth-Token 是 String 用户token。 表3 请求Body参数 参数 是否必选 参数类型 描述 app_name 是 String app名称。 app_remark 否 String app备注。 workspace_id 否 String 工作空间id。
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 app ApigAppDetailInfo object 创建的APP基础信息。 表5 ApigAppDetailInfo 参数 参数类型 描述 app_codes Array of strings APP Code列表,当APP类型为APIC时,此参数为空。 app_id String APP编号。 app_key String APP的key。 app_name String APP名称。 app_remark String APP描述,默认为空。不超过200个字符。 app_secret String APP密钥。 app_type String APP类型。枚举值如下: APIC:该APP注册在roma connect网关上 APIG:该APP注册在共享API网关上 DEDICATE_APIG:该APP注册在专享API网关上 bounded_api_count Integer APP绑定API数量。 created_at Long APP创建时间。 project_id String 项目ID。 updated_at Long APP更新时间。 user_id String APP创建用户ID。 状态码: 401 表6 响应Body参数 参数 参数类型 描述 error_code String ModelArts错误码。 error_msg String 具体错误信息。 状态码: 403 表7 响应Body参数 参数 参数类型 描述 error_code String ModelArts错误码。 error_msg String 具体错误信息。 状态码: 404 表8 响应Body参数 参数 参数类型 描述 error_code String ModelArts错误码。 error_msg String 具体错误信息。
共100000条