diff --git a/VERSION b/VERSION index ac667f6f2..8d4280c47 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.1360 \ No newline at end of file +1.36.1361 \ No newline at end of file diff --git a/dms-enterprise/CMakeLists.txt b/dms-enterprise/CMakeLists.txt index a3f957a8e..87f66497c 100644 --- a/dms-enterprise/CMakeLists.txt +++ b/dms-enterprise/CMakeLists.txt @@ -153,6 +153,8 @@ set(dms-enterprise_public_header_model include/alibabacloud/dms-enterprise/model/GetMetaTableColumnResult.h include/alibabacloud/dms-enterprise/model/GetMetaTableDetailInfoRequest.h include/alibabacloud/dms-enterprise/model/GetMetaTableDetailInfoResult.h + include/alibabacloud/dms-enterprise/model/GetOnlineDDLProgressRequest.h + include/alibabacloud/dms-enterprise/model/GetOnlineDDLProgressResult.h include/alibabacloud/dms-enterprise/model/GetOpLogRequest.h include/alibabacloud/dms-enterprise/model/GetOpLogResult.h include/alibabacloud/dms-enterprise/model/GetOrderAttachmentFileRequest.h @@ -518,6 +520,8 @@ set(dms-enterprise_src src/model/GetMetaTableColumnResult.cc src/model/GetMetaTableDetailInfoRequest.cc src/model/GetMetaTableDetailInfoResult.cc + src/model/GetOnlineDDLProgressRequest.cc + src/model/GetOnlineDDLProgressResult.cc src/model/GetOpLogRequest.cc src/model/GetOpLogResult.cc src/model/GetOrderAttachmentFileRequest.cc diff --git a/dms-enterprise/include/alibabacloud/dms-enterprise/Dms_enterpriseClient.h b/dms-enterprise/include/alibabacloud/dms-enterprise/Dms_enterpriseClient.h index 07f4a276d..7041730c2 100644 --- a/dms-enterprise/include/alibabacloud/dms-enterprise/Dms_enterpriseClient.h +++ b/dms-enterprise/include/alibabacloud/dms-enterprise/Dms_enterpriseClient.h @@ -154,6 +154,8 @@ #include "model/GetMetaTableColumnResult.h" #include "model/GetMetaTableDetailInfoRequest.h" #include "model/GetMetaTableDetailInfoResult.h" +#include "model/GetOnlineDDLProgressRequest.h" +#include "model/GetOnlineDDLProgressResult.h" #include "model/GetOpLogRequest.h" #include "model/GetOpLogResult.h" #include "model/GetOrderAttachmentFileRequest.h" @@ -591,6 +593,9 @@ namespace AlibabaCloud typedef Outcome GetMetaTableDetailInfoOutcome; typedef std::future GetMetaTableDetailInfoOutcomeCallable; typedef std::function&)> GetMetaTableDetailInfoAsyncHandler; + typedef Outcome GetOnlineDDLProgressOutcome; + typedef std::future GetOnlineDDLProgressOutcomeCallable; + typedef std::function&)> GetOnlineDDLProgressAsyncHandler; typedef Outcome GetOpLogOutcome; typedef std::future GetOpLogOutcomeCallable; typedef std::function&)> GetOpLogAsyncHandler; @@ -1139,6 +1144,9 @@ namespace AlibabaCloud GetMetaTableDetailInfoOutcome getMetaTableDetailInfo(const Model::GetMetaTableDetailInfoRequest &request)const; void getMetaTableDetailInfoAsync(const Model::GetMetaTableDetailInfoRequest& request, const GetMetaTableDetailInfoAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetMetaTableDetailInfoOutcomeCallable getMetaTableDetailInfoCallable(const Model::GetMetaTableDetailInfoRequest& request) const; + GetOnlineDDLProgressOutcome getOnlineDDLProgress(const Model::GetOnlineDDLProgressRequest &request)const; + void getOnlineDDLProgressAsync(const Model::GetOnlineDDLProgressRequest& request, const GetOnlineDDLProgressAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetOnlineDDLProgressOutcomeCallable getOnlineDDLProgressCallable(const Model::GetOnlineDDLProgressRequest& request) const; GetOpLogOutcome getOpLog(const Model::GetOpLogRequest &request)const; void getOpLogAsync(const Model::GetOpLogRequest& request, const GetOpLogAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetOpLogOutcomeCallable getOpLogCallable(const Model::GetOpLogRequest& request) const; diff --git a/dms-enterprise/include/alibabacloud/dms-enterprise/model/GetLogicDatabaseResult.h b/dms-enterprise/include/alibabacloud/dms-enterprise/model/GetLogicDatabaseResult.h index 4bb65d366..d7957c9cc 100644 --- a/dms-enterprise/include/alibabacloud/dms-enterprise/model/GetLogicDatabaseResult.h +++ b/dms-enterprise/include/alibabacloud/dms-enterprise/model/GetLogicDatabaseResult.h @@ -43,6 +43,7 @@ namespace AlibabaCloud std::string schemaName; std::string envType; std::vector ownerIdList; + std::vector databaseIds; }; diff --git a/dms-enterprise/include/alibabacloud/dms-enterprise/model/GetOnlineDDLProgressRequest.h b/dms-enterprise/include/alibabacloud/dms-enterprise/model/GetOnlineDDLProgressRequest.h new file mode 100644 index 000000000..4c25f312b --- /dev/null +++ b/dms-enterprise/include/alibabacloud/dms-enterprise/model/GetOnlineDDLProgressRequest.h @@ -0,0 +1,45 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_DMS_ENTERPRISE_MODEL_GETONLINEDDLPROGRESSREQUEST_H_ +#define ALIBABACLOUD_DMS_ENTERPRISE_MODEL_GETONLINEDDLPROGRESSREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace Dms_enterprise { +namespace Model { +class ALIBABACLOUD_DMS_ENTERPRISE_EXPORT GetOnlineDDLProgressRequest : public RpcServiceRequest { +public: + GetOnlineDDLProgressRequest(); + ~GetOnlineDDLProgressRequest(); + long getTid() const; + void setTid(long tid); + long getJobDetailId() const; + void setJobDetailId(long jobDetailId); + +private: + long tid_; + long jobDetailId_; +}; +} // namespace Model +} // namespace Dms_enterprise +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_DMS_ENTERPRISE_MODEL_GETONLINEDDLPROGRESSREQUEST_H_ diff --git a/dms-enterprise/include/alibabacloud/dms-enterprise/model/GetOnlineDDLProgressResult.h b/dms-enterprise/include/alibabacloud/dms-enterprise/model/GetOnlineDDLProgressResult.h new file mode 100644 index 000000000..725a285c1 --- /dev/null +++ b/dms-enterprise/include/alibabacloud/dms-enterprise/model/GetOnlineDDLProgressResult.h @@ -0,0 +1,73 @@ +/* + * 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_DMS_ENTERPRISE_MODEL_GETONLINEDDLPROGRESSRESULT_H_ +#define ALIBABACLOUD_DMS_ENTERPRISE_MODEL_GETONLINEDDLPROGRESSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Dms_enterprise + { + namespace Model + { + class ALIBABACLOUD_DMS_ENTERPRISE_EXPORT GetOnlineDDLProgressResult : public ServiceResult + { + public: + struct OnlineDDLTaskDetail + { + std::string cleanStrategy; + long cutoverLockTimeSeconds; + long copyChunkSize; + std::string copyChunkMode; + std::string cutoverWindowEndTime; + std::string cutoverWindowStartTime; + std::string jobStatus; + std::string statusDesc; + std::string progressRatio; + long delaySeconds; + long cutoverFailRetryTimes; + long copyTotal; + long copyCount; + }; + + + GetOnlineDDLProgressResult(); + explicit GetOnlineDDLProgressResult(const std::string &payload); + ~GetOnlineDDLProgressResult(); + OnlineDDLTaskDetail getOnlineDDLTaskDetail()const; + std::string getErrorCode()const; + std::string getErrorMessage()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + OnlineDDLTaskDetail onlineDDLTaskDetail_; + std::string errorCode_; + std::string errorMessage_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_DMS_ENTERPRISE_MODEL_GETONLINEDDLPROGRESSRESULT_H_ \ No newline at end of file diff --git a/dms-enterprise/include/alibabacloud/dms-enterprise/model/ListLogicDatabasesResult.h b/dms-enterprise/include/alibabacloud/dms-enterprise/model/ListLogicDatabasesResult.h index 26f5a5c9d..25b0c7ac1 100644 --- a/dms-enterprise/include/alibabacloud/dms-enterprise/model/ListLogicDatabasesResult.h +++ b/dms-enterprise/include/alibabacloud/dms-enterprise/model/ListLogicDatabasesResult.h @@ -43,6 +43,7 @@ namespace AlibabaCloud std::string schemaName; std::string envType; std::vector ownerIdList; + std::vector databaseIds; }; diff --git a/dms-enterprise/src/Dms-enterpriseClient.cc b/dms-enterprise/src/Dms-enterpriseClient.cc index 0bef433ff..3fca2718c 100644 --- a/dms-enterprise/src/Dms-enterpriseClient.cc +++ b/dms-enterprise/src/Dms-enterpriseClient.cc @@ -2427,6 +2427,42 @@ Dms_enterpriseClient::GetMetaTableDetailInfoOutcomeCallable Dms_enterpriseClient return task->get_future(); } +Dms_enterpriseClient::GetOnlineDDLProgressOutcome Dms_enterpriseClient::getOnlineDDLProgress(const GetOnlineDDLProgressRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetOnlineDDLProgressOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetOnlineDDLProgressOutcome(GetOnlineDDLProgressResult(outcome.result())); + else + return GetOnlineDDLProgressOutcome(outcome.error()); +} + +void Dms_enterpriseClient::getOnlineDDLProgressAsync(const GetOnlineDDLProgressRequest& request, const GetOnlineDDLProgressAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getOnlineDDLProgress(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +Dms_enterpriseClient::GetOnlineDDLProgressOutcomeCallable Dms_enterpriseClient::getOnlineDDLProgressCallable(const GetOnlineDDLProgressRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getOnlineDDLProgress(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + Dms_enterpriseClient::GetOpLogOutcome Dms_enterpriseClient::getOpLog(const GetOpLogRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/dms-enterprise/src/model/GetLogicDatabaseResult.cc b/dms-enterprise/src/model/GetLogicDatabaseResult.cc index 1305c04c4..98efe8e88 100644 --- a/dms-enterprise/src/model/GetLogicDatabaseResult.cc +++ b/dms-enterprise/src/model/GetLogicDatabaseResult.cc @@ -60,6 +60,9 @@ void GetLogicDatabaseResult::parse(const std::string &payload) auto allOwnerNameList = logicDatabaseNode["OwnerNameList"]["OwnerNames"]; for (auto value : allOwnerNameList) logicDatabase_.ownerNameList.push_back(value.asString()); + auto allDatabaseIds = logicDatabaseNode["DatabaseIds"]["DatabaseIds"]; + for (auto value : allDatabaseIds) + logicDatabase_.databaseIds.push_back(value.asString()); if(!value["ErrorCode"].isNull()) errorCode_ = value["ErrorCode"].asString(); if(!value["ErrorMessage"].isNull()) diff --git a/dms-enterprise/src/model/GetOnlineDDLProgressRequest.cc b/dms-enterprise/src/model/GetOnlineDDLProgressRequest.cc new file mode 100644 index 000000000..ed9d4d764 --- /dev/null +++ b/dms-enterprise/src/model/GetOnlineDDLProgressRequest.cc @@ -0,0 +1,45 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Dms_enterprise::Model::GetOnlineDDLProgressRequest; + +GetOnlineDDLProgressRequest::GetOnlineDDLProgressRequest() + : RpcServiceRequest("dms-enterprise", "2018-11-01", "GetOnlineDDLProgress") { + setMethod(HttpRequest::Method::Post); +} + +GetOnlineDDLProgressRequest::~GetOnlineDDLProgressRequest() {} + +long GetOnlineDDLProgressRequest::getTid() const { + return tid_; +} + +void GetOnlineDDLProgressRequest::setTid(long tid) { + tid_ = tid; + setParameter(std::string("Tid"), std::to_string(tid)); +} + +long GetOnlineDDLProgressRequest::getJobDetailId() const { + return jobDetailId_; +} + +void GetOnlineDDLProgressRequest::setJobDetailId(long jobDetailId) { + jobDetailId_ = jobDetailId; + setParameter(std::string("JobDetailId"), std::to_string(jobDetailId)); +} + diff --git a/dms-enterprise/src/model/GetOnlineDDLProgressResult.cc b/dms-enterprise/src/model/GetOnlineDDLProgressResult.cc new file mode 100644 index 000000000..d1b7cab2d --- /dev/null +++ b/dms-enterprise/src/model/GetOnlineDDLProgressResult.cc @@ -0,0 +1,97 @@ +/* + * 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::Dms_enterprise; +using namespace AlibabaCloud::Dms_enterprise::Model; + +GetOnlineDDLProgressResult::GetOnlineDDLProgressResult() : + ServiceResult() +{} + +GetOnlineDDLProgressResult::GetOnlineDDLProgressResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetOnlineDDLProgressResult::~GetOnlineDDLProgressResult() +{} + +void GetOnlineDDLProgressResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto onlineDDLTaskDetailNode = value["OnlineDDLTaskDetail"]; + if(!onlineDDLTaskDetailNode["JobStatus"].isNull()) + onlineDDLTaskDetail_.jobStatus = onlineDDLTaskDetailNode["JobStatus"].asString(); + if(!onlineDDLTaskDetailNode["StatusDesc"].isNull()) + onlineDDLTaskDetail_.statusDesc = onlineDDLTaskDetailNode["StatusDesc"].asString(); + if(!onlineDDLTaskDetailNode["DelaySeconds"].isNull()) + onlineDDLTaskDetail_.delaySeconds = std::stol(onlineDDLTaskDetailNode["DelaySeconds"].asString()); + if(!onlineDDLTaskDetailNode["CopyTotal"].isNull()) + onlineDDLTaskDetail_.copyTotal = std::stol(onlineDDLTaskDetailNode["CopyTotal"].asString()); + if(!onlineDDLTaskDetailNode["CopyCount"].isNull()) + onlineDDLTaskDetail_.copyCount = std::stol(onlineDDLTaskDetailNode["CopyCount"].asString()); + if(!onlineDDLTaskDetailNode["ProgressRatio"].isNull()) + onlineDDLTaskDetail_.progressRatio = onlineDDLTaskDetailNode["ProgressRatio"].asString(); + if(!onlineDDLTaskDetailNode["CutoverLockTimeSeconds"].isNull()) + onlineDDLTaskDetail_.cutoverLockTimeSeconds = std::stol(onlineDDLTaskDetailNode["CutoverLockTimeSeconds"].asString()); + if(!onlineDDLTaskDetailNode["CutoverFailRetryTimes"].isNull()) + onlineDDLTaskDetail_.cutoverFailRetryTimes = std::stol(onlineDDLTaskDetailNode["CutoverFailRetryTimes"].asString()); + if(!onlineDDLTaskDetailNode["CleanStrategy"].isNull()) + onlineDDLTaskDetail_.cleanStrategy = onlineDDLTaskDetailNode["CleanStrategy"].asString(); + if(!onlineDDLTaskDetailNode["CopyChunkSize"].isNull()) + onlineDDLTaskDetail_.copyChunkSize = std::stol(onlineDDLTaskDetailNode["CopyChunkSize"].asString()); + if(!onlineDDLTaskDetailNode["CopyChunkMode"].isNull()) + onlineDDLTaskDetail_.copyChunkMode = onlineDDLTaskDetailNode["CopyChunkMode"].asString(); + if(!onlineDDLTaskDetailNode["CutoverWindowStartTime"].isNull()) + onlineDDLTaskDetail_.cutoverWindowStartTime = onlineDDLTaskDetailNode["CutoverWindowStartTime"].asString(); + if(!onlineDDLTaskDetailNode["CutoverWindowEndTime"].isNull()) + onlineDDLTaskDetail_.cutoverWindowEndTime = onlineDDLTaskDetailNode["CutoverWindowEndTime"].asString(); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; + if(!value["ErrorMessage"].isNull()) + errorMessage_ = value["ErrorMessage"].asString(); + if(!value["ErrorCode"].isNull()) + errorCode_ = value["ErrorCode"].asString(); + +} + +GetOnlineDDLProgressResult::OnlineDDLTaskDetail GetOnlineDDLProgressResult::getOnlineDDLTaskDetail()const +{ + return onlineDDLTaskDetail_; +} + +std::string GetOnlineDDLProgressResult::getErrorCode()const +{ + return errorCode_; +} + +std::string GetOnlineDDLProgressResult::getErrorMessage()const +{ + return errorMessage_; +} + +bool GetOnlineDDLProgressResult::getSuccess()const +{ + return success_; +} + diff --git a/dms-enterprise/src/model/ListLogicDatabasesResult.cc b/dms-enterprise/src/model/ListLogicDatabasesResult.cc index 8db2599b4..89ef5e3ca 100644 --- a/dms-enterprise/src/model/ListLogicDatabasesResult.cc +++ b/dms-enterprise/src/model/ListLogicDatabasesResult.cc @@ -63,6 +63,9 @@ void ListLogicDatabasesResult::parse(const std::string &payload) auto allOwnerNameList = value["OwnerNameList"]["OwnerNames"]; for (auto value : allOwnerNameList) logicDatabaseListObject.ownerNameList.push_back(value.asString()); + auto allDatabaseIds = value["DatabaseIds"]["DatabaseIds"]; + for (auto value : allDatabaseIds) + logicDatabaseListObject.databaseIds.push_back(value.asString()); logicDatabaseList_.push_back(logicDatabaseListObject); } if(!value["TotalCount"].isNull())