From a06cf9503a8d9b40f7756fc6a8b98cf19f74382b Mon Sep 17 00:00:00 2001 From: fengyikai Date: Thu, 11 Jul 2024 10:17:10 +0800 Subject: [PATCH] Update SDK --- ksyun/__init__.py | 2 +- ksyun/client/monitor/v20210101/client.py | 23 ++++++++++ ksyun/client/monitor/v20210101/models.py | 12 +++++ ksyun/client/monitor/v20220101/models.py | 58 +----------------------- 4 files changed, 37 insertions(+), 58 deletions(-) diff --git a/ksyun/__init__.py b/ksyun/__init__.py index a5ca1e1..7ed4632 100644 --- a/ksyun/__init__.py +++ b/ksyun/__init__.py @@ -14,4 +14,4 @@ # limitations under the License. -__version__ = '1.4.5' +__version__ = '1.4.6' diff --git a/ksyun/client/monitor/v20210101/client.py b/ksyun/client/monitor/v20210101/client.py index ec81bfc..ef84ae6 100644 --- a/ksyun/client/monitor/v20210101/client.py +++ b/ksyun/client/monitor/v20210101/client.py @@ -215,3 +215,26 @@ def UpdateAlertUserStatus(self, request): raise KsyunSDKException(e.message, e.message) + def DescribeMonitorProductList(self, request): + """描述监控云服务类别,支持项目 + :param request: Request instance for DescribeMonitorProductList. + :type request: :class:`ksyun.client.monitor.v20210101.models.DescribeMonitorProductListRequest` + """ + try: + params = request._serialize() + body = self.call_judge("DescribeMonitorProductList", params, "application/json") + response = json.loads(body) + if "Error" not in response: + return body + else: + code = response["Error"]["Code"] + message = response["Error"]["Message"] + req_id = response["RequestId"] + raise KsyunSDKException(code, message, req_id) + except Exception as e: + if isinstance(e, KsyunSDKException): + raise + else: + raise KsyunSDKException(e.message, e.message) + + diff --git a/ksyun/client/monitor/v20210101/models.py b/ksyun/client/monitor/v20210101/models.py index a67d36b..c74f325 100644 --- a/ksyun/client/monitor/v20210101/models.py +++ b/ksyun/client/monitor/v20210101/models.py @@ -207,3 +207,15 @@ def _deserialize(self, params): self.UserStatus = params.get("UserStatus") +class DescribeMonitorProductListRequest(AbstractModel): + """DescribeMonitorProductList请求参数结构体 + """ + + def __init__(self): + r"""描述监控云服务类别,支持项目 + """ + + def _deserialize(self, params): + return + + diff --git a/ksyun/client/monitor/v20220101/models.py b/ksyun/client/monitor/v20220101/models.py index 97bcdac..5a60ad9 100644 --- a/ksyun/client/monitor/v20220101/models.py +++ b/ksyun/client/monitor/v20220101/models.py @@ -6,66 +6,10 @@ class CreateAlarmPolicyRequest(AbstractModel): def __init__(self): r"""创建告警策略 - :param PolicyName: 策略名称 - :type PathPrefix: String - :param ProductType: 云服务类别,详见 [云服务类别](云服务类别) - :type PathPrefix: Int - :param PolicyType: 策略类型。取值: -- 0:普通策略 -- 1:默认策略 - :type PathPrefix: Int - :param ResourceBindType: 策略所关联资源,绑定方式。取值: -- 1:全部实例 -- 2:按照项目组维度 -- 3:自选实例 - :type PathPrefix: Int - :param ProjectId: 项目组ID。 - -> **注意**:有且当 ResourceBindType=2时,该字段必填 - - - :type PathPrefix: Int - :param InstanceIds: 实例ID。 - -> **注意:** 有且当 ResourceBindType=3时,该字段必填 - :type PathPrefix: Array - :param TriggerRules: 配置触发告警的规则列表 - :type PathPrefix: Array - :param UserNotice: 绑定告警联系人/联系组列表 - :type PathPrefix: Array - :param URLNotice: 告警回调Webhook地址。 -> **注意:** 最多可添加5个回调地址。 - :type PathPrefix: Array """ - self.PolicyName = None - self.ProductType = None - self.PolicyType = None - self.ResourceBindType = None - self.ProjectId = None - self.InstanceIds = None - self.TriggerRules = None - self.UserNotice = None - self.URLNotice = None def _deserialize(self, params): - if params.get("PolicyName"): - self.PolicyName = params.get("PolicyName") - if params.get("ProductType"): - self.ProductType = params.get("ProductType") - if params.get("PolicyType"): - self.PolicyType = params.get("PolicyType") - if params.get("ResourceBindType"): - self.ResourceBindType = params.get("ResourceBindType") - if params.get("ProjectId"): - self.ProjectId = params.get("ProjectId") - if params.get("InstanceIds"): - self.InstanceIds = params.get("InstanceIds") - if params.get("TriggerRules"): - self.TriggerRules = params.get("TriggerRules") - if params.get("UserNotice"): - self.UserNotice = params.get("UserNotice") - if params.get("URLNotice"): - self.URLNotice = params.get("URLNotice") + return class DeleteAlarmPolicyRequest(AbstractModel):