Support ListNodeInfos4Pod.
This commit is contained in:
45
eflo/src/model/GetNodeInfoForPodRequest.cc
Normal file
45
eflo/src/model/GetNodeInfoForPodRequest.cc
Normal 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 ®ionId) {
|
||||
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);
|
||||
}
|
||||
|
||||
79
eflo/src/model/GetNodeInfoForPodResult.cc
Normal file
79
eflo/src/model/GetNodeInfoForPodResult.cc
Normal 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_;
|
||||
}
|
||||
|
||||
54
eflo/src/model/ListNodeInfosForPodRequest.cc
Normal file
54
eflo/src/model/ListNodeInfosForPodRequest.cc
Normal 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 ®ionId) {
|
||||
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);
|
||||
}
|
||||
|
||||
84
eflo/src/model/ListNodeInfosForPodResult.cc
Normal file
84
eflo/src/model/ListNodeInfosForPodResult.cc
Normal 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_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user