DescribeInstanceTypes add CpuOptions.

This commit is contained in:
sdk-team
2024-10-31 12:18:01 +00:00
parent 5cdab50afe
commit 5edf5643a2
3 changed files with 10 additions and 1 deletions

View File

@@ -39,6 +39,10 @@ namespace AlibabaCloud
int vfQueueNumberPerEni;
bool sriovSupport;
};
struct CpuOptions
{
std::vector<std::string> supportedTopologyTypes;
};
struct NetworkCardInfo
{
int networkCardIndex;
@@ -70,6 +74,7 @@ namespace AlibabaCloud
float gPUMemorySize;
int eniTotalQuantity;
int cpuCoreCount;
CpuOptions cpuOptions;
int initialCredit;
int networkCardQuantity;
std::string instanceCategory;

View File

@@ -130,6 +130,10 @@ void DescribeInstanceTypesResult::parse(const std::string &payload)
instanceTypesObject.enhancedNetwork.sriovSupport = enhancedNetworkNode["SriovSupport"].asString() == "true";
if(!enhancedNetworkNode["VfQueueNumberPerEni"].isNull())
instanceTypesObject.enhancedNetwork.vfQueueNumberPerEni = std::stoi(enhancedNetworkNode["VfQueueNumberPerEni"].asString());
auto cpuOptionsNode = value["CpuOptions"];
auto allSupportedTopologyTypes = cpuOptionsNode["SupportedTopologyTypes"]["SupportedTopologyType"];
for (auto value : allSupportedTopologyTypes)
instanceTypesObject.cpuOptions.supportedTopologyTypes.push_back(value.asString());
auto allSupportedBootModes = value["SupportedBootModes"]["SupportedBootMode"];
for (auto value : allSupportedBootModes)
instanceTypesObject.supportedBootModes.push_back(value.asString());