Skip to content

Commit b2901fc

Browse files
author
fengyikai
committed
内容分发网络(cdn):更新v3接口 V3GetBandwidthData /2016-09-01/statistics/GetBandwidthData; V3GetFlowData /2016-09-01/statist...;云监控(monitor):获取故障影响实例列表接口更新
1 parent fd8317c commit b2901fc

5 files changed

Lines changed: 292 additions & 1 deletion

File tree

ksyun/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
# limitations under the License.
1515

1616

17-
__version__ = '1.5.8.35'
17+
__version__ = '1.5.8.36'

ksyun/client/cdn/v3/client.py

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,3 +721,72 @@ def GetBlockUrlQuota(self, request):
721721
raise KsyunSDKException(e.message, e.message)
722722

723723

724+
def GetBandwidthData(self, request):
725+
"""新版查询带宽信息V3
726+
:param request: Request instance for GetBandwidthData.
727+
:type request: :class:`ksyun.client.cdn.v3.models.GetBandwidthDataRequest`
728+
"""
729+
try:
730+
params = request._serialize()
731+
body = self.call_judge("GetBandwidthData", params, "application/json")
732+
response = json.loads(body)
733+
if "Error" not in response:
734+
return body
735+
else:
736+
code = response["Error"]["Code"]
737+
message = response["Error"]["Message"]
738+
req_id = response["RequestId"]
739+
raise KsyunSDKException(code, message, req_id)
740+
except Exception as e:
741+
if isinstance(e, KsyunSDKException):
742+
raise
743+
else:
744+
raise KsyunSDKException(e.message, e.message)
745+
746+
747+
def GetFlowData(self, request):
748+
"""新版查询流量信息接口V3
749+
:param request: Request instance for GetFlowData.
750+
:type request: :class:`ksyun.client.cdn.v3.models.GetFlowDataRequest`
751+
"""
752+
try:
753+
params = request._serialize()
754+
body = self.call_judge("GetFlowData", params, "application/x-www-form-urlencoded")
755+
response = json.loads(body)
756+
if "Error" not in response:
757+
return body
758+
else:
759+
code = response["Error"]["Code"]
760+
message = response["Error"]["Message"]
761+
req_id = response["RequestId"]
762+
raise KsyunSDKException(code, message, req_id)
763+
except Exception as e:
764+
if isinstance(e, KsyunSDKException):
765+
raise
766+
else:
767+
raise KsyunSDKException(e.message, e.message)
768+
769+
770+
def GetPvData(self, request):
771+
"""新版查询请求数信息接口V3
772+
:param request: Request instance for GetPvData.
773+
:type request: :class:`ksyun.client.cdn.v3.models.GetPvDataRequest`
774+
"""
775+
try:
776+
params = request._serialize()
777+
body = self.call_judge("GetPvData", params, "application/x-www-form-urlencoded")
778+
response = json.loads(body)
779+
if "Error" not in response:
780+
return body
781+
else:
782+
code = response["Error"]["Code"]
783+
message = response["Error"]["Message"]
784+
req_id = response["RequestId"]
785+
raise KsyunSDKException(code, message, req_id)
786+
except Exception as e:
787+
if isinstance(e, KsyunSDKException):
788+
raise
789+
else:
790+
raise KsyunSDKException(e.message, e.message)
791+
792+

ksyun/client/cdn/v3/models.py

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -907,3 +907,171 @@ def _deserialize(self, params):
907907
return
908908

909909

910+
class GetBandwidthDataRequest(AbstractModel):
911+
"""GetBandwidthData请求参数结构体
912+
"""
913+
914+
def __init__(self):
915+
r"""新版查询带宽信息V3
916+
:param StartTime: 获取数据起始时间点,日期格式按ISO8601表示法,北京时间,格式为:YYYY-MM-DDThh:mm+0800,例如: 2016-08-01T21:14+0800
917+
:type PathPrefix: String
918+
:param EndTime: 结束时间需大于起始时间;获取日期格式按照ISO8601表示法,北京时间,格式为:YYYY-MM-DDThh:mm+0800,例如: 2016-08-01T21:14+0800
919+
:type PathPrefix: String
920+
:param CdnType: 产品类型,只允许输入一种类型,取值为file:大文件下载,video:音视频点播,page:图片小文件,live:流媒体直播
921+
:type PathPrefix: String
922+
:param DomainIds: 域名ID,缺省为当前产品类型下的全部域名,可输入需要查询的域名ID,支持批量域名查询,多个域名ID用逗号(半角)分隔
923+
:type PathPrefix: String
924+
:param Regions: S区域名称,枚举类型表见使用须知,支持多区域查询,多个区域用逗号(半角)分隔,缺省为 CN缺省为 CN
925+
:type PathPrefix: String
926+
:param ResultType: 取值为0:多域名多区域数据做合并;1:每个域名每个区域的数据分别返回
927+
:type PathPrefix: Int
928+
:param Granularity: 统计粒度,取值为 5(默认):5分钟粒度;10:10分钟粒度;20:20分钟粒度;60:1小时粒度;240:4小时粒度;480:8小时粒度;1440:1天粒度;以上粒度的带宽值均取该粒度时间段的带宽峰值,即每5分钟有效带宽值的最高带宽
929+
:type PathPrefix: Int
930+
:param DataType: 数据类型,取值为edge:服务数据; origin:回源数据(push:直播推流加速暂不支持查询回源数据); 支持多类型选择,多个类型用逗号(半角)分隔,缺省为 edge
931+
:type PathPrefix: String
932+
:param ProtocolType: 协议类型, 取值为http:http协议数据;https:https协议数据;缺省默认返回全部协议数据(当CdnType=live时,请忽略此参数)
933+
:type PathPrefix: String
934+
"""
935+
self.StartTime = None
936+
self.EndTime = None
937+
self.CdnType = None
938+
self.DomainIds = None
939+
self.Regions = None
940+
self.ResultType = None
941+
self.Granularity = None
942+
self.DataType = None
943+
self.ProtocolType = None
944+
945+
def _deserialize(self, params):
946+
if params.get("StartTime"):
947+
self.StartTime = params.get("StartTime")
948+
if params.get("EndTime"):
949+
self.EndTime = params.get("EndTime")
950+
if params.get("CdnType"):
951+
self.CdnType = params.get("CdnType")
952+
if params.get("DomainIds"):
953+
self.DomainIds = params.get("DomainIds")
954+
if params.get("Regions"):
955+
self.Regions = params.get("Regions")
956+
if params.get("ResultType"):
957+
self.ResultType = params.get("ResultType")
958+
if params.get("Granularity"):
959+
self.Granularity = params.get("Granularity")
960+
if params.get("DataType"):
961+
self.DataType = params.get("DataType")
962+
if params.get("ProtocolType"):
963+
self.ProtocolType = params.get("ProtocolType")
964+
965+
966+
class GetFlowDataRequest(AbstractModel):
967+
"""GetFlowData请求参数结构体
968+
"""
969+
970+
def __init__(self):
971+
r"""新版查询流量信息接口V3
972+
:param StartTime: 获取数据起始时间点,日期格式按ISO8601表示法,北京时间,格式为:YYYY-MM-DDThh:mm+0800,例如: 2016-08-01T21:14+0800
973+
:type PathPrefix: String
974+
:param EndTime: 结束时间需大于起始时间;获取日期格式按照ISO8601表示法,北京时间,格式为:YYYY-MM-DDThh:mm+0800,例如: 2016-08-01T21:14+0800
975+
:type PathPrefix: String
976+
:param CdnType: 产品类型,只允许输入一种类型,取值为file:大文件下载,video:音视频点播,page:图片小文件,live:流媒体直播
977+
:type PathPrefix: String
978+
:param DomainIds: 域名ID,缺省为当前产品类型下的全部域名,可输入需要查询的域名ID,支持批量域名查询,多个域名ID用逗号(半角)分隔
979+
:type PathPrefix: String
980+
:param Regions: 区域名称,枚举类型表见[使用须知](使用须知),支持多区域查询,多个区域用逗号(半角)分隔,缺省为 CN缺省为 CN
981+
:type PathPrefix: String
982+
:param ResultType: 取值为0:多域名多区域数据做合并;1:每个域名每个区域的数据分别返回
983+
:type PathPrefix: Int
984+
:param Granularity: 统计粒度,取值为 5(默认):5分钟粒度;10:10分钟粒度;20:20分钟粒度;60:1小时粒度;240:4小时粒度;480:8小时粒度;1440:1天粒度;以上粒度流量值均取该粒度时间段的流量总和
985+
:type PathPrefix: Int
986+
:param DataType: 数据类型,取值为edge:服务数据; origin:回源数据(push:直播推流加速暂不支持查询回源数据); 支持多类型选择,多个类型用逗号(半角)分隔,缺省为edge
987+
:type PathPrefix: String
988+
:param ProtocolType: 协议类型, 取值为http:htts协议数据; https:https协议数据;缺省默认返回全部协议数据
989+
:type PathPrefix: String
990+
"""
991+
self.StartTime = None
992+
self.EndTime = None
993+
self.CdnType = None
994+
self.DomainIds = None
995+
self.Regions = None
996+
self.ResultType = None
997+
self.Granularity = None
998+
self.DataType = None
999+
self.ProtocolType = None
1000+
1001+
def _deserialize(self, params):
1002+
if params.get("StartTime"):
1003+
self.StartTime = params.get("StartTime")
1004+
if params.get("EndTime"):
1005+
self.EndTime = params.get("EndTime")
1006+
if params.get("CdnType"):
1007+
self.CdnType = params.get("CdnType")
1008+
if params.get("DomainIds"):
1009+
self.DomainIds = params.get("DomainIds")
1010+
if params.get("Regions"):
1011+
self.Regions = params.get("Regions")
1012+
if params.get("ResultType"):
1013+
self.ResultType = params.get("ResultType")
1014+
if params.get("Granularity"):
1015+
self.Granularity = params.get("Granularity")
1016+
if params.get("DataType"):
1017+
self.DataType = params.get("DataType")
1018+
if params.get("ProtocolType"):
1019+
self.ProtocolType = params.get("ProtocolType")
1020+
1021+
1022+
class GetPvDataRequest(AbstractModel):
1023+
"""GetPvData请求参数结构体
1024+
"""
1025+
1026+
def __init__(self):
1027+
r"""新版查询请求数信息接口V3
1028+
:param StartTime: 获取数据起始时间点,日期格式按ISO8601表示法,北京时间,格式为:YYYY-MM-DDThh:mm+0800,例如: 2016-08-01T21:14+0800
1029+
:type PathPrefix: String
1030+
:param EndTime: 结束时间需大于起始时间;获取日期格式按照ISO8601表示法,北京时间,格式为:YYYY-MM-DDThh:mm+0800,例如: 2016-08-01T21:14+0800
1031+
:type PathPrefix: String
1032+
:param CdnType: 产品类型,只允许输入一种类型,取值为file:大文件下载,video:音视频点播,page:图片小文件,live:流媒体直播
1033+
:type PathPrefix: String
1034+
:param DomainIds: 域名ID,缺省为当前产品类型下的全部域名,可输入需要查询的域名ID,支持批量域名查询,多个域名ID用逗号(半角)分隔
1035+
:type PathPrefix: String
1036+
:param Regions: 区域名称,枚举类型表见[使用须知](https://docs.ksyun.com/documents/196#36),支持多区域查询,多个区域用逗号(半角)分隔,缺省为 CN缺省为 CN
1037+
:type PathPrefix: String
1038+
:param ResultType: 取值为0:多域名多区域数据做合并;1:每个域名每个区域的数据分别返回
1039+
:type PathPrefix: Int
1040+
:param Granularity: 统计粒度,取值为 5(默认):5分钟粒度;10:10分钟粒度;20:20分钟粒度;60:1小时粒度;240:4小时粒度;480:8小时粒度;1440:1天粒度;以上粒度的请求数均取该粒度时间段的请求数总和
1041+
:type PathPrefix: Int
1042+
:param DataType: 数据类型, 取值为edge:服务数据; origin:回源数据; 支持多类型选择,多个类型用逗号(半角)分隔,缺省为edge
1043+
:type PathPrefix: String
1044+
:param ProtocolType: 协议类型, 取值为http:http协议数据; https:https协议数据(直播不支持区分协议查询),默认返回全部协议数据
1045+
:type PathPrefix: String
1046+
"""
1047+
self.StartTime = None
1048+
self.EndTime = None
1049+
self.CdnType = None
1050+
self.DomainIds = None
1051+
self.Regions = None
1052+
self.ResultType = None
1053+
self.Granularity = None
1054+
self.DataType = None
1055+
self.ProtocolType = None
1056+
1057+
def _deserialize(self, params):
1058+
if params.get("StartTime"):
1059+
self.StartTime = params.get("StartTime")
1060+
if params.get("EndTime"):
1061+
self.EndTime = params.get("EndTime")
1062+
if params.get("CdnType"):
1063+
self.CdnType = params.get("CdnType")
1064+
if params.get("DomainIds"):
1065+
self.DomainIds = params.get("DomainIds")
1066+
if params.get("Regions"):
1067+
self.Regions = params.get("Regions")
1068+
if params.get("ResultType"):
1069+
self.ResultType = params.get("ResultType")
1070+
if params.get("Granularity"):
1071+
self.Granularity = params.get("Granularity")
1072+
if params.get("DataType"):
1073+
self.DataType = params.get("DataType")
1074+
if params.get("ProtocolType"):
1075+
self.ProtocolType = params.get("ProtocolType")
1076+
1077+

ksyun/client/monitor/v20250101/client.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,26 @@ def DescribeSystemEventAttributes(self, request):
5454
raise KsyunSDKException(e.message, e.message)
5555

5656

57+
def ListAlarmEffectInstance(self, request):
58+
"""获取故障影响实例列表
59+
:param request: Request instance for ListAlarmEffectInstance.
60+
:type request: :class:`ksyun.client.monitor.v20250101.models.ListAlarmEffectInstanceRequest`
61+
"""
62+
try:
63+
params = request._serialize()
64+
body = self.call_judge("ListAlarmEffectInstance", params, "application/x-www-form-urlencoded")
65+
response = json.loads(body)
66+
if "Error" not in response:
67+
return body
68+
else:
69+
code = response["Error"]["Code"]
70+
message = response["Error"]["Message"]
71+
req_id = response["RequestId"]
72+
raise KsyunSDKException(code, message, req_id)
73+
except Exception as e:
74+
if isinstance(e, KsyunSDKException):
75+
raise
76+
else:
77+
raise KsyunSDKException(e.message, e.message)
78+
79+

ksyun/client/monitor/v20250101/models.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,34 @@ def _deserialize(self, params):
123123
self.PageSize = params.get("PageSize")
124124

125125

126+
class ListAlarmEffectInstanceRequest(AbstractModel):
127+
"""ListAlarmEffectInstance请求参数结构体
128+
"""
129+
130+
def __init__(self):
131+
r"""获取故障影响实例列表
132+
:param StartTime: 开始时间。
133+
:type PathPrefix: Int
134+
:param EndTime: 结束时间。
135+
:type PathPrefix: Int
136+
:param PageIndex: 页数。
137+
:type PathPrefix: Int
138+
:param PageSize: 每页显示最大数量。
139+
:type PathPrefix: Int
140+
"""
141+
self.StartTime = None
142+
self.EndTime = None
143+
self.PageIndex = None
144+
self.PageSize = None
145+
146+
def _deserialize(self, params):
147+
if params.get("StartTime"):
148+
self.StartTime = params.get("StartTime")
149+
if params.get("EndTime"):
150+
self.EndTime = params.get("EndTime")
151+
if params.get("PageIndex"):
152+
self.PageIndex = params.get("PageIndex")
153+
if params.get("PageSize"):
154+
self.PageSize = params.get("PageSize")
155+
156+

0 commit comments

Comments
 (0)