Support ListNodeInfos4Pod.

This commit is contained in:
sdk-team
2023-09-04 06:09:08 +00:00
parent 22a89cfe51
commit 8d45c4275f
12 changed files with 582 additions and 1 deletions

View File

@@ -1 +1 @@
1.36.1748
1.36.1749

View File

@@ -81,6 +81,8 @@ set(eflo_public_header_model
include/alibabacloud/eflo/model/GetLniPrivateIpAddressResult.h
include/alibabacloud/eflo/model/GetNetworkInterfaceRequest.h
include/alibabacloud/eflo/model/GetNetworkInterfaceResult.h
include/alibabacloud/eflo/model/GetNodeInfoForPodRequest.h
include/alibabacloud/eflo/model/GetNodeInfoForPodResult.h
include/alibabacloud/eflo/model/GetSubnetRequest.h
include/alibabacloud/eflo/model/GetSubnetResult.h
include/alibabacloud/eflo/model/GetVccRequest.h
@@ -113,6 +115,8 @@ set(eflo_public_header_model
include/alibabacloud/eflo/model/ListLniPrivateIpAddressResult.h
include/alibabacloud/eflo/model/ListNetworkInterfacesRequest.h
include/alibabacloud/eflo/model/ListNetworkInterfacesResult.h
include/alibabacloud/eflo/model/ListNodeInfosForPodRequest.h
include/alibabacloud/eflo/model/ListNodeInfosForPodResult.h
include/alibabacloud/eflo/model/ListSubnetsRequest.h
include/alibabacloud/eflo/model/ListSubnetsResult.h
include/alibabacloud/eflo/model/ListVccGrantRulesRequest.h
@@ -210,6 +214,8 @@ set(eflo_src
src/model/GetLniPrivateIpAddressResult.cc
src/model/GetNetworkInterfaceRequest.cc
src/model/GetNetworkInterfaceResult.cc
src/model/GetNodeInfoForPodRequest.cc
src/model/GetNodeInfoForPodResult.cc
src/model/GetSubnetRequest.cc
src/model/GetSubnetResult.cc
src/model/GetVccRequest.cc
@@ -242,6 +248,8 @@ set(eflo_src
src/model/ListLniPrivateIpAddressResult.cc
src/model/ListNetworkInterfacesRequest.cc
src/model/ListNetworkInterfacesResult.cc
src/model/ListNodeInfosForPodRequest.cc
src/model/ListNodeInfosForPodResult.cc
src/model/ListSubnetsRequest.cc
src/model/ListSubnetsResult.cc
src/model/ListVccGrantRulesRequest.cc

View File

@@ -82,6 +82,8 @@
#include "model/GetLniPrivateIpAddressResult.h"
#include "model/GetNetworkInterfaceRequest.h"
#include "model/GetNetworkInterfaceResult.h"
#include "model/GetNodeInfoForPodRequest.h"
#include "model/GetNodeInfoForPodResult.h"
#include "model/GetSubnetRequest.h"
#include "model/GetSubnetResult.h"
#include "model/GetVccRequest.h"
@@ -114,6 +116,8 @@
#include "model/ListLniPrivateIpAddressResult.h"
#include "model/ListNetworkInterfacesRequest.h"
#include "model/ListNetworkInterfacesResult.h"
#include "model/ListNodeInfosForPodRequest.h"
#include "model/ListNodeInfosForPodResult.h"
#include "model/ListSubnetsRequest.h"
#include "model/ListSubnetsResult.h"
#include "model/ListVccGrantRulesRequest.h"
@@ -247,6 +251,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::GetNetworkInterfaceResult> GetNetworkInterfaceOutcome;
typedef std::future<GetNetworkInterfaceOutcome> GetNetworkInterfaceOutcomeCallable;
typedef std::function<void(const EfloClient*, const Model::GetNetworkInterfaceRequest&, const GetNetworkInterfaceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetNetworkInterfaceAsyncHandler;
typedef Outcome<Error, Model::GetNodeInfoForPodResult> GetNodeInfoForPodOutcome;
typedef std::future<GetNodeInfoForPodOutcome> GetNodeInfoForPodOutcomeCallable;
typedef std::function<void(const EfloClient*, const Model::GetNodeInfoForPodRequest&, const GetNodeInfoForPodOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetNodeInfoForPodAsyncHandler;
typedef Outcome<Error, Model::GetSubnetResult> GetSubnetOutcome;
typedef std::future<GetSubnetOutcome> GetSubnetOutcomeCallable;
typedef std::function<void(const EfloClient*, const Model::GetSubnetRequest&, const GetSubnetOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetSubnetAsyncHandler;
@@ -295,6 +302,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::ListNetworkInterfacesResult> ListNetworkInterfacesOutcome;
typedef std::future<ListNetworkInterfacesOutcome> ListNetworkInterfacesOutcomeCallable;
typedef std::function<void(const EfloClient*, const Model::ListNetworkInterfacesRequest&, const ListNetworkInterfacesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListNetworkInterfacesAsyncHandler;
typedef Outcome<Error, Model::ListNodeInfosForPodResult> ListNodeInfosForPodOutcome;
typedef std::future<ListNodeInfosForPodOutcome> ListNodeInfosForPodOutcomeCallable;
typedef std::function<void(const EfloClient*, const Model::ListNodeInfosForPodRequest&, const ListNodeInfosForPodOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListNodeInfosForPodAsyncHandler;
typedef Outcome<Error, Model::ListSubnetsResult> ListSubnetsOutcome;
typedef std::future<ListSubnetsOutcome> ListSubnetsOutcomeCallable;
typedef std::function<void(const EfloClient*, const Model::ListSubnetsRequest&, const ListSubnetsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListSubnetsAsyncHandler;
@@ -441,6 +451,9 @@ namespace AlibabaCloud
GetNetworkInterfaceOutcome getNetworkInterface(const Model::GetNetworkInterfaceRequest &request)const;
void getNetworkInterfaceAsync(const Model::GetNetworkInterfaceRequest& request, const GetNetworkInterfaceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GetNetworkInterfaceOutcomeCallable getNetworkInterfaceCallable(const Model::GetNetworkInterfaceRequest& request) const;
GetNodeInfoForPodOutcome getNodeInfoForPod(const Model::GetNodeInfoForPodRequest &request)const;
void getNodeInfoForPodAsync(const Model::GetNodeInfoForPodRequest& request, const GetNodeInfoForPodAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GetNodeInfoForPodOutcomeCallable getNodeInfoForPodCallable(const Model::GetNodeInfoForPodRequest& request) const;
GetSubnetOutcome getSubnet(const Model::GetSubnetRequest &request)const;
void getSubnetAsync(const Model::GetSubnetRequest& request, const GetSubnetAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GetSubnetOutcomeCallable getSubnetCallable(const Model::GetSubnetRequest& request) const;
@@ -489,6 +502,9 @@ namespace AlibabaCloud
ListNetworkInterfacesOutcome listNetworkInterfaces(const Model::ListNetworkInterfacesRequest &request)const;
void listNetworkInterfacesAsync(const Model::ListNetworkInterfacesRequest& request, const ListNetworkInterfacesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ListNetworkInterfacesOutcomeCallable listNetworkInterfacesCallable(const Model::ListNetworkInterfacesRequest& request) const;
ListNodeInfosForPodOutcome listNodeInfosForPod(const Model::ListNodeInfosForPodRequest &request)const;
void listNodeInfosForPodAsync(const Model::ListNodeInfosForPodRequest& request, const ListNodeInfosForPodAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ListNodeInfosForPodOutcomeCallable listNodeInfosForPodCallable(const Model::ListNodeInfosForPodRequest& request) const;
ListSubnetsOutcome listSubnets(const Model::ListSubnetsRequest &request)const;
void listSubnetsAsync(const Model::ListSubnetsRequest& request, const ListSubnetsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ListSubnetsOutcomeCallable listSubnetsCallable(const Model::ListSubnetsRequest& request) const;

View File

@@ -0,0 +1,45 @@
/*
* 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_GETNODEINFOFORPODREQUEST_H_
#define ALIBABACLOUD_EFLO_MODEL_GETNODEINFOFORPODREQUEST_H_
#include <alibabacloud/eflo/EfloExport.h>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <string>
#include <vector>
#include <map>
namespace AlibabaCloud {
namespace Eflo {
namespace Model {
class ALIBABACLOUD_EFLO_EXPORT GetNodeInfoForPodRequest : public RpcServiceRequest {
public:
GetNodeInfoForPodRequest();
~GetNodeInfoForPodRequest();
std::string getRegionId() const;
void setRegionId(const std::string &regionId);
std::string getNodeId() const;
void setNodeId(const std::string &nodeId);
private:
std::string regionId_;
std::string nodeId_;
};
} // namespace Model
} // namespace Eflo
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_EFLO_MODEL_GETNODEINFOFORPODREQUEST_H_

View File

@@ -0,0 +1,65 @@
/*
* 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_GETNODEINFOFORPODRESULT_H_
#define ALIBABACLOUD_EFLO_MODEL_GETNODEINFOFORPODRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/eflo/EfloExport.h>
namespace AlibabaCloud
{
namespace Eflo
{
namespace Model
{
class ALIBABACLOUD_EFLO_EXPORT GetNodeInfoForPodResult : public ServiceResult
{
public:
struct Content
{
std::string vpcId;
std::string clusterId;
int lniSipQuota;
std::string nodeId;
int leniQuota;
std::vector<std::string> vSwitches;
std::string regionId;
};
GetNodeInfoForPodResult();
explicit GetNodeInfoForPodResult(const std::string &payload);
~GetNodeInfoForPodResult();
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_GETNODEINFOFORPODRESULT_H_

View File

@@ -0,0 +1,48 @@
/*
* 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_LISTNODEINFOSFORPODREQUEST_H_
#define ALIBABACLOUD_EFLO_MODEL_LISTNODEINFOSFORPODREQUEST_H_
#include <alibabacloud/eflo/EfloExport.h>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <string>
#include <vector>
#include <map>
namespace AlibabaCloud {
namespace Eflo {
namespace Model {
class ALIBABACLOUD_EFLO_EXPORT ListNodeInfosForPodRequest : public RpcServiceRequest {
public:
ListNodeInfosForPodRequest();
~ListNodeInfosForPodRequest();
std::string getClusterId() const;
void setClusterId(const std::string &clusterId);
std::string getRegionId() const;
void setRegionId(const std::string &regionId);
std::string getNodeId() const;
void setNodeId(const std::string &nodeId);
private:
std::string clusterId_;
std::string regionId_;
std::string nodeId_;
};
} // namespace Model
} // namespace Eflo
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_EFLO_MODEL_LISTNODEINFOSFORPODREQUEST_H_

View File

@@ -0,0 +1,65 @@
/*
* 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_LISTNODEINFOSFORPODRESULT_H_
#define ALIBABACLOUD_EFLO_MODEL_LISTNODEINFOSFORPODRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/eflo/EfloExport.h>
namespace AlibabaCloud
{
namespace Eflo
{
namespace Model
{
class ALIBABACLOUD_EFLO_EXPORT ListNodeInfosForPodResult : public ServiceResult
{
public:
struct ContentItem
{
std::string vpcId;
std::string clusterId;
int lniSipQuota;
std::string nodeId;
int leniQuota;
std::vector<std::string> vSwitches;
std::string regionId;
};
ListNodeInfosForPodResult();
explicit ListNodeInfosForPodResult(const std::string &payload);
~ListNodeInfosForPodResult();
std::string getMessage()const;
std::vector<ContentItem> getContent()const;
int getCode()const;
protected:
void parse(const std::string &payload);
private:
std::string message_;
std::vector<ContentItem> content_;
int code_;
};
}
}
}
#endif // !ALIBABACLOUD_EFLO_MODEL_LISTNODEINFOSFORPODRESULT_H_

View File

@@ -1131,6 +1131,42 @@ EfloClient::GetNetworkInterfaceOutcomeCallable EfloClient::getNetworkInterfaceCa
return task->get_future();
}
EfloClient::GetNodeInfoForPodOutcome EfloClient::getNodeInfoForPod(const GetNodeInfoForPodRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GetNodeInfoForPodOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GetNodeInfoForPodOutcome(GetNodeInfoForPodResult(outcome.result()));
else
return GetNodeInfoForPodOutcome(outcome.error());
}
void EfloClient::getNodeInfoForPodAsync(const GetNodeInfoForPodRequest& request, const GetNodeInfoForPodAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, getNodeInfoForPod(request), context);
};
asyncExecute(new Runnable(fn));
}
EfloClient::GetNodeInfoForPodOutcomeCallable EfloClient::getNodeInfoForPodCallable(const GetNodeInfoForPodRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GetNodeInfoForPodOutcome()>>(
[this, request]()
{
return this->getNodeInfoForPod(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
EfloClient::GetSubnetOutcome EfloClient::getSubnet(const GetSubnetRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -1707,6 +1743,42 @@ EfloClient::ListNetworkInterfacesOutcomeCallable EfloClient::listNetworkInterfac
return task->get_future();
}
EfloClient::ListNodeInfosForPodOutcome EfloClient::listNodeInfosForPod(const ListNodeInfosForPodRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ListNodeInfosForPodOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ListNodeInfosForPodOutcome(ListNodeInfosForPodResult(outcome.result()));
else
return ListNodeInfosForPodOutcome(outcome.error());
}
void EfloClient::listNodeInfosForPodAsync(const ListNodeInfosForPodRequest& request, const ListNodeInfosForPodAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, listNodeInfosForPod(request), context);
};
asyncExecute(new Runnable(fn));
}
EfloClient::ListNodeInfosForPodOutcomeCallable EfloClient::listNodeInfosForPodCallable(const ListNodeInfosForPodRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ListNodeInfosForPodOutcome()>>(
[this, request]()
{
return this->listNodeInfosForPod(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
EfloClient::ListSubnetsOutcome EfloClient::listSubnets(const ListSubnetsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -0,0 +1,45 @@
/*
* 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 <alibabacloud/eflo/model/GetNodeInfoForPodRequest.h>
using AlibabaCloud::Eflo::Model::GetNodeInfoForPodRequest;
GetNodeInfoForPodRequest::GetNodeInfoForPodRequest()
: RpcServiceRequest("eflo", "2022-05-30", "GetNodeInfoForPod") {
setMethod(HttpRequest::Method::Post);
}
GetNodeInfoForPodRequest::~GetNodeInfoForPodRequest() {}
std::string GetNodeInfoForPodRequest::getRegionId() const {
return regionId_;
}
void GetNodeInfoForPodRequest::setRegionId(const std::string &regionId) {
regionId_ = regionId;
setBodyParameter(std::string("RegionId"), regionId);
}
std::string GetNodeInfoForPodRequest::getNodeId() const {
return nodeId_;
}
void GetNodeInfoForPodRequest::setNodeId(const std::string &nodeId) {
nodeId_ = nodeId;
setBodyParameter(std::string("NodeId"), nodeId);
}

View File

@@ -0,0 +1,79 @@
/*
* 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 <alibabacloud/eflo/model/GetNodeInfoForPodResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Eflo;
using namespace AlibabaCloud::Eflo::Model;
GetNodeInfoForPodResult::GetNodeInfoForPodResult() :
ServiceResult()
{}
GetNodeInfoForPodResult::GetNodeInfoForPodResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GetNodeInfoForPodResult::~GetNodeInfoForPodResult()
{}
void GetNodeInfoForPodResult::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["RegionId"].isNull())
content_.regionId = contentNode["RegionId"].asString();
if(!contentNode["ClusterId"].isNull())
content_.clusterId = contentNode["ClusterId"].asString();
if(!contentNode["VpcId"].isNull())
content_.vpcId = contentNode["VpcId"].asString();
if(!contentNode["NodeId"].isNull())
content_.nodeId = contentNode["NodeId"].asString();
if(!contentNode["LeniQuota"].isNull())
content_.leniQuota = std::stoi(contentNode["LeniQuota"].asString());
if(!contentNode["LniSipQuota"].isNull())
content_.lniSipQuota = std::stoi(contentNode["LniSipQuota"].asString());
auto allVSwitches = contentNode["VSwitches"]["VSwitche"];
for (auto value : allVSwitches)
content_.vSwitches.push_back(value.asString());
if(!value["Code"].isNull())
code_ = std::stoi(value["Code"].asString());
if(!value["Message"].isNull())
message_ = value["Message"].asString();
}
std::string GetNodeInfoForPodResult::getMessage()const
{
return message_;
}
GetNodeInfoForPodResult::Content GetNodeInfoForPodResult::getContent()const
{
return content_;
}
int GetNodeInfoForPodResult::getCode()const
{
return code_;
}

View File

@@ -0,0 +1,54 @@
/*
* 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 <alibabacloud/eflo/model/ListNodeInfosForPodRequest.h>
using AlibabaCloud::Eflo::Model::ListNodeInfosForPodRequest;
ListNodeInfosForPodRequest::ListNodeInfosForPodRequest()
: RpcServiceRequest("eflo", "2022-05-30", "ListNodeInfosForPod") {
setMethod(HttpRequest::Method::Post);
}
ListNodeInfosForPodRequest::~ListNodeInfosForPodRequest() {}
std::string ListNodeInfosForPodRequest::getClusterId() const {
return clusterId_;
}
void ListNodeInfosForPodRequest::setClusterId(const std::string &clusterId) {
clusterId_ = clusterId;
setBodyParameter(std::string("ClusterId"), clusterId);
}
std::string ListNodeInfosForPodRequest::getRegionId() const {
return regionId_;
}
void ListNodeInfosForPodRequest::setRegionId(const std::string &regionId) {
regionId_ = regionId;
setBodyParameter(std::string("RegionId"), regionId);
}
std::string ListNodeInfosForPodRequest::getNodeId() const {
return nodeId_;
}
void ListNodeInfosForPodRequest::setNodeId(const std::string &nodeId) {
nodeId_ = nodeId;
setBodyParameter(std::string("NodeId"), nodeId);
}

View File

@@ -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 <alibabacloud/eflo/model/ListNodeInfosForPodResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Eflo;
using namespace AlibabaCloud::Eflo::Model;
ListNodeInfosForPodResult::ListNodeInfosForPodResult() :
ServiceResult()
{}
ListNodeInfosForPodResult::ListNodeInfosForPodResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ListNodeInfosForPodResult::~ListNodeInfosForPodResult()
{}
void ListNodeInfosForPodResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allContentNode = value["Content"]["ContentItem"];
for (auto valueContentContentItem : allContentNode)
{
ContentItem contentObject;
if(!valueContentContentItem["RegionId"].isNull())
contentObject.regionId = valueContentContentItem["RegionId"].asString();
if(!valueContentContentItem["ClusterId"].isNull())
contentObject.clusterId = valueContentContentItem["ClusterId"].asString();
if(!valueContentContentItem["VpcId"].isNull())
contentObject.vpcId = valueContentContentItem["VpcId"].asString();
if(!valueContentContentItem["NodeId"].isNull())
contentObject.nodeId = valueContentContentItem["NodeId"].asString();
if(!valueContentContentItem["LeniQuota"].isNull())
contentObject.leniQuota = std::stoi(valueContentContentItem["LeniQuota"].asString());
if(!valueContentContentItem["LniSipQuota"].isNull())
contentObject.lniSipQuota = std::stoi(valueContentContentItem["LniSipQuota"].asString());
auto allVSwitches = value["VSwitches"]["VSwitche"];
for (auto value : allVSwitches)
contentObject.vSwitches.push_back(value.asString());
content_.push_back(contentObject);
}
if(!value["Code"].isNull())
code_ = std::stoi(value["Code"].asString());
if(!value["Message"].isNull())
message_ = value["Message"].asString();
}
std::string ListNodeInfosForPodResult::getMessage()const
{
return message_;
}
std::vector<ListNodeInfosForPodResult::ContentItem> ListNodeInfosForPodResult::getContent()const
{
return content_;
}
int ListNodeInfosForPodResult::getCode()const
{
return code_;
}