Support input parameter ClientToken for CreateAutoProvisioningGroup.

This commit is contained in:
sdk-team
2021-01-06 03:44:45 +00:00
parent e941e2f1df
commit f75ad9a460
5 changed files with 52 additions and 0 deletions

View File

@@ -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_;

View File

@@ -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::LaunchResult> CreateAutoProvisioningGroupResult::getLaunchResults()const
{
return launchResults_;
}