华为云用户手册

  • 响应示例 状态码: 200 成功 { "id" : "e4f9c0d6-e1d7-41d5-a108-f38aa8372ffd", "name" : "test1", "description" : "", "created_at" : "2022-06-07 08:21:05.794205 +0000 UTC", "updated_at" : "2022-06-07 08:21:05.794217 +0000 UTC", "project_id" : "xxx", "iam_role" : "", "memory" : 8595, "cpu" : 5, "gpu_num" : 0, "nodes" : [ { "id" : "024e05a8-89bf-46d8-b298-700a2af69605", "project_id" : "xxx", "name" : "test1", "description" : "", "created_at" : "2022-08-05 02:14:52.351802 +0000 UTC", "updated_at" : "2022-10-31 19:19:37.104359 +0000 UTC", "state" : "RUNNING", "master_addr" : "xxx/xxx", "arch" : "x86_64", "enable_gpu" : false, "gpu_info" : [ ], "gpu_num" : 0, "memory" : 990, "os_version" : "3.10.0-1062.12.1.el7.x86_64", "os_name" : "CentOS Linux 7 (Core)", "device_infos" : null, "os_type" : "linux", "pause_docker_image" : "", "host_name" : "test1", "cpu" : 1, "log_configs" : [ { "level" : "on", "rotate_num" : 5, "component" : "app", "rotate_period" : "yearly", "type" : "LTS", "id" : "", "size" : 50 }, { "level" : "info", "rotate_num" : 5, "component" : "system", "rotate_period" : "yearly", "type" : "LTS", "id" : "", "size" : 50 }, { "level" : "", "rotate_num" : 5, "component" : "app", "rotate_period" : "daily", "type" : "local", "id" : "", "size" : 50 }, { "level" : "info", "rotate_num" : 5, "component" : "system", "rotate_period" : "daily", "type" : "local", "id" : "", "size" : 50 } ], "host_ips" : [ "192.168.0.x" ], "edged_version" : "2.1.0", "deployment_num" : 1, "device_num" : 2, "upgrade_history" : [ { "to_version" : "2.55.8", "upgrade_time" : 1659694662, "id" : 0, "result" : "install_success", "from_version" : "", "dur_time" : 0 }, { "to_version" : "2.55.9", "upgrade_time" : 1660642318, "id" : 1, "result" : "upgrade_success", "from_version" : "2.55.8", "dur_time" : 30 }, { "to_version" : "2.56.0", "upgrade_time" : 1662019732, "id" : 2, "result" : "upgrade_success", "from_version" : "2.55.9", "dur_time" : 29 }, { "to_version" : "2.56.0", "upgrade_time" : 1663125401, "id" : 3, "result" : "upgrade_failed_rollback_success", "from_version" : "2.56.0", "dur_time" : 3 } ], "ief_node_version" : "2.3.0", "upgrade_flag" : false, "comment" : "", "ca" : "", "relation" : "", "certificate" : "", "private_key" : "", "attributes" : null, "package" : "", "tags" : null, "product_id" : "", "mqtt_mode" : "internal", "mqtt_internal" : "", "mqtt_external" : "", "enable_npu" : false, "npu_type" : "", "docker_enable" : null, "npu_num" : 0, "npu_info" : [ ], "node_type" : "", "ntp_configs" : null, "nics" : null, "error_reason" : "", "container_runtime_version" : "", "purchase_id" : "", "state_details" : { "register_stat" : "", "purchase_stat" : "", "purchase_error" : "" }, "cert_remaining_valid_time" : 0 }, { "id" : "de5d81fe-a58e-4ec4-be9d-f3906d7fe356", "project_id" : "xxx", "name" : "cjq-test-1008", "description" : "", "created_at" : "2022-10-07 23:19:18.147956 +0000 UTC", "updated_at" : "2022-10-27 23:20:09.631153 +0000 UTC", "state" : "RUNNING", "master_addr" : "xxx", "arch" : "x86_64", "enable_gpu" : false, "gpu_info" : [ ], "gpu_num" : 0, "memory" : 7805, "os_version" : "3.10.0-862.14.1.5.h408.eulerosv2r7.x86_64", "os_name" : "EulerOS 2.0 (SP5)", "device_infos" : null, "os_type" : "linux", "pause_docker_image" : "", "host_name" : "ecs-81ba", "cpu" : 4, "log_configs" : null, "host_ips" : [ "192.168.0.161" ], "edged_version" : "2.1.0", "deployment_num" : 1, "device_num" : 0, "upgrade_history" : [ { "to_version" : "2.53.4", "upgrade_time" : 1665215216, "id" : 0, "result" : "install_success", "from_version" : "", "dur_time" : 0 }, { "to_version" : "2.56.5", "upgrade_time" : 1666839798, "id" : 1, "result" : "upgrade_success", "from_version" : "2.56.4", "dur_time" : 22 }, { "to_version" : "2.56.6", "upgrade_time" : 1666872187, "id" : 2, "result" : "upgrade_success", "from_version" : "2.56.5", "dur_time" : 23 } ], "ief_node_version" : "2.56.6", "upgrade_flag" : false, "comment" : "", "ca" : "", "relation" : "", "certificate" : "", "private_key" : "", "attributes" : null, "package" : "", "tags" : null, "product_id" : "", "mqtt_mode" : "internal", "mqtt_internal" : "", "mqtt_external" : "", "enable_npu" : false, "npu_type" : "", "docker_enable" : null, "npu_num" : 0, "npu_info" : [ ], "node_type" : "", "ntp_configs" : null, "nics" : null, "error_reason" : "", "container_runtime_version" : "", "purchase_id" : "", "state_details" : { "register_stat" : "", "purchase_stat" : "", "purchase_error" : "" }, "cert_remaining_valid_time" : 0 } ], "deployments" : [ ], "attributes" : [ ], "failed_node_add" : null, "failed_node_del" : null, "success_node_add" : null, "success_node_del" : null }
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 ief-instance-id 否 String 铂金版实例ID,专业版实例为空值 Content-Type 是 String 消息体的类型(格式),默认取值为“application/json” 表3 请求Body参数 参数 是否必选 参数类型 描述 add_node_ids 否 Array of strings 新增绑定的节点ID列表 remove_node_ids 否 Array of strings 新增解绑的节点ID列表
  • 响应示例 状态码: 201 创建成功 { "endpoint" : { "name" : "dis_example", "description" : "", "type" : "dis", "properties" : { "domain_id" : "8fd3691d01f44badab03e28d81abd4ff" }, "ief_instance_id" : "", "is_shared" : false, "id" : "add32d8b-eed1-40a6-8538-5ac66d8e0681", "project_id" : "ed202955e111444e8ced21a1bd75fc59", "created_at" : "2022-09-07T11:02:26Z", "updated_at" : "2022-09-07T11:02:26Z" } }
  • 响应示例 状态码: 201 创建成功 { "systemevent" : { "id" : "b79f4d8e-4549-4da4-9a9c-a9d13452c7d6", "project_id" : "ed202955e111444e8ced21a1bd75fc59", "created_at" : "2022-11-02T07:17:01.372735871Z", "updated_at" : "2022-11-02T07:17:01.372735998Z", "name" : "aa", "description" : "", "in_using" : true, "events" : "edgeNode/online", "target" : { "name" : "apigw", "description" : "", "type" : "apigw", "properties" : { "domain_id" : "d0857ebddc514a7381c3673363e61337" }, "ief_instance_id" : "38898a99-d67c-41f8-a8cb-8c53d6d297ba", "is_shared" : false, "id" : "591ba510-8c62-41b8-a0c3-d94262ef97ef", "project_id" : "ed202955e111444e8ced21a1bd75fc59", "created_at" : "2022-06-02T11:15:26.29972+08:00", "updated_at" : "2022-06-02T11:15:26.29972+08:00" }, "target_resource" : { "resource" : "https://www.fake.com" }, "fail_messages" : 0, "success_messages" : 0, "delete_at" : 0 } }
  • 请求示例 创建系统订阅,订阅的系统主题为节点上线。 { "systemevent" : { "name" : "aa", "description" : "", "events" : "edgeNode/online", "target_resource" : { "resource" : "https://www.fake.com" }, "target" : "591ba510-8c62-41b8-a0c3-d94262ef97ef" } }
  • URI GET /v2/{project_id}/edgemgr/groups 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID 表2 Query参数 参数 是否必选 参数类型 描述 name 否 String 边缘节点组名称 limit 否 Integer 查询返回记录的数量限制 offset 否 Integer 偏移量,表示查询该偏移量后面的记录 sort 否 String 显示的条目排列顺序,使用:分隔参考值和顺序,如sort=created_at%3Adesc表示根据创建时间逆序排列
  • 响应示例 状态码: 200 响应参数 { "count" : 1, "edge_groups" : [ { "id" : "e4f9c0d6-e1d7-41d5-a108-f38aa8372ffd", "name" : "test1", "description" : "", "created_at" : "2022-06-07 08:21:05.794205 +0000 UTC", "updated_at" : "2022-06-07 08:21:05.794217 +0000 UTC", "project_id" : "xxx", "iam_role" : "", "memory" : 8595, "cpu" : 5, "gpu_num" : 0, "nodes" : [ { "id" : "024e05a8-89bf-46d8-b298-700a2af69605", "project_id" : "xxx", "name" : "test1", "description" : "", "created_at" : "2022-08-05 02:14:52.351802 +0000 UTC", "updated_at" : "2022-10-31 19:19:37.104359 +0000 UTC", "state" : "RUNNING", "master_addr" : "xxx/xxx", "arch" : "x86_64", "enable_gpu" : false, "gpu_info" : [ ], "gpu_num" : 0, "memory" : 990, "os_version" : "3.10.0-1062.12.1.el7.x86_64", "os_name" : "CentOS Linux 7 (Core)", "device_infos" : null, "os_type" : "linux", "pause_docker_image" : "", "host_name" : "test1", "cpu" : 1, "log_configs" : [ { "level" : "on", "rotate_num" : 5, "component" : "app", "rotate_period" : "yearly", "type" : "LTS", "id" : "", "size" : 50 }, { "level" : "info", "rotate_num" : 5, "component" : "system", "rotate_period" : "yearly", "type" : "LTS", "id" : "", "size" : 50 }, { "level" : "", "rotate_num" : 5, "component" : "app", "rotate_period" : "daily", "type" : "local", "id" : "", "size" : 50 }, { "level" : "info", "rotate_num" : 5, "component" : "system", "rotate_period" : "daily", "type" : "local", "id" : "", "size" : 50 } ], "host_ips" : [ "192.168.0.x" ], "edged_version" : "2.1.0", "deployment_num" : 1, "device_num" : 2, "upgrade_history" : [ { "to_version" : "2.55.8", "upgrade_time" : 1659694662, "id" : 0, "result" : "install_success", "from_version" : "", "dur_time" : 0 }, { "to_version" : "2.55.9", "upgrade_time" : 1660642318, "id" : 1, "result" : "upgrade_success", "from_version" : "2.55.8", "dur_time" : 30 }, { "to_version" : "2.56.0", "upgrade_time" : 1662019732, "id" : 2, "result" : "upgrade_success", "from_version" : "2.55.9", "dur_time" : 29 }, { "to_version" : "2.56.0", "upgrade_time" : 1663125401, "id" : 3, "result" : "upgrade_failed_rollback_success", "from_version" : "2.56.0", "dur_time" : 3 } ], "ief_node_version" : "2.3.0", "upgrade_flag" : false, "comment" : "", "ca" : "", "relation" : "", "certificate" : "", "private_key" : "", "attributes" : null, "package" : "", "tags" : null, "product_id" : "", "mqtt_mode" : "internal", "mqtt_internal" : "", "mqtt_external" : "", "enable_npu" : false, "npu_type" : "", "docker_enable" : null, "npu_num" : 0, "npu_info" : [ ], "node_type" : "", "ntp_configs" : null, "nics" : null, "error_reason" : "", "container_runtime_version" : "", "purchase_id" : "", "state_details" : { "register_stat" : "", "purchase_stat" : "", "purchase_error" : "" }, "cert_remaining_valid_time" : 0 }, { "id" : "de5d81fe-a58e-4ec4-be9d-f3906d7fe356", "project_id" : "xxx", "name" : "cjq-test-1008", "description" : "", "created_at" : "2022-10-07 23:19:18.147956 +0000 UTC", "updated_at" : "2022-10-27 23:20:09.631153 +0000 UTC", "state" : "RUNNING", "master_addr" : "xxx", "arch" : "x86_64", "enable_gpu" : false, "gpu_info" : [ ], "gpu_num" : 0, "memory" : 7805, "os_version" : "3.10.0-862.14.1.5.h408.eulerosv2r7.x86_64", "os_name" : "EulerOS 2.0 (SP5)", "device_infos" : null, "os_type" : "linux", "pause_docker_image" : "", "host_name" : "ecs-81ba", "cpu" : 4, "log_configs" : null, "host_ips" : [ "192.168.0.161" ], "edged_version" : "2.1.0", "deployment_num" : 1, "device_num" : 0, "upgrade_history" : [ { "to_version" : "2.53.4", "upgrade_time" : 1665215216, "id" : 0, "result" : "install_success", "from_version" : "", "dur_time" : 0 }, { "to_version" : "2.56.5", "upgrade_time" : 1666839798, "id" : 1, "result" : "upgrade_success", "from_version" : "2.56.4", "dur_time" : 22 }, { "to_version" : "2.56.6", "upgrade_time" : 1666872187, "id" : 2, "result" : "upgrade_success", "from_version" : "2.56.5", "dur_time" : 23 } ], "ief_node_version" : "2.56.6", "upgrade_flag" : false, "comment" : "", "ca" : "", "relation" : "", "certificate" : "", "private_key" : "", "attributes" : null, "package" : "", "tags" : null, "product_id" : "", "mqtt_mode" : "internal", "mqtt_internal" : "", "mqtt_external" : "", "enable_npu" : false, "npu_type" : "", "docker_enable" : null, "npu_num" : 0, "npu_info" : [ ], "node_type" : "", "ntp_configs" : null, "nics" : null, "error_reason" : "", "container_runtime_version" : "", "purchase_id" : "", "state_details" : { "register_stat" : "", "purchase_stat" : "", "purchase_error" : "" }, "cert_remaining_valid_time" : 0 } ], "deployments" : [ ], "attributes" : [ ], "failed_node_add" : null, "failed_node_del" : null, "success_node_add" : null, "success_node_del" : null } ] }
  • 请求参数 表3 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 ief-instance-id 否 String 铂金版实例ID,专业版实例为空值 Content-Type 是 String 消息体的类型(格式),默认取值为“application/json”
  • 响应示例 状态码: 200 更新成功 { "id" : "e4f9c0d6-e1d7-41d5-a108-f38aa8372ffd", "name" : "test1", "description" : "new description", "created_at" : "2022-06-07 08:21:05.794205 +0000 UTC", "updated_at" : "2022-06-07 08:21:05.794217 +0000 UTC", "project_id" : "xxx", "iam_role" : "", "memory" : 8595, "cpu" : 5, "gpu_num" : 0, "nodes" : [ { "id" : "024e05a8-89bf-46d8-b298-700a2af69605", "project_id" : "xxx", "name" : "test1", "description" : "", "created_at" : "2022-08-05 02:14:52.351802 +0000 UTC", "updated_at" : "2022-10-31 19:19:37.104359 +0000 UTC", "state" : "RUNNING", "master_addr" : "xxx/xxx", "arch" : "x86_64", "enable_gpu" : false, "gpu_info" : [ ], "gpu_num" : 0, "memory" : 990, "os_version" : "3.10.0-1062.12.1.el7.x86_64", "os_name" : "CentOS Linux 7 (Core)", "device_infos" : null, "os_type" : "linux", "pause_docker_image" : "", "host_name" : "test1", "cpu" : 1, "log_configs" : [ { "level" : "on", "rotate_num" : 5, "component" : "app", "rotate_period" : "yearly", "type" : "LTS", "id" : "", "size" : 50 }, { "level" : "info", "rotate_num" : 5, "component" : "system", "rotate_period" : "yearly", "type" : "LTS", "id" : "", "size" : 50 }, { "level" : "", "rotate_num" : 5, "component" : "app", "rotate_period" : "daily", "type" : "local", "id" : "", "size" : 50 }, { "level" : "info", "rotate_num" : 5, "component" : "system", "rotate_period" : "daily", "type" : "local", "id" : "", "size" : 50 } ], "host_ips" : [ "192.168.0.x" ], "edged_version" : "2.1.0", "deployment_num" : 1, "device_num" : 2, "upgrade_history" : [ { "to_version" : "2.55.8", "upgrade_time" : 1659694662, "id" : 0, "result" : "install_success", "from_version" : "", "dur_time" : 0 }, { "to_version" : "2.55.9", "upgrade_time" : 1660642318, "id" : 1, "result" : "upgrade_success", "from_version" : "2.55.8", "dur_time" : 30 }, { "to_version" : "2.56.0", "upgrade_time" : 1662019732, "id" : 2, "result" : "upgrade_success", "from_version" : "2.55.9", "dur_time" : 29 }, { "to_version" : "2.56.0", "upgrade_time" : 1663125401, "id" : 3, "result" : "upgrade_failed_rollback_success", "from_version" : "2.56.0", "dur_time" : 3 } ], "ief_node_version" : "2.3.0", "upgrade_flag" : false, "comment" : "", "ca" : "", "relation" : "", "certificate" : "", "private_key" : "", "attributes" : null, "package" : "", "tags" : null, "product_id" : "", "mqtt_mode" : "internal", "mqtt_internal" : "", "mqtt_external" : "", "enable_npu" : false, "npu_type" : "", "docker_enable" : null, "npu_num" : 0, "npu_info" : [ ], "node_type" : "", "ntp_configs" : null, "nics" : null, "error_reason" : "", "container_runtime_version" : "", "purchase_id" : "", "state_details" : { "register_stat" : "", "purchase_stat" : "", "purchase_error" : "" }, "cert_remaining_valid_time" : 0 }, { "id" : "de5d81fe-a58e-4ec4-be9d-f3906d7fe356", "project_id" : "xxx", "name" : "cjq-test-1008", "description" : "", "created_at" : "2022-10-07 23:19:18.147956 +0000 UTC", "updated_at" : "2022-10-27 23:20:09.631153 +0000 UTC", "state" : "RUNNING", "master_addr" : "xxx", "arch" : "x86_64", "enable_gpu" : false, "gpu_info" : [ ], "gpu_num" : 0, "memory" : 7805, "os_version" : "3.10.0-862.14.1.5.h408.eulerosv2r7.x86_64", "os_name" : "EulerOS 2.0 (SP5)", "device_infos" : null, "os_type" : "linux", "pause_docker_image" : "", "host_name" : "ecs-81ba", "cpu" : 4, "log_configs" : null, "host_ips" : [ "192.168.0.161" ], "edged_version" : "2.1.0", "deployment_num" : 1, "device_num" : 0, "upgrade_history" : [ { "to_version" : "2.53.4", "upgrade_time" : 1665215216, "id" : 0, "result" : "install_success", "from_version" : "", "dur_time" : 0 }, { "to_version" : "2.56.5", "upgrade_time" : 1666839798, "id" : 1, "result" : "upgrade_success", "from_version" : "2.56.4", "dur_time" : 22 }, { "to_version" : "2.56.6", "upgrade_time" : 1666872187, "id" : 2, "result" : "upgrade_success", "from_version" : "2.56.5", "dur_time" : 23 } ], "ief_node_version" : "2.56.6", "upgrade_flag" : false, "comment" : "", "ca" : "", "relation" : "", "certificate" : "", "private_key" : "", "attributes" : null, "package" : "", "tags" : null, "product_id" : "", "mqtt_mode" : "internal", "mqtt_internal" : "", "mqtt_external" : "", "enable_npu" : false, "npu_type" : "", "docker_enable" : null, "npu_num" : 0, "npu_info" : [ ], "node_type" : "", "ntp_configs" : null, "nics" : null, "error_reason" : "", "container_runtime_version" : "", "purchase_id" : "", "state_details" : { "register_stat" : "", "purchase_stat" : "", "purchase_error" : "" }, "cert_remaining_valid_time" : 0 } ], "deployments" : [ ], "attributes" : [ ], "failed_node_add" : null, "failed_node_del" : null, "success_node_add" : null, "success_node_del" : null }
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 ief-instance-id 否 String 铂金版实例ID,专业版实例为空值 Content-Type 是 String 消息体的类型(格式),默认取值为“application/json” 表3 请求Body参数 参数 是否必选 参数类型 描述 description 否 String 边缘节点组描述
  • 基本概念 账号 用户注册时的账号,账号对其所拥有的资源及云服务具有完全的访问权限,可以重置用户密码、分配用户权限等。由于账号是付费主体,为了确保账号安全,建议您不要直接使用账号进行日常管理工作,而是创建用户并使用他们进行日常管理工作。 用户 由账号在IAM中创建的用户,是云服务的使用人员,具有身份凭证(密码和访问密钥)。 在我的凭证下,您可以查看账号ID和IAM用户ID。通常在调用API的鉴权过程中,您需要用到账号、用户和密码等信息。 区域(Region) 从地理位置和网络时延维度划分,同一个Region内共享弹性计算、块存储、对象存储、VPC网络、弹性公网IP、镜像等公共服务。Region分为通用Region和专属Region,通用Region指面向公共租户提供通用云服务的Region;专属Region指只承载同一类业务或只面向特定租户提供业务服务的专用Region。 详情请参见区域和可用区。 可用区(AZ,Availability Zone) 一个可用区是一个或多个物理数据中心的集合,有独立的风火水电,AZ内逻辑上再将计算、网络、存储等资源划分成多个集群。一个Region中的多个AZ间通过高速光纤相连,以满足用户跨AZ构建高可用性系统的需求。 项目 区域默认对应一个项目,这个项目由系统预置,用来隔离物理区域间的资源(计算资源、存储资源和网络资源),以默认项目为单位进行授权,用户可以访问您账号中该区域的所有资源。如果您希望进行更加精细的权限控制,可以在区域默认的项目中创建子项目,并在子项目中创建资源,然后以子项目为单位进行授权,使得用户仅能访问特定子项目中的资源,使得资源的权限控制更加精确。 图1 项目隔离模型 同样在我的凭证下,您可以查看项目ID。 企业项目 企业项目是项目的升级版,针对企业不同项目间的资源进行分组和管理,是逻辑隔离。企业项目中可以包含多个区域的资源,且项目中的资源可以迁入迁出。 关于企业项目ID的获取及企业项目特性的详细信息,请参见《企业管理用户指南》。 父主题: 使用前必读
  • 请求消息体(可选) 该部分可选。请求消息体通常以结构化格式(如JSON或XML)发出,与请求消息头中Content-Type对应,传递除请求消息头之外的内容。若请求消息体中的参数支持中文,则中文字符必须为UTF-8编码。 每个接口的请求消息体内容不同,也并不是每个接口都需要有请求消息体(或者说消息体为空),GET、DELETE操作类型的接口就不需要消息体,消息体具体内容需要根据具体接口而定。 对于获取用户Token接口,您可以从接口的请求部分看到所需的请求参数及参数说明。将消息体加入后的请求如下所示,加粗的斜体字段需要根据实际值填写,其中username为用户名,domainname为用户所属的账号名称,********为用户登录密码,xxxxxxxxxxxxxxxxxx为project的名称,如“cn-north-4”,您可以从地区和终端节点获取。 scope参数定义了Token的作用域,下面示例中获取的Token仅能访问project下的资源。您还可以设置Token的作用域为某个账号下所有资源或账号的某个project下的资源,详细定义请参见获取用户Token。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 POST https://iam.cn-north-4.myhuaweicloud.com/v3/auth/tokens Content-Type: application/json { "auth": { "identity": { "methods": [ "password" ], "password": { "user": { "name": "username", "password": "********", "domain": { "name": "domainname" } } } }, "scope": { "project": { "name": "xxxxxxxxxxxxxxxxxx" } } } } 到这里为止这个请求需要的内容就具备齐全了,您可以使用curl、Postman或直接编写代码等方式发送请求调用API。对于获取用户Token接口,返回的响应消息头中“x-subject-token”就是需要获取的用户Token。有了Token之后,您就可以使用Token认证调用其他API。
  • 请求方法 HTTP请求方法(也称为操作或动词),它告诉服务你正在请求什么类型的操作。 表2 HTTP方法 方法 说明 GET 请求服务器返回指定资源。 PUT 请求服务器更新指定资源。 POST 请求服务器新增资源或执行特殊操作。 DELETE 请求服务器删除指定资源,如删除对象等。 HEAD 请求服务器资源头部。 PATCH 请求服务器更新资源的部分内容。 当资源不存在的时候,PATCH可能会去创建一个新的资源。 在获取用户Token的URI部分,您可以看到其请求方法为“POST”,则其请求为: 1 POST https://iam.cn-north-4.myhuaweicloud.com/v3/auth/tokens
  • 请求消息头 附加请求头字段,如指定的URI和HTTP方法所要求的字段。例如定义消息体类型的请求头“Content-Type”,请求鉴权信息等。 详细的公共请求消息头字段请参见表3。 表3 公共请求消息头 名称 描述 是否必选 示例 Host 请求的服务器信息,从服务API的URL中获取。值为hostname[:port]。端口缺省时使用默认的端口,https的默认端口为443。 否 使用AK/SK认证时该字段必选。 code.test.com or code.test.com:443 Content-Type 消息体的类型(格式)。推荐用户使用默认值application/json,有其他取值时会在具体接口中专门说明。 是 application/json Content-Length 请求body长度,单位为Byte。 否 3495 X-Project-Id project id,项目编号。请参考获取项目ID章节获取项目编号。 否 如果是专属云场景采用AK/SK认证方式的接口请求或者多project场景采用AK/SK认证的接口请求,则该字段必选。 e9993fc787d94b6c886cbaa340f9c0f4 X-Auth-Token 用户Token。 用户Token也就是调用获取用户Token接口的响应值,该接口是唯一不需要认证的接口。 请求响应成功后在响应消息头(Headers)中包含的“X-Subject-Token”的值即为Token值。 否 使用Token认证时该字段必选。 注:以下仅为Token示例片段 MIIPAgYJKoZIhvcNAQcCo...ggg1BBIINPXsidG9rZ ief-instance-id 铂金版实例ID。 使用铂金版实例时需要添加。 db953bf7-9f6c-4e90-9963-0a4453df72ba API同时支持使用AK/SK认证,AK/SK认证是使用SDK对请求进行签名,签名过程会自动往请求中添加Authorization(签名认证信息)和X-Sdk-Date(请求发送的时间)请求头。 AK/SK认证的详细说明请参见认证鉴权的“AK/SK认证”。 对于获取用户Token接口,由于不需要认证,所以只添加“Content-Type”即可,添加消息头后的请求如下所示。 1 2 POST https://iam.cn-north-4.myhuaweicloud.com/v3/auth/tokens Content-Type: application/json
  • 请求URI 请求URI由如下部分组成: {URI-scheme}://{Endpoint}/{resource-path}?{query-string} 尽管请求URI包含在请求消息头中,但大多数语言或框架都要求您从请求消息中单独传递它,所以在此单独强调。 表1 URI中的参数说明 参数 描述 URI-scheme 表示用于传输请求的协议,当前所有API均采用HTTPS协议。 Endpoint 指定承载REST服务端点的服务器域名或IP,不同服务不同区域的Endpoint不同,您可以从地区和终端节点获取。 例如IAM服务在“华北-北京四”区域的Endpoint为“iam.cn-north-4.myhuaweicloud.com”。 resource-path 资源路径,也即API访问路径。从具体API的URI模块获取,例如“获取用户Token”API的resource-path为“/v3/auth/tokens”。 query-string 查询参数,是可选部分,并不是每个API都有查询参数。查询参数前面需要带一个“?”,形式为“参数名=参数取值”,例如“limit=10”,表示查询不超过10条数据。 例如您需要获取IAM在“华北-北京四”区域的Token,则需使用“华北-北京四”区域的Endpoint(iam.cn-north-4.myhuaweicloud.com),并在获取用户Token的URI部分找到resource-path(/v3/auth/tokens),拼接起来如下所示。 1 https://iam.cn-north-4.myhuaweicloud.com/v3/auth/tokens 图1 URI示意图 为查看方便,在每个具体API的URI部分,只给出resource-path部分,并将请求方法写在一起。这是因为URI-scheme都是HTTPS,而Endpoint在同一个区域也相同,所以简洁起见将这两部分省略。
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 ief-instance-id 否 String 铂金版实例ID,专业版实例为空值 Content-Type 是 String 消息体的类型(格式),默认取值为“application/json” 表3 请求Body参数 参数 是否必选 参数类型 描述 name 是 String 节点组名称。只允许中文字符、英文字母、数字、下划线、中划线,最大长度64 description 否 String 节点组描述。最大长度255个字符 node_ids 否 Array of strings 节点组绑定的节点ID列表 tags 否 Array of Attributes objects 节点组标签 device_ids 否 Array of strings 节点组绑定的终端设备ID列表 表4 Attributes 参数 是否必选 参数类型 描述 key 否 String 节点属性的key值,长度取值范围为1~128, 仅允许大小写英文字母、数字、下划线、中划线 value 否 String 节点属性的value值,长度取值范围为1~256, 仅允许大小写英文字母、数字、下划线、中划线
  • 响应示例 状态码: 201 边缘节点组详细信息 { "id" : "e4f9c0d6-e1d7-41d5-a108-f38aa8372ffd", "name" : "test1", "description" : "", "created_at" : "2022-06-07 08:21:05.794205 +0000 UTC", "updated_at" : "2022-06-07 08:21:05.794217 +0000 UTC", "project_id" : "xxx", "iam_role" : "", "memory" : 8595, "cpu" : 5, "gpu_num" : 0, "nodes" : [ { "id" : "024e05a8-89bf-46d8-b298-700a2af69605", "project_id" : "xxx", "name" : "test1", "description" : "", "created_at" : "2022-08-05 02:14:52.351802 +0000 UTC", "updated_at" : "2022-10-31 19:19:37.104359 +0000 UTC", "state" : "RUNNING", "master_addr" : "xxx/xxx", "arch" : "x86_64", "enable_gpu" : false, "gpu_info" : [ ], "gpu_num" : 0, "memory" : 990, "os_version" : "3.10.0-1062.12.1.el7.x86_64", "os_name" : "CentOS Linux 7 (Core)", "device_infos" : null, "os_type" : "linux", "pause_docker_image" : "", "host_name" : "test1", "cpu" : 1, "log_configs" : [ { "level" : "on", "rotate_num" : 5, "component" : "app", "rotate_period" : "yearly", "type" : "LTS", "id" : "", "size" : 50 }, { "level" : "info", "rotate_num" : 5, "component" : "system", "rotate_period" : "yearly", "type" : "LTS", "id" : "", "size" : 50 }, { "level" : "", "rotate_num" : 5, "component" : "app", "rotate_period" : "daily", "type" : "local", "id" : "", "size" : 50 }, { "level" : "info", "rotate_num" : 5, "component" : "system", "rotate_period" : "daily", "type" : "local", "id" : "", "size" : 50 } ], "host_ips" : [ "192.168.0.x" ], "edged_version" : "2.1.0", "deployment_num" : 1, "device_num" : 2, "upgrade_history" : [ { "to_version" : "2.55.8", "upgrade_time" : 1659694662, "id" : 0, "result" : "install_success", "from_version" : "", "dur_time" : 0 }, { "to_version" : "2.55.9", "upgrade_time" : 1660642318, "id" : 1, "result" : "upgrade_success", "from_version" : "2.55.8", "dur_time" : 30 }, { "to_version" : "2.56.0", "upgrade_time" : 1662019732, "id" : 2, "result" : "upgrade_success", "from_version" : "2.55.9", "dur_time" : 29 }, { "to_version" : "2.56.0", "upgrade_time" : 1663125401, "id" : 3, "result" : "upgrade_failed_rollback_success", "from_version" : "2.56.0", "dur_time" : 3 } ], "ief_node_version" : "2.3.0", "upgrade_flag" : false, "comment" : "", "ca" : "", "relation" : "", "certificate" : "", "private_key" : "", "attributes" : null, "package" : "", "tags" : null, "product_id" : "", "mqtt_mode" : "internal", "mqtt_internal" : "", "mqtt_external" : "", "enable_npu" : false, "npu_type" : "", "docker_enable" : null, "npu_num" : 0, "npu_info" : [ ], "node_type" : "", "ntp_configs" : null, "nics" : null, "error_reason" : "", "container_runtime_version" : "", "purchase_id" : "", "state_details" : { "register_stat" : "", "purchase_stat" : "", "purchase_error" : "" }, "cert_remaining_valid_time" : 0 }, { "id" : "de5d81fe-a58e-4ec4-be9d-f3906d7fe356", "project_id" : "xxx", "name" : "cjq-test-1008", "description" : "", "created_at" : "2022-10-07 23:19:18.147956 +0000 UTC", "updated_at" : "2022-10-27 23:20:09.631153 +0000 UTC", "state" : "RUNNING", "master_addr" : "xxx", "arch" : "x86_64", "enable_gpu" : false, "gpu_info" : [ ], "gpu_num" : 0, "memory" : 7805, "os_version" : "3.10.0-862.14.1.5.h408.eulerosv2r7.x86_64", "os_name" : "EulerOS 2.0 (SP5)", "device_infos" : null, "os_type" : "linux", "pause_docker_image" : "", "host_name" : "ecs-81ba", "cpu" : 4, "log_configs" : null, "host_ips" : [ "192.168.0.161" ], "edged_version" : "2.1.0", "deployment_num" : 1, "device_num" : 0, "upgrade_history" : [ { "to_version" : "2.53.4", "upgrade_time" : 1665215216, "id" : 0, "result" : "install_success", "from_version" : "", "dur_time" : 0 }, { "to_version" : "2.56.5", "upgrade_time" : 1666839798, "id" : 1, "result" : "upgrade_success", "from_version" : "2.56.4", "dur_time" : 22 }, { "to_version" : "2.56.6", "upgrade_time" : 1666872187, "id" : 2, "result" : "upgrade_success", "from_version" : "2.56.5", "dur_time" : 23 } ], "ief_node_version" : "2.56.6", "upgrade_flag" : false, "comment" : "", "ca" : "", "relation" : "", "certificate" : "", "private_key" : "", "attributes" : null, "package" : "", "tags" : null, "product_id" : "", "mqtt_mode" : "internal", "mqtt_internal" : "", "mqtt_external" : "", "enable_npu" : false, "npu_type" : "", "docker_enable" : null, "npu_num" : 0, "npu_info" : [ ], "node_type" : "", "ntp_configs" : null, "nics" : null, "error_reason" : "", "container_runtime_version" : "", "purchase_id" : "", "state_details" : { "register_stat" : "", "purchase_stat" : "", "purchase_error" : "" }, "cert_remaining_valid_time" : 0 } ], "deployments" : [ ], "attributes" : [ ], "failed_node_add" : null, "failed_node_del" : null, "success_node_add" : null, "success_node_del" : null }
  • 请求示例 管理边缘节点组,指定边缘节点组绑定的节点ID。 { "name" : "test1", "description" : "", "device_ids" : [ ], "node_ids" : [ "024e05a8-89bf-46d8-b298-700a2af69605", "de5d81fe-a58e-4ec4-be9d-f3906d7fe356" ], "tags" : [ ] }
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 Content-Type 是 String 消息体的类型(格式),默认取值为“application/json” X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 ief-instance-id 否 String 铂金版实例ID,专业版实例为空值
  • 响应示例 状态码: 200 ok { "rule" : { "name" : "eventbus-to-dis", "description" : "", "source_resource" : { "node_id" : "5a98f0d8-6827-45e8-871d-b865111fbe68", "topic" : "ed202955e111444e8ced21a1bd75fc59/nodes/5a98f0d8-6827-45e8-871d-b865111fbe68/user/aaa" }, "target_resource" : { "channel" : "dis-I5QG" }, "in_using" : true, "ief_instance_id" : "", "id" : "18bcb8bb-019b-4a5b-835b-6a444b3b04e9", "project_id" : "ed202955e111444e8ced21a1bd75fc59", "created_at" : "2022-06-07T03:09:03Z", "updated_at" : "2022-06-07T03:09:03Z", "source" : { "name" : "SystemEventBus", "description" : "", "type" : "eventbus", "properties" : { }, "ief_instance_id" : "", "is_shared" : true, "id" : "6bf2fda9-810c-40ed-8623-ff9396fe357d", "project_id" : "9ff38382ccc546ac9635800c3315a5e2", "created_at" : "2019-03-09T11:42:45Z", "updated_at" : "2021-10-11T09:16:09Z" }, "target" : { "name" : "test", "description" : "", "type" : "dis", "properties" : { "domain_id" : "d0857ebddc514a7381c3673363e61337" }, "ief_instance_id" : "", "is_shared" : false, "id" : "da14393a-b65a-4303-b74d-4cdf1dc44784", "project_id" : "ed202955e111444e8ced21a1bd75fc59", "created_at" : "2022-06-07T03:06:03Z", "updated_at" : "2022-06-07T03:06:03Z" }, "fail_messages" : 0, "success_messages" : 0 } }
  • 支持的授权项 策略包含系统策略和自定义策略,如果系统策略不满足授权要求,管理员可以创建自定义策略,并通过给用户组授予自定义策略来进行精细的访问控制。策略支持的操作与API相对应,授权项列表说明如下: 权限:允许或拒绝某项操作。 对应API接口:自定义策略实际调用的API接口。 授权项:自定义策略中支持的Action,在自定义策略中的Action中写入授权项,可以实现授权项对应的权限功能。 依赖的授权项:部分Action存在对其他Action的依赖,需要将依赖的Action同时写入授权项,才能实现对应的权限功能。 IAM项目(Project):自定义策略的授权范围。授权范围仅支持IAM项目,不支持企业项目,表示仅能在IAM中给用户组授权并生效,如果在企业管理中授权,则该自定义策略不生效。 表1 IEF授权项 权限 对应API接口 授权项(Action) 创建IEF实例 POST /v2/{project_id}/edgemgr/ief_instances ief:iefInstance:create 删除IEF实例 DELETE /v2/{project_id}/edgemgr/ief_instances/{ief_instance_id} ief:iefInstance:delete 查询IEF实例信息 GET /v2/{project_id}/edgemgr/ief_instances/{ief_instance_id} ief:iefInstance:get 查询IEF实例列表信息 GET /v2/{project_id}/edgemgr/ief_instances ief:iefInstance:list 创建边缘节点 POST /v2/{project_id}/edgemgr/nodes ief:node:create 创建边缘节点证书 POST /v2/{project_id}/edgemgr/nodes/{node_id}/certs ief:node:createNodeCert 删除边缘节点 DELETE /v2/{project_id}/edgemgr/nodes/{node_id} ief:node:delete 删除边缘节点证书 DELETE /v2/{project_id}/edgemgr/nodes/{node_id}/certs/{cert_id} ief:node:deleteNodeCert 查询边缘节点信息 GET /v2/{project_id}/edgemgr/nodes/{node_id} ief:node:get 查询边缘节点列表信息 GET /v2/{project_id}/edgemgr/nodes ief:node:list 查询边缘节点证书 GET /v2/{project_id}/edgemgr/nodes/{node_id}/certs ief:node:listNodeCert 启动或停用边缘节点 POST /v2/{project_id}/edgemgr/nodes/{node_id}/action ief:node:action 维护边缘节点 POST /v2/{project_id}/edgemgr/nodes/{node_id}/maintain ief:node:maintain 更新边缘节点 PUT /v2/{project_id}/edgemgr/groups/{group_id}/nodes ief:node:update 升级边缘节点 POST /v2/{project_id}/edgemgr/nodes/{node_id}/upgrade ief:node:upgrade 创建边缘节点组 POST /v2/{project_id}/edgemgr/groups ief:group:create 删除边缘节点组 DELETE /v2/{project_id}/edgemgr/groups/{group_id} ief:group:delete 绑定设备到边缘节点组 PUT /v2/{project_id}/edgemgr/groups/{group_id}/devices ief:group:deviceBinding 查询边缘节点组信息 GET /v2/{project_id}/edgemgr/groups/{group_id} ief:group:get 查询边缘节点组列表信息 GET /v2/{project_id}/edgemgr/groups ief:group:list 查询节点组实例状态 POST /v2/{project_id}/edgemgr/groups/instancestate ief:group:listInstanceState 绑定边缘节点到边缘节点组 PUT /v2/{project_id}/edgemgr/groups/{group_id}/nodes ief:group:bindNode 更新边缘节点组 PUT /v2/{project_id}/edgemgr/groups/{group_id} ief:group:update 创建设备 POST /v2/{project_id}/edgemgr/devices ief:device:create 删除设备 DELETE /v2/{project_id}/edgemgr/devices/{device_id} ief:device:delete 查询设备 GET /v2/{project_id}/edgemgr/devices/{device_id} ief:device:get 查询设备列表 GET /v2/{project_id}/edgemgr/devices ief:device:list 更新设备 PUT /v2/{project_id}/edgemgr/devices/{device_id} ief:device:update 绑定设备 PUT /v2/{project_id}/edgemgr/nodes/{node_id}/devices ief:node:bindDevices 创建应用部署 POST /v3/{project_id}/edgemgr/deployments ief:deployment:create 删除应用部署 DELETE /v3/{project_id}/edgemgr/deployments/{deployment_id} ief:deployment:delete 查询应用部署信息 GET /v3/{project_id}/edgemgr/deployments/{deployment_id} ief:deployment:get 查询应用部署列表信息 GET /v3/{project_id}/edgemgr/deployments ief:deployment:list 更新应用部署 PUT /v3/{project_id}/edgemgr/deployments/{deployment_id} ief:deployment:update 创建应用模板 POST /v2/{project_id}/edgemgr/apps ief:application:create 删除应用模板 DELETE /v2/{project_id}/edgemgr/apps/{app_id} ief:application:delete 查询应用模板信息 GET /v2/{project_id}/edgemgr/apps/{app_id} ief:application:get 查询应用模板列表信息 GET /v2/{project_id}/edgemgr/apps ief:application:list 更新应用模板 PUT /v2/{project_id}/edgemgr/apps/{app_id} ief:application:update 创建应用模板版本 POST /v2/{project_id}/edgemgr/apps/{app_id}/versions ief:appVersion:create 删除应用模板版本 DELETE /v2/{project_id}/edgemgr/apps/{app_id}/versions/{version_id} ief:appVersion:delete 查询应用模板版本信息 GET /v2/{project_id}/edgemgr/apps/{app_id}/versions/{version_id} ief:appVersion:get 查询应用模板版本列表信息 GET /v2/{project_id}/edgemgr/apps/{app_id}/versions ief:appVersion:list 更新应用模板版本 PUT /v2/{project_id}/edgemgr/apps/{app_id}/versions/{version_id} ief:appVersion:update 创建消息端点 POST /v2/{project_id}/routermgr/endpoints ief:endpoint:create 删除消息端点 DELETE /v2/{project_id}/routermgr/endpoints/{endpoint_id} ief:endpoint:delete 查询消息端点 GET /v2/{project_id}/routermgr/endpoints/{endpoint_id} ief:endpoint:get 查询消息端点列表 GET /v2/{project_id}/routermgr/endpoints ief:endpoint:list 更新消息端点 PUT /v2/{project_id}/routermgr/endpoints/{endpoint_id} ief:endpoint:update 创建消息路由 POST /v2/{project_id}/routermgr/rules ief:rule:create 删除消息路由 DELETE /v2/{project_id}/routermgr/rules/{rule_id} ief:rule:delete 查询消息路由 GET /v2/{project_id}/routermgr/rules/{rule_id} ief:rule:get 查询消息路由列表 GET /v2/{project_id}/routermgr/rules ief:rule:list 更新消息路由 POST /v2/{project_id}/routemgr/rules/{rule_id}/start ief:rule:update 创建批量作业 POST /v2/{project_id}/productmgr/jobs ief:batchjob:create 删除批量作业 DELETE /v2/{project_id}/productmgr/jobs/{job_id} ief:batchjob:delete 查询批量作业 GET /v2/{project_id}/productmgr/jobs/{job_id} ief:batchjob:get 查询批量作业列表信息 GET /v2/{project_id}/productmgr/jobs ief:batchjob:list 暂停批量作业 POST /v2/{project_id}/productmgr/jobs/{job_id}/pause ief:batchjob:pause 恢复批量作业 POST /v2/{project_id}/productmgr/jobs/{job_id}/restore ief:batchjob:restore 重试批量作业 POST /v2/{project_id}/productmgr/jobs/{job_id}/retry ief:batchjob:retry 创建配置项 POST /v2/{project_id}/edgemgr/configmaps ief:configmap:create 删除配置项 DELETE /v2/{project_id}/edgemgr/configmaps/{configmap_id} ief:configmap:delete 查询配置项 GET /v2/{project_id}/edgemgr/configmaps/{configmap_id} ief:configmap:get 查询配置项列表 GET /v2/{project_id}/edgemgr/configmaps ief:configmap:list 更新配置项 PUT /v2/{project_id}/edgemgr/configmaps/{configmap_id} ief:configmap:update 创建密钥 POST /v2/{project_id}/edgemgr/secrets ief:secret:create 删除密钥 DELETE /v2/{project_id}/edgemgr/secrets/{secret_id} ief:secret:delete 查询密钥 GET /v2/{project_id}/edgemgr/secrets/{secret_id} ief:secret:get 查询密钥列表 GET /v2/{project_id}/edgemgr/secrets ief:secret:list 更新密钥 PUT /v2/{project_id}/edgemgr/secrets/{secret_id} ief:secret:update 创建加密数据 POST /v2/{project_id}/edm/encryptdatas/encrypt ief:secureSecret:create 删除加密数据 DELETE /v2/{project_id}/edm/encryptdatas/{encryptdata_id} ief:secureSecret:delete 查询加密数据 GET /v2/{project_id}/edm/encryptdatas/{encryptdata_id} ief:secureSecret:get 查询加密数据列表 GET /v2/{project_id}/edm/encryptdatas ief:secureSecret:list 更新加密数据 PUT /v2/{project_id}/edm/encryptdatas/{encryptdata_id} ief:secureSecret:update 创建产品 POST /v2/{project_id}/productmgr/products ief:product:create 删除产品 DELETE /v2/{project_id}/productmgr/products/{product_id} ief:product:delete 查询产品信息 GET /v2/{project_id}/productmgr/products/{product_id} ief:product:get 查询产品列表信息 GET /v2{project_id}/productmgr/products ief:product:list 产品注册边缘节点 POST /v2/productmgr/nodes/register ief:product:nodeRegister 创建系统订阅 POST /v2/{project_id}/routemgr/exchanger/systemevents ief:systemEvent:create 删除系统订阅 DELETE /v2/{project_id}/routemgr/exchanger/systemevents/{event-id} ief:systemEvent:delete 查询系统订阅 GET /v2/{project_id}/routemgr/exchanger/systemevents/{event-id} ief:systemEvent:get 查询系统订阅列表 GET /v2/{project_id}/routemgr/exchanger/systemevents ief:systemEvent:list 更新系统订阅 POST /v2/{project_id}/routemgr/exchanger/systemevents/{event-id}/start ief:systemEvent:update 安装插件 POST /v3/{project_id}/edgemgr/plugins ief:plugin:create 卸载插件 DELETE /v3/{project_id}/edgemgr/plugins/{plugin_instance_name} ief:plugin:delete 查询插件 GET /v3/{project_id}/edgemgr/plugins/{plugin_instance_name} ief:plugin:get 查询插件列表 GET /v3/{project_id}/edgemgr/plugins ief:plugin:list 升级插件 PUT /v3/{project_id}/edgemgr/plugins/{plugin_instance_name} ief:plugin:update 查询配额 GET /v2/{project_id}/edgemgr/quotas ief:quota:get
  • 响应示例 状态码: 200 查询成功 { "id" : "e4f9c0d6-e1d7-41d5-a108-f38aa8372ffd", "name" : "test1", "description" : "", "created_at" : "2022-06-07 08:21:05.794205 +0000 UTC", "updated_at" : "2022-06-07 08:21:05.794217 +0000 UTC", "project_id" : "xxx", "iam_role" : "", "memory" : 8595, "cpu" : 5, "gpu_num" : 0, "nodes" : [ { "id" : "024e05a8-89bf-46d8-b298-700a2af69605", "project_id" : "xxx", "name" : "test1", "description" : "", "created_at" : "2022-08-05 02:14:52.351802 +0000 UTC", "updated_at" : "2022-10-31 19:19:37.104359 +0000 UTC", "state" : "RUNNING", "master_addr" : "xxx/xxx", "arch" : "x86_64", "enable_gpu" : false, "gpu_info" : [ ], "gpu_num" : 0, "memory" : 990, "os_version" : "3.10.0-1062.12.1.el7.x86_64", "os_name" : "CentOS Linux 7 (Core)", "device_infos" : null, "os_type" : "linux", "pause_docker_image" : "", "host_name" : "test1", "cpu" : 1, "log_configs" : [ { "level" : "on", "rotate_num" : 5, "component" : "app", "rotate_period" : "yearly", "type" : "LTS", "id" : "", "size" : 50 }, { "level" : "info", "rotate_num" : 5, "component" : "system", "rotate_period" : "yearly", "type" : "LTS", "id" : "", "size" : 50 }, { "level" : "", "rotate_num" : 5, "component" : "app", "rotate_period" : "daily", "type" : "local", "id" : "", "size" : 50 }, { "level" : "info", "rotate_num" : 5, "component" : "system", "rotate_period" : "daily", "type" : "local", "id" : "", "size" : 50 } ], "host_ips" : [ "192.168.0.x" ], "edged_version" : "2.1.0", "deployment_num" : 1, "device_num" : 2, "upgrade_history" : [ { "to_version" : "2.55.8", "upgrade_time" : 1659694662, "id" : 0, "result" : "install_success", "from_version" : "", "dur_time" : 0 }, { "to_version" : "2.55.9", "upgrade_time" : 1660642318, "id" : 1, "result" : "upgrade_success", "from_version" : "2.55.8", "dur_time" : 30 }, { "to_version" : "2.56.0", "upgrade_time" : 1662019732, "id" : 2, "result" : "upgrade_success", "from_version" : "2.55.9", "dur_time" : 29 }, { "to_version" : "2.56.0", "upgrade_time" : 1663125401, "id" : 3, "result" : "upgrade_failed_rollback_success", "from_version" : "2.56.0", "dur_time" : 3 } ], "ief_node_version" : "2.3.0", "upgrade_flag" : false, "comment" : "", "ca" : "", "relation" : "", "certificate" : "", "private_key" : "", "attributes" : null, "package" : "", "tags" : null, "product_id" : "", "mqtt_mode" : "internal", "mqtt_internal" : "", "mqtt_external" : "", "enable_npu" : false, "npu_type" : "", "docker_enable" : null, "npu_num" : 0, "npu_info" : [ ], "node_type" : "", "ntp_configs" : null, "nics" : null, "error_reason" : "", "container_runtime_version" : "", "purchase_id" : "", "state_details" : { "register_stat" : "", "purchase_stat" : "", "purchase_error" : "" }, "cert_remaining_valid_time" : 0 }, { "id" : "de5d81fe-a58e-4ec4-be9d-f3906d7fe356", "project_id" : "xxx", "name" : "cjq-test-1008", "description" : "", "created_at" : "2022-10-07 23:19:18.147956 +0000 UTC", "updated_at" : "2022-10-27 23:20:09.631153 +0000 UTC", "state" : "RUNNING", "master_addr" : "xxx", "arch" : "x86_64", "enable_gpu" : false, "gpu_info" : [ ], "gpu_num" : 0, "memory" : 7805, "os_version" : "3.10.0-862.14.1.5.h408.eulerosv2r7.x86_64", "os_name" : "EulerOS 2.0 (SP5)", "device_infos" : null, "os_type" : "linux", "pause_docker_image" : "", "host_name" : "ecs-81ba", "cpu" : 4, "log_configs" : null, "host_ips" : [ "192.168.0.161" ], "edged_version" : "2.1.0", "deployment_num" : 1, "device_num" : 0, "upgrade_history" : [ { "to_version" : "2.53.4", "upgrade_time" : 1665215216, "id" : 0, "result" : "install_success", "from_version" : "", "dur_time" : 0 }, { "to_version" : "2.56.5", "upgrade_time" : 1666839798, "id" : 1, "result" : "upgrade_success", "from_version" : "2.56.4", "dur_time" : 22 }, { "to_version" : "2.56.6", "upgrade_time" : 1666872187, "id" : 2, "result" : "upgrade_success", "from_version" : "2.56.5", "dur_time" : 23 } ], "ief_node_version" : "2.56.6", "upgrade_flag" : false, "comment" : "", "ca" : "", "relation" : "", "certificate" : "", "private_key" : "", "attributes" : null, "package" : "", "tags" : null, "product_id" : "", "mqtt_mode" : "internal", "mqtt_internal" : "", "mqtt_external" : "", "enable_npu" : false, "npu_type" : "", "docker_enable" : null, "npu_num" : 0, "npu_info" : [ ], "node_type" : "", "ntp_configs" : null, "nics" : null, "error_reason" : "", "container_runtime_version" : "", "purchase_id" : "", "state_details" : { "register_stat" : "", "purchase_stat" : "", "purchase_error" : "" }, "cert_remaining_valid_time" : 0 } ], "deployments" : [ ], "attributes" : [ ], "failed_node_add" : null, "failed_node_del" : null, "success_node_add" : null, "success_node_del" : null }
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 Content-Type 是 String 消息体的类型(格式),默认取值为“application/json” ief-instance-id 否 String 铂金版实例ID,专业版实例为空值
  • 响应示例 状态码: 200 查询成功 { "endpoints" : [ { "name" : "SystemREST", "description" : "", "type" : "rest", "properties" : { "public" : "stargate-elb.ief-system.svc.cluster.local" }, "ief_instance_id" : "38898a99-d67c-41f8-a8cb-8c53d6d297ba", "is_shared" : true, "id" : "94150bf3-457e-4c93-8cd1-7cd3b203634b", "project_id" : "ed202955e111444e8ced21a1bd75fc59", "created_at" : "2022-04-29T18:27:28.048855+08:00", "updated_at" : "2022-04-29T18:27:28.048855+08:00" }, { "name" : "SystemEventBus", "description" : "", "type" : "eventbus", "properties" : { }, "ief_instance_id" : "default", "is_shared" : true, "id" : "383b985e-402b-4ed0-924c-911a787ff9b7", "project_id" : "op_svc_ief_container1", "created_at" : "2021-05-12T20:39:34.553763+08:00", "updated_at" : "2022-09-02T17:11:55.792879+08:00" } ] }
  • URI GET /v2/{project_id}/routemgr/endpoints 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID 表2 Query参数 参数 是否必选 参数类型 描述 name 否 String 端点名称 type 否 String 端点类型 枚举值: dis servicebus apigw is_shared 否 String 端点是否共享 limit 否 Integer 查询返回记录的数量限制 offset 否 Integer 偏移量,表示查询该偏移量后面的记录
  • 请求参数 表3 请求Header参数 参数 是否必选 参数类型 描述 Content-Type 是 String 消息体的类型(格式),默认取值为“application/json” X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 ief-instance-id 否 String 铂金版实例ID,专业版实例为空值
  • 请求参数 表3 请求Header参数 参数 是否必选 参数类型 描述 Content-Type 是 String 消息体的类型(格式),默认取值为“application/json” X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 ief-instance-id 否 String 铂金版实例ID,专业版实例为空值
  • 响应示例 状态码: 200 查询成功 { "devices" : [ { "id" : "1398f13d-f24d-4de4-8cd3-5905db1d6d9f", "name" : "device", "access_protocol" : "", "project_id" : "05e1aef9040010e22fccc009adecb056", "description" : "", "created_at" : "2020-09-23T02:00:22.858736Z", "updated_at" : "", "access_config" : { }, "connection_type" : "edge" } ], "count" : 1 }
  • URI GET /v2/{project_id}/edgemgr/devices 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID 表2 Query参数 参数 是否必选 参数类型 描述 name 否 String 终端设备名称,模糊匹配 node_id 否 String 节点ID, 精确匹配 limit 否 String 每页显示的条目数量,取值范围1~1000,默认为1000 offset 否 String 查询的起始位置,取值范围为非负整数,默认为0 is_binding 否 String 是否绑定到边缘节点,为“true”时返回所有已绑定到节点的设备列表;为“false”则返回未绑定节点的设备列表。 tags 否 String 标签的key和value通过点连接, 多个标签通过逗号连接,如:tags=key1.value1,key2.value2
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 Content-Type 是 String 消息体的类型(格式),默认取值为“application/json” X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 ief-instance-id 否 String 铂金版实例ID,专业版实例为空值
共100000条