# AddCloudRouterEdgePoints

## 1. 接口描述

调用本接口用于向一个三层网络增加一个或多个新的边缘连接点。

#### 准备工作

在你新增连接点之前，你可以：

* **三层网络加入VPC**：可以通过[DescribeCloudRouterAvailableVpcs](https://docs.console.zenlayer.com/api-reference/cn/networking/sdn/router/describecloudrouteravailablevpcs)接口来获取可以使用的VPC。
* **三层网络加入ZBG**：可以通过[DescribeBorderGateways](https://docs.console.zenlayer.com/api-reference/cn/compute/zec/vpc-network/border-gateway/describebordergateways)接口来获取可以使用的ZBG。
* **三层网络加入数据中心端口：** 可以通过[DescribeCloudRouterAvailablePorts](https://docs.console.zenlayer.com/api-reference/cn/networking/sdn/router/describecloudrouteravailableports-1)接口来获取可以使用的端口。
* **云接入支持的数据中心查询：**
  * 可以通过 [DescribeGoogleRegions](https://docs.console.zenlayer.com/api-reference/cn/networking/sdn/cloud/describegoogleregions) 查询Goolge 云接入点支持的数据中心信息。
  * 可以通过 [DescribeAWSRegions](https://docs.console.zenlayer.com/api-reference/cn/networking/sdn/cloud/describe-aws-regions) 查询AWS云接入点支持的数据中心信息。
  * 可以通过 [DescribeTencentRegions](https://docs.console.zenlayer.com/api-reference/cn/networking/sdn/cloud/describe-tencent-regions)查询Tencent 云接入点支持的数据中心信息。
* **边缘网关支持的数据中心查询：**&#x53EF;以通过 [DescribeVirtualEdgeDatacenters](https://docs.console.zenlayer.com/api-reference/cn/networking/sdn/common/describevirtualedgedatacenters) 查询支持边缘网关的数据中心信息。

{% hint style="info" %}
**注意事项**

* 目前只允许连通性状态为**ACTIVE**的端口加入到三层网络中。
* 本接口为异步接口，当请求下发成功后，操作并未立即完成。在此期间三层网络的状态将会处于**UPDATING**，当加入成功后，三层网络的状态将变为**RUNNING**。
* 在此期间三层网络将无法同时进行其他操作。
  {% endhint %}

## 2. 请求参数

以下请求参数列表仅列出了接口中需要的请求参数

<table><thead><tr><th width="210">参数名称</th><th width="82.875">必选</th><th width="215">类型</th><th>描述</th></tr></thead><tbody><tr><td>cloudRouterId</td><td>是</td><td>String</td><td>三层网络的ID。</td></tr><tr><td>edgePoints</td><td>是</td><td>Array of <a href="../../datastructure#createcloudrouteredgepoint">CreateCloudRouterEdgePoint</a></td><td>新的连接点信息。</td></tr></tbody></table>

## 3. 响应结果

<table><thead><tr><th width="149.33333333333331">参数名称</th><th width="203.54340836012864">类型</th><th>描述</th></tr></thead><tbody><tr><td>requestId</td><td>String</td><td><p>唯一请求 ID。</p><p>每次请求都会返回。定位问题时需要提供该次请求的 RequestId。</p></td></tr><tr><td>edgePointIds</td><td>Array of String</td><td>新增的连接点ID。<br>跟新增时的顺序保持一致。</td></tr></tbody></table>

## 4. 代码示例

{% tabs %}
{% tab title="示例" %}
**1. 向指定的三层网络中新增1个连接点, 连接点为VPC, 接入带宽为1Mbps.**

```json
POST /api/v2/sdn HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: AddCloudRouterEdgePoints
<Common Request Params>

Request：
{
    "cloudRouterId": "your-cloud-router-id",
    "edgePoints": [
        {
            "vpcId":"your vpc id",
            "bandwidthMbps":1
        }
    ]
}

Response：
{   
  "requestId": "T98044459-95B2-477E-9A2F-00253A70CC6E",
  "response": {
     "requestId": "T98044459-95B2-477E-9A2F-00253A70CC6E"，
     "edgePointIds": ["edge point id"]
  }
}
```

{% endtab %}
{% endtabs %}

## 5. 开发者工具

Zenlayer Cloud API 2.0 提供了配套的[开发工具集（SDK）](https://docs.console.zenlayer.com/api-reference/cn/api-introduction/toolkit)，未来会陆续支持更多开发语言，方便快速接入和使用Zenlayer的产品和服务。

## 6. 错误码

下面包含业务逻辑中遇到的错误码，其他错误码见[公共错误码](https://docs.console.zenlayer.com/api-reference/cn/api-introduction/instruction/commonerrorcode)

<table><thead><tr><th width="178.33333333333331">HTTP状态码</th><th>错误码</th><th>说明</th></tr></thead><tbody><tr><td>404</td><td>INVALID_CLOUD_ROUTER_NOT_FOUND</td><td>三层网络不存在。</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.console.zenlayer.com/api-reference/cn/networking/sdn/router/add-cloud-router-points.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
