华为云用户手册

  • URI GET /v1/{project_id}/clusters 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 用户项目ID。获取方法请参见获取项目ID和名称。 表2 Query参数 参数 是否必选 参数类型 描述 cluster_name 否 String 集群名称,默认不过滤集群名。 status 否 String 集群状态,默认不过滤状态。 offset 否 Integer 分页列表的起始页,默认为0。 limit 否 Integer 指定每一页返回的最大条目数,默认为1000。 sort_by 否 String 指定排序字段,可选值为: created_at: 创建时间,默认值 cluster_name: 集群名称。 order 否 String 排序方式,可选值如下: asc : 递增排序 desc: 递减排序,默认值
  • 响应示例 状态码: 200 服务部署规格列表。 { "total_count" : 1, "count" : 1, "clusters" : [ { "cluster_id" : "ff808081673fbb3d01673fbb824d0000", "cluster_name" : "my-cluster", "description" : "", "tenant" : "tenant_id", "project" : "project_id", "owner" : "owner_id", "created_at" : 1574923077927, "status" : "running", "nodes" : { "specification" : "modelarts.vm.cpu.8ud", "count" : 1, "available_count" : 1 }, "allocatable_cpu_cores" : 5.5, "allocatable_memory" : 4096, "allocatable_gpus" : 0.5 } ] }
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 total_count Integer 不分页的情况下符合查询条件的总集群数量。 count Integer 当前查询结果的集群数量,不设置offset、limit查询参数时,count与total相同。 clusters Array of Cluster objects 查询到的集群列表。 表5 Cluster 参数 参数类型 描述 owner String 集群归属用户。 cluster_name String 集群名称。 period_num Integer 对应订购周期的个数,仅当集群为包周期类型时返回。 created_at Integer 集群创建时间,距“1970.1.1 0:0:0 UTC”的毫秒数。 description String 集群备注。 project String 集群归属项目。 allocatable_memory Integer 可使用的内存数。 cluster_id String 集群ID。 nodes ClusterNode object 集群节点配置。 allocatable_cpu_cores Float 可使用的CPU核数。 product_id String 产品ID,仅当集群为包周期类型时返回。 allocatable_gpus Float 可使用的GPU核数。 order_id String 购买产品的订单ID,仅当集群为包周期类型时返回。 period_type String 订购周期类型,取值year或month,仅当集群为包周期类型时返回。 tenant String 集群归属租户。 status String 集群状态,取值为: deploying:部署中 running:运行中 concerning:告警 abnormal:异常 表6 ClusterNode 参数 参数类型 描述 available_count Integer 可用节点数。 count Integer 节点数。 specification String 节点规格。
  • 响应参数 状态码: 200 表2 响应Body参数 参数 参数类型 描述 yaml_templates Array of YamlTemplate objects 所有yaml文件的目录和文件名信息。 表3 YamlTemplate 参数 参数类型 描述 algorithm_type_en String AutoSearch算法类型,英文描述。 algorithm_type_zh String AutoSearch算法类型,中文描述。 algorithm_names Array of strings 该算法类型下所有算法的名称。
  • 响应示例 状态码: 200 ok { "yaml_templates" : [ { "algorithm_type_en" : "hpo", "algorithm_type_zh" : "algorithm_type_zh to translate", "algorithm_names" : [ "Anneal", "Bayes", "DragonFly", "FixNorm", "GridSearch", "TPE" ] }, { "algorithm_type_en" : "nas", "algorithm_type_zh" : "algorithm_type_zh to translate", "algorithm_names" : [ "AutoBSS", "AutoEvo", "AutoTopo", "MBNAS" ] }, { "algorithm_type_en" : "augment", "algorithm_type_zh" : "algorithm_type_zh to translate", "algorithm_names" : [ "AdvAutoAugment", "AutoAugment" ] }, { "algorithm_type_en" : "compression", "algorithm_type_zh" : "algorithm_type_zh to translate", "algorithm_names" : [ "AutoCompress" ] } ] }
  • 请求示例 为指定的Notebook添加资源标签。例如设置TMS标签的key为“test”,value为“service-gpu”。 https://{endpoint}/v1/{project_id}/notebooks/a55eba18-1ebf-4e9a-8229-d2d3b593a3dc/tags/create { "tags" : [ { "key" : "test", "value" : "service-gpu" }, { "key" : "model_version", "value" : "0.1" } ] }
  • 响应参数 状态码: 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 { "apps" : [ { "app_id" : "fb1a9eadd87b48abbd74b8ba1755dffd", "app_name" : "app_13e0", "app_remark" : "ds", "app_key" : "b11ae87581b04b5284aa92b0d4ae332c", "app_secret" : "cb5d1b57368b4f129b635332a03bf0e3", "user_id" : "04f258c8fb00d42a1f65c00df88cc4dc", "project_id" : "04f258c84780d5a52f3bc00dc15aa5e7", "app_type" : "APIG", "app_codes" : [ "53a7c6de82be4671b93414adf98c1c507d5cef29fbdd48d88a4dddb668b0f0ad", "3b5930537438461b9a3e81e5f21d56b49eadbe1047174574b9d2dde859beec54", "55804013463d4344ac37775ff8f6e9d8343933f8f0be420cb2e87bb5aad4c6a3" ], "created_at" : 1683173880900, "updated_at" : 1703160524345, "bounded_api_count" : 29 } ], "count" : 1, "total_count" : 1 }
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 apps Array of ApigAppDetailInfo objects APP基础信息数组,可能为空数组。 count Integer 查询到的APP数量。 total_count Integer 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 具体错误信息
  • URI GET /v1/{project_id}/app-auth/apps 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 用户项目ID。获取方法请参见获取项目ID。 表2 Query参数 参数 是否必选 参数类型 描述 app_name 否 String APP名称 limit 否 String 分页展示时,一页展示多少项。默认为1000。 offset 否 String 分页展示时,从第几页开始。默认为0。 order 否 String 返回的APP列表排序方式,可选值包括asc、desc。默认为asc。 sort_by 否 String 返回的APP列表按何属性排序,可选值包括app_name、created_at、updated_at。默认为name。 workspace_id 否 String 工作空间id iphertext_enabled 否 Boolean 是否明文展示appsecret app_ids 否 Array 需要明文展示的app_id集合
  • URI GET /v2/{project_id}/pools/{pool_name}/nodes 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 用户项目ID。获取方法请参见获取项目ID和名称。 pool_name 是 String 资源池名称。 表2 Query参数 参数 是否必选 参数类型 描述 continue 否 String 分页查询时上一页位置。 limit 否 Integer 分页单次查询返回数。
  • 响应示例 状态码: 200 OK。 { "kind" : "NodeList", "apiVersion" : "v2", "metadata" : { }, "items" : [ { "kind" : "Node", "apiVersion" : "v2", "metadata" : { "name" : "os-node-created-zlncn", "creationTimestamp" : "2022-09-16T05:32:44Z" }, "spec" : { "flavor" : "modelarts.vm.cpu.4ud" }, "status" : { "phase" : "Available", "az" : "cn-north-7c", "privateIp" : "192.168.0.1", "resources" : { "cpu" : "3920m", "memory" : "6270Mi" }, "availableResources" : { "cpu" : "2970m", "memory" : "4558Mi" } } }, { "kind" : "Node", "apiVersion" : "v2", "metadata" : { "name" : "os-node-created-4s522", "creationTimestamp" : "2022-09-16T03:20:53Z" }, "spec" : { "flavor" : "modelarts.vm.cpu.4ud" }, "status" : { "phase" : "Available", "az" : "cn-north-7c", "privateIp" : "192.168.0.2", "resources" : { "cpu" : "3920m", "memory" : "6270Mi" }, "availableResources" : { "cpu" : "2970m", "memory" : "4558Mi" } } }, { "kind" : "Node", "apiVersion" : "v2", "metadata" : { "name" : "os-node-created-v7hfj", "creationTimestamp" : "2022-09-16T09:16:37Z" }, "spec" : { "flavor" : "modelarts.vm.cpu.4ud" }, "status" : { "phase" : "Available", "az" : "cn-north-7c", "privateIp" : "192.168.0.3", "resources" : { "cpu" : "3920m", "memory" : "6270Mi" }, "availableResources" : { "cpu" : "3720m", "memory" : "5670Mi" } } } ] } 状态码: 404 Not Found。 { "error_code" : "ModelArts.50015001", "error_msg" : "pool not found" }
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 apiVersion String API版本。可选值如下: v2 kind String 资源类型。可选值如下: NodeList:节点列表 metadata NodeListMetadata object 资源列表的metadata信息。 items Array of Node objects 节点列表。 表4 NodeListMetadata 参数 参数类型 描述 continue String 分页查询时,下一次查询位置。 remainingItemCount Long 剩余资源个数。 表5 Node 参数 参数类型 描述 apiVersion String API版本。可选值如下: v2 kind String 资源类型。可选值如下: Node:节点 metadata metadata object 节点metadata信息。 spec NodeSpec object 节点期望信息。 status NodeStatus object 节点状态信息。 表6 metadata 参数 参数类型 描述 name String 节点名称。 creationTimestamp String 创建时间。 表7 NodeSpec 参数 参数类型 描述 flavor String 节点规格。 表8 NodeStatus 参数 参数类型 描述 phase String 节点当前状态。可选值如下: Available:节点可用 Creating:节点创建中 Deleting:节点删除中 Abnormal:节点不正常 az String 节点所在的可用区。 privateIp String 节点的IP地址。 resources NodeResource object 节点资源量信息。 availableResources NodeResource object 节点可用资源量信息。 表9 NodeResource 参数 参数类型 描述 cpu String CPU资源量。 memory String 内存资源量。 nvidia.com/gpu String GPU节点的GPU资源量。 huawei.com/ascend-snt3 String 昇腾节点的NPU资源量。 huawei.com/ascend-snt9 String 昇腾节点的NPU资源量。 状态码: 404 表10 响应Body参数 参数 参数类型 描述 error_code String ModelArts错误码 error_msg String 具体错误信息
  • 响应示例 状态码: 200 OK { "apis" : [ { "api_id" : "7e0d272df0e94297b7d4046bada3f158", "api_name" : "infer_ae20fc9fb37c48c28ebc3f3a638c9f48", "api_method" : "ANY", "predict_url" : "https://b86b2d069324491fbd66940e4533b45c.apig.xxxxxx.com/v1/infers/ae20fc9f-b37c-48c2-8ebc-3f3a638c9f48", "support_app_code" : true, "service_id" : "ae20fc9f-b37c-48c2-8ebc-3f3a638c9f48", "service_name" : "service-3c02" } ], "count" : 1 }
  • URI GET /v1/{project_id}/app-auth/apps/{app_id}/auth-apis 表1 路径参数 参数 是否必选 参数类型 描述 app_id 是 String APP编号。 project_id 是 String 用户项目ID。获取方法请参见获取项目ID。 表2 Query参数 参数 是否必选 参数类型 描述 limit 否 String 分页展示时,一页展示多少项。默认为1000。 offset 否 String 分页展示时,从第几页开始。默认为0。 order 否 String 返回的APP列表排序方式,可选值包括asc、desc。默认为asc。 service_name 否 String API所属服务名称,支持模糊查找。 sort_by 否 String 返回的APP列表按何属性排序,可选值包括app_name、created_at、updated_at。默认为name。 workspace_id 否 String 工作空间id
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 apis Array of AuthTypeApiBasicInfo objects API认证信息列表 count Integer 查询数据个数 total_count Integer 数据总量 表5 AuthTypeApiBasicInfo 参数 参数类型 描述 api_id String API编号。 api_method String 请求方式包含GET、POST、PUT、DELETE、HEAD、PATCH、OPTIONS、ANY,固定返回ANY。 api_name String API名称。 api_remark String API描述。字符长度不超过255 auth_type String API的认证方式。 NONE:无认证 APP:APP认证 IAM :IAM认证 predict_url String 预测地址。 service_id String 服务编号。 service_name String 服务名称。 support_app_code Boolean 是否支持APP CODE。 状态码: 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 具体错误信息
  • 请求示例 请求示例,创建在线服务。 POST https://{endpoint}/v1/{project_id}/services { "infer_type" : "real-time", "service_name" : "mnist", "description" : "mnist service", "config" : [ { "specification" : "modelarts.vm.cpu.2u", "weight" : 100, "model_id" : "0e07b41b-173e-42db-8c16-8e1b44cc0d44", "instance_count" : 1 } ] } 请求示例,创建在线服务且配置多版本分流 POST https://{endpoint}/v1/{project_id}/services { "service_name" : "mnist", "description" : "mnist service", "infer_type" : "real-time", "config" : [ { "model_id" : "xxxmodel-idxxx", "weight" : "70", "specification" : "modelarts.vm.cpu.2u", "instance_count" : 1, "envs" : { "model_name" : "mxnet-model-1", "load_epoch" : "0" } }, { "model_id" : "xxxxxx", "weight" : "30", "specification" : "modelarts.vm.cpu.2u", "instance_count" : 1 } ] } 请求示例,创建专属资源池自定义规格在线服务样例 POST https://{endpoint}/v1/{project_id}/services { "service_name" : "realtime-demo", "description" : "", "infer_type" : "real-time", "cluster_id" : "8abf68a969c3cb3a0169c4acb24b0000", "config" : [ { "model_id" : "eb6a4a8c-5713-4a27-b8ed-c7e694499af5", "weight" : "100", "cluster_id" : "8abf68a969c3cb3a0169c4acb24b0000", "specification" : "custom", "custom_spec" : { "cpu" : 1.5, "memory" : 7500, "gpu_p4" : 0, "ascend_a310" : 0 }, "instance_count" : 1 } ] } 请求示例,创建在线服务设置自动停止 POST https://{endpoint}/v1/{project_id}/services { "service_name" : "service-demo", "description" : "demo", "infer_type" : "real-time", "config" : [ { "model_id" : "xxxmodel-idxxx", "weight" : "100", "specification" : "modelarts.vm.cpu.2u", "instance_count" : 1 } ], "schedule" : [ { "type" : "stop", "time_unit" : "HOURS", "duration" : 1 } ] } 请求示例,创建批量服务且输入数据映射方式为“file” POST https://{endpoint}/v1/{project_id}/services { "service_name" : "batchservicetest", "description" : "", "infer_type" : "batch", "cluster_id" : "8abf68a969c3cb3a0169c4acb24b****", "config" : [ { "model_id" : "598b913a-af3e-41ba-a1b5-bf065320f1e2", "specification" : "modelarts.vm.cpu.2u", "instance_count" : 1, "src_path" : "https://infers-data.obs.xxxxx.com/xgboosterdata/", "dest_path" : "https://infers-data.obs.xxxxx.com/output/", "req_uri" : "/", "mapping_type" : "file" } ] } 请求示例,创建批量服务且输入数据映射方式为“csv” POST https://{endpoint}/v1/{project_id}/services { "service_name" : "batchservicetest", "description" : "", "infer_type" : "batch", "config" : [ { "model_id" : "598b913a-af3e-41ba-a1b5-bf065320f1e2", "specification" : "modelarts.vm.cpu.2u", "instance_count" : 1, "src_path" : "https://infers-data.obs.xxxxx.com/xgboosterdata/", "dest_path" : "https://infers-data.obs.xxxxx.com/output/", "req_uri" : "/", "mapping_type" : "csv", "mapping_rule" : { "type" : "object", "properties" : { "data" : { "type" : "object", "properties" : { "req_data" : { "type" : "array", "items" : [ { "type" : "object", "properties" : { "input5" : { "type" : "number", "index" : 0 }, "input4" : { "type" : "number", "index" : 1 }, "input3" : { "type" : "number", "index" : 2 }, "input2" : { "type" : "number", "index" : 3 }, "input1" : { "type" : "number", "index" : 4 } } } ] } } } } } } ] } 请求示例,创建边缘服务样例 POST https://{endpoint}/v1/{project_id}/services { "service_name" : "service-edge-demo", "description" : "", "infer_type" : "edge", "config" : [ { "model_id" : "eb6a4a8c-5713-4a27-b8ed-c7e694499af5", "specification" : "custom", "instance_count" : 1, "custom_spec" : { "cpu" : 1.5, "memory" : 7500, "gpu_p4" : 0, "ascend_a310" : 0 }, "envs" : { }, "nodes" : [ "2r8c4fb9-t497-40u3-89yf-skui77db0472" ] } ] }
  • 请求示例 对在线服务进行鉴权。设置付费工作流计费周期为“day”,付费工作流可使用的时间为“100”。 POST https://{endpoint}/v2/{project_id}/workflows/service/auth { "content_id" : "xxx", "main_service_id" : "xxx", "consume" : { "period" : "day", "value" : 100 } }
  • 请求参数 表2 请求Body参数 参数 是否必选 参数类型 描述 main_service_id 否 String 在线服务ID content_id 否 String Gallery资产ID consume 否 WorkflowConsume object 消费信息 表3 WorkflowConsume 参数 是否必选 参数类型 描述 period 否 String 付费工作流计费周期 value 否 Long 付费工作流可使用的时间值
  • 响应示例 状态码: 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,Tue", "method" : "fixed" }, "action" : "run", "policies" : { "on_failure" : "retry", "on_running" : "cancel" }, "workflow_id" : "f1642618-43eb-4ab1-a0b1-9cc584182c60", "user_id" : "75540c679ab44074bc100022d8a4b204", "enable" : true }
  • URI PUT /v2/{project_id}/workflows/{workflow_id}/schedules/{schedule_id} 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 用户项目ID。获取方法请参见获取项目ID和名称。 workflow_id 是 String 工作流的ID schedule_id 是 String 工作流调度信息ID
  • 请求示例 更新调度信息 PUT https://{endpoint}/v2/{project_id}/workflows/{workflow_id}/schedules/fa4ac58e-088b-4fd7-ae8c-b36fee50f884 { "content" : { "cron" : "0 0 0 * * Thu,Tue", "method" : "fixed" }, "enable" : true }
  • 响应示例 状态码: 200 OK { "total" : 5, "items" : [ { "time" : "2022-10-28T15:31:43.409368+08:00", "duration" : 366181, "workflow_id" : "bd711470-e00f-422a-8da4-8a7fa06f4b8c", "workflow_name" : "wf-test-service-xiahou", "execution_id" : "837f989e-ff44-4089-90f5-ec6d790d339d", "step_name" : "service_step", "step_title" : "install service", "status" : "wait_inputs" }, { "time" : "2022-10-28T15:31:28.753908+08:00", "duration" : 366196, "workflow_id" : "acf1a43e-3037-4e97-8438-d21fe38d31dd", "workflow_name" : "workflow-service-infer2", "execution_id" : "2d235b72-c9e2-4277-9a10-b826746d38e7", "step_name" : "service_step", "step_title" : "service_step", "status" : "wait_inputs" }, { "time" : "2022-10-27T15:01:33.644611+08:00", "duration" : 454391, "workflow_id" : "79232863-7d4c-4e36-af8a-b4030da7b525", "workflow_name" : "MAssist_checkpoint_url_beta2_4dc3a098-2687-400a-a621-11fe1ff6542", "execution_id" : "2d2affa3-892f-4b2f-87de-a22f8b8d018a", "step_name" : "condition_step", "step_title" : "skip training", "status" : "wait_inputs" }, { "time" : "2022-10-20T15:01:42.650076+08:00", "duration" : 1059182, "workflow_id" : "b94d87ad-ccc3-4d7a-ac3e-a4907ccf8247", "workflow_name" : "MAssist_checkpoint_url2_c508a2ac-e146-42dd-8e5b-249dc4a117ee", "execution_id" : "0f2bb91c-3a60-49bd-a32e-190797d90ebd", "step_name" : "condition_step_test", "step_title" : "condition_step_test", "status" : "wait_inputs" }, { "time" : "2022-10-20T14:53:13.05412+08:00", "duration" : 1059692, "workflow_id" : "e6d01c2e-0ff7-42ea-a0da-363660b730bd", "workflow_name" : "MAssist_checkpoint_url3_2086aa8f-09b7-4dae-b262-642d0d80519e", "execution_id" : "2aa33bf2-7ddb-4401-adb9-627952a282e9", "step_name" : "labeling", "step_title" : "data labeling", "status" : "hold" } ] }
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 items Array of WorkflowTodo objects 代办列表 total Integer 条目个数 表4 WorkflowTodo 参数 参数类型 描述 time String 时间 duration Integer 运行时长 workflow_id String 工作流ID workflow_name String 工作流名称。填写1-64位,仅包含英文、数字、下划线(_)和中划线(-),并且以英文开头的名称。 execution_id String 工作流执行ID step_name String 节点名称 step_title String 节点的Title status String 状态
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 auths Array of ApiAuthInfo objects 授权信息数组。 count Integer 查询到的授权信息数量。 total_count Integer 授权信息总数量。 表4 ApiAuthInfo 参数 参数类型 描述 app ApigAppDetailInfo object APP信息。 authed Boolean API是否已授权给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。 状态码: 400 表6 响应Body参数 参数 参数类型 描述 error_code String ModelArts错误码 error_msg String 具体错误信息
  • 响应示例 状态码: 200 OK { "auths" : [ { "app" : { "app_id" : "fb1a9eadd87b48abbd74b8ba1755dffd", "app_name" : "app_13e0", "app_remark" : "ds", "app_key" : "b11ae87581b04b5284aa92b0d4ae332c", "app_secret" : "cb5d1b57368b4f129b635332a03bf0e3", "user_id" : "04f258c8fb00d42a1f65c00df88cc4dc", "project_id" : "04f258c84780d5a52f3bc00dc15aa5e7", "app_type" : "APIG", "app_codes" : [ "53a7c6de82be4671b93414adf98c1c507d5cef29fbdd48d88a4dddb668b0f0ad" ], "created_at" : 1683173880900, "updated_at" : 1700531228874, "bounded_api_count" : 28 }, "authed" : true } ], "count" : 1, "total_count" : 1 }
  • URI GET /v1/{project_id}/services/{service_id}/app-auth-apis/{api_id}/api-auths 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 用户项目ID。获取方法请参见获取项目ID。 service_id 是 String 服务 ID。 api_id 是 String API编号。 表2 Query参数 参数 是否必选 参数类型 描述 limit 否 String 分页展示时,一页展示多少项。默认为1000。 offset 否 String 分页展示时,从第几页开始。默认为0。 app_name 否 String APP名称,支持模糊查找。 order 否 String 返回的APP列表排序方式,可选值包括asc、desc。默认为asc。 show_only 否 String 可选值包括: AUTH(只显示已授权的APP信息) UNAUTH(只显示未授权的APP信息) 默认为空,即显示全部可见的APP信息。 sort_by 否 String 返回的APP列表按何属性排序, 可选值包括 app_name(应用名称) created_at(应用创建时间) updated_at(应用更新时间) 默认为app_name。 workspace_id 否 String 工作空间id iphertext_enabled 否 Boolean 是否明文展示appsecret app_ids 否 Array 明文展示的app_id集合
  • 响应示例 状态码: 200 OK { "total" : 1, "count" : 1, "items" : [ { "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", "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 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 用户项目ID。获取方法请参见获取项目ID和名称。 表2 Query参数 参数 是否必选 参数类型 描述 name 否 String 工作流名称。 description 否 String 工作流描述信息 status 否 String 工作流状态 labels 否 String 工作流标签 template_id 否 String 工作流模板ID limit 否 String 分页参数limit,表示单次查询的条目数上限。假如要查询20~29条记录,offset为20,limit为10 offset 否 String 分页参数offset,表示单次查询的条目偏移数量。假如要查询20~29条记录,offset为20,limit为10 sort_by 否 String 排序依据字段,例如sort_by=create_time,则表示以条目的创建时间进行排序 search_type 否 String 过滤方式。可选值如下: equal表示精确匹配 contain表示模糊匹配。 具体过滤的字段,由各个接口额外定义参数。例如Workflow支持按照名称(name)进行过滤,则相应的过滤字段为name。name=workflow&search_type=contain表示查询名称中含有Workflow字样的所有工作流。
  • 响应示例 状态码: 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" : 2 } ], "network" : { "name" : "network-maos-86c13962597848eeb29c5861153a391f" } }, "status" : { "phase" : "Running", "root" : "auto-pool-os-86c13962597848eeb29c5861153a391f", "scope" : [ { "scopeType" : "Train", "state" : "Enabled" }, { "scopeType" : "Infer", "state" : "Enabled" } ], "resources" : { "available" : [ { "flavor" : "modelarts.vm.cpu.4ud", "count" : 2, "azs" : [ { "az" : "cn-north-7c", "count" : 2 } ] } ] } } } 状态码: 404 Not Found。 { "error_code" : "ModelArts.50015001", "error_msg" : "pool not found" }
共100000条