From 2ee90f14b272a64f2e3f058e34c0325e2ee634dc Mon Sep 17 00:00:00 2001 From: "haowei.yao" Date: Wed, 17 Apr 2019 00:30:27 +0800 Subject: [PATCH] =?UTF-8?q?DBS=20SDK=20Auto=20Released=20By=20wanxin,Versi?= =?UTF-8?q?on=EF=BC=9A1.36.16?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: haowei.yao --- CHANGELOG | 4 + VERSION | 2 +- dbs/CMakeLists.txt | 44 +---- dbs/include/alibabacloud/dbs/DbsClient.h | 16 ++ .../dbs/model/DescribeNodeCidrListRequest.h | 57 +++++++ .../dbs/model/DescribeNodeCidrListResult.h | 61 +++++++ .../model/DescribeRestoreTaskListRequest.h | 66 ++++++++ .../dbs/model/DescribeRestoreTaskListResult.h | 91 +++++++++++ dbs/src/DbsClient.cc | 72 ++++++++ dbs/src/model/DescribeNodeCidrListRequest.cc | 71 ++++++++ dbs/src/model/DescribeNodeCidrListResult.cc | 89 ++++++++++ .../model/DescribeRestoreTaskListRequest.cc | 104 ++++++++++++ .../model/DescribeRestoreTaskListResult.cc | 154 ++++++++++++++++++ 13 files changed, 788 insertions(+), 43 deletions(-) create mode 100644 dbs/include/alibabacloud/dbs/model/DescribeNodeCidrListRequest.h create mode 100644 dbs/include/alibabacloud/dbs/model/DescribeNodeCidrListResult.h create mode 100644 dbs/include/alibabacloud/dbs/model/DescribeRestoreTaskListRequest.h create mode 100644 dbs/include/alibabacloud/dbs/model/DescribeRestoreTaskListResult.h create mode 100644 dbs/src/model/DescribeNodeCidrListRequest.cc create mode 100644 dbs/src/model/DescribeNodeCidrListResult.cc create mode 100644 dbs/src/model/DescribeRestoreTaskListRequest.cc create mode 100644 dbs/src/model/DescribeRestoreTaskListResult.cc diff --git a/CHANGELOG b/CHANGELOG index dd941121d..43171ba69 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 1, Fixed DescribeAccounts response type error. diff --git a/VERSION b/VERSION index fe24ebae7..514a854ea 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.15 \ No newline at end of file +1.36.16 \ No newline at end of file diff --git a/dbs/CMakeLists.txt b/dbs/CMakeLists.txt index 990501031..9084a1528 100644 --- a/dbs/CMakeLists.txt +++ b/dbs/CMakeLists.txt @@ -20,50 +20,10 @@ set(dbs_public_header include/alibabacloud/dbs/DbsClient.h include/alibabacloud/dbs/DbsExport.h ) -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_public_header_model ) set(dbs_src - 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 ) + src/DbsClient.cc ) add_library(dbs ${LIB_TYPE} ${dbs_public_header} diff --git a/dbs/include/alibabacloud/dbs/DbsClient.h b/dbs/include/alibabacloud/dbs/DbsClient.h index e95271b8c..7d50404e3 100644 --- a/dbs/include/alibabacloud/dbs/DbsClient.h +++ b/dbs/include/alibabacloud/dbs/DbsClient.h @@ -42,6 +42,10 @@ #include "model/DescribeFullBackupListResult.h" #include "model/StartRestoreTaskRequest.h" #include "model/StartRestoreTaskResult.h" +#include "model/DescribeNodeCidrListRequest.h" +#include "model/DescribeNodeCidrListResult.h" +#include "model/DescribeRestoreTaskListRequest.h" +#include "model/DescribeRestoreTaskListResult.h" namespace AlibabaCloud @@ -81,6 +85,12 @@ namespace AlibabaCloud typedef Outcome StartRestoreTaskOutcome; typedef std::future StartRestoreTaskOutcomeCallable; typedef std::function&)> StartRestoreTaskAsyncHandler; + typedef Outcome DescribeNodeCidrListOutcome; + typedef std::future DescribeNodeCidrListOutcomeCallable; + typedef std::function&)> DescribeNodeCidrListAsyncHandler; + typedef Outcome DescribeRestoreTaskListOutcome; + typedef std::future DescribeRestoreTaskListOutcomeCallable; + typedef std::function&)> DescribeRestoreTaskListAsyncHandler; DbsClient(const Credentials &credentials, const ClientConfiguration &configuration); DbsClient(const std::shared_ptr &credentialsProvider, const ClientConfiguration &configuration); @@ -116,6 +126,12 @@ namespace AlibabaCloud StartRestoreTaskOutcome startRestoreTask(const Model::StartRestoreTaskRequest &request)const; void startRestoreTaskAsync(const Model::StartRestoreTaskRequest& request, const StartRestoreTaskAsyncHandler& handler, const std::shared_ptr& context = nullptr) 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& 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& context = nullptr) const; + DescribeRestoreTaskListOutcomeCallable describeRestoreTaskListCallable(const Model::DescribeRestoreTaskListRequest& request) const; private: std::shared_ptr endpointProvider_; diff --git a/dbs/include/alibabacloud/dbs/model/DescribeNodeCidrListRequest.h b/dbs/include/alibabacloud/dbs/model/DescribeNodeCidrListRequest.h new file mode 100644 index 000000000..274d3a1d8 --- /dev/null +++ b/dbs/include/alibabacloud/dbs/model/DescribeNodeCidrListRequest.h @@ -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 +#include +#include +#include + +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_ \ No newline at end of file diff --git a/dbs/include/alibabacloud/dbs/model/DescribeNodeCidrListResult.h b/dbs/include/alibabacloud/dbs/model/DescribeNodeCidrListResult.h new file mode 100644 index 000000000..ceabf564c --- /dev/null +++ b/dbs/include/alibabacloud/dbs/model/DescribeNodeCidrListResult.h @@ -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 +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Dbs + { + namespace Model + { + class ALIBABACLOUD_DBS_EXPORT DescribeNodeCidrListResult : public ServiceResult + { + public: + + + DescribeNodeCidrListResult(); + explicit DescribeNodeCidrListResult(const std::string &payload); + ~DescribeNodeCidrListResult(); + std::vector getInternetIPs()const; + int getHttpStatusCode()const; + std::vector getIntranetIPs()const; + std::string getErrMessage()const; + bool getSuccess()const; + std::string getErrCode()const; + + protected: + void parse(const std::string &payload); + private: + std::vector internetIPs_; + int httpStatusCode_; + std::vector intranetIPs_; + std::string errMessage_; + bool success_; + std::string errCode_; + + }; + } + } +} +#endif // !ALIBABACLOUD_DBS_MODEL_DESCRIBENODECIDRLISTRESULT_H_ \ No newline at end of file diff --git a/dbs/include/alibabacloud/dbs/model/DescribeRestoreTaskListRequest.h b/dbs/include/alibabacloud/dbs/model/DescribeRestoreTaskListRequest.h new file mode 100644 index 000000000..5f43c320b --- /dev/null +++ b/dbs/include/alibabacloud/dbs/model/DescribeRestoreTaskListRequest.h @@ -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 +#include +#include +#include + +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_ \ No newline at end of file diff --git a/dbs/include/alibabacloud/dbs/model/DescribeRestoreTaskListResult.h b/dbs/include/alibabacloud/dbs/model/DescribeRestoreTaskListResult.h new file mode 100644 index 000000000..00c55d58d --- /dev/null +++ b/dbs/include/alibabacloud/dbs/model/DescribeRestoreTaskListResult.h @@ -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 +#include +#include +#include +#include + +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 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 items_; + int totalPages_; + std::string errMessage_; + bool success_; + std::string errCode_; + + }; + } + } +} +#endif // !ALIBABACLOUD_DBS_MODEL_DESCRIBERESTORETASKLISTRESULT_H_ \ No newline at end of file diff --git a/dbs/src/DbsClient.cc b/dbs/src/DbsClient.cc index bc351c2a9..8343fa77a 100644 --- a/dbs/src/DbsClient.cc +++ b/dbs/src/DbsClient.cc @@ -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& 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>( + [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& 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>( + [this, request]() + { + return this->describeRestoreTaskList(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + diff --git a/dbs/src/model/DescribeNodeCidrListRequest.cc b/dbs/src/model/DescribeNodeCidrListRequest.cc new file mode 100644 index 000000000..135384877 --- /dev/null +++ b/dbs/src/model/DescribeNodeCidrListRequest.cc @@ -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 + +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); +} + diff --git a/dbs/src/model/DescribeNodeCidrListResult.cc b/dbs/src/model/DescribeNodeCidrListResult.cc new file mode 100644 index 000000000..190227939 --- /dev/null +++ b/dbs/src/model/DescribeNodeCidrListResult.cc @@ -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 +#include + +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 DescribeNodeCidrListResult::getInternetIPs()const +{ + return internetIPs_; +} + +int DescribeNodeCidrListResult::getHttpStatusCode()const +{ + return httpStatusCode_; +} + +std::vector 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_; +} + diff --git a/dbs/src/model/DescribeRestoreTaskListRequest.cc b/dbs/src/model/DescribeRestoreTaskListRequest.cc new file mode 100644 index 000000000..9096f5c16 --- /dev/null +++ b/dbs/src/model/DescribeRestoreTaskListRequest.cc @@ -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 + +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); +} + diff --git a/dbs/src/model/DescribeRestoreTaskListResult.cc b/dbs/src/model/DescribeRestoreTaskListResult.cc new file mode 100644 index 000000000..47e66bc70 --- /dev/null +++ b/dbs/src/model/DescribeRestoreTaskListResult.cc @@ -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 +#include + +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::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_; +} +