华为云用户手册

  • 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,用于过滤具体工作空间下的条目
  • 请求示例 如下以更新“real-time”类型的服务为例。 PUT https://{endpoint}/v1/{project_id}/services/{service_id} { "description" : "", "status" : "running", "config" : [ { "model_id" : "xxxx", "weight" : "100", "specification" : "modelarts.vm.cpu.2u", "instance_count" : 1 } ] }
  • 请求示例 查询训练作业。设置查询训练作业限制个数为1,查询作业名称中包含trainjob的所有训练作业数据。 POST https://endpoint/v2/{project_id}/training-job-searches?limit=1 { "offset" : 0, "limit" : 1, "filters" : [ { "key" : "name", "operator" : "like", "value" : [ "trainjob" ] }, { "key" : "create_time", "operator" : "between", "value" : [ "", "" ] }, { "key" : "phase", "operator" : "in", "value" : [ "" ] }, { "key" : "algorithm_name", "operator" : "like", "value" : [ "" ] }, { "key" : "kind", "operator" : "in", "value" : [ ] }, { "key" : "user_id", "operator" : "in", "value" : [ "" ] } ] }
  • 请求参数 表2 请求Body参数 参数 是否必选 参数类型 描述 offset 否 Integer 查询作业的页数,最小为0。例如设置为0,则表示从第一页开始查询。 limit 否 Integer 查询作业的每页条目数。最小为1,最大为50。 sort_by 否 String 查询作业排列顺序的指标。默认使用create_time排序。 order 否 String 查询作业排列顺序,默认为“desc”,降序排序。也可以选择对应的“asc”,升序排序。 group_by 否 String 查询作业要搜索的分组条件。 filters 否 Array of filters objects 查询作业要过滤的一系列条件。 表3 filters 参数 是否必选 参数类型 描述 key 否 String 分组条件键值。 operator 否 String 分组条件键值键关系,支持between(范围)、like(类似)、in(包含)、not(非)。 value 否 Array of strings 分组条件键对应值。
  • 响应示例 状态码: 200 ok { "total" : 5059, "count" : 1, "limit" : 1, "offset" : 0, "sort_by" : "create_time", "order" : "desc", "group_by" : "", "workspace_id" : "0", "ai_project" : "default-ai-project", "items" : [ { "kind" : "job", "metadata" : { "id" : "3faf5c03-aaa1-4cbe-879d-24b05d997347", "name" : "trainjob--py14_mem06-byd-108", "description" : "", "create_time" : 1636447346315, "workspace_id" : "0", "user_name" : "ei_modelarts_q00357245_01" }, "status" : { "phase" : "Abnormal", "secondary_phase" : "CreateFailed", "duration" : 0, "start_time" : 0, "node_count_metrics" : [ [ 1636447746000, 0 ], [ 1636447755000, 0 ], [ 1636447756000, 0 ] ], "tasks" : [ "worker-0" ] }, "algorithm" : { "code_dir" : "obs://test-crq/economic_test/py_minist/", "boot_file" : "obs://test-crq/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-crq/data/py_minist/" } } } ], "outputs" : [ { "name" : "train_url", "local_dir" : "/home/ma-user/modelarts/outputs/train_url_0", "remote" : { "obs" : { "obs_url" : "/test-crq/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" : { "policy" : "economic", "flavor_id" : "modelarts.vm.p100.large.eco", "flavor_name" : "Computing GPU(P100) instance", "node_count" : 1, "flavor_detail" : { "flavor_type" : "GPU", "billing" : { "code" : "modelarts.vm.gpu.p100.eco", "unit_num" : 1 }, "flavor_info" : { "cpu" : { "arch" : "x86", "core_num" : 8 }, "gpu" : { "unit_num" : 1, "product_name" : "NVIDIA-P100", "memory" : "8GB" }, "memory" : { "size" : 64, "unit" : "GB" } } } } } } ] }
  • 响应参数 状态码: 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 具体错误信息
  • 响应示例 状态码: 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 } }
  • URI GET /v1/{project_id}/app-auth/apps/{app_id} 表1 路径参数 参数 是否必选 参数类型 描述 app_id 是 String APP ID project_id 是 String 用户项目ID。获取方法请参见获取项目ID。 表2 Query参数 参数 是否必选 参数类型 描述 workspace_id 否 String 工作空间id iphertext_enabled 否 Boolean 是否明文展示
  • 响应参数 状态码: 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 具体错误信息
  • 响应示例 状态码: 202 ok { "kind" : "job", "metadata" : { "id" : "cf63aba9-63b1-4219-b717-708a2665100b", "name" : "trainjob--py14_mem06-110", "description" : "", "create_time" : 1636515222282, "workspace_id" : "0", "user_name" : "ei_modelarts_z00424192_01" }, "status" : { "phase" : "Terminating", "secondary_phase" : "Terminating", "duration" : 0, "start_time" : 0, "node_count_metrics" : null, "tasks" : [ "worker-0" ] }, "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" : { "policy" : "economic", "flavor_id" : "modelarts.vm.p100.large.eco", "flavor_name" : "Computing GPU(P100) instance", "node_count" : 1, "flavor_detail" : { "flavor_type" : "GPU", "billing" : { "code" : "modelarts.vm.gpu.p100.eco", "unit_num" : 1 }, "flavor_info" : { "cpu" : { "arch" : "x86", "core_num" : 8 }, "gpu" : { "unit_num" : 1, "product_name" : "NVIDIA-P100", "memory" : "8GB" }, "memory" : { "size" : 64, "unit" : "GB" } } } } } }
  • 响应参数 状态码: 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 超参搜索算法的参数类型。
  • 响应示例 状态码: 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." } ] }
  • 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 表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。 { "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 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
共100000条