Ver Fonte

Support input parameter LaunchConfigurationHostNames and MinTargetCapacity for CreateAutoProvisioningGroup.

sdk-team há 5 anos atrás
pai
commit
f3a5eccfc1

+ 3 - 0
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.

+ 1 - 1
VERSION

@@ -1 +1 @@
-1.36.770
+1.36.771

+ 15 - 9
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<std::string> getLaunchConfigurationHostNames()const;
+				void setLaunchConfigurationHostNames(const std::vector<std::string>& 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<std::string> 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_;

+ 33 - 9
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<std::string> CreateAutoProvisioningGroupRequest::getLaunchConfigurationHostNames()const
+{
+	return launchConfigurationHostNames_;
+}
+
+void CreateAutoProvisioningGroupRequest::setLaunchConfigurationHostNames(const std::vector<std::string>& 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));
 	}
 }
 

+ 6 - 6
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());