diff --git a/CHANGELOG b/CHANGELOG index 5ca98f40b..87a6a567c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2021-01-06 Version: patch +- Support input parameter ClientToken for CreateAutoProvisioningGroup. + 2021-01-06 Version: patch - Add API. diff --git a/ecs/include/alibabacloud/ecs/model/CreateAutoProvisioningGroupRequest.h b/ecs/include/alibabacloud/ecs/model/CreateAutoProvisioningGroupRequest.h index efa554d01..25aa7262a 100644 --- a/ecs/include/alibabacloud/ecs/model/CreateAutoProvisioningGroupRequest.h +++ b/ecs/include/alibabacloud/ecs/model/CreateAutoProvisioningGroupRequest.h @@ -112,6 +112,8 @@ namespace AlibabaCloud void setMaxSpotPrice(float maxSpotPrice); bool getLaunchConfigurationPasswordInherit()const; void setLaunchConfigurationPasswordInherit(bool launchConfigurationPasswordInherit); + std::string getClientToken()const; + void setClientToken(const std::string& clientToken); std::string getLaunchConfigurationSecurityGroupId()const; void setLaunchConfigurationSecurityGroupId(const std::string& launchConfigurationSecurityGroupId); std::string getDescription()const; @@ -195,6 +197,7 @@ namespace AlibabaCloud std::string launchConfigurationHostName_; float maxSpotPrice_; bool launchConfigurationPasswordInherit_; + std::string clientToken_; std::string launchConfigurationSecurityGroupId_; std::string description_; bool terminateInstancesWithExpiration_; diff --git a/ecs/include/alibabacloud/ecs/model/CreateAutoProvisioningGroupResult.h b/ecs/include/alibabacloud/ecs/model/CreateAutoProvisioningGroupResult.h index 8b5304658..86c76f4ca 100644 --- a/ecs/include/alibabacloud/ecs/model/CreateAutoProvisioningGroupResult.h +++ b/ecs/include/alibabacloud/ecs/model/CreateAutoProvisioningGroupResult.h @@ -32,17 +32,28 @@ namespace AlibabaCloud class ALIBABACLOUD_ECS_EXPORT CreateAutoProvisioningGroupResult : public ServiceResult { public: + struct LaunchResult + { + std::string zoneId; + std::string errorMsg; + std::string errorCode; + std::string instanceType; + std::vector instanceIds; + std::string spotStrategy; + }; CreateAutoProvisioningGroupResult(); explicit CreateAutoProvisioningGroupResult(const std::string &payload); ~CreateAutoProvisioningGroupResult(); std::string getAutoProvisioningGroupId()const; + std::vector getLaunchResults()const; protected: void parse(const std::string &payload); private: std::string autoProvisioningGroupId_; + std::vector launchResults_; }; } diff --git a/ecs/src/model/CreateAutoProvisioningGroupRequest.cc b/ecs/src/model/CreateAutoProvisioningGroupRequest.cc index 476712e4a..a99b64563 100644 --- a/ecs/src/model/CreateAutoProvisioningGroupRequest.cc +++ b/ecs/src/model/CreateAutoProvisioningGroupRequest.cc @@ -279,6 +279,17 @@ void CreateAutoProvisioningGroupRequest::setLaunchConfigurationPasswordInherit(b setParameter("LaunchConfigurationPasswordInherit", launchConfigurationPasswordInherit ? "true" : "false"); } +std::string CreateAutoProvisioningGroupRequest::getClientToken()const +{ + return clientToken_; +} + +void CreateAutoProvisioningGroupRequest::setClientToken(const std::string& clientToken) +{ + clientToken_ = clientToken; + setParameter("ClientToken", clientToken); +} + std::string CreateAutoProvisioningGroupRequest::getLaunchConfigurationSecurityGroupId()const { return launchConfigurationSecurityGroupId_; diff --git a/ecs/src/model/CreateAutoProvisioningGroupResult.cc b/ecs/src/model/CreateAutoProvisioningGroupResult.cc index d2bf9c461..2427d102d 100644 --- a/ecs/src/model/CreateAutoProvisioningGroupResult.cc +++ b/ecs/src/model/CreateAutoProvisioningGroupResult.cc @@ -39,6 +39,25 @@ void CreateAutoProvisioningGroupResult::parse(const std::string &payload) Json::Value value; reader.parse(payload, value); setRequestId(value["RequestId"].asString()); + auto allLaunchResultsNode = value["LaunchResults"]["LaunchResult"]; + 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(); + auto allInstanceIds = value["InstanceIds"]["InstanceId"]; + for (auto value : allInstanceIds) + launchResultsObject.instanceIds.push_back(value.asString()); + launchResults_.push_back(launchResultsObject); + } if(!value["AutoProvisioningGroupId"].isNull()) autoProvisioningGroupId_ = value["AutoProvisioningGroupId"].asString(); @@ -49,3 +68,8 @@ std::string CreateAutoProvisioningGroupResult::getAutoProvisioningGroupId()const return autoProvisioningGroupId_; } +std::vector CreateAutoProvisioningGroupResult::getLaunchResults()const +{ + return launchResults_; +} +