DBS SDK Auto Released By wanxin,Version:1.36.16
Signed-off-by: haowei.yao <haowei.yao@alibaba-inc.com>
This commit is contained in:
@@ -411,3 +411,75 @@ DbsClient::StartRestoreTaskOutcomeCallable DbsClient::startRestoreTaskCallable(c
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
DbsClient::DescribeNodeCidrListOutcome DbsClient::describeNodeCidrList(const DescribeNodeCidrListRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DescribeNodeCidrListOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DescribeNodeCidrListOutcome(DescribeNodeCidrListResult(outcome.result()));
|
||||
else
|
||||
return DescribeNodeCidrListOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void DbsClient::describeNodeCidrListAsync(const DescribeNodeCidrListRequest& request, const DescribeNodeCidrListAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, describeNodeCidrList(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
DbsClient::DescribeNodeCidrListOutcomeCallable DbsClient::describeNodeCidrListCallable(const DescribeNodeCidrListRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DescribeNodeCidrListOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->describeNodeCidrList(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
DbsClient::DescribeRestoreTaskListOutcome DbsClient::describeRestoreTaskList(const DescribeRestoreTaskListRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DescribeRestoreTaskListOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DescribeRestoreTaskListOutcome(DescribeRestoreTaskListResult(outcome.result()));
|
||||
else
|
||||
return DescribeRestoreTaskListOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void DbsClient::describeRestoreTaskListAsync(const DescribeRestoreTaskListRequest& request, const DescribeRestoreTaskListAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, describeRestoreTaskList(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
DbsClient::DescribeRestoreTaskListOutcomeCallable DbsClient::describeRestoreTaskListCallable(const DescribeRestoreTaskListRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DescribeRestoreTaskListOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->describeRestoreTaskList(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
|
||||
71
dbs/src/model/DescribeNodeCidrListRequest.cc
Normal file
71
dbs/src/model/DescribeNodeCidrListRequest.cc
Normal file
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* 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/dbs/model/DescribeNodeCidrListRequest.h>
|
||||
|
||||
using AlibabaCloud::Dbs::Model::DescribeNodeCidrListRequest;
|
||||
|
||||
DescribeNodeCidrListRequest::DescribeNodeCidrListRequest() :
|
||||
RpcServiceRequest("dbs", "2019-03-06", "DescribeNodeCidrList")
|
||||
{}
|
||||
|
||||
DescribeNodeCidrListRequest::~DescribeNodeCidrListRequest()
|
||||
{}
|
||||
|
||||
std::string DescribeNodeCidrListRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void DescribeNodeCidrListRequest::setRegionId(const std::string& regionId)
|
||||
{
|
||||
regionId_ = regionId;
|
||||
setCoreParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
std::string DescribeNodeCidrListRequest::getClientToken()const
|
||||
{
|
||||
return clientToken_;
|
||||
}
|
||||
|
||||
void DescribeNodeCidrListRequest::setClientToken(const std::string& clientToken)
|
||||
{
|
||||
clientToken_ = clientToken;
|
||||
setCoreParameter("ClientToken", clientToken);
|
||||
}
|
||||
|
||||
std::string DescribeNodeCidrListRequest::getRegion()const
|
||||
{
|
||||
return region_;
|
||||
}
|
||||
|
||||
void DescribeNodeCidrListRequest::setRegion(const std::string& region)
|
||||
{
|
||||
region_ = region;
|
||||
setCoreParameter("Region", region);
|
||||
}
|
||||
|
||||
std::string DescribeNodeCidrListRequest::getOwnerId()const
|
||||
{
|
||||
return ownerId_;
|
||||
}
|
||||
|
||||
void DescribeNodeCidrListRequest::setOwnerId(const std::string& ownerId)
|
||||
{
|
||||
ownerId_ = ownerId;
|
||||
setCoreParameter("OwnerId", ownerId);
|
||||
}
|
||||
|
||||
89
dbs/src/model/DescribeNodeCidrListResult.cc
Normal file
89
dbs/src/model/DescribeNodeCidrListResult.cc
Normal file
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* 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/dbs/model/DescribeNodeCidrListResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Dbs;
|
||||
using namespace AlibabaCloud::Dbs::Model;
|
||||
|
||||
DescribeNodeCidrListResult::DescribeNodeCidrListResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
DescribeNodeCidrListResult::DescribeNodeCidrListResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DescribeNodeCidrListResult::~DescribeNodeCidrListResult()
|
||||
{}
|
||||
|
||||
void DescribeNodeCidrListResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allInternetIPs = value["InternetIPs"]["InternetIP"];
|
||||
for (const auto &item : allInternetIPs)
|
||||
internetIPs_.push_back(item.asString());
|
||||
auto allIntranetIPs = value["IntranetIPs"]["IntranetIP"];
|
||||
for (const auto &item : allIntranetIPs)
|
||||
intranetIPs_.push_back(item.asString());
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
if(!value["ErrCode"].isNull())
|
||||
errCode_ = value["ErrCode"].asString();
|
||||
if(!value["ErrMessage"].isNull())
|
||||
errMessage_ = value["ErrMessage"].asString();
|
||||
if(!value["HttpStatusCode"].isNull())
|
||||
httpStatusCode_ = std::stoi(value["HttpStatusCode"].asString());
|
||||
|
||||
}
|
||||
|
||||
std::vector<std::string> DescribeNodeCidrListResult::getInternetIPs()const
|
||||
{
|
||||
return internetIPs_;
|
||||
}
|
||||
|
||||
int DescribeNodeCidrListResult::getHttpStatusCode()const
|
||||
{
|
||||
return httpStatusCode_;
|
||||
}
|
||||
|
||||
std::vector<std::string> DescribeNodeCidrListResult::getIntranetIPs()const
|
||||
{
|
||||
return intranetIPs_;
|
||||
}
|
||||
|
||||
std::string DescribeNodeCidrListResult::getErrMessage()const
|
||||
{
|
||||
return errMessage_;
|
||||
}
|
||||
|
||||
bool DescribeNodeCidrListResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
std::string DescribeNodeCidrListResult::getErrCode()const
|
||||
{
|
||||
return errCode_;
|
||||
}
|
||||
|
||||
104
dbs/src/model/DescribeRestoreTaskListRequest.cc
Normal file
104
dbs/src/model/DescribeRestoreTaskListRequest.cc
Normal file
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
* 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/dbs/model/DescribeRestoreTaskListRequest.h>
|
||||
|
||||
using AlibabaCloud::Dbs::Model::DescribeRestoreTaskListRequest;
|
||||
|
||||
DescribeRestoreTaskListRequest::DescribeRestoreTaskListRequest() :
|
||||
RpcServiceRequest("dbs", "2019-03-06", "DescribeRestoreTaskList")
|
||||
{}
|
||||
|
||||
DescribeRestoreTaskListRequest::~DescribeRestoreTaskListRequest()
|
||||
{}
|
||||
|
||||
std::string DescribeRestoreTaskListRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void DescribeRestoreTaskListRequest::setRegionId(const std::string& regionId)
|
||||
{
|
||||
regionId_ = regionId;
|
||||
setCoreParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
std::string DescribeRestoreTaskListRequest::getClientToken()const
|
||||
{
|
||||
return clientToken_;
|
||||
}
|
||||
|
||||
void DescribeRestoreTaskListRequest::setClientToken(const std::string& clientToken)
|
||||
{
|
||||
clientToken_ = clientToken;
|
||||
setCoreParameter("ClientToken", clientToken);
|
||||
}
|
||||
|
||||
std::string DescribeRestoreTaskListRequest::getRestoreTaskId()const
|
||||
{
|
||||
return restoreTaskId_;
|
||||
}
|
||||
|
||||
void DescribeRestoreTaskListRequest::setRestoreTaskId(const std::string& restoreTaskId)
|
||||
{
|
||||
restoreTaskId_ = restoreTaskId;
|
||||
setCoreParameter("RestoreTaskId", restoreTaskId);
|
||||
}
|
||||
|
||||
int DescribeRestoreTaskListRequest::getPageSize()const
|
||||
{
|
||||
return pageSize_;
|
||||
}
|
||||
|
||||
void DescribeRestoreTaskListRequest::setPageSize(int pageSize)
|
||||
{
|
||||
pageSize_ = pageSize;
|
||||
setCoreParameter("PageSize", std::to_string(pageSize));
|
||||
}
|
||||
|
||||
std::string DescribeRestoreTaskListRequest::getBackupPlanId()const
|
||||
{
|
||||
return backupPlanId_;
|
||||
}
|
||||
|
||||
void DescribeRestoreTaskListRequest::setBackupPlanId(const std::string& backupPlanId)
|
||||
{
|
||||
backupPlanId_ = backupPlanId;
|
||||
setCoreParameter("BackupPlanId", backupPlanId);
|
||||
}
|
||||
|
||||
int DescribeRestoreTaskListRequest::getPageNum()const
|
||||
{
|
||||
return pageNum_;
|
||||
}
|
||||
|
||||
void DescribeRestoreTaskListRequest::setPageNum(int pageNum)
|
||||
{
|
||||
pageNum_ = pageNum;
|
||||
setCoreParameter("PageNum", std::to_string(pageNum));
|
||||
}
|
||||
|
||||
std::string DescribeRestoreTaskListRequest::getOwnerId()const
|
||||
{
|
||||
return ownerId_;
|
||||
}
|
||||
|
||||
void DescribeRestoreTaskListRequest::setOwnerId(const std::string& ownerId)
|
||||
{
|
||||
ownerId_ = ownerId;
|
||||
setCoreParameter("OwnerId", ownerId);
|
||||
}
|
||||
|
||||
154
dbs/src/model/DescribeRestoreTaskListResult.cc
Normal file
154
dbs/src/model/DescribeRestoreTaskListResult.cc
Normal file
@@ -0,0 +1,154 @@
|
||||
/*
|
||||
* 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/dbs/model/DescribeRestoreTaskListResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Dbs;
|
||||
using namespace AlibabaCloud::Dbs::Model;
|
||||
|
||||
DescribeRestoreTaskListResult::DescribeRestoreTaskListResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
DescribeRestoreTaskListResult::DescribeRestoreTaskListResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DescribeRestoreTaskListResult::~DescribeRestoreTaskListResult()
|
||||
{}
|
||||
|
||||
void DescribeRestoreTaskListResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allItems = value["Items"]["RestoreTaskDetail"];
|
||||
for (auto value : allItems)
|
||||
{
|
||||
RestoreTaskDetail itemsObject;
|
||||
if(!value["BackupPlanId"].isNull())
|
||||
itemsObject.backupPlanId = value["BackupPlanId"].asString();
|
||||
if(!value["DestinationEndpointInstanceType"].isNull())
|
||||
itemsObject.destinationEndpointInstanceType = value["DestinationEndpointInstanceType"].asString();
|
||||
if(!value["DestinationEndpointRegion"].isNull())
|
||||
itemsObject.destinationEndpointRegion = value["DestinationEndpointRegion"].asString();
|
||||
if(!value["DestinationEndpointInstanceID"].isNull())
|
||||
itemsObject.destinationEndpointInstanceID = value["DestinationEndpointInstanceID"].asString();
|
||||
if(!value["DestinationEndpointIpPort"].isNull())
|
||||
itemsObject.destinationEndpointIpPort = value["DestinationEndpointIpPort"].asString();
|
||||
if(!value["DestinationEndpointDatabaseName"].isNull())
|
||||
itemsObject.destinationEndpointDatabaseName = value["DestinationEndpointDatabaseName"].asString();
|
||||
if(!value["DestinationEndpointUserName"].isNull())
|
||||
itemsObject.destinationEndpointUserName = value["DestinationEndpointUserName"].asString();
|
||||
if(!value["DestinationEndpointOracleSID"].isNull())
|
||||
itemsObject.destinationEndpointOracleSID = value["DestinationEndpointOracleSID"].asString();
|
||||
if(!value["RestoreObjects"].isNull())
|
||||
itemsObject.restoreObjects = value["RestoreObjects"].asString();
|
||||
if(!value["BackupGatewayId"].isNull())
|
||||
itemsObject.backupGatewayId = std::stol(value["BackupGatewayId"].asString());
|
||||
if(!value["RestoreDir"].isNull())
|
||||
itemsObject.restoreDir = value["RestoreDir"].asString();
|
||||
if(!value["RestoreTaskName"].isNull())
|
||||
itemsObject.restoreTaskName = value["RestoreTaskName"].asString();
|
||||
if(!value["BackupSetId"].isNull())
|
||||
itemsObject.backupSetId = value["BackupSetId"].asString();
|
||||
if(!value["RestoreTime"].isNull())
|
||||
itemsObject.restoreTime = std::stol(value["RestoreTime"].asString());
|
||||
if(!value["RestoreTaskCreateTime"].isNull())
|
||||
itemsObject.restoreTaskCreateTime = std::stol(value["RestoreTaskCreateTime"].asString());
|
||||
if(!value["RestoreStatus"].isNull())
|
||||
itemsObject.restoreStatus = value["RestoreStatus"].asString();
|
||||
if(!value["RestoreTaskId"].isNull())
|
||||
itemsObject.restoreTaskId = value["RestoreTaskId"].asString();
|
||||
if(!value["FullStruforeRestoreProgress"].isNull())
|
||||
itemsObject.fullStruforeRestoreProgress = std::stoi(value["FullStruforeRestoreProgress"].asString());
|
||||
if(!value["FullDataRestoreProgress"].isNull())
|
||||
itemsObject.fullDataRestoreProgress = std::stoi(value["FullDataRestoreProgress"].asString());
|
||||
if(!value["ContinuousRestoreProgress"].isNull())
|
||||
itemsObject.continuousRestoreProgress = std::stoi(value["ContinuousRestoreProgress"].asString());
|
||||
if(!value["FullStruAfterRestoreProgress"].isNull())
|
||||
itemsObject.fullStruAfterRestoreProgress = std::stoi(value["FullStruAfterRestoreProgress"].asString());
|
||||
items_.push_back(itemsObject);
|
||||
}
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
if(!value["ErrCode"].isNull())
|
||||
errCode_ = value["ErrCode"].asString();
|
||||
if(!value["ErrMessage"].isNull())
|
||||
errMessage_ = value["ErrMessage"].asString();
|
||||
if(!value["HttpStatusCode"].isNull())
|
||||
httpStatusCode_ = std::stoi(value["HttpStatusCode"].asString());
|
||||
if(!value["TotalPages"].isNull())
|
||||
totalPages_ = std::stoi(value["TotalPages"].asString());
|
||||
if(!value["PageSize"].isNull())
|
||||
pageSize_ = std::stoi(value["PageSize"].asString());
|
||||
if(!value["PageNum"].isNull())
|
||||
pageNum_ = std::stoi(value["PageNum"].asString());
|
||||
if(!value["TotalElements"].isNull())
|
||||
totalElements_ = std::stoi(value["TotalElements"].asString());
|
||||
|
||||
}
|
||||
|
||||
int DescribeRestoreTaskListResult::getPageSize()const
|
||||
{
|
||||
return pageSize_;
|
||||
}
|
||||
|
||||
int DescribeRestoreTaskListResult::getPageNum()const
|
||||
{
|
||||
return pageNum_;
|
||||
}
|
||||
|
||||
int DescribeRestoreTaskListResult::getHttpStatusCode()const
|
||||
{
|
||||
return httpStatusCode_;
|
||||
}
|
||||
|
||||
int DescribeRestoreTaskListResult::getTotalElements()const
|
||||
{
|
||||
return totalElements_;
|
||||
}
|
||||
|
||||
std::vector<DescribeRestoreTaskListResult::RestoreTaskDetail> DescribeRestoreTaskListResult::getItems()const
|
||||
{
|
||||
return items_;
|
||||
}
|
||||
|
||||
int DescribeRestoreTaskListResult::getTotalPages()const
|
||||
{
|
||||
return totalPages_;
|
||||
}
|
||||
|
||||
std::string DescribeRestoreTaskListResult::getErrMessage()const
|
||||
{
|
||||
return errMessage_;
|
||||
}
|
||||
|
||||
bool DescribeRestoreTaskListResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
std::string DescribeRestoreTaskListResult::getErrCode()const
|
||||
{
|
||||
return errCode_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user