Skip to content

Commit eb8fa72

Browse files
authored
sdk: rolling update for 0.11.64 (#269)
1 parent 7402203 commit eb8fa72

File tree

19 files changed

+388
-188
lines changed

19 files changed

+388
-188
lines changed

ucloud/services/ucdn/client.py

Lines changed: 77 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,13 @@ def batch_refresh_new_ucdn_domain_cache(
150150
def control_ucdn_domain_cache_access(
151151
self, req: typing.Optional[dict] = None, **kwargs
152152
) -> dict:
153-
"""ControlUcdnDomainCacheAccess - 封禁解封缓存访问
153+
"""ControlUcdnDomainCacheAccess -
154154
155155
**Request**
156156
157-
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
158-
- **Type** (str) - (Required) forbid=封禁 unforbid=解封 其他值非法
159-
- **UrlList** (list) - (Required) 待封禁的Url,一次封禁多个Url时最多一次30条,只能对表示文件的Url进行操作
157+
- **ProjectId** (str) - (Config)
158+
- **Type** (str) - (Required)
159+
- **UrlList** (list) -
160160
161161
**Response**
162162
@@ -169,6 +169,9 @@ def control_ucdn_domain_cache_access(
169169
req and d.update(req)
170170
d = apis.ControlUcdnDomainCacheAccessRequestSchema().dumps(d)
171171

172+
# build options
173+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
174+
172175
resp = self.invoke("ControlUcdnDomainCacheAccess", d, **kwargs)
173176
return apis.ControlUcdnDomainCacheAccessResponseSchema().loads(resp)
174177

@@ -623,6 +626,47 @@ def get_new_ucdn_domain_request_num(
623626
resp = self.invoke("GetNewUcdnDomainRequestNum", d, **kwargs)
624627
return apis.GetNewUcdnDomainRequestNumResponseSchema().loads(resp)
625628

629+
def get_new_ucdn_log_client_ip_statistics(
630+
self, req: typing.Optional[dict] = None, **kwargs
631+
) -> dict:
632+
"""GetNewUcdnLogClientIpStatistics - 获取日志客户端ip统计
633+
634+
**Request**
635+
636+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
637+
- **DomainId** (str) - (Required) 域名id,创建域名时生成的id
638+
- **BeginTime** (int) - 查询的日期,单位:Unix时间戳。只支持按天查询
639+
- **Limit** (str) - 返回结果数量限制,返回最多100条
640+
- **OrderBy** (int) - 0表示按照下载次数降序排列,1表示按流量降序排列,默认为0
641+
- **Type** (int) - 1表示按照1小时粒度,2表示按照一天的粒度 默认是天
642+
643+
**Response**
644+
645+
- **Action** (str) - 操作名称
646+
- **ClientIpStatisticsList** (list) - 见 **ClientIpStatisticsList** 模型定义
647+
- **RetCode** (int) - 返回码
648+
649+
**Response Model**
650+
651+
**ClientIpStatisticsList**
652+
- **Flow** (int) - 流量单位字节
653+
- **FlowPercent** (float) - 流量占比
654+
- **IP** (str) - 客户端IP
655+
- **RequestPercent** (float) - 请求数占比
656+
- **Requst** (int) - 请求数
657+
658+
659+
"""
660+
# build request
661+
d = {
662+
"ProjectId": self.config.project_id,
663+
}
664+
req and d.update(req)
665+
d = apis.GetNewUcdnLogClientIpStatisticsRequestSchema().dumps(d)
666+
667+
resp = self.invoke("GetNewUcdnLogClientIpStatistics", d, **kwargs)
668+
return apis.GetNewUcdnLogClientIpStatisticsResponseSchema().loads(resp)
669+
626670
def get_new_ucdn_log_referer_statistics(
627671
self, req: typing.Optional[dict] = None, **kwargs
628672
) -> dict:
@@ -937,7 +981,7 @@ def get_ucdn_domain_hit_rate(
937981
- **BeginTime** (int) - 查询的起始时间,格式为Unix Timestamp。如果有EndTime,BeginTime必须赋值。如没有赋值,则返回缺少参 数错误,如果没有EndTime,BeginTime也可以不赋值,EndTime默认当前时间,BeginTime 默认前一天的当前时间。
938982
- **DomainId** (list) - 域名id,创建域名时生成的id。默认全部域名
939983
- **EndTime** (int) - 查询的结束时间,格式为Unix Timestamp。EndTime默认为当前时间,BeginTime默认为当前时间前一天时间。
940-
- **HitType** (int) - 命中类型:0=整体命中 1=边缘命中 默认是0
984+
- **HitType** (int) - 默认是0
941985
- **IsDcdn** (bool) - 是否全站加速,默认false
942986
943987
**Response**
@@ -977,7 +1021,7 @@ def get_ucdn_domain_http_code_v2(
9771021
- **DomainId** (list) - 域名id,创建域名时生成的id。默认全部域名
9781022
- **EndTime** (int) - 查询的结束时间,格式为Unix Timestamp。EndTime默认为当前时间,BeginTime默认为当前时间前一天时间。
9791023
- **IsDcdn** (bool) - 是否全站加速 默认false
980-
- **Layer** (str) - 指定获取的状态码是边缘还是上层 edge 表示边缘 layer 表示上层
1024+
- **Layer** (str) - edge 表示边缘
9811025
9821026
**Response**
9831027
@@ -1766,7 +1810,7 @@ def prefetch_new_ucdn_domain_cache(
17661810
**Request**
17671811
17681812
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
1769-
- **UrlList** (list) - (Required) 预热URL列表,n从自然数0开始。UrlList.n字段必须以”http://域名/”开始。如刷新文件目录a下面img.png文件, 格式为http://abc.ucloud.cn/a/img.png。请正确提交需要刷新的域名
1813+
- **UrlList** (list) - (Required) 预热URL列表,n从自然数0开始。UrlList.n字段必须以”http://域名/”开始。如刷新文件目录a下面img.png文件, 格式为http://abc.ucloud.cn/a/img.png。请正确提交需要刷新的域名,一次性可提交1000条,最少每10S调用一次
17701814
17711815
**Response**
17721816
@@ -1865,6 +1909,32 @@ def switch_ucdn_charge_type(
18651909
resp = self.invoke("SwitchUcdnChargeType", d, **kwargs)
18661910
return apis.SwitchUcdnChargeTypeResponseSchema().loads(resp)
18671911

1912+
def update_ucdn_domain_https_config_v2(
1913+
self, req: typing.Optional[dict] = None, **kwargs
1914+
) -> dict:
1915+
"""UpdateUcdnDomainHttpsConfigV2 - https加速配置,国内,国外一起配置(兼容全站加速域名)
1916+
1917+
**Request**
1918+
1919+
- **DomainId** (str) - (Required) 域名对应的资源Id
1920+
- **CertId** (int) - 证书id(可能是ucdn的id,也可能是ussl的id)
1921+
- **CertName** (str) - 证书名称,开启加速必传
1922+
- **CertType** (str) - 证书类型 ucdn/ussl
1923+
- **HttpsStatusAbroad** (str) - 开启或关闭加速 enable或disable 当加速区域含国外的时候,此参数为必传
1924+
- **HttpsStatusCn** (str) - 开启或关闭加速 enable或disable 当加速区域含国内的时候,此参数为必传
1925+
1926+
**Response**
1927+
1928+
1929+
"""
1930+
# build request
1931+
d = {}
1932+
req and d.update(req)
1933+
d = apis.UpdateUcdnDomainHttpsConfigV2RequestSchema().dumps(d)
1934+
1935+
resp = self.invoke("UpdateUcdnDomainHttpsConfigV2", d, **kwargs)
1936+
return apis.UpdateUcdnDomainHttpsConfigV2ResponseSchema().loads(resp)
1937+
18681938
def update_ucdn_domain_status(
18691939
self, req: typing.Optional[dict] = None, **kwargs
18701940
) -> dict:

ucloud/services/ucdn/schemas/apis.py

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,12 @@ class BatchRefreshNewUcdnDomainCacheResponseSchema(schema.ResponseSchema):
100100
"""
101101
API: ControlUcdnDomainCacheAccess
102102
103-
封禁解封缓存访问
103+
104104
"""
105105

106106

107107
class ControlUcdnDomainCacheAccessRequestSchema(schema.RequestSchema):
108-
"""ControlUcdnDomainCacheAccess - 封禁解封缓存访问"""
108+
"""ControlUcdnDomainCacheAccess -"""
109109

110110
fields = {
111111
"ProjectId": fields.Str(required=False, dump_to="ProjectId"),
@@ -115,7 +115,7 @@ class ControlUcdnDomainCacheAccessRequestSchema(schema.RequestSchema):
115115

116116

117117
class ControlUcdnDomainCacheAccessResponseSchema(schema.ResponseSchema):
118-
"""ControlUcdnDomainCacheAccess - 封禁解封缓存访问"""
118+
"""ControlUcdnDomainCacheAccess -"""
119119

120120
fields = {}
121121

@@ -423,6 +423,40 @@ class GetNewUcdnDomainRequestNumResponseSchema(schema.ResponseSchema):
423423
}
424424

425425

426+
"""
427+
API: GetNewUcdnLogClientIpStatistics
428+
429+
获取日志客户端ip统计
430+
"""
431+
432+
433+
class GetNewUcdnLogClientIpStatisticsRequestSchema(schema.RequestSchema):
434+
"""GetNewUcdnLogClientIpStatistics - 获取日志客户端ip统计"""
435+
436+
fields = {
437+
"BeginTime": fields.Int(required=False, dump_to="BeginTime"),
438+
"DomainId": fields.Str(required=True, dump_to="DomainId"),
439+
"Limit": fields.Str(required=False, dump_to="Limit"),
440+
"OrderBy": fields.Int(required=False, dump_to="OrderBy"),
441+
"ProjectId": fields.Str(required=False, dump_to="ProjectId"),
442+
"Type": fields.Int(required=False, dump_to="Type"),
443+
}
444+
445+
446+
class GetNewUcdnLogClientIpStatisticsResponseSchema(schema.ResponseSchema):
447+
"""GetNewUcdnLogClientIpStatistics - 获取日志客户端ip统计"""
448+
449+
fields = {
450+
"Action": fields.Str(required=True, load_from="Action"),
451+
"ClientIpStatisticsList": fields.List(
452+
models.ClientIpStatisticsListSchema(),
453+
required=False,
454+
load_from="ClientIpStatisticsList",
455+
),
456+
"RetCode": fields.Int(required=True, load_from="RetCode"),
457+
}
458+
459+
426460
"""
427461
API: GetNewUcdnLogRefererStatistics
428462
@@ -1308,6 +1342,34 @@ class SwitchUcdnChargeTypeResponseSchema(schema.ResponseSchema):
13081342
fields = {}
13091343

13101344

1345+
"""
1346+
API: UpdateUcdnDomainHttpsConfigV2
1347+
1348+
https加速配置,国内,国外一起配置(兼容全站加速域名)
1349+
"""
1350+
1351+
1352+
class UpdateUcdnDomainHttpsConfigV2RequestSchema(schema.RequestSchema):
1353+
"""UpdateUcdnDomainHttpsConfigV2 - https加速配置,国内,国外一起配置(兼容全站加速域名)"""
1354+
1355+
fields = {
1356+
"CertId": fields.Int(required=False, dump_to="CertId"),
1357+
"CertName": fields.Str(required=False, dump_to="CertName"),
1358+
"CertType": fields.Str(required=False, dump_to="CertType"),
1359+
"DomainId": fields.Str(required=True, dump_to="DomainId"),
1360+
"HttpsStatusAbroad": fields.Str(
1361+
required=False, dump_to="HttpsStatusAbroad"
1362+
),
1363+
"HttpsStatusCn": fields.Str(required=False, dump_to="HttpsStatusCn"),
1364+
}
1365+
1366+
1367+
class UpdateUcdnDomainHttpsConfigV2ResponseSchema(schema.ResponseSchema):
1368+
"""UpdateUcdnDomainHttpsConfigV2 - https加速配置,国内,国外一起配置(兼容全站加速域名)"""
1369+
1370+
fields = {}
1371+
1372+
13111373
"""
13121374
API: UpdateUcdnDomainStatus
13131375

ucloud/services/ucdn/schemas/models.py

Lines changed: 52 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
from ucloud.core.typesystem import schema, fields
44

55

6+
class AccessConfSchema(schema.ResponseSchema):
7+
"""AccessConf - 访问控制"""
8+
9+
fields = {
10+
"IpBlacklist": fields.Str(required=False, load_from="IpBlacklist"),
11+
}
12+
13+
614
class CacheConfSchema(schema.ResponseSchema):
715
"""CacheConf - 缓存配置"""
816

@@ -21,14 +29,6 @@ class CacheConfSchema(schema.ResponseSchema):
2129
}
2230

2331

24-
class AccessConfSchema(schema.ResponseSchema):
25-
"""AccessConf - 访问控制"""
26-
27-
fields = {
28-
"IpBlacklist": fields.Str(required=False, load_from="IpBlacklist"),
29-
}
30-
31-
3232
class DomainInfoSchema(schema.ResponseSchema):
3333
"""DomainInfo - 域名配置"""
3434

@@ -245,6 +245,20 @@ class RequestInfoSchema(schema.ResponseSchema):
245245
}
246246

247247

248+
class ClientIpStatisticsListSchema(schema.ResponseSchema):
249+
"""ClientIpStatisticsList - ClientIpStatisticsList"""
250+
251+
fields = {
252+
"Flow": fields.Int(required=False, load_from="Flow"),
253+
"FlowPercent": fields.Float(required=False, load_from="FlowPercent"),
254+
"IP": fields.Str(required=False, load_from="IP"),
255+
"RequestPercent": fields.Float(
256+
required=False, load_from="RequestPercent"
257+
),
258+
"Requst": fields.Int(required=False, load_from="Requst"),
259+
}
260+
261+
248262
class RefererListSchema(schema.ResponseSchema):
249263
"""RefererList - RefererList"""
250264

@@ -294,6 +308,16 @@ class BandwidthTrafficInfoSchema(schema.ResponseSchema):
294308
}
295309

296310

311+
class CacheKeyInfoSchema(schema.ResponseSchema):
312+
"""CacheKeyInfo - 忽略参数缓存配置"""
313+
314+
fields = {
315+
"Ignore": fields.Bool(required=False, load_from="Ignore"),
316+
"PathPattern": fields.Str(required=False, load_from="PathPattern"),
317+
"QueryString": fields.Str(required=False, load_from="QueryString"),
318+
}
319+
320+
297321
class ReferConfSchema(schema.ResponseSchema):
298322
"""ReferConf - refer配置"""
299323

@@ -304,13 +328,28 @@ class ReferConfSchema(schema.ResponseSchema):
304328
}
305329

306330

307-
class CacheKeyInfoSchema(schema.ResponseSchema):
308-
"""CacheKeyInfo - 忽略参数缓存配置"""
331+
class AdvancedConfSchema(schema.ResponseSchema):
332+
"""AdvancedConf - 域名高级配置"""
309333

310334
fields = {
311-
"Ignore": fields.Bool(required=False, load_from="Ignore"),
312-
"PathPattern": fields.Str(required=False, load_from="PathPattern"),
313-
"QueryString": fields.Str(required=False, load_from="QueryString"),
335+
"Http2Https": fields.Bool(required=False, load_from="Http2Https"),
336+
"HttpClientHeader": fields.List(fields.Str()),
337+
"HttpOriginHeader": fields.List(fields.Str()),
338+
"QuicEnable": fields.Bool(required=False, load_from="QuicEnable"),
339+
"WebSocketEnable": fields.Bool(
340+
required=False, load_from="WebSocketEnable"
341+
),
342+
}
343+
344+
345+
class CacheAllConfigSchema(schema.ResponseSchema):
346+
"""CacheAllConfig - 缓存相关的配置"""
347+
348+
fields = {
349+
"CacheHost": fields.Str(required=False, load_from="CacheHost"),
350+
"CacheKeyList": fields.List(CacheKeyInfoSchema()),
351+
"CacheList": fields.List(CacheConfSchema()),
352+
"HttpCodeCacheList": fields.List(CacheConfSchema()),
314353
}
315354

316355

@@ -352,31 +391,6 @@ class OriginConfSchema(schema.ResponseSchema):
352391
}
353392

354393

355-
class CacheAllConfigSchema(schema.ResponseSchema):
356-
"""CacheAllConfig - 缓存相关的配置"""
357-
358-
fields = {
359-
"CacheHost": fields.Str(required=False, load_from="CacheHost"),
360-
"CacheKeyList": fields.List(CacheKeyInfoSchema()),
361-
"CacheList": fields.List(CacheConfSchema()),
362-
"HttpCodeCacheList": fields.List(CacheConfSchema()),
363-
}
364-
365-
366-
class AdvancedConfSchema(schema.ResponseSchema):
367-
"""AdvancedConf - 域名高级配置"""
368-
369-
fields = {
370-
"Http2Https": fields.Bool(required=False, load_from="Http2Https"),
371-
"HttpClientHeader": fields.List(fields.Str()),
372-
"HttpOriginHeader": fields.List(fields.Str()),
373-
"QuicEnable": fields.Bool(required=False, load_from="QuicEnable"),
374-
"WebSocketEnable": fields.Bool(
375-
required=False, load_from="WebSocketEnable"
376-
),
377-
}
378-
379-
380394
class DomainConfigInfoSchema(schema.ResponseSchema):
381395
"""DomainConfigInfo - 更新域名配置"""
382396

0 commit comments

Comments
 (0)