|
| 1 | +# coding=utf8 |
| 2 | + |
| 3 | +# Copyright 2018 JDCLOUD.COM |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | +# you may not use this file except in compliance with the License. |
| 7 | +# You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | +# |
| 17 | +# NOTE: This class is auto generated by the jdcloud code generator program. |
| 18 | + |
| 19 | +from jdcloud_sdk.core.jdcloudrequest import JDCloudRequest |
| 20 | + |
| 21 | + |
| 22 | +class CreateAlarmRequest(JDCloudRequest): |
| 23 | + """ |
| 24 | + 创建报警 |
| 25 | + """ |
| 26 | + |
| 27 | + def __init__(self, parameters, header=None, version="v1"): |
| 28 | + super(CreateAlarmRequest, self).__init__( |
| 29 | + '/alarms', 'POST', header, version) |
| 30 | + self.parameters = parameters |
| 31 | + |
| 32 | + |
| 33 | +class CreateAlarmParameters(object): |
| 34 | + |
| 35 | + def __init__(self, ): |
| 36 | + """ |
| 37 | + """ |
| 38 | + |
| 39 | + self.idc = None |
| 40 | + self.resourceType = None |
| 41 | + self.resourceId = None |
| 42 | + self.name = None |
| 43 | + self.metric = None |
| 44 | + self.period = None |
| 45 | + self.statisticMethod = None |
| 46 | + self.operator = None |
| 47 | + self.threshold = None |
| 48 | + self.times = None |
| 49 | + self.noticePeriod = None |
| 50 | + self.status = None |
| 51 | + self.noticeMethod = None |
| 52 | + self.noticeObj = None |
| 53 | + self.userId = None |
| 54 | + |
| 55 | + def setIdc(self, idc): |
| 56 | + """ |
| 57 | + :param idc: (Optional) idc机房实例ID |
| 58 | + """ |
| 59 | + self.idc = idc |
| 60 | + |
| 61 | + def setResourceType(self, resourceType): |
| 62 | + """ |
| 63 | + :param resourceType: (Optional) 资源类型,bandwidth:带宽 |
| 64 | + """ |
| 65 | + self.resourceType = resourceType |
| 66 | + |
| 67 | + def setResourceId(self, resourceId): |
| 68 | + """ |
| 69 | + :param resourceId: (Optional) 带宽实例ID |
| 70 | + """ |
| 71 | + self.resourceId = resourceId |
| 72 | + |
| 73 | + def setName(self, name): |
| 74 | + """ |
| 75 | + :param name: (Optional) 规则名称 |
| 76 | + """ |
| 77 | + self.name = name |
| 78 | + |
| 79 | + def setMetric(self, metric): |
| 80 | + """ |
| 81 | + :param metric: (Optional) 监控项,bandwidthTrafficIn:上行实时流量 bandwidthTrafficOut:下行实时流量 |
| 82 | + """ |
| 83 | + self.metric = metric |
| 84 | + |
| 85 | + def setPeriod(self, period): |
| 86 | + """ |
| 87 | + :param period: (Optional) 统计周期(单位:分钟) |
| 88 | + """ |
| 89 | + self.period = period |
| 90 | + |
| 91 | + def setStatisticMethod(self, statisticMethod): |
| 92 | + """ |
| 93 | + :param statisticMethod: (Optional) 统计方法:平均值=avg、最大值=max、最小值=min |
| 94 | + """ |
| 95 | + self.statisticMethod = statisticMethod |
| 96 | + |
| 97 | + def setOperator(self, operator): |
| 98 | + """ |
| 99 | + :param operator: (Optional) 计算方式 >=、>、<、<=、=、!= |
| 100 | + """ |
| 101 | + self.operator = operator |
| 102 | + |
| 103 | + def setThreshold(self, threshold): |
| 104 | + """ |
| 105 | + :param threshold: (Optional) 阈值 |
| 106 | + """ |
| 107 | + self.threshold = threshold |
| 108 | + |
| 109 | + def setTimes(self, times): |
| 110 | + """ |
| 111 | + :param times: (Optional) 连续多少次后报警 |
| 112 | + """ |
| 113 | + self.times = times |
| 114 | + |
| 115 | + def setNoticePeriod(self, noticePeriod): |
| 116 | + """ |
| 117 | + :param noticePeriod: (Optional) 通知周期 单位:小时 |
| 118 | + """ |
| 119 | + self.noticePeriod = noticePeriod |
| 120 | + |
| 121 | + def setStatus(self, status): |
| 122 | + """ |
| 123 | + :param status: (Optional) 规则状态 disabled:禁用 enabled:启用 |
| 124 | + """ |
| 125 | + self.status = status |
| 126 | + |
| 127 | + def setNoticeMethod(self, noticeMethod): |
| 128 | + """ |
| 129 | + :param noticeMethod: (Optional) 通知方式 all:全部 sms:短信 email:邮件 |
| 130 | + """ |
| 131 | + self.noticeMethod = noticeMethod |
| 132 | + |
| 133 | + def setNoticeObj(self, noticeObj): |
| 134 | + """ |
| 135 | + :param noticeObj: (Optional) 通知对象 all:全部 persons:个人 groups:角色组 |
| 136 | + """ |
| 137 | + self.noticeObj = noticeObj |
| 138 | + |
| 139 | + def setUserId(self, userId): |
| 140 | + """ |
| 141 | + :param userId: (Optional) 通知对象用户ID,若多个用逗号分隔 |
| 142 | + """ |
| 143 | + self.userId = userId |
| 144 | + |
0 commit comments