# AddCloudRouterEdgePoints

## 1. API Description

This API is used to add one or more new access point to a Layer 3 cloud router.

#### Prerequisites

* **Query available VPCs**\
  You can call [`DescribeCloudRouterAvailableVpcs`](https://docs.console.zenlayer.com/api-reference/networking/sdn/router/describecloudrouteravailablevpcs) to query VPCs that can be added in to the Layer 3 cloud router.
* **Query available border gateways**\
  You can call [`DescribeBorderGateways`](https://docs.console.zenlayer.com/api-reference/compute/zec/vpc-network/border-gateway/describebordergateways) to query border gateways that can be added in to the Layer 3 cloud router.
* **Query available ports**\
  You can call [`DescribeCloudRouterAvailablePorts`](https://docs.console.zenlayer.com/api-reference/networking/sdn/router/describecloudrouteravailableports-1) to query ports that can be added in to the Layer 3 cloud router.
* **Query available locations for public clouds**
  * You can call [`DescribeGoogleRegions`](https://docs.console.zenlayer.com/api-reference/networking/sdn/cloud/describegoogleregions) to query locations supporting for Google Cloud access point.
  * You can call [`DescribeAWSRegions`](https://docs.console.zenlayer.com/api-reference/networking/sdn/cloud/describe-aws-regions) to query locations supporting for AWS access point.
  * You can call [`DescribeTencentRegions`](https://docs.console.zenlayer.com/api-reference/networking/sdn/cloud/describe-tencent-regions) to query locations supporting for Tencent Cloud access point.
* **Query available date centers for virtual edges**
  * You can call [`DescribeVirtualEdgeDatacenters`](https://docs.console.zenlayer.com/api-reference/networking/sdn/common/describevirtualedgedatacenters) to query date centers supporting virtual edges.

{% hint style="info" %} <mark style="color:blue;">**Note**</mark>

* <mark style="color:blue;">Only operations on ports in state of</mark> <mark style="color:blue;">`ACTIVE`</mark> <mark style="color:blue;">are supported.</mark>
* <mark style="color:blue;">This API is an async API. A request ID is returned after the request is sent. However, it does not mean the operation has been completed. The status of the cloud router will be</mark> <mark style="color:blue;">`UPDATING`</mark> <mark style="color:blue;">during the operation. If the cloud router state changes from</mark> <mark style="color:blue;">`UPDATING`</mark> <mark style="color:blue;">to</mark> <mark style="color:blue;">`RUNNING`</mark><mark style="color:blue;">, it means that the access point has been added.</mark>
* <mark style="color:blue;">Any operations on the</mark> <mark style="color:blue;">cloud routers</mark> <mark style="color:blue;">are not allowed while adding access points.</mark>
  {% endhint %}

## 2. Input Parameters

The following request parameter list only provides API request parameters.

<table><thead><tr><th width="186">Parameter Name</th><th width="111.875">Required</th><th width="152">Type</th><th>Description</th></tr></thead><tbody><tr><td>cloudRouterId</td><td>Yes</td><td>String</td><td>Cloud router ID.</td></tr><tr><td>edgePoints</td><td>Yes</td><td>Array of <a href="../../datastructure#createcloudrouteredgepoint">CreateCloudRouterEdgePoint</a></td><td>Information on access points.</td></tr></tbody></table>

## 3. Output Parameters

<table><thead><tr><th width="196.33333333333331">Parameter Name</th><th width="151.54340836012864">Type</th><th>Description</th></tr></thead><tbody><tr><td>requestId</td><td>String</td><td>The unique request ID, which is returned for each request. RequestId is required for locating a problem.</td></tr><tr><td>edgePointIds</td><td>Array of String</td><td>Access point ID.<br>Consistent with the adding order.</td></tr></tbody></table>

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**Add a VPC access point to a Layer 3 cloud router with access bandwidth of 1 Mbps.**

```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. Developer Resources

Zenlayer Cloud API 2.0 integrates [SDKs](https://docs.console.zenlayer.com/api-reference/api-introduction/toolkit/api-sdk) to make it easier for you to call APIs. More programming languages will be supported.

## 6. Error Codes

The following only lists the error codes related to the API business logic. For other error codes, see [Common Error Codes](https://docs.console.zenlayer.com/api-reference/api-introduction/instruction/commonerrorcode).​

<table><thead><tr><th width="207.33333333333331">HTTP Status Code</th><th width="234">Error Code</th><th>Description</th></tr></thead><tbody><tr><td>404</td><td>INVALID_CLOUD_ROUTER_NOT_FOUND</td><td>Cloud router doesn't exist.</td></tr></tbody></table>
