Skip to content

Commit

Permalink
Update SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
fengyikai committed Jul 11, 2024
1 parent ed968ac commit a06cf95
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 58 deletions.
2 changes: 1 addition & 1 deletion ksyun/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
# limitations under the License.


__version__ = '1.4.5'
__version__ = '1.4.6'
23 changes: 23 additions & 0 deletions ksyun/client/monitor/v20210101/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


12 changes: 12 additions & 0 deletions ksyun/client/monitor/v20210101/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


58 changes: 1 addition & 57 deletions ksyun/client/monitor/v20220101/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit a06cf95

Please sign in to comment.