PatchBaseline Support Tags.
This commit is contained in:
@@ -28,12 +28,21 @@ namespace Oos {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_OOS_EXPORT CreateApplicationRequest : public RpcServiceRequest {
|
||||
public:
|
||||
struct AlarmConfig {
|
||||
std::string string;
|
||||
std::vector<std::string> templateIds;
|
||||
std::string string;
|
||||
std::vector<std::string> contactGroups;
|
||||
std::string healthCheckUrl;
|
||||
};
|
||||
CreateApplicationRequest();
|
||||
~CreateApplicationRequest();
|
||||
std::string getClientToken() const;
|
||||
void setClientToken(const std::string &clientToken);
|
||||
std::string getDescription() const;
|
||||
void setDescription(const std::string &description);
|
||||
AlarmConfig getAlarmConfig() const;
|
||||
void setAlarmConfig(const AlarmConfig &alarmConfig);
|
||||
std::string getResourceGroupId() const;
|
||||
void setResourceGroupId(const std::string &resourceGroupId);
|
||||
std::string getRegionId() const;
|
||||
@@ -46,6 +55,7 @@ public:
|
||||
private:
|
||||
std::string clientToken_;
|
||||
std::string description_;
|
||||
AlarmConfig alarmConfig_;
|
||||
std::string resourceGroupId_;
|
||||
std::string regionId_;
|
||||
std::string tags_;
|
||||
|
||||
@@ -34,12 +34,19 @@ namespace AlibabaCloud
|
||||
public:
|
||||
struct Application
|
||||
{
|
||||
struct AlarmConfig
|
||||
{
|
||||
std::vector<std::string> contactGroups;
|
||||
std::string healthCheckUrl;
|
||||
std::vector<std::string> templateIds;
|
||||
};
|
||||
std::string updateDate;
|
||||
std::string applicationType;
|
||||
std::string description;
|
||||
std::string resourceGroupId;
|
||||
std::string createDate;
|
||||
std::string tags;
|
||||
AlarmConfig alarmConfig;
|
||||
std::string name;
|
||||
};
|
||||
|
||||
|
||||
@@ -28,21 +28,34 @@ namespace Oos {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_OOS_EXPORT UpdateApplicationRequest : public RpcServiceRequest {
|
||||
public:
|
||||
struct AlarmConfig {
|
||||
std::string string;
|
||||
std::vector<std::string> templateIds;
|
||||
std::string string;
|
||||
std::vector<std::string> contactGroups;
|
||||
std::string healthCheckUrl;
|
||||
};
|
||||
UpdateApplicationRequest();
|
||||
~UpdateApplicationRequest();
|
||||
std::string getDescription() const;
|
||||
void setDescription(const std::string &description);
|
||||
std::map<std::string, std::string> getTags() const;
|
||||
void setTags(const std::map<std::string, std::string> &tags);
|
||||
AlarmConfig getAlarmConfig() const;
|
||||
void setAlarmConfig(const AlarmConfig &alarmConfig);
|
||||
bool getDeleteAlarmRulesBeforeUpdate() const;
|
||||
void setDeleteAlarmRulesBeforeUpdate(bool deleteAlarmRulesBeforeUpdate);
|
||||
std::string getRegionId() const;
|
||||
void setRegionId(const std::string ®ionId);
|
||||
std::map<std::string, std::string> getTags() const;
|
||||
void setTags(const std::map<std::string, std::string> &tags);
|
||||
std::string getName() const;
|
||||
void setName(const std::string &name);
|
||||
|
||||
private:
|
||||
std::string description_;
|
||||
std::map<std::string, std::string> tags_;
|
||||
AlarmConfig alarmConfig_;
|
||||
bool deleteAlarmRulesBeforeUpdate_;
|
||||
std::string regionId_;
|
||||
std::map<std::string, std::string> tags_;
|
||||
std::string name_;
|
||||
};
|
||||
} // namespace Model
|
||||
|
||||
@@ -43,6 +43,21 @@ void CreateApplicationRequest::setDescription(const std::string &description) {
|
||||
setParameter(std::string("Description"), description);
|
||||
}
|
||||
|
||||
CreateApplicationRequest::AlarmConfig CreateApplicationRequest::getAlarmConfig() const {
|
||||
return alarmConfig_;
|
||||
}
|
||||
|
||||
void CreateApplicationRequest::setAlarmConfig(const CreateApplicationRequest::AlarmConfig &alarmConfig) {
|
||||
alarmConfig_ = alarmConfig;
|
||||
for(int dep1 = 0; dep1 != alarmConfig.templateIds.size(); dep1++) {
|
||||
setParameter(std::string("AlarmConfig") + ".TemplateIds." + std::to_string(dep1 + 1), alarmConfig.templateIds[dep1]);
|
||||
}
|
||||
for(int dep1 = 0; dep1 != alarmConfig.contactGroups.size(); dep1++) {
|
||||
setParameter(std::string("AlarmConfig") + ".ContactGroups." + std::to_string(dep1 + 1), alarmConfig.contactGroups[dep1]);
|
||||
}
|
||||
setParameter(std::string("AlarmConfig") + ".HealthCheckUrl", alarmConfig.healthCheckUrl);
|
||||
}
|
||||
|
||||
std::string CreateApplicationRequest::getResourceGroupId() const {
|
||||
return resourceGroupId_;
|
||||
}
|
||||
|
||||
@@ -54,6 +54,15 @@ void GetApplicationResult::parse(const std::string &payload)
|
||||
application_.createDate = applicationNode["CreateDate"].asString();
|
||||
if(!applicationNode["ApplicationType"].isNull())
|
||||
application_.applicationType = applicationNode["ApplicationType"].asString();
|
||||
auto alarmConfigNode = applicationNode["AlarmConfig"];
|
||||
if(!alarmConfigNode["HealthCheckUrl"].isNull())
|
||||
application_.alarmConfig.healthCheckUrl = alarmConfigNode["HealthCheckUrl"].asString();
|
||||
auto allContactGroups = alarmConfigNode["ContactGroups"]["ContactGroup"];
|
||||
for (auto value : allContactGroups)
|
||||
application_.alarmConfig.contactGroups.push_back(value.asString());
|
||||
auto allTemplateIds = alarmConfigNode["TemplateIds"]["TemplateId"];
|
||||
for (auto value : allTemplateIds)
|
||||
application_.alarmConfig.templateIds.push_back(value.asString());
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -34,15 +34,28 @@ void UpdateApplicationRequest::setDescription(const std::string &description) {
|
||||
setParameter(std::string("Description"), description);
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> UpdateApplicationRequest::getTags() const {
|
||||
return tags_;
|
||||
UpdateApplicationRequest::AlarmConfig UpdateApplicationRequest::getAlarmConfig() const {
|
||||
return alarmConfig_;
|
||||
}
|
||||
|
||||
void UpdateApplicationRequest::setTags(const std::map<std::string, std::string> &tags) {
|
||||
tags_ = tags;
|
||||
for(auto const &iter1 : tags) {
|
||||
setParameter(std::string("Tags") + "." + iter1.first, iter1.second);
|
||||
void UpdateApplicationRequest::setAlarmConfig(const UpdateApplicationRequest::AlarmConfig &alarmConfig) {
|
||||
alarmConfig_ = alarmConfig;
|
||||
for(int dep1 = 0; dep1 != alarmConfig.templateIds.size(); dep1++) {
|
||||
setParameter(std::string("AlarmConfig") + ".TemplateIds." + std::to_string(dep1 + 1), alarmConfig.templateIds[dep1]);
|
||||
}
|
||||
for(int dep1 = 0; dep1 != alarmConfig.contactGroups.size(); dep1++) {
|
||||
setParameter(std::string("AlarmConfig") + ".ContactGroups." + std::to_string(dep1 + 1), alarmConfig.contactGroups[dep1]);
|
||||
}
|
||||
setParameter(std::string("AlarmConfig") + ".HealthCheckUrl", alarmConfig.healthCheckUrl);
|
||||
}
|
||||
|
||||
bool UpdateApplicationRequest::getDeleteAlarmRulesBeforeUpdate() const {
|
||||
return deleteAlarmRulesBeforeUpdate_;
|
||||
}
|
||||
|
||||
void UpdateApplicationRequest::setDeleteAlarmRulesBeforeUpdate(bool deleteAlarmRulesBeforeUpdate) {
|
||||
deleteAlarmRulesBeforeUpdate_ = deleteAlarmRulesBeforeUpdate;
|
||||
setParameter(std::string("DeleteAlarmRulesBeforeUpdate"), deleteAlarmRulesBeforeUpdate ? "true" : "false");
|
||||
}
|
||||
|
||||
std::string UpdateApplicationRequest::getRegionId() const {
|
||||
@@ -54,6 +67,17 @@ void UpdateApplicationRequest::setRegionId(const std::string ®ionId) {
|
||||
setParameter(std::string("RegionId"), regionId);
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> UpdateApplicationRequest::getTags() const {
|
||||
return tags_;
|
||||
}
|
||||
|
||||
void UpdateApplicationRequest::setTags(const std::map<std::string, std::string> &tags) {
|
||||
tags_ = tags;
|
||||
for(auto const &iter1 : tags) {
|
||||
setParameter(std::string("Tags") + "." + iter1.first, iter1.second);
|
||||
}
|
||||
}
|
||||
|
||||
std::string UpdateApplicationRequest::getName() const {
|
||||
return name_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user