Generated 2020-06-01 for SWAS-OPEN.

This commit is contained in:
sdk-team
2025-03-25 08:46:38 +00:00
parent 4208be77a5
commit af9bc95b0b
7 changed files with 72 additions and 10 deletions

View File

@@ -1 +1 @@
1.36.2051
1.36.2052

View File

@@ -34,6 +34,8 @@ public:
};
ListInstancesRequest();
~ListInstancesRequest();
std::string getPlanType() const;
void setPlanType(const std::string &planType);
int getPageNumber() const;
void setPageNumber(int pageNumber);
std::string getResourceGroupId() const;
@@ -56,6 +58,7 @@ public:
void setStatus(const std::string &status);
private:
std::string planType_;
int pageNumber_;
std::string resourceGroupId_;
std::string regionId_;

View File

@@ -78,6 +78,13 @@ namespace AlibabaCloud
std::string regionId;
std::string diskId;
};
struct NetworkAttribute
{
std::string publicIpAddress;
std::string privateIpAddress;
int peakBandwidth;
std::string publicIpDdosStatus;
};
std::string status;
std::string disableReason;
std::string resourceGroupId;
@@ -90,6 +97,7 @@ namespace AlibabaCloud
std::string businessStatus;
std::string publicIpAddress;
std::string instanceName;
std::vector<Instance::NetworkAttribute> networkAttributes;
std::string innerIpAddress;
std::string uuid;
std::string chargeType;
@@ -97,6 +105,7 @@ namespace AlibabaCloud
std::string expiredTime;
std::string creationTime;
std::string imageId;
std::string planType;
std::vector<Instance::Disk> disks;
std::string regionId;
std::vector<Instance::Tag> tags;

View File

@@ -34,17 +34,26 @@ namespace AlibabaCloud
public:
struct Plan
{
std::string diskType;
double originPrice;
struct Tag
{
std::string color;
std::string cnTitle;
std::string enTitle;
};
std::string supportPlatform;
int memory;
int bandwidth;
std::string publicIpNum;
float memory;
std::string planId;
int flow;
std::string diskType;
std::string originPrice;
std::string ispType;
int bandwidth;
std::string currency;
int diskSize;
std::string planType;
std::vector<Plan::Tag> tags;
int core;
int flow;
};

View File

@@ -25,6 +25,15 @@ ListInstancesRequest::ListInstancesRequest()
ListInstancesRequest::~ListInstancesRequest() {}
std::string ListInstancesRequest::getPlanType() const {
return planType_;
}
void ListInstancesRequest::setPlanType(const std::string &planType) {
planType_ = planType;
setParameter(std::string("PlanType"), planType);
}
int ListInstancesRequest::getPageNumber() const {
return pageNumber_;
}

View File

@@ -79,6 +79,8 @@ void ListInstancesResult::parse(const std::string &payload)
instancesObject.uuid = valueInstancesInstance["Uuid"].asString();
if(!valueInstancesInstance["ResourceGroupId"].isNull())
instancesObject.resourceGroupId = valueInstancesInstance["ResourceGroupId"].asString();
if(!valueInstancesInstance["PlanType"].isNull())
instancesObject.planType = valueInstancesInstance["PlanType"].asString();
auto allTagsNode = valueInstancesInstance["Tags"]["tag"];
for (auto valueInstancesInstanceTagstag : allTagsNode)
{
@@ -129,6 +131,20 @@ void ListInstancesResult::parse(const std::string &payload)
}
instancesObject.disks.push_back(disksObject);
}
auto allNetworkAttributesNode = valueInstancesInstance["NetworkAttributes"]["networkAttribute"];
for (auto valueInstancesInstanceNetworkAttributesnetworkAttribute : allNetworkAttributesNode)
{
Instance::NetworkAttribute networkAttributesObject;
if(!valueInstancesInstanceNetworkAttributesnetworkAttribute["PublicIpAddress"].isNull())
networkAttributesObject.publicIpAddress = valueInstancesInstanceNetworkAttributesnetworkAttribute["PublicIpAddress"].asString();
if(!valueInstancesInstanceNetworkAttributesnetworkAttribute["PrivateIpAddress"].isNull())
networkAttributesObject.privateIpAddress = valueInstancesInstanceNetworkAttributesnetworkAttribute["PrivateIpAddress"].asString();
if(!valueInstancesInstanceNetworkAttributesnetworkAttribute["PeakBandwidth"].isNull())
networkAttributesObject.peakBandwidth = std::stoi(valueInstancesInstanceNetworkAttributesnetworkAttribute["PeakBandwidth"].asString());
if(!valueInstancesInstanceNetworkAttributesnetworkAttribute["PublicIpDdosStatus"].isNull())
networkAttributesObject.publicIpDdosStatus = valueInstancesInstanceNetworkAttributesnetworkAttribute["PublicIpDdosStatus"].asString();
instancesObject.networkAttributes.push_back(networkAttributesObject);
}
auto resourceSpecNode = value["ResourceSpec"];
if(!resourceSpecNode["DiskCategory"].isNull())
instancesObject.resourceSpec.diskCategory = resourceSpecNode["DiskCategory"].asString();

View File

@@ -51,20 +51,36 @@ void ListPlansResult::parse(const std::string &payload)
plansObject.diskSize = std::stoi(valuePlansPlan["DiskSize"].asString());
if(!valuePlansPlan["Flow"].isNull())
plansObject.flow = std::stoi(valuePlansPlan["Flow"].asString());
if(!valuePlansPlan["Memory"].isNull())
plansObject.memory = std::stoi(valuePlansPlan["Memory"].asString());
if(!valuePlansPlan["PlanId"].isNull())
plansObject.planId = valuePlansPlan["PlanId"].asString();
if(!valuePlansPlan["DiskType"].isNull())
plansObject.diskType = valuePlansPlan["DiskType"].asString();
if(!valuePlansPlan["OriginPrice"].isNull())
plansObject.originPrice = valuePlansPlan["OriginPrice"].asString();
if(!valuePlansPlan["Currency"].isNull())
plansObject.currency = valuePlansPlan["Currency"].asString();
if(!valuePlansPlan["SupportPlatform"].isNull())
plansObject.supportPlatform = valuePlansPlan["SupportPlatform"].asString();
if(!valuePlansPlan["PlanType"].isNull())
plansObject.planType = valuePlansPlan["PlanType"].asString();
if(!valuePlansPlan["PublicIpNum"].isNull())
plansObject.publicIpNum = valuePlansPlan["PublicIpNum"].asString();
if(!valuePlansPlan["IspType"].isNull())
plansObject.ispType = valuePlansPlan["IspType"].asString();
if(!valuePlansPlan["Memory"].isNull())
plansObject.memory = std::stof(valuePlansPlan["Memory"].asString());
if(!valuePlansPlan["OriginPrice"].isNull())
plansObject.originPrice = valuePlansPlan["OriginPrice"].asString();
auto allTagsNode = valuePlansPlan["Tags"]["Tag"];
for (auto valuePlansPlanTagsTag : allTagsNode)
{
Plan::Tag tagsObject;
if(!valuePlansPlanTagsTag["CnTitle"].isNull())
tagsObject.cnTitle = valuePlansPlanTagsTag["CnTitle"].asString();
if(!valuePlansPlanTagsTag["EnTitle"].isNull())
tagsObject.enTitle = valuePlansPlanTagsTag["EnTitle"].asString();
if(!valuePlansPlanTagsTag["Color"].isNull())
tagsObject.color = valuePlansPlanTagsTag["Color"].asString();
plansObject.tags.push_back(tagsObject);
}
plans_.push_back(plansObject);
}