华为云用户手册

  • 响应示例 状态码: 200 Execution Information { "created_at" : "2022-06-16T23:12:48.458022+08:00", "name" : "execution-056", "execution_id" : "fa412c98-6d94-42a2-891a-99cd1da93916", "description" : "", "status" : "stopped", "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-16T23:12:48.466906+08:00", "uuid" : "5e8456bd-35ff-4cc9-9624-935c37dabe47", "instance_id" : "{\"model_id\":\"7d795a48-e646-43b0-b4cb-759454acaf2b\"}", "step_name" : "model_step", "step_title" : "model release", "status" : "completed", "duration" : 17, "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" : "7d795a48-e646-43b0-b4cb-759454acaf2b" } } ], "properties" : { "model_name" : "lh-xh", "model_type" : "TensorFlow" }, "events" : [ "2022-06-16 23:12:49 change status from init to creating", "2022-06-16 23:12:51 change status from creating to created", "2022-06-16 23:12:51 change status from created to running", "2022-06-16 23:13:05 change status from running to completed" ], "policy" : { } }, { "created_at" : "2022-06-16T23:13:05.620354+08:00", "uuid" : "9b452016-cc7b-4bfe-snt9-f9d53dcb4cc1", "step_name" : "service_step", "step_title" : "service install", "status" : "stopped", "duration" : 1, "events" : [ "2022-06-16 23:13:06 change status from init to wait_inputs", "2022-06-16 23:16:13 change status from wait_inputs to stopped" ], "policy" : { } } ], "duration" : 204, "events" : [ "2022-06-16 23:12:49 step model_step change status from init to creating", "2022-06-16 23:12:51 step model_step change status from creating to created", "2022-06-16 23:12:51 step model_step change status from created to running", "2022-06-16 23:13:05 step model_step change status from running to completed", "2022-06-16 23:13:06 step service_step change status from init to wait_inputs", "2022-06-16 23:16:13 step service_step change status from wait_inputs to stopped" ], "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" } ], "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, "used_steps" : [ "service_step" ] } ], "policies" : { } }
  • URI GET /v2/{project_id}/workflows/{workflow_id}/executions/{execution_id} 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 用户项目ID。获取方法请参见获取项目ID和名称。 workflow_id 是 String 工作流的ID execution_id 是 String 工作流执行ID
  • 请求示例 更新订阅信息 PUT https://{endpoint}/v2/{project_id}/workflows/{workflow_id}/subscription/f1642618-43eb-4ab1-a0b1-9cc58418 { "topic_urns" : [ "fengbin26" ], "entity" : "238947895793875835893490", "events" : [ "*:failed,completed", "job_step:stop" ] }
  • URI PUT /v2/{project_id}/workflows/{workflow_id}/subscriptions/{subscription_id} 表1 路径参数 参数 是否必选 参数类型 描述 subscription_id 是 String 消息订阅ID project_id 是 String 用户项目ID。获取方法请参见获取项目ID和名称。 workflow_id 是 String 工作流的ID
  • 响应示例 状态码: 200 ok { "file_name" : "Bayes.yaml", "content" : "general:\n instance_per_trial: 1\n gpu_per_instance: 1\n cpu_per_instance: 1\n\nsearch_space:\n - params: # only support continuous params\n - type: continuous_param\n name : lr\n start: 0.001\n stop: 0.1\n\nsearch_algorithm:\n type: bayes_opt_search\n max_concurrent: 4\n reward_attr: accuracy\n num_samples: 8\n kind : ucb\n save_model_count : 3\n mode: max\n\nscheduler:\n type: FIFOScheduler" }
  • URI GET /v2/{project_id}/training-jobs/autosearch/yaml-templates/{algorithm_type}/{algorithm_name} 表1 路径参数 参数 是否必选 参数类型 描述 algorithm_type 是 String 搜索算法类型 algorithm_name 是 String 搜索算法名称 project_id 是 String 用户项目ID。获取方法请参见获取项目ID和名称。
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。通过调用 IAM 服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 表3 请求Body参数 参数 是否必选 参数类型 描述 status 是 String 服务状态,取值为: running:running为启动节点实例,只有处于stopped状态的节点实例支持启动。 stopped:stopped为停止节点实例,只有处于running状态的节点实例支持停止。
  • URI PUT /v1/{project_id}/services/{service_id}/nodes/{node_id}/status 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 用户项目ID。获取方法请参见获取项目ID和名称。 service_id 是 String 服务ID。 node_id 是 String 边缘节点ID。在IEF上创建边缘节点后可得到。
  • 响应示例 状态码: 200 OK { "app" : { "app_id" : "f29eddd1443e4dceb76898f881c07a4d", "app_name" : "app_xq0XT", "app_remark" : "autotest", "app_key" : "bcb835430eab4c72bd45e2315d98fdb9", "app_secret" : "80dc4ab97b34456fbf73a04e83164a1b", "user_id" : "04f258c8fb00d42a1f65c00df88cc4dc", "project_id" : "04f258c84780d5a52f3bc00dc15aa5e7", "app_type" : "APIG", "app_codes" : [ ], "created_at" : 1698745606957, "updated_at" : 1703162934072, "bounded_api_count" : 0 } }
  • URI DELETE /v1/{project_id}/app-auth/apps/{app_id}/app-code/{app_code} 表1 路径参数 参数 是否必选 参数类型 描述 app_code 是 String 待删除的AppCode。 app_id 是 String APP编号,可通过APP列表接口获取 project_id 是 String 用户项目ID。获取方法请参见获取项目ID。 表2 Query参数 参数 是否必选 参数类型 描述 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 具体错误信息
  • URI DELETE /v2/{project_id}/workflows/{workflow_id}/executions/{execution_id} 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 用户项目ID。获取方法请参见获取项目ID和名称。 workflow_id 是 String 工作流的ID execution_id 是 String 工作流执行ID
  • URI GET /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 字段中获取。
  • 响应示例 状态码: 200 get image save job successfully { "name" : "imagesave", "namespace" : "dev", "tag" : 0.1, "description" : "hello world!", "status" : "ACTIVE", "message" : "building", "create_time" : 1686718209968 }
  • 响应参数 状态码: 200 表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 DELETE /v2/{project_id}/workflows/{workflow_id}/schedules/{schedule_id} 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 用户项目ID。获取方法请参见获取项目ID和名称。 workflow_id 是 String 工作流的ID schedule_id 是 String 工作流调度信息ID
  • URI GET /v2/{project_id}/workflows/overview 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 用户项目ID。获取方法请参见获取项目ID和名称。 表2 Query参数 参数 是否必选 参数类型 描述 workspace_id 否 String 工作空间ID,用于过滤具体工作空间下的条目 search_type 否 String 过滤方式。可选值如下: equal表示精确匹配 contain表示模糊匹配。 具体过滤的字段,由各个接口额外定义参数。例如Workflow支持按照名称(name)进行过滤,则相应的过滤字段为name。name=workflow&search_type=contain表示查询名称中含有Workflow字样的所有工作流。 name 否 String 工作流名称。填写1-64位,仅包含英文、数字、下划线(_)和中划线(-),并且以英文开头的名称。 description 否 String 工作流描述信息
  • 请求示例 创建Workflow工作流。设置工作流名称为“graph-test-has-condition-step”。 POST https://{endpoint}/v2/{project_id}/workflows { "name" : "graph-test-has-condition-step", "description" : "", "workspace_id" : "0", "steps" : [ { "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" : { } }, { "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" : { } }, { "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" : { } }, { "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" ] } ] }
  • 响应示例 状态码: 201 OK { "name" : "graph-test-has-condition-step", "description" : "", "workspace_id" : "0", "steps" : [ { "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" : { } }, { "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" : { } }, { "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" : { } }, { "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 specificaiton", "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" ] } ] }
  • 响应示例 状态码: 200 OK { "app" : { "app_id" : "logic-app-7ded3898-8306-49ee-a1df-2708f9aac83a", "app_name" : "app_c8ae", "app_key" : "9cdbfd0b65364fbe8b1c6cf29255a46f", "app_secret" : "c736b99bdc33403ab0652bf91c00e99e", "user_id" : "04f258c8fb00d42a1f65c00df88cc4dc", "project_id" : "04f258c84780d5a52f3bc00dc15aa5e7", "app_type" : "DEDICATE_APIG", "app_codes" : [ ], "created_at" : 1703162733450, "updated_at" : 1703162733450, "bounded_api_count" : 0 } }
  • 请求参数 表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 具体错误信息
  • 响应示例 状态码: 201 OK { "created_at" : "2022-11-01T21:36:04.264564372+08:00", "name" : "execution-065", "execution_id" : "46c682b6-0310-4774-9c8e-62d7fb7e0b55", "description" : "", "workspace_id" : "0", "workflow_id" : "f1642618-43eb-4ab1-a0b1-9cc584182c60", "workflow_name" : "workflow_model_service_no_modify_xiahou_copy", "steps_execution" : null, "duration" : 0, "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" } ], "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, "used_steps" : [ "service_step" ] } ], "policies" : { } }
  • 请求示例 创建训练作业标签。设置TMS标签的key/value为“111”和“k3”,TMS标签的key/value为"k3"和“v2”。 POST https://endpoint/v2/{project_id }/trainJob/{training_job_id}/tags/create { "tags" : [ { "key" : "111", "value" : "v2" }, { "key" : "k3", "value" : "v2" } ] }
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 service_name String 服务名称。 service_id String 服务ID。 monitors Array of Monitor objects 监控信息详情。 service_running_instance_count Integer 服务运行中实例数量。 service_instance_count Integer 服务实例数量。 req_count_per_min Long 服务分钟调用量,这里指当前时间上一分钟的服务调用总量。 表5 Monitor 参数 参数类型 描述 failed_times Integer 模型实例调用失败次数,在线服务字段。 model_version String 模型版本,在线服务字段。 cpu_memory_total Integer 总内存,单位MB。 gpu_usage Float 已使用GPU个数。 node_name String 节点名称,边缘服务字段。 gpu_total Float 总GPU个数。 model_id String 模型ID,在线服务字段。 invocation_times Integer 模型实例的总调用次数,在线服务字段。 cpu_core_usage Float 已使用CPU核数。 cpu_core_total Float 总CPU核数。 model_name String 模型名称,在线服务字段。 cpu_memory_usage Integer 已使用内存,单位MB。 node_id String 边缘节点ID,边缘服务字段。 model_running_instance_count Integer 模型运行中实例数。 model_instance_count Integer 模型实例数。 gpu_memory_total Float gpu总显存,单位MB gpu_memory_usage Float 已使用gpu显存,单位MB npu_total Float 总NPU个数 npu_usage Float 已使用NPU个数 npu_memory_total Float npu总显存,单位MB npu_memory_usage Float 已使用npu显存,单位MB
  • 响应示例 状态码: 200 监控信息 { "service_name" : "mnist", "service_id" : "195c1f2d-136d-40af-a0f3-db5717d2634a", "monitors" : [ { "failed_times" : 1, "model_version" : "1.0.0", "cpu_core_total" : 4, "cpu_memory_total" : 8192, "model_name" : "minst", "gpu_usage" : 0.6, "cpu_memory_usage" : 2011, "gpu_total" : 1, "model_id" : "0e07b41b-173e-42db-8c16-8e1b44cc0d44", "invocation_times" : 50, "cpu_core_usage" : 2.4 } ] }
  • URI GET /v1/{project_id}/services/{service_id}/monitor 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 用户项目ID。获取方法请参见获取项目ID和名称。 service_id 是 String 服务ID。 表2 Query参数 参数 是否必选 参数类型 描述 node_id 否 String 待查询的边缘节点ID,仅当infer_type为edge时可指定,默认查询所有节点。
  • 输出说明 图像分类 输出数据的目录结构如下所示。 output_path/ --Data/ ----class1/ # 如果输入数据有标注信息会一并输出,class1为标注类别 ------1.jpg ----class2/ ------2.jpg ----3.jpg --output.manifest 其中manifest文件内容示例如下所示。 { "id": "xss", "source": "obs://home/fc8e2688015d4a1784dcbda44d840307_14.jpg", "usage": "train", "annotation": [ { "name": "Cat", "type": "modelarts/image_classification" } ] } 物体检测 输出数据的目录结构如下所示。 output_path/ --Data/ ----1.jpg ----1.xml # 如果输入数据有标注信息会一并输出,xml为标注文件 ----2.jpg ----3.jpg --output.manifest 其中manifest文件内容示例如下所示。 { "source":"obs://fake/be462ea9c5abc09f.jpg", "annotation":[ { "annotation-loc":"obs://fake/be462ea9c5abc09f.xml", "type":"modelarts/object_detection", "annotation-format":"PASCAL VOC", "annotated-by":"modelarts/hard_example_algo" } ] }
  • 参数说明 表1 数据清洗-PCC算子参数说明 参数名 是否必选 默认值 参数说明 prototype_sample_path 是 None 数据清洗正样例目录。目录应存放正样例图片文件,算法将这些图片为正样例,对输入中的数据进行过滤,即保留与“prototype_sample_path”目录下图片相似度高的数据。 请输入一个真实存在的OBS目录,该目录下已包含提供的正样例图片,且以obs://开头。如:obs://obs_bucket_name/folder_name。 criticism_sample_path 否 None 数据清洗负样例目录。目录应存放负样例图片文件,算法将这些图片为负样例,对算法输入中的数据进行过滤, 即保留与“criticism_sample_path”目录下图片相似度差距较大的数据。 建议该参数和“prototype_sample_path”配合使用,可以提高数据清洗的准确性。 请输入一个真实存在的OBS目录,且以obs://开头。如:obs://obs_bucket_name/folder_name。 n_clusters 否 auto 数据样本的种类数,默认值auto。您可以输入小于样本总数的整数或auto。auto表示使用正样本目录的图片个数作为数据样本的种类数。 simlarity_threshold 否 0.9 相似度阈值。两张图片相似程度超过阈值时,判定为相似图片,反之按非相似图片处理。输入取值范围为0~1。 embedding_distance 否 0.2 样本特征间距。两张图片样本特征间距小于设定值,判定为相似图片,反之按非相似图片处理。输入取值范围为0~1。 do_validation 否 True 是否进行数据校验,可填True或者False。表示数据清洗前需要进行数据校验,否则只进行数据清洗。
  • 输入要求 算子输入分为两种,“数据集”或“OBS目录”。 选择“数据集”,请从下拉框中选择ModelArts中管理的数据集及其版本。要求数据集类型与您在本任务中选择的场景类别一致。 选择“OBS目录”,存放结构又分两种情况,“仅包含图片”或“包含图片和标注信息”。 “仅包含图片”:当目录下全是图片时,支持jpg、jpeg、png、bmp格式,嵌套子目录的图片也将全部读入。 “包含图片和标注信息”:根据不同场景类型,结构不同。 图像分类场景,其目录结构如下所示。如下目录结构,仅支持单标签场景。 input_path/ --label1/ ----1.jpg --label2/ ----2.jpg --../ 物体检测场景,其目录结构如下所示。支持jpg、jpeg、png、bmp格式的图片,xml为标准的PACAL VOC格式标注文件。 input_path/ --1.jpg --1.xml --2.jpg --2.xml ...
共100000条