From f3a5eccfc1ff536103807a462988adea4f7e88f3 Mon Sep 17 00:00:00 2001 From: sdk-team Date: Tue, 8 Jun 2021 08:28:45 +0000 Subject: [PATCH] Support input parameter LaunchConfigurationHostNames and MinTargetCapacity for CreateAutoProvisioningGroup. --- CHANGELOG | 3 ++ VERSION | 2 +- .../CreateAutoProvisioningGroupRequest.h | 24 +++++++---- .../CreateAutoProvisioningGroupRequest.cc | 42 +++++++++++++++---- .../CreateAutoProvisioningGroupResult.cc | 12 +++--- 5 files changed, 58 insertions(+), 25 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 1d5387fb9..164707c2f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2021-06-08 Version: 1.36.771 +- Support input parameter LaunchConfigurationHostNames and MinTargetCapacity for CreateAutoProvisioningGroup. + 2021-06-08 Version: 1.36.770 - Increase detection frequency for availability monitoring. - Add application group to query in batch according to group ID. diff --git a/VERSION b/VERSION index da4d41876..eba7c4fbd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.770 \ No newline at end of file +1.36.771 \ No newline at end of file diff --git a/ecs/include/alibabacloud/ecs/model/CreateAutoProvisioningGroupRequest.h b/ecs/include/alibabacloud/ecs/model/CreateAutoProvisioningGroupRequest.h index 327f316f5..c40e9d71c 100644 --- a/ecs/include/alibabacloud/ecs/model/CreateAutoProvisioningGroupRequest.h +++ b/ecs/include/alibabacloud/ecs/model/CreateAutoProvisioningGroupRequest.h @@ -33,16 +33,16 @@ namespace AlibabaCloud public: struct LaunchConfigurationDataDisk { - int size; - std::string category; std::string performanceLevel; - std::string device; + std::string kmsKeyId; + std::string description; std::string snapshotId; + int size; + std::string device; + std::string diskName; + std::string category; bool deleteWithInstance; bool encrypted; - std::string kmsKeyId; - std::string diskName; - std::string description; }; struct SystemDiskConfig { @@ -54,11 +54,11 @@ namespace AlibabaCloud }; struct LaunchTemplateConfig { - std::string instanceType; - double maxPrice; std::string vSwitchId; - double weightedCapacity; + double maxPrice; int priority; + std::string instanceType; + double weightedCapacity; }; struct LaunchConfigurationTag { @@ -80,6 +80,8 @@ namespace AlibabaCloud void setAutoProvisioningGroupType(const std::string& autoProvisioningGroupType); std::string getLaunchConfigurationSystemDiskPerformanceLevel()const; void setLaunchConfigurationSystemDiskPerformanceLevel(const std::string& launchConfigurationSystemDiskPerformanceLevel); + std::vector getLaunchConfigurationHostNames()const; + void setLaunchConfigurationHostNames(const std::vector& launchConfigurationHostNames); std::string getResourceGroupId()const; void setResourceGroupId(const std::string& resourceGroupId); std::string getLaunchConfigurationImageId()const; @@ -110,6 +112,8 @@ namespace AlibabaCloud void setLaunchConfigurationInternetMaxBandwidthOut(int launchConfigurationInternetMaxBandwidthOut); std::string getLaunchConfigurationHostName()const; void setLaunchConfigurationHostName(const std::string& launchConfigurationHostName); + std::string getMinTargetCapacity()const; + void setMinTargetCapacity(const std::string& minTargetCapacity); float getMaxSpotPrice()const; void setMaxSpotPrice(float maxSpotPrice); bool getLaunchConfigurationPasswordInherit()const; @@ -185,6 +189,7 @@ namespace AlibabaCloud std::string launchConfigurationSystemDiskCategory_; std::string autoProvisioningGroupType_; std::string launchConfigurationSystemDiskPerformanceLevel_; + std::vector launchConfigurationHostNames_; std::string resourceGroupId_; std::string launchConfigurationImageId_; std::string launchConfigurationResourceGroupId_; @@ -200,6 +205,7 @@ namespace AlibabaCloud int launchConfigurationSystemDiskSize_; int launchConfigurationInternetMaxBandwidthOut_; std::string launchConfigurationHostName_; + std::string minTargetCapacity_; float maxSpotPrice_; bool launchConfigurationPasswordInherit_; std::string clientToken_; diff --git a/ecs/src/model/CreateAutoProvisioningGroupRequest.cc b/ecs/src/model/CreateAutoProvisioningGroupRequest.cc index 7771ba172..d8da9b929 100644 --- a/ecs/src/model/CreateAutoProvisioningGroupRequest.cc +++ b/ecs/src/model/CreateAutoProvisioningGroupRequest.cc @@ -38,16 +38,16 @@ void CreateAutoProvisioningGroupRequest::setLaunchConfigurationDataDisk(const st for(int dep1 = 0; dep1!= launchConfigurationDataDisk.size(); dep1++) { auto launchConfigurationDataDiskObj = launchConfigurationDataDisk.at(dep1); std::string launchConfigurationDataDiskObjStr = "LaunchConfiguration.DataDisk." + std::to_string(dep1 + 1); - setParameter(launchConfigurationDataDiskObjStr + ".Size", std::to_string(launchConfigurationDataDiskObj.size)); - setParameter(launchConfigurationDataDiskObjStr + ".Category", launchConfigurationDataDiskObj.category); setParameter(launchConfigurationDataDiskObjStr + ".PerformanceLevel", launchConfigurationDataDiskObj.performanceLevel); - setParameter(launchConfigurationDataDiskObjStr + ".Device", launchConfigurationDataDiskObj.device); + setParameter(launchConfigurationDataDiskObjStr + ".KmsKeyId", launchConfigurationDataDiskObj.kmsKeyId); + setParameter(launchConfigurationDataDiskObjStr + ".Description", launchConfigurationDataDiskObj.description); setParameter(launchConfigurationDataDiskObjStr + ".SnapshotId", launchConfigurationDataDiskObj.snapshotId); + setParameter(launchConfigurationDataDiskObjStr + ".Size", std::to_string(launchConfigurationDataDiskObj.size)); + setParameter(launchConfigurationDataDiskObjStr + ".Device", launchConfigurationDataDiskObj.device); + setParameter(launchConfigurationDataDiskObjStr + ".DiskName", launchConfigurationDataDiskObj.diskName); + setParameter(launchConfigurationDataDiskObjStr + ".Category", launchConfigurationDataDiskObj.category); setParameter(launchConfigurationDataDiskObjStr + ".DeleteWithInstance", launchConfigurationDataDiskObj.deleteWithInstance ? "true" : "false"); setParameter(launchConfigurationDataDiskObjStr + ".Encrypted", launchConfigurationDataDiskObj.encrypted ? "true" : "false"); - setParameter(launchConfigurationDataDiskObjStr + ".KmsKeyId", launchConfigurationDataDiskObj.kmsKeyId); - setParameter(launchConfigurationDataDiskObjStr + ".DiskName", launchConfigurationDataDiskObj.diskName); - setParameter(launchConfigurationDataDiskObjStr + ".Description", launchConfigurationDataDiskObj.description); } } @@ -95,6 +95,19 @@ void CreateAutoProvisioningGroupRequest::setLaunchConfigurationSystemDiskPerform setParameter("LaunchConfigurationSystemDiskPerformanceLevel", launchConfigurationSystemDiskPerformanceLevel); } +std::vector CreateAutoProvisioningGroupRequest::getLaunchConfigurationHostNames()const +{ + return launchConfigurationHostNames_; +} + +void CreateAutoProvisioningGroupRequest::setLaunchConfigurationHostNames(const std::vector& launchConfigurationHostNames) +{ + launchConfigurationHostNames_ = launchConfigurationHostNames; + for(int dep1 = 0; dep1!= launchConfigurationHostNames.size(); dep1++) { + setParameter("LaunchConfigurationHostNames."+ std::to_string(dep1), launchConfigurationHostNames.at(dep1)); + } +} + std::string CreateAutoProvisioningGroupRequest::getResourceGroupId()const { return resourceGroupId_; @@ -268,6 +281,17 @@ void CreateAutoProvisioningGroupRequest::setLaunchConfigurationHostName(const st setParameter("LaunchConfigurationHostName", launchConfigurationHostName); } +std::string CreateAutoProvisioningGroupRequest::getMinTargetCapacity()const +{ + return minTargetCapacity_; +} + +void CreateAutoProvisioningGroupRequest::setMinTargetCapacity(const std::string& minTargetCapacity) +{ + minTargetCapacity_ = minTargetCapacity; + setParameter("MinTargetCapacity", minTargetCapacity); +} + float CreateAutoProvisioningGroupRequest::getMaxSpotPrice()const { return maxSpotPrice_; @@ -455,11 +479,11 @@ void CreateAutoProvisioningGroupRequest::setLaunchTemplateConfig(const std::vect for(int dep1 = 0; dep1!= launchTemplateConfig.size(); dep1++) { auto launchTemplateConfigObj = launchTemplateConfig.at(dep1); std::string launchTemplateConfigObjStr = "LaunchTemplateConfig." + std::to_string(dep1 + 1); - setParameter(launchTemplateConfigObjStr + ".InstanceType", launchTemplateConfigObj.instanceType); - setParameter(launchTemplateConfigObjStr + ".MaxPrice", std::to_string(launchTemplateConfigObj.maxPrice)); setParameter(launchTemplateConfigObjStr + ".VSwitchId", launchTemplateConfigObj.vSwitchId); - setParameter(launchTemplateConfigObjStr + ".WeightedCapacity", std::to_string(launchTemplateConfigObj.weightedCapacity)); + setParameter(launchTemplateConfigObjStr + ".MaxPrice", std::to_string(launchTemplateConfigObj.maxPrice)); setParameter(launchTemplateConfigObjStr + ".Priority", std::to_string(launchTemplateConfigObj.priority)); + setParameter(launchTemplateConfigObjStr + ".InstanceType", launchTemplateConfigObj.instanceType); + setParameter(launchTemplateConfigObjStr + ".WeightedCapacity", std::to_string(launchTemplateConfigObj.weightedCapacity)); } } diff --git a/ecs/src/model/CreateAutoProvisioningGroupResult.cc b/ecs/src/model/CreateAutoProvisioningGroupResult.cc index 2427d102d..097ec4673 100644 --- a/ecs/src/model/CreateAutoProvisioningGroupResult.cc +++ b/ecs/src/model/CreateAutoProvisioningGroupResult.cc @@ -43,16 +43,16 @@ void CreateAutoProvisioningGroupResult::parse(const std::string &payload) for (auto valueLaunchResultsLaunchResult : allLaunchResultsNode) { LaunchResult launchResultsObject; - if(!valueLaunchResultsLaunchResult["SpotStrategy"].isNull()) - launchResultsObject.spotStrategy = valueLaunchResultsLaunchResult["SpotStrategy"].asString(); - if(!valueLaunchResultsLaunchResult["InstanceType"].isNull()) - launchResultsObject.instanceType = valueLaunchResultsLaunchResult["InstanceType"].asString(); if(!valueLaunchResultsLaunchResult["ZoneId"].isNull()) launchResultsObject.zoneId = valueLaunchResultsLaunchResult["ZoneId"].asString(); - if(!valueLaunchResultsLaunchResult["ErrorCode"].isNull()) - launchResultsObject.errorCode = valueLaunchResultsLaunchResult["ErrorCode"].asString(); if(!valueLaunchResultsLaunchResult["ErrorMsg"].isNull()) launchResultsObject.errorMsg = valueLaunchResultsLaunchResult["ErrorMsg"].asString(); + if(!valueLaunchResultsLaunchResult["InstanceType"].isNull()) + launchResultsObject.instanceType = valueLaunchResultsLaunchResult["InstanceType"].asString(); + if(!valueLaunchResultsLaunchResult["ErrorCode"].isNull()) + launchResultsObject.errorCode = valueLaunchResultsLaunchResult["ErrorCode"].asString(); + if(!valueLaunchResultsLaunchResult["SpotStrategy"].isNull()) + launchResultsObject.spotStrategy = valueLaunchResultsLaunchResult["SpotStrategy"].asString(); auto allInstanceIds = value["InstanceIds"]["InstanceId"]; for (auto value : allInstanceIds) launchResultsObject.instanceIds.push_back(value.asString());