diff --git a/CHANGELOG b/CHANGELOG index af0c78c62..a31ad8b0b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +2019-08-28 Version 1.36.97 +- Add DBS API UpgradeBackupPlan. +- Add DBS API DescribePreCheckProgressList. + 2019-08-26 Version 1.36.96 - QueryInstanceBillResponse change ownerId type from Long to String. - QueryInstanceBillResponse change usage type from float to String. diff --git a/VERSION b/VERSION index cc1fd136f..9b9e071b9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.96 \ No newline at end of file +1.36.97 \ No newline at end of file diff --git a/dbs/CMakeLists.txt b/dbs/CMakeLists.txt index fa3ebe9f0..324dd496c 100644 --- a/dbs/CMakeLists.txt +++ b/dbs/CMakeLists.txt @@ -23,14 +23,12 @@ set(dbs_public_header set(dbs_public_header_model include/alibabacloud/dbs/model/DescribeBackupPlanListRequest.h include/alibabacloud/dbs/model/DescribeBackupPlanListResult.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/RenewBackupPlanRequest.h include/alibabacloud/dbs/model/RenewBackupPlanResult.h include/alibabacloud/dbs/model/DescribeFullBackupListRequest.h include/alibabacloud/dbs/model/DescribeFullBackupListResult.h + include/alibabacloud/dbs/model/UpgradeBackupPlanRequest.h + include/alibabacloud/dbs/model/UpgradeBackupPlanResult.h include/alibabacloud/dbs/model/DescribeRestoreTaskListRequest.h include/alibabacloud/dbs/model/DescribeRestoreTaskListResult.h include/alibabacloud/dbs/model/ModifyBackupPlanNameRequest.h @@ -39,16 +37,12 @@ set(dbs_public_header_model include/alibabacloud/dbs/model/StopBackupPlanResult.h include/alibabacloud/dbs/model/ModifyBackupSourceEndpointRequest.h include/alibabacloud/dbs/model/ModifyBackupSourceEndpointResult.h - include/alibabacloud/dbs/model/DescribeBackupGatewayListRequest.h - include/alibabacloud/dbs/model/DescribeBackupGatewayListResult.h + include/alibabacloud/dbs/model/DescribePreCheckProgressListRequest.h + include/alibabacloud/dbs/model/DescribePreCheckProgressListResult.h include/alibabacloud/dbs/model/ModifyBackupObjectsRequest.h include/alibabacloud/dbs/model/ModifyBackupObjectsResult.h - include/alibabacloud/dbs/model/DescribeIncrementBackupListRequest.h - include/alibabacloud/dbs/model/DescribeIncrementBackupListResult.h include/alibabacloud/dbs/model/CreateRestoreTaskRequest.h include/alibabacloud/dbs/model/CreateRestoreTaskResult.h - include/alibabacloud/dbs/model/ConfigureBackupPlanRequest.h - include/alibabacloud/dbs/model/ConfigureBackupPlanResult.h include/alibabacloud/dbs/model/ModifyBackupStrategyRequest.h include/alibabacloud/dbs/model/ModifyBackupStrategyResult.h include/alibabacloud/dbs/model/StartRestoreTaskRequest.h @@ -60,14 +54,12 @@ set(dbs_src src/DbsClient.cc src/model/DescribeBackupPlanListRequest.cc src/model/DescribeBackupPlanListResult.cc - src/model/CreateBackupPlanRequest.cc - src/model/CreateBackupPlanResult.cc - src/model/StartBackupPlanRequest.cc - src/model/StartBackupPlanResult.cc src/model/RenewBackupPlanRequest.cc src/model/RenewBackupPlanResult.cc src/model/DescribeFullBackupListRequest.cc src/model/DescribeFullBackupListResult.cc + src/model/UpgradeBackupPlanRequest.cc + src/model/UpgradeBackupPlanResult.cc src/model/DescribeRestoreTaskListRequest.cc src/model/DescribeRestoreTaskListResult.cc src/model/ModifyBackupPlanNameRequest.cc @@ -76,16 +68,12 @@ set(dbs_src src/model/StopBackupPlanResult.cc src/model/ModifyBackupSourceEndpointRequest.cc src/model/ModifyBackupSourceEndpointResult.cc - src/model/DescribeBackupGatewayListRequest.cc - src/model/DescribeBackupGatewayListResult.cc + src/model/DescribePreCheckProgressListRequest.cc + src/model/DescribePreCheckProgressListResult.cc src/model/ModifyBackupObjectsRequest.cc src/model/ModifyBackupObjectsResult.cc - src/model/DescribeIncrementBackupListRequest.cc - src/model/DescribeIncrementBackupListResult.cc src/model/CreateRestoreTaskRequest.cc src/model/CreateRestoreTaskResult.cc - src/model/ConfigureBackupPlanRequest.cc - src/model/ConfigureBackupPlanResult.cc src/model/ModifyBackupStrategyRequest.cc src/model/ModifyBackupStrategyResult.cc src/model/StartRestoreTaskRequest.cc diff --git a/dbs/include/alibabacloud/dbs/DbsClient.h b/dbs/include/alibabacloud/dbs/DbsClient.h index 88d86b742..4a7555339 100644 --- a/dbs/include/alibabacloud/dbs/DbsClient.h +++ b/dbs/include/alibabacloud/dbs/DbsClient.h @@ -32,16 +32,20 @@ #include "model/RenewBackupPlanResult.h" #include "model/DescribeFullBackupListRequest.h" #include "model/DescribeFullBackupListResult.h" +#include "model/UpgradeBackupPlanRequest.h" +#include "model/UpgradeBackupPlanResult.h" #include "model/DescribeRestoreTaskListRequest.h" #include "model/DescribeRestoreTaskListResult.h" #include "model/ModifyBackupPlanNameRequest.h" #include "model/ModifyBackupPlanNameResult.h" #include "model/StopBackupPlanRequest.h" #include "model/StopBackupPlanResult.h" -#include "model/ModifyBackupSourceEndpointRequest.h" -#include "model/ModifyBackupSourceEndpointResult.h" #include "model/DescribeBackupGatewayListRequest.h" #include "model/DescribeBackupGatewayListResult.h" +#include "model/ModifyBackupSourceEndpointRequest.h" +#include "model/ModifyBackupSourceEndpointResult.h" +#include "model/DescribePreCheckProgressListRequest.h" +#include "model/DescribePreCheckProgressListResult.h" #include "model/ModifyBackupObjectsRequest.h" #include "model/ModifyBackupObjectsResult.h" #include "model/DescribeIncrementBackupListRequest.h" @@ -80,6 +84,9 @@ namespace AlibabaCloud typedef Outcome DescribeFullBackupListOutcome; typedef std::future DescribeFullBackupListOutcomeCallable; typedef std::function&)> DescribeFullBackupListAsyncHandler; + typedef Outcome UpgradeBackupPlanOutcome; + typedef std::future UpgradeBackupPlanOutcomeCallable; + typedef std::function&)> UpgradeBackupPlanAsyncHandler; typedef Outcome DescribeRestoreTaskListOutcome; typedef std::future DescribeRestoreTaskListOutcomeCallable; typedef std::function&)> DescribeRestoreTaskListAsyncHandler; @@ -89,12 +96,15 @@ namespace AlibabaCloud typedef Outcome StopBackupPlanOutcome; typedef std::future StopBackupPlanOutcomeCallable; typedef std::function&)> StopBackupPlanAsyncHandler; - typedef Outcome ModifyBackupSourceEndpointOutcome; - typedef std::future ModifyBackupSourceEndpointOutcomeCallable; - typedef std::function&)> ModifyBackupSourceEndpointAsyncHandler; typedef Outcome DescribeBackupGatewayListOutcome; typedef std::future DescribeBackupGatewayListOutcomeCallable; typedef std::function&)> DescribeBackupGatewayListAsyncHandler; + typedef Outcome ModifyBackupSourceEndpointOutcome; + typedef std::future ModifyBackupSourceEndpointOutcomeCallable; + typedef std::function&)> ModifyBackupSourceEndpointAsyncHandler; + typedef Outcome DescribePreCheckProgressListOutcome; + typedef std::future DescribePreCheckProgressListOutcomeCallable; + typedef std::function&)> DescribePreCheckProgressListAsyncHandler; typedef Outcome ModifyBackupObjectsOutcome; typedef std::future ModifyBackupObjectsOutcomeCallable; typedef std::function&)> ModifyBackupObjectsAsyncHandler; @@ -136,6 +146,9 @@ namespace AlibabaCloud DescribeFullBackupListOutcome describeFullBackupList(const Model::DescribeFullBackupListRequest &request)const; void describeFullBackupListAsync(const Model::DescribeFullBackupListRequest& request, const DescribeFullBackupListAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; DescribeFullBackupListOutcomeCallable describeFullBackupListCallable(const Model::DescribeFullBackupListRequest& request) const; + UpgradeBackupPlanOutcome upgradeBackupPlan(const Model::UpgradeBackupPlanRequest &request)const; + void upgradeBackupPlanAsync(const Model::UpgradeBackupPlanRequest& request, const UpgradeBackupPlanAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + UpgradeBackupPlanOutcomeCallable upgradeBackupPlanCallable(const Model::UpgradeBackupPlanRequest& 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; @@ -145,12 +158,15 @@ namespace AlibabaCloud StopBackupPlanOutcome stopBackupPlan(const Model::StopBackupPlanRequest &request)const; void stopBackupPlanAsync(const Model::StopBackupPlanRequest& request, const StopBackupPlanAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; StopBackupPlanOutcomeCallable stopBackupPlanCallable(const Model::StopBackupPlanRequest& request) const; - ModifyBackupSourceEndpointOutcome modifyBackupSourceEndpoint(const Model::ModifyBackupSourceEndpointRequest &request)const; - void modifyBackupSourceEndpointAsync(const Model::ModifyBackupSourceEndpointRequest& request, const ModifyBackupSourceEndpointAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; - ModifyBackupSourceEndpointOutcomeCallable modifyBackupSourceEndpointCallable(const Model::ModifyBackupSourceEndpointRequest& request) const; DescribeBackupGatewayListOutcome describeBackupGatewayList(const Model::DescribeBackupGatewayListRequest &request)const; void describeBackupGatewayListAsync(const Model::DescribeBackupGatewayListRequest& request, const DescribeBackupGatewayListAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; DescribeBackupGatewayListOutcomeCallable describeBackupGatewayListCallable(const Model::DescribeBackupGatewayListRequest& request) const; + ModifyBackupSourceEndpointOutcome modifyBackupSourceEndpoint(const Model::ModifyBackupSourceEndpointRequest &request)const; + void modifyBackupSourceEndpointAsync(const Model::ModifyBackupSourceEndpointRequest& request, const ModifyBackupSourceEndpointAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ModifyBackupSourceEndpointOutcomeCallable modifyBackupSourceEndpointCallable(const Model::ModifyBackupSourceEndpointRequest& request) const; + DescribePreCheckProgressListOutcome describePreCheckProgressList(const Model::DescribePreCheckProgressListRequest &request)const; + void describePreCheckProgressListAsync(const Model::DescribePreCheckProgressListRequest& request, const DescribePreCheckProgressListAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + DescribePreCheckProgressListOutcomeCallable describePreCheckProgressListCallable(const Model::DescribePreCheckProgressListRequest& request) const; ModifyBackupObjectsOutcome modifyBackupObjects(const Model::ModifyBackupObjectsRequest &request)const; void modifyBackupObjectsAsync(const Model::ModifyBackupObjectsRequest& request, const ModifyBackupObjectsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ModifyBackupObjectsOutcomeCallable modifyBackupObjectsCallable(const Model::ModifyBackupObjectsRequest& request) const; diff --git a/dbs/include/alibabacloud/dbs/model/DescribePreCheckProgressListRequest.h b/dbs/include/alibabacloud/dbs/model/DescribePreCheckProgressListRequest.h new file mode 100644 index 000000000..56f8c85e8 --- /dev/null +++ b/dbs/include/alibabacloud/dbs/model/DescribePreCheckProgressListRequest.h @@ -0,0 +1,60 @@ +/* + * 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_DESCRIBEPRECHECKPROGRESSLISTREQUEST_H_ +#define ALIBABACLOUD_DBS_MODEL_DESCRIBEPRECHECKPROGRESSLISTREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Dbs + { + namespace Model + { + class ALIBABACLOUD_DBS_EXPORT DescribePreCheckProgressListRequest : public RpcServiceRequest + { + + public: + DescribePreCheckProgressListRequest(); + ~DescribePreCheckProgressListRequest(); + + 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); + std::string getBackupPlanId()const; + void setBackupPlanId(const std::string& backupPlanId); + std::string getOwnerId()const; + void setOwnerId(const std::string& ownerId); + + private: + std::string regionId_; + std::string clientToken_; + std::string restoreTaskId_; + std::string backupPlanId_; + std::string ownerId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_DBS_MODEL_DESCRIBEPRECHECKPROGRESSLISTREQUEST_H_ \ No newline at end of file diff --git a/dbs/include/alibabacloud/dbs/model/DescribePreCheckProgressListResult.h b/dbs/include/alibabacloud/dbs/model/DescribePreCheckProgressListResult.h new file mode 100644 index 000000000..b364264f3 --- /dev/null +++ b/dbs/include/alibabacloud/dbs/model/DescribePreCheckProgressListResult.h @@ -0,0 +1,74 @@ +/* + * 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_DESCRIBEPRECHECKPROGRESSLISTRESULT_H_ +#define ALIBABACLOUD_DBS_MODEL_DESCRIBEPRECHECKPROGRESSLISTRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Dbs + { + namespace Model + { + class ALIBABACLOUD_DBS_EXPORT DescribePreCheckProgressListResult : public ServiceResult + { + public: + struct PreCheckProgressDetail + { + std::string names; + std::string item; + std::string orderNum; + long finishTime; + std::string errMsg; + std::string state; + long bootTime; + std::string jobId; + }; + + + DescribePreCheckProgressListResult(); + explicit DescribePreCheckProgressListResult(const std::string &payload); + ~DescribePreCheckProgressListResult(); + std::string getStatus()const; + int getProgress()const; + int getHttpStatusCode()const; + std::vector getItems()const; + std::string getErrMessage()const; + bool getSuccess()const; + std::string getErrCode()const; + + protected: + void parse(const std::string &payload); + private: + std::string status_; + int progress_; + int httpStatusCode_; + std::vector items_; + std::string errMessage_; + bool success_; + std::string errCode_; + + }; + } + } +} +#endif // !ALIBABACLOUD_DBS_MODEL_DESCRIBEPRECHECKPROGRESSLISTRESULT_H_ \ No newline at end of file diff --git a/dbs/include/alibabacloud/dbs/model/UpgradeBackupPlanRequest.h b/dbs/include/alibabacloud/dbs/model/UpgradeBackupPlanRequest.h new file mode 100644 index 000000000..d1fe5b5c0 --- /dev/null +++ b/dbs/include/alibabacloud/dbs/model/UpgradeBackupPlanRequest.h @@ -0,0 +1,60 @@ +/* + * 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_UPGRADEBACKUPPLANREQUEST_H_ +#define ALIBABACLOUD_DBS_MODEL_UPGRADEBACKUPPLANREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Dbs + { + namespace Model + { + class ALIBABACLOUD_DBS_EXPORT UpgradeBackupPlanRequest : public RpcServiceRequest + { + + public: + UpgradeBackupPlanRequest(); + ~UpgradeBackupPlanRequest(); + + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + std::string getClientToken()const; + void setClientToken(const std::string& clientToken); + std::string getBackupPlanId()const; + void setBackupPlanId(const std::string& backupPlanId); + std::string getOwnerId()const; + void setOwnerId(const std::string& ownerId); + std::string getInstanceClass()const; + void setInstanceClass(const std::string& instanceClass); + + private: + std::string regionId_; + std::string clientToken_; + std::string backupPlanId_; + std::string ownerId_; + std::string instanceClass_; + + }; + } + } +} +#endif // !ALIBABACLOUD_DBS_MODEL_UPGRADEBACKUPPLANREQUEST_H_ \ No newline at end of file diff --git a/dbs/include/alibabacloud/dbs/model/UpgradeBackupPlanResult.h b/dbs/include/alibabacloud/dbs/model/UpgradeBackupPlanResult.h new file mode 100644 index 000000000..c5fcf92cd --- /dev/null +++ b/dbs/include/alibabacloud/dbs/model/UpgradeBackupPlanResult.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_UPGRADEBACKUPPLANRESULT_H_ +#define ALIBABACLOUD_DBS_MODEL_UPGRADEBACKUPPLANRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Dbs + { + namespace Model + { + class ALIBABACLOUD_DBS_EXPORT UpgradeBackupPlanResult : public ServiceResult + { + public: + + + UpgradeBackupPlanResult(); + explicit UpgradeBackupPlanResult(const std::string &payload); + ~UpgradeBackupPlanResult(); + int getHttpStatusCode()const; + std::string getBackupPlanId()const; + std::string getErrMessage()const; + std::string getOrderId()const; + bool getSuccess()const; + std::string getErrCode()const; + + protected: + void parse(const std::string &payload); + private: + int httpStatusCode_; + std::string backupPlanId_; + std::string errMessage_; + std::string orderId_; + bool success_; + std::string errCode_; + + }; + } + } +} +#endif // !ALIBABACLOUD_DBS_MODEL_UPGRADEBACKUPPLANRESULT_H_ \ No newline at end of file diff --git a/dbs/src/DbsClient.cc b/dbs/src/DbsClient.cc index 30b21461f..5d5fa1a6b 100644 --- a/dbs/src/DbsClient.cc +++ b/dbs/src/DbsClient.cc @@ -31,21 +31,21 @@ DbsClient::DbsClient(const Credentials &credentials, const ClientConfiguration & RpcServiceClient(SERVICE_NAME, std::make_shared(credentials), configuration) { auto locationClient = std::make_shared(credentials, configuration); - endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "dbs"); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "cbs"); } DbsClient::DbsClient(const std::shared_ptr& credentialsProvider, const ClientConfiguration & configuration) : RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration) { auto locationClient = std::make_shared(credentialsProvider, configuration); - endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "dbs"); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "cbs"); } DbsClient::DbsClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) : RpcServiceClient(SERVICE_NAME, std::make_shared(accessKeyId, accessKeySecret), configuration) { auto locationClient = std::make_shared(accessKeyId, accessKeySecret, configuration); - endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "dbs"); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "cbs"); } DbsClient::~DbsClient() @@ -231,6 +231,42 @@ DbsClient::DescribeFullBackupListOutcomeCallable DbsClient::describeFullBackupLi return task->get_future(); } +DbsClient::UpgradeBackupPlanOutcome DbsClient::upgradeBackupPlan(const UpgradeBackupPlanRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return UpgradeBackupPlanOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return UpgradeBackupPlanOutcome(UpgradeBackupPlanResult(outcome.result())); + else + return UpgradeBackupPlanOutcome(outcome.error()); +} + +void DbsClient::upgradeBackupPlanAsync(const UpgradeBackupPlanRequest& request, const UpgradeBackupPlanAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, upgradeBackupPlan(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +DbsClient::UpgradeBackupPlanOutcomeCallable DbsClient::upgradeBackupPlanCallable(const UpgradeBackupPlanRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->upgradeBackupPlan(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + DbsClient::DescribeRestoreTaskListOutcome DbsClient::describeRestoreTaskList(const DescribeRestoreTaskListRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -339,6 +375,42 @@ DbsClient::StopBackupPlanOutcomeCallable DbsClient::stopBackupPlanCallable(const return task->get_future(); } +DbsClient::DescribeBackupGatewayListOutcome DbsClient::describeBackupGatewayList(const DescribeBackupGatewayListRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return DescribeBackupGatewayListOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return DescribeBackupGatewayListOutcome(DescribeBackupGatewayListResult(outcome.result())); + else + return DescribeBackupGatewayListOutcome(outcome.error()); +} + +void DbsClient::describeBackupGatewayListAsync(const DescribeBackupGatewayListRequest& request, const DescribeBackupGatewayListAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, describeBackupGatewayList(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +DbsClient::DescribeBackupGatewayListOutcomeCallable DbsClient::describeBackupGatewayListCallable(const DescribeBackupGatewayListRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->describeBackupGatewayList(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + DbsClient::ModifyBackupSourceEndpointOutcome DbsClient::modifyBackupSourceEndpoint(const ModifyBackupSourceEndpointRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -375,36 +447,36 @@ DbsClient::ModifyBackupSourceEndpointOutcomeCallable DbsClient::modifyBackupSour return task->get_future(); } -DbsClient::DescribeBackupGatewayListOutcome DbsClient::describeBackupGatewayList(const DescribeBackupGatewayListRequest &request) const +DbsClient::DescribePreCheckProgressListOutcome DbsClient::describePreCheckProgressList(const DescribePreCheckProgressListRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); if (!endpointOutcome.isSuccess()) - return DescribeBackupGatewayListOutcome(endpointOutcome.error()); + return DescribePreCheckProgressListOutcome(endpointOutcome.error()); auto outcome = makeRequest(endpointOutcome.result(), request); if (outcome.isSuccess()) - return DescribeBackupGatewayListOutcome(DescribeBackupGatewayListResult(outcome.result())); + return DescribePreCheckProgressListOutcome(DescribePreCheckProgressListResult(outcome.result())); else - return DescribeBackupGatewayListOutcome(outcome.error()); + return DescribePreCheckProgressListOutcome(outcome.error()); } -void DbsClient::describeBackupGatewayListAsync(const DescribeBackupGatewayListRequest& request, const DescribeBackupGatewayListAsyncHandler& handler, const std::shared_ptr& context) const +void DbsClient::describePreCheckProgressListAsync(const DescribePreCheckProgressListRequest& request, const DescribePreCheckProgressListAsyncHandler& handler, const std::shared_ptr& context) const { auto fn = [this, request, handler, context]() { - handler(this, request, describeBackupGatewayList(request), context); + handler(this, request, describePreCheckProgressList(request), context); }; asyncExecute(new Runnable(fn)); } -DbsClient::DescribeBackupGatewayListOutcomeCallable DbsClient::describeBackupGatewayListCallable(const DescribeBackupGatewayListRequest &request) const +DbsClient::DescribePreCheckProgressListOutcomeCallable DbsClient::describePreCheckProgressListCallable(const DescribePreCheckProgressListRequest &request) const { - auto task = std::make_shared>( + auto task = std::make_shared>( [this, request]() { - return this->describeBackupGatewayList(request); + return this->describePreCheckProgressList(request); }); asyncExecute(new Runnable([task]() { (*task)(); })); diff --git a/dbs/src/model/DescribePreCheckProgressListRequest.cc b/dbs/src/model/DescribePreCheckProgressListRequest.cc new file mode 100644 index 000000000..110b31321 --- /dev/null +++ b/dbs/src/model/DescribePreCheckProgressListRequest.cc @@ -0,0 +1,82 @@ +/* + * 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::DescribePreCheckProgressListRequest; + +DescribePreCheckProgressListRequest::DescribePreCheckProgressListRequest() : + RpcServiceRequest("dbs", "2019-03-06", "DescribePreCheckProgressList") +{} + +DescribePreCheckProgressListRequest::~DescribePreCheckProgressListRequest() +{} + +std::string DescribePreCheckProgressListRequest::getRegionId()const +{ + return regionId_; +} + +void DescribePreCheckProgressListRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setCoreParameter("RegionId", regionId); +} + +std::string DescribePreCheckProgressListRequest::getClientToken()const +{ + return clientToken_; +} + +void DescribePreCheckProgressListRequest::setClientToken(const std::string& clientToken) +{ + clientToken_ = clientToken; + setCoreParameter("ClientToken", clientToken); +} + +std::string DescribePreCheckProgressListRequest::getRestoreTaskId()const +{ + return restoreTaskId_; +} + +void DescribePreCheckProgressListRequest::setRestoreTaskId(const std::string& restoreTaskId) +{ + restoreTaskId_ = restoreTaskId; + setCoreParameter("RestoreTaskId", restoreTaskId); +} + +std::string DescribePreCheckProgressListRequest::getBackupPlanId()const +{ + return backupPlanId_; +} + +void DescribePreCheckProgressListRequest::setBackupPlanId(const std::string& backupPlanId) +{ + backupPlanId_ = backupPlanId; + setCoreParameter("BackupPlanId", backupPlanId); +} + +std::string DescribePreCheckProgressListRequest::getOwnerId()const +{ + return ownerId_; +} + +void DescribePreCheckProgressListRequest::setOwnerId(const std::string& ownerId) +{ + ownerId_ = ownerId; + setCoreParameter("OwnerId", ownerId); +} + diff --git a/dbs/src/model/DescribePreCheckProgressListResult.cc b/dbs/src/model/DescribePreCheckProgressListResult.cc new file mode 100644 index 000000000..f1da3a287 --- /dev/null +++ b/dbs/src/model/DescribePreCheckProgressListResult.cc @@ -0,0 +1,117 @@ +/* + * 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; + +DescribePreCheckProgressListResult::DescribePreCheckProgressListResult() : + ServiceResult() +{} + +DescribePreCheckProgressListResult::DescribePreCheckProgressListResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +DescribePreCheckProgressListResult::~DescribePreCheckProgressListResult() +{} + +void DescribePreCheckProgressListResult::parse(const std::string &payload) +{ + Json::CharReaderBuilder builder; + Json::CharReader *reader = builder.newCharReader(); + Json::Value *val; + Json::Value value; + JSONCPP_STRING *errs; + reader->parse(payload.data(), payload.data() + payload.size(), val, errs); + value = *val; + setRequestId(value["RequestId"].asString()); + auto allItems = value["Items"]["PreCheckProgressDetail"]; + for (auto value : allItems) + { + PreCheckProgressDetail itemsObject; + if(!value["JobId"].isNull()) + itemsObject.jobId = value["JobId"].asString(); + if(!value["State"].isNull()) + itemsObject.state = value["State"].asString(); + if(!value["OrderNum"].isNull()) + itemsObject.orderNum = value["OrderNum"].asString(); + if(!value["ErrMsg"].isNull()) + itemsObject.errMsg = value["ErrMsg"].asString(); + if(!value["Names"].isNull()) + itemsObject.names = value["Names"].asString(); + if(!value["Item"].isNull()) + itemsObject.item = value["Item"].asString(); + if(!value["BootTime"].isNull()) + itemsObject.bootTime = std::stol(value["BootTime"].asString()); + if(!value["FinishTime"].isNull()) + itemsObject.finishTime = std::stol(value["FinishTime"].asString()); + items_.push_back(itemsObject); + } + if(!value["Status"].isNull()) + status_ = value["Status"].asString(); + if(!value["Progress"].isNull()) + progress_ = std::stoi(value["Progress"].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::string DescribePreCheckProgressListResult::getStatus()const +{ + return status_; +} + +int DescribePreCheckProgressListResult::getProgress()const +{ + return progress_; +} + +int DescribePreCheckProgressListResult::getHttpStatusCode()const +{ + return httpStatusCode_; +} + +std::vector DescribePreCheckProgressListResult::getItems()const +{ + return items_; +} + +std::string DescribePreCheckProgressListResult::getErrMessage()const +{ + return errMessage_; +} + +bool DescribePreCheckProgressListResult::getSuccess()const +{ + return success_; +} + +std::string DescribePreCheckProgressListResult::getErrCode()const +{ + return errCode_; +} + diff --git a/dbs/src/model/UpgradeBackupPlanRequest.cc b/dbs/src/model/UpgradeBackupPlanRequest.cc new file mode 100644 index 000000000..8155bd473 --- /dev/null +++ b/dbs/src/model/UpgradeBackupPlanRequest.cc @@ -0,0 +1,82 @@ +/* + * 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::UpgradeBackupPlanRequest; + +UpgradeBackupPlanRequest::UpgradeBackupPlanRequest() : + RpcServiceRequest("dbs", "2019-03-06", "UpgradeBackupPlan") +{} + +UpgradeBackupPlanRequest::~UpgradeBackupPlanRequest() +{} + +std::string UpgradeBackupPlanRequest::getRegionId()const +{ + return regionId_; +} + +void UpgradeBackupPlanRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setCoreParameter("RegionId", regionId); +} + +std::string UpgradeBackupPlanRequest::getClientToken()const +{ + return clientToken_; +} + +void UpgradeBackupPlanRequest::setClientToken(const std::string& clientToken) +{ + clientToken_ = clientToken; + setCoreParameter("ClientToken", clientToken); +} + +std::string UpgradeBackupPlanRequest::getBackupPlanId()const +{ + return backupPlanId_; +} + +void UpgradeBackupPlanRequest::setBackupPlanId(const std::string& backupPlanId) +{ + backupPlanId_ = backupPlanId; + setCoreParameter("BackupPlanId", backupPlanId); +} + +std::string UpgradeBackupPlanRequest::getOwnerId()const +{ + return ownerId_; +} + +void UpgradeBackupPlanRequest::setOwnerId(const std::string& ownerId) +{ + ownerId_ = ownerId; + setCoreParameter("OwnerId", ownerId); +} + +std::string UpgradeBackupPlanRequest::getInstanceClass()const +{ + return instanceClass_; +} + +void UpgradeBackupPlanRequest::setInstanceClass(const std::string& instanceClass) +{ + instanceClass_ = instanceClass; + setCoreParameter("InstanceClass", instanceClass); +} + diff --git a/dbs/src/model/UpgradeBackupPlanResult.cc b/dbs/src/model/UpgradeBackupPlanResult.cc new file mode 100644 index 000000000..9ea367431 --- /dev/null +++ b/dbs/src/model/UpgradeBackupPlanResult.cc @@ -0,0 +1,90 @@ +/* + * 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; + +UpgradeBackupPlanResult::UpgradeBackupPlanResult() : + ServiceResult() +{} + +UpgradeBackupPlanResult::UpgradeBackupPlanResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +UpgradeBackupPlanResult::~UpgradeBackupPlanResult() +{} + +void UpgradeBackupPlanResult::parse(const std::string &payload) +{ + Json::CharReaderBuilder builder; + Json::CharReader *reader = builder.newCharReader(); + Json::Value *val; + Json::Value value; + JSONCPP_STRING *errs; + reader->parse(payload.data(), payload.data() + payload.size(), val, errs); + value = *val; + setRequestId(value["RequestId"].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()); + if(!value["BackupPlanId"].isNull()) + backupPlanId_ = value["BackupPlanId"].asString(); + if(!value["OrderId"].isNull()) + orderId_ = value["OrderId"].asString(); + +} + +int UpgradeBackupPlanResult::getHttpStatusCode()const +{ + return httpStatusCode_; +} + +std::string UpgradeBackupPlanResult::getBackupPlanId()const +{ + return backupPlanId_; +} + +std::string UpgradeBackupPlanResult::getErrMessage()const +{ + return errMessage_; +} + +std::string UpgradeBackupPlanResult::getOrderId()const +{ + return orderId_; +} + +bool UpgradeBackupPlanResult::getSuccess()const +{ + return success_; +} + +std::string UpgradeBackupPlanResult::getErrCode()const +{ + return errCode_; +} +