Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sdk: rolling update for 0.22.31 #435

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
182 changes: 131 additions & 51 deletions services/ucdn/apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,56 +195,6 @@ func (c *UCDNClient) BatchRefreshNewUcdnDomainCache(req *BatchRefreshNewUcdnDoma
return &res, nil
}

// ControlUcdnDomainCacheAccessRequest is request schema for ControlUcdnDomainCacheAccess action
type ControlUcdnDomainCacheAccessRequest struct {
request.CommonBase

// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
// ProjectId *string `required:"false"`

// forbid=封禁 unforbid=解封 其他值非法
Type *string `required:"true"`

// 待封禁的Url,一次封禁多个Url时最多一次30条,只能对表示文件的Url进行操作
UrlList []string `required:"true"`
}

// ControlUcdnDomainCacheAccessResponse is response schema for ControlUcdnDomainCacheAccess action
type ControlUcdnDomainCacheAccessResponse struct {
response.CommonBase
}

// NewControlUcdnDomainCacheAccessRequest will create request of ControlUcdnDomainCacheAccess action.
func (c *UCDNClient) NewControlUcdnDomainCacheAccessRequest() *ControlUcdnDomainCacheAccessRequest {
req := &ControlUcdnDomainCacheAccessRequest{}

// setup request with client config
c.Client.SetupRequest(req)

// setup retryable with default retry policy (retry for non-create action and common error)
req.SetRetryable(true)
return req
}

/*
API: ControlUcdnDomainCacheAccess

封禁解封缓存访问
*/
func (c *UCDNClient) ControlUcdnDomainCacheAccess(req *ControlUcdnDomainCacheAccessRequest) (*ControlUcdnDomainCacheAccessResponse, error) {
var err error
var res ControlUcdnDomainCacheAccessResponse

reqCopier := *req

err = c.Client.InvokeAction("ControlUcdnDomainCacheAccess", &reqCopier, &res)
if err != nil {
return &res, err
}

return &res, nil
}

// DeleteCertificateRequest is request schema for DeleteCertificate action
type DeleteCertificateRequest struct {
request.CommonBase
Expand Down Expand Up @@ -497,6 +447,9 @@ type GetCertificateV2Request struct {
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
// ProjectId *string `required:"false"`

// 根据加速域名筛选对应的证书
CdnDomain *string `required:"false"`

// 长度,默认为全部,非负整数
Limit *int `required:"false"`

Expand Down Expand Up @@ -859,6 +812,74 @@ func (c *UCDNClient) GetNewUcdnDomainRequestNum(req *GetNewUcdnDomainRequestNumR
return &res, nil
}

// GetNewUcdnLogClientIpStatisticsRequest is request schema for GetNewUcdnLogClientIpStatistics action
type GetNewUcdnLogClientIpStatisticsRequest struct {
request.CommonBase

// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
// ProjectId *string `required:"false"`

// 查询的日期,单位:Unix时间戳。只支持按天查询
BeginTime *int `required:"false"`

// 域名id,创建域名时生成的id
DomainId *string `required:"true"`

// 返回结果数量限制,返回最多100条
Limit *string `required:"false"`

// 0表示按照下载次数降序排列,1表示按流量降序排列,默认为0
OrderBy *int `required:"false"`

// 1表示按照1小时粒度,2表示按照一天的粒度 默认是天
Type *int `required:"false"`
}

// GetNewUcdnLogClientIpStatisticsResponse is response schema for GetNewUcdnLogClientIpStatistics action
type GetNewUcdnLogClientIpStatisticsResponse struct {
response.CommonBase

// 操作名称
Action string

// 客户端ip数据集合。
ClientIpStatisticsList []ClientIpStatisticsList

// 返回码
RetCode int
}

// NewGetNewUcdnLogClientIpStatisticsRequest will create request of GetNewUcdnLogClientIpStatistics action.
func (c *UCDNClient) NewGetNewUcdnLogClientIpStatisticsRequest() *GetNewUcdnLogClientIpStatisticsRequest {
req := &GetNewUcdnLogClientIpStatisticsRequest{}

// setup request with client config
c.Client.SetupRequest(req)

// setup retryable with default retry policy (retry for non-create action and common error)
req.SetRetryable(true)
return req
}

/*
API: GetNewUcdnLogClientIpStatistics

获取日志客户端ip统计
*/
func (c *UCDNClient) GetNewUcdnLogClientIpStatistics(req *GetNewUcdnLogClientIpStatisticsRequest) (*GetNewUcdnLogClientIpStatisticsResponse, error) {
var err error
var res GetNewUcdnLogClientIpStatisticsResponse

reqCopier := *req

err = c.Client.InvokeAction("GetNewUcdnLogClientIpStatistics", &reqCopier, &res)
if err != nil {
return &res, err
}

return &res, nil
}

// GetNewUcdnLogRefererStatisticsRequest is request schema for GetNewUcdnLogRefererStatistics action
type GetNewUcdnLogRefererStatisticsRequest struct {
request.CommonBase
Expand Down Expand Up @@ -2420,7 +2441,7 @@ type PrefetchNewUcdnDomainCacheRequest struct {
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
// ProjectId *string `required:"false"`

// 预热URL列表,n从自然数0开始。UrlList.n字段必须以”http://域名/”开始。如刷新文件目录a下面img.png文件, 格式为http://abc.ucloud.cn/a/img.png。请正确提交需要刷新的域名
// 预热URL列表,n从自然数0开始。UrlList.n字段必须以”http://域名/”开始。如刷新文件目录a下面img.png文件, 格式为http://abc.ucloud.cn/a/img.png。请正确提交需要刷新的域名,一次性可提交1000条,最少每10S调用一次
UrlList []string `required:"true"`
}

Expand Down Expand Up @@ -2610,6 +2631,65 @@ func (c *UCDNClient) SwitchUcdnChargeType(req *SwitchUcdnChargeTypeRequest) (*Sw
return &res, nil
}

// UpdateUcdnDomainHttpsConfigV2Request is request schema for UpdateUcdnDomainHttpsConfigV2 action
type UpdateUcdnDomainHttpsConfigV2Request struct {
request.CommonBase

// 证书id(可能是ucdn的id,也可能是ussl的id)
CertId *int `required:"false"`

// 证书名称,开启加速必传
CertName *string `required:"false"`

// 证书类型 ucdn/ussl
CertType *string `required:"false"`

// 域名对应的资源Id
DomainId *string `required:"true"`

// 开启或关闭加速 enable或disable 当加速区域含国外的时候,此参数为必传
HttpsStatusAbroad *string `required:"false"`

// 开启或关闭加速 enable或disable 当加速区域含国内的时候,此参数为必传
HttpsStatusCn *string `required:"false"`
}

// UpdateUcdnDomainHttpsConfigV2Response is response schema for UpdateUcdnDomainHttpsConfigV2 action
type UpdateUcdnDomainHttpsConfigV2Response struct {
response.CommonBase
}

// NewUpdateUcdnDomainHttpsConfigV2Request will create request of UpdateUcdnDomainHttpsConfigV2 action.
func (c *UCDNClient) NewUpdateUcdnDomainHttpsConfigV2Request() *UpdateUcdnDomainHttpsConfigV2Request {
req := &UpdateUcdnDomainHttpsConfigV2Request{}

// setup request with client config
c.Client.SetupRequest(req)

// setup retryable with default retry policy (retry for non-create action and common error)
req.SetRetryable(true)
return req
}

/*
API: UpdateUcdnDomainHttpsConfigV2

https加速配置,国内,国外一起配置(兼容全站加速域名)
*/
func (c *UCDNClient) UpdateUcdnDomainHttpsConfigV2(req *UpdateUcdnDomainHttpsConfigV2Request) (*UpdateUcdnDomainHttpsConfigV2Response, error) {
var err error
var res UpdateUcdnDomainHttpsConfigV2Response

reqCopier := *req

err = c.Client.InvokeAction("UpdateUcdnDomainHttpsConfigV2", &reqCopier, &res)
if err != nil {
return &res, err
}

return &res, nil
}

// UpdateUcdnDomainStatusRequest is request schema for UpdateUcdnDomainStatus action
type UpdateUcdnDomainStatusRequest struct {
request.CommonBase
Expand Down
115 changes: 68 additions & 47 deletions services/ucdn/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,27 @@ type RequestInfo struct {
Time int
}

/*
ClientIpStatisticsList - ClientIpStatisticsList
*/
type ClientIpStatisticsList struct {

// 流量单位字节
Flow int

// 流量占比
FlowPercent float64

// 客户端IP
IP string

// 请求数占比
RequestPercent float64

// 请求数
Requst int
}

/*
RefererList - RefererList
*/
Expand Down Expand Up @@ -548,21 +569,6 @@ type BandwidthTrafficInfo struct {
Traffic float64
}

/*
CacheKeyInfo - 忽略参数缓存配置
*/
type CacheKeyInfo struct {

// 是否忽略
Ignore bool

// 路径模式,支持正则
PathPattern string

// 自定义变量,以$符号开头,多个变量用加号(+)连接,$querystring表示所有变量
QueryString string
}

/*
ReferConf - refer配置
*/
Expand All @@ -579,39 +585,30 @@ type ReferConf struct {
}

/*
OriginConf - 回源配置
CacheKeyInfo - 忽略参数缓存配置
*/
type OriginConf struct {

// 1如果为false表示BackupOriginIp为空,表示没有备份源站,忽略BackupOriginIp,BackupOriginHost字段2如果为true表示BackupOriginIp.n必须至少有一个备份源站地址
BackupOriginEnable bool

// 备份回源Http请求头部Host,默认是加速域名
BackupOriginHost string

// 备份源站ip即cdn服务器回源访问的ip地址。多个源站ip,可以这样表述,如:["1.1.1.1","2.2.2.2"]
BackupOriginIpList []string

// 主源响应的回源错误码(如:404|500),默认空字符串
OriginErrorCode string
type CacheKeyInfo struct {

// 回主源的回源失败数,默认1
OriginErrorNum int
// 是否忽略
Ignore bool

// 跟随301跳转 0=不跟随 1=跟随
OriginFollow301 int
// 路径模式,支持正则
PathPattern string

// 回源Http请求头部Host,默认是加速域名
OriginHost string
// 自定义变量,以$符号开头,多个变量用加号(+)连接,$querystring表示所有变量
QueryString string
}

// 源站ip即cdn服务器回源访问的ip地址。多个源站ip,可以这样表述,如:["1.1.1.1","2.2.2.2"]
OriginIpList []string
/*
AccessControlConf - 访问控制配置参数
*/
type AccessControlConf struct {

// 回源端口
OriginPort int
// ip黑名单,多个ip,可表示为:IpBlackList.0=1.1.1.1,IpBlackList.1=2.2.2.2
IpBlackList []string

// 源站协议http,http|https 默认http
OriginProtocol string
// refer配置
ReferConf ReferConf
}

/*
Expand Down Expand Up @@ -654,15 +651,39 @@ type AdvancedConf struct {
}

/*
AccessControlConf - 访问控制配置参数
OriginConf - 回源配置
*/
type AccessControlConf struct {
type OriginConf struct {

// ip黑名单,多个ip,可表示为:IpBlackList.0=1.1.1.1,IpBlackList.1=2.2.2.2
IpBlackList []string
// 1如果为false表示BackupOriginIp为空,表示没有备份源站,忽略BackupOriginIp,BackupOriginHost字段2如果为true表示BackupOriginIp.n必须至少有一个备份源站地址
BackupOriginEnable bool

// refer配置
ReferConf ReferConf
// 备份回源Http请求头部Host,默认是加速域名
BackupOriginHost string

// 备份源站ip即cdn服务器回源访问的ip地址。多个源站ip,可以这样表述,如:["1.1.1.1","2.2.2.2"]
BackupOriginIpList []string

// 主源响应的回源错误码(如:404|500),默认空字符串
OriginErrorCode string

// 回主源的回源失败数,默认1
OriginErrorNum int

// 跟随301跳转 0=不跟随 1=跟随
OriginFollow301 int

// 回源Http请求头部Host,默认是加速域名
OriginHost string

// 源站ip即cdn服务器回源访问的ip地址。多个源站ip,可以这样表述,如:["1.1.1.1","2.2.2.2"]
OriginIpList []string

// 回源端口
OriginPort int

// 源站协议http,http|https 默认http
OriginProtocol string
}

/*
Expand Down
Loading