PutResourceMetricRuleRequest.cc 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. /*
  2. * Copyright 2009-2017 Alibaba Cloud All rights reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #include <alibabacloud/cms/model/PutResourceMetricRuleRequest.h>
  17. using AlibabaCloud::Cms::Model::PutResourceMetricRuleRequest;
  18. PutResourceMetricRuleRequest::PutResourceMetricRuleRequest()
  19. : RpcServiceRequest("cms", "2019-01-01", "PutResourceMetricRule") {
  20. setMethod(HttpRequest::Method::Post);
  21. }
  22. PutResourceMetricRuleRequest::~PutResourceMetricRuleRequest() {}
  23. std::string PutResourceMetricRuleRequest::getWebhook() const {
  24. return webhook_;
  25. }
  26. void PutResourceMetricRuleRequest::setWebhook(const std::string &webhook) {
  27. webhook_ = webhook;
  28. setParameter(std::string("Webhook"), webhook);
  29. }
  30. std::string PutResourceMetricRuleRequest::getEscalationsWarnComparisonOperator() const {
  31. return escalationsWarnComparisonOperator_;
  32. }
  33. void PutResourceMetricRuleRequest::setEscalationsWarnComparisonOperator(const std::string &escalationsWarnComparisonOperator) {
  34. escalationsWarnComparisonOperator_ = escalationsWarnComparisonOperator;
  35. setParameter(std::string("Escalations.Warn.ComparisonOperator"), escalationsWarnComparisonOperator);
  36. }
  37. std::string PutResourceMetricRuleRequest::getRuleName() const {
  38. return ruleName_;
  39. }
  40. void PutResourceMetricRuleRequest::setRuleName(const std::string &ruleName) {
  41. ruleName_ = ruleName;
  42. setParameter(std::string("RuleName"), ruleName);
  43. }
  44. std::string PutResourceMetricRuleRequest::getEffectiveInterval() const {
  45. return effectiveInterval_;
  46. }
  47. void PutResourceMetricRuleRequest::setEffectiveInterval(const std::string &effectiveInterval) {
  48. effectiveInterval_ = effectiveInterval;
  49. setParameter(std::string("EffectiveInterval"), effectiveInterval);
  50. }
  51. std::string PutResourceMetricRuleRequest::getNoDataPolicy() const {
  52. return noDataPolicy_;
  53. }
  54. void PutResourceMetricRuleRequest::setNoDataPolicy(const std::string &noDataPolicy) {
  55. noDataPolicy_ = noDataPolicy;
  56. setParameter(std::string("NoDataPolicy"), noDataPolicy);
  57. }
  58. std::string PutResourceMetricRuleRequest::getNoEffectiveInterval() const {
  59. return noEffectiveInterval_;
  60. }
  61. void PutResourceMetricRuleRequest::setNoEffectiveInterval(const std::string &noEffectiveInterval) {
  62. noEffectiveInterval_ = noEffectiveInterval;
  63. setParameter(std::string("NoEffectiveInterval"), noEffectiveInterval);
  64. }
  65. std::string PutResourceMetricRuleRequest::getEmailSubject() const {
  66. return emailSubject_;
  67. }
  68. void PutResourceMetricRuleRequest::setEmailSubject(const std::string &emailSubject) {
  69. emailSubject_ = emailSubject;
  70. setParameter(std::string("EmailSubject"), emailSubject);
  71. }
  72. std::string PutResourceMetricRuleRequest::getOptions() const {
  73. return options_;
  74. }
  75. void PutResourceMetricRuleRequest::setOptions(const std::string &options) {
  76. options_ = options;
  77. setParameter(std::string("Options"), options);
  78. }
  79. std::string PutResourceMetricRuleRequest::getMetricName() const {
  80. return metricName_;
  81. }
  82. void PutResourceMetricRuleRequest::setMetricName(const std::string &metricName) {
  83. metricName_ = metricName;
  84. setParameter(std::string("MetricName"), metricName);
  85. }
  86. int PutResourceMetricRuleRequest::getEscalationsWarnTimes() const {
  87. return escalationsWarnTimes_;
  88. }
  89. void PutResourceMetricRuleRequest::setEscalationsWarnTimes(int escalationsWarnTimes) {
  90. escalationsWarnTimes_ = escalationsWarnTimes;
  91. setParameter(std::string("Escalations.Warn.Times"), std::to_string(escalationsWarnTimes));
  92. }
  93. std::string PutResourceMetricRuleRequest::getPeriod() const {
  94. return period_;
  95. }
  96. void PutResourceMetricRuleRequest::setPeriod(const std::string &period) {
  97. period_ = period;
  98. setParameter(std::string("Period"), period);
  99. }
  100. std::string PutResourceMetricRuleRequest::getEscalationsWarnThreshold() const {
  101. return escalationsWarnThreshold_;
  102. }
  103. void PutResourceMetricRuleRequest::setEscalationsWarnThreshold(const std::string &escalationsWarnThreshold) {
  104. escalationsWarnThreshold_ = escalationsWarnThreshold;
  105. setParameter(std::string("Escalations.Warn.Threshold"), escalationsWarnThreshold);
  106. }
  107. std::string PutResourceMetricRuleRequest::getContactGroups() const {
  108. return contactGroups_;
  109. }
  110. void PutResourceMetricRuleRequest::setContactGroups(const std::string &contactGroups) {
  111. contactGroups_ = contactGroups;
  112. setParameter(std::string("ContactGroups"), contactGroups);
  113. }
  114. std::string PutResourceMetricRuleRequest::getEscalationsCriticalStatistics() const {
  115. return escalationsCriticalStatistics_;
  116. }
  117. void PutResourceMetricRuleRequest::setEscalationsCriticalStatistics(const std::string &escalationsCriticalStatistics) {
  118. escalationsCriticalStatistics_ = escalationsCriticalStatistics;
  119. setParameter(std::string("Escalations.Critical.Statistics"), escalationsCriticalStatistics);
  120. }
  121. std::string PutResourceMetricRuleRequest::getGroupId() const {
  122. return groupId_;
  123. }
  124. void PutResourceMetricRuleRequest::setGroupId(const std::string &groupId) {
  125. groupId_ = groupId;
  126. setParameter(std::string("GroupId"), groupId);
  127. }
  128. std::string PutResourceMetricRuleRequest::getGroupName() const {
  129. return groupName_;
  130. }
  131. void PutResourceMetricRuleRequest::setGroupName(const std::string &groupName) {
  132. groupName_ = groupName;
  133. setParameter(std::string("GroupName"), groupName);
  134. }
  135. std::vector<PutResourceMetricRuleRequest::Labels> PutResourceMetricRuleRequest::getLabels() const {
  136. return labels_;
  137. }
  138. void PutResourceMetricRuleRequest::setLabels(const std::vector<PutResourceMetricRuleRequest::Labels> &labels) {
  139. labels_ = labels;
  140. for(int dep1 = 0; dep1 != labels.size(); dep1++) {
  141. auto labelsObj = labels.at(dep1);
  142. std::string labelsObjStr = std::string("Labels") + "." + std::to_string(dep1 + 1);
  143. setParameter(labelsObjStr + ".Value", labelsObj.value);
  144. setParameter(labelsObjStr + ".Key", labelsObj.key);
  145. }
  146. }
  147. std::string PutResourceMetricRuleRequest::getInterval() const {
  148. return interval_;
  149. }
  150. void PutResourceMetricRuleRequest::setInterval(const std::string &interval) {
  151. interval_ = interval;
  152. setParameter(std::string("Interval"), interval);
  153. }
  154. std::string PutResourceMetricRuleRequest::getRuleId() const {
  155. return ruleId_;
  156. }
  157. void PutResourceMetricRuleRequest::setRuleId(const std::string &ruleId) {
  158. ruleId_ = ruleId;
  159. setParameter(std::string("RuleId"), ruleId);
  160. }
  161. std::string PutResourceMetricRuleRequest::getEscalationsCriticalThreshold() const {
  162. return escalationsCriticalThreshold_;
  163. }
  164. void PutResourceMetricRuleRequest::setEscalationsCriticalThreshold(const std::string &escalationsCriticalThreshold) {
  165. escalationsCriticalThreshold_ = escalationsCriticalThreshold;
  166. setParameter(std::string("Escalations.Critical.Threshold"), escalationsCriticalThreshold);
  167. }
  168. std::string PutResourceMetricRuleRequest::getEscalationsInfoStatistics() const {
  169. return escalationsInfoStatistics_;
  170. }
  171. void PutResourceMetricRuleRequest::setEscalationsInfoStatistics(const std::string &escalationsInfoStatistics) {
  172. escalationsInfoStatistics_ = escalationsInfoStatistics;
  173. setParameter(std::string("Escalations.Info.Statistics"), escalationsInfoStatistics);
  174. }
  175. std::string PutResourceMetricRuleRequest::getEscalationsInfoComparisonOperator() const {
  176. return escalationsInfoComparisonOperator_;
  177. }
  178. void PutResourceMetricRuleRequest::setEscalationsInfoComparisonOperator(const std::string &escalationsInfoComparisonOperator) {
  179. escalationsInfoComparisonOperator_ = escalationsInfoComparisonOperator;
  180. setParameter(std::string("Escalations.Info.ComparisonOperator"), escalationsInfoComparisonOperator);
  181. }
  182. int PutResourceMetricRuleRequest::getSilenceTime() const {
  183. return silenceTime_;
  184. }
  185. void PutResourceMetricRuleRequest::setSilenceTime(int silenceTime) {
  186. silenceTime_ = silenceTime;
  187. setParameter(std::string("SilenceTime"), std::to_string(silenceTime));
  188. }
  189. PutResourceMetricRuleRequest::Prometheus PutResourceMetricRuleRequest::getPrometheus() const {
  190. return prometheus_;
  191. }
  192. void PutResourceMetricRuleRequest::setPrometheus(const PutResourceMetricRuleRequest::Prometheus &prometheus) {
  193. prometheus_ = prometheus;
  194. setParameter(std::string("Prometheus") + ".PromQL", prometheus.promQL);
  195. setParameter(std::string("Prometheus") + ".Times", std::to_string(prometheus.times));
  196. setParameter(std::string("Prometheus") + ".Level", prometheus.level);
  197. for(int dep1 = 0; dep1 != prometheus.annotations.size(); dep1++) {
  198. setParameter(std::string("Prometheus") + ".Annotations." + std::to_string(dep1 + 1) + ".Value", prometheus.annotations[dep1].value);
  199. setParameter(std::string("Prometheus") + ".Annotations." + std::to_string(dep1 + 1) + ".Key", prometheus.annotations[dep1].key);
  200. }
  201. }
  202. PutResourceMetricRuleRequest::CompositeExpression PutResourceMetricRuleRequest::getCompositeExpression() const {
  203. return compositeExpression_;
  204. }
  205. void PutResourceMetricRuleRequest::setCompositeExpression(const PutResourceMetricRuleRequest::CompositeExpression &compositeExpression) {
  206. compositeExpression_ = compositeExpression;
  207. setParameter(std::string("CompositeExpression") + ".Times", std::to_string(compositeExpression.times));
  208. for(int dep1 = 0; dep1 != compositeExpression.expressionList.size(); dep1++) {
  209. setParameter(std::string("CompositeExpression") + ".ExpressionList." + std::to_string(dep1 + 1) + ".Period", std::to_string(compositeExpression.expressionList[dep1].period));
  210. setParameter(std::string("CompositeExpression") + ".ExpressionList." + std::to_string(dep1 + 1) + ".Threshold", compositeExpression.expressionList[dep1].threshold);
  211. setParameter(std::string("CompositeExpression") + ".ExpressionList." + std::to_string(dep1 + 1) + ".Id", compositeExpression.expressionList[dep1].id);
  212. setParameter(std::string("CompositeExpression") + ".ExpressionList." + std::to_string(dep1 + 1) + ".MetricName", compositeExpression.expressionList[dep1].metricName);
  213. setParameter(std::string("CompositeExpression") + ".ExpressionList." + std::to_string(dep1 + 1) + ".ComparisonOperator", compositeExpression.expressionList[dep1].comparisonOperator);
  214. setParameter(std::string("CompositeExpression") + ".ExpressionList." + std::to_string(dep1 + 1) + ".Statistics", compositeExpression.expressionList[dep1].statistics);
  215. }
  216. setParameter(std::string("CompositeExpression") + ".Level", compositeExpression.level);
  217. setParameter(std::string("CompositeExpression") + ".ExpressionRaw", compositeExpression.expressionRaw);
  218. setParameter(std::string("CompositeExpression") + ".ExpressionListJoin", compositeExpression.expressionListJoin);
  219. }
  220. std::string PutResourceMetricRuleRequest::getResources() const {
  221. return resources_;
  222. }
  223. void PutResourceMetricRuleRequest::setResources(const std::string &resources) {
  224. resources_ = resources;
  225. setParameter(std::string("Resources"), resources);
  226. }
  227. int PutResourceMetricRuleRequest::getEscalationsInfoTimes() const {
  228. return escalationsInfoTimes_;
  229. }
  230. void PutResourceMetricRuleRequest::setEscalationsInfoTimes(int escalationsInfoTimes) {
  231. escalationsInfoTimes_ = escalationsInfoTimes;
  232. setParameter(std::string("Escalations.Info.Times"), std::to_string(escalationsInfoTimes));
  233. }
  234. std::string PutResourceMetricRuleRequest::getGroupBy() const {
  235. return groupBy_;
  236. }
  237. void PutResourceMetricRuleRequest::setGroupBy(const std::string &groupBy) {
  238. groupBy_ = groupBy;
  239. setParameter(std::string("GroupBy"), groupBy);
  240. }
  241. int PutResourceMetricRuleRequest::getEscalationsCriticalTimes() const {
  242. return escalationsCriticalTimes_;
  243. }
  244. void PutResourceMetricRuleRequest::setEscalationsCriticalTimes(int escalationsCriticalTimes) {
  245. escalationsCriticalTimes_ = escalationsCriticalTimes;
  246. setParameter(std::string("Escalations.Critical.Times"), std::to_string(escalationsCriticalTimes));
  247. }
  248. std::string PutResourceMetricRuleRequest::getEscalationsWarnStatistics() const {
  249. return escalationsWarnStatistics_;
  250. }
  251. void PutResourceMetricRuleRequest::setEscalationsWarnStatistics(const std::string &escalationsWarnStatistics) {
  252. escalationsWarnStatistics_ = escalationsWarnStatistics;
  253. setParameter(std::string("Escalations.Warn.Statistics"), escalationsWarnStatistics);
  254. }
  255. std::string PutResourceMetricRuleRequest::getEscalationsInfoThreshold() const {
  256. return escalationsInfoThreshold_;
  257. }
  258. void PutResourceMetricRuleRequest::setEscalationsInfoThreshold(const std::string &escalationsInfoThreshold) {
  259. escalationsInfoThreshold_ = escalationsInfoThreshold;
  260. setParameter(std::string("Escalations.Info.Threshold"), escalationsInfoThreshold);
  261. }
  262. std::string PutResourceMetricRuleRequest::get_Namespace() const {
  263. return _namespace_;
  264. }
  265. void PutResourceMetricRuleRequest::set_Namespace(const std::string &_namespace) {
  266. _namespace_ = _namespace;
  267. setParameter(std::string("Namespace"), _namespace);
  268. }
  269. std::string PutResourceMetricRuleRequest::getEscalationsCriticalComparisonOperator() const {
  270. return escalationsCriticalComparisonOperator_;
  271. }
  272. void PutResourceMetricRuleRequest::setEscalationsCriticalComparisonOperator(const std::string &escalationsCriticalComparisonOperator) {
  273. escalationsCriticalComparisonOperator_ = escalationsCriticalComparisonOperator;
  274. setParameter(std::string("Escalations.Critical.ComparisonOperator"), escalationsCriticalComparisonOperator);
  275. }