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:
haowei.yao
2019-04-17 00:30:27 +08:00
parent 464ff6cf22
commit 2ee90f14b2
13 changed files with 788 additions and 43 deletions

View File

@@ -1,3 +1,7 @@
2019-04-17 Version: 1.36.16
1, Add DescribeRestoreTaskList DBS interface.
2, Add DescribeNodeCidrList DBS interface.
2019-04-16 Version: 1.36.15 2019-04-16 Version: 1.36.15
1, Fixed DescribeAccounts response type error. 1, Fixed DescribeAccounts response type error.

View File

@@ -1 +1 @@
1.36.15 1.36.16

View File

@@ -20,50 +20,10 @@ set(dbs_public_header
include/alibabacloud/dbs/DbsClient.h include/alibabacloud/dbs/DbsClient.h
include/alibabacloud/dbs/DbsExport.h ) include/alibabacloud/dbs/DbsExport.h )
set(dbs_public_header_model set(dbs_public_header_model )
include/alibabacloud/dbs/model/DescribeBackupPlanListRequest.h
include/alibabacloud/dbs/model/DescribeBackupPlanListResult.h
include/alibabacloud/dbs/model/StopBackupPlanRequest.h
include/alibabacloud/dbs/model/StopBackupPlanResult.h
include/alibabacloud/dbs/model/CreateBackupPlanRequest.h
include/alibabacloud/dbs/model/CreateBackupPlanResult.h
include/alibabacloud/dbs/model/StartBackupPlanRequest.h
include/alibabacloud/dbs/model/StartBackupPlanResult.h
include/alibabacloud/dbs/model/DescribeBackupGatewayListRequest.h
include/alibabacloud/dbs/model/DescribeBackupGatewayListResult.h
include/alibabacloud/dbs/model/CreateRestoreTaskRequest.h
include/alibabacloud/dbs/model/CreateRestoreTaskResult.h
include/alibabacloud/dbs/model/DescribeIncrementBackupListRequest.h
include/alibabacloud/dbs/model/DescribeIncrementBackupListResult.h
include/alibabacloud/dbs/model/ConfigureBackupPlanRequest.h
include/alibabacloud/dbs/model/ConfigureBackupPlanResult.h
include/alibabacloud/dbs/model/DescribeFullBackupListRequest.h
include/alibabacloud/dbs/model/DescribeFullBackupListResult.h
include/alibabacloud/dbs/model/StartRestoreTaskRequest.h
include/alibabacloud/dbs/model/StartRestoreTaskResult.h )
set(dbs_src set(dbs_src
src/DbsClient.cc src/DbsClient.cc )
src/model/DescribeBackupPlanListRequest.cc
src/model/DescribeBackupPlanListResult.cc
src/model/StopBackupPlanRequest.cc
src/model/StopBackupPlanResult.cc
src/model/CreateBackupPlanRequest.cc
src/model/CreateBackupPlanResult.cc
src/model/StartBackupPlanRequest.cc
src/model/StartBackupPlanResult.cc
src/model/DescribeBackupGatewayListRequest.cc
src/model/DescribeBackupGatewayListResult.cc
src/model/CreateRestoreTaskRequest.cc
src/model/CreateRestoreTaskResult.cc
src/model/DescribeIncrementBackupListRequest.cc
src/model/DescribeIncrementBackupListResult.cc
src/model/ConfigureBackupPlanRequest.cc
src/model/ConfigureBackupPlanResult.cc
src/model/DescribeFullBackupListRequest.cc
src/model/DescribeFullBackupListResult.cc
src/model/StartRestoreTaskRequest.cc
src/model/StartRestoreTaskResult.cc )
add_library(dbs ${LIB_TYPE} add_library(dbs ${LIB_TYPE}
${dbs_public_header} ${dbs_public_header}

View File

@@ -42,6 +42,10 @@
#include "model/DescribeFullBackupListResult.h" #include "model/DescribeFullBackupListResult.h"
#include "model/StartRestoreTaskRequest.h" #include "model/StartRestoreTaskRequest.h"
#include "model/StartRestoreTaskResult.h" #include "model/StartRestoreTaskResult.h"
#include "model/DescribeNodeCidrListRequest.h"
#include "model/DescribeNodeCidrListResult.h"
#include "model/DescribeRestoreTaskListRequest.h"
#include "model/DescribeRestoreTaskListResult.h"
namespace AlibabaCloud namespace AlibabaCloud
@@ -81,6 +85,12 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::StartRestoreTaskResult> StartRestoreTaskOutcome; typedef Outcome<Error, Model::StartRestoreTaskResult> StartRestoreTaskOutcome;
typedef std::future<StartRestoreTaskOutcome> StartRestoreTaskOutcomeCallable; typedef std::future<StartRestoreTaskOutcome> StartRestoreTaskOutcomeCallable;
typedef std::function<void(const DbsClient*, const Model::StartRestoreTaskRequest&, const StartRestoreTaskOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> StartRestoreTaskAsyncHandler; typedef std::function<void(const DbsClient*, const Model::StartRestoreTaskRequest&, const StartRestoreTaskOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> StartRestoreTaskAsyncHandler;
typedef Outcome<Error, Model::DescribeNodeCidrListResult> DescribeNodeCidrListOutcome;
typedef std::future<DescribeNodeCidrListOutcome> DescribeNodeCidrListOutcomeCallable;
typedef std::function<void(const DbsClient*, const Model::DescribeNodeCidrListRequest&, const DescribeNodeCidrListOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeNodeCidrListAsyncHandler;
typedef Outcome<Error, Model::DescribeRestoreTaskListResult> DescribeRestoreTaskListOutcome;
typedef std::future<DescribeRestoreTaskListOutcome> DescribeRestoreTaskListOutcomeCallable;
typedef std::function<void(const DbsClient*, const Model::DescribeRestoreTaskListRequest&, const DescribeRestoreTaskListOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeRestoreTaskListAsyncHandler;
DbsClient(const Credentials &credentials, const ClientConfiguration &configuration); DbsClient(const Credentials &credentials, const ClientConfiguration &configuration);
DbsClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration); DbsClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
@@ -116,6 +126,12 @@ namespace AlibabaCloud
StartRestoreTaskOutcome startRestoreTask(const Model::StartRestoreTaskRequest &request)const; StartRestoreTaskOutcome startRestoreTask(const Model::StartRestoreTaskRequest &request)const;
void startRestoreTaskAsync(const Model::StartRestoreTaskRequest& request, const StartRestoreTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const; void startRestoreTaskAsync(const Model::StartRestoreTaskRequest& request, const StartRestoreTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
StartRestoreTaskOutcomeCallable startRestoreTaskCallable(const Model::StartRestoreTaskRequest& request) const; StartRestoreTaskOutcomeCallable startRestoreTaskCallable(const Model::StartRestoreTaskRequest& request) const;
DescribeNodeCidrListOutcome describeNodeCidrList(const Model::DescribeNodeCidrListRequest &request)const;
void describeNodeCidrListAsync(const Model::DescribeNodeCidrListRequest& request, const DescribeNodeCidrListAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
DescribeNodeCidrListOutcomeCallable describeNodeCidrListCallable(const Model::DescribeNodeCidrListRequest& request) const;
DescribeRestoreTaskListOutcome describeRestoreTaskList(const Model::DescribeRestoreTaskListRequest &request)const;
void describeRestoreTaskListAsync(const Model::DescribeRestoreTaskListRequest& request, const DescribeRestoreTaskListAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
DescribeRestoreTaskListOutcomeCallable describeRestoreTaskListCallable(const Model::DescribeRestoreTaskListRequest& request) const;
private: private:
std::shared_ptr<EndpointProvider> endpointProvider_; std::shared_ptr<EndpointProvider> endpointProvider_;

View File

@@ -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_DBS_MODEL_DESCRIBENODECIDRLISTREQUEST_H_
#define ALIBABACLOUD_DBS_MODEL_DESCRIBENODECIDRLISTREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/dbs/DbsExport.h>
namespace AlibabaCloud
{
namespace Dbs
{
namespace Model
{
class ALIBABACLOUD_DBS_EXPORT DescribeNodeCidrListRequest : public RpcServiceRequest
{
public:
DescribeNodeCidrListRequest();
~DescribeNodeCidrListRequest();
std::string getRegionId()const;
void setRegionId(const std::string& regionId);
std::string getClientToken()const;
void setClientToken(const std::string& clientToken);
std::string getRegion()const;
void setRegion(const std::string& region);
std::string getOwnerId()const;
void setOwnerId(const std::string& ownerId);
private:
std::string regionId_;
std::string clientToken_;
std::string region_;
std::string ownerId_;
};
}
}
}
#endif // !ALIBABACLOUD_DBS_MODEL_DESCRIBENODECIDRLISTREQUEST_H_

View File

@@ -0,0 +1,61 @@
/*
* 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_DBS_MODEL_DESCRIBENODECIDRLISTRESULT_H_
#define ALIBABACLOUD_DBS_MODEL_DESCRIBENODECIDRLISTRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/dbs/DbsExport.h>
namespace AlibabaCloud
{
namespace Dbs
{
namespace Model
{
class ALIBABACLOUD_DBS_EXPORT DescribeNodeCidrListResult : public ServiceResult
{
public:
DescribeNodeCidrListResult();
explicit DescribeNodeCidrListResult(const std::string &payload);
~DescribeNodeCidrListResult();
std::vector<std::string> getInternetIPs()const;
int getHttpStatusCode()const;
std::vector<std::string> getIntranetIPs()const;
std::string getErrMessage()const;
bool getSuccess()const;
std::string getErrCode()const;
protected:
void parse(const std::string &payload);
private:
std::vector<std::string> internetIPs_;
int httpStatusCode_;
std::vector<std::string> intranetIPs_;
std::string errMessage_;
bool success_;
std::string errCode_;
};
}
}
}
#endif // !ALIBABACLOUD_DBS_MODEL_DESCRIBENODECIDRLISTRESULT_H_

View File

@@ -0,0 +1,66 @@
/*
* 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_DBS_MODEL_DESCRIBERESTORETASKLISTREQUEST_H_
#define ALIBABACLOUD_DBS_MODEL_DESCRIBERESTORETASKLISTREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/dbs/DbsExport.h>
namespace AlibabaCloud
{
namespace Dbs
{
namespace Model
{
class ALIBABACLOUD_DBS_EXPORT DescribeRestoreTaskListRequest : public RpcServiceRequest
{
public:
DescribeRestoreTaskListRequest();
~DescribeRestoreTaskListRequest();
std::string getRegionId()const;
void setRegionId(const std::string& regionId);
std::string getClientToken()const;
void setClientToken(const std::string& clientToken);
std::string getRestoreTaskId()const;
void setRestoreTaskId(const std::string& restoreTaskId);
int getPageSize()const;
void setPageSize(int pageSize);
std::string getBackupPlanId()const;
void setBackupPlanId(const std::string& backupPlanId);
int getPageNum()const;
void setPageNum(int pageNum);
std::string getOwnerId()const;
void setOwnerId(const std::string& ownerId);
private:
std::string regionId_;
std::string clientToken_;
std::string restoreTaskId_;
int pageSize_;
std::string backupPlanId_;
int pageNum_;
std::string ownerId_;
};
}
}
}
#endif // !ALIBABACLOUD_DBS_MODEL_DESCRIBERESTORETASKLISTREQUEST_H_

View File

@@ -0,0 +1,91 @@
/*
* 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_DBS_MODEL_DESCRIBERESTORETASKLISTRESULT_H_
#define ALIBABACLOUD_DBS_MODEL_DESCRIBERESTORETASKLISTRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/dbs/DbsExport.h>
namespace AlibabaCloud
{
namespace Dbs
{
namespace Model
{
class ALIBABACLOUD_DBS_EXPORT DescribeRestoreTaskListResult : public ServiceResult
{
public:
struct RestoreTaskDetail
{
std::string restoreDir;
int fullStruAfterRestoreProgress;
int fullStruforeRestoreProgress;
std::string destinationEndpointOracleSID;
std::string backupSetId;
std::string restoreStatus;
std::string destinationEndpointInstanceType;
long restoreTime;
std::string destinationEndpointRegion;
int fullDataRestoreProgress;
std::string destinationEndpointDatabaseName;
std::string restoreTaskId;
int continuousRestoreProgress;
std::string destinationEndpointIpPort;
std::string destinationEndpointUserName;
std::string restoreObjects;
std::string restoreTaskName;
std::string backupPlanId;
long restoreTaskCreateTime;
long backupGatewayId;
std::string destinationEndpointInstanceID;
};
DescribeRestoreTaskListResult();
explicit DescribeRestoreTaskListResult(const std::string &payload);
~DescribeRestoreTaskListResult();
int getPageSize()const;
int getPageNum()const;
int getHttpStatusCode()const;
int getTotalElements()const;
std::vector<RestoreTaskDetail> getItems()const;
int getTotalPages()const;
std::string getErrMessage()const;
bool getSuccess()const;
std::string getErrCode()const;
protected:
void parse(const std::string &payload);
private:
int pageSize_;
int pageNum_;
int httpStatusCode_;
int totalElements_;
std::vector<RestoreTaskDetail> items_;
int totalPages_;
std::string errMessage_;
bool success_;
std::string errCode_;
};
}
}
}
#endif // !ALIBABACLOUD_DBS_MODEL_DESCRIBERESTORETASKLISTRESULT_H_

View File

@@ -411,3 +411,75 @@ DbsClient::StartRestoreTaskOutcomeCallable DbsClient::startRestoreTaskCallable(c
return task->get_future(); 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();
}

View 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);
}

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

View 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);
}

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