CreateAutoProvisioningGroup support NetworkInterface.

This commit is contained in:
sdk-team
2023-06-13 17:36:33 +00:00
parent a79257acaa
commit 3267f3d649
5 changed files with 46 additions and 1 deletions

View File

@@ -1 +1 @@
1.36.1605
1.36.1606

View File

@@ -65,11 +65,19 @@ public:
int maxQuantity;
std::string instanceFamilyLevel;
std::string burstablePerformance;
struct SecondaryNetworkInterface {
std::string vSwitchId;
};
std::vector<SecondaryNetworkInterface> secondaryNetworkInterface;
};
struct LaunchConfigurationTag {
std::string key;
std::string value;
};
struct LaunchConfigurationNetworkInterface {
std::string securityGroupId;
std::string instanceType;
};
CreateAutoProvisioningGroupRequest();
~CreateAutoProvisioningGroupRequest();
std::vector<LaunchConfigurationDataDisk> getLaunchConfigurationDataDisk() const;
@@ -92,6 +100,8 @@ public:
void setLaunchConfigurationImageId(const std::string &launchConfigurationImageId);
std::string getLaunchConfigurationResourceGroupId() const;
void setLaunchConfigurationResourceGroupId(const std::string &launchConfigurationResourceGroupId);
bool getResourcePlanningOnly() const;
void setResourcePlanningOnly(bool resourcePlanningOnly);
std::string getLaunchConfigurationPassword() const;
void setLaunchConfigurationPassword(const std::string &launchConfigurationPassword);
std::string getLaunchConfigurationAutoReleaseTime() const;
@@ -190,6 +200,8 @@ public:
void setTotalTargetCapacity(const std::string &totalTargetCapacity);
std::string getSpotTargetCapacity() const;
void setSpotTargetCapacity(const std::string &spotTargetCapacity);
std::vector<LaunchConfigurationNetworkInterface> getLaunchConfigurationNetworkInterface() const;
void setLaunchConfigurationNetworkInterface(const std::vector<LaunchConfigurationNetworkInterface> &launchConfigurationNetworkInterface);
std::string getValidFrom() const;
void setValidFrom(const std::string &validFrom);
std::string getAutoProvisioningGroupName() const;
@@ -206,6 +218,7 @@ private:
std::string resourceGroupId_;
std::string launchConfigurationImageId_;
std::string launchConfigurationResourceGroupId_;
bool resourcePlanningOnly_;
std::string launchConfigurationPassword_;
std::string launchConfigurationAutoReleaseTime_;
std::string payAsYouGoAllocationStrategy_;
@@ -255,6 +268,7 @@ private:
bool hibernationOptionsConfigured_;
std::string totalTargetCapacity_;
std::string spotTargetCapacity_;
std::vector<LaunchConfigurationNetworkInterface> launchConfigurationNetworkInterface_;
std::string validFrom_;
std::string autoProvisioningGroupName_;
};

View File

@@ -35,6 +35,7 @@ namespace AlibabaCloud
struct LaunchResult
{
std::string zoneId;
int amount;
std::string errorMsg;
std::string errorCode;
std::string instanceType;

View File

@@ -126,6 +126,15 @@ void CreateAutoProvisioningGroupRequest::setLaunchConfigurationResourceGroupId(c
setParameter(std::string("LaunchConfiguration.ResourceGroupId"), launchConfigurationResourceGroupId);
}
bool CreateAutoProvisioningGroupRequest::getResourcePlanningOnly() const {
return resourcePlanningOnly_;
}
void CreateAutoProvisioningGroupRequest::setResourcePlanningOnly(bool resourcePlanningOnly) {
resourcePlanningOnly_ = resourcePlanningOnly;
setParameter(std::string("ResourcePlanningOnly"), resourcePlanningOnly ? "true" : "false");
}
std::string CreateAutoProvisioningGroupRequest::getLaunchConfigurationPassword() const {
return launchConfigurationPassword_;
}
@@ -447,6 +456,11 @@ void CreateAutoProvisioningGroupRequest::setLaunchTemplateConfig(const std::vect
setParameter(launchTemplateConfigObjStr + ".MaxQuantity", std::to_string(launchTemplateConfigObj.maxQuantity));
setParameter(launchTemplateConfigObjStr + ".InstanceFamilyLevel", launchTemplateConfigObj.instanceFamilyLevel);
setParameter(launchTemplateConfigObjStr + ".BurstablePerformance", launchTemplateConfigObj.burstablePerformance);
for(int dep2 = 0; dep2 != launchTemplateConfigObj.secondaryNetworkInterface.size(); dep2++) {
auto secondaryNetworkInterfaceObj = launchTemplateConfigObj.secondaryNetworkInterface.at(dep2);
std::string secondaryNetworkInterfaceObjStr = launchTemplateConfigObjStr + ".SecondaryNetworkInterface" + "." + std::to_string(dep2 + 1);
setParameter(secondaryNetworkInterfaceObjStr + ".VSwitchId", secondaryNetworkInterfaceObj.vSwitchId);
}
}
}
@@ -599,6 +613,20 @@ void CreateAutoProvisioningGroupRequest::setSpotTargetCapacity(const std::string
setParameter(std::string("SpotTargetCapacity"), spotTargetCapacity);
}
std::vector<CreateAutoProvisioningGroupRequest::LaunchConfigurationNetworkInterface> CreateAutoProvisioningGroupRequest::getLaunchConfigurationNetworkInterface() const {
return launchConfigurationNetworkInterface_;
}
void CreateAutoProvisioningGroupRequest::setLaunchConfigurationNetworkInterface(const std::vector<CreateAutoProvisioningGroupRequest::LaunchConfigurationNetworkInterface> &launchConfigurationNetworkInterface) {
launchConfigurationNetworkInterface_ = launchConfigurationNetworkInterface;
for(int dep1 = 0; dep1 != launchConfigurationNetworkInterface.size(); dep1++) {
auto launchConfigurationNetworkInterfaceObj = launchConfigurationNetworkInterface.at(dep1);
std::string launchConfigurationNetworkInterfaceObjStr = std::string("LaunchConfiguration.NetworkInterface") + "." + std::to_string(dep1 + 1);
setParameter(launchConfigurationNetworkInterfaceObjStr + ".SecurityGroupId", launchConfigurationNetworkInterfaceObj.securityGroupId);
setParameter(launchConfigurationNetworkInterfaceObjStr + ".InstanceType", launchConfigurationNetworkInterfaceObj.instanceType);
}
}
std::string CreateAutoProvisioningGroupRequest::getValidFrom() const {
return validFrom_;
}

View File

@@ -53,6 +53,8 @@ void CreateAutoProvisioningGroupResult::parse(const std::string &payload)
launchResultsObject.errorCode = valueLaunchResultsLaunchResult["ErrorCode"].asString();
if(!valueLaunchResultsLaunchResult["SpotStrategy"].isNull())
launchResultsObject.spotStrategy = valueLaunchResultsLaunchResult["SpotStrategy"].asString();
if(!valueLaunchResultsLaunchResult["Amount"].isNull())
launchResultsObject.amount = std::stoi(valueLaunchResultsLaunchResult["Amount"].asString());
auto allInstanceIds = value["InstanceIds"]["InstanceId"];
for (auto value : allInstanceIds)
launchResultsObject.instanceIds.push_back(value.asString());