Add OpenArmsServiceSecondVersion.
This commit is contained in:
@@ -375,6 +375,42 @@ ARMSClient::CreateAlertContactGroupOutcomeCallable ARMSClient::createAlertContac
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::CreateAlertTemplateOutcome ARMSClient::createAlertTemplate(const CreateAlertTemplateRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return CreateAlertTemplateOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return CreateAlertTemplateOutcome(CreateAlertTemplateResult(outcome.result()));
|
||||
else
|
||||
return CreateAlertTemplateOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ARMSClient::createAlertTemplateAsync(const CreateAlertTemplateRequest& request, const CreateAlertTemplateAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, createAlertTemplate(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ARMSClient::CreateAlertTemplateOutcomeCallable ARMSClient::createAlertTemplateCallable(const CreateAlertTemplateRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<CreateAlertTemplateOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->createAlertTemplate(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::CreateDispatchRuleOutcome ARMSClient::createDispatchRule(const CreateDispatchRuleRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -411,6 +447,42 @@ ARMSClient::CreateDispatchRuleOutcomeCallable ARMSClient::createDispatchRuleCall
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::CreatePrometheusAlertRuleOutcome ARMSClient::createPrometheusAlertRule(const CreatePrometheusAlertRuleRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return CreatePrometheusAlertRuleOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return CreatePrometheusAlertRuleOutcome(CreatePrometheusAlertRuleResult(outcome.result()));
|
||||
else
|
||||
return CreatePrometheusAlertRuleOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ARMSClient::createPrometheusAlertRuleAsync(const CreatePrometheusAlertRuleRequest& request, const CreatePrometheusAlertRuleAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, createPrometheusAlertRule(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ARMSClient::CreatePrometheusAlertRuleOutcomeCallable ARMSClient::createPrometheusAlertRuleCallable(const CreatePrometheusAlertRuleRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<CreatePrometheusAlertRuleOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->createPrometheusAlertRule(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::CreateRetcodeAppOutcome ARMSClient::createRetcodeApp(const CreateRetcodeAppRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -447,6 +519,42 @@ ARMSClient::CreateRetcodeAppOutcomeCallable ARMSClient::createRetcodeAppCallable
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::CreateWebhookOutcome ARMSClient::createWebhook(const CreateWebhookRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return CreateWebhookOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return CreateWebhookOutcome(CreateWebhookResult(outcome.result()));
|
||||
else
|
||||
return CreateWebhookOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ARMSClient::createWebhookAsync(const CreateWebhookRequest& request, const CreateWebhookAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, createWebhook(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ARMSClient::CreateWebhookOutcomeCallable ARMSClient::createWebhookCallable(const CreateWebhookRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<CreateWebhookOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->createWebhook(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::CreateWehookOutcome ARMSClient::createWehook(const CreateWehookRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -591,6 +699,42 @@ ARMSClient::DeleteAlertRulesOutcomeCallable ARMSClient::deleteAlertRulesCallable
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::DeleteAlertTemplateOutcome ARMSClient::deleteAlertTemplate(const DeleteAlertTemplateRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DeleteAlertTemplateOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DeleteAlertTemplateOutcome(DeleteAlertTemplateResult(outcome.result()));
|
||||
else
|
||||
return DeleteAlertTemplateOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ARMSClient::deleteAlertTemplateAsync(const DeleteAlertTemplateRequest& request, const DeleteAlertTemplateAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, deleteAlertTemplate(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ARMSClient::DeleteAlertTemplateOutcomeCallable ARMSClient::deleteAlertTemplateCallable(const DeleteAlertTemplateRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DeleteAlertTemplateOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->deleteAlertTemplate(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::DeleteDispatchRuleOutcome ARMSClient::deleteDispatchRule(const DeleteDispatchRuleRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -627,6 +771,78 @@ ARMSClient::DeleteDispatchRuleOutcomeCallable ARMSClient::deleteDispatchRuleCall
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::DeleteGrafanaResourceOutcome ARMSClient::deleteGrafanaResource(const DeleteGrafanaResourceRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DeleteGrafanaResourceOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DeleteGrafanaResourceOutcome(DeleteGrafanaResourceResult(outcome.result()));
|
||||
else
|
||||
return DeleteGrafanaResourceOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ARMSClient::deleteGrafanaResourceAsync(const DeleteGrafanaResourceRequest& request, const DeleteGrafanaResourceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, deleteGrafanaResource(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ARMSClient::DeleteGrafanaResourceOutcomeCallable ARMSClient::deleteGrafanaResourceCallable(const DeleteGrafanaResourceRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DeleteGrafanaResourceOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->deleteGrafanaResource(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::DeletePrometheusAlertRuleOutcome ARMSClient::deletePrometheusAlertRule(const DeletePrometheusAlertRuleRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DeletePrometheusAlertRuleOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DeletePrometheusAlertRuleOutcome(DeletePrometheusAlertRuleResult(outcome.result()));
|
||||
else
|
||||
return DeletePrometheusAlertRuleOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ARMSClient::deletePrometheusAlertRuleAsync(const DeletePrometheusAlertRuleRequest& request, const DeletePrometheusAlertRuleAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, deletePrometheusAlertRule(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ARMSClient::DeletePrometheusAlertRuleOutcomeCallable ARMSClient::deletePrometheusAlertRuleCallable(const DeletePrometheusAlertRuleRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DeletePrometheusAlertRuleOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->deletePrometheusAlertRule(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::DeleteRetcodeAppOutcome ARMSClient::deleteRetcodeApp(const DeleteRetcodeAppRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -771,6 +987,42 @@ ARMSClient::DescribeDispatchRuleOutcomeCallable ARMSClient::describeDispatchRule
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::DescribePrometheusAlertRuleOutcome ARMSClient::describePrometheusAlertRule(const DescribePrometheusAlertRuleRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DescribePrometheusAlertRuleOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DescribePrometheusAlertRuleOutcome(DescribePrometheusAlertRuleResult(outcome.result()));
|
||||
else
|
||||
return DescribePrometheusAlertRuleOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ARMSClient::describePrometheusAlertRuleAsync(const DescribePrometheusAlertRuleRequest& request, const DescribePrometheusAlertRuleAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, describePrometheusAlertRule(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ARMSClient::DescribePrometheusAlertRuleOutcomeCallable ARMSClient::describePrometheusAlertRuleCallable(const DescribePrometheusAlertRuleRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DescribePrometheusAlertRuleOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->describePrometheusAlertRule(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::DescribeTraceLicenseKeyOutcome ARMSClient::describeTraceLicenseKey(const DescribeTraceLicenseKeyRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -843,6 +1095,78 @@ ARMSClient::DescribeTraceLocationOutcomeCallable ARMSClient::describeTraceLocati
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::DisableAlertTemplateOutcome ARMSClient::disableAlertTemplate(const DisableAlertTemplateRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DisableAlertTemplateOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DisableAlertTemplateOutcome(DisableAlertTemplateResult(outcome.result()));
|
||||
else
|
||||
return DisableAlertTemplateOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ARMSClient::disableAlertTemplateAsync(const DisableAlertTemplateRequest& request, const DisableAlertTemplateAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, disableAlertTemplate(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ARMSClient::DisableAlertTemplateOutcomeCallable ARMSClient::disableAlertTemplateCallable(const DisableAlertTemplateRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DisableAlertTemplateOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->disableAlertTemplate(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::EnableAlertTemplateOutcome ARMSClient::enableAlertTemplate(const EnableAlertTemplateRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return EnableAlertTemplateOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return EnableAlertTemplateOutcome(EnableAlertTemplateResult(outcome.result()));
|
||||
else
|
||||
return EnableAlertTemplateOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ARMSClient::enableAlertTemplateAsync(const EnableAlertTemplateRequest& request, const EnableAlertTemplateAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, enableAlertTemplate(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ARMSClient::EnableAlertTemplateOutcomeCallable ARMSClient::enableAlertTemplateCallable(const EnableAlertTemplateRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<EnableAlertTemplateOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->enableAlertTemplate(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::ExportPrometheusRulesOutcome ARMSClient::exportPrometheusRules(const ExportPrometheusRulesRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -1347,6 +1671,78 @@ ARMSClient::ImportPrometheusRulesOutcomeCallable ARMSClient::importPrometheusRul
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::ListActivatedAlertsOutcome ARMSClient::listActivatedAlerts(const ListActivatedAlertsRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ListActivatedAlertsOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ListActivatedAlertsOutcome(ListActivatedAlertsResult(outcome.result()));
|
||||
else
|
||||
return ListActivatedAlertsOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ARMSClient::listActivatedAlertsAsync(const ListActivatedAlertsRequest& request, const ListActivatedAlertsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, listActivatedAlerts(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ARMSClient::ListActivatedAlertsOutcomeCallable ARMSClient::listActivatedAlertsCallable(const ListActivatedAlertsRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ListActivatedAlertsOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->listActivatedAlerts(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::ListAlertTemplatesOutcome ARMSClient::listAlertTemplates(const ListAlertTemplatesRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ListAlertTemplatesOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ListAlertTemplatesOutcome(ListAlertTemplatesResult(outcome.result()));
|
||||
else
|
||||
return ListAlertTemplatesOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ARMSClient::listAlertTemplatesAsync(const ListAlertTemplatesRequest& request, const ListAlertTemplatesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, listAlertTemplates(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ARMSClient::ListAlertTemplatesOutcomeCallable ARMSClient::listAlertTemplatesCallable(const ListAlertTemplatesRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ListAlertTemplatesOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->listAlertTemplates(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::ListClusterFromGrafanaOutcome ARMSClient::listClusterFromGrafana(const ListClusterFromGrafanaRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -1491,6 +1887,78 @@ ARMSClient::ListPromClustersOutcomeCallable ARMSClient::listPromClustersCallable
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::ListPrometheusAlertRulesOutcome ARMSClient::listPrometheusAlertRules(const ListPrometheusAlertRulesRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ListPrometheusAlertRulesOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ListPrometheusAlertRulesOutcome(ListPrometheusAlertRulesResult(outcome.result()));
|
||||
else
|
||||
return ListPrometheusAlertRulesOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ARMSClient::listPrometheusAlertRulesAsync(const ListPrometheusAlertRulesRequest& request, const ListPrometheusAlertRulesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, listPrometheusAlertRules(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ARMSClient::ListPrometheusAlertRulesOutcomeCallable ARMSClient::listPrometheusAlertRulesCallable(const ListPrometheusAlertRulesRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ListPrometheusAlertRulesOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->listPrometheusAlertRules(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::ListPrometheusAlertTemplatesOutcome ARMSClient::listPrometheusAlertTemplates(const ListPrometheusAlertTemplatesRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ListPrometheusAlertTemplatesOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ListPrometheusAlertTemplatesOutcome(ListPrometheusAlertTemplatesResult(outcome.result()));
|
||||
else
|
||||
return ListPrometheusAlertTemplatesOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ARMSClient::listPrometheusAlertTemplatesAsync(const ListPrometheusAlertTemplatesRequest& request, const ListPrometheusAlertTemplatesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, listPrometheusAlertTemplates(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ARMSClient::ListPrometheusAlertTemplatesOutcomeCallable ARMSClient::listPrometheusAlertTemplatesCallable(const ListPrometheusAlertTemplatesRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ListPrometheusAlertTemplatesOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->listPrometheusAlertTemplates(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::ListRetcodeAppsOutcome ARMSClient::listRetcodeApps(const ListRetcodeAppsRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -1635,6 +2103,42 @@ ARMSClient::ListTraceAppsOutcomeCallable ARMSClient::listTraceAppsCallable(const
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::OpenArmsDefaultSLROutcome ARMSClient::openArmsDefaultSLR(const OpenArmsDefaultSLRRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return OpenArmsDefaultSLROutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return OpenArmsDefaultSLROutcome(OpenArmsDefaultSLRResult(outcome.result()));
|
||||
else
|
||||
return OpenArmsDefaultSLROutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ARMSClient::openArmsDefaultSLRAsync(const OpenArmsDefaultSLRRequest& request, const OpenArmsDefaultSLRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, openArmsDefaultSLR(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ARMSClient::OpenArmsDefaultSLROutcomeCallable ARMSClient::openArmsDefaultSLRCallable(const OpenArmsDefaultSLRRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<OpenArmsDefaultSLROutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->openArmsDefaultSLR(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::OpenArmsServiceOutcome ARMSClient::openArmsService(const OpenArmsServiceRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -1671,6 +2175,42 @@ ARMSClient::OpenArmsServiceOutcomeCallable ARMSClient::openArmsServiceCallable(c
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::OpenArmsServiceSecondVersionOutcome ARMSClient::openArmsServiceSecondVersion(const OpenArmsServiceSecondVersionRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return OpenArmsServiceSecondVersionOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return OpenArmsServiceSecondVersionOutcome(OpenArmsServiceSecondVersionResult(outcome.result()));
|
||||
else
|
||||
return OpenArmsServiceSecondVersionOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ARMSClient::openArmsServiceSecondVersionAsync(const OpenArmsServiceSecondVersionRequest& request, const OpenArmsServiceSecondVersionAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, openArmsServiceSecondVersion(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ARMSClient::OpenArmsServiceSecondVersionOutcomeCallable ARMSClient::openArmsServiceSecondVersionCallable(const OpenArmsServiceSecondVersionRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<OpenArmsServiceSecondVersionOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->openArmsServiceSecondVersion(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::OpenVClusterOutcome ARMSClient::openVCluster(const OpenVClusterRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -1707,6 +2247,42 @@ ARMSClient::OpenVClusterOutcomeCallable ARMSClient::openVClusterCallable(const O
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::OpenXtraceDefaultSLROutcome ARMSClient::openXtraceDefaultSLR(const OpenXtraceDefaultSLRRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return OpenXtraceDefaultSLROutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return OpenXtraceDefaultSLROutcome(OpenXtraceDefaultSLRResult(outcome.result()));
|
||||
else
|
||||
return OpenXtraceDefaultSLROutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ARMSClient::openXtraceDefaultSLRAsync(const OpenXtraceDefaultSLRRequest& request, const OpenXtraceDefaultSLRAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, openXtraceDefaultSLR(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ARMSClient::OpenXtraceDefaultSLROutcomeCallable ARMSClient::openXtraceDefaultSLRCallable(const OpenXtraceDefaultSLRRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<OpenXtraceDefaultSLROutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->openXtraceDefaultSLR(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::QueryDatasetOutcome ARMSClient::queryDataset(const QueryDatasetRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -2499,6 +3075,42 @@ ARMSClient::UpdateAlertRuleOutcomeCallable ARMSClient::updateAlertRuleCallable(c
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::UpdateAlertTemplateOutcome ARMSClient::updateAlertTemplate(const UpdateAlertTemplateRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return UpdateAlertTemplateOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return UpdateAlertTemplateOutcome(UpdateAlertTemplateResult(outcome.result()));
|
||||
else
|
||||
return UpdateAlertTemplateOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ARMSClient::updateAlertTemplateAsync(const UpdateAlertTemplateRequest& request, const UpdateAlertTemplateAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, updateAlertTemplate(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ARMSClient::UpdateAlertTemplateOutcomeCallable ARMSClient::updateAlertTemplateCallable(const UpdateAlertTemplateRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<UpdateAlertTemplateOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->updateAlertTemplate(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::UpdateDispatchRuleOutcome ARMSClient::updateDispatchRule(const UpdateDispatchRuleRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -2535,6 +3147,42 @@ ARMSClient::UpdateDispatchRuleOutcomeCallable ARMSClient::updateDispatchRuleCall
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::UpdatePrometheusAlertRuleOutcome ARMSClient::updatePrometheusAlertRule(const UpdatePrometheusAlertRuleRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return UpdatePrometheusAlertRuleOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return UpdatePrometheusAlertRuleOutcome(UpdatePrometheusAlertRuleResult(outcome.result()));
|
||||
else
|
||||
return UpdatePrometheusAlertRuleOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ARMSClient::updatePrometheusAlertRuleAsync(const UpdatePrometheusAlertRuleRequest& request, const UpdatePrometheusAlertRuleAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, updatePrometheusAlertRule(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ARMSClient::UpdatePrometheusAlertRuleOutcomeCallable ARMSClient::updatePrometheusAlertRuleCallable(const UpdatePrometheusAlertRuleRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<UpdatePrometheusAlertRuleOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->updatePrometheusAlertRule(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ARMSClient::UpdateWebhookOutcome ARMSClient::updateWebhook(const UpdateWebhookRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
150
arms/src/model/CreateAlertTemplateRequest.cc
Normal file
150
arms/src/model/CreateAlertTemplateRequest.cc
Normal file
@@ -0,0 +1,150 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/CreateAlertTemplateRequest.h>
|
||||
|
||||
using AlibabaCloud::ARMS::Model::CreateAlertTemplateRequest;
|
||||
|
||||
CreateAlertTemplateRequest::CreateAlertTemplateRequest() :
|
||||
RpcServiceRequest("arms", "2019-08-08", "CreateAlertTemplate")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
CreateAlertTemplateRequest::~CreateAlertTemplateRequest()
|
||||
{}
|
||||
|
||||
std::string CreateAlertTemplateRequest::getTemplateProvider()const
|
||||
{
|
||||
return templateProvider_;
|
||||
}
|
||||
|
||||
void CreateAlertTemplateRequest::setTemplateProvider(const std::string& templateProvider)
|
||||
{
|
||||
templateProvider_ = templateProvider;
|
||||
setParameter("TemplateProvider", templateProvider);
|
||||
}
|
||||
|
||||
std::string CreateAlertTemplateRequest::getAnnotations()const
|
||||
{
|
||||
return annotations_;
|
||||
}
|
||||
|
||||
void CreateAlertTemplateRequest::setAnnotations(const std::string& annotations)
|
||||
{
|
||||
annotations_ = annotations;
|
||||
setParameter("Annotations", annotations);
|
||||
}
|
||||
|
||||
std::string CreateAlertTemplateRequest::getRule()const
|
||||
{
|
||||
return rule_;
|
||||
}
|
||||
|
||||
void CreateAlertTemplateRequest::setRule(const std::string& rule)
|
||||
{
|
||||
rule_ = rule;
|
||||
setParameter("Rule", rule);
|
||||
}
|
||||
|
||||
std::string CreateAlertTemplateRequest::getProxyUserId()const
|
||||
{
|
||||
return proxyUserId_;
|
||||
}
|
||||
|
||||
void CreateAlertTemplateRequest::setProxyUserId(const std::string& proxyUserId)
|
||||
{
|
||||
proxyUserId_ = proxyUserId;
|
||||
setParameter("ProxyUserId", proxyUserId);
|
||||
}
|
||||
|
||||
std::string CreateAlertTemplateRequest::getType()const
|
||||
{
|
||||
return type_;
|
||||
}
|
||||
|
||||
void CreateAlertTemplateRequest::setType(const std::string& type)
|
||||
{
|
||||
type_ = type;
|
||||
setParameter("Type", type);
|
||||
}
|
||||
|
||||
std::string CreateAlertTemplateRequest::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
void CreateAlertTemplateRequest::setMessage(const std::string& message)
|
||||
{
|
||||
message_ = message;
|
||||
setParameter("Message", message);
|
||||
}
|
||||
|
||||
std::string CreateAlertTemplateRequest::getParentId()const
|
||||
{
|
||||
return parentId_;
|
||||
}
|
||||
|
||||
void CreateAlertTemplateRequest::setParentId(const std::string& parentId)
|
||||
{
|
||||
parentId_ = parentId;
|
||||
setParameter("ParentId", parentId);
|
||||
}
|
||||
|
||||
std::string CreateAlertTemplateRequest::getLabels()const
|
||||
{
|
||||
return labels_;
|
||||
}
|
||||
|
||||
void CreateAlertTemplateRequest::setLabels(const std::string& labels)
|
||||
{
|
||||
labels_ = labels;
|
||||
setParameter("Labels", labels);
|
||||
}
|
||||
|
||||
std::string CreateAlertTemplateRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void CreateAlertTemplateRequest::setRegionId(const std::string& regionId)
|
||||
{
|
||||
regionId_ = regionId;
|
||||
setParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
std::string CreateAlertTemplateRequest::getName()const
|
||||
{
|
||||
return name_;
|
||||
}
|
||||
|
||||
void CreateAlertTemplateRequest::setName(const std::string& name)
|
||||
{
|
||||
name_ = name;
|
||||
setParameter("Name", name);
|
||||
}
|
||||
|
||||
std::string CreateAlertTemplateRequest::getMatchExpressions()const
|
||||
{
|
||||
return matchExpressions_;
|
||||
}
|
||||
|
||||
void CreateAlertTemplateRequest::setMatchExpressions(const std::string& matchExpressions)
|
||||
{
|
||||
matchExpressions_ = matchExpressions;
|
||||
setParameter("MatchExpressions", matchExpressions);
|
||||
}
|
||||
|
||||
95
arms/src/model/CreateAlertTemplateResult.cc
Normal file
95
arms/src/model/CreateAlertTemplateResult.cc
Normal file
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/CreateAlertTemplateResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::ARMS;
|
||||
using namespace AlibabaCloud::ARMS::Model;
|
||||
|
||||
CreateAlertTemplateResult::CreateAlertTemplateResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
CreateAlertTemplateResult::CreateAlertTemplateResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
CreateAlertTemplateResult::~CreateAlertTemplateResult()
|
||||
{}
|
||||
|
||||
void CreateAlertTemplateResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto alertTemplateNode = value["AlertTemplate"];
|
||||
if(!alertTemplateNode["Id"].isNull())
|
||||
alertTemplate_.id = std::stoi(alertTemplateNode["Id"].asString());
|
||||
if(!alertTemplateNode["ParentId"].isNull())
|
||||
alertTemplate_.parentId = std::stoi(alertTemplateNode["ParentId"].asString());
|
||||
if(!alertTemplateNode["Name"].isNull())
|
||||
alertTemplate_.name = alertTemplateNode["Name"].asString();
|
||||
if(!alertTemplateNode["Message"].isNull())
|
||||
alertTemplate_.message = alertTemplateNode["Message"].asString();
|
||||
if(!alertTemplateNode["AlertProvider"].isNull())
|
||||
alertTemplate_.alertProvider = alertTemplateNode["AlertProvider"].asString();
|
||||
if(!alertTemplateNode["TemplateProvider"].isNull())
|
||||
alertTemplate_.templateProvider = alertTemplateNode["TemplateProvider"].asString();
|
||||
if(!alertTemplateNode["Type"].isNull())
|
||||
alertTemplate_.type = alertTemplateNode["Type"].asString();
|
||||
if(!alertTemplateNode["Labels"].isNull())
|
||||
alertTemplate_.labels = alertTemplateNode["Labels"].asString();
|
||||
if(!alertTemplateNode["Annotations"].isNull())
|
||||
alertTemplate_.annotations = alertTemplateNode["Annotations"].asString();
|
||||
if(!alertTemplateNode["Rule"].isNull())
|
||||
alertTemplate_.rule = alertTemplateNode["Rule"].asString();
|
||||
if(!alertTemplateNode["UserId"].isNull())
|
||||
alertTemplate_.userId = alertTemplateNode["UserId"].asString();
|
||||
if(!alertTemplateNode["Status"].isNull())
|
||||
alertTemplate_.status = alertTemplateNode["Status"].asString() == "true";
|
||||
if(!alertTemplateNode["Public"].isNull())
|
||||
alertTemplate_._public = alertTemplateNode["Public"].asString() == "true";
|
||||
auto labelMatchExpressionGridNode = alertTemplateNode["LabelMatchExpressionGrid"];
|
||||
auto allLabelMatchExpressionGroupsNode = labelMatchExpressionGridNode["LabelMatchExpressionGroups"]["LabelMatchExpressionGroup"];
|
||||
for (auto labelMatchExpressionGridNodeLabelMatchExpressionGroupsLabelMatchExpressionGroup : allLabelMatchExpressionGroupsNode)
|
||||
{
|
||||
AlertTemplate::LabelMatchExpressionGrid::LabelMatchExpressionGroup labelMatchExpressionGroupObject;
|
||||
auto allLabelMatchExpressionsNode = labelMatchExpressionGridNodeLabelMatchExpressionGroupsLabelMatchExpressionGroup["LabelMatchExpressions"]["LabelMatchExpression"];
|
||||
for (auto labelMatchExpressionGridNodeLabelMatchExpressionGroupsLabelMatchExpressionGroupLabelMatchExpressionsLabelMatchExpression : allLabelMatchExpressionsNode)
|
||||
{
|
||||
AlertTemplate::LabelMatchExpressionGrid::LabelMatchExpressionGroup::LabelMatchExpression labelMatchExpressionsObject;
|
||||
if(!labelMatchExpressionGridNodeLabelMatchExpressionGroupsLabelMatchExpressionGroupLabelMatchExpressionsLabelMatchExpression["Key"].isNull())
|
||||
labelMatchExpressionsObject.key = labelMatchExpressionGridNodeLabelMatchExpressionGroupsLabelMatchExpressionGroupLabelMatchExpressionsLabelMatchExpression["Key"].asString();
|
||||
if(!labelMatchExpressionGridNodeLabelMatchExpressionGroupsLabelMatchExpressionGroupLabelMatchExpressionsLabelMatchExpression["Value"].isNull())
|
||||
labelMatchExpressionsObject.value = labelMatchExpressionGridNodeLabelMatchExpressionGroupsLabelMatchExpressionGroupLabelMatchExpressionsLabelMatchExpression["Value"].asString();
|
||||
if(!labelMatchExpressionGridNodeLabelMatchExpressionGroupsLabelMatchExpressionGroupLabelMatchExpressionsLabelMatchExpression["Operator"].isNull())
|
||||
labelMatchExpressionsObject._operator = labelMatchExpressionGridNodeLabelMatchExpressionGroupsLabelMatchExpressionGroupLabelMatchExpressionsLabelMatchExpression["Operator"].asString();
|
||||
labelMatchExpressionGroupObject.labelMatchExpressions.push_back(labelMatchExpressionsObject);
|
||||
}
|
||||
alertTemplate_.labelMatchExpressionGrid.labelMatchExpressionGroups.push_back(labelMatchExpressionGroupObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
CreateAlertTemplateResult::AlertTemplate CreateAlertTemplateResult::getAlertTemplate()const
|
||||
{
|
||||
return alertTemplate_;
|
||||
}
|
||||
|
||||
172
arms/src/model/CreatePrometheusAlertRuleRequest.cc
Normal file
172
arms/src/model/CreatePrometheusAlertRuleRequest.cc
Normal file
@@ -0,0 +1,172 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/CreatePrometheusAlertRuleRequest.h>
|
||||
|
||||
using AlibabaCloud::ARMS::Model::CreatePrometheusAlertRuleRequest;
|
||||
|
||||
CreatePrometheusAlertRuleRequest::CreatePrometheusAlertRuleRequest() :
|
||||
RpcServiceRequest("arms", "2019-08-08", "CreatePrometheusAlertRule")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
CreatePrometheusAlertRuleRequest::~CreatePrometheusAlertRuleRequest()
|
||||
{}
|
||||
|
||||
std::string CreatePrometheusAlertRuleRequest::getProductCode()const
|
||||
{
|
||||
return productCode_;
|
||||
}
|
||||
|
||||
void CreatePrometheusAlertRuleRequest::setProductCode(const std::string& productCode)
|
||||
{
|
||||
productCode_ = productCode;
|
||||
setParameter("ProductCode", productCode);
|
||||
}
|
||||
|
||||
std::string CreatePrometheusAlertRuleRequest::getExpression()const
|
||||
{
|
||||
return expression_;
|
||||
}
|
||||
|
||||
void CreatePrometheusAlertRuleRequest::setExpression(const std::string& expression)
|
||||
{
|
||||
expression_ = expression;
|
||||
setParameter("Expression", expression);
|
||||
}
|
||||
|
||||
std::string CreatePrometheusAlertRuleRequest::getAlertName()const
|
||||
{
|
||||
return alertName_;
|
||||
}
|
||||
|
||||
void CreatePrometheusAlertRuleRequest::setAlertName(const std::string& alertName)
|
||||
{
|
||||
alertName_ = alertName;
|
||||
setParameter("AlertName", alertName);
|
||||
}
|
||||
|
||||
std::string CreatePrometheusAlertRuleRequest::getAnnotations()const
|
||||
{
|
||||
return annotations_;
|
||||
}
|
||||
|
||||
void CreatePrometheusAlertRuleRequest::setAnnotations(const std::string& annotations)
|
||||
{
|
||||
annotations_ = annotations;
|
||||
setParameter("Annotations", annotations);
|
||||
}
|
||||
|
||||
std::string CreatePrometheusAlertRuleRequest::getClusterId()const
|
||||
{
|
||||
return clusterId_;
|
||||
}
|
||||
|
||||
void CreatePrometheusAlertRuleRequest::setClusterId(const std::string& clusterId)
|
||||
{
|
||||
clusterId_ = clusterId;
|
||||
setParameter("ClusterId", clusterId);
|
||||
}
|
||||
|
||||
long CreatePrometheusAlertRuleRequest::getDispatchRuleId()const
|
||||
{
|
||||
return dispatchRuleId_;
|
||||
}
|
||||
|
||||
void CreatePrometheusAlertRuleRequest::setDispatchRuleId(long dispatchRuleId)
|
||||
{
|
||||
dispatchRuleId_ = dispatchRuleId;
|
||||
setParameter("DispatchRuleId", std::to_string(dispatchRuleId));
|
||||
}
|
||||
|
||||
std::string CreatePrometheusAlertRuleRequest::getProxyUserId()const
|
||||
{
|
||||
return proxyUserId_;
|
||||
}
|
||||
|
||||
void CreatePrometheusAlertRuleRequest::setProxyUserId(const std::string& proxyUserId)
|
||||
{
|
||||
proxyUserId_ = proxyUserId;
|
||||
setParameter("ProxyUserId", proxyUserId);
|
||||
}
|
||||
|
||||
std::string CreatePrometheusAlertRuleRequest::getType()const
|
||||
{
|
||||
return type_;
|
||||
}
|
||||
|
||||
void CreatePrometheusAlertRuleRequest::setType(const std::string& type)
|
||||
{
|
||||
type_ = type;
|
||||
setParameter("Type", type);
|
||||
}
|
||||
|
||||
std::string CreatePrometheusAlertRuleRequest::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
void CreatePrometheusAlertRuleRequest::setMessage(const std::string& message)
|
||||
{
|
||||
message_ = message;
|
||||
setParameter("Message", message);
|
||||
}
|
||||
|
||||
std::string CreatePrometheusAlertRuleRequest::getLabels()const
|
||||
{
|
||||
return labels_;
|
||||
}
|
||||
|
||||
void CreatePrometheusAlertRuleRequest::setLabels(const std::string& labels)
|
||||
{
|
||||
labels_ = labels;
|
||||
setParameter("Labels", labels);
|
||||
}
|
||||
|
||||
std::string CreatePrometheusAlertRuleRequest::getDuration()const
|
||||
{
|
||||
return duration_;
|
||||
}
|
||||
|
||||
void CreatePrometheusAlertRuleRequest::setDuration(const std::string& duration)
|
||||
{
|
||||
duration_ = duration;
|
||||
setParameter("Duration", duration);
|
||||
}
|
||||
|
||||
std::string CreatePrometheusAlertRuleRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void CreatePrometheusAlertRuleRequest::setRegionId(const std::string& regionId)
|
||||
{
|
||||
regionId_ = regionId;
|
||||
setParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
std::string CreatePrometheusAlertRuleRequest::getNotifyType()const
|
||||
{
|
||||
return notifyType_;
|
||||
}
|
||||
|
||||
void CreatePrometheusAlertRuleRequest::setNotifyType(const std::string& notifyType)
|
||||
{
|
||||
notifyType_ = notifyType;
|
||||
setParameter("NotifyType", notifyType);
|
||||
}
|
||||
|
||||
90
arms/src/model/CreatePrometheusAlertRuleResult.cc
Normal file
90
arms/src/model/CreatePrometheusAlertRuleResult.cc
Normal file
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/CreatePrometheusAlertRuleResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::ARMS;
|
||||
using namespace AlibabaCloud::ARMS::Model;
|
||||
|
||||
CreatePrometheusAlertRuleResult::CreatePrometheusAlertRuleResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
CreatePrometheusAlertRuleResult::CreatePrometheusAlertRuleResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
CreatePrometheusAlertRuleResult::~CreatePrometheusAlertRuleResult()
|
||||
{}
|
||||
|
||||
void CreatePrometheusAlertRuleResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto prometheusAlertRuleNode = value["PrometheusAlertRule"];
|
||||
if(!prometheusAlertRuleNode["AlertId"].isNull())
|
||||
prometheusAlertRule_.alertId = std::stol(prometheusAlertRuleNode["AlertId"].asString());
|
||||
if(!prometheusAlertRuleNode["AlertName"].isNull())
|
||||
prometheusAlertRule_.alertName = prometheusAlertRuleNode["AlertName"].asString();
|
||||
if(!prometheusAlertRuleNode["Message"].isNull())
|
||||
prometheusAlertRule_.message = prometheusAlertRuleNode["Message"].asString();
|
||||
if(!prometheusAlertRuleNode["Type"].isNull())
|
||||
prometheusAlertRule_.type = prometheusAlertRuleNode["Type"].asString();
|
||||
if(!prometheusAlertRuleNode["Expression"].isNull())
|
||||
prometheusAlertRule_.expression = prometheusAlertRuleNode["Expression"].asString();
|
||||
if(!prometheusAlertRuleNode["Duration"].isNull())
|
||||
prometheusAlertRule_.duration = prometheusAlertRuleNode["Duration"].asString();
|
||||
if(!prometheusAlertRuleNode["ClusterId"].isNull())
|
||||
prometheusAlertRule_.clusterId = prometheusAlertRuleNode["ClusterId"].asString();
|
||||
if(!prometheusAlertRuleNode["Status"].isNull())
|
||||
prometheusAlertRule_.status = std::stoi(prometheusAlertRuleNode["Status"].asString());
|
||||
if(!prometheusAlertRuleNode["DispatchRuleId"].isNull())
|
||||
prometheusAlertRule_.dispatchRuleId = std::stol(prometheusAlertRuleNode["DispatchRuleId"].asString());
|
||||
if(!prometheusAlertRuleNode["NotifyType"].isNull())
|
||||
prometheusAlertRule_.notifyType = prometheusAlertRuleNode["NotifyType"].asString();
|
||||
auto allLabelsNode = prometheusAlertRuleNode["Labels"]["Label"];
|
||||
for (auto prometheusAlertRuleNodeLabelsLabel : allLabelsNode)
|
||||
{
|
||||
PrometheusAlertRule::Label labelObject;
|
||||
if(!prometheusAlertRuleNodeLabelsLabel["Name"].isNull())
|
||||
labelObject.name = prometheusAlertRuleNodeLabelsLabel["Name"].asString();
|
||||
if(!prometheusAlertRuleNodeLabelsLabel["Value"].isNull())
|
||||
labelObject.value = prometheusAlertRuleNodeLabelsLabel["Value"].asString();
|
||||
prometheusAlertRule_.labels.push_back(labelObject);
|
||||
}
|
||||
auto allAnnotationsNode = prometheusAlertRuleNode["Annotations"]["Annotation"];
|
||||
for (auto prometheusAlertRuleNodeAnnotationsAnnotation : allAnnotationsNode)
|
||||
{
|
||||
PrometheusAlertRule::Annotation annotationObject;
|
||||
if(!prometheusAlertRuleNodeAnnotationsAnnotation["Name"].isNull())
|
||||
annotationObject.name = prometheusAlertRuleNodeAnnotationsAnnotation["Name"].asString();
|
||||
if(!prometheusAlertRuleNodeAnnotationsAnnotation["Value"].isNull())
|
||||
annotationObject.value = prometheusAlertRuleNodeAnnotationsAnnotation["Value"].asString();
|
||||
prometheusAlertRule_.annotations.push_back(annotationObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
CreatePrometheusAlertRuleResult::PrometheusAlertRule CreatePrometheusAlertRuleResult::getPrometheusAlertRule()const
|
||||
{
|
||||
return prometheusAlertRule_;
|
||||
}
|
||||
|
||||
117
arms/src/model/CreateWebhookRequest.cc
Normal file
117
arms/src/model/CreateWebhookRequest.cc
Normal file
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/CreateWebhookRequest.h>
|
||||
|
||||
using AlibabaCloud::ARMS::Model::CreateWebhookRequest;
|
||||
|
||||
CreateWebhookRequest::CreateWebhookRequest() :
|
||||
RpcServiceRequest("arms", "2019-08-08", "CreateWebhook")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
CreateWebhookRequest::~CreateWebhookRequest()
|
||||
{}
|
||||
|
||||
std::string CreateWebhookRequest::getHttpHeaders()const
|
||||
{
|
||||
return httpHeaders_;
|
||||
}
|
||||
|
||||
void CreateWebhookRequest::setHttpHeaders(const std::string& httpHeaders)
|
||||
{
|
||||
httpHeaders_ = httpHeaders;
|
||||
setParameter("HttpHeaders", httpHeaders);
|
||||
}
|
||||
|
||||
std::string CreateWebhookRequest::getMethod()const
|
||||
{
|
||||
return method_;
|
||||
}
|
||||
|
||||
void CreateWebhookRequest::setMethod(const std::string& method)
|
||||
{
|
||||
method_ = method;
|
||||
setParameter("Method", method);
|
||||
}
|
||||
|
||||
std::string CreateWebhookRequest::getHttpParams()const
|
||||
{
|
||||
return httpParams_;
|
||||
}
|
||||
|
||||
void CreateWebhookRequest::setHttpParams(const std::string& httpParams)
|
||||
{
|
||||
httpParams_ = httpParams;
|
||||
setParameter("HttpParams", httpParams);
|
||||
}
|
||||
|
||||
std::string CreateWebhookRequest::getProxyUserId()const
|
||||
{
|
||||
return proxyUserId_;
|
||||
}
|
||||
|
||||
void CreateWebhookRequest::setProxyUserId(const std::string& proxyUserId)
|
||||
{
|
||||
proxyUserId_ = proxyUserId;
|
||||
setParameter("ProxyUserId", proxyUserId);
|
||||
}
|
||||
|
||||
std::string CreateWebhookRequest::getBody()const
|
||||
{
|
||||
return body_;
|
||||
}
|
||||
|
||||
void CreateWebhookRequest::setBody(const std::string& body)
|
||||
{
|
||||
body_ = body;
|
||||
setParameter("Body", body);
|
||||
}
|
||||
|
||||
std::string CreateWebhookRequest::getUrl()const
|
||||
{
|
||||
return url_;
|
||||
}
|
||||
|
||||
void CreateWebhookRequest::setUrl(const std::string& url)
|
||||
{
|
||||
url_ = url;
|
||||
setParameter("Url", url);
|
||||
}
|
||||
|
||||
std::string CreateWebhookRequest::getContactName()const
|
||||
{
|
||||
return contactName_;
|
||||
}
|
||||
|
||||
void CreateWebhookRequest::setContactName(const std::string& contactName)
|
||||
{
|
||||
contactName_ = contactName;
|
||||
setParameter("ContactName", contactName);
|
||||
}
|
||||
|
||||
std::string CreateWebhookRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void CreateWebhookRequest::setRegionId(const std::string& regionId)
|
||||
{
|
||||
regionId_ = regionId;
|
||||
setParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
51
arms/src/model/CreateWebhookResult.cc
Normal file
51
arms/src/model/CreateWebhookResult.cc
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/CreateWebhookResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::ARMS;
|
||||
using namespace AlibabaCloud::ARMS::Model;
|
||||
|
||||
CreateWebhookResult::CreateWebhookResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
CreateWebhookResult::CreateWebhookResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
CreateWebhookResult::~CreateWebhookResult()
|
||||
{}
|
||||
|
||||
void CreateWebhookResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["ContactId"].isNull())
|
||||
contactId_ = value["ContactId"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string CreateWebhookResult::getContactId()const
|
||||
{
|
||||
return contactId_;
|
||||
}
|
||||
|
||||
62
arms/src/model/DeleteAlertTemplateRequest.cc
Normal file
62
arms/src/model/DeleteAlertTemplateRequest.cc
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/DeleteAlertTemplateRequest.h>
|
||||
|
||||
using AlibabaCloud::ARMS::Model::DeleteAlertTemplateRequest;
|
||||
|
||||
DeleteAlertTemplateRequest::DeleteAlertTemplateRequest() :
|
||||
RpcServiceRequest("arms", "2019-08-08", "DeleteAlertTemplate")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DeleteAlertTemplateRequest::~DeleteAlertTemplateRequest()
|
||||
{}
|
||||
|
||||
std::string DeleteAlertTemplateRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void DeleteAlertTemplateRequest::setRegionId(const std::string& regionId)
|
||||
{
|
||||
regionId_ = regionId;
|
||||
setParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
long DeleteAlertTemplateRequest::getId()const
|
||||
{
|
||||
return id_;
|
||||
}
|
||||
|
||||
void DeleteAlertTemplateRequest::setId(long id)
|
||||
{
|
||||
id_ = id;
|
||||
setParameter("Id", std::to_string(id));
|
||||
}
|
||||
|
||||
std::string DeleteAlertTemplateRequest::getProxyUserId()const
|
||||
{
|
||||
return proxyUserId_;
|
||||
}
|
||||
|
||||
void DeleteAlertTemplateRequest::setProxyUserId(const std::string& proxyUserId)
|
||||
{
|
||||
proxyUserId_ = proxyUserId;
|
||||
setParameter("ProxyUserId", proxyUserId);
|
||||
}
|
||||
|
||||
51
arms/src/model/DeleteAlertTemplateResult.cc
Normal file
51
arms/src/model/DeleteAlertTemplateResult.cc
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/DeleteAlertTemplateResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::ARMS;
|
||||
using namespace AlibabaCloud::ARMS::Model;
|
||||
|
||||
DeleteAlertTemplateResult::DeleteAlertTemplateResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
DeleteAlertTemplateResult::DeleteAlertTemplateResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DeleteAlertTemplateResult::~DeleteAlertTemplateResult()
|
||||
{}
|
||||
|
||||
void DeleteAlertTemplateResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
|
||||
}
|
||||
|
||||
bool DeleteAlertTemplateResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
62
arms/src/model/DeleteGrafanaResourceRequest.cc
Normal file
62
arms/src/model/DeleteGrafanaResourceRequest.cc
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/DeleteGrafanaResourceRequest.h>
|
||||
|
||||
using AlibabaCloud::ARMS::Model::DeleteGrafanaResourceRequest;
|
||||
|
||||
DeleteGrafanaResourceRequest::DeleteGrafanaResourceRequest() :
|
||||
RpcServiceRequest("arms", "2019-08-08", "DeleteGrafanaResource")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DeleteGrafanaResourceRequest::~DeleteGrafanaResourceRequest()
|
||||
{}
|
||||
|
||||
std::string DeleteGrafanaResourceRequest::getClusterName()const
|
||||
{
|
||||
return clusterName_;
|
||||
}
|
||||
|
||||
void DeleteGrafanaResourceRequest::setClusterName(const std::string& clusterName)
|
||||
{
|
||||
clusterName_ = clusterName;
|
||||
setBodyParameter("ClusterName", clusterName);
|
||||
}
|
||||
|
||||
std::string DeleteGrafanaResourceRequest::getClusterId()const
|
||||
{
|
||||
return clusterId_;
|
||||
}
|
||||
|
||||
void DeleteGrafanaResourceRequest::setClusterId(const std::string& clusterId)
|
||||
{
|
||||
clusterId_ = clusterId;
|
||||
setBodyParameter("ClusterId", clusterId);
|
||||
}
|
||||
|
||||
std::string DeleteGrafanaResourceRequest::getUserId()const
|
||||
{
|
||||
return userId_;
|
||||
}
|
||||
|
||||
void DeleteGrafanaResourceRequest::setUserId(const std::string& userId)
|
||||
{
|
||||
userId_ = userId;
|
||||
setBodyParameter("UserId", userId);
|
||||
}
|
||||
|
||||
51
arms/src/model/DeleteGrafanaResourceResult.cc
Normal file
51
arms/src/model/DeleteGrafanaResourceResult.cc
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/DeleteGrafanaResourceResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::ARMS;
|
||||
using namespace AlibabaCloud::ARMS::Model;
|
||||
|
||||
DeleteGrafanaResourceResult::DeleteGrafanaResourceResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
DeleteGrafanaResourceResult::DeleteGrafanaResourceResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DeleteGrafanaResourceResult::~DeleteGrafanaResourceResult()
|
||||
{}
|
||||
|
||||
void DeleteGrafanaResourceResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Data"].isNull())
|
||||
data_ = value["Data"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string DeleteGrafanaResourceResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
40
arms/src/model/DeletePrometheusAlertRuleRequest.cc
Normal file
40
arms/src/model/DeletePrometheusAlertRuleRequest.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/DeletePrometheusAlertRuleRequest.h>
|
||||
|
||||
using AlibabaCloud::ARMS::Model::DeletePrometheusAlertRuleRequest;
|
||||
|
||||
DeletePrometheusAlertRuleRequest::DeletePrometheusAlertRuleRequest() :
|
||||
RpcServiceRequest("arms", "2019-08-08", "DeletePrometheusAlertRule")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DeletePrometheusAlertRuleRequest::~DeletePrometheusAlertRuleRequest()
|
||||
{}
|
||||
|
||||
long DeletePrometheusAlertRuleRequest::getAlertId()const
|
||||
{
|
||||
return alertId_;
|
||||
}
|
||||
|
||||
void DeletePrometheusAlertRuleRequest::setAlertId(long alertId)
|
||||
{
|
||||
alertId_ = alertId;
|
||||
setParameter("AlertId", std::to_string(alertId));
|
||||
}
|
||||
|
||||
51
arms/src/model/DeletePrometheusAlertRuleResult.cc
Normal file
51
arms/src/model/DeletePrometheusAlertRuleResult.cc
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/DeletePrometheusAlertRuleResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::ARMS;
|
||||
using namespace AlibabaCloud::ARMS::Model;
|
||||
|
||||
DeletePrometheusAlertRuleResult::DeletePrometheusAlertRuleResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
DeletePrometheusAlertRuleResult::DeletePrometheusAlertRuleResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DeletePrometheusAlertRuleResult::~DeletePrometheusAlertRuleResult()
|
||||
{}
|
||||
|
||||
void DeletePrometheusAlertRuleResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
|
||||
}
|
||||
|
||||
bool DeletePrometheusAlertRuleResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
40
arms/src/model/DescribePrometheusAlertRuleRequest.cc
Normal file
40
arms/src/model/DescribePrometheusAlertRuleRequest.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/DescribePrometheusAlertRuleRequest.h>
|
||||
|
||||
using AlibabaCloud::ARMS::Model::DescribePrometheusAlertRuleRequest;
|
||||
|
||||
DescribePrometheusAlertRuleRequest::DescribePrometheusAlertRuleRequest() :
|
||||
RpcServiceRequest("arms", "2019-08-08", "DescribePrometheusAlertRule")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DescribePrometheusAlertRuleRequest::~DescribePrometheusAlertRuleRequest()
|
||||
{}
|
||||
|
||||
long DescribePrometheusAlertRuleRequest::getAlertId()const
|
||||
{
|
||||
return alertId_;
|
||||
}
|
||||
|
||||
void DescribePrometheusAlertRuleRequest::setAlertId(long alertId)
|
||||
{
|
||||
alertId_ = alertId;
|
||||
setParameter("AlertId", std::to_string(alertId));
|
||||
}
|
||||
|
||||
90
arms/src/model/DescribePrometheusAlertRuleResult.cc
Normal file
90
arms/src/model/DescribePrometheusAlertRuleResult.cc
Normal file
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/DescribePrometheusAlertRuleResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::ARMS;
|
||||
using namespace AlibabaCloud::ARMS::Model;
|
||||
|
||||
DescribePrometheusAlertRuleResult::DescribePrometheusAlertRuleResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
DescribePrometheusAlertRuleResult::DescribePrometheusAlertRuleResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DescribePrometheusAlertRuleResult::~DescribePrometheusAlertRuleResult()
|
||||
{}
|
||||
|
||||
void DescribePrometheusAlertRuleResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto prometheusAlertRuleNode = value["PrometheusAlertRule"];
|
||||
if(!prometheusAlertRuleNode["AlertId"].isNull())
|
||||
prometheusAlertRule_.alertId = std::stol(prometheusAlertRuleNode["AlertId"].asString());
|
||||
if(!prometheusAlertRuleNode["AlertName"].isNull())
|
||||
prometheusAlertRule_.alertName = prometheusAlertRuleNode["AlertName"].asString();
|
||||
if(!prometheusAlertRuleNode["Message"].isNull())
|
||||
prometheusAlertRule_.message = prometheusAlertRuleNode["Message"].asString();
|
||||
if(!prometheusAlertRuleNode["Type"].isNull())
|
||||
prometheusAlertRule_.type = prometheusAlertRuleNode["Type"].asString();
|
||||
if(!prometheusAlertRuleNode["Expression"].isNull())
|
||||
prometheusAlertRule_.expression = prometheusAlertRuleNode["Expression"].asString();
|
||||
if(!prometheusAlertRuleNode["Duration"].isNull())
|
||||
prometheusAlertRule_.duration = prometheusAlertRuleNode["Duration"].asString();
|
||||
if(!prometheusAlertRuleNode["ClusterId"].isNull())
|
||||
prometheusAlertRule_.clusterId = prometheusAlertRuleNode["ClusterId"].asString();
|
||||
if(!prometheusAlertRuleNode["Status"].isNull())
|
||||
prometheusAlertRule_.status = std::stoi(prometheusAlertRuleNode["Status"].asString());
|
||||
if(!prometheusAlertRuleNode["DispatchRuleId"].isNull())
|
||||
prometheusAlertRule_.dispatchRuleId = std::stol(prometheusAlertRuleNode["DispatchRuleId"].asString());
|
||||
if(!prometheusAlertRuleNode["NotifyType"].isNull())
|
||||
prometheusAlertRule_.notifyType = prometheusAlertRuleNode["NotifyType"].asString();
|
||||
auto allLabelsNode = prometheusAlertRuleNode["Labels"]["Label"];
|
||||
for (auto prometheusAlertRuleNodeLabelsLabel : allLabelsNode)
|
||||
{
|
||||
PrometheusAlertRule::Label labelObject;
|
||||
if(!prometheusAlertRuleNodeLabelsLabel["Name"].isNull())
|
||||
labelObject.name = prometheusAlertRuleNodeLabelsLabel["Name"].asString();
|
||||
if(!prometheusAlertRuleNodeLabelsLabel["Value"].isNull())
|
||||
labelObject.value = prometheusAlertRuleNodeLabelsLabel["Value"].asString();
|
||||
prometheusAlertRule_.labels.push_back(labelObject);
|
||||
}
|
||||
auto allAnnotationsNode = prometheusAlertRuleNode["Annotations"]["Annotation"];
|
||||
for (auto prometheusAlertRuleNodeAnnotationsAnnotation : allAnnotationsNode)
|
||||
{
|
||||
PrometheusAlertRule::Annotation annotationObject;
|
||||
if(!prometheusAlertRuleNodeAnnotationsAnnotation["Name"].isNull())
|
||||
annotationObject.name = prometheusAlertRuleNodeAnnotationsAnnotation["Name"].asString();
|
||||
if(!prometheusAlertRuleNodeAnnotationsAnnotation["Value"].isNull())
|
||||
annotationObject.value = prometheusAlertRuleNodeAnnotationsAnnotation["Value"].asString();
|
||||
prometheusAlertRule_.annotations.push_back(annotationObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
DescribePrometheusAlertRuleResult::PrometheusAlertRule DescribePrometheusAlertRuleResult::getPrometheusAlertRule()const
|
||||
{
|
||||
return prometheusAlertRule_;
|
||||
}
|
||||
|
||||
62
arms/src/model/DisableAlertTemplateRequest.cc
Normal file
62
arms/src/model/DisableAlertTemplateRequest.cc
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/DisableAlertTemplateRequest.h>
|
||||
|
||||
using AlibabaCloud::ARMS::Model::DisableAlertTemplateRequest;
|
||||
|
||||
DisableAlertTemplateRequest::DisableAlertTemplateRequest() :
|
||||
RpcServiceRequest("arms", "2019-08-08", "DisableAlertTemplate")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DisableAlertTemplateRequest::~DisableAlertTemplateRequest()
|
||||
{}
|
||||
|
||||
std::string DisableAlertTemplateRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void DisableAlertTemplateRequest::setRegionId(const std::string& regionId)
|
||||
{
|
||||
regionId_ = regionId;
|
||||
setParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
long DisableAlertTemplateRequest::getId()const
|
||||
{
|
||||
return id_;
|
||||
}
|
||||
|
||||
void DisableAlertTemplateRequest::setId(long id)
|
||||
{
|
||||
id_ = id;
|
||||
setParameter("Id", std::to_string(id));
|
||||
}
|
||||
|
||||
std::string DisableAlertTemplateRequest::getProxyUserId()const
|
||||
{
|
||||
return proxyUserId_;
|
||||
}
|
||||
|
||||
void DisableAlertTemplateRequest::setProxyUserId(const std::string& proxyUserId)
|
||||
{
|
||||
proxyUserId_ = proxyUserId;
|
||||
setParameter("ProxyUserId", proxyUserId);
|
||||
}
|
||||
|
||||
51
arms/src/model/DisableAlertTemplateResult.cc
Normal file
51
arms/src/model/DisableAlertTemplateResult.cc
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/DisableAlertTemplateResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::ARMS;
|
||||
using namespace AlibabaCloud::ARMS::Model;
|
||||
|
||||
DisableAlertTemplateResult::DisableAlertTemplateResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
DisableAlertTemplateResult::DisableAlertTemplateResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DisableAlertTemplateResult::~DisableAlertTemplateResult()
|
||||
{}
|
||||
|
||||
void DisableAlertTemplateResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
|
||||
}
|
||||
|
||||
bool DisableAlertTemplateResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
62
arms/src/model/EnableAlertTemplateRequest.cc
Normal file
62
arms/src/model/EnableAlertTemplateRequest.cc
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/EnableAlertTemplateRequest.h>
|
||||
|
||||
using AlibabaCloud::ARMS::Model::EnableAlertTemplateRequest;
|
||||
|
||||
EnableAlertTemplateRequest::EnableAlertTemplateRequest() :
|
||||
RpcServiceRequest("arms", "2019-08-08", "EnableAlertTemplate")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
EnableAlertTemplateRequest::~EnableAlertTemplateRequest()
|
||||
{}
|
||||
|
||||
std::string EnableAlertTemplateRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void EnableAlertTemplateRequest::setRegionId(const std::string& regionId)
|
||||
{
|
||||
regionId_ = regionId;
|
||||
setParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
long EnableAlertTemplateRequest::getId()const
|
||||
{
|
||||
return id_;
|
||||
}
|
||||
|
||||
void EnableAlertTemplateRequest::setId(long id)
|
||||
{
|
||||
id_ = id;
|
||||
setParameter("Id", std::to_string(id));
|
||||
}
|
||||
|
||||
std::string EnableAlertTemplateRequest::getProxyUserId()const
|
||||
{
|
||||
return proxyUserId_;
|
||||
}
|
||||
|
||||
void EnableAlertTemplateRequest::setProxyUserId(const std::string& proxyUserId)
|
||||
{
|
||||
proxyUserId_ = proxyUserId;
|
||||
setParameter("ProxyUserId", proxyUserId);
|
||||
}
|
||||
|
||||
51
arms/src/model/EnableAlertTemplateResult.cc
Normal file
51
arms/src/model/EnableAlertTemplateResult.cc
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/EnableAlertTemplateResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::ARMS;
|
||||
using namespace AlibabaCloud::ARMS::Model;
|
||||
|
||||
EnableAlertTemplateResult::EnableAlertTemplateResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
EnableAlertTemplateResult::EnableAlertTemplateResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
EnableAlertTemplateResult::~EnableAlertTemplateResult()
|
||||
{}
|
||||
|
||||
void EnableAlertTemplateResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
|
||||
}
|
||||
|
||||
bool EnableAlertTemplateResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
84
arms/src/model/ListActivatedAlertsRequest.cc
Normal file
84
arms/src/model/ListActivatedAlertsRequest.cc
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/ListActivatedAlertsRequest.h>
|
||||
|
||||
using AlibabaCloud::ARMS::Model::ListActivatedAlertsRequest;
|
||||
|
||||
ListActivatedAlertsRequest::ListActivatedAlertsRequest() :
|
||||
RpcServiceRequest("arms", "2019-08-08", "ListActivatedAlerts")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ListActivatedAlertsRequest::~ListActivatedAlertsRequest()
|
||||
{}
|
||||
|
||||
std::string ListActivatedAlertsRequest::getFilter()const
|
||||
{
|
||||
return filter_;
|
||||
}
|
||||
|
||||
void ListActivatedAlertsRequest::setFilter(const std::string& filter)
|
||||
{
|
||||
filter_ = filter;
|
||||
setParameter("Filter", filter);
|
||||
}
|
||||
|
||||
std::string ListActivatedAlertsRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void ListActivatedAlertsRequest::setRegionId(const std::string& regionId)
|
||||
{
|
||||
regionId_ = regionId;
|
||||
setParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
int ListActivatedAlertsRequest::getPageSize()const
|
||||
{
|
||||
return pageSize_;
|
||||
}
|
||||
|
||||
void ListActivatedAlertsRequest::setPageSize(int pageSize)
|
||||
{
|
||||
pageSize_ = pageSize;
|
||||
setParameter("PageSize", std::to_string(pageSize));
|
||||
}
|
||||
|
||||
int ListActivatedAlertsRequest::getCurrentPage()const
|
||||
{
|
||||
return currentPage_;
|
||||
}
|
||||
|
||||
void ListActivatedAlertsRequest::setCurrentPage(int currentPage)
|
||||
{
|
||||
currentPage_ = currentPage;
|
||||
setParameter("CurrentPage", std::to_string(currentPage));
|
||||
}
|
||||
|
||||
std::string ListActivatedAlertsRequest::getProxyUserId()const
|
||||
{
|
||||
return proxyUserId_;
|
||||
}
|
||||
|
||||
void ListActivatedAlertsRequest::setProxyUserId(const std::string& proxyUserId)
|
||||
{
|
||||
proxyUserId_ = proxyUserId;
|
||||
setParameter("ProxyUserId", proxyUserId);
|
||||
}
|
||||
|
||||
102
arms/src/model/ListActivatedAlertsResult.cc
Normal file
102
arms/src/model/ListActivatedAlertsResult.cc
Normal file
@@ -0,0 +1,102 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/ListActivatedAlertsResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::ARMS;
|
||||
using namespace AlibabaCloud::ARMS::Model;
|
||||
|
||||
ListActivatedAlertsResult::ListActivatedAlertsResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListActivatedAlertsResult::ListActivatedAlertsResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListActivatedAlertsResult::~ListActivatedAlertsResult()
|
||||
{}
|
||||
|
||||
void ListActivatedAlertsResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto pageNode = value["Page"];
|
||||
if(!pageNode["Page"].isNull())
|
||||
page_.page = std::stoi(pageNode["Page"].asString());
|
||||
if(!pageNode["PageSize"].isNull())
|
||||
page_.pageSize = std::stoi(pageNode["PageSize"].asString());
|
||||
if(!pageNode["Total"].isNull())
|
||||
page_.total = std::stoi(pageNode["Total"].asString());
|
||||
auto allAlertsNode = pageNode["Alerts"]["Alert"];
|
||||
for (auto pageNodeAlertsAlert : allAlertsNode)
|
||||
{
|
||||
Page::Alert alertObject;
|
||||
if(!pageNodeAlertsAlert["AlertName"].isNull())
|
||||
alertObject.alertName = pageNodeAlertsAlert["AlertName"].asString();
|
||||
if(!pageNodeAlertsAlert["AlertType"].isNull())
|
||||
alertObject.alertType = pageNodeAlertsAlert["AlertType"].asString();
|
||||
if(!pageNodeAlertsAlert["Count"].isNull())
|
||||
alertObject.count = std::stoi(pageNodeAlertsAlert["Count"].asString());
|
||||
if(!pageNodeAlertsAlert["CreateTime"].isNull())
|
||||
alertObject.createTime = std::stol(pageNodeAlertsAlert["CreateTime"].asString());
|
||||
if(!pageNodeAlertsAlert["EndsAt"].isNull())
|
||||
alertObject.endsAt = std::stol(pageNodeAlertsAlert["EndsAt"].asString());
|
||||
if(!pageNodeAlertsAlert["ExpandFields"].isNull())
|
||||
alertObject.expandFields = pageNodeAlertsAlert["ExpandFields"].asString();
|
||||
if(!pageNodeAlertsAlert["AlertId"].isNull())
|
||||
alertObject.alertId = pageNodeAlertsAlert["AlertId"].asString();
|
||||
if(!pageNodeAlertsAlert["IntegrationName"].isNull())
|
||||
alertObject.integrationName = pageNodeAlertsAlert["IntegrationName"].asString();
|
||||
if(!pageNodeAlertsAlert["IntegrationType"].isNull())
|
||||
alertObject.integrationType = pageNodeAlertsAlert["IntegrationType"].asString();
|
||||
if(!pageNodeAlertsAlert["InvolvedObjectKind"].isNull())
|
||||
alertObject.involvedObjectKind = pageNodeAlertsAlert["InvolvedObjectKind"].asString();
|
||||
if(!pageNodeAlertsAlert["InvolvedObjectName"].isNull())
|
||||
alertObject.involvedObjectName = pageNodeAlertsAlert["InvolvedObjectName"].asString();
|
||||
if(!pageNodeAlertsAlert["Message"].isNull())
|
||||
alertObject.message = pageNodeAlertsAlert["Message"].asString();
|
||||
if(!pageNodeAlertsAlert["Severity"].isNull())
|
||||
alertObject.severity = pageNodeAlertsAlert["Severity"].asString();
|
||||
if(!pageNodeAlertsAlert["StartsAt"].isNull())
|
||||
alertObject.startsAt = std::stol(pageNodeAlertsAlert["StartsAt"].asString());
|
||||
if(!pageNodeAlertsAlert["Status"].isNull())
|
||||
alertObject.status = pageNodeAlertsAlert["Status"].asString();
|
||||
auto allDispatchRulesNode = pageNodeAlertsAlert["DispatchRules"]["DispatchRule"];
|
||||
for (auto pageNodeAlertsAlertDispatchRulesDispatchRule : allDispatchRulesNode)
|
||||
{
|
||||
Page::Alert::DispatchRule dispatchRulesObject;
|
||||
if(!pageNodeAlertsAlertDispatchRulesDispatchRule["RuleName"].isNull())
|
||||
dispatchRulesObject.ruleName = pageNodeAlertsAlertDispatchRulesDispatchRule["RuleName"].asString();
|
||||
if(!pageNodeAlertsAlertDispatchRulesDispatchRule["RuleId"].isNull())
|
||||
dispatchRulesObject.ruleId = std::stoi(pageNodeAlertsAlertDispatchRulesDispatchRule["RuleId"].asString());
|
||||
alertObject.dispatchRules.push_back(dispatchRulesObject);
|
||||
}
|
||||
page_.alerts.push_back(alertObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ListActivatedAlertsResult::Page ListActivatedAlertsResult::getPage()const
|
||||
{
|
||||
return page_;
|
||||
}
|
||||
|
||||
117
arms/src/model/ListAlertTemplatesRequest.cc
Normal file
117
arms/src/model/ListAlertTemplatesRequest.cc
Normal file
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/ListAlertTemplatesRequest.h>
|
||||
|
||||
using AlibabaCloud::ARMS::Model::ListAlertTemplatesRequest;
|
||||
|
||||
ListAlertTemplatesRequest::ListAlertTemplatesRequest() :
|
||||
RpcServiceRequest("arms", "2019-08-08", "ListAlertTemplates")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ListAlertTemplatesRequest::~ListAlertTemplatesRequest()
|
||||
{}
|
||||
|
||||
std::string ListAlertTemplatesRequest::getAlertProvider()const
|
||||
{
|
||||
return alertProvider_;
|
||||
}
|
||||
|
||||
void ListAlertTemplatesRequest::setAlertProvider(const std::string& alertProvider)
|
||||
{
|
||||
alertProvider_ = alertProvider;
|
||||
setParameter("AlertProvider", alertProvider);
|
||||
}
|
||||
|
||||
std::string ListAlertTemplatesRequest::getTemplateProvider()const
|
||||
{
|
||||
return templateProvider_;
|
||||
}
|
||||
|
||||
void ListAlertTemplatesRequest::setTemplateProvider(const std::string& templateProvider)
|
||||
{
|
||||
templateProvider_ = templateProvider;
|
||||
setParameter("TemplateProvider", templateProvider);
|
||||
}
|
||||
|
||||
std::string ListAlertTemplatesRequest::getProxyUserId()const
|
||||
{
|
||||
return proxyUserId_;
|
||||
}
|
||||
|
||||
void ListAlertTemplatesRequest::setProxyUserId(const std::string& proxyUserId)
|
||||
{
|
||||
proxyUserId_ = proxyUserId;
|
||||
setParameter("ProxyUserId", proxyUserId);
|
||||
}
|
||||
|
||||
std::string ListAlertTemplatesRequest::getType()const
|
||||
{
|
||||
return type_;
|
||||
}
|
||||
|
||||
void ListAlertTemplatesRequest::setType(const std::string& type)
|
||||
{
|
||||
type_ = type;
|
||||
setParameter("Type", type);
|
||||
}
|
||||
|
||||
std::string ListAlertTemplatesRequest::getLabels()const
|
||||
{
|
||||
return labels_;
|
||||
}
|
||||
|
||||
void ListAlertTemplatesRequest::setLabels(const std::string& labels)
|
||||
{
|
||||
labels_ = labels;
|
||||
setParameter("Labels", labels);
|
||||
}
|
||||
|
||||
std::string ListAlertTemplatesRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void ListAlertTemplatesRequest::setRegionId(const std::string& regionId)
|
||||
{
|
||||
regionId_ = regionId;
|
||||
setParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
std::string ListAlertTemplatesRequest::getName()const
|
||||
{
|
||||
return name_;
|
||||
}
|
||||
|
||||
void ListAlertTemplatesRequest::setName(const std::string& name)
|
||||
{
|
||||
name_ = name;
|
||||
setParameter("Name", name);
|
||||
}
|
||||
|
||||
bool ListAlertTemplatesRequest::getStatus()const
|
||||
{
|
||||
return status_;
|
||||
}
|
||||
|
||||
void ListAlertTemplatesRequest::setStatus(bool status)
|
||||
{
|
||||
status_ = status;
|
||||
setParameter("Status", status ? "true" : "false");
|
||||
}
|
||||
|
||||
100
arms/src/model/ListAlertTemplatesResult.cc
Normal file
100
arms/src/model/ListAlertTemplatesResult.cc
Normal file
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/ListAlertTemplatesResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::ARMS;
|
||||
using namespace AlibabaCloud::ARMS::Model;
|
||||
|
||||
ListAlertTemplatesResult::ListAlertTemplatesResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListAlertTemplatesResult::ListAlertTemplatesResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListAlertTemplatesResult::~ListAlertTemplatesResult()
|
||||
{}
|
||||
|
||||
void ListAlertTemplatesResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allAlertTemplatesNode = value["AlertTemplates"]["AlertTemplate"];
|
||||
for (auto valueAlertTemplatesAlertTemplate : allAlertTemplatesNode)
|
||||
{
|
||||
AlertTemplate alertTemplatesObject;
|
||||
if(!valueAlertTemplatesAlertTemplate["Id"].isNull())
|
||||
alertTemplatesObject.id = std::stoi(valueAlertTemplatesAlertTemplate["Id"].asString());
|
||||
if(!valueAlertTemplatesAlertTemplate["ParentId"].isNull())
|
||||
alertTemplatesObject.parentId = std::stoi(valueAlertTemplatesAlertTemplate["ParentId"].asString());
|
||||
if(!valueAlertTemplatesAlertTemplate["Name"].isNull())
|
||||
alertTemplatesObject.name = valueAlertTemplatesAlertTemplate["Name"].asString();
|
||||
if(!valueAlertTemplatesAlertTemplate["Message"].isNull())
|
||||
alertTemplatesObject.message = valueAlertTemplatesAlertTemplate["Message"].asString();
|
||||
if(!valueAlertTemplatesAlertTemplate["AlertProvider"].isNull())
|
||||
alertTemplatesObject.alertProvider = valueAlertTemplatesAlertTemplate["AlertProvider"].asString();
|
||||
if(!valueAlertTemplatesAlertTemplate["TemplateProvider"].isNull())
|
||||
alertTemplatesObject.templateProvider = valueAlertTemplatesAlertTemplate["TemplateProvider"].asString();
|
||||
if(!valueAlertTemplatesAlertTemplate["Type"].isNull())
|
||||
alertTemplatesObject.type = valueAlertTemplatesAlertTemplate["Type"].asString();
|
||||
if(!valueAlertTemplatesAlertTemplate["Labels"].isNull())
|
||||
alertTemplatesObject.labels = valueAlertTemplatesAlertTemplate["Labels"].asString();
|
||||
if(!valueAlertTemplatesAlertTemplate["Annotations"].isNull())
|
||||
alertTemplatesObject.annotations = valueAlertTemplatesAlertTemplate["Annotations"].asString();
|
||||
if(!valueAlertTemplatesAlertTemplate["Rule"].isNull())
|
||||
alertTemplatesObject.rule = valueAlertTemplatesAlertTemplate["Rule"].asString();
|
||||
if(!valueAlertTemplatesAlertTemplate["UserId"].isNull())
|
||||
alertTemplatesObject.userId = valueAlertTemplatesAlertTemplate["UserId"].asString();
|
||||
if(!valueAlertTemplatesAlertTemplate["Status"].isNull())
|
||||
alertTemplatesObject.status = valueAlertTemplatesAlertTemplate["Status"].asString() == "true";
|
||||
if(!valueAlertTemplatesAlertTemplate["Public"].isNull())
|
||||
alertTemplatesObject._public = valueAlertTemplatesAlertTemplate["Public"].asString() == "true";
|
||||
auto labelMatchExpressionGridNode = value["LabelMatchExpressionGrid"];
|
||||
auto allLabelMatchExpressionGroupsNode = labelMatchExpressionGridNode["LabelMatchExpressionGroups"]["LabelMatchExpressionGroup"];
|
||||
for (auto labelMatchExpressionGridNodeLabelMatchExpressionGroupsLabelMatchExpressionGroup : allLabelMatchExpressionGroupsNode)
|
||||
{
|
||||
AlertTemplate::LabelMatchExpressionGrid::LabelMatchExpressionGroup labelMatchExpressionGroupObject;
|
||||
auto allLabelMatchExpressionsNode = labelMatchExpressionGridNodeLabelMatchExpressionGroupsLabelMatchExpressionGroup["LabelMatchExpressions"]["LabelMatchExpression"];
|
||||
for (auto labelMatchExpressionGridNodeLabelMatchExpressionGroupsLabelMatchExpressionGroupLabelMatchExpressionsLabelMatchExpression : allLabelMatchExpressionsNode)
|
||||
{
|
||||
AlertTemplate::LabelMatchExpressionGrid::LabelMatchExpressionGroup::LabelMatchExpression labelMatchExpressionsObject;
|
||||
if(!labelMatchExpressionGridNodeLabelMatchExpressionGroupsLabelMatchExpressionGroupLabelMatchExpressionsLabelMatchExpression["Key"].isNull())
|
||||
labelMatchExpressionsObject.key = labelMatchExpressionGridNodeLabelMatchExpressionGroupsLabelMatchExpressionGroupLabelMatchExpressionsLabelMatchExpression["Key"].asString();
|
||||
if(!labelMatchExpressionGridNodeLabelMatchExpressionGroupsLabelMatchExpressionGroupLabelMatchExpressionsLabelMatchExpression["Value"].isNull())
|
||||
labelMatchExpressionsObject.value = labelMatchExpressionGridNodeLabelMatchExpressionGroupsLabelMatchExpressionGroupLabelMatchExpressionsLabelMatchExpression["Value"].asString();
|
||||
if(!labelMatchExpressionGridNodeLabelMatchExpressionGroupsLabelMatchExpressionGroupLabelMatchExpressionsLabelMatchExpression["Operator"].isNull())
|
||||
labelMatchExpressionsObject._operator = labelMatchExpressionGridNodeLabelMatchExpressionGroupsLabelMatchExpressionGroupLabelMatchExpressionsLabelMatchExpression["Operator"].asString();
|
||||
labelMatchExpressionGroupObject.labelMatchExpressions.push_back(labelMatchExpressionsObject);
|
||||
}
|
||||
alertTemplatesObject.labelMatchExpressionGrid.labelMatchExpressionGroups.push_back(labelMatchExpressionGroupObject);
|
||||
}
|
||||
alertTemplates_.push_back(alertTemplatesObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
std::vector<ListAlertTemplatesResult::AlertTemplate> ListAlertTemplatesResult::getAlertTemplates()const
|
||||
{
|
||||
return alertTemplates_;
|
||||
}
|
||||
|
||||
@@ -27,26 +27,37 @@ ListDashboardsRequest::ListDashboardsRequest() :
|
||||
ListDashboardsRequest::~ListDashboardsRequest()
|
||||
{}
|
||||
|
||||
std::string ListDashboardsRequest::getClusterType()const
|
||||
std::string ListDashboardsRequest::getDashboardName()const
|
||||
{
|
||||
return clusterType_;
|
||||
return dashboardName_;
|
||||
}
|
||||
|
||||
void ListDashboardsRequest::setClusterType(const std::string& clusterType)
|
||||
void ListDashboardsRequest::setDashboardName(const std::string& dashboardName)
|
||||
{
|
||||
clusterType_ = clusterType;
|
||||
setParameter("ClusterType", clusterType);
|
||||
dashboardName_ = dashboardName;
|
||||
setParameter("DashboardName", dashboardName);
|
||||
}
|
||||
|
||||
std::string ListDashboardsRequest::getRegionId()const
|
||||
std::string ListDashboardsRequest::getProduct()const
|
||||
{
|
||||
return regionId_;
|
||||
return product_;
|
||||
}
|
||||
|
||||
void ListDashboardsRequest::setRegionId(const std::string& regionId)
|
||||
void ListDashboardsRequest::setProduct(const std::string& product)
|
||||
{
|
||||
regionId_ = regionId;
|
||||
setParameter("RegionId", regionId);
|
||||
product_ = product;
|
||||
setParameter("Product", product);
|
||||
}
|
||||
|
||||
bool ListDashboardsRequest::getRecreateSwitch()const
|
||||
{
|
||||
return recreateSwitch_;
|
||||
}
|
||||
|
||||
void ListDashboardsRequest::setRecreateSwitch(bool recreateSwitch)
|
||||
{
|
||||
recreateSwitch_ = recreateSwitch;
|
||||
setParameter("RecreateSwitch", recreateSwitch ? "true" : "false");
|
||||
}
|
||||
|
||||
std::string ListDashboardsRequest::getClusterId()const
|
||||
@@ -71,3 +82,25 @@ void ListDashboardsRequest::setTitle(const std::string& title)
|
||||
setParameter("Title", title);
|
||||
}
|
||||
|
||||
std::string ListDashboardsRequest::getClusterType()const
|
||||
{
|
||||
return clusterType_;
|
||||
}
|
||||
|
||||
void ListDashboardsRequest::setClusterType(const std::string& clusterType)
|
||||
{
|
||||
clusterType_ = clusterType;
|
||||
setParameter("ClusterType", clusterType);
|
||||
}
|
||||
|
||||
std::string ListDashboardsRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void ListDashboardsRequest::setRegionId(const std::string& regionId)
|
||||
{
|
||||
regionId_ = regionId;
|
||||
setParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
|
||||
@@ -59,6 +59,16 @@ void ListDashboardsResult::parse(const std::string &payload)
|
||||
dashboardVosObject.exporter = valueDashboardVosDashboardVosItem["Exporter"].asString();
|
||||
if(!valueDashboardVosDashboardVosItem["IsArmsExporter"].isNull())
|
||||
dashboardVosObject.isArmsExporter = valueDashboardVosDashboardVosItem["IsArmsExporter"].asString() == "true";
|
||||
if(!valueDashboardVosDashboardVosItem["Name"].isNull())
|
||||
dashboardVosObject.name = valueDashboardVosDashboardVosItem["Name"].asString();
|
||||
if(!valueDashboardVosDashboardVosItem["Version"].isNull())
|
||||
dashboardVosObject.version = valueDashboardVosDashboardVosItem["Version"].asString();
|
||||
if(!valueDashboardVosDashboardVosItem["DashboardType"].isNull())
|
||||
dashboardVosObject.dashboardType = valueDashboardVosDashboardVosItem["DashboardType"].asString();
|
||||
if(!valueDashboardVosDashboardVosItem["Kind"].isNull())
|
||||
dashboardVosObject.kind = valueDashboardVosDashboardVosItem["Kind"].asString();
|
||||
if(!valueDashboardVosDashboardVosItem["NeedUpdate"].isNull())
|
||||
dashboardVosObject.needUpdate = valueDashboardVosDashboardVosItem["NeedUpdate"].asString() == "true";
|
||||
auto allTags = value["Tags"]["Tags"];
|
||||
for (auto value : allTags)
|
||||
dashboardVosObject.tags.push_back(value.asString());
|
||||
|
||||
106
arms/src/model/ListPrometheusAlertRulesRequest.cc
Normal file
106
arms/src/model/ListPrometheusAlertRulesRequest.cc
Normal file
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/ListPrometheusAlertRulesRequest.h>
|
||||
|
||||
using AlibabaCloud::ARMS::Model::ListPrometheusAlertRulesRequest;
|
||||
|
||||
ListPrometheusAlertRulesRequest::ListPrometheusAlertRulesRequest() :
|
||||
RpcServiceRequest("arms", "2019-08-08", "ListPrometheusAlertRules")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ListPrometheusAlertRulesRequest::~ListPrometheusAlertRulesRequest()
|
||||
{}
|
||||
|
||||
std::string ListPrometheusAlertRulesRequest::getClusterId()const
|
||||
{
|
||||
return clusterId_;
|
||||
}
|
||||
|
||||
void ListPrometheusAlertRulesRequest::setClusterId(const std::string& clusterId)
|
||||
{
|
||||
clusterId_ = clusterId;
|
||||
setParameter("ClusterId", clusterId);
|
||||
}
|
||||
|
||||
std::string ListPrometheusAlertRulesRequest::getProxyUserId()const
|
||||
{
|
||||
return proxyUserId_;
|
||||
}
|
||||
|
||||
void ListPrometheusAlertRulesRequest::setProxyUserId(const std::string& proxyUserId)
|
||||
{
|
||||
proxyUserId_ = proxyUserId;
|
||||
setParameter("ProxyUserId", proxyUserId);
|
||||
}
|
||||
|
||||
std::string ListPrometheusAlertRulesRequest::getType()const
|
||||
{
|
||||
return type_;
|
||||
}
|
||||
|
||||
void ListPrometheusAlertRulesRequest::setType(const std::string& type)
|
||||
{
|
||||
type_ = type;
|
||||
setParameter("Type", type);
|
||||
}
|
||||
|
||||
std::string ListPrometheusAlertRulesRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void ListPrometheusAlertRulesRequest::setRegionId(const std::string& regionId)
|
||||
{
|
||||
regionId_ = regionId;
|
||||
setParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
std::string ListPrometheusAlertRulesRequest::getName()const
|
||||
{
|
||||
return name_;
|
||||
}
|
||||
|
||||
void ListPrometheusAlertRulesRequest::setName(const std::string& name)
|
||||
{
|
||||
name_ = name;
|
||||
setParameter("Name", name);
|
||||
}
|
||||
|
||||
std::string ListPrometheusAlertRulesRequest::getMatchExpressions()const
|
||||
{
|
||||
return matchExpressions_;
|
||||
}
|
||||
|
||||
void ListPrometheusAlertRulesRequest::setMatchExpressions(const std::string& matchExpressions)
|
||||
{
|
||||
matchExpressions_ = matchExpressions;
|
||||
setParameter("MatchExpressions", matchExpressions);
|
||||
}
|
||||
|
||||
int ListPrometheusAlertRulesRequest::getStatus()const
|
||||
{
|
||||
return status_;
|
||||
}
|
||||
|
||||
void ListPrometheusAlertRulesRequest::setStatus(int status)
|
||||
{
|
||||
status_ = status;
|
||||
setParameter("Status", std::to_string(status));
|
||||
}
|
||||
|
||||
95
arms/src/model/ListPrometheusAlertRulesResult.cc
Normal file
95
arms/src/model/ListPrometheusAlertRulesResult.cc
Normal file
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/ListPrometheusAlertRulesResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::ARMS;
|
||||
using namespace AlibabaCloud::ARMS::Model;
|
||||
|
||||
ListPrometheusAlertRulesResult::ListPrometheusAlertRulesResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListPrometheusAlertRulesResult::ListPrometheusAlertRulesResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListPrometheusAlertRulesResult::~ListPrometheusAlertRulesResult()
|
||||
{}
|
||||
|
||||
void ListPrometheusAlertRulesResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allPrometheusAlertRulesNode = value["PrometheusAlertRules"]["PrometheusAlertRule"];
|
||||
for (auto valuePrometheusAlertRulesPrometheusAlertRule : allPrometheusAlertRulesNode)
|
||||
{
|
||||
PrometheusAlertRule prometheusAlertRulesObject;
|
||||
if(!valuePrometheusAlertRulesPrometheusAlertRule["AlertId"].isNull())
|
||||
prometheusAlertRulesObject.alertId = std::stol(valuePrometheusAlertRulesPrometheusAlertRule["AlertId"].asString());
|
||||
if(!valuePrometheusAlertRulesPrometheusAlertRule["AlertName"].isNull())
|
||||
prometheusAlertRulesObject.alertName = valuePrometheusAlertRulesPrometheusAlertRule["AlertName"].asString();
|
||||
if(!valuePrometheusAlertRulesPrometheusAlertRule["Message"].isNull())
|
||||
prometheusAlertRulesObject.message = valuePrometheusAlertRulesPrometheusAlertRule["Message"].asString();
|
||||
if(!valuePrometheusAlertRulesPrometheusAlertRule["Type"].isNull())
|
||||
prometheusAlertRulesObject.type = valuePrometheusAlertRulesPrometheusAlertRule["Type"].asString();
|
||||
if(!valuePrometheusAlertRulesPrometheusAlertRule["Expression"].isNull())
|
||||
prometheusAlertRulesObject.expression = valuePrometheusAlertRulesPrometheusAlertRule["Expression"].asString();
|
||||
if(!valuePrometheusAlertRulesPrometheusAlertRule["Duration"].isNull())
|
||||
prometheusAlertRulesObject.duration = valuePrometheusAlertRulesPrometheusAlertRule["Duration"].asString();
|
||||
if(!valuePrometheusAlertRulesPrometheusAlertRule["ClusterId"].isNull())
|
||||
prometheusAlertRulesObject.clusterId = valuePrometheusAlertRulesPrometheusAlertRule["ClusterId"].asString();
|
||||
if(!valuePrometheusAlertRulesPrometheusAlertRule["Status"].isNull())
|
||||
prometheusAlertRulesObject.status = std::stoi(valuePrometheusAlertRulesPrometheusAlertRule["Status"].asString());
|
||||
if(!valuePrometheusAlertRulesPrometheusAlertRule["DispatchRuleId"].isNull())
|
||||
prometheusAlertRulesObject.dispatchRuleId = std::stol(valuePrometheusAlertRulesPrometheusAlertRule["DispatchRuleId"].asString());
|
||||
if(!valuePrometheusAlertRulesPrometheusAlertRule["NotifyType"].isNull())
|
||||
prometheusAlertRulesObject.notifyType = valuePrometheusAlertRulesPrometheusAlertRule["NotifyType"].asString();
|
||||
auto allLabelsNode = valuePrometheusAlertRulesPrometheusAlertRule["Labels"]["Label"];
|
||||
for (auto valuePrometheusAlertRulesPrometheusAlertRuleLabelsLabel : allLabelsNode)
|
||||
{
|
||||
PrometheusAlertRule::Label labelsObject;
|
||||
if(!valuePrometheusAlertRulesPrometheusAlertRuleLabelsLabel["Name"].isNull())
|
||||
labelsObject.name = valuePrometheusAlertRulesPrometheusAlertRuleLabelsLabel["Name"].asString();
|
||||
if(!valuePrometheusAlertRulesPrometheusAlertRuleLabelsLabel["Value"].isNull())
|
||||
labelsObject.value = valuePrometheusAlertRulesPrometheusAlertRuleLabelsLabel["Value"].asString();
|
||||
prometheusAlertRulesObject.labels.push_back(labelsObject);
|
||||
}
|
||||
auto allAnnotationsNode = valuePrometheusAlertRulesPrometheusAlertRule["Annotations"]["Annotation"];
|
||||
for (auto valuePrometheusAlertRulesPrometheusAlertRuleAnnotationsAnnotation : allAnnotationsNode)
|
||||
{
|
||||
PrometheusAlertRule::Annotation annotationsObject;
|
||||
if(!valuePrometheusAlertRulesPrometheusAlertRuleAnnotationsAnnotation["Name"].isNull())
|
||||
annotationsObject.name = valuePrometheusAlertRulesPrometheusAlertRuleAnnotationsAnnotation["Name"].asString();
|
||||
if(!valuePrometheusAlertRulesPrometheusAlertRuleAnnotationsAnnotation["Value"].isNull())
|
||||
annotationsObject.value = valuePrometheusAlertRulesPrometheusAlertRuleAnnotationsAnnotation["Value"].asString();
|
||||
prometheusAlertRulesObject.annotations.push_back(annotationsObject);
|
||||
}
|
||||
prometheusAlertRules_.push_back(prometheusAlertRulesObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
std::vector<ListPrometheusAlertRulesResult::PrometheusAlertRule> ListPrometheusAlertRulesResult::getPrometheusAlertRules()const
|
||||
{
|
||||
return prometheusAlertRules_;
|
||||
}
|
||||
|
||||
73
arms/src/model/ListPrometheusAlertTemplatesRequest.cc
Normal file
73
arms/src/model/ListPrometheusAlertTemplatesRequest.cc
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/ListPrometheusAlertTemplatesRequest.h>
|
||||
|
||||
using AlibabaCloud::ARMS::Model::ListPrometheusAlertTemplatesRequest;
|
||||
|
||||
ListPrometheusAlertTemplatesRequest::ListPrometheusAlertTemplatesRequest() :
|
||||
RpcServiceRequest("arms", "2019-08-08", "ListPrometheusAlertTemplates")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ListPrometheusAlertTemplatesRequest::~ListPrometheusAlertTemplatesRequest()
|
||||
{}
|
||||
|
||||
std::string ListPrometheusAlertTemplatesRequest::getProductCode()const
|
||||
{
|
||||
return productCode_;
|
||||
}
|
||||
|
||||
void ListPrometheusAlertTemplatesRequest::setProductCode(const std::string& productCode)
|
||||
{
|
||||
productCode_ = productCode;
|
||||
setParameter("ProductCode", productCode);
|
||||
}
|
||||
|
||||
std::string ListPrometheusAlertTemplatesRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void ListPrometheusAlertTemplatesRequest::setRegionId(const std::string& regionId)
|
||||
{
|
||||
regionId_ = regionId;
|
||||
setParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
std::string ListPrometheusAlertTemplatesRequest::getClusterId()const
|
||||
{
|
||||
return clusterId_;
|
||||
}
|
||||
|
||||
void ListPrometheusAlertTemplatesRequest::setClusterId(const std::string& clusterId)
|
||||
{
|
||||
clusterId_ = clusterId;
|
||||
setParameter("ClusterId", clusterId);
|
||||
}
|
||||
|
||||
std::string ListPrometheusAlertTemplatesRequest::getProxyUserId()const
|
||||
{
|
||||
return proxyUserId_;
|
||||
}
|
||||
|
||||
void ListPrometheusAlertTemplatesRequest::setProxyUserId(const std::string& proxyUserId)
|
||||
{
|
||||
proxyUserId_ = proxyUserId;
|
||||
setParameter("ProxyUserId", proxyUserId);
|
||||
}
|
||||
|
||||
87
arms/src/model/ListPrometheusAlertTemplatesResult.cc
Normal file
87
arms/src/model/ListPrometheusAlertTemplatesResult.cc
Normal file
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/ListPrometheusAlertTemplatesResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::ARMS;
|
||||
using namespace AlibabaCloud::ARMS::Model;
|
||||
|
||||
ListPrometheusAlertTemplatesResult::ListPrometheusAlertTemplatesResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListPrometheusAlertTemplatesResult::ListPrometheusAlertTemplatesResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListPrometheusAlertTemplatesResult::~ListPrometheusAlertTemplatesResult()
|
||||
{}
|
||||
|
||||
void ListPrometheusAlertTemplatesResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allPrometheusAlertTemplatesNode = value["PrometheusAlertTemplates"]["PrometheusAlertTemplate"];
|
||||
for (auto valuePrometheusAlertTemplatesPrometheusAlertTemplate : allPrometheusAlertTemplatesNode)
|
||||
{
|
||||
PrometheusAlertTemplate prometheusAlertTemplatesObject;
|
||||
if(!valuePrometheusAlertTemplatesPrometheusAlertTemplate["AlertName"].isNull())
|
||||
prometheusAlertTemplatesObject.alertName = valuePrometheusAlertTemplatesPrometheusAlertTemplate["AlertName"].asString();
|
||||
if(!valuePrometheusAlertTemplatesPrometheusAlertTemplate["Description"].isNull())
|
||||
prometheusAlertTemplatesObject.description = valuePrometheusAlertTemplatesPrometheusAlertTemplate["Description"].asString();
|
||||
if(!valuePrometheusAlertTemplatesPrometheusAlertTemplate["Type"].isNull())
|
||||
prometheusAlertTemplatesObject.type = valuePrometheusAlertTemplatesPrometheusAlertTemplate["Type"].asString();
|
||||
if(!valuePrometheusAlertTemplatesPrometheusAlertTemplate["Expression"].isNull())
|
||||
prometheusAlertTemplatesObject.expression = valuePrometheusAlertTemplatesPrometheusAlertTemplate["Expression"].asString();
|
||||
if(!valuePrometheusAlertTemplatesPrometheusAlertTemplate["Duration"].isNull())
|
||||
prometheusAlertTemplatesObject.duration = valuePrometheusAlertTemplatesPrometheusAlertTemplate["Duration"].asString();
|
||||
if(!valuePrometheusAlertTemplatesPrometheusAlertTemplate["Version"].isNull())
|
||||
prometheusAlertTemplatesObject.version = valuePrometheusAlertTemplatesPrometheusAlertTemplate["Version"].asString();
|
||||
auto allLabelsNode = valuePrometheusAlertTemplatesPrometheusAlertTemplate["Labels"]["Label"];
|
||||
for (auto valuePrometheusAlertTemplatesPrometheusAlertTemplateLabelsLabel : allLabelsNode)
|
||||
{
|
||||
PrometheusAlertTemplate::Label labelsObject;
|
||||
if(!valuePrometheusAlertTemplatesPrometheusAlertTemplateLabelsLabel["Name"].isNull())
|
||||
labelsObject.name = valuePrometheusAlertTemplatesPrometheusAlertTemplateLabelsLabel["Name"].asString();
|
||||
if(!valuePrometheusAlertTemplatesPrometheusAlertTemplateLabelsLabel["Value"].isNull())
|
||||
labelsObject.value = valuePrometheusAlertTemplatesPrometheusAlertTemplateLabelsLabel["Value"].asString();
|
||||
prometheusAlertTemplatesObject.labels.push_back(labelsObject);
|
||||
}
|
||||
auto allAnnotationsNode = valuePrometheusAlertTemplatesPrometheusAlertTemplate["Annotations"]["Annotation"];
|
||||
for (auto valuePrometheusAlertTemplatesPrometheusAlertTemplateAnnotationsAnnotation : allAnnotationsNode)
|
||||
{
|
||||
PrometheusAlertTemplate::Annotation annotationsObject;
|
||||
if(!valuePrometheusAlertTemplatesPrometheusAlertTemplateAnnotationsAnnotation["Name"].isNull())
|
||||
annotationsObject.name = valuePrometheusAlertTemplatesPrometheusAlertTemplateAnnotationsAnnotation["Name"].asString();
|
||||
if(!valuePrometheusAlertTemplatesPrometheusAlertTemplateAnnotationsAnnotation["Value"].isNull())
|
||||
annotationsObject.value = valuePrometheusAlertTemplatesPrometheusAlertTemplateAnnotationsAnnotation["Value"].asString();
|
||||
prometheusAlertTemplatesObject.annotations.push_back(annotationsObject);
|
||||
}
|
||||
prometheusAlertTemplates_.push_back(prometheusAlertTemplatesObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
std::vector<ListPrometheusAlertTemplatesResult::PrometheusAlertTemplate> ListPrometheusAlertTemplatesResult::getPrometheusAlertTemplates()const
|
||||
{
|
||||
return prometheusAlertTemplates_;
|
||||
}
|
||||
|
||||
40
arms/src/model/OpenArmsDefaultSLRRequest.cc
Normal file
40
arms/src/model/OpenArmsDefaultSLRRequest.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/OpenArmsDefaultSLRRequest.h>
|
||||
|
||||
using AlibabaCloud::ARMS::Model::OpenArmsDefaultSLRRequest;
|
||||
|
||||
OpenArmsDefaultSLRRequest::OpenArmsDefaultSLRRequest() :
|
||||
RpcServiceRequest("arms", "2019-08-08", "OpenArmsDefaultSLR")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
OpenArmsDefaultSLRRequest::~OpenArmsDefaultSLRRequest()
|
||||
{}
|
||||
|
||||
std::string OpenArmsDefaultSLRRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void OpenArmsDefaultSLRRequest::setRegionId(const std::string& regionId)
|
||||
{
|
||||
regionId_ = regionId;
|
||||
setParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
51
arms/src/model/OpenArmsDefaultSLRResult.cc
Normal file
51
arms/src/model/OpenArmsDefaultSLRResult.cc
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/OpenArmsDefaultSLRResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::ARMS;
|
||||
using namespace AlibabaCloud::ARMS::Model;
|
||||
|
||||
OpenArmsDefaultSLRResult::OpenArmsDefaultSLRResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
OpenArmsDefaultSLRResult::OpenArmsDefaultSLRResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
OpenArmsDefaultSLRResult::~OpenArmsDefaultSLRResult()
|
||||
{}
|
||||
|
||||
void OpenArmsDefaultSLRResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Data"].isNull())
|
||||
data_ = value["Data"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string OpenArmsDefaultSLRResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
51
arms/src/model/OpenArmsServiceSecondVersionRequest.cc
Normal file
51
arms/src/model/OpenArmsServiceSecondVersionRequest.cc
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/OpenArmsServiceSecondVersionRequest.h>
|
||||
|
||||
using AlibabaCloud::ARMS::Model::OpenArmsServiceSecondVersionRequest;
|
||||
|
||||
OpenArmsServiceSecondVersionRequest::OpenArmsServiceSecondVersionRequest() :
|
||||
RpcServiceRequest("arms", "2019-08-08", "OpenArmsServiceSecondVersion")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
OpenArmsServiceSecondVersionRequest::~OpenArmsServiceSecondVersionRequest()
|
||||
{}
|
||||
|
||||
std::string OpenArmsServiceSecondVersionRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void OpenArmsServiceSecondVersionRequest::setRegionId(const std::string& regionId)
|
||||
{
|
||||
regionId_ = regionId;
|
||||
setParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
std::string OpenArmsServiceSecondVersionRequest::getType()const
|
||||
{
|
||||
return type_;
|
||||
}
|
||||
|
||||
void OpenArmsServiceSecondVersionRequest::setType(const std::string& type)
|
||||
{
|
||||
type_ = type;
|
||||
setParameter("Type", type);
|
||||
}
|
||||
|
||||
51
arms/src/model/OpenArmsServiceSecondVersionResult.cc
Normal file
51
arms/src/model/OpenArmsServiceSecondVersionResult.cc
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/OpenArmsServiceSecondVersionResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::ARMS;
|
||||
using namespace AlibabaCloud::ARMS::Model;
|
||||
|
||||
OpenArmsServiceSecondVersionResult::OpenArmsServiceSecondVersionResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
OpenArmsServiceSecondVersionResult::OpenArmsServiceSecondVersionResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
OpenArmsServiceSecondVersionResult::~OpenArmsServiceSecondVersionResult()
|
||||
{}
|
||||
|
||||
void OpenArmsServiceSecondVersionResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["OrderId"].isNull())
|
||||
orderId_ = value["OrderId"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string OpenArmsServiceSecondVersionResult::getOrderId()const
|
||||
{
|
||||
return orderId_;
|
||||
}
|
||||
|
||||
@@ -38,6 +38,28 @@ void OpenVClusterRequest::setClusterType(const std::string& clusterType)
|
||||
setParameter("ClusterType", clusterType);
|
||||
}
|
||||
|
||||
std::string OpenVClusterRequest::getProduct()const
|
||||
{
|
||||
return product_;
|
||||
}
|
||||
|
||||
void OpenVClusterRequest::setProduct(const std::string& product)
|
||||
{
|
||||
product_ = product;
|
||||
setParameter("Product", product);
|
||||
}
|
||||
|
||||
bool OpenVClusterRequest::getRecreateSwitch()const
|
||||
{
|
||||
return recreateSwitch_;
|
||||
}
|
||||
|
||||
void OpenVClusterRequest::setRecreateSwitch(bool recreateSwitch)
|
||||
{
|
||||
recreateSwitch_ = recreateSwitch;
|
||||
setParameter("RecreateSwitch", recreateSwitch ? "true" : "false");
|
||||
}
|
||||
|
||||
std::string OpenVClusterRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
|
||||
40
arms/src/model/OpenXtraceDefaultSLRRequest.cc
Normal file
40
arms/src/model/OpenXtraceDefaultSLRRequest.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/OpenXtraceDefaultSLRRequest.h>
|
||||
|
||||
using AlibabaCloud::ARMS::Model::OpenXtraceDefaultSLRRequest;
|
||||
|
||||
OpenXtraceDefaultSLRRequest::OpenXtraceDefaultSLRRequest() :
|
||||
RpcServiceRequest("arms", "2019-08-08", "OpenXtraceDefaultSLR")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
OpenXtraceDefaultSLRRequest::~OpenXtraceDefaultSLRRequest()
|
||||
{}
|
||||
|
||||
std::string OpenXtraceDefaultSLRRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void OpenXtraceDefaultSLRRequest::setRegionId(const std::string& regionId)
|
||||
{
|
||||
regionId_ = regionId;
|
||||
setParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
51
arms/src/model/OpenXtraceDefaultSLRResult.cc
Normal file
51
arms/src/model/OpenXtraceDefaultSLRResult.cc
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/OpenXtraceDefaultSLRResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::ARMS;
|
||||
using namespace AlibabaCloud::ARMS::Model;
|
||||
|
||||
OpenXtraceDefaultSLRResult::OpenXtraceDefaultSLRResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
OpenXtraceDefaultSLRResult::OpenXtraceDefaultSLRResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
OpenXtraceDefaultSLRResult::~OpenXtraceDefaultSLRResult()
|
||||
{}
|
||||
|
||||
void OpenXtraceDefaultSLRResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Data"].isNull())
|
||||
data_ = value["Data"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string OpenXtraceDefaultSLRResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
150
arms/src/model/UpdateAlertTemplateRequest.cc
Normal file
150
arms/src/model/UpdateAlertTemplateRequest.cc
Normal file
@@ -0,0 +1,150 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/UpdateAlertTemplateRequest.h>
|
||||
|
||||
using AlibabaCloud::ARMS::Model::UpdateAlertTemplateRequest;
|
||||
|
||||
UpdateAlertTemplateRequest::UpdateAlertTemplateRequest() :
|
||||
RpcServiceRequest("arms", "2019-08-08", "UpdateAlertTemplate")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
UpdateAlertTemplateRequest::~UpdateAlertTemplateRequest()
|
||||
{}
|
||||
|
||||
std::string UpdateAlertTemplateRequest::getAnnotations()const
|
||||
{
|
||||
return annotations_;
|
||||
}
|
||||
|
||||
void UpdateAlertTemplateRequest::setAnnotations(const std::string& annotations)
|
||||
{
|
||||
annotations_ = annotations;
|
||||
setParameter("Annotations", annotations);
|
||||
}
|
||||
|
||||
std::string UpdateAlertTemplateRequest::getRule()const
|
||||
{
|
||||
return rule_;
|
||||
}
|
||||
|
||||
void UpdateAlertTemplateRequest::setRule(const std::string& rule)
|
||||
{
|
||||
rule_ = rule;
|
||||
setParameter("Rule", rule);
|
||||
}
|
||||
|
||||
std::string UpdateAlertTemplateRequest::getProxyUserId()const
|
||||
{
|
||||
return proxyUserId_;
|
||||
}
|
||||
|
||||
void UpdateAlertTemplateRequest::setProxyUserId(const std::string& proxyUserId)
|
||||
{
|
||||
proxyUserId_ = proxyUserId;
|
||||
setParameter("ProxyUserId", proxyUserId);
|
||||
}
|
||||
|
||||
std::string UpdateAlertTemplateRequest::getType()const
|
||||
{
|
||||
return type_;
|
||||
}
|
||||
|
||||
void UpdateAlertTemplateRequest::setType(const std::string& type)
|
||||
{
|
||||
type_ = type;
|
||||
setParameter("Type", type);
|
||||
}
|
||||
|
||||
std::string UpdateAlertTemplateRequest::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
void UpdateAlertTemplateRequest::setMessage(const std::string& message)
|
||||
{
|
||||
message_ = message;
|
||||
setParameter("Message", message);
|
||||
}
|
||||
|
||||
std::string UpdateAlertTemplateRequest::getLabels()const
|
||||
{
|
||||
return labels_;
|
||||
}
|
||||
|
||||
void UpdateAlertTemplateRequest::setLabels(const std::string& labels)
|
||||
{
|
||||
labels_ = labels;
|
||||
setParameter("Labels", labels);
|
||||
}
|
||||
|
||||
std::string UpdateAlertTemplateRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void UpdateAlertTemplateRequest::setRegionId(const std::string& regionId)
|
||||
{
|
||||
regionId_ = regionId;
|
||||
setParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
std::string UpdateAlertTemplateRequest::getName()const
|
||||
{
|
||||
return name_;
|
||||
}
|
||||
|
||||
void UpdateAlertTemplateRequest::setName(const std::string& name)
|
||||
{
|
||||
name_ = name;
|
||||
setParameter("Name", name);
|
||||
}
|
||||
|
||||
long UpdateAlertTemplateRequest::getId()const
|
||||
{
|
||||
return id_;
|
||||
}
|
||||
|
||||
void UpdateAlertTemplateRequest::setId(long id)
|
||||
{
|
||||
id_ = id;
|
||||
setParameter("Id", std::to_string(id));
|
||||
}
|
||||
|
||||
std::string UpdateAlertTemplateRequest::getMatchExpressions()const
|
||||
{
|
||||
return matchExpressions_;
|
||||
}
|
||||
|
||||
void UpdateAlertTemplateRequest::setMatchExpressions(const std::string& matchExpressions)
|
||||
{
|
||||
matchExpressions_ = matchExpressions;
|
||||
setParameter("MatchExpressions", matchExpressions);
|
||||
}
|
||||
|
||||
bool UpdateAlertTemplateRequest::getStatus()const
|
||||
{
|
||||
return status_;
|
||||
}
|
||||
|
||||
void UpdateAlertTemplateRequest::setStatus(bool status)
|
||||
{
|
||||
status_ = status;
|
||||
setParameter("Status", status ? "true" : "false");
|
||||
}
|
||||
|
||||
51
arms/src/model/UpdateAlertTemplateResult.cc
Normal file
51
arms/src/model/UpdateAlertTemplateResult.cc
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/UpdateAlertTemplateResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::ARMS;
|
||||
using namespace AlibabaCloud::ARMS::Model;
|
||||
|
||||
UpdateAlertTemplateResult::UpdateAlertTemplateResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
UpdateAlertTemplateResult::UpdateAlertTemplateResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
UpdateAlertTemplateResult::~UpdateAlertTemplateResult()
|
||||
{}
|
||||
|
||||
void UpdateAlertTemplateResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
|
||||
}
|
||||
|
||||
bool UpdateAlertTemplateResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
172
arms/src/model/UpdatePrometheusAlertRuleRequest.cc
Normal file
172
arms/src/model/UpdatePrometheusAlertRuleRequest.cc
Normal file
@@ -0,0 +1,172 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/UpdatePrometheusAlertRuleRequest.h>
|
||||
|
||||
using AlibabaCloud::ARMS::Model::UpdatePrometheusAlertRuleRequest;
|
||||
|
||||
UpdatePrometheusAlertRuleRequest::UpdatePrometheusAlertRuleRequest() :
|
||||
RpcServiceRequest("arms", "2019-08-08", "UpdatePrometheusAlertRule")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
UpdatePrometheusAlertRuleRequest::~UpdatePrometheusAlertRuleRequest()
|
||||
{}
|
||||
|
||||
std::string UpdatePrometheusAlertRuleRequest::getExpression()const
|
||||
{
|
||||
return expression_;
|
||||
}
|
||||
|
||||
void UpdatePrometheusAlertRuleRequest::setExpression(const std::string& expression)
|
||||
{
|
||||
expression_ = expression;
|
||||
setParameter("Expression", expression);
|
||||
}
|
||||
|
||||
std::string UpdatePrometheusAlertRuleRequest::getAlertName()const
|
||||
{
|
||||
return alertName_;
|
||||
}
|
||||
|
||||
void UpdatePrometheusAlertRuleRequest::setAlertName(const std::string& alertName)
|
||||
{
|
||||
alertName_ = alertName;
|
||||
setParameter("AlertName", alertName);
|
||||
}
|
||||
|
||||
std::string UpdatePrometheusAlertRuleRequest::getAnnotations()const
|
||||
{
|
||||
return annotations_;
|
||||
}
|
||||
|
||||
void UpdatePrometheusAlertRuleRequest::setAnnotations(const std::string& annotations)
|
||||
{
|
||||
annotations_ = annotations;
|
||||
setParameter("Annotations", annotations);
|
||||
}
|
||||
|
||||
std::string UpdatePrometheusAlertRuleRequest::getClusterId()const
|
||||
{
|
||||
return clusterId_;
|
||||
}
|
||||
|
||||
void UpdatePrometheusAlertRuleRequest::setClusterId(const std::string& clusterId)
|
||||
{
|
||||
clusterId_ = clusterId;
|
||||
setParameter("ClusterId", clusterId);
|
||||
}
|
||||
|
||||
long UpdatePrometheusAlertRuleRequest::getDispatchRuleId()const
|
||||
{
|
||||
return dispatchRuleId_;
|
||||
}
|
||||
|
||||
void UpdatePrometheusAlertRuleRequest::setDispatchRuleId(long dispatchRuleId)
|
||||
{
|
||||
dispatchRuleId_ = dispatchRuleId;
|
||||
setParameter("DispatchRuleId", std::to_string(dispatchRuleId));
|
||||
}
|
||||
|
||||
std::string UpdatePrometheusAlertRuleRequest::getProxyUserId()const
|
||||
{
|
||||
return proxyUserId_;
|
||||
}
|
||||
|
||||
void UpdatePrometheusAlertRuleRequest::setProxyUserId(const std::string& proxyUserId)
|
||||
{
|
||||
proxyUserId_ = proxyUserId;
|
||||
setParameter("ProxyUserId", proxyUserId);
|
||||
}
|
||||
|
||||
std::string UpdatePrometheusAlertRuleRequest::getType()const
|
||||
{
|
||||
return type_;
|
||||
}
|
||||
|
||||
void UpdatePrometheusAlertRuleRequest::setType(const std::string& type)
|
||||
{
|
||||
type_ = type;
|
||||
setParameter("Type", type);
|
||||
}
|
||||
|
||||
std::string UpdatePrometheusAlertRuleRequest::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
void UpdatePrometheusAlertRuleRequest::setMessage(const std::string& message)
|
||||
{
|
||||
message_ = message;
|
||||
setParameter("Message", message);
|
||||
}
|
||||
|
||||
std::string UpdatePrometheusAlertRuleRequest::getLabels()const
|
||||
{
|
||||
return labels_;
|
||||
}
|
||||
|
||||
void UpdatePrometheusAlertRuleRequest::setLabels(const std::string& labels)
|
||||
{
|
||||
labels_ = labels;
|
||||
setParameter("Labels", labels);
|
||||
}
|
||||
|
||||
std::string UpdatePrometheusAlertRuleRequest::getDuration()const
|
||||
{
|
||||
return duration_;
|
||||
}
|
||||
|
||||
void UpdatePrometheusAlertRuleRequest::setDuration(const std::string& duration)
|
||||
{
|
||||
duration_ = duration;
|
||||
setParameter("Duration", duration);
|
||||
}
|
||||
|
||||
std::string UpdatePrometheusAlertRuleRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void UpdatePrometheusAlertRuleRequest::setRegionId(const std::string& regionId)
|
||||
{
|
||||
regionId_ = regionId;
|
||||
setParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
long UpdatePrometheusAlertRuleRequest::getAlertId()const
|
||||
{
|
||||
return alertId_;
|
||||
}
|
||||
|
||||
void UpdatePrometheusAlertRuleRequest::setAlertId(long alertId)
|
||||
{
|
||||
alertId_ = alertId;
|
||||
setParameter("AlertId", std::to_string(alertId));
|
||||
}
|
||||
|
||||
std::string UpdatePrometheusAlertRuleRequest::getNotifyType()const
|
||||
{
|
||||
return notifyType_;
|
||||
}
|
||||
|
||||
void UpdatePrometheusAlertRuleRequest::setNotifyType(const std::string& notifyType)
|
||||
{
|
||||
notifyType_ = notifyType;
|
||||
setParameter("NotifyType", notifyType);
|
||||
}
|
||||
|
||||
90
arms/src/model/UpdatePrometheusAlertRuleResult.cc
Normal file
90
arms/src/model/UpdatePrometheusAlertRuleResult.cc
Normal file
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/arms/model/UpdatePrometheusAlertRuleResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::ARMS;
|
||||
using namespace AlibabaCloud::ARMS::Model;
|
||||
|
||||
UpdatePrometheusAlertRuleResult::UpdatePrometheusAlertRuleResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
UpdatePrometheusAlertRuleResult::UpdatePrometheusAlertRuleResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
UpdatePrometheusAlertRuleResult::~UpdatePrometheusAlertRuleResult()
|
||||
{}
|
||||
|
||||
void UpdatePrometheusAlertRuleResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto prometheusAlertRuleNode = value["PrometheusAlertRule"];
|
||||
if(!prometheusAlertRuleNode["AlertId"].isNull())
|
||||
prometheusAlertRule_.alertId = std::stol(prometheusAlertRuleNode["AlertId"].asString());
|
||||
if(!prometheusAlertRuleNode["AlertName"].isNull())
|
||||
prometheusAlertRule_.alertName = prometheusAlertRuleNode["AlertName"].asString();
|
||||
if(!prometheusAlertRuleNode["Message"].isNull())
|
||||
prometheusAlertRule_.message = prometheusAlertRuleNode["Message"].asString();
|
||||
if(!prometheusAlertRuleNode["Type"].isNull())
|
||||
prometheusAlertRule_.type = prometheusAlertRuleNode["Type"].asString();
|
||||
if(!prometheusAlertRuleNode["Expression"].isNull())
|
||||
prometheusAlertRule_.expression = prometheusAlertRuleNode["Expression"].asString();
|
||||
if(!prometheusAlertRuleNode["Duration"].isNull())
|
||||
prometheusAlertRule_.duration = prometheusAlertRuleNode["Duration"].asString();
|
||||
if(!prometheusAlertRuleNode["ClusterId"].isNull())
|
||||
prometheusAlertRule_.clusterId = prometheusAlertRuleNode["ClusterId"].asString();
|
||||
if(!prometheusAlertRuleNode["Status"].isNull())
|
||||
prometheusAlertRule_.status = std::stoi(prometheusAlertRuleNode["Status"].asString());
|
||||
if(!prometheusAlertRuleNode["DispatchRuleId"].isNull())
|
||||
prometheusAlertRule_.dispatchRuleId = std::stol(prometheusAlertRuleNode["DispatchRuleId"].asString());
|
||||
if(!prometheusAlertRuleNode["NotifyType"].isNull())
|
||||
prometheusAlertRule_.notifyType = prometheusAlertRuleNode["NotifyType"].asString();
|
||||
auto allLabelsNode = prometheusAlertRuleNode["Labels"]["Label"];
|
||||
for (auto prometheusAlertRuleNodeLabelsLabel : allLabelsNode)
|
||||
{
|
||||
PrometheusAlertRule::Label labelObject;
|
||||
if(!prometheusAlertRuleNodeLabelsLabel["Name"].isNull())
|
||||
labelObject.name = prometheusAlertRuleNodeLabelsLabel["Name"].asString();
|
||||
if(!prometheusAlertRuleNodeLabelsLabel["Value"].isNull())
|
||||
labelObject.value = prometheusAlertRuleNodeLabelsLabel["Value"].asString();
|
||||
prometheusAlertRule_.labels.push_back(labelObject);
|
||||
}
|
||||
auto allAnnotationsNode = prometheusAlertRuleNode["Annotations"]["Annotation"];
|
||||
for (auto prometheusAlertRuleNodeAnnotationsAnnotation : allAnnotationsNode)
|
||||
{
|
||||
PrometheusAlertRule::Annotation annotationObject;
|
||||
if(!prometheusAlertRuleNodeAnnotationsAnnotation["Name"].isNull())
|
||||
annotationObject.name = prometheusAlertRuleNodeAnnotationsAnnotation["Name"].asString();
|
||||
if(!prometheusAlertRuleNodeAnnotationsAnnotation["Value"].isNull())
|
||||
annotationObject.value = prometheusAlertRuleNodeAnnotationsAnnotation["Value"].asString();
|
||||
prometheusAlertRule_.annotations.push_back(annotationObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
UpdatePrometheusAlertRuleResult::PrometheusAlertRule UpdatePrometheusAlertRuleResult::getPrometheusAlertRule()const
|
||||
{
|
||||
return prometheusAlertRule_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user