Skip to content

Commit af9bc95

Browse files
committedMar 25, 2025·
Generated 2020-06-01 for SWAS-OPEN.
1 parent 4208be7 commit af9bc95

File tree

7 files changed

+72
-10
lines changed

7 files changed

+72
-10
lines changed
 

‎VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.36.2051
1+
1.36.2052

‎swas-open/include/alibabacloud/swas-open/model/ListInstancesRequest.h

+3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ class ALIBABACLOUD_SWAS_OPEN_EXPORT ListInstancesRequest : public RpcServiceRequ
3434
};
3535
ListInstancesRequest();
3636
~ListInstancesRequest();
37+
std::string getPlanType() const;
38+
void setPlanType(const std::string &planType);
3739
int getPageNumber() const;
3840
void setPageNumber(int pageNumber);
3941
std::string getResourceGroupId() const;
@@ -56,6 +58,7 @@ class ALIBABACLOUD_SWAS_OPEN_EXPORT ListInstancesRequest : public RpcServiceRequ
5658
void setStatus(const std::string &status);
5759

5860
private:
61+
std::string planType_;
5962
int pageNumber_;
6063
std::string resourceGroupId_;
6164
std::string regionId_;

‎swas-open/include/alibabacloud/swas-open/model/ListInstancesResult.h

+9
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ namespace AlibabaCloud
7878
std::string regionId;
7979
std::string diskId;
8080
};
81+
struct NetworkAttribute
82+
{
83+
std::string publicIpAddress;
84+
std::string privateIpAddress;
85+
int peakBandwidth;
86+
std::string publicIpDdosStatus;
87+
};
8188
std::string status;
8289
std::string disableReason;
8390
std::string resourceGroupId;
@@ -90,13 +97,15 @@ namespace AlibabaCloud
9097
std::string businessStatus;
9198
std::string publicIpAddress;
9299
std::string instanceName;
100+
std::vector<Instance::NetworkAttribute> networkAttributes;
93101
std::string innerIpAddress;
94102
std::string uuid;
95103
std::string chargeType;
96104
bool combination;
97105
std::string expiredTime;
98106
std::string creationTime;
99107
std::string imageId;
108+
std::string planType;
100109
std::vector<Instance::Disk> disks;
101110
std::string regionId;
102111
std::vector<Instance::Tag> tags;

‎swas-open/include/alibabacloud/swas-open/model/ListPlansResult.h

+14-5
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,26 @@ namespace AlibabaCloud
3434
public:
3535
struct Plan
3636
{
37-
std::string diskType;
38-
double originPrice;
37+
struct Tag
38+
{
39+
std::string color;
40+
std::string cnTitle;
41+
std::string enTitle;
42+
};
3943
std::string supportPlatform;
40-
int memory;
41-
int bandwidth;
44+
std::string publicIpNum;
45+
float memory;
4246
std::string planId;
47+
int flow;
48+
std::string diskType;
49+
std::string originPrice;
50+
std::string ispType;
51+
int bandwidth;
4352
std::string currency;
4453
int diskSize;
4554
std::string planType;
55+
std::vector<Plan::Tag> tags;
4656
int core;
47-
int flow;
4857
};
4958

5059

‎swas-open/src/model/ListInstancesRequest.cc

+9
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ ListInstancesRequest::ListInstancesRequest()
2525

2626
ListInstancesRequest::~ListInstancesRequest() {}
2727

28+
std::string ListInstancesRequest::getPlanType() const {
29+
return planType_;
30+
}
31+
32+
void ListInstancesRequest::setPlanType(const std::string &planType) {
33+
planType_ = planType;
34+
setParameter(std::string("PlanType"), planType);
35+
}
36+
2837
int ListInstancesRequest::getPageNumber() const {
2938
return pageNumber_;
3039
}

‎swas-open/src/model/ListInstancesResult.cc

+16
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ void ListInstancesResult::parse(const std::string &payload)
7979
instancesObject.uuid = valueInstancesInstance["Uuid"].asString();
8080
if(!valueInstancesInstance["ResourceGroupId"].isNull())
8181
instancesObject.resourceGroupId = valueInstancesInstance["ResourceGroupId"].asString();
82+
if(!valueInstancesInstance["PlanType"].isNull())
83+
instancesObject.planType = valueInstancesInstance["PlanType"].asString();
8284
auto allTagsNode = valueInstancesInstance["Tags"]["tag"];
8385
for (auto valueInstancesInstanceTagstag : allTagsNode)
8486
{
@@ -129,6 +131,20 @@ void ListInstancesResult::parse(const std::string &payload)
129131
}
130132
instancesObject.disks.push_back(disksObject);
131133
}
134+
auto allNetworkAttributesNode = valueInstancesInstance["NetworkAttributes"]["networkAttribute"];
135+
for (auto valueInstancesInstanceNetworkAttributesnetworkAttribute : allNetworkAttributesNode)
136+
{
137+
Instance::NetworkAttribute networkAttributesObject;
138+
if(!valueInstancesInstanceNetworkAttributesnetworkAttribute["PublicIpAddress"].isNull())
139+
networkAttributesObject.publicIpAddress = valueInstancesInstanceNetworkAttributesnetworkAttribute["PublicIpAddress"].asString();
140+
if(!valueInstancesInstanceNetworkAttributesnetworkAttribute["PrivateIpAddress"].isNull())
141+
networkAttributesObject.privateIpAddress = valueInstancesInstanceNetworkAttributesnetworkAttribute["PrivateIpAddress"].asString();
142+
if(!valueInstancesInstanceNetworkAttributesnetworkAttribute["PeakBandwidth"].isNull())
143+
networkAttributesObject.peakBandwidth = std::stoi(valueInstancesInstanceNetworkAttributesnetworkAttribute["PeakBandwidth"].asString());
144+
if(!valueInstancesInstanceNetworkAttributesnetworkAttribute["PublicIpDdosStatus"].isNull())
145+
networkAttributesObject.publicIpDdosStatus = valueInstancesInstanceNetworkAttributesnetworkAttribute["PublicIpDdosStatus"].asString();
146+
instancesObject.networkAttributes.push_back(networkAttributesObject);
147+
}
132148
auto resourceSpecNode = value["ResourceSpec"];
133149
if(!resourceSpecNode["DiskCategory"].isNull())
134150
instancesObject.resourceSpec.diskCategory = resourceSpecNode["DiskCategory"].asString();

‎swas-open/src/model/ListPlansResult.cc

+20-4
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,36 @@ void ListPlansResult::parse(const std::string &payload)
5151
plansObject.diskSize = std::stoi(valuePlansPlan["DiskSize"].asString());
5252
if(!valuePlansPlan["Flow"].isNull())
5353
plansObject.flow = std::stoi(valuePlansPlan["Flow"].asString());
54-
if(!valuePlansPlan["Memory"].isNull())
55-
plansObject.memory = std::stoi(valuePlansPlan["Memory"].asString());
5654
if(!valuePlansPlan["PlanId"].isNull())
5755
plansObject.planId = valuePlansPlan["PlanId"].asString();
5856
if(!valuePlansPlan["DiskType"].isNull())
5957
plansObject.diskType = valuePlansPlan["DiskType"].asString();
60-
if(!valuePlansPlan["OriginPrice"].isNull())
61-
plansObject.originPrice = valuePlansPlan["OriginPrice"].asString();
6258
if(!valuePlansPlan["Currency"].isNull())
6359
plansObject.currency = valuePlansPlan["Currency"].asString();
6460
if(!valuePlansPlan["SupportPlatform"].isNull())
6561
plansObject.supportPlatform = valuePlansPlan["SupportPlatform"].asString();
6662
if(!valuePlansPlan["PlanType"].isNull())
6763
plansObject.planType = valuePlansPlan["PlanType"].asString();
64+
if(!valuePlansPlan["PublicIpNum"].isNull())
65+
plansObject.publicIpNum = valuePlansPlan["PublicIpNum"].asString();
66+
if(!valuePlansPlan["IspType"].isNull())
67+
plansObject.ispType = valuePlansPlan["IspType"].asString();
68+
if(!valuePlansPlan["Memory"].isNull())
69+
plansObject.memory = std::stof(valuePlansPlan["Memory"].asString());
70+
if(!valuePlansPlan["OriginPrice"].isNull())
71+
plansObject.originPrice = valuePlansPlan["OriginPrice"].asString();
72+
auto allTagsNode = valuePlansPlan["Tags"]["Tag"];
73+
for (auto valuePlansPlanTagsTag : allTagsNode)
74+
{
75+
Plan::Tag tagsObject;
76+
if(!valuePlansPlanTagsTag["CnTitle"].isNull())
77+
tagsObject.cnTitle = valuePlansPlanTagsTag["CnTitle"].asString();
78+
if(!valuePlansPlanTagsTag["EnTitle"].isNull())
79+
tagsObject.enTitle = valuePlansPlanTagsTag["EnTitle"].asString();
80+
if(!valuePlansPlanTagsTag["Color"].isNull())
81+
tagsObject.color = valuePlansPlanTagsTag["Color"].asString();
82+
plansObject.tags.push_back(tagsObject);
83+
}
6884
plans_.push_back(plansObject);
6985
}
7086

0 commit comments

Comments
 (0)
Please sign in to comment.