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();
~ListInstancesRequest(); ~ListInstancesRequest();
std::string getPlanType() const;
void setPlanType(const std::string &planType);
int getPageNumber() const; int getPageNumber() const;
void setPageNumber(int pageNumber); void setPageNumber(int pageNumber);
std::string getResourceGroupId() const; std::string getResourceGroupId() const;
@@ -56,6 +58,7 @@ public:
void setStatus(const std::string &status); void setStatus(const std::string &status);
private: private:
std::string planType_;
int pageNumber_; int pageNumber_;
std::string resourceGroupId_; std::string resourceGroupId_;
std::string regionId_; std::string regionId_;

View File

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

View File

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

View File

@@ -25,6 +25,15 @@ ListInstancesRequest::ListInstancesRequest()
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 { int ListInstancesRequest::getPageNumber() const {
return pageNumber_; return pageNumber_;
} }

View File

@@ -79,6 +79,8 @@ void ListInstancesResult::parse(const std::string &payload)
instancesObject.uuid = valueInstancesInstance["Uuid"].asString(); instancesObject.uuid = valueInstancesInstance["Uuid"].asString();
if(!valueInstancesInstance["ResourceGroupId"].isNull()) if(!valueInstancesInstance["ResourceGroupId"].isNull())
instancesObject.resourceGroupId = valueInstancesInstance["ResourceGroupId"].asString(); instancesObject.resourceGroupId = valueInstancesInstance["ResourceGroupId"].asString();
if(!valueInstancesInstance["PlanType"].isNull())
instancesObject.planType = valueInstancesInstance["PlanType"].asString();
auto allTagsNode = valueInstancesInstance["Tags"]["tag"]; auto allTagsNode = valueInstancesInstance["Tags"]["tag"];
for (auto valueInstancesInstanceTagstag : allTagsNode) for (auto valueInstancesInstanceTagstag : allTagsNode)
{ {
@@ -129,6 +131,20 @@ void ListInstancesResult::parse(const std::string &payload)
} }
instancesObject.disks.push_back(disksObject); 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"]; auto resourceSpecNode = value["ResourceSpec"];
if(!resourceSpecNode["DiskCategory"].isNull()) if(!resourceSpecNode["DiskCategory"].isNull())
instancesObject.resourceSpec.diskCategory = resourceSpecNode["DiskCategory"].asString(); 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()); plansObject.diskSize = std::stoi(valuePlansPlan["DiskSize"].asString());
if(!valuePlansPlan["Flow"].isNull()) if(!valuePlansPlan["Flow"].isNull())
plansObject.flow = std::stoi(valuePlansPlan["Flow"].asString()); plansObject.flow = std::stoi(valuePlansPlan["Flow"].asString());
if(!valuePlansPlan["Memory"].isNull())
plansObject.memory = std::stoi(valuePlansPlan["Memory"].asString());
if(!valuePlansPlan["PlanId"].isNull()) if(!valuePlansPlan["PlanId"].isNull())
plansObject.planId = valuePlansPlan["PlanId"].asString(); plansObject.planId = valuePlansPlan["PlanId"].asString();
if(!valuePlansPlan["DiskType"].isNull()) if(!valuePlansPlan["DiskType"].isNull())
plansObject.diskType = valuePlansPlan["DiskType"].asString(); plansObject.diskType = valuePlansPlan["DiskType"].asString();
if(!valuePlansPlan["OriginPrice"].isNull())
plansObject.originPrice = valuePlansPlan["OriginPrice"].asString();
if(!valuePlansPlan["Currency"].isNull()) if(!valuePlansPlan["Currency"].isNull())
plansObject.currency = valuePlansPlan["Currency"].asString(); plansObject.currency = valuePlansPlan["Currency"].asString();
if(!valuePlansPlan["SupportPlatform"].isNull()) if(!valuePlansPlan["SupportPlatform"].isNull())
plansObject.supportPlatform = valuePlansPlan["SupportPlatform"].asString(); plansObject.supportPlatform = valuePlansPlan["SupportPlatform"].asString();
if(!valuePlansPlan["PlanType"].isNull()) if(!valuePlansPlan["PlanType"].isNull())
plansObject.planType = valuePlansPlan["PlanType"].asString(); 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); plans_.push_back(plansObject);
} }