CreateGroupMonitoringAgentProcessRequest.cc 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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/CreateGroupMonitoringAgentProcessRequest.h>
  17. using AlibabaCloud::Cms::Model::CreateGroupMonitoringAgentProcessRequest;
  18. CreateGroupMonitoringAgentProcessRequest::CreateGroupMonitoringAgentProcessRequest()
  19. : RpcServiceRequest("cms", "2019-01-01", "CreateGroupMonitoringAgentProcess") {
  20. setMethod(HttpRequest::Method::Post);
  21. }
  22. CreateGroupMonitoringAgentProcessRequest::~CreateGroupMonitoringAgentProcessRequest() {}
  23. std::vector<CreateGroupMonitoringAgentProcessRequest::AlertConfig> CreateGroupMonitoringAgentProcessRequest::getAlertConfig() const {
  24. return alertConfig_;
  25. }
  26. void CreateGroupMonitoringAgentProcessRequest::setAlertConfig(const std::vector<CreateGroupMonitoringAgentProcessRequest::AlertConfig> &alertConfig) {
  27. alertConfig_ = alertConfig;
  28. for(int dep1 = 0; dep1 != alertConfig.size(); dep1++) {
  29. auto alertConfigObj = alertConfig.at(dep1);
  30. std::string alertConfigObjStr = std::string("AlertConfig") + "." + std::to_string(dep1 + 1);
  31. setParameter(alertConfigObjStr + ".Times", alertConfigObj.times);
  32. setParameter(alertConfigObjStr + ".Webhook", alertConfigObj.webhook);
  33. setParameter(alertConfigObjStr + ".NoEffectiveInterval", alertConfigObj.noEffectiveInterval);
  34. setParameter(alertConfigObjStr + ".SilenceTime", alertConfigObj.silenceTime);
  35. setParameter(alertConfigObjStr + ".Threshold", alertConfigObj.threshold);
  36. setParameter(alertConfigObjStr + ".ComparisonOperator", alertConfigObj.comparisonOperator);
  37. setParameter(alertConfigObjStr + ".EffectiveInterval", alertConfigObj.effectiveInterval);
  38. setParameter(alertConfigObjStr + ".EscalationsLevel", alertConfigObj.escalationsLevel);
  39. setParameter(alertConfigObjStr + ".Statistics", alertConfigObj.statistics);
  40. }
  41. }
  42. std::string CreateGroupMonitoringAgentProcessRequest::getGroupId() const {
  43. return groupId_;
  44. }
  45. void CreateGroupMonitoringAgentProcessRequest::setGroupId(const std::string &groupId) {
  46. groupId_ = groupId;
  47. setParameter(std::string("GroupId"), groupId);
  48. }
  49. std::string CreateGroupMonitoringAgentProcessRequest::getProcessName() const {
  50. return processName_;
  51. }
  52. void CreateGroupMonitoringAgentProcessRequest::setProcessName(const std::string &processName) {
  53. processName_ = processName;
  54. setParameter(std::string("ProcessName"), processName);
  55. }
  56. std::string CreateGroupMonitoringAgentProcessRequest::getMatchExpressFilterRelation() const {
  57. return matchExpressFilterRelation_;
  58. }
  59. void CreateGroupMonitoringAgentProcessRequest::setMatchExpressFilterRelation(const std::string &matchExpressFilterRelation) {
  60. matchExpressFilterRelation_ = matchExpressFilterRelation;
  61. setParameter(std::string("MatchExpressFilterRelation"), matchExpressFilterRelation);
  62. }
  63. std::vector<CreateGroupMonitoringAgentProcessRequest::MatchExpress> CreateGroupMonitoringAgentProcessRequest::getMatchExpress() const {
  64. return matchExpress_;
  65. }
  66. void CreateGroupMonitoringAgentProcessRequest::setMatchExpress(const std::vector<CreateGroupMonitoringAgentProcessRequest::MatchExpress> &matchExpress) {
  67. matchExpress_ = matchExpress;
  68. for(int dep1 = 0; dep1 != matchExpress.size(); dep1++) {
  69. auto matchExpressObj = matchExpress.at(dep1);
  70. std::string matchExpressObjStr = std::string("MatchExpress") + "." + std::to_string(dep1 + 1);
  71. setParameter(matchExpressObjStr + ".Function", matchExpressObj.function);
  72. setParameter(matchExpressObjStr + ".Name", matchExpressObj.name);
  73. setParameter(matchExpressObjStr + ".Value", matchExpressObj.value);
  74. }
  75. }