diff --git a/CHANGELOG b/CHANGELOG index afccd0fcf..b2a682924 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2021-11-19 Version: 1.36.938 +- Add site monitoring dial DNS_ match_ rule. + 2021-11-17 Version: 1.36.937 - Update apm interface parameter. diff --git a/VERSION b/VERSION index adedef820..07cb58452 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.937 \ No newline at end of file +1.36.938 \ No newline at end of file diff --git a/cms/include/alibabacloud/cms/model/CreateSiteMonitorRequest.h b/cms/include/alibabacloud/cms/model/CreateSiteMonitorRequest.h index 5db3205d0..4a432f977 100644 --- a/cms/include/alibabacloud/cms/model/CreateSiteMonitorRequest.h +++ b/cms/include/alibabacloud/cms/model/CreateSiteMonitorRequest.h @@ -35,6 +35,8 @@ namespace AlibabaCloud CreateSiteMonitorRequest(); ~CreateSiteMonitorRequest(); + std::string getReportProject()const; + void setReportProject(const std::string& reportProject); std::string getTaskName()const; void setTaskName(const std::string& taskName); std::string getAlertIds()const; @@ -55,6 +57,7 @@ namespace AlibabaCloud void setInterval(const std::string& interval); private: + std::string reportProject_; std::string taskName_; std::string alertIds_; std::string address_; diff --git a/cms/include/alibabacloud/cms/model/DescribeActiveMetricRuleListResult.h b/cms/include/alibabacloud/cms/model/DescribeActiveMetricRuleListResult.h index 905800f78..87e9a8b74 100644 --- a/cms/include/alibabacloud/cms/model/DescribeActiveMetricRuleListResult.h +++ b/cms/include/alibabacloud/cms/model/DescribeActiveMetricRuleListResult.h @@ -40,8 +40,8 @@ namespace AlibabaCloud std::string endTime; std::string ruleId; std::string startTime; - std::string period; std::string evaluationCount; + std::string period; std::string _namespace; std::string statistics; std::string metricName; @@ -80,9 +80,9 @@ namespace AlibabaCloud Info info; Warn warn; }; - std::string noEffectiveInterval; std::string silenceTime; std::string contactGroups; + std::string noEffectiveInterval; std::string mailSubject; std::string ruleId; std::string period; diff --git a/cms/include/alibabacloud/cms/model/DescribeAlertLogListResult.h b/cms/include/alibabacloud/cms/model/DescribeAlertLogListResult.h index 85456d6f8..81aec1816 100644 --- a/cms/include/alibabacloud/cms/model/DescribeAlertLogListResult.h +++ b/cms/include/alibabacloud/cms/model/DescribeAlertLogListResult.h @@ -43,8 +43,8 @@ namespace AlibabaCloud std::string requestId; std::vector notifyTargetList; std::string code; - std::string detail; bool success; + std::string detail; }; std::vector resultList; std::string channel; @@ -74,6 +74,11 @@ namespace AlibabaCloud std::string code; std::string url; }; + struct SendResult + { + std::vector value; + std::string key; + }; std::string groupName; std::vector contactALIIWWList; std::string message; @@ -84,14 +89,15 @@ namespace AlibabaCloud std::string metricName; std::vector contactSMSList; SendDetail sendDetail; + std::vector sendResultList; std::string ruleName; std::vector contactGroups; std::vector dingdingWebhookList; std::string instanceId; std::string blackListName; std::vector dimensions; - std::string levelChange; std::string blackListUUID; + std::string levelChange; std::vector contactOnCallList; std::string _namespace; std::vector contactDingList; @@ -114,7 +120,6 @@ namespace AlibabaCloud std::string getMessage()const; int getPageSize()const; int getPageNumber()const; - int getTotal()const; std::string getCode()const; bool getSuccess()const; @@ -125,7 +130,6 @@ namespace AlibabaCloud std::string message_; int pageSize_; int pageNumber_; - int total_; std::string code_; bool success_; diff --git a/cms/include/alibabacloud/cms/model/DescribeDynamicTagRuleListResult.h b/cms/include/alibabacloud/cms/model/DescribeDynamicTagRuleListResult.h index caef43b2b..9fe9c29ac 100644 --- a/cms/include/alibabacloud/cms/model/DescribeDynamicTagRuleListResult.h +++ b/cms/include/alibabacloud/cms/model/DescribeDynamicTagRuleListResult.h @@ -40,6 +40,7 @@ namespace AlibabaCloud std::string tagValueMatchFunction; }; std::string status; + std::vector contactGroupList; std::string matchExpressFilterRelation; std::string dynamicTagRuleId; std::vector templateIdList; diff --git a/cms/include/alibabacloud/cms/model/DescribeHostAvailabilityListRequest.h b/cms/include/alibabacloud/cms/model/DescribeHostAvailabilityListRequest.h index 772c4e119..afd1efbb5 100644 --- a/cms/include/alibabacloud/cms/model/DescribeHostAvailabilityListRequest.h +++ b/cms/include/alibabacloud/cms/model/DescribeHostAvailabilityListRequest.h @@ -43,6 +43,8 @@ namespace AlibabaCloud void setPageNumber(int pageNumber); int getPageSize()const; void setPageSize(int pageSize); + std::string getIds()const; + void setIds(const std::string& ids); long getId()const; void setId(long id); @@ -51,6 +53,7 @@ namespace AlibabaCloud std::string taskName_; int pageNumber_; int pageSize_; + std::string ids_; long id_; }; diff --git a/cms/include/alibabacloud/cms/model/DescribeMetricRuleTemplateAttributeResult.h b/cms/include/alibabacloud/cms/model/DescribeMetricRuleTemplateAttributeResult.h index 6354a6075..fc13ef258 100644 --- a/cms/include/alibabacloud/cms/model/DescribeMetricRuleTemplateAttributeResult.h +++ b/cms/include/alibabacloud/cms/model/DescribeMetricRuleTemplateAttributeResult.h @@ -36,6 +36,23 @@ namespace AlibabaCloud { struct AlertTemplate { + struct CompositeExpression + { + struct ExpressionListItem + { + std::string metricName; + std::string comparisonOperator; + int period; + std::string id; + std::string statistics; + std::string threshold; + }; + int times; + std::string expressionRaw; + std::string level; + std::string expressionListJoin; + std::vector expressionList; + }; struct Escalations { struct Info @@ -66,8 +83,10 @@ namespace AlibabaCloud std::string metricName; std::string category; Escalations escalations; - std::string _namespace; + CompositeExpression compositeExpression; std::string webhook; + std::string _namespace; + std::string noDataPolicy; std::string ruleName; std::string selector; }; @@ -76,8 +95,8 @@ namespace AlibabaCloud std::string description; std::string systemEventTemplates; std::string restVersion; - std::string templateId; std::string processMonitorTemplates; + std::string templateId; std::string name; }; diff --git a/cms/include/alibabacloud/cms/model/DescribeSiteMonitorAttributeResult.h b/cms/include/alibabacloud/cms/model/DescribeSiteMonitorAttributeResult.h index 2bc0d1de6..3b4397e31 100644 --- a/cms/include/alibabacloud/cms/model/DescribeSiteMonitorAttributeResult.h +++ b/cms/include/alibabacloud/cms/model/DescribeSiteMonitorAttributeResult.h @@ -51,6 +51,7 @@ namespace AlibabaCloud std::string cookie; bool enable_operator_dns; bool proxy_protocol; + std::string dns_match_rule; float failure_rate; int match_rule; std::string acceptable_response_code; diff --git a/cms/include/alibabacloud/cms/model/DescribeSiteMonitorListResult.h b/cms/include/alibabacloud/cms/model/DescribeSiteMonitorListResult.h index 0b78b859d..79b7b4d00 100644 --- a/cms/include/alibabacloud/cms/model/DescribeSiteMonitorListResult.h +++ b/cms/include/alibabacloud/cms/model/DescribeSiteMonitorListResult.h @@ -39,6 +39,7 @@ namespace AlibabaCloud std::string cookie; int ping_num; bool enable_operator_dns; + std::string dns_match_rule; long traceroute; float failure_rate; int port; diff --git a/cms/include/alibabacloud/cms/model/InstallMonitoringAgentRequest.h b/cms/include/alibabacloud/cms/model/InstallMonitoringAgentRequest.h index 3514dc521..b2c30df0e 100644 --- a/cms/include/alibabacloud/cms/model/InstallMonitoringAgentRequest.h +++ b/cms/include/alibabacloud/cms/model/InstallMonitoringAgentRequest.h @@ -39,10 +39,13 @@ namespace AlibabaCloud void setInstanceIds(const std::vector& instanceIds); bool getForce()const; void setForce(bool force); + std::string getInstallCommand()const; + void setInstallCommand(const std::string& installCommand); private: std::vector instanceIds_; bool force_; + std::string installCommand_; }; } diff --git a/cms/include/alibabacloud/cms/model/PutCustomEventRuleRequest.h b/cms/include/alibabacloud/cms/model/PutCustomEventRuleRequest.h index 6e74a28cf..3e072232b 100644 --- a/cms/include/alibabacloud/cms/model/PutCustomEventRuleRequest.h +++ b/cms/include/alibabacloud/cms/model/PutCustomEventRuleRequest.h @@ -47,6 +47,8 @@ namespace AlibabaCloud void setEventName(const std::string& eventName); std::string getEmailSubject()const; void setEmailSubject(const std::string& emailSubject); + std::string getMetricName()const; + void setMetricName(const std::string& metricName); std::string getPeriod()const; void setPeriod(const std::string& period); std::string getContactGroups()const; @@ -65,6 +67,7 @@ namespace AlibabaCloud std::string effectiveInterval_; std::string eventName_; std::string emailSubject_; + std::string metricName_; std::string period_; std::string contactGroups_; std::string level_; diff --git a/cms/include/alibabacloud/cms/model/PutGroupMetricRuleResult.h b/cms/include/alibabacloud/cms/model/PutGroupMetricRuleResult.h index 46844f989..6bf3e1d8f 100644 --- a/cms/include/alibabacloud/cms/model/PutGroupMetricRuleResult.h +++ b/cms/include/alibabacloud/cms/model/PutGroupMetricRuleResult.h @@ -32,6 +32,10 @@ namespace AlibabaCloud class ALIBABACLOUD_CMS_EXPORT PutGroupMetricRuleResult : public ServiceResult { public: + struct Result + { + std::string ruleId; + }; PutGroupMetricRuleResult(); @@ -40,6 +44,7 @@ namespace AlibabaCloud std::string getMessage()const; std::string getCode()const; bool getSuccess()const; + Result getResult()const; protected: void parse(const std::string &payload); @@ -47,6 +52,7 @@ namespace AlibabaCloud std::string message_; std::string code_; bool success_; + Result result_; }; } diff --git a/cms/include/alibabacloud/cms/model/PutLogMonitorRequest.h b/cms/include/alibabacloud/cms/model/PutLogMonitorRequest.h index 2cf4a84d3..a5748db31 100644 --- a/cms/include/alibabacloud/cms/model/PutLogMonitorRequest.h +++ b/cms/include/alibabacloud/cms/model/PutLogMonitorRequest.h @@ -69,6 +69,8 @@ namespace AlibabaCloud void setGroupId(const std::string& groupId); std::string getTumblingwindows()const; void setTumblingwindows(const std::string& tumblingwindows); + std::string getGroupBy()const; + void setGroupBy(const std::string& groupBy); std::string getValueFilterRelation()const; void setValueFilterRelation(const std::string& valueFilterRelation); std::string getUnit()const; @@ -89,6 +91,7 @@ namespace AlibabaCloud std::string metricName_; std::string groupId_; std::string tumblingwindows_; + std::string groupBy_; std::string valueFilterRelation_; std::string unit_; std::vector groupbys_; diff --git a/cms/src/model/CreateSiteMonitorRequest.cc b/cms/src/model/CreateSiteMonitorRequest.cc index 369b50ebf..547f8ad85 100644 --- a/cms/src/model/CreateSiteMonitorRequest.cc +++ b/cms/src/model/CreateSiteMonitorRequest.cc @@ -27,6 +27,17 @@ CreateSiteMonitorRequest::CreateSiteMonitorRequest() : CreateSiteMonitorRequest::~CreateSiteMonitorRequest() {} +std::string CreateSiteMonitorRequest::getReportProject()const +{ + return reportProject_; +} + +void CreateSiteMonitorRequest::setReportProject(const std::string& reportProject) +{ + reportProject_ = reportProject; + setParameter("ReportProject", reportProject); +} + std::string CreateSiteMonitorRequest::getTaskName()const { return taskName_; diff --git a/cms/src/model/CreateSiteMonitorResult.cc b/cms/src/model/CreateSiteMonitorResult.cc index f3bc181de..3cbc82bcd 100644 --- a/cms/src/model/CreateSiteMonitorResult.cc +++ b/cms/src/model/CreateSiteMonitorResult.cc @@ -43,10 +43,10 @@ void CreateSiteMonitorResult::parse(const std::string &payload) for (auto valueCreateResultListCreateResultListItem : allCreateResultListNode) { CreateResultListItem createResultListObject; - if(!valueCreateResultListCreateResultListItem["TaskName"].isNull()) - createResultListObject.taskName = valueCreateResultListCreateResultListItem["TaskName"].asString(); if(!valueCreateResultListCreateResultListItem["TaskId"].isNull()) createResultListObject.taskId = valueCreateResultListCreateResultListItem["TaskId"].asString(); + if(!valueCreateResultListCreateResultListItem["TaskName"].isNull()) + createResultListObject.taskName = valueCreateResultListCreateResultListItem["TaskName"].asString(); createResultList_.push_back(createResultListObject); } auto dataNode = value["Data"]; @@ -54,12 +54,12 @@ void CreateSiteMonitorResult::parse(const std::string &payload) for (auto dataNodeAttachAlertResultContact : allAttachAlertResultNode) { Data::Contact contactObject; + if(!dataNodeAttachAlertResultContact["Code"].isNull()) + contactObject.code = dataNodeAttachAlertResultContact["Code"].asString(); if(!dataNodeAttachAlertResultContact["Message"].isNull()) contactObject.message = dataNodeAttachAlertResultContact["Message"].asString(); if(!dataNodeAttachAlertResultContact["RequestId"].isNull()) contactObject.requestId = dataNodeAttachAlertResultContact["RequestId"].asString(); - if(!dataNodeAttachAlertResultContact["Code"].isNull()) - contactObject.code = dataNodeAttachAlertResultContact["Code"].asString(); if(!dataNodeAttachAlertResultContact["Success"].isNull()) contactObject.success = dataNodeAttachAlertResultContact["Success"].asString(); if(!dataNodeAttachAlertResultContact["RuleId"].isNull()) diff --git a/cms/src/model/DeleteMetricRuleTemplateResult.cc b/cms/src/model/DeleteMetricRuleTemplateResult.cc index df5df1d09..b5aa68b29 100644 --- a/cms/src/model/DeleteMetricRuleTemplateResult.cc +++ b/cms/src/model/DeleteMetricRuleTemplateResult.cc @@ -42,12 +42,12 @@ void DeleteMetricRuleTemplateResult::parse(const std::string &payload) auto resourceNode = value["Resource"]; if(!resourceNode["TemplateId"].isNull()) resource_.templateId = resourceNode["TemplateId"].asString(); - if(!value["Success"].isNull()) - success_ = value["Success"].asString() == "true"; if(!value["Code"].isNull()) code_ = std::stoi(value["Code"].asString()); if(!value["Message"].isNull()) message_ = value["Message"].asString(); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; } diff --git a/cms/src/model/DescribeActiveMetricRuleListResult.cc b/cms/src/model/DescribeActiveMetricRuleListResult.cc index 19de65a43..cfff7d0ca 100644 --- a/cms/src/model/DescribeActiveMetricRuleListResult.cc +++ b/cms/src/model/DescribeActiveMetricRuleListResult.cc @@ -43,110 +43,110 @@ void DescribeActiveMetricRuleListResult::parse(const std::string &payload) for (auto valueDatapointsAlarm : allDatapointsNode) { Alarm datapointsObject; - if(!valueDatapointsAlarm["RuleId"].isNull()) - datapointsObject.ruleId = valueDatapointsAlarm["RuleId"].asString(); - if(!valueDatapointsAlarm["Namespace"].isNull()) - datapointsObject._namespace = valueDatapointsAlarm["Namespace"].asString(); - if(!valueDatapointsAlarm["MetricName"].isNull()) - datapointsObject.metricName = valueDatapointsAlarm["MetricName"].asString(); - if(!valueDatapointsAlarm["Period"].isNull()) - datapointsObject.period = valueDatapointsAlarm["Period"].asString(); - if(!valueDatapointsAlarm["Statistics"].isNull()) - datapointsObject.statistics = valueDatapointsAlarm["Statistics"].asString(); - if(!valueDatapointsAlarm["ComparisonOperator"].isNull()) - datapointsObject.comparisonOperator = valueDatapointsAlarm["ComparisonOperator"].asString(); - if(!valueDatapointsAlarm["Threshold"].isNull()) - datapointsObject.threshold = valueDatapointsAlarm["Threshold"].asString(); - if(!valueDatapointsAlarm["EvaluationCount"].isNull()) - datapointsObject.evaluationCount = valueDatapointsAlarm["EvaluationCount"].asString(); - if(!valueDatapointsAlarm["StartTime"].isNull()) - datapointsObject.startTime = valueDatapointsAlarm["StartTime"].asString(); - if(!valueDatapointsAlarm["EndTime"].isNull()) - datapointsObject.endTime = valueDatapointsAlarm["EndTime"].asString(); if(!valueDatapointsAlarm["SilenceTime"].isNull()) datapointsObject.silenceTime = valueDatapointsAlarm["SilenceTime"].asString(); - if(!valueDatapointsAlarm["Enable"].isNull()) - datapointsObject.enable = valueDatapointsAlarm["Enable"].asString(); + if(!valueDatapointsAlarm["MetricName"].isNull()) + datapointsObject.metricName = valueDatapointsAlarm["MetricName"].asString(); + if(!valueDatapointsAlarm["EvaluationCount"].isNull()) + datapointsObject.evaluationCount = valueDatapointsAlarm["EvaluationCount"].asString(); + if(!valueDatapointsAlarm["Webhook"].isNull()) + datapointsObject.webhook = valueDatapointsAlarm["Webhook"].asString(); if(!valueDatapointsAlarm["State"].isNull()) datapointsObject.state = valueDatapointsAlarm["State"].asString(); if(!valueDatapointsAlarm["ContactGroups"].isNull()) datapointsObject.contactGroups = valueDatapointsAlarm["ContactGroups"].asString(); - if(!valueDatapointsAlarm["Webhook"].isNull()) - datapointsObject.webhook = valueDatapointsAlarm["Webhook"].asString(); + if(!valueDatapointsAlarm["Namespace"].isNull()) + datapointsObject._namespace = valueDatapointsAlarm["Namespace"].asString(); if(!valueDatapointsAlarm["RuleName"].isNull()) datapointsObject.ruleName = valueDatapointsAlarm["RuleName"].asString(); + if(!valueDatapointsAlarm["RuleId"].isNull()) + datapointsObject.ruleId = valueDatapointsAlarm["RuleId"].asString(); + if(!valueDatapointsAlarm["Period"].isNull()) + datapointsObject.period = valueDatapointsAlarm["Period"].asString(); + if(!valueDatapointsAlarm["ComparisonOperator"].isNull()) + datapointsObject.comparisonOperator = valueDatapointsAlarm["ComparisonOperator"].asString(); + if(!valueDatapointsAlarm["EndTime"].isNull()) + datapointsObject.endTime = valueDatapointsAlarm["EndTime"].asString(); + if(!valueDatapointsAlarm["StartTime"].isNull()) + datapointsObject.startTime = valueDatapointsAlarm["StartTime"].asString(); + if(!valueDatapointsAlarm["Threshold"].isNull()) + datapointsObject.threshold = valueDatapointsAlarm["Threshold"].asString(); + if(!valueDatapointsAlarm["Statistics"].isNull()) + datapointsObject.statistics = valueDatapointsAlarm["Statistics"].asString(); + if(!valueDatapointsAlarm["Enable"].isNull()) + datapointsObject.enable = valueDatapointsAlarm["Enable"].asString(); datapoints_.push_back(datapointsObject); } auto allAlertListNode = value["AlertList"]["Alert"]; for (auto valueAlertListAlert : allAlertListNode) { Alert alertListObject; - if(!valueAlertListAlert["RuleId"].isNull()) - alertListObject.ruleId = valueAlertListAlert["RuleId"].asString(); - if(!valueAlertListAlert["Namespace"].isNull()) - alertListObject._namespace = valueAlertListAlert["Namespace"].asString(); + if(!valueAlertListAlert["SilenceTime"].isNull()) + alertListObject.silenceTime = valueAlertListAlert["SilenceTime"].asString(); if(!valueAlertListAlert["MetricName"].isNull()) alertListObject.metricName = valueAlertListAlert["MetricName"].asString(); - if(!valueAlertListAlert["Period"].isNull()) - alertListObject.period = valueAlertListAlert["Period"].asString(); + if(!valueAlertListAlert["Webhook"].isNull()) + alertListObject.webhook = valueAlertListAlert["Webhook"].asString(); + if(!valueAlertListAlert["ContactGroups"].isNull()) + alertListObject.contactGroups = valueAlertListAlert["ContactGroups"].asString(); + if(!valueAlertListAlert["Namespace"].isNull()) + alertListObject._namespace = valueAlertListAlert["Namespace"].asString(); if(!valueAlertListAlert["EffectiveInterval"].isNull()) alertListObject.effectiveInterval = valueAlertListAlert["EffectiveInterval"].asString(); if(!valueAlertListAlert["NoEffectiveInterval"].isNull()) alertListObject.noEffectiveInterval = valueAlertListAlert["NoEffectiveInterval"].asString(); - if(!valueAlertListAlert["SilenceTime"].isNull()) - alertListObject.silenceTime = valueAlertListAlert["SilenceTime"].asString(); - if(!valueAlertListAlert["EnableState"].isNull()) - alertListObject.enableState = valueAlertListAlert["EnableState"].asString() == "true"; - if(!valueAlertListAlert["AlertState"].isNull()) - alertListObject.alertState = valueAlertListAlert["AlertState"].asString(); - if(!valueAlertListAlert["ContactGroups"].isNull()) - alertListObject.contactGroups = valueAlertListAlert["ContactGroups"].asString(); - if(!valueAlertListAlert["Webhook"].isNull()) - alertListObject.webhook = valueAlertListAlert["Webhook"].asString(); if(!valueAlertListAlert["MailSubject"].isNull()) alertListObject.mailSubject = valueAlertListAlert["MailSubject"].asString(); if(!valueAlertListAlert["RuleName"].isNull()) alertListObject.ruleName = valueAlertListAlert["RuleName"].asString(); - if(!valueAlertListAlert["Resources"].isNull()) - alertListObject.resources = valueAlertListAlert["Resources"].asString(); + if(!valueAlertListAlert["RuleId"].isNull()) + alertListObject.ruleId = valueAlertListAlert["RuleId"].asString(); + if(!valueAlertListAlert["Period"].isNull()) + alertListObject.period = valueAlertListAlert["Period"].asString(); + if(!valueAlertListAlert["AlertState"].isNull()) + alertListObject.alertState = valueAlertListAlert["AlertState"].asString(); if(!valueAlertListAlert["Dimensions"].isNull()) alertListObject.dimensions = valueAlertListAlert["Dimensions"].asString(); + if(!valueAlertListAlert["EnableState"].isNull()) + alertListObject.enableState = valueAlertListAlert["EnableState"].asString() == "true"; + if(!valueAlertListAlert["Resources"].isNull()) + alertListObject.resources = valueAlertListAlert["Resources"].asString(); auto escalationsNode = value["Escalations"]; auto infoNode = escalationsNode["Info"]; if(!infoNode["ComparisonOperator"].isNull()) alertListObject.escalations.info.comparisonOperator = infoNode["ComparisonOperator"].asString(); - if(!infoNode["Statistics"].isNull()) - alertListObject.escalations.info.statistics = infoNode["Statistics"].asString(); - if(!infoNode["Threshold"].isNull()) - alertListObject.escalations.info.threshold = infoNode["Threshold"].asString(); if(!infoNode["Times"].isNull()) alertListObject.escalations.info.times = infoNode["Times"].asString(); + if(!infoNode["Threshold"].isNull()) + alertListObject.escalations.info.threshold = infoNode["Threshold"].asString(); + if(!infoNode["Statistics"].isNull()) + alertListObject.escalations.info.statistics = infoNode["Statistics"].asString(); auto warnNode = escalationsNode["Warn"]; if(!warnNode["ComparisonOperator"].isNull()) alertListObject.escalations.warn.comparisonOperator = warnNode["ComparisonOperator"].asString(); - if(!warnNode["Statistics"].isNull()) - alertListObject.escalations.warn.statistics = warnNode["Statistics"].asString(); - if(!warnNode["Threshold"].isNull()) - alertListObject.escalations.warn.threshold = warnNode["Threshold"].asString(); if(!warnNode["Times"].isNull()) alertListObject.escalations.warn.times = warnNode["Times"].asString(); + if(!warnNode["Threshold"].isNull()) + alertListObject.escalations.warn.threshold = warnNode["Threshold"].asString(); + if(!warnNode["Statistics"].isNull()) + alertListObject.escalations.warn.statistics = warnNode["Statistics"].asString(); auto criticalNode = escalationsNode["Critical"]; if(!criticalNode["ComparisonOperator"].isNull()) alertListObject.escalations.critical.comparisonOperator = criticalNode["ComparisonOperator"].asString(); - if(!criticalNode["Statistics"].isNull()) - alertListObject.escalations.critical.statistics = criticalNode["Statistics"].asString(); - if(!criticalNode["Threshold"].isNull()) - alertListObject.escalations.critical.threshold = criticalNode["Threshold"].asString(); if(!criticalNode["Times"].isNull()) alertListObject.escalations.critical.times = criticalNode["Times"].asString(); + if(!criticalNode["Threshold"].isNull()) + alertListObject.escalations.critical.threshold = criticalNode["Threshold"].asString(); + if(!criticalNode["Statistics"].isNull()) + alertListObject.escalations.critical.statistics = criticalNode["Statistics"].asString(); alertList_.push_back(alertListObject); } - if(!value["Success"].isNull()) - success_ = value["Success"].asString() == "true"; if(!value["Code"].isNull()) code_ = value["Code"].asString(); if(!value["Message"].isNull()) message_ = value["Message"].asString(); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; } diff --git a/cms/src/model/DescribeAlertLogListResult.cc b/cms/src/model/DescribeAlertLogListResult.cc index 00170ecf4..81f5dc20e 100644 --- a/cms/src/model/DescribeAlertLogListResult.cc +++ b/cms/src/model/DescribeAlertLogListResult.cc @@ -43,42 +43,42 @@ void DescribeAlertLogListResult::parse(const std::string &payload) for (auto valueAlertLogListAlarm : allAlertLogListNode) { Alarm alertLogListObject; - if(!valueAlertLogListAlarm["RuleId"].isNull()) - alertLogListObject.ruleId = valueAlertLogListAlarm["RuleId"].asString(); - if(!valueAlertLogListAlarm["RuleName"].isNull()) - alertLogListObject.ruleName = valueAlertLogListAlarm["RuleName"].asString(); - if(!valueAlertLogListAlarm["Namespace"].isNull()) - alertLogListObject._namespace = valueAlertLogListAlarm["Namespace"].asString(); - if(!valueAlertLogListAlarm["Product"].isNull()) - alertLogListObject.product = valueAlertLogListAlarm["Product"].asString(); - if(!valueAlertLogListAlarm["EventName"].isNull()) - alertLogListObject.eventName = valueAlertLogListAlarm["EventName"].asString(); - if(!valueAlertLogListAlarm["GroupId"].isNull()) - alertLogListObject.groupId = valueAlertLogListAlarm["GroupId"].asString(); - if(!valueAlertLogListAlarm["GroupName"].isNull()) - alertLogListObject.groupName = valueAlertLogListAlarm["GroupName"].asString(); if(!valueAlertLogListAlarm["MetricName"].isNull()) alertLogListObject.metricName = valueAlertLogListAlarm["MetricName"].asString(); - if(!valueAlertLogListAlarm["InstanceId"].isNull()) - alertLogListObject.instanceId = valueAlertLogListAlarm["InstanceId"].asString(); - if(!valueAlertLogListAlarm["InstanceName"].isNull()) - alertLogListObject.instanceName = valueAlertLogListAlarm["InstanceName"].asString(); - if(!valueAlertLogListAlarm["Level"].isNull()) - alertLogListObject.level = valueAlertLogListAlarm["Level"].asString(); - if(!valueAlertLogListAlarm["LevelChange"].isNull()) - alertLogListObject.levelChange = valueAlertLogListAlarm["LevelChange"].asString(); - if(!valueAlertLogListAlarm["SendStatus"].isNull()) - alertLogListObject.sendStatus = valueAlertLogListAlarm["SendStatus"].asString(); - if(!valueAlertLogListAlarm["AlertTime"].isNull()) - alertLogListObject.alertTime = valueAlertLogListAlarm["AlertTime"].asString(); - if(!valueAlertLogListAlarm["Message"].isNull()) - alertLogListObject.message = valueAlertLogListAlarm["Message"].asString(); + if(!valueAlertLogListAlarm["EventName"].isNull()) + alertLogListObject.eventName = valueAlertLogListAlarm["EventName"].asString(); + if(!valueAlertLogListAlarm["Product"].isNull()) + alertLogListObject.product = valueAlertLogListAlarm["Product"].asString(); if(!valueAlertLogListAlarm["BlackListUUID"].isNull()) alertLogListObject.blackListUUID = valueAlertLogListAlarm["BlackListUUID"].asString(); + if(!valueAlertLogListAlarm["Message"].isNull()) + alertLogListObject.message = valueAlertLogListAlarm["Message"].asString(); + if(!valueAlertLogListAlarm["Namespace"].isNull()) + alertLogListObject._namespace = valueAlertLogListAlarm["Namespace"].asString(); + if(!valueAlertLogListAlarm["LevelChange"].isNull()) + alertLogListObject.levelChange = valueAlertLogListAlarm["LevelChange"].asString(); + if(!valueAlertLogListAlarm["InstanceId"].isNull()) + alertLogListObject.instanceId = valueAlertLogListAlarm["InstanceId"].asString(); + if(!valueAlertLogListAlarm["RuleName"].isNull()) + alertLogListObject.ruleName = valueAlertLogListAlarm["RuleName"].asString(); + if(!valueAlertLogListAlarm["RuleId"].isNull()) + alertLogListObject.ruleId = valueAlertLogListAlarm["RuleId"].asString(); if(!valueAlertLogListAlarm["BlackListName"].isNull()) alertLogListObject.blackListName = valueAlertLogListAlarm["BlackListName"].asString(); + if(!valueAlertLogListAlarm["GroupName"].isNull()) + alertLogListObject.groupName = valueAlertLogListAlarm["GroupName"].asString(); + if(!valueAlertLogListAlarm["GroupId"].isNull()) + alertLogListObject.groupId = valueAlertLogListAlarm["GroupId"].asString(); + if(!valueAlertLogListAlarm["AlertTime"].isNull()) + alertLogListObject.alertTime = valueAlertLogListAlarm["AlertTime"].asString(); + if(!valueAlertLogListAlarm["InstanceName"].isNull()) + alertLogListObject.instanceName = valueAlertLogListAlarm["InstanceName"].asString(); if(!valueAlertLogListAlarm["BlackListDetail"].isNull()) alertLogListObject.blackListDetail = valueAlertLogListAlarm["BlackListDetail"].asString(); + if(!valueAlertLogListAlarm["Level"].isNull()) + alertLogListObject.level = valueAlertLogListAlarm["Level"].asString(); + if(!valueAlertLogListAlarm["SendStatus"].isNull()) + alertLogListObject.sendStatus = valueAlertLogListAlarm["SendStatus"].asString(); auto allExtendedInfoNode = valueAlertLogListAlarm["ExtendedInfo"]["ExtInfo"]; for (auto valueAlertLogListAlarmExtendedInfoExtInfo : allExtendedInfoNode) { @@ -103,14 +103,25 @@ void DescribeAlertLogListResult::parse(const std::string &payload) for (auto valueAlertLogListAlarmWebhookListWebhookListItem : allWebhookListNode) { Alarm::WebhookListItem webhookListObject; - if(!valueAlertLogListAlarmWebhookListWebhookListItem["url"].isNull()) - webhookListObject.url = valueAlertLogListAlarmWebhookListWebhookListItem["url"].asString(); if(!valueAlertLogListAlarmWebhookListWebhookListItem["code"].isNull()) webhookListObject.code = valueAlertLogListAlarmWebhookListWebhookListItem["code"].asString(); + if(!valueAlertLogListAlarmWebhookListWebhookListItem["url"].isNull()) + webhookListObject.url = valueAlertLogListAlarmWebhookListWebhookListItem["url"].asString(); if(!valueAlertLogListAlarmWebhookListWebhookListItem["message"].isNull()) webhookListObject.message = valueAlertLogListAlarmWebhookListWebhookListItem["message"].asString(); alertLogListObject.webhookList.push_back(webhookListObject); } + auto allSendResultListNode = valueAlertLogListAlarm["SendResultList"]["SendResult"]; + for (auto valueAlertLogListAlarmSendResultListSendResult : allSendResultListNode) + { + Alarm::SendResult sendResultListObject; + if(!valueAlertLogListAlarmSendResultListSendResult["Key"].isNull()) + sendResultListObject.key = valueAlertLogListAlarmSendResultListSendResult["Key"].asString(); + auto allValue = value["Value"]["Value"]; + for (auto value : allValue) + sendResultListObject.value.push_back(value.asString()); + alertLogListObject.sendResultList.push_back(sendResultListObject); + } auto sendDetailNode = value["SendDetail"]; if(!sendDetailNode["ResultCode"].isNull()) alertLogListObject.sendDetail.resultCode = sendDetailNode["ResultCode"].asString(); @@ -126,12 +137,12 @@ void DescribeAlertLogListResult::parse(const std::string &payload) Alarm::SendDetail::ChannelResult::Result resultListObject; if(!sendDetailNodeChannelResultListChannelResultResultListResult["Code"].isNull()) resultListObject.code = sendDetailNodeChannelResultListChannelResultResultListResult["Code"].asString(); - if(!sendDetailNodeChannelResultListChannelResultResultListResult["Detail"].isNull()) - resultListObject.detail = sendDetailNodeChannelResultListChannelResultResultListResult["Detail"].asString(); - if(!sendDetailNodeChannelResultListChannelResultResultListResult["Success"].isNull()) - resultListObject.success = sendDetailNodeChannelResultListChannelResultResultListResult["Success"].asString() == "true"; if(!sendDetailNodeChannelResultListChannelResultResultListResult["RequestId"].isNull()) resultListObject.requestId = sendDetailNodeChannelResultListChannelResultResultListResult["RequestId"].asString(); + if(!sendDetailNodeChannelResultListChannelResultResultListResult["Success"].isNull()) + resultListObject.success = sendDetailNodeChannelResultListChannelResultResultListResult["Success"].asString() == "true"; + if(!sendDetailNodeChannelResultListChannelResultResultListResult["Detail"].isNull()) + resultListObject.detail = sendDetailNodeChannelResultListChannelResultResultListResult["Detail"].asString(); auto allNotifyTargetList = value["notifyTargetList"]["NotifyTarget"]; for (auto value : allNotifyTargetList) resultListObject.notifyTargetList.push_back(value.asString()); @@ -140,12 +151,21 @@ void DescribeAlertLogListResult::parse(const std::string &payload) alertLogListObject.sendDetail.channelResultList.push_back(channelResultObject); } auto escalationNode = value["Escalation"]; - if(!escalationNode["Times"].isNull()) - alertLogListObject.escalation.times = std::stoi(escalationNode["Times"].asString()); if(!escalationNode["Expression"].isNull()) alertLogListObject.escalation.expression = escalationNode["Expression"].asString(); + if(!escalationNode["Times"].isNull()) + alertLogListObject.escalation.times = std::stoi(escalationNode["Times"].asString()); if(!escalationNode["Level"].isNull()) alertLogListObject.escalation.level = escalationNode["Level"].asString(); + auto allDingdingWebhookList = value["DingdingWebhookList"]["ContactDingList"]; + for (auto value : allDingdingWebhookList) + alertLogListObject.dingdingWebhookList.push_back(value.asString()); + auto allContactOnCallList = value["ContactOnCallList"]["ContactOnCallList"]; + for (auto value : allContactOnCallList) + alertLogListObject.contactOnCallList.push_back(value.asString()); + auto allContactMailList = value["ContactMailList"]["ContactMailList"]; + for (auto value : allContactMailList) + alertLogListObject.contactMailList.push_back(value.asString()); auto allContactGroups = value["ContactGroups"]["ContactGroup"]; for (auto value : allContactGroups) alertLogListObject.contactGroups.push_back(value.asString()); @@ -155,32 +175,21 @@ void DescribeAlertLogListResult::parse(const std::string &payload) auto allContactSMSList = value["ContactSMSList"]["ContactSMSList"]; for (auto value : allContactSMSList) alertLogListObject.contactSMSList.push_back(value.asString()); - auto allContactOnCallList = value["ContactOnCallList"]["ContactOnCallList"]; - for (auto value : allContactOnCallList) - alertLogListObject.contactOnCallList.push_back(value.asString()); - auto allContactMailList = value["ContactMailList"]["ContactMailList"]; - for (auto value : allContactMailList) - alertLogListObject.contactMailList.push_back(value.asString()); auto allContactDingList = value["ContactDingList"]["ContactDingList"]; for (auto value : allContactDingList) alertLogListObject.contactDingList.push_back(value.asString()); - auto allDingdingWebhookList = value["DingdingWebhookList"]["ContactDingList"]; - for (auto value : allDingdingWebhookList) - alertLogListObject.dingdingWebhookList.push_back(value.asString()); alertLogList_.push_back(alertLogListObject); } + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; if(!value["Code"].isNull()) code_ = value["Code"].asString(); if(!value["Message"].isNull()) message_ = value["Message"].asString(); - if(!value["Success"].isNull()) - success_ = value["Success"].asString() == "true"; - if(!value["Total"].isNull()) - total_ = std::stoi(value["Total"].asString()); - if(!value["PageSize"].isNull()) - pageSize_ = std::stoi(value["PageSize"].asString()); if(!value["PageNumber"].isNull()) pageNumber_ = std::stoi(value["PageNumber"].asString()); + if(!value["PageSize"].isNull()) + pageSize_ = std::stoi(value["PageSize"].asString()); } @@ -204,11 +213,6 @@ int DescribeAlertLogListResult::getPageNumber()const return pageNumber_; } -int DescribeAlertLogListResult::getTotal()const -{ - return total_; -} - std::string DescribeAlertLogListResult::getCode()const { return code_; diff --git a/cms/src/model/DescribeDynamicTagRuleListResult.cc b/cms/src/model/DescribeDynamicTagRuleListResult.cc index 9ad133bb7..4776acbd3 100644 --- a/cms/src/model/DescribeDynamicTagRuleListResult.cc +++ b/cms/src/model/DescribeDynamicTagRuleListResult.cc @@ -43,29 +43,32 @@ void DescribeDynamicTagRuleListResult::parse(const std::string &payload) for (auto valueTagGroupListTagGroup : allTagGroupListNode) { TagGroup tagGroupListObject; - if(!valueTagGroupListTagGroup["DynamicTagRuleId"].isNull()) - tagGroupListObject.dynamicTagRuleId = valueTagGroupListTagGroup["DynamicTagRuleId"].asString(); - if(!valueTagGroupListTagGroup["TagKey"].isNull()) - tagGroupListObject.tagKey = valueTagGroupListTagGroup["TagKey"].asString(); - if(!valueTagGroupListTagGroup["RegionId"].isNull()) - tagGroupListObject.regionId = valueTagGroupListTagGroup["RegionId"].asString(); - if(!valueTagGroupListTagGroup["MatchExpressFilterRelation"].isNull()) - tagGroupListObject.matchExpressFilterRelation = valueTagGroupListTagGroup["MatchExpressFilterRelation"].asString(); if(!valueTagGroupListTagGroup["Status"].isNull()) tagGroupListObject.status = valueTagGroupListTagGroup["Status"].asString(); + if(!valueTagGroupListTagGroup["MatchExpressFilterRelation"].isNull()) + tagGroupListObject.matchExpressFilterRelation = valueTagGroupListTagGroup["MatchExpressFilterRelation"].asString(); + if(!valueTagGroupListTagGroup["RegionId"].isNull()) + tagGroupListObject.regionId = valueTagGroupListTagGroup["RegionId"].asString(); + if(!valueTagGroupListTagGroup["TagKey"].isNull()) + tagGroupListObject.tagKey = valueTagGroupListTagGroup["TagKey"].asString(); + if(!valueTagGroupListTagGroup["DynamicTagRuleId"].isNull()) + tagGroupListObject.dynamicTagRuleId = valueTagGroupListTagGroup["DynamicTagRuleId"].asString(); auto allMatchExpressNode = valueTagGroupListTagGroup["MatchExpress"]["MatchExpressItem"]; for (auto valueTagGroupListTagGroupMatchExpressMatchExpressItem : allMatchExpressNode) { TagGroup::MatchExpressItem matchExpressObject; - if(!valueTagGroupListTagGroupMatchExpressMatchExpressItem["TagValueMatchFunction"].isNull()) - matchExpressObject.tagValueMatchFunction = valueTagGroupListTagGroupMatchExpressMatchExpressItem["TagValueMatchFunction"].asString(); if(!valueTagGroupListTagGroupMatchExpressMatchExpressItem["TagValue"].isNull()) matchExpressObject.tagValue = valueTagGroupListTagGroupMatchExpressMatchExpressItem["TagValue"].asString(); + if(!valueTagGroupListTagGroupMatchExpressMatchExpressItem["TagValueMatchFunction"].isNull()) + matchExpressObject.tagValueMatchFunction = valueTagGroupListTagGroupMatchExpressMatchExpressItem["TagValueMatchFunction"].asString(); tagGroupListObject.matchExpress.push_back(matchExpressObject); } auto allTemplateIdList = value["TemplateIdList"]["TemplateIdList"]; for (auto value : allTemplateIdList) tagGroupListObject.templateIdList.push_back(value.asString()); + auto allContactGroupList = value["ContactGroupList"]["ContactGroupList"]; + for (auto value : allContactGroupList) + tagGroupListObject.contactGroupList.push_back(value.asString()); tagGroupList_.push_back(tagGroupListObject); } if(!value["Success"].isNull()) @@ -74,12 +77,12 @@ void DescribeDynamicTagRuleListResult::parse(const std::string &payload) code_ = value["Code"].asString(); if(!value["Message"].isNull()) message_ = value["Message"].asString(); - if(!value["Total"].isNull()) - total_ = std::stoi(value["Total"].asString()); - if(!value["PageNumber"].isNull()) - pageNumber_ = value["PageNumber"].asString(); if(!value["PageSize"].isNull()) pageSize_ = value["PageSize"].asString(); + if(!value["PageNumber"].isNull()) + pageNumber_ = value["PageNumber"].asString(); + if(!value["Total"].isNull()) + total_ = std::stoi(value["Total"].asString()); } diff --git a/cms/src/model/DescribeHostAvailabilityListRequest.cc b/cms/src/model/DescribeHostAvailabilityListRequest.cc index b89af1e34..50827fec5 100644 --- a/cms/src/model/DescribeHostAvailabilityListRequest.cc +++ b/cms/src/model/DescribeHostAvailabilityListRequest.cc @@ -71,6 +71,17 @@ void DescribeHostAvailabilityListRequest::setPageSize(int pageSize) setParameter("PageSize", std::to_string(pageSize)); } +std::string DescribeHostAvailabilityListRequest::getIds()const +{ + return ids_; +} + +void DescribeHostAvailabilityListRequest::setIds(const std::string& ids) +{ + ids_ = ids; + setParameter("Ids", ids); +} + long DescribeHostAvailabilityListRequest::getId()const { return id_; diff --git a/cms/src/model/DescribeMetricRuleTemplateAttributeResult.cc b/cms/src/model/DescribeMetricRuleTemplateAttributeResult.cc index 769b715d3..18da688f1 100644 --- a/cms/src/model/DescribeMetricRuleTemplateAttributeResult.cc +++ b/cms/src/model/DescribeMetricRuleTemplateAttributeResult.cc @@ -40,72 +40,101 @@ void DescribeMetricRuleTemplateAttributeResult::parse(const std::string &payload reader.parse(payload, value); setRequestId(value["RequestId"].asString()); auto resourceNode = value["Resource"]; - if(!resourceNode["Name"].isNull()) - resource_.name = resourceNode["Name"].asString(); - if(!resourceNode["TemplateId"].isNull()) - resource_.templateId = resourceNode["TemplateId"].asString(); - if(!resourceNode["RestVersion"].isNull()) - resource_.restVersion = resourceNode["RestVersion"].asString(); if(!resourceNode["Description"].isNull()) resource_.description = resourceNode["Description"].asString(); if(!resourceNode["SystemEventTemplates"].isNull()) resource_.systemEventTemplates = resourceNode["SystemEventTemplates"].asString(); if(!resourceNode["ProcessMonitorTemplates"].isNull()) resource_.processMonitorTemplates = resourceNode["ProcessMonitorTemplates"].asString(); + if(!resourceNode["Name"].isNull()) + resource_.name = resourceNode["Name"].asString(); + if(!resourceNode["RestVersion"].isNull()) + resource_.restVersion = resourceNode["RestVersion"].asString(); if(!resourceNode["HostAvailabilityTemplates"].isNull()) resource_.hostAvailabilityTemplates = resourceNode["HostAvailabilityTemplates"].asString(); + if(!resourceNode["TemplateId"].isNull()) + resource_.templateId = resourceNode["TemplateId"].asString(); auto allAlertTemplatesNode = resourceNode["AlertTemplates"]["AlertTemplate"]; for (auto resourceNodeAlertTemplatesAlertTemplate : allAlertTemplatesNode) { Resource::AlertTemplate alertTemplateObject; - if(!resourceNodeAlertTemplatesAlertTemplate["RuleName"].isNull()) - alertTemplateObject.ruleName = resourceNodeAlertTemplatesAlertTemplate["RuleName"].asString(); - if(!resourceNodeAlertTemplatesAlertTemplate["Category"].isNull()) - alertTemplateObject.category = resourceNodeAlertTemplatesAlertTemplate["Category"].asString(); - if(!resourceNodeAlertTemplatesAlertTemplate["Namespace"].isNull()) - alertTemplateObject._namespace = resourceNodeAlertTemplatesAlertTemplate["Namespace"].asString(); if(!resourceNodeAlertTemplatesAlertTemplate["MetricName"].isNull()) alertTemplateObject.metricName = resourceNodeAlertTemplatesAlertTemplate["MetricName"].asString(); if(!resourceNodeAlertTemplatesAlertTemplate["Selector"].isNull()) alertTemplateObject.selector = resourceNodeAlertTemplatesAlertTemplate["Selector"].asString(); if(!resourceNodeAlertTemplatesAlertTemplate["Webhook"].isNull()) alertTemplateObject.webhook = resourceNodeAlertTemplatesAlertTemplate["Webhook"].asString(); + if(!resourceNodeAlertTemplatesAlertTemplate["Namespace"].isNull()) + alertTemplateObject._namespace = resourceNodeAlertTemplatesAlertTemplate["Namespace"].asString(); + if(!resourceNodeAlertTemplatesAlertTemplate["Category"].isNull()) + alertTemplateObject.category = resourceNodeAlertTemplatesAlertTemplate["Category"].asString(); + if(!resourceNodeAlertTemplatesAlertTemplate["RuleName"].isNull()) + alertTemplateObject.ruleName = resourceNodeAlertTemplatesAlertTemplate["RuleName"].asString(); + if(!resourceNodeAlertTemplatesAlertTemplate["NoDataPolicy"].isNull()) + alertTemplateObject.noDataPolicy = resourceNodeAlertTemplatesAlertTemplate["NoDataPolicy"].asString(); + auto compositeExpressionNode = value["CompositeExpression"]; + if(!compositeExpressionNode["Level"].isNull()) + alertTemplateObject.compositeExpression.level = compositeExpressionNode["Level"].asString(); + if(!compositeExpressionNode["ExpressionListJoin"].isNull()) + alertTemplateObject.compositeExpression.expressionListJoin = compositeExpressionNode["ExpressionListJoin"].asString(); + if(!compositeExpressionNode["ExpressionRaw"].isNull()) + alertTemplateObject.compositeExpression.expressionRaw = compositeExpressionNode["ExpressionRaw"].asString(); + if(!compositeExpressionNode["Times"].isNull()) + alertTemplateObject.compositeExpression.times = std::stoi(compositeExpressionNode["Times"].asString()); + auto allExpressionListNode = compositeExpressionNode["ExpressionList"]["ExpressionListItem"]; + for (auto compositeExpressionNodeExpressionListExpressionListItem : allExpressionListNode) + { + Resource::AlertTemplate::CompositeExpression::ExpressionListItem expressionListItemObject; + if(!compositeExpressionNodeExpressionListExpressionListItem["MetricName"].isNull()) + expressionListItemObject.metricName = compositeExpressionNodeExpressionListExpressionListItem["MetricName"].asString(); + if(!compositeExpressionNodeExpressionListExpressionListItem["ComparisonOperator"].isNull()) + expressionListItemObject.comparisonOperator = compositeExpressionNodeExpressionListExpressionListItem["ComparisonOperator"].asString(); + if(!compositeExpressionNodeExpressionListExpressionListItem["Statistics"].isNull()) + expressionListItemObject.statistics = compositeExpressionNodeExpressionListExpressionListItem["Statistics"].asString(); + if(!compositeExpressionNodeExpressionListExpressionListItem["Threshold"].isNull()) + expressionListItemObject.threshold = compositeExpressionNodeExpressionListExpressionListItem["Threshold"].asString(); + if(!compositeExpressionNodeExpressionListExpressionListItem["Period"].isNull()) + expressionListItemObject.period = std::stoi(compositeExpressionNodeExpressionListExpressionListItem["Period"].asString()); + if(!compositeExpressionNodeExpressionListExpressionListItem["Id"].isNull()) + expressionListItemObject.id = compositeExpressionNodeExpressionListExpressionListItem["Id"].asString(); + alertTemplateObject.compositeExpression.expressionList.push_back(expressionListItemObject); + } auto escalationsNode = value["Escalations"]; auto infoNode = escalationsNode["Info"]; - if(!infoNode["Statistics"].isNull()) - alertTemplateObject.escalations.info.statistics = infoNode["Statistics"].asString(); if(!infoNode["ComparisonOperator"].isNull()) alertTemplateObject.escalations.info.comparisonOperator = infoNode["ComparisonOperator"].asString(); - if(!infoNode["Threshold"].isNull()) - alertTemplateObject.escalations.info.threshold = infoNode["Threshold"].asString(); if(!infoNode["Times"].isNull()) alertTemplateObject.escalations.info.times = std::stoi(infoNode["Times"].asString()); + if(!infoNode["Threshold"].isNull()) + alertTemplateObject.escalations.info.threshold = infoNode["Threshold"].asString(); + if(!infoNode["Statistics"].isNull()) + alertTemplateObject.escalations.info.statistics = infoNode["Statistics"].asString(); auto warnNode = escalationsNode["Warn"]; - if(!warnNode["Statistics"].isNull()) - alertTemplateObject.escalations.warn.statistics = warnNode["Statistics"].asString(); if(!warnNode["ComparisonOperator"].isNull()) alertTemplateObject.escalations.warn.comparisonOperator = warnNode["ComparisonOperator"].asString(); - if(!warnNode["Threshold"].isNull()) - alertTemplateObject.escalations.warn.threshold = warnNode["Threshold"].asString(); if(!warnNode["Times"].isNull()) alertTemplateObject.escalations.warn.times = std::stoi(warnNode["Times"].asString()); + if(!warnNode["Threshold"].isNull()) + alertTemplateObject.escalations.warn.threshold = warnNode["Threshold"].asString(); + if(!warnNode["Statistics"].isNull()) + alertTemplateObject.escalations.warn.statistics = warnNode["Statistics"].asString(); auto criticalNode = escalationsNode["Critical"]; - if(!criticalNode["Statistics"].isNull()) - alertTemplateObject.escalations.critical.statistics = criticalNode["Statistics"].asString(); if(!criticalNode["ComparisonOperator"].isNull()) alertTemplateObject.escalations.critical.comparisonOperator = criticalNode["ComparisonOperator"].asString(); - if(!criticalNode["Threshold"].isNull()) - alertTemplateObject.escalations.critical.threshold = criticalNode["Threshold"].asString(); if(!criticalNode["Times"].isNull()) alertTemplateObject.escalations.critical.times = std::stoi(criticalNode["Times"].asString()); + if(!criticalNode["Threshold"].isNull()) + alertTemplateObject.escalations.critical.threshold = criticalNode["Threshold"].asString(); + if(!criticalNode["Statistics"].isNull()) + alertTemplateObject.escalations.critical.statistics = criticalNode["Statistics"].asString(); resource_.alertTemplates.push_back(alertTemplateObject); } - if(!value["Success"].isNull()) - success_ = value["Success"].asString() == "true"; if(!value["Code"].isNull()) code_ = std::stoi(value["Code"].asString()); if(!value["Message"].isNull()) message_ = value["Message"].asString(); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; } diff --git a/cms/src/model/DescribeSiteMonitorAttributeResult.cc b/cms/src/model/DescribeSiteMonitorAttributeResult.cc index ce075fcdc..c8744442a 100644 --- a/cms/src/model/DescribeSiteMonitorAttributeResult.cc +++ b/cms/src/model/DescribeSiteMonitorAttributeResult.cc @@ -119,6 +119,8 @@ void DescribeSiteMonitorAttributeResult::parse(const std::string &payload) siteMonitors_.optionJson.authentication = std::stoi(optionJsonNode["authentication"].asString()); if(!optionJsonNode["match_rule"].isNull()) siteMonitors_.optionJson.match_rule = std::stoi(optionJsonNode["match_rule"].asString()); + if(!optionJsonNode["dns_match_rule"].isNull()) + siteMonitors_.optionJson.dns_match_rule = optionJsonNode["dns_match_rule"].asString(); if(!optionJsonNode["ipv6_task"].isNull()) siteMonitors_.optionJson.ipv6_task = optionJsonNode["ipv6_task"].asString(); if(!optionJsonNode["request_content"].isNull()) diff --git a/cms/src/model/DescribeSiteMonitorListResult.cc b/cms/src/model/DescribeSiteMonitorListResult.cc index 57e6f5a94..14f335f47 100644 --- a/cms/src/model/DescribeSiteMonitorListResult.cc +++ b/cms/src/model/DescribeSiteMonitorListResult.cc @@ -88,6 +88,8 @@ void DescribeSiteMonitorListResult::parse(const std::string &payload) siteMonitorsObject.optionsJson.http_method = optionsJsonNode["http_method"].asString(); if(!optionsJsonNode["match_rule"].isNull()) siteMonitorsObject.optionsJson.match_rule = std::stoi(optionsJsonNode["match_rule"].asString()); + if(!optionsJsonNode["dns_match_rule"].isNull()) + siteMonitorsObject.optionsJson.dns_match_rule = optionsJsonNode["dns_match_rule"].asString(); if(!optionsJsonNode["request_content"].isNull()) siteMonitorsObject.optionsJson.request_content = optionsJsonNode["request_content"].asString(); if(!optionsJsonNode["username"].isNull()) diff --git a/cms/src/model/InstallMonitoringAgentRequest.cc b/cms/src/model/InstallMonitoringAgentRequest.cc index 0827d6dc9..0bc8a1695 100644 --- a/cms/src/model/InstallMonitoringAgentRequest.cc +++ b/cms/src/model/InstallMonitoringAgentRequest.cc @@ -51,3 +51,14 @@ void InstallMonitoringAgentRequest::setForce(bool force) setParameter("Force", force ? "true" : "false"); } +std::string InstallMonitoringAgentRequest::getInstallCommand()const +{ + return installCommand_; +} + +void InstallMonitoringAgentRequest::setInstallCommand(const std::string& installCommand) +{ + installCommand_ = installCommand; + setParameter("InstallCommand", installCommand); +} + diff --git a/cms/src/model/PutContactGroupResult.cc b/cms/src/model/PutContactGroupResult.cc index 47a3865cb..5e2d7faf9 100644 --- a/cms/src/model/PutContactGroupResult.cc +++ b/cms/src/model/PutContactGroupResult.cc @@ -39,12 +39,12 @@ void PutContactGroupResult::parse(const std::string &payload) Json::Value value; reader.parse(payload, value); setRequestId(value["RequestId"].asString()); - if(!value["Success"].isNull()) - success_ = value["Success"].asString() == "true"; if(!value["Code"].isNull()) code_ = value["Code"].asString(); if(!value["Message"].isNull()) message_ = value["Message"].asString(); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; } diff --git a/cms/src/model/PutContactResult.cc b/cms/src/model/PutContactResult.cc index e79517e42..3a4647b0e 100644 --- a/cms/src/model/PutContactResult.cc +++ b/cms/src/model/PutContactResult.cc @@ -39,12 +39,12 @@ void PutContactResult::parse(const std::string &payload) Json::Value value; reader.parse(payload, value); setRequestId(value["RequestId"].asString()); - if(!value["Success"].isNull()) - success_ = value["Success"].asString() == "true"; if(!value["Code"].isNull()) code_ = value["Code"].asString(); if(!value["Message"].isNull()) message_ = value["Message"].asString(); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; } diff --git a/cms/src/model/PutCustomEventRuleRequest.cc b/cms/src/model/PutCustomEventRuleRequest.cc index e71c3007e..a50a6f26f 100644 --- a/cms/src/model/PutCustomEventRuleRequest.cc +++ b/cms/src/model/PutCustomEventRuleRequest.cc @@ -93,6 +93,17 @@ void PutCustomEventRuleRequest::setEmailSubject(const std::string& emailSubject) setParameter("EmailSubject", emailSubject); } +std::string PutCustomEventRuleRequest::getMetricName()const +{ + return metricName_; +} + +void PutCustomEventRuleRequest::setMetricName(const std::string& metricName) +{ + metricName_ = metricName; + setParameter("MetricName", metricName); +} + std::string PutCustomEventRuleRequest::getPeriod()const { return period_; diff --git a/cms/src/model/PutCustomEventRuleResult.cc b/cms/src/model/PutCustomEventRuleResult.cc index 4ba10afbf..d7e49883a 100644 --- a/cms/src/model/PutCustomEventRuleResult.cc +++ b/cms/src/model/PutCustomEventRuleResult.cc @@ -39,12 +39,12 @@ void PutCustomEventRuleResult::parse(const std::string &payload) Json::Value value; reader.parse(payload, value); setRequestId(value["RequestId"].asString()); - if(!value["Success"].isNull()) - success_ = value["Success"].asString() == "true"; if(!value["Code"].isNull()) code_ = value["Code"].asString(); if(!value["Message"].isNull()) message_ = value["Message"].asString(); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; } diff --git a/cms/src/model/PutGroupMetricRuleResult.cc b/cms/src/model/PutGroupMetricRuleResult.cc index 9d6fd978a..5e03d58f3 100644 --- a/cms/src/model/PutGroupMetricRuleResult.cc +++ b/cms/src/model/PutGroupMetricRuleResult.cc @@ -39,6 +39,9 @@ void PutGroupMetricRuleResult::parse(const std::string &payload) Json::Value value; reader.parse(payload, value); setRequestId(value["RequestId"].asString()); + auto resultNode = value["Result"]; + if(!resultNode["RuleId"].isNull()) + result_.ruleId = resultNode["RuleId"].asString(); if(!value["Code"].isNull()) code_ = value["Code"].asString(); if(!value["Message"].isNull()) @@ -63,3 +66,8 @@ bool PutGroupMetricRuleResult::getSuccess()const return success_; } +PutGroupMetricRuleResult::Result PutGroupMetricRuleResult::getResult()const +{ + return result_; +} + diff --git a/cms/src/model/PutLogMonitorRequest.cc b/cms/src/model/PutLogMonitorRequest.cc index 73ca1980e..bb90368fc 100644 --- a/cms/src/model/PutLogMonitorRequest.cc +++ b/cms/src/model/PutLogMonitorRequest.cc @@ -121,6 +121,17 @@ void PutLogMonitorRequest::setTumblingwindows(const std::string& tumblingwindows setParameter("Tumblingwindows", tumblingwindows); } +std::string PutLogMonitorRequest::getGroupBy()const +{ + return groupBy_; +} + +void PutLogMonitorRequest::setGroupBy(const std::string& groupBy) +{ + groupBy_ = groupBy; + setParameter("GroupBy", groupBy); +} + std::string PutLogMonitorRequest::getValueFilterRelation()const { return valueFilterRelation_; diff --git a/cms/src/model/PutLogMonitorResult.cc b/cms/src/model/PutLogMonitorResult.cc index 91938e8fb..7b1d3509b 100644 --- a/cms/src/model/PutLogMonitorResult.cc +++ b/cms/src/model/PutLogMonitorResult.cc @@ -43,10 +43,10 @@ void PutLogMonitorResult::parse(const std::string &payload) code_ = value["Code"].asString(); if(!value["Message"].isNull()) message_ = value["Message"].asString(); - if(!value["Success"].isNull()) - success_ = value["Success"].asString() == "true"; if(!value["LogId"].isNull()) logId_ = value["LogId"].asString(); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; }