在站点在创建源地址池,创建成功后,源地址池可以用于负载均衡器,也可以用于记录直接回源。
接口说明
源地址下可以添加多个源站,支持域名、IP、OSS、S3 等类型的源站,支持 OSS 和 S3 类型源站的回源鉴权。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
下表是API对应的授权信息,可以在RAM权限策略语句的Action
元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:
- 操作:是指具体的权限点。
- 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
- 资源类型:是指操作中支持授权的资源类型。具体说明如下:
- 对于必选的资源类型,用前面加 * 表示。
- 对于不支持资源级授权的操作,用
全部资源
表示。
- 条件关键字:是指云产品自身定义的条件关键字。
- 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作 | 访问级别 | 资源类型 | 条件关键字 | 关联操作 |
---|---|---|---|---|
esa:CreateOriginPool | create | *Site acs:esa:{#regionId}:{#accountId}:site/{#SiteId} |
| 无 |
请求参数
名称 | 类型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
Name | string | 是 | 源地址池名称,一个站点下源地址池名称唯一。 | pool1 |
Enabled | boolean | 否 | 源地址池是否启用:
| true |
Origins | array<object> | 否 | 源地址池里添加的源站信息,多个源站使用数组传值。 | |
object | 否 | 单个源站信息。 | ||
Name | string | 否 | 源站名称,一个源地址下源站名称唯一。 | origin1 |
Address | string | 否 | 源站地址,如:www.example.com。 | www.example.com |
Enabled | boolean | 否 | 源站是否启用:
| true |
Header | any | 否 | 回源时带的请求头,只支持 Host。 | { "Host": [ "example.com" ] } |
Weight | integer | 否 | 权重,0-100 的整数。 | 50 |
Type | string | 否 | 源站类型:
| ip_domain |
AuthConf | object | 否 | 鉴权信息,源站为 OSS 或者 S3 等源站需要鉴权时,需要传鉴权相关配置信息。 | |
AuthType | string | 否 | 鉴权类型。
| public |
AccessKey | string | 否 | 私有鉴权时需要传的 access key。 | yourAccessKeyID |
SecretKey | string | 否 | 私有鉴权时需要传的 secret key。 | yourAccessKeySecret |
Version | string | 否 | 源站为 AWS S3 时需要传的签名版本。 | v2 |
Region | string | 否 | 源站为 AWS S3 时需要传的源站 region。 | us-east-1 |
SiteId | long | 是 | 站点 ID,可通过调用 ListSites 接口获取。 | 21655860979**** |
返回参数
示例
正常返回示例
JSON
格式
{
"RequestId": "CB1A380B-09F0-41BB-A198-72F8FD6DA2FE\n",
"Id": 0
}
错误码
HTTP status code | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidParameter | The specified parameter is invalid. | 输入参数规范校验失败。 |
400 | SourceNumberExceedLimit | The number of sources in the origin pool exceeds the quota limit. | 您在源地址池中可创建的源站个数已达到套餐上限,请查看您的套餐配额,并升级套餐以获得更多配额。 |
400 | PoolNumberExceedQuotaLimit | The number of origin pool you have added has reached the upper limit of the plan quota. Please delete the origin pool that is no longer in use or upgrade the plan and try again. | 您添加的源站组数量已经达到套餐的配额上限,请删除不再使用的源站组或者升级套餐后,进行重试。 |
400 | InternalException | Failed to call the service. Try again later or contact technical support. | 调用服务失败,请稍后重试或联系客服咨询详情。 |
400 | InvalidParameter.AddressConflict | Duplicate origin addresses. Make sure that each origin address for the same pool is unique. | 传入的源站地址有冲突,在同一个源地址池中,不能存在重复的源站地址,请您确保源站地址的唯一性。 |
400 | OriginPoolNameConflict | The specified origin pool name already exists or its hostname conflicts with a load balancer name. Try again with a unique name. | 源地址池名称冲突,请确保新名称与现有源地址池及负载均衡器名称均不相同。 |
400 | SourceAddressInvalid | Invalid origin address. Check whether the IP address or domain name is in the valid format. | 源站地址无效,请检查并确保输入的是正确的IP或域名格式。 |
400 | SourceCircleExist | The host record of the resource to be operated on is already the source station of another resource, or the source station of the current resource has been added as a host record. To avoid loopback, modify the host record or source station and retry. | 当前要操作资源的主机记录已经是其他资源的源站,或者当前资源的源站已经被添加为主机记录,为避免回环产生,请修改主机记录或者源站后进行重试。 |
400 | SourceInBlackList | The source is in the black list. | 源站在黑名单中。 |
404 | SiteNotFound | The website does not exist or does not belong to you. | 站点不存在,或者不属于你。 |
访问错误中心查看更多错误码。