From 1d1099683ec57efad4dc131fb0bd1dd09525b54f Mon Sep 17 00:00:00 2001 From: sdk-team Date: Tue, 24 Dec 2024 10:07:48 +0000 Subject: [PATCH] Supported Jumbo for HDENI and LENI. --- VERSION | 2 +- eflo/CMakeLists.txt | 4 + eflo/include/alibabacloud/eflo/EfloClient.h | 8 ++ .../CreateElasticNetworkInterfaceRequest.h | 3 + .../eflo/model/CreateVccRequest.h | 3 + .../model/GetElasticNetworkInterfaceResult.h | 14 ++++ .../alibabacloud/eflo/model/GetVccResult.h | 1 + .../eflo/model/ListVccFlowInfosRequest.h | 57 +++++++++++++ .../eflo/model/ListVccFlowInfosResult.h | 69 +++++++++++++++ .../alibabacloud/eflo/model/ListVccsResult.h | 1 + eflo/src/EfloClient.cc | 36 ++++++++ .../CreateElasticNetworkInterfaceRequest.cc | 9 ++ eflo/src/model/CreateVccRequest.cc | 9 ++ .../model/GetElasticNetworkInterfaceResult.cc | 26 ++++++ eflo/src/model/GetVccResult.cc | 2 + eflo/src/model/ListVccFlowInfosRequest.cc | 81 ++++++++++++++++++ eflo/src/model/ListVccFlowInfosResult.cc | 84 +++++++++++++++++++ eflo/src/model/ListVccsResult.cc | 2 + 18 files changed, 410 insertions(+), 1 deletion(-) create mode 100644 eflo/include/alibabacloud/eflo/model/ListVccFlowInfosRequest.h create mode 100644 eflo/include/alibabacloud/eflo/model/ListVccFlowInfosResult.h create mode 100644 eflo/src/model/ListVccFlowInfosRequest.cc create mode 100644 eflo/src/model/ListVccFlowInfosResult.cc diff --git a/VERSION b/VERSION index 9d37f5ab1..6be841765 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.2032 \ No newline at end of file +1.36.2033 \ No newline at end of file diff --git a/eflo/CMakeLists.txt b/eflo/CMakeLists.txt index 01ae6131f..6a0c3daee 100644 --- a/eflo/CMakeLists.txt +++ b/eflo/CMakeLists.txt @@ -125,6 +125,8 @@ set(eflo_public_header_model include/alibabacloud/eflo/model/ListNodeInfosForPodResult.h include/alibabacloud/eflo/model/ListSubnetsRequest.h include/alibabacloud/eflo/model/ListSubnetsResult.h + include/alibabacloud/eflo/model/ListVccFlowInfosRequest.h + include/alibabacloud/eflo/model/ListVccFlowInfosResult.h include/alibabacloud/eflo/model/ListVccGrantRulesRequest.h include/alibabacloud/eflo/model/ListVccGrantRulesResult.h include/alibabacloud/eflo/model/ListVccRouteEntriesRequest.h @@ -268,6 +270,8 @@ set(eflo_src src/model/ListNodeInfosForPodResult.cc src/model/ListSubnetsRequest.cc src/model/ListSubnetsResult.cc + src/model/ListVccFlowInfosRequest.cc + src/model/ListVccFlowInfosResult.cc src/model/ListVccGrantRulesRequest.cc src/model/ListVccGrantRulesResult.cc src/model/ListVccRouteEntriesRequest.cc diff --git a/eflo/include/alibabacloud/eflo/EfloClient.h b/eflo/include/alibabacloud/eflo/EfloClient.h index 207b6a9cf..ff2a8a966 100644 --- a/eflo/include/alibabacloud/eflo/EfloClient.h +++ b/eflo/include/alibabacloud/eflo/EfloClient.h @@ -126,6 +126,8 @@ #include "model/ListNodeInfosForPodResult.h" #include "model/ListSubnetsRequest.h" #include "model/ListSubnetsResult.h" +#include "model/ListVccFlowInfosRequest.h" +#include "model/ListVccFlowInfosResult.h" #include "model/ListVccGrantRulesRequest.h" #include "model/ListVccGrantRulesResult.h" #include "model/ListVccRouteEntriesRequest.h" @@ -327,6 +329,9 @@ namespace AlibabaCloud typedef Outcome ListSubnetsOutcome; typedef std::future ListSubnetsOutcomeCallable; typedef std::function&)> ListSubnetsAsyncHandler; + typedef Outcome ListVccFlowInfosOutcome; + typedef std::future ListVccFlowInfosOutcomeCallable; + typedef std::function&)> ListVccFlowInfosAsyncHandler; typedef Outcome ListVccGrantRulesOutcome; typedef std::future ListVccGrantRulesOutcomeCallable; typedef std::function&)> ListVccGrantRulesAsyncHandler; @@ -542,6 +547,9 @@ namespace AlibabaCloud ListSubnetsOutcome listSubnets(const Model::ListSubnetsRequest &request)const; void listSubnetsAsync(const Model::ListSubnetsRequest& request, const ListSubnetsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListSubnetsOutcomeCallable listSubnetsCallable(const Model::ListSubnetsRequest& request) const; + ListVccFlowInfosOutcome listVccFlowInfos(const Model::ListVccFlowInfosRequest &request)const; + void listVccFlowInfosAsync(const Model::ListVccFlowInfosRequest& request, const ListVccFlowInfosAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ListVccFlowInfosOutcomeCallable listVccFlowInfosCallable(const Model::ListVccFlowInfosRequest& request) const; ListVccGrantRulesOutcome listVccGrantRules(const Model::ListVccGrantRulesRequest &request)const; void listVccGrantRulesAsync(const Model::ListVccGrantRulesRequest& request, const ListVccGrantRulesAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListVccGrantRulesOutcomeCallable listVccGrantRulesCallable(const Model::ListVccGrantRulesRequest& request) const; diff --git a/eflo/include/alibabacloud/eflo/model/CreateElasticNetworkInterfaceRequest.h b/eflo/include/alibabacloud/eflo/model/CreateElasticNetworkInterfaceRequest.h index ceb1b1a3b..a6269dceb 100644 --- a/eflo/include/alibabacloud/eflo/model/CreateElasticNetworkInterfaceRequest.h +++ b/eflo/include/alibabacloud/eflo/model/CreateElasticNetworkInterfaceRequest.h @@ -40,6 +40,8 @@ public: void setRegionId(const std::string ®ionId); std::string getNodeId() const; void setNodeId(const std::string &nodeId); + bool getEnableJumboFrame() const; + void setEnableJumboFrame(bool enableJumboFrame); std::string getVSwitchId() const; void setVSwitchId(const std::string &vSwitchId); std::string getVpcId() const; @@ -53,6 +55,7 @@ private: std::string description_; std::string regionId_; std::string nodeId_; + bool enableJumboFrame_; std::string vSwitchId_; std::string vpcId_; std::string zoneId_; diff --git a/eflo/include/alibabacloud/eflo/model/CreateVccRequest.h b/eflo/include/alibabacloud/eflo/model/CreateVccRequest.h index e777d5801..d612f10fd 100644 --- a/eflo/include/alibabacloud/eflo/model/CreateVccRequest.h +++ b/eflo/include/alibabacloud/eflo/model/CreateVccRequest.h @@ -42,6 +42,8 @@ public: void setDescription(const std::string &description); std::string getCenOwnerId() const; void setCenOwnerId(const std::string &cenOwnerId); + long getBgpAsn() const; + void setBgpAsn(long bgpAsn); bool getAccessCouldService() const; void setAccessCouldService(bool accessCouldService); std::string getResourceGroupId() const; @@ -72,6 +74,7 @@ private: std::string cenId_; std::string description_; std::string cenOwnerId_; + long bgpAsn_; bool accessCouldService_; std::string resourceGroupId_; std::string vccName_; diff --git a/eflo/include/alibabacloud/eflo/model/GetElasticNetworkInterfaceResult.h b/eflo/include/alibabacloud/eflo/model/GetElasticNetworkInterfaceResult.h index 11b32d5d8..8364f2d32 100644 --- a/eflo/include/alibabacloud/eflo/model/GetElasticNetworkInterfaceResult.h +++ b/eflo/include/alibabacloud/eflo/model/GetElasticNetworkInterfaceResult.h @@ -46,6 +46,18 @@ namespace AlibabaCloud std::string gmtModified; std::string regionId; }; + struct Ipv6Addresse + { + std::string status; + std::string elasticNetworkInterfaceId; + std::string ipName; + std::string gmtCreate; + std::string description; + std::string message; + std::string gmtModified; + std::string regionId; + std::string ipv6Address; + }; std::string status; std::string description; std::vector privateIpAddresses; @@ -57,10 +69,12 @@ namespace AlibabaCloud std::string securityGroupId; std::string mask; std::string gmtModified; + std::vector ipv6Addresses; std::string mac; std::string elasticNetworkInterfaceId; std::string type; std::string vpcId; + bool enableJumboFrame; std::string gateway; std::string nodeId; std::string regionId; diff --git a/eflo/include/alibabacloud/eflo/model/GetVccResult.h b/eflo/include/alibabacloud/eflo/model/GetVccResult.h index 6447f2604..082503758 100644 --- a/eflo/include/alibabacloud/eflo/model/GetVccResult.h +++ b/eflo/include/alibabacloud/eflo/model/GetVccResult.h @@ -120,6 +120,7 @@ namespace AlibabaCloud std::string duration; std::string payType; std::vector aliyunRouterInfo; + std::string bgpAsn; std::string internetChargeType; std::string bandwidthStr; std::vector cisRouterInfo; diff --git a/eflo/include/alibabacloud/eflo/model/ListVccFlowInfosRequest.h b/eflo/include/alibabacloud/eflo/model/ListVccFlowInfosRequest.h new file mode 100644 index 000000000..0703dfac4 --- /dev/null +++ b/eflo/include/alibabacloud/eflo/model/ListVccFlowInfosRequest.h @@ -0,0 +1,57 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_EFLO_MODEL_LISTVCCFLOWINFOSREQUEST_H_ +#define ALIBABACLOUD_EFLO_MODEL_LISTVCCFLOWINFOSREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace Eflo { +namespace Model { +class ALIBABACLOUD_EFLO_EXPORT ListVccFlowInfosRequest : public RpcServiceRequest { +public: + ListVccFlowInfosRequest(); + ~ListVccFlowInfosRequest(); + std::string getRegionId() const; + void setRegionId(const std::string ®ionId); + long getFrom() const; + void setFrom(long from); + long getTo() const; + void setTo(long to); + std::string getVccId() const; + void setVccId(const std::string &vccId); + std::string getMetricName() const; + void setMetricName(const std::string &metricName); + std::string getDirection() const; + void setDirection(const std::string &direction); + +private: + std::string regionId_; + long from_; + long to_; + std::string vccId_; + std::string metricName_; + std::string direction_; +}; +} // namespace Model +} // namespace Eflo +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_EFLO_MODEL_LISTVCCFLOWINFOSREQUEST_H_ diff --git a/eflo/include/alibabacloud/eflo/model/ListVccFlowInfosResult.h b/eflo/include/alibabacloud/eflo/model/ListVccFlowInfosResult.h new file mode 100644 index 000000000..d5320fa6e --- /dev/null +++ b/eflo/include/alibabacloud/eflo/model/ListVccFlowInfosResult.h @@ -0,0 +1,69 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_EFLO_MODEL_LISTVCCFLOWINFOSRESULT_H_ +#define ALIBABACLOUD_EFLO_MODEL_LISTVCCFLOWINFOSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Eflo + { + namespace Model + { + class ALIBABACLOUD_EFLO_EXPORT ListVccFlowInfosResult : public ServiceResult + { + public: + struct Content + { + struct DataItem + { + std::string metricName; + double value; + std::string regionId; + std::string vccId; + std::string direction; + long timestamp; + }; + long total; + std::vector data; + }; + + + ListVccFlowInfosResult(); + explicit ListVccFlowInfosResult(const std::string &payload); + ~ListVccFlowInfosResult(); + std::string getMessage()const; + Content getContent()const; + int getCode()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + Content content_; + int code_; + + }; + } + } +} +#endif // !ALIBABACLOUD_EFLO_MODEL_LISTVCCFLOWINFOSRESULT_H_ \ No newline at end of file diff --git a/eflo/include/alibabacloud/eflo/model/ListVccsResult.h b/eflo/include/alibabacloud/eflo/model/ListVccsResult.h index 5f3f0199e..58b1c54f9 100644 --- a/eflo/include/alibabacloud/eflo/model/ListVccsResult.h +++ b/eflo/include/alibabacloud/eflo/model/ListVccsResult.h @@ -79,6 +79,7 @@ namespace AlibabaCloud std::string connectionType; double rate; std::string createTime; + std::string bgpAsn; std::string bandwidthStr; std::string tenantId; std::string vpcId; diff --git a/eflo/src/EfloClient.cc b/eflo/src/EfloClient.cc index 56aaf6ddd..029abd375 100644 --- a/eflo/src/EfloClient.cc +++ b/eflo/src/EfloClient.cc @@ -1923,6 +1923,42 @@ EfloClient::ListSubnetsOutcomeCallable EfloClient::listSubnetsCallable(const Lis return task->get_future(); } +EfloClient::ListVccFlowInfosOutcome EfloClient::listVccFlowInfos(const ListVccFlowInfosRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ListVccFlowInfosOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ListVccFlowInfosOutcome(ListVccFlowInfosResult(outcome.result())); + else + return ListVccFlowInfosOutcome(outcome.error()); +} + +void EfloClient::listVccFlowInfosAsync(const ListVccFlowInfosRequest& request, const ListVccFlowInfosAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, listVccFlowInfos(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +EfloClient::ListVccFlowInfosOutcomeCallable EfloClient::listVccFlowInfosCallable(const ListVccFlowInfosRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->listVccFlowInfos(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + EfloClient::ListVccGrantRulesOutcome EfloClient::listVccGrantRules(const ListVccGrantRulesRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/eflo/src/model/CreateElasticNetworkInterfaceRequest.cc b/eflo/src/model/CreateElasticNetworkInterfaceRequest.cc index 46ff3d00f..6a57b6a0c 100644 --- a/eflo/src/model/CreateElasticNetworkInterfaceRequest.cc +++ b/eflo/src/model/CreateElasticNetworkInterfaceRequest.cc @@ -70,6 +70,15 @@ void CreateElasticNetworkInterfaceRequest::setNodeId(const std::string &nodeId) setBodyParameter(std::string("NodeId"), nodeId); } +bool CreateElasticNetworkInterfaceRequest::getEnableJumboFrame() const { + return enableJumboFrame_; +} + +void CreateElasticNetworkInterfaceRequest::setEnableJumboFrame(bool enableJumboFrame) { + enableJumboFrame_ = enableJumboFrame; + setBodyParameter(std::string("EnableJumboFrame"), enableJumboFrame ? "true" : "false"); +} + std::string CreateElasticNetworkInterfaceRequest::getVSwitchId() const { return vSwitchId_; } diff --git a/eflo/src/model/CreateVccRequest.cc b/eflo/src/model/CreateVccRequest.cc index f99e207ff..dd4ff5821 100644 --- a/eflo/src/model/CreateVccRequest.cc +++ b/eflo/src/model/CreateVccRequest.cc @@ -61,6 +61,15 @@ void CreateVccRequest::setCenOwnerId(const std::string &cenOwnerId) { setBodyParameter(std::string("CenOwnerId"), cenOwnerId); } +long CreateVccRequest::getBgpAsn() const { + return bgpAsn_; +} + +void CreateVccRequest::setBgpAsn(long bgpAsn) { + bgpAsn_ = bgpAsn; + setBodyParameter(std::string("BgpAsn"), std::to_string(bgpAsn)); +} + bool CreateVccRequest::getAccessCouldService() const { return accessCouldService_; } diff --git a/eflo/src/model/GetElasticNetworkInterfaceResult.cc b/eflo/src/model/GetElasticNetworkInterfaceResult.cc index 0fbe269a9..bcd599446 100644 --- a/eflo/src/model/GetElasticNetworkInterfaceResult.cc +++ b/eflo/src/model/GetElasticNetworkInterfaceResult.cc @@ -74,6 +74,8 @@ void GetElasticNetworkInterfaceResult::parse(const std::string &payload) content_.description = contentNode["Description"].asString(); if(!contentNode["SecurityGroupId"].isNull()) content_.securityGroupId = contentNode["SecurityGroupId"].asString(); + if(!contentNode["EnableJumboFrame"].isNull()) + content_.enableJumboFrame = contentNode["EnableJumboFrame"].asString() == "true"; auto allPrivateIpAddressesNode = contentNode["PrivateIpAddresses"]["PrivateIpAddress"]; for (auto contentNodePrivateIpAddressesPrivateIpAddress : allPrivateIpAddressesNode) { @@ -98,6 +100,30 @@ void GetElasticNetworkInterfaceResult::parse(const std::string &payload) privateIpAddressObject.message = contentNodePrivateIpAddressesPrivateIpAddress["Message"].asString(); content_.privateIpAddresses.push_back(privateIpAddressObject); } + auto allIpv6AddressesNode = contentNode["Ipv6Addresses"]["Ipv6Addresse"]; + for (auto contentNodeIpv6AddressesIpv6Addresse : allIpv6AddressesNode) + { + Content::Ipv6Addresse ipv6AddresseObject; + if(!contentNodeIpv6AddressesIpv6Addresse["ElasticNetworkInterfaceId"].isNull()) + ipv6AddresseObject.elasticNetworkInterfaceId = contentNodeIpv6AddressesIpv6Addresse["ElasticNetworkInterfaceId"].asString(); + if(!contentNodeIpv6AddressesIpv6Addresse["IpName"].isNull()) + ipv6AddresseObject.ipName = contentNodeIpv6AddressesIpv6Addresse["IpName"].asString(); + if(!contentNodeIpv6AddressesIpv6Addresse["Ipv6Address"].isNull()) + ipv6AddresseObject.ipv6Address = contentNodeIpv6AddressesIpv6Addresse["Ipv6Address"].asString(); + if(!contentNodeIpv6AddressesIpv6Addresse["Status"].isNull()) + ipv6AddresseObject.status = contentNodeIpv6AddressesIpv6Addresse["Status"].asString(); + if(!contentNodeIpv6AddressesIpv6Addresse["Description"].isNull()) + ipv6AddresseObject.description = contentNodeIpv6AddressesIpv6Addresse["Description"].asString(); + if(!contentNodeIpv6AddressesIpv6Addresse["Message"].isNull()) + ipv6AddresseObject.message = contentNodeIpv6AddressesIpv6Addresse["Message"].asString(); + if(!contentNodeIpv6AddressesIpv6Addresse["RegionId"].isNull()) + ipv6AddresseObject.regionId = contentNodeIpv6AddressesIpv6Addresse["RegionId"].asString(); + if(!contentNodeIpv6AddressesIpv6Addresse["GmtCreate"].isNull()) + ipv6AddresseObject.gmtCreate = contentNodeIpv6AddressesIpv6Addresse["GmtCreate"].asString(); + if(!contentNodeIpv6AddressesIpv6Addresse["GmtModified"].isNull()) + ipv6AddresseObject.gmtModified = contentNodeIpv6AddressesIpv6Addresse["GmtModified"].asString(); + content_.ipv6Addresses.push_back(ipv6AddresseObject); + } if(!value["Code"].isNull()) code_ = std::stoi(value["Code"].asString()); if(!value["Message"].isNull()) diff --git a/eflo/src/model/GetVccResult.cc b/eflo/src/model/GetVccResult.cc index 7c7dbe49a..0c5a02c96 100644 --- a/eflo/src/model/GetVccResult.cc +++ b/eflo/src/model/GetVccResult.cc @@ -100,6 +100,8 @@ void GetVccResult::parse(const std::string &payload) content_.connectionType = contentNode["ConnectionType"].asString(); if(!contentNode["CenOwnerId"].isNull()) content_.cenOwnerId = contentNode["CenOwnerId"].asString(); + if(!contentNode["BgpAsn"].isNull()) + content_.bgpAsn = contentNode["BgpAsn"].asString(); auto allErInfosNode = contentNode["ErInfos"]["ErInfo"]; for (auto contentNodeErInfosErInfo : allErInfosNode) { diff --git a/eflo/src/model/ListVccFlowInfosRequest.cc b/eflo/src/model/ListVccFlowInfosRequest.cc new file mode 100644 index 000000000..b0eef5873 --- /dev/null +++ b/eflo/src/model/ListVccFlowInfosRequest.cc @@ -0,0 +1,81 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Eflo::Model::ListVccFlowInfosRequest; + +ListVccFlowInfosRequest::ListVccFlowInfosRequest() + : RpcServiceRequest("eflo", "2022-05-30", "ListVccFlowInfos") { + setMethod(HttpRequest::Method::Post); +} + +ListVccFlowInfosRequest::~ListVccFlowInfosRequest() {} + +std::string ListVccFlowInfosRequest::getRegionId() const { + return regionId_; +} + +void ListVccFlowInfosRequest::setRegionId(const std::string ®ionId) { + regionId_ = regionId; + setBodyParameter(std::string("RegionId"), regionId); +} + +long ListVccFlowInfosRequest::getFrom() const { + return from_; +} + +void ListVccFlowInfosRequest::setFrom(long from) { + from_ = from; + setBodyParameter(std::string("From"), std::to_string(from)); +} + +long ListVccFlowInfosRequest::getTo() const { + return to_; +} + +void ListVccFlowInfosRequest::setTo(long to) { + to_ = to; + setBodyParameter(std::string("To"), std::to_string(to)); +} + +std::string ListVccFlowInfosRequest::getVccId() const { + return vccId_; +} + +void ListVccFlowInfosRequest::setVccId(const std::string &vccId) { + vccId_ = vccId; + setBodyParameter(std::string("VccId"), vccId); +} + +std::string ListVccFlowInfosRequest::getMetricName() const { + return metricName_; +} + +void ListVccFlowInfosRequest::setMetricName(const std::string &metricName) { + metricName_ = metricName; + setBodyParameter(std::string("MetricName"), metricName); +} + +std::string ListVccFlowInfosRequest::getDirection() const { + return direction_; +} + +void ListVccFlowInfosRequest::setDirection(const std::string &direction) { + direction_ = direction; + setBodyParameter(std::string("Direction"), direction); +} + diff --git a/eflo/src/model/ListVccFlowInfosResult.cc b/eflo/src/model/ListVccFlowInfosResult.cc new file mode 100644 index 000000000..c78506356 --- /dev/null +++ b/eflo/src/model/ListVccFlowInfosResult.cc @@ -0,0 +1,84 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Eflo; +using namespace AlibabaCloud::Eflo::Model; + +ListVccFlowInfosResult::ListVccFlowInfosResult() : + ServiceResult() +{} + +ListVccFlowInfosResult::ListVccFlowInfosResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ListVccFlowInfosResult::~ListVccFlowInfosResult() +{} + +void ListVccFlowInfosResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto contentNode = value["Content"]; + if(!contentNode["Total"].isNull()) + content_.total = std::stol(contentNode["Total"].asString()); + auto allDataNode = contentNode["Data"]["DataItem"]; + for (auto contentNodeDataDataItem : allDataNode) + { + Content::DataItem dataItemObject; + if(!contentNodeDataDataItem["RegionId"].isNull()) + dataItemObject.regionId = contentNodeDataDataItem["RegionId"].asString(); + if(!contentNodeDataDataItem["VccId"].isNull()) + dataItemObject.vccId = contentNodeDataDataItem["VccId"].asString(); + if(!contentNodeDataDataItem["MetricName"].isNull()) + dataItemObject.metricName = contentNodeDataDataItem["MetricName"].asString(); + if(!contentNodeDataDataItem["Direction"].isNull()) + dataItemObject.direction = contentNodeDataDataItem["Direction"].asString(); + if(!contentNodeDataDataItem["Timestamp"].isNull()) + dataItemObject.timestamp = std::stol(contentNodeDataDataItem["Timestamp"].asString()); + if(!contentNodeDataDataItem["Value"].isNull()) + dataItemObject.value = contentNodeDataDataItem["Value"].asString(); + content_.data.push_back(dataItemObject); + } + if(!value["Code"].isNull()) + code_ = std::stoi(value["Code"].asString()); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + +} + +std::string ListVccFlowInfosResult::getMessage()const +{ + return message_; +} + +ListVccFlowInfosResult::Content ListVccFlowInfosResult::getContent()const +{ + return content_; +} + +int ListVccFlowInfosResult::getCode()const +{ + return code_; +} + diff --git a/eflo/src/model/ListVccsResult.cc b/eflo/src/model/ListVccsResult.cc index e2273f47a..bb8cfa7c4 100644 --- a/eflo/src/model/ListVccsResult.cc +++ b/eflo/src/model/ListVccsResult.cc @@ -98,6 +98,8 @@ void ListVccsResult::parse(const std::string &payload) dataItemObject.connectionType = contentNodeDataDataItem["ConnectionType"].asString(); if(!contentNodeDataDataItem["CenOwnerId"].isNull()) dataItemObject.cenOwnerId = contentNodeDataDataItem["CenOwnerId"].asString(); + if(!contentNodeDataDataItem["BgpAsn"].isNull()) + dataItemObject.bgpAsn = contentNodeDataDataItem["BgpAsn"].asString(); auto allErInfosNode = contentNodeDataDataItem["ErInfos"]["ErInfo"]; for (auto contentNodeDataDataItemErInfosErInfo : allErInfosNode) {