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

@@ -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_;
}