|
|
@@ -43,58 +43,58 @@ void DescribeDedicatedHostsResult::parse(const std::string &payload)
|
|
|
for (auto valueDedicatedHostsDedicatedHost : allDedicatedHostsNode)
|
|
|
{
|
|
|
DedicatedHost dedicatedHostsObject;
|
|
|
- if(!valueDedicatedHostsDedicatedHost["DedicatedHostId"].isNull())
|
|
|
- dedicatedHostsObject.dedicatedHostId = valueDedicatedHostsDedicatedHost["DedicatedHostId"].asString();
|
|
|
- if(!valueDedicatedHostsDedicatedHost["AutoPlacement"].isNull())
|
|
|
- dedicatedHostsObject.autoPlacement = valueDedicatedHostsDedicatedHost["AutoPlacement"].asString();
|
|
|
- if(!valueDedicatedHostsDedicatedHost["RegionId"].isNull())
|
|
|
- dedicatedHostsObject.regionId = valueDedicatedHostsDedicatedHost["RegionId"].asString();
|
|
|
- if(!valueDedicatedHostsDedicatedHost["ZoneId"].isNull())
|
|
|
- dedicatedHostsObject.zoneId = valueDedicatedHostsDedicatedHost["ZoneId"].asString();
|
|
|
- if(!valueDedicatedHostsDedicatedHost["DedicatedHostName"].isNull())
|
|
|
- dedicatedHostsObject.dedicatedHostName = valueDedicatedHostsDedicatedHost["DedicatedHostName"].asString();
|
|
|
- if(!valueDedicatedHostsDedicatedHost["MachineId"].isNull())
|
|
|
- dedicatedHostsObject.machineId = valueDedicatedHostsDedicatedHost["MachineId"].asString();
|
|
|
- if(!valueDedicatedHostsDedicatedHost["Description"].isNull())
|
|
|
- dedicatedHostsObject.description = valueDedicatedHostsDedicatedHost["Description"].asString();
|
|
|
- if(!valueDedicatedHostsDedicatedHost["DedicatedHostType"].isNull())
|
|
|
- dedicatedHostsObject.dedicatedHostType = valueDedicatedHostsDedicatedHost["DedicatedHostType"].asString();
|
|
|
- if(!valueDedicatedHostsDedicatedHost["Sockets"].isNull())
|
|
|
- dedicatedHostsObject.sockets = std::stoi(valueDedicatedHostsDedicatedHost["Sockets"].asString());
|
|
|
+ if(!valueDedicatedHostsDedicatedHost["CreationTime"].isNull())
|
|
|
+ dedicatedHostsObject.creationTime = valueDedicatedHostsDedicatedHost["CreationTime"].asString();
|
|
|
+ if(!valueDedicatedHostsDedicatedHost["Status"].isNull())
|
|
|
+ dedicatedHostsObject.status = valueDedicatedHostsDedicatedHost["Status"].asString();
|
|
|
if(!valueDedicatedHostsDedicatedHost["Cores"].isNull())
|
|
|
dedicatedHostsObject.cores = std::stoi(valueDedicatedHostsDedicatedHost["Cores"].asString());
|
|
|
- if(!valueDedicatedHostsDedicatedHost["PhysicalGpus"].isNull())
|
|
|
- dedicatedHostsObject.physicalGpus = std::stoi(valueDedicatedHostsDedicatedHost["PhysicalGpus"].asString());
|
|
|
+ if(!valueDedicatedHostsDedicatedHost["AutoPlacement"].isNull())
|
|
|
+ dedicatedHostsObject.autoPlacement = valueDedicatedHostsDedicatedHost["AutoPlacement"].asString();
|
|
|
if(!valueDedicatedHostsDedicatedHost["GPUSpec"].isNull())
|
|
|
dedicatedHostsObject.gPUSpec = valueDedicatedHostsDedicatedHost["GPUSpec"].asString();
|
|
|
- if(!valueDedicatedHostsDedicatedHost["ActionOnMaintenance"].isNull())
|
|
|
- dedicatedHostsObject.actionOnMaintenance = valueDedicatedHostsDedicatedHost["ActionOnMaintenance"].asString();
|
|
|
- if(!valueDedicatedHostsDedicatedHost["Status"].isNull())
|
|
|
- dedicatedHostsObject.status = valueDedicatedHostsDedicatedHost["Status"].asString();
|
|
|
- if(!valueDedicatedHostsDedicatedHost["CreationTime"].isNull())
|
|
|
- dedicatedHostsObject.creationTime = valueDedicatedHostsDedicatedHost["CreationTime"].asString();
|
|
|
+ if(!valueDedicatedHostsDedicatedHost["AutoReleaseTime"].isNull())
|
|
|
+ dedicatedHostsObject.autoReleaseTime = valueDedicatedHostsDedicatedHost["AutoReleaseTime"].asString();
|
|
|
if(!valueDedicatedHostsDedicatedHost["ChargeType"].isNull())
|
|
|
dedicatedHostsObject.chargeType = valueDedicatedHostsDedicatedHost["ChargeType"].asString();
|
|
|
+ if(!valueDedicatedHostsDedicatedHost["CpuOverCommitRatio"].isNull())
|
|
|
+ dedicatedHostsObject.cpuOverCommitRatio = std::stof(valueDedicatedHostsDedicatedHost["CpuOverCommitRatio"].asString());
|
|
|
+ if(!valueDedicatedHostsDedicatedHost["ActionOnMaintenance"].isNull())
|
|
|
+ dedicatedHostsObject.actionOnMaintenance = valueDedicatedHostsDedicatedHost["ActionOnMaintenance"].asString();
|
|
|
if(!valueDedicatedHostsDedicatedHost["SaleCycle"].isNull())
|
|
|
dedicatedHostsObject.saleCycle = valueDedicatedHostsDedicatedHost["SaleCycle"].asString();
|
|
|
+ if(!valueDedicatedHostsDedicatedHost["PhysicalGpus"].isNull())
|
|
|
+ dedicatedHostsObject.physicalGpus = std::stoi(valueDedicatedHostsDedicatedHost["PhysicalGpus"].asString());
|
|
|
+ if(!valueDedicatedHostsDedicatedHost["RegionId"].isNull())
|
|
|
+ dedicatedHostsObject.regionId = valueDedicatedHostsDedicatedHost["RegionId"].asString();
|
|
|
+ if(!valueDedicatedHostsDedicatedHost["DedicatedHostName"].isNull())
|
|
|
+ dedicatedHostsObject.dedicatedHostName = valueDedicatedHostsDedicatedHost["DedicatedHostName"].asString();
|
|
|
+ if(!valueDedicatedHostsDedicatedHost["Description"].isNull())
|
|
|
+ dedicatedHostsObject.description = valueDedicatedHostsDedicatedHost["Description"].asString();
|
|
|
+ if(!valueDedicatedHostsDedicatedHost["DedicatedHostClusterId"].isNull())
|
|
|
+ dedicatedHostsObject.dedicatedHostClusterId = valueDedicatedHostsDedicatedHost["DedicatedHostClusterId"].asString();
|
|
|
if(!valueDedicatedHostsDedicatedHost["ExpiredTime"].isNull())
|
|
|
dedicatedHostsObject.expiredTime = valueDedicatedHostsDedicatedHost["ExpiredTime"].asString();
|
|
|
- if(!valueDedicatedHostsDedicatedHost["AutoReleaseTime"].isNull())
|
|
|
- dedicatedHostsObject.autoReleaseTime = valueDedicatedHostsDedicatedHost["AutoReleaseTime"].asString();
|
|
|
+ if(!valueDedicatedHostsDedicatedHost["DedicatedHostType"].isNull())
|
|
|
+ dedicatedHostsObject.dedicatedHostType = valueDedicatedHostsDedicatedHost["DedicatedHostType"].asString();
|
|
|
if(!valueDedicatedHostsDedicatedHost["ResourceGroupId"].isNull())
|
|
|
dedicatedHostsObject.resourceGroupId = valueDedicatedHostsDedicatedHost["ResourceGroupId"].asString();
|
|
|
- if(!valueDedicatedHostsDedicatedHost["DedicatedHostClusterId"].isNull())
|
|
|
- dedicatedHostsObject.dedicatedHostClusterId = valueDedicatedHostsDedicatedHost["DedicatedHostClusterId"].asString();
|
|
|
- if(!valueDedicatedHostsDedicatedHost["CpuOverCommitRatio"].isNull())
|
|
|
- dedicatedHostsObject.cpuOverCommitRatio = std::stof(valueDedicatedHostsDedicatedHost["CpuOverCommitRatio"].asString());
|
|
|
+ if(!valueDedicatedHostsDedicatedHost["ZoneId"].isNull())
|
|
|
+ dedicatedHostsObject.zoneId = valueDedicatedHostsDedicatedHost["ZoneId"].asString();
|
|
|
+ if(!valueDedicatedHostsDedicatedHost["DedicatedHostId"].isNull())
|
|
|
+ dedicatedHostsObject.dedicatedHostId = valueDedicatedHostsDedicatedHost["DedicatedHostId"].asString();
|
|
|
+ if(!valueDedicatedHostsDedicatedHost["Sockets"].isNull())
|
|
|
+ dedicatedHostsObject.sockets = std::stoi(valueDedicatedHostsDedicatedHost["Sockets"].asString());
|
|
|
+ if(!valueDedicatedHostsDedicatedHost["MachineId"].isNull())
|
|
|
+ dedicatedHostsObject.machineId = valueDedicatedHostsDedicatedHost["MachineId"].asString();
|
|
|
auto allInstancesNode = valueDedicatedHostsDedicatedHost["Instances"]["Instance"];
|
|
|
for (auto valueDedicatedHostsDedicatedHostInstancesInstance : allInstancesNode)
|
|
|
{
|
|
|
DedicatedHost::Instance instancesObject;
|
|
|
- if(!valueDedicatedHostsDedicatedHostInstancesInstance["InstanceId"].isNull())
|
|
|
- instancesObject.instanceId = valueDedicatedHostsDedicatedHostInstancesInstance["InstanceId"].asString();
|
|
|
if(!valueDedicatedHostsDedicatedHostInstancesInstance["InstanceType"].isNull())
|
|
|
instancesObject.instanceType = valueDedicatedHostsDedicatedHostInstancesInstance["InstanceType"].asString();
|
|
|
+ if(!valueDedicatedHostsDedicatedHostInstancesInstance["InstanceId"].isNull())
|
|
|
+ instancesObject.instanceId = valueDedicatedHostsDedicatedHostInstancesInstance["InstanceId"].asString();
|
|
|
dedicatedHostsObject.instances.push_back(instancesObject);
|
|
|
}
|
|
|
auto allOperationLocksNode = valueDedicatedHostsDedicatedHost["OperationLocks"]["OperationLock"];
|
|
|
@@ -109,36 +109,36 @@ void DescribeDedicatedHostsResult::parse(const std::string &payload)
|
|
|
for (auto valueDedicatedHostsDedicatedHostTagsTag : allTagsNode)
|
|
|
{
|
|
|
DedicatedHost::Tag tagsObject;
|
|
|
- if(!valueDedicatedHostsDedicatedHostTagsTag["TagKey"].isNull())
|
|
|
- tagsObject.tagKey = valueDedicatedHostsDedicatedHostTagsTag["TagKey"].asString();
|
|
|
if(!valueDedicatedHostsDedicatedHostTagsTag["TagValue"].isNull())
|
|
|
tagsObject.tagValue = valueDedicatedHostsDedicatedHostTagsTag["TagValue"].asString();
|
|
|
+ if(!valueDedicatedHostsDedicatedHostTagsTag["TagKey"].isNull())
|
|
|
+ tagsObject.tagKey = valueDedicatedHostsDedicatedHostTagsTag["TagKey"].asString();
|
|
|
dedicatedHostsObject.tags.push_back(tagsObject);
|
|
|
}
|
|
|
auto capacityNode = value["Capacity"];
|
|
|
- if(!capacityNode["TotalVcpus"].isNull())
|
|
|
- dedicatedHostsObject.capacity.totalVcpus = std::stoi(capacityNode["TotalVcpus"].asString());
|
|
|
- if(!capacityNode["AvailableVcpus"].isNull())
|
|
|
- dedicatedHostsObject.capacity.availableVcpus = std::stoi(capacityNode["AvailableVcpus"].asString());
|
|
|
- if(!capacityNode["TotalVgpus"].isNull())
|
|
|
- dedicatedHostsObject.capacity.totalVgpus = std::stoi(capacityNode["TotalVgpus"].asString());
|
|
|
- if(!capacityNode["AvailableVgpus"].isNull())
|
|
|
- dedicatedHostsObject.capacity.availableVgpus = std::stoi(capacityNode["AvailableVgpus"].asString());
|
|
|
- if(!capacityNode["TotalMemory"].isNull())
|
|
|
- dedicatedHostsObject.capacity.totalMemory = std::stof(capacityNode["TotalMemory"].asString());
|
|
|
if(!capacityNode["AvailableMemory"].isNull())
|
|
|
dedicatedHostsObject.capacity.availableMemory = std::stof(capacityNode["AvailableMemory"].asString());
|
|
|
+ if(!capacityNode["LocalStorageCategory"].isNull())
|
|
|
+ dedicatedHostsObject.capacity.localStorageCategory = capacityNode["LocalStorageCategory"].asString();
|
|
|
+ if(!capacityNode["TotalMemory"].isNull())
|
|
|
+ dedicatedHostsObject.capacity.totalMemory = std::stof(capacityNode["TotalMemory"].asString());
|
|
|
if(!capacityNode["TotalLocalStorage"].isNull())
|
|
|
dedicatedHostsObject.capacity.totalLocalStorage = std::stoi(capacityNode["TotalLocalStorage"].asString());
|
|
|
+ if(!capacityNode["TotalVcpus"].isNull())
|
|
|
+ dedicatedHostsObject.capacity.totalVcpus = std::stoi(capacityNode["TotalVcpus"].asString());
|
|
|
+ if(!capacityNode["TotalVgpus"].isNull())
|
|
|
+ dedicatedHostsObject.capacity.totalVgpus = std::stoi(capacityNode["TotalVgpus"].asString());
|
|
|
if(!capacityNode["AvailableLocalStorage"].isNull())
|
|
|
dedicatedHostsObject.capacity.availableLocalStorage = std::stoi(capacityNode["AvailableLocalStorage"].asString());
|
|
|
- if(!capacityNode["LocalStorageCategory"].isNull())
|
|
|
- dedicatedHostsObject.capacity.localStorageCategory = capacityNode["LocalStorageCategory"].asString();
|
|
|
+ if(!capacityNode["AvailableVcpus"].isNull())
|
|
|
+ dedicatedHostsObject.capacity.availableVcpus = std::stoi(capacityNode["AvailableVcpus"].asString());
|
|
|
+ if(!capacityNode["AvailableVgpus"].isNull())
|
|
|
+ dedicatedHostsObject.capacity.availableVgpus = std::stoi(capacityNode["AvailableVgpus"].asString());
|
|
|
auto networkAttributesNode = value["NetworkAttributes"];
|
|
|
- if(!networkAttributesNode["SlbUdpTimeout"].isNull())
|
|
|
- dedicatedHostsObject.networkAttributes.slbUdpTimeout = std::stoi(networkAttributesNode["SlbUdpTimeout"].asString());
|
|
|
if(!networkAttributesNode["UdpTimeout"].isNull())
|
|
|
dedicatedHostsObject.networkAttributes.udpTimeout = std::stoi(networkAttributesNode["UdpTimeout"].asString());
|
|
|
+ if(!networkAttributesNode["SlbUdpTimeout"].isNull())
|
|
|
+ dedicatedHostsObject.networkAttributes.slbUdpTimeout = std::stoi(networkAttributesNode["SlbUdpTimeout"].asString());
|
|
|
auto hostDetailInfoNode = value["HostDetailInfo"];
|
|
|
if(!hostDetailInfoNode["SerialNumber"].isNull())
|
|
|
dedicatedHostsObject.hostDetailInfo.serialNumber = hostDetailInfoNode["SerialNumber"].asString();
|
|
|
@@ -153,12 +153,12 @@ void DescribeDedicatedHostsResult::parse(const std::string &payload)
|
|
|
dedicatedHostsObject.supportedInstanceTypesList.push_back(value.asString());
|
|
|
dedicatedHosts_.push_back(dedicatedHostsObject);
|
|
|
}
|
|
|
- if(!value["TotalCount"].isNull())
|
|
|
- totalCount_ = std::stoi(value["TotalCount"].asString());
|
|
|
- if(!value["PageNumber"].isNull())
|
|
|
- pageNumber_ = std::stoi(value["PageNumber"].asString());
|
|
|
if(!value["PageSize"].isNull())
|
|
|
pageSize_ = std::stoi(value["PageSize"].asString());
|
|
|
+ if(!value["PageNumber"].isNull())
|
|
|
+ pageNumber_ = std::stoi(value["PageNumber"].asString());
|
|
|
+ if(!value["TotalCount"].isNull())
|
|
|
+ totalCount_ = std::stoi(value["TotalCount"].asString());
|
|
|
|
|
|
}
|
|
|
|