You need to enable JavaScript to run this app.
导航

创建边缘应用

最近更新时间2024.01.15 15:04:13

首次发布时间2023.02.22 17:09:41

本接口用于创建边缘容器应用。

前提条件

为提高容器部署成功率,创建边缘应用前,您必须进行资源检查,可以通过应用部署前资源检查接口完成。检查不通过的部署节点,将无法被成功部署,创建应用时请注意删除未通过资源检查的部署节点。

请求参数

名称

类型

是否必选

示例值

描述

Action

String

CreateApplication

要执行的操作。取值:CreateApplication。

name

String

边缘容器应用1

应用名称。同一火山引擎账号下边缘应用名称不能重复。长度必须在5-20个字符之间, 且不能包含空白字符、不能以 / 开头。

remark

String

应用描述文字

应用描述。最多80个字符。

bind_app_id

String

veecc-4000252292242221****

绑定到的边缘应用(即:主应用)的 ID。
选择需绑定的主应用后,将自动复制该应用的部署信息。如果主应用的部署信息发生变化,当前应用的部署信息也会相应变化,与主应用保持一致。
您无法将应用绑定到一个已经绑定到其他应用的子应用。

workload

Workload

参考 Workload

工作负载信息。

containers

[ ]Container

参考 Container

容器列表。

placements

[ ]
ApplicationPlacement

参考 ApplicationPlacement

部署节点列表。您可以通过获取可部署城市运营商列表接口查询。

返回数据

名称

类型

示例值

描述

identity

String

veecc-4110202211206660****

边缘应用ID。

请求示例

POST https://veecc.volcengineapi.com/?Action=CreateApplication
&<公共请求参数>
{
  "name": "test_a****",
  "remark": "11",
  "bind_app_id": "veecc-4000252292242221****",
  "workload": {
    "workload_access": {
      "access_public_network": true,
      "access_type": 3,
      "access_services": [
        {
          "protocol": "TCP",
          "container_port": 10,
          "service_port": 10
        }
      ]
    },
    "deploy_strategy": 2,
    "name": "workload****",
    "remark": "r****",
    "replicas": 1,
    "spec_name": "veECC.C1.0-1large",
    "type": 1,
    "workload_storage_volumes": [
      {
        "class": 1,
        "type": 2,
        "name": "sto****",
        "capacity": 10
      }
    ],
    "rolling_size": 1,
    "max_disable_size": 1
  },
  "containers": [
    {
      "name": "ccccc****",
      "image_domain": "cr-cn-domain.com/test****/python",
      "image_pull_secret_identity": "res-1705570270102522****",
      "image_version": "3.6",
      "storage_volumes": [
        {
          "volume_name": "sto****",
          "mount_path": "/a"
        }
      ],
      "ports": [
        {
          "name": "p****",
          "port": 10,
          "protocol": "TCP"
        }
      ],
      "envs": [
        {
          "type": 2,
          "value": "res-1012020828110298****"
        }
      ],
      "mount_configs": [
        {
          "type": 1,
          "ref_id": "res-1012020828110298****",
          "mount_path": "/cc"
        }
      ],
      "post_start": {
        "handler_type": 1,
        "exec": {
          "command": "ls"
        }
      },
      "liveness_probe": {
        "failure_threshold": 1,
        "initial_delay_seconds": 1,
        "period_seconds": 1,
        "success_threshold": 1,
        "timeout_seconds": 1,
        "handler": {
          "handler_type": 1,
          "exec": {
            "command": "ls"
          }
        }
      },
      "cpu": 0.5,
      "mem": 1,
      "cmd": {
        "cmd": "ls",
        "params": []
      }
    }
  ],
  "placements": [
    {
      "region": "CentralChina",
      "city": "430400",
      "isp": "CTCC",
      "replicas": 1
      "cluster_name": "****-test"
    }
  ]
}

返回示例

{
  "ResponseMetadata": {
    "RequestId": "2021102215554401022511001102AB****",
    "Action": "CreateApplication",
    "Version": "2022-10-01",
    "Service": "veecc",
    "Region": "cn-north-1"
  },
  "Result": {
    "identity": "veecc-5288000118982381****"
  }
}