Add site monitoring dial DNS_ match_ rule.

This commit is contained in:
sdk-team
2021-11-19 04:26:31 +00:00
parent d1aee32108
commit 650feae280
32 changed files with 328 additions and 175 deletions

View File

@@ -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_;

View File

@@ -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())

View File

@@ -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";
}

View File

@@ -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";
}

View File

@@ -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_;

View File

@@ -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());
}

View File

@@ -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_;

View File

@@ -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";
}

View File

@@ -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())

View File

@@ -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())

View File

@@ -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);
}

View File

@@ -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";
}

View File

@@ -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";
}

View File

@@ -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_;

View File

@@ -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";
}

View File

@@ -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_;
}

View File

@@ -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_;

View File

@@ -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";
}