> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/api-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/api-reference/cn/networking/zga/accelerator/modifyacceleratororigin.md).

# ModifyAcceleratorOrigin

## 1. 接口描述

本接口(ModifyAcceleratorOrigin)用于修改加速器源站信息。

**注意事项**

* domain不允许和origin相同，否则会形成回环，无法访问。
* 仅修改源站或备份源站需要全量提交整个源站配置，建议修改前调用`DescribeAccelerators`接口，获取源站和备份源站配置。
* 本接口为异步接口，接口返回成功后，此时修改加速器操作并未立即完成。在此期间加速器的状态将会处于`Deploying`，加速器状态可以通过调用`DescribeAccelerators` 接口查询，如果加速器状态(acceleratorStatus)由`Deploying`(部署中)变为`Accelerating`(加速中），则代表加速成功，`AccelerateFailure`代表加速失败，可调用redeploy接口重试部署。

## 2. 请求参数

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

| 参数名称          | 必选 | 类型                                                                 | 描述     |
| ------------- | -- | ------------------------------------------------------------------ | ------ |
| acceleratorId | 是  | String                                                             | 加速器Id  |
| origin        | 是  | [Origin](/api-reference/cn/networking/zga/datastructure.md#origin) | 源站修改信息 |

## 3. 响应结果

| 参数名称      | 类型     | 描述                                         |
| --------- | ------ | ------------------------------------------ |
| requestId | String | 唯一请求 ID，每次请求都会返回。定位问题时需要提供该次请求的 requestId。 |

## 4. 代码示例

{% tabs %}
{% tab title="示例" %}

1. **修改加速器源站**

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

Request:
{
    "acceleratorId": "acceleratorIdxxxxx",
     "origin": {
        "origin": "101.101.101.101",
        "backupOrigin": "101.101.101.102"
    }
}


Response:
{
    "requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
}
```

{% endtab %}
{% endtabs %}

## 5. 开发者工具

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

## 6. 错误码

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

| HTTP状态码 | 错误码                                         | 说明                   |
| ------- | ------------------------------------------- | -------------------- |
| 400     | ORIGIN\_FORBIDDEN                           | 源站被禁止                |
| 400     | ORIGIN\_NOT\_AVAILABLE                      | 源站不可用                |
| 400     | IP\_CNAME\_EXIST\_SAME\_TIME                | 源站不能同时存在IP和cname     |
| 400     | MULTIPLE\_CNAMES\_EXIST                     | 源站不能存在多个cname        |
| 400     | CNAME\_ORIGIN\_NOT\_SUPPORT\_BACKUP\_ORIGIN | 主源站为CNAME类型时不支持配置备源站 |
| 400     | DOMAIN\_SAME\_AS\_ORIGIN                    | domain不允许和源站相同       |
