Support describe and modify NVMe on instance.
This commit is contained in:
@@ -71,6 +71,8 @@ public:
|
||||
void setName(const std::string &name);
|
||||
bool getEnableParameter() const;
|
||||
void setEnableParameter(bool enableParameter);
|
||||
std::string getLauncher() const;
|
||||
void setLauncher(const std::string &launcher);
|
||||
|
||||
private:
|
||||
long resourceOwnerId_;
|
||||
@@ -89,6 +91,7 @@ private:
|
||||
long ownerId_;
|
||||
std::string name_;
|
||||
bool enableParameter_;
|
||||
std::string launcher_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace Ecs
|
||||
|
||||
@@ -61,6 +61,7 @@ namespace AlibabaCloud
|
||||
int version;
|
||||
int invokeTimes;
|
||||
std::string creationTime;
|
||||
std::string launcher;
|
||||
bool latest;
|
||||
bool enableParameter;
|
||||
std::string commandId;
|
||||
|
||||
@@ -36,8 +36,16 @@ namespace AlibabaCloud
|
||||
{
|
||||
struct AllocatedResource
|
||||
{
|
||||
struct ElasticityAssuranceUsage
|
||||
{
|
||||
int usedAmount;
|
||||
std::string accountId;
|
||||
std::string serviceName;
|
||||
};
|
||||
int usedAmount;
|
||||
std::string zoneId;
|
||||
std::vector<AllocatedResource::ElasticityAssuranceUsage> elasticityAssuranceUsages;
|
||||
int availableAmount;
|
||||
int totalAmount;
|
||||
std::string instanceType;
|
||||
};
|
||||
@@ -54,6 +62,7 @@ namespace AlibabaCloud
|
||||
std::string latestStartTime;
|
||||
std::string privatePoolOptionsName;
|
||||
std::string instanceChargeType;
|
||||
std::string elasticityAssuranceOwnerId;
|
||||
std::string startTime;
|
||||
std::string startTimeType;
|
||||
std::string privatePoolOptionsMatchCriteria;
|
||||
|
||||
@@ -85,6 +85,7 @@ namespace AlibabaCloud
|
||||
struct ImageOptions
|
||||
{
|
||||
bool loginAsNonRoot;
|
||||
bool currentOSNVMeSupported;
|
||||
};
|
||||
struct PrivateDnsNameOptions
|
||||
{
|
||||
|
||||
@@ -52,6 +52,8 @@ public:
|
||||
void setOwnerId(long ownerId);
|
||||
std::string getName() const;
|
||||
void setName(const std::string &name);
|
||||
std::string getLauncher() const;
|
||||
void setLauncher(const std::string &launcher);
|
||||
|
||||
private:
|
||||
long resourceOwnerId_;
|
||||
@@ -65,6 +67,7 @@ private:
|
||||
std::string ownerAccount_;
|
||||
long ownerId_;
|
||||
std::string name_;
|
||||
std::string launcher_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace Ecs
|
||||
|
||||
@@ -35,6 +35,9 @@ public:
|
||||
bool enableIpDnsARecord;
|
||||
bool enableIpDnsPtrRecord;
|
||||
};
|
||||
struct ImageOptions {
|
||||
bool currentOSNVMeSupported;
|
||||
};
|
||||
struct AdditionalInfo {
|
||||
std::string pvdConfig;
|
||||
bool enableHighDensityMode;
|
||||
@@ -65,6 +68,8 @@ public:
|
||||
void setPrivateDnsNameOptions(const PrivateDnsNameOptions &privateDnsNameOptions);
|
||||
std::string getCpuOptionsTopologyType() const;
|
||||
void setCpuOptionsTopologyType(const std::string &cpuOptionsTopologyType);
|
||||
ImageOptions getImageOptions() const;
|
||||
void setImageOptions(const ImageOptions &imageOptions);
|
||||
std::string getOSNameEn() const;
|
||||
void setOSNameEn(const std::string &oSNameEn);
|
||||
bool getEnableJumboFrame() const;
|
||||
@@ -99,6 +104,7 @@ private:
|
||||
std::string hostName_;
|
||||
PrivateDnsNameOptions privateDnsNameOptions_;
|
||||
std::string cpuOptionsTopologyType_;
|
||||
ImageOptions imageOptions_;
|
||||
std::string oSNameEn_;
|
||||
bool enableJumboFrame_;
|
||||
std::string resourceOwnerAccount_;
|
||||
|
||||
@@ -180,3 +180,12 @@ void CreateCommandRequest::setEnableParameter(bool enableParameter) {
|
||||
setParameter(std::string("EnableParameter"), enableParameter ? "true" : "false");
|
||||
}
|
||||
|
||||
std::string CreateCommandRequest::getLauncher() const {
|
||||
return launcher_;
|
||||
}
|
||||
|
||||
void CreateCommandRequest::setLauncher(const std::string &launcher) {
|
||||
launcher_ = launcher;
|
||||
setParameter(std::string("Launcher"), launcher);
|
||||
}
|
||||
|
||||
|
||||
@@ -73,6 +73,8 @@ void DescribeCommandsResult::parse(const std::string &payload)
|
||||
commandsObject.enableParameter = valueCommandsCommand["EnableParameter"].asString() == "true";
|
||||
if(!valueCommandsCommand["ResourceGroupId"].isNull())
|
||||
commandsObject.resourceGroupId = valueCommandsCommand["ResourceGroupId"].asString();
|
||||
if(!valueCommandsCommand["Launcher"].isNull())
|
||||
commandsObject.launcher = valueCommandsCommand["Launcher"].asString();
|
||||
auto allParameterDefinitionsNode = valueCommandsCommand["ParameterDefinitions"]["ParameterDefinition"];
|
||||
for (auto valueCommandsCommandParameterDefinitionsParameterDefinition : allParameterDefinitionsNode)
|
||||
{
|
||||
|
||||
@@ -71,6 +71,8 @@ void DescribeElasticityAssurancesResult::parse(const std::string &payload)
|
||||
elasticityAssuranceSetObject.instanceChargeType = valueElasticityAssuranceSetElasticityAssuranceItem["InstanceChargeType"].asString();
|
||||
if(!valueElasticityAssuranceSetElasticityAssuranceItem["StartTimeType"].isNull())
|
||||
elasticityAssuranceSetObject.startTimeType = valueElasticityAssuranceSetElasticityAssuranceItem["StartTimeType"].asString();
|
||||
if(!valueElasticityAssuranceSetElasticityAssuranceItem["ElasticityAssuranceOwnerId"].isNull())
|
||||
elasticityAssuranceSetObject.elasticityAssuranceOwnerId = valueElasticityAssuranceSetElasticityAssuranceItem["ElasticityAssuranceOwnerId"].asString();
|
||||
auto allAllocatedResourcesNode = valueElasticityAssuranceSetElasticityAssuranceItem["AllocatedResources"]["AllocatedResource"];
|
||||
for (auto valueElasticityAssuranceSetElasticityAssuranceItemAllocatedResourcesAllocatedResource : allAllocatedResourcesNode)
|
||||
{
|
||||
@@ -79,10 +81,24 @@ void DescribeElasticityAssurancesResult::parse(const std::string &payload)
|
||||
allocatedResourcesObject.usedAmount = std::stoi(valueElasticityAssuranceSetElasticityAssuranceItemAllocatedResourcesAllocatedResource["UsedAmount"].asString());
|
||||
if(!valueElasticityAssuranceSetElasticityAssuranceItemAllocatedResourcesAllocatedResource["TotalAmount"].isNull())
|
||||
allocatedResourcesObject.totalAmount = std::stoi(valueElasticityAssuranceSetElasticityAssuranceItemAllocatedResourcesAllocatedResource["TotalAmount"].asString());
|
||||
if(!valueElasticityAssuranceSetElasticityAssuranceItemAllocatedResourcesAllocatedResource["AvailableAmount"].isNull())
|
||||
allocatedResourcesObject.availableAmount = std::stoi(valueElasticityAssuranceSetElasticityAssuranceItemAllocatedResourcesAllocatedResource["AvailableAmount"].asString());
|
||||
if(!valueElasticityAssuranceSetElasticityAssuranceItemAllocatedResourcesAllocatedResource["zoneId"].isNull())
|
||||
allocatedResourcesObject.zoneId = valueElasticityAssuranceSetElasticityAssuranceItemAllocatedResourcesAllocatedResource["zoneId"].asString();
|
||||
if(!valueElasticityAssuranceSetElasticityAssuranceItemAllocatedResourcesAllocatedResource["InstanceType"].isNull())
|
||||
allocatedResourcesObject.instanceType = valueElasticityAssuranceSetElasticityAssuranceItemAllocatedResourcesAllocatedResource["InstanceType"].asString();
|
||||
auto allElasticityAssuranceUsagesNode = valueElasticityAssuranceSetElasticityAssuranceItemAllocatedResourcesAllocatedResource["ElasticityAssuranceUsages"]["ElasticityAssuranceUsage"];
|
||||
for (auto valueElasticityAssuranceSetElasticityAssuranceItemAllocatedResourcesAllocatedResourceElasticityAssuranceUsagesElasticityAssuranceUsage : allElasticityAssuranceUsagesNode)
|
||||
{
|
||||
ElasticityAssuranceItem::AllocatedResource::ElasticityAssuranceUsage elasticityAssuranceUsagesObject;
|
||||
if(!valueElasticityAssuranceSetElasticityAssuranceItemAllocatedResourcesAllocatedResourceElasticityAssuranceUsagesElasticityAssuranceUsage["AccountId"].isNull())
|
||||
elasticityAssuranceUsagesObject.accountId = valueElasticityAssuranceSetElasticityAssuranceItemAllocatedResourcesAllocatedResourceElasticityAssuranceUsagesElasticityAssuranceUsage["AccountId"].asString();
|
||||
if(!valueElasticityAssuranceSetElasticityAssuranceItemAllocatedResourcesAllocatedResourceElasticityAssuranceUsagesElasticityAssuranceUsage["ServiceName"].isNull())
|
||||
elasticityAssuranceUsagesObject.serviceName = valueElasticityAssuranceSetElasticityAssuranceItemAllocatedResourcesAllocatedResourceElasticityAssuranceUsagesElasticityAssuranceUsage["ServiceName"].asString();
|
||||
if(!valueElasticityAssuranceSetElasticityAssuranceItemAllocatedResourcesAllocatedResourceElasticityAssuranceUsagesElasticityAssuranceUsage["UsedAmount"].isNull())
|
||||
elasticityAssuranceUsagesObject.usedAmount = std::stoi(valueElasticityAssuranceSetElasticityAssuranceItemAllocatedResourcesAllocatedResourceElasticityAssuranceUsagesElasticityAssuranceUsage["UsedAmount"].asString());
|
||||
allocatedResourcesObject.elasticityAssuranceUsages.push_back(elasticityAssuranceUsagesObject);
|
||||
}
|
||||
elasticityAssuranceSetObject.allocatedResources.push_back(allocatedResourcesObject);
|
||||
}
|
||||
auto allTagsNode = valueElasticityAssuranceSetElasticityAssuranceItem["Tags"]["Tag"];
|
||||
|
||||
@@ -269,6 +269,8 @@ void DescribeInstancesResult::parse(const std::string &payload)
|
||||
auto imageOptionsNode = value["ImageOptions"];
|
||||
if(!imageOptionsNode["LoginAsNonRoot"].isNull())
|
||||
instancesObject.imageOptions.loginAsNonRoot = imageOptionsNode["LoginAsNonRoot"].asString() == "true";
|
||||
if(!imageOptionsNode["CurrentOSNVMeSupported"].isNull())
|
||||
instancesObject.imageOptions.currentOSNVMeSupported = imageOptionsNode["CurrentOSNVMeSupported"].asString() == "true";
|
||||
auto privateDnsNameOptionsNode = value["PrivateDnsNameOptions"];
|
||||
if(!privateDnsNameOptionsNode["EnableInstanceIdDnsARecord"].isNull())
|
||||
instancesObject.privateDnsNameOptions.enableInstanceIdDnsARecord = privateDnsNameOptionsNode["EnableInstanceIdDnsARecord"].asString() == "true";
|
||||
|
||||
@@ -124,3 +124,12 @@ void ModifyCommandRequest::setName(const std::string &name) {
|
||||
setParameter(std::string("Name"), name);
|
||||
}
|
||||
|
||||
std::string ModifyCommandRequest::getLauncher() const {
|
||||
return launcher_;
|
||||
}
|
||||
|
||||
void ModifyCommandRequest::setLauncher(const std::string &launcher) {
|
||||
launcher_ = launcher;
|
||||
setParameter(std::string("Launcher"), launcher);
|
||||
}
|
||||
|
||||
|
||||
@@ -119,6 +119,15 @@ void ModifyInstanceAttributeRequest::setCpuOptionsTopologyType(const std::string
|
||||
setParameter(std::string("CpuOptions.TopologyType"), cpuOptionsTopologyType);
|
||||
}
|
||||
|
||||
ModifyInstanceAttributeRequest::ImageOptions ModifyInstanceAttributeRequest::getImageOptions() const {
|
||||
return imageOptions_;
|
||||
}
|
||||
|
||||
void ModifyInstanceAttributeRequest::setImageOptions(const ModifyInstanceAttributeRequest::ImageOptions &imageOptions) {
|
||||
imageOptions_ = imageOptions;
|
||||
setParameter(std::string("ImageOptions") + ".CurrentOSNVMeSupported", imageOptions.currentOSNVMeSupported ? "true" : "false");
|
||||
}
|
||||
|
||||
std::string ModifyInstanceAttributeRequest::getOSNameEn() const {
|
||||
return oSNameEn_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user