{"base_path":"/","components":null,"consumes":"[\"application/json\"]","definitions":{"Affinity":{"description":"应用实例亲和性规则,仅铂金版支持","properties":{"nodeAffinity":{"description":"节点亲和规则","properties":{"preferredDuringSchedulingIgnoredDuringExecution":{"description":"优先使用定义的规则调度,且不会影响已经在节点上运行的Pod。即优先选择调度到满足规则的节点,但也可能会调度到不满足规则的节点。","items":{"$ref":"#/definitions/PreferredSchedulingTerm"},"type":"array"},"requiredDuringSchedulingIgnoredDuringExecution":{"$ref":"#/definitions/RequiredDuringScheduling"}}},"podAffinity":{"description":"Pod亲和规则","properties":{"preferredDuringSchedulingIgnoredDuringExecution":{"description":"优先使用定义的规则调度,且不会影响已经在节点上运行的Pod。即优先选择调度到满足规则的节点,但也可能会调度到不满足规则的节点。","items":{"$ref":"#/definitions/WeightPodAffinityTerms"},"type":"array"},"requiredDuringSchedulingIgnoredDuringExecution":{"description":"强制使用定义的规则调度,且不会影响已经在节点上运行的Pod。即强制选择调度到满足规则的节点,不会调度到不满足规则的节点。","items":{"$ref":"#/definitions/PodAffinityTerm"},"type":"array"}}},"podAntiAffinity":{"description":"Pod反亲和规则","properties":{"preferredDuringSchedulingIgnoredDuringExecution":{"description":"优先使用定义的规则调度,且不会影响已经在节点上运行的Pod。即优先选择调度到满足规则的节点,但也可能会调度到不满足规则的节点。","items":{"$ref":"#/definitions/WeightPodAffinityTerms"},"type":"array"},"requiredDuringSchedulingIgnoredDuringExecution":{"description":"强制使用定义的规则调度,且不会影响已经在节点上运行的Pod。即强制选择调度到满足规则的节点,不会调度到不满足规则的节点。","items":{"$ref":"#/definitions/PodAffinityTerm"},"type":"array"}}}}},"Annotations":{"description":"应用扩展功能配置选项","properties":{"autonomy_edge_selector":{"description":"离线自愈功能配置字段,须填写调度的节点组id","type":"string"},"ring_controller":{"description":"生成ranktablefile。该参数目前只支持赋值\"ascend-1980\",指昇腾D910。","type":"string"}}},"Attributes":{"description":"节点属性","properties":{"key":{"description":"节点属性的key值,长度取值范围为1~128, 仅允许大小写英文字母、数字、下划线、中划线","type":"string"},"value":{"description":"节点属性的value值,长度取值范围为1~256, 仅允许大小写英文字母、数字、下划线、中划线","type":"string"}}},"ConfigsMap":{"description":"环境变量引用配置项时使用。","properties":{"key":{"description":"配置项的属性名","type":"string"},"name":{"description":"配置项的名称","type":"string"}},"required":["name","key"]},"ContainerDef":{"properties":{"args":{"description":"容器启动参数,字符总长度最大为65536","items":{"type":"string"},"type":"array"},"command":{"description":"容器启动命令,字符总长度最大为65536。\ncommand支持使用数组定义多条命令,但在IEF控制台界面只会显示第一条命令。","items":{"type":"string"},"type":"array"},"envs":{"description":"环境变量","items":{"$ref":"#/definitions/Env"},"type":"array"},"image_url":{"description":"容器镜像URL","type":"string"},"liveness_probe":{"$ref":"#/definitions/Probe"},"name":{"description":"容器名称,只允许英文小写字母、数字、中划线,最大长度32, 英文小写字母或数字开头和结尾","type":"string"},"npu_type":{"description":"NPU类型,支持D310类型和D910类型。\n- D310表示D310类型。\n- D910表示D910类型。\n- 不填表示为D310类型。","type":"string"},"ports":{"description":"容器端口映射值","items":{"$ref":"#/definitions/HostContainerPortMapping"},"type":"array"},"privileged":{"description":"是否启用特权容器,默认值false","type":"boolean"},"readiness_probe":{"$ref":"#/definitions/Probe"},"resources":{"$ref":"#/definitions/DeploymentResources"},"run_as_user":{"description":"容器运行用户ID,输入范围为0~65534的整数","type":"integer"},"version":{"description":"容器镜像版本","type":"string"},"volumes":{"description":"卷配置","items":{"$ref":"#/definitions/Volumes"},"type":"array"}},"required":["name","image_url"]},"CreateAppsInDeploymentV3":{"description":"部署参数配置","properties":{"annotations":{"$ref":"#/definitions/Annotations"},"replicas":{"description":"副本数量","format":"int32","type":"integer"},"template":{"$ref":"#/definitions/PodRequest"}},"required":["replicas","template"]},"Deployment":{"description":"部署参数配置","properties":{"deployment":{"$ref":"#/definitions/CreateAppsInDeploymentV3"},"description":{"description":"部署描述","type":"string"},"group_id":{"description":"应用部署到指定节点组,与node_ids二选一","type":"string"},"name":{"description":"部署名称,只允许英文小写字母、数字、中划线,最大长度32,英文小写字母或数字开头和结尾","type":"string"},"node_ids":{"description":"应用部署到指定节点,当前只支持一个边缘节点","items":{"type":"string"},"type":"array"},"source":{"description":"应用部署来源:边缘市场(iem)或自定义()","type":"string"},"tags":{"description":"节点属性","items":{"$ref":"#/definitions/Attributes"},"type":"array"}},"required":["name","node_ids","deployment"],"type":"object"},"DeploymentResources":{"description":"创建容器时使用的资源","properties":{"limits":{"additionalProperties":{"type":"string"},"description":"允许容器使用的最大资源,key值支持填写:cpu, memory, gpu, npu, D310, D910","type":"object"},"requests":{"additionalProperties":{"type":"string"},"description":"容器需要使用的最小资源,key值支持填写:cpu, memory, gpu, npu, D310, D910","type":"object"}},"type":"object"},"DeploymentResp":{"description":"部署参数配置","properties":{"annotations":{"$ref":"#/definitions/Annotations"},"api_version":{"description":"应用部署版本","type":"string"},"created_at":{"description":"应用部署创建时间","type":"string"},"description":{"description":"应用部署描述,最大长度255,不允许^ ~ # $ % & * < > ( ) [ ] { } ' \" \\","type":"string"},"group_id":{"description":"应用部署到指定节点组,与node_ids二选一","type":"string"},"id":{"description":"应用部署uuid","type":"string"},"name":{"description":"应用部署名称,只允许英文小写字母、数字、中划线,最大长度32, 英文小写字母或数字开头和结尾","type":"string"},"node_ids":{"description":"应用部署到指定节点,当前只支持一个边缘节点","items":{"type":"string"},"type":"array"},"project_id":{"description":"项目ID","type":"string"},"ready_replicas":{"description":"应用部署正常副本数","format":"int32","type":"integer"},"replicas":{"description":"应用部署总副本数","format":"int32","type":"integer"},"source":{"description":"应用部署来源:边缘市场(iem)或自定义(userdefined)","type":"string"},"source_id":{"description":"预留字段","type":"string"},"state":{"description":"应用状态,仅包括冻结(FREEZE)、删除中(PENDING_DELETE)、删除失败(DELETE_FAILED),保留字段","type":"string"},"tags":{"description":"节点属性","items":{"$ref":"#/definitions/Attributes"},"type":"array"},"template":{"$ref":"#/definitions/PodRequest"},"updated_at":{"description":"应用部署更新时间","type":"string"}},"required":["id","name","node_ids","template"]},"Env":{"description":"环境变量","properties":{"field_path":{"description":"该参数目前只支持赋值\"status.hostIP\",即引用边缘节点的IP地址作为环境变量。","type":"string"},"name":{"description":"环境变量的key,由大小写字母或下划线开头,由数字、大小写字母、下划线组成,最大长度2048个字符,不允许重复","type":"string"},"value":{"description":"环境变量的value,最大长度20480个字符。value、value_from和field_path必须三选一使用。","type":"string"},"value_from":{"$ref":"#/definitions/ValueFrom","description":"环境变量可使用配置项和密钥导入"}},"required":["name"]},"ErrorResponseBody":{"description":"响应Body参数","properties":{"error_code":{"description":"错误码","type":"string"},"error_msg":{"description":"错误描述信息","type":"string"}}},"Exec":{"properties":{"command":{"description":"探针执行命令,最大长度10240个字符","type":"string"}},"required":["command"]},"HostContainerPortMapping":{"description":"容器端口映射值","properties":{"container_port":{"description":"构成一堆映射的容器端口","format":"int32","type":"integer"},"host_ip":{"description":"对应网卡地址","type":"string"},"host_port":{"description":"构成一对映射的物理机对应网卡端口","format":"int32","type":"integer"},"host_port_range":{"$ref":"#/definitions/HostPortRange"}},"required":["container_port"]},"HostPortRange":{"description":"主机端口范围,在范围内为应用实例自动分配主机端口;与主机端口参数二选一;仅铂金版可用","properties":{"max_port":{"description":"主机端口上限值,1到65535之间的整数;max_port需大于min_port","format":"int32","type":"integer"},"min_port":{"description":"主机端口下限制,1到65535之间的整数","format":"int32","type":"integer"}},"required":["min_port","max_port"]},"HttpGetDetail":{"description":"执行http探测","properties":{"host":{"description":"请求的主机地址,默认为容器IP","type":"string"},"path":{"description":"必须要以/开头,构造结果为:协议类型://主机地址:端口路径","type":"string"},"port":{"description":"探测的http端口,1到65535之间的整数","format":"int32","type":"integer"},"scheme":{"description":"协议类型,HTTP或HTTPS,默认HTTP","type":"string"}},"required":["path","port"]},"LabelSelector":{"description":"标签选择器","properties":{"matchExpressions":{"description":"匹配规则表达式","items":{"$ref":"#/definitions/MatchExpression"},"type":"array"},"matchLabels":{"additionalProperties":{"type":"string"},"description":"匹配的标签,格式为key:value键值对。\n单个键值对相当于matchExpressions的一个元素,key字段为key,操作符为In,values数组中只有value。","type":"object"}}},"MatchExpression":{"description":"匹配规则表达式","properties":{"key":{"description":"规则的标签","type":"string"},"operator":{"description":"操作符,取值如下:\n- In:标签值需要在values的列表中\n- NotIn:标签的值不在某个列表中\n- Exists:某个标签存在\n- DoesNotExist:某个标签不存在\n- Gt:标签的值大于某个值(字符串比较)\n- Lt:标签的值小于某个值(字符串比较)","type":"string"},"values":{"description":"一组标签值。\n- 如果运算符为In或NotIn,则值数组必须非空。\n- 如果运算符为Exists 或DoesNotExist,则值数组必须为空。\n- 如果运算符是Gt或Lt,则值数组必须具有单个元素,该元素将被解释为整数。","items":{"type":"string"},"type":"array"}}},"MatchExpressions":{"description":"匹配规则表达式","properties":{"matchExpressions":{"description":"匹配规则表达式","items":{"$ref":"#/definitions/MatchExpression"},"type":"array"}}},"PodAffinityTerm":{"description":"Pod亲和规则","properties":{"labelSelector":{"description":"标签选择器","properties":{"matchExpressions":{"description":"匹配规则表达式","items":{"$ref":"#/definitions/MatchExpression"},"type":"array"},"matchLabels":{"additionalProperties":{"type":"string"},"description":"匹配的标签,格式为key:value键值对。\n单个键值对相当于matchExpressions的一个元素,key字段为key,操作符为In,values数组中只有value。","type":"object"}}},"namespaces":{"description":"命名空间","items":{"type":"string"},"type":"array"},"topologyKey":{"description":"拓扑标签。先圈定topologyKey指定的范围,然后再选择labelSelector定义的内容,即亲和调度只会在有topologyKey指定的标签节点上调度。","type":"string"}}},"PodConfigs":{"description":"应用实例配置","properties":{"dns_policy":{"description":"应用实例DNS策略,可选值Default、ClusterFirst、ClusterFirstWithHostNet,默认为Default。应用实例启用主机网络时只能选填Default、ClusterFirstWithHostNet,不启用主机网络时只能选填Default、ClusterFirst","type":"string"},"host_network":{"description":"应用实例是否启用主机网络,不启用则使用端口映射,默认值false","type":"boolean"},"host_pid":{"description":"应用实例是否与主机共PID命名空间,默认值false","type":"boolean"},"migration":{"description":"应用实例故障是否迁移,指定节点组部署时必选,默认值false","type":"boolean"},"restart_policy":{"description":"应用实例重启策略,可选值Always、OnFailure、Never","type":"string"},"toleration_seconds":{"description":"应用实例故障容忍时间,容忍时间到达后迁移应用实例,只在指定节点组部署时生效","format":"int32","type":"integer"}},"required":["restart_policy"],"type":"object"},"PodRequest":{"description":"应用部署模板","properties":{"affinity":{"$ref":"#/definitions/Affinity"},"configs":{"$ref":"#/definitions/PodConfigs"},"containers":{"description":"应用部署业务容器","items":{"$ref":"#/definitions/ContainerDef"},"type":"array"},"init_containers":{"description":"应用部署init业务容器","items":{"$ref":"#/definitions/ContainerDef"},"type":"array"}},"required":["configs","containers"]},"PreferredSchedulingTerm":{"description":"优先使用定义的规则调度,且不会影响已经在节点上运行的Pod。即优先选择调度到满足规则的节点,但也可能会调度到不满足规则的节点。","properties":{"preference":{"description":"与相应权重关联的节点选择器项。","properties":{"matchExpressions":{"description":"匹配规则表达式","items":{"$ref":"#/definitions/MatchExpression"},"type":"array"}}},"weight":{"description":"权重,范围为1-100","format":"int32","type":"integer"}}},"Probe":{"description":"探针配置","properties":{"exec":{"$ref":"#/definitions/Exec","description":"执行命令检查,与http_get二选一"},"http_get":{"$ref":"#/definitions/HttpGetDetail","description":"执行http探测"},"initial_delay_seconds":{"description":"表示从工作负载启动后从多久开始探测,大于0且不大于3600的整数,默认为10","format":"int32","type":"integer"},"timeout_seconds":{"description":"表示探测超时时间,大于0且不大于3600的整数,默认为1","format":"int32","type":"integer"}}},"RequiredDuringScheduling":{"description":"强制使用定义的规则调度,且不会影响已经在节点上运行的Pod。即强制选择调度到满足规则的节点,不会调度到不满足规则的节点。","properties":{"nodeSelectorTerms":{"description":"节点选择规则","items":{"$ref":"#/definitions/MatchExpressions"},"type":"array"}}},"Secrets":{"description":"环境变量引用密钥时使用。使用ValueFrom时,secret与configmap必须二选一。","properties":{"key":{"description":"密钥的属性名","type":"string"},"name":{"description":"密钥的名称","type":"string"}},"required":["name","key"]},"ValueFrom":{"properties":{"configmap":{"$ref":"#/definitions/ConfigsMap"},"secret":{"$ref":"#/definitions/Secrets"}}},"Volumes":{"description":"卷配置","properties":{"destination":{"description":"卷挂载路径,必须是合法的路径","type":"string"},"name":{"description":"卷名称,小写字母或数字,最长63个字符","type":"string"},"read_only":{"description":"读写权限,configMap和secret类型只支持读权限","type":"boolean"},"source":{"description":"卷来源,type为hostPath时输入路径,要求以/开头,后面可包含中划线,反斜杠,下划线,点号,字母,数字; secret时输入secret名称,configMap时输入configMap名称,emptyDir时输入disk或memory","type":"string"},"type":{"description":"卷的类型,支持configMap,secret,emptyDir,hostPath","type":"string"}},"required":["name","type","source","destination"],"type":"object"},"WeightPodAffinityTerms":{"description":"优先使用定义的规则调度,且不会影响已经在节点上运行的Pod。即优先选择调度到满足规则的节点,但也可能会调度到不满足规则的节点。","properties":{"podAffinityTerm":{"description":"Pod亲和规则","properties":{"labelSelector":{"$ref":"#/definitions/LabelSelector"},"namespaces":{"description":"命名空间","items":{"type":"string"},"type":"array"},"topologyKey":{"description":"拓扑标签。先圈定topologyKey指定的范围,然后再选择labelSelector定义的内容,即亲和调度只会在有topologyKey指定的标签节点上调度。","type":"string"}}},"weight":{"description":"权重,范围为1-100","format":"int32","type":"integer"}}}},"description":null,"group_id":"cdaa2d3f4fbb4dc38b6a6c55f9222ed9","host":"ief.cn-north-4.myhuaweicloud.com","id":"c081226e0c2b4377bc7593518bec2d2c","info_version":"v1","method":"post","name":"CreateDeployments","parameters":{"Content-Type":{"description":"消息体的类型(格式),默认取值为“application/json”","in":"header","name":"Content-Type","required":true,"type":"string"},"IEF-Instance-Id":{"description":"铂金版实例ID,专业版实例为空值","in":"header","name":"ief-instance-id","required":false,"type":"string"},"X-Auth-Token":{"description":"用户Token。\n通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。","in":"header","name":"X-Auth-Token","required":true,"type":"string","x-example":"MIIDkgYJKoZIhvcNAQcCoIIDgzCCXXXXXX..."}},"paths":{"/v3/{project_id}/edgemgr/deployments":{"post":{"consumes":["application/json"],"description":"创建部署","operationId":"CreateDeployments","parameters":[{"$ref":"#/parameters/Content-Type"},{"$ref":"#/parameters/X-Auth-Token"},{"$ref":"#/parameters/IEF-Instance-Id"},{"description":"项目ID","in":"path","name":"project_id","required":true,"type":"string"},{"description":"请求Body参数","in":"body","name":"CreateDeployments","required":true,"schema":{"$ref":"#/definitions/Deployment"}}],"produces":["application/json"],"responses":{"201":{"description":"ok","examples":{"application/json":{"api_version":"v3","created_at":"2020-09-23 02:38:17.894471458 +0000 UTC","description":"this is a test app","group_id":"","id":"66a7fe7e-699a-41b2-9119-f9468a5ed78e","name":"app","node_ids":["9ebd8efb-9fdd-44a1-abda-9cdbc287a867"],"project_id":"05e1aef9040010e22fccc009adecb056","ready_replicas":0,"replicas":1,"source":"","source_id":"","state":"","template":{"configs":{"host_network":true,"host_pid":true,"migration":false,"restart_policy":"Always","toleration_seconds":300},"containers":[{"image_url":"nginx:alpine","name":"container-0","npu_type":"","privileged":false,"resources":{"limits":{"cpu":"0.25","memory":"500"},"requests":{"cpu":"0.25","memory":"500"}},"version":""}],"init_containers":[]},"updated_at":"2020-09-23 02:38:17.894471458 +0000 UTC"}},"schema":{"$ref":"#/definitions/DeploymentResp"}},"400":{"description":"error","examples":{"application/json":{"error_code":"IEF.100001","error_msg":"PROJECT_ID not found"}},"schema":{"$ref":"#/definitions/ErrorResponseBody"}},"500":{"description":"error","examples":{"application/json":{"error_code":"IEF.100158","error_msg":"Fail to extract gpu infomation"}},"schema":{"$ref":"#/definitions/ErrorResponseBody"}}},"summary":"创建部署","tags":["部署管理"],"x-is-registered":"Y","x-publishpath":"ief_02_0082","x-request-examples-1":{"deployment":{"replicas":1,"template":{"configs":{"host_network":true,"host_pid":true,"restart_policy":"Always","toleration_seconds":300},"containers":[{"image_url":"nginx:alpine","name":"container-0","resources":{"limits":{"cpu":"0.25","memory":"500"},"requests":{"cpu":"0.25","memory":"500"}}}]}},"description":"this is a test app","name":"app","node_ids":["9ebd8efb-9fdd-44a1-abda-9cdbc287a867"],"tags":[{"key":"app","value":"test"}]},"x-request-examples-description-1":"创建部署,应用部署到指定节点,容器网络为主机网络。","x-request-examples-text-1":{"deployment":{"replicas":1,"template":{"configs":{"host_network":true,"host_pid":true,"restart_policy":"Always","toleration_seconds":300},"containers":[{"image_url":"nginx:alpine","name":"container-0","resources":{"limits":{"cpu":"0.25","memory":"500"},"requests":{"cpu":"0.25","memory":"500"}}}]}},"description":"this is a test app","name":"app","node_ids":["9ebd8efb-9fdd-44a1-abda-9cdbc287a867"],"tags":[{"key":"app","value":"test"}]},"x-support-sdk":"Y"}}},"product_short":"IEF","region_id":"cn-north-4","schemes":["HTTPS"],"security_definitions":null,"summary":"创建部署","tags":"部署管理","uri":null,"version":"2.0"}