CreateOriginPool - 创建源地址池

在站点在创建源地址池,创建成功后,源地址池可以用于负载均衡器,也可以用于记录直接回源。

接口说明

源地址下可以添加多个源站,支持域名、IP、OSS、S3 等类型的源站,支持 OSS 和 S3 类型源站的回源鉴权。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用前面加 * 表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
esa:CreateOriginPoolcreate
*Site
acs:esa:{#regionId}:{#accountId}:site/{#SiteId}

请求参数

名称类型必填描述示例值
Namestring

源地址池名称,一个站点下源地址池名称唯一。

pool1
Enabledboolean

源地址池是否启用:

  • true: 启用;
  • false:不启用。
true
Originsarray<object>

源地址池里添加的源站信息,多个源站使用数组传值。

object

单个源站信息。

Namestring

源站名称,一个源地址下源站名称唯一。

origin1
Addressstring

源站地址,如:www.example.com。

www.example.com
Enabledboolean

源站是否启用:

  • true: 启用;
  • false:不启用。
true
Headerany

回源时带的请求头,只支持 Host。

{ "Host": [ "example.com" ] }
Weightinteger

权重,0-100 的整数。

50
Typestring

源站类型:

  • ip_domain: ip 或域名类型源站;
  • OSS:OSS 地址源站;
  • S3:AWS S3 源站。
ip_domain
AuthConfobject

鉴权信息,源站为 OSS 或者 S3 等源站需要鉴权时,需要传鉴权相关配置信息。

AuthTypestring

鉴权类型。

  • public:公共读写,源站为 OSS 或 S3 且为公共读写时使用;
  • private_same_account:私有同账号,源站为 OSS,且鉴权类型为同账号私有鉴权时使用;
  • private_cross_account:私有跨账号,源站为 OSS,且鉴权类型为跨账号私有鉴权时使用;
  • private:源站为 S3,且鉴权类型为私有时使用。
public
AccessKeystring

私有鉴权时需要传的 access key。

yourAccessKeyID
SecretKeystring

私有鉴权时需要传的 secret key。

yourAccessKeySecret
Versionstring

源站为 AWS S3 时需要传的签名版本。

v2
Regionstring

源站为 AWS S3 时需要传的源站 region。

us-east-1
SiteIdlong

站点 ID,可通过调用 ListSites 接口获取。

21655860979****

返回参数

名称类型描述示例值
object

Schema of Response

RequestIdstring

请求 ID。

CB1A380B-09F0-41BB-A198-72F8FD6DA2FE
Idlong

新增的源地址池 ID。

103852052519****

示例

正常返回示例

JSON格式

{
  "RequestId": "CB1A380B-09F0-41BB-A198-72F8FD6DA2FE\n",
  "Id": 0
}

错误码

HTTP status code错误码错误信息描述
400InvalidParameterThe specified parameter is invalid.输入参数规范校验失败。
400SourceNumberExceedLimitThe number of sources in the origin pool exceeds the quota limit.您在源地址池中可创建的源站个数已达到套餐上限,请查看您的套餐配额,并升级套餐以获得更多配额。
400PoolNumberExceedQuotaLimitThe 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.您添加的源站组数量已经达到套餐的配额上限,请删除不再使用的源站组或者升级套餐后,进行重试。
400InternalExceptionFailed to call the service. Try again later or contact technical support.调用服务失败,请稍后重试或联系客服咨询详情。
400InvalidParameter.AddressConflictDuplicate origin addresses. Make sure that each origin address for the same pool is unique.传入的源站地址有冲突,在同一个源地址池中,不能存在重复的源站地址,请您确保源站地址的唯一性。
400OriginPoolNameConflictThe specified origin pool name already exists or its hostname conflicts with a load balancer name. Try again with a unique name.源地址池名称冲突,请确保新名称与现有源地址池及负载均衡器名称均不相同。
400SourceAddressInvalidInvalid origin address. Check whether the IP address or domain name is in the valid format.源站地址无效,请检查并确保输入的是正确的IP或域名格式。
400SourceCircleExistThe 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.当前要操作资源的主机记录已经是其他资源的源站,或者当前资源的源站已经被添加为主机记录,为避免回环产生,请修改主机记录或者源站后进行重试。
400SourceInBlackListThe source is in the black list.源站在黑名单中。
404SiteNotFoundThe website does not exist or does not belong to you.站点不存在,或者不属于你。

访问错误中心查看更多错误码。