Kaynağa Gözat

Support GetDBTopology API.

sdk-team 5 yıl önce
ebeveyn
işleme
5df89b5fa1

+ 3 - 0
CHANGELOG

@@ -1,3 +1,6 @@
+2021-04-12 Version: 1.36.675
+- Support GetDBTopology API.
+
 2021-04-09 Version: 1.36.674
 - Bank Card Ocr and Verify.
 

+ 1 - 1
VERSION

@@ -1 +1 @@
-1.36.674
+1.36.675

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 0
dms-enterprise/2018-11-01/GetDBTopology.xml


+ 4 - 0
dms-enterprise/CMakeLists.txt

@@ -61,6 +61,8 @@ set(dms-enterprise_public_header_model
 	include/alibabacloud/dms-enterprise/model/ExecuteStructSyncResult.h
 	include/alibabacloud/dms-enterprise/model/GetApprovalDetailRequest.h
 	include/alibabacloud/dms-enterprise/model/GetApprovalDetailResult.h
+	include/alibabacloud/dms-enterprise/model/GetDBTopologyRequest.h
+	include/alibabacloud/dms-enterprise/model/GetDBTopologyResult.h
 	include/alibabacloud/dms-enterprise/model/GetDataCorrectBackupFilesRequest.h
 	include/alibabacloud/dms-enterprise/model/GetDataCorrectBackupFilesResult.h
 	include/alibabacloud/dms-enterprise/model/GetDataCorrectOrderDetailRequest.h
@@ -218,6 +220,8 @@ set(dms-enterprise_src
 	src/model/ExecuteStructSyncResult.cc
 	src/model/GetApprovalDetailRequest.cc
 	src/model/GetApprovalDetailResult.cc
+	src/model/GetDBTopologyRequest.cc
+	src/model/GetDBTopologyResult.cc
 	src/model/GetDataCorrectBackupFilesRequest.cc
 	src/model/GetDataCorrectBackupFilesResult.cc
 	src/model/GetDataCorrectOrderDetailRequest.cc

+ 8 - 0
dms-enterprise/include/alibabacloud/dms-enterprise/Dms_enterpriseClient.h

@@ -62,6 +62,8 @@
 #include "model/ExecuteStructSyncResult.h"
 #include "model/GetApprovalDetailRequest.h"
 #include "model/GetApprovalDetailResult.h"
+#include "model/GetDBTopologyRequest.h"
+#include "model/GetDBTopologyResult.h"
 #include "model/GetDataCorrectBackupFilesRequest.h"
 #include "model/GetDataCorrectBackupFilesResult.h"
 #include "model/GetDataCorrectOrderDetailRequest.h"
@@ -245,6 +247,9 @@ namespace AlibabaCloud
 			typedef Outcome<Error, Model::GetApprovalDetailResult> GetApprovalDetailOutcome;
 			typedef std::future<GetApprovalDetailOutcome> GetApprovalDetailOutcomeCallable;
 			typedef std::function<void(const Dms_enterpriseClient*, const Model::GetApprovalDetailRequest&, const GetApprovalDetailOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetApprovalDetailAsyncHandler;
+			typedef Outcome<Error, Model::GetDBTopologyResult> GetDBTopologyOutcome;
+			typedef std::future<GetDBTopologyOutcome> GetDBTopologyOutcomeCallable;
+			typedef std::function<void(const Dms_enterpriseClient*, const Model::GetDBTopologyRequest&, const GetDBTopologyOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetDBTopologyAsyncHandler;
 			typedef Outcome<Error, Model::GetDataCorrectBackupFilesResult> GetDataCorrectBackupFilesOutcome;
 			typedef std::future<GetDataCorrectBackupFilesOutcome> GetDataCorrectBackupFilesOutcomeCallable;
 			typedef std::function<void(const Dms_enterpriseClient*, const Model::GetDataCorrectBackupFilesRequest&, const GetDataCorrectBackupFilesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetDataCorrectBackupFilesAsyncHandler;
@@ -481,6 +486,9 @@ namespace AlibabaCloud
 			GetApprovalDetailOutcome getApprovalDetail(const Model::GetApprovalDetailRequest &request)const;
 			void getApprovalDetailAsync(const Model::GetApprovalDetailRequest& request, const GetApprovalDetailAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
 			GetApprovalDetailOutcomeCallable getApprovalDetailCallable(const Model::GetApprovalDetailRequest& request) const;
+			GetDBTopologyOutcome getDBTopology(const Model::GetDBTopologyRequest &request)const;
+			void getDBTopologyAsync(const Model::GetDBTopologyRequest& request, const GetDBTopologyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
+			GetDBTopologyOutcomeCallable getDBTopologyCallable(const Model::GetDBTopologyRequest& request) const;
 			GetDataCorrectBackupFilesOutcome getDataCorrectBackupFiles(const Model::GetDataCorrectBackupFilesRequest &request)const;
 			void getDataCorrectBackupFilesAsync(const Model::GetDataCorrectBackupFilesRequest& request, const GetDataCorrectBackupFilesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
 			GetDataCorrectBackupFilesOutcomeCallable getDataCorrectBackupFilesCallable(const Model::GetDataCorrectBackupFilesRequest& request) const;

+ 51 - 0
dms-enterprise/include/alibabacloud/dms-enterprise/model/GetDBTopologyRequest.h

@@ -0,0 +1,51 @@
+/*
+ * 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_GETDBTOPOLOGYREQUEST_H_
+#define ALIBABACLOUD_DMS_ENTERPRISE_MODEL_GETDBTOPOLOGYREQUEST_H_
+
+#include <string>
+#include <vector>
+#include <alibabacloud/core/RpcServiceRequest.h>
+#include <alibabacloud/dms-enterprise/Dms_enterpriseExport.h>
+
+namespace AlibabaCloud
+{
+	namespace Dms_enterprise
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_DMS_ENTERPRISE_EXPORT GetDBTopologyRequest : public RpcServiceRequest
+			{
+
+			public:
+				GetDBTopologyRequest();
+				~GetDBTopologyRequest();
+
+				long getLogicDbId()const;
+				void setLogicDbId(long logicDbId);
+				long getTid()const;
+				void setTid(long tid);
+
+            private:
+				long logicDbId_;
+				long tid_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_DMS_ENTERPRISE_MODEL_GETDBTOPOLOGYREQUEST_H_

+ 80 - 0
dms-enterprise/include/alibabacloud/dms-enterprise/model/GetDBTopologyResult.h

@@ -0,0 +1,80 @@
+/*
+ * 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_GETDBTOPOLOGYRESULT_H_
+#define ALIBABACLOUD_DMS_ENTERPRISE_MODEL_GETDBTOPOLOGYRESULT_H_
+
+#include <string>
+#include <vector>
+#include <utility>
+#include <alibabacloud/core/ServiceResult.h>
+#include <alibabacloud/dms-enterprise/Dms_enterpriseExport.h>
+
+namespace AlibabaCloud
+{
+	namespace Dms_enterprise
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_DMS_ENTERPRISE_EXPORT GetDBTopologyResult : public ServiceResult
+			{
+			public:
+				struct DBTopology
+				{
+					struct DBTopologyInfo
+					{
+						std::string instanceSource;
+						std::string instanceResourceId;
+						long instanceId;
+						std::string searchName;
+						long dbId;
+						std::string catalogName;
+						std::string regionId;
+						std::string envType;
+						std::string dbType;
+						std::string schemaName;
+					};
+					long logicDbId;
+					std::string searchName;
+					std::string alias;
+					std::string logicDbName;
+					std::vector<DBTopologyInfo> dBTopologyInfoList;
+					std::string envType;
+					std::string dbType;
+				};
+
+
+				GetDBTopologyResult();
+				explicit GetDBTopologyResult(const std::string &payload);
+				~GetDBTopologyResult();
+				DBTopology getDBTopology()const;
+				std::string getErrorCode()const;
+				std::string getErrorMessage()const;
+				bool getSuccess()const;
+
+			protected:
+				void parse(const std::string &payload);
+			private:
+				DBTopology dBTopology_;
+				std::string errorCode_;
+				std::string errorMessage_;
+				bool success_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_DMS_ENTERPRISE_MODEL_GETDBTOPOLOGYRESULT_H_

+ 36 - 0
dms-enterprise/src/Dms-enterpriseClient.cc

@@ -771,6 +771,42 @@ Dms_enterpriseClient::GetApprovalDetailOutcomeCallable Dms_enterpriseClient::get
 	return task->get_future();
 }
 
+Dms_enterpriseClient::GetDBTopologyOutcome Dms_enterpriseClient::getDBTopology(const GetDBTopologyRequest &request) const
+{
+	auto endpointOutcome = endpointProvider_->getEndpoint();
+	if (!endpointOutcome.isSuccess())
+		return GetDBTopologyOutcome(endpointOutcome.error());
+
+	auto outcome = makeRequest(endpointOutcome.result(), request);
+
+	if (outcome.isSuccess())
+		return GetDBTopologyOutcome(GetDBTopologyResult(outcome.result()));
+	else
+		return GetDBTopologyOutcome(outcome.error());
+}
+
+void Dms_enterpriseClient::getDBTopologyAsync(const GetDBTopologyRequest& request, const GetDBTopologyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
+{
+	auto fn = [this, request, handler, context]()
+	{
+		handler(this, request, getDBTopology(request), context);
+	};
+
+	asyncExecute(new Runnable(fn));
+}
+
+Dms_enterpriseClient::GetDBTopologyOutcomeCallable Dms_enterpriseClient::getDBTopologyCallable(const GetDBTopologyRequest &request) const
+{
+	auto task = std::make_shared<std::packaged_task<GetDBTopologyOutcome()>>(
+			[this, request]()
+			{
+			return this->getDBTopology(request);
+			});
+
+	asyncExecute(new Runnable([task]() { (*task)(); }));
+	return task->get_future();
+}
+
 Dms_enterpriseClient::GetDataCorrectBackupFilesOutcome Dms_enterpriseClient::getDataCorrectBackupFiles(const GetDataCorrectBackupFilesRequest &request) const
 {
 	auto endpointOutcome = endpointProvider_->getEndpoint();

+ 51 - 0
dms-enterprise/src/model/GetDBTopologyRequest.cc

@@ -0,0 +1,51 @@
+/*
+ * 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/dms-enterprise/model/GetDBTopologyRequest.h>
+
+using AlibabaCloud::Dms_enterprise::Model::GetDBTopologyRequest;
+
+GetDBTopologyRequest::GetDBTopologyRequest() :
+	RpcServiceRequest("dms-enterprise", "2018-11-01", "GetDBTopology")
+{
+	setMethod(HttpRequest::Method::Post);
+}
+
+GetDBTopologyRequest::~GetDBTopologyRequest()
+{}
+
+long GetDBTopologyRequest::getLogicDbId()const
+{
+	return logicDbId_;
+}
+
+void GetDBTopologyRequest::setLogicDbId(long logicDbId)
+{
+	logicDbId_ = logicDbId;
+	setParameter("LogicDbId", std::to_string(logicDbId));
+}
+
+long GetDBTopologyRequest::getTid()const
+{
+	return tid_;
+}
+
+void GetDBTopologyRequest::setTid(long tid)
+{
+	tid_ = tid;
+	setParameter("Tid", std::to_string(tid));
+}
+

+ 109 - 0
dms-enterprise/src/model/GetDBTopologyResult.cc

@@ -0,0 +1,109 @@
+/*
+ * 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/dms-enterprise/model/GetDBTopologyResult.h>
+#include <json/json.h>
+
+using namespace AlibabaCloud::Dms_enterprise;
+using namespace AlibabaCloud::Dms_enterprise::Model;
+
+GetDBTopologyResult::GetDBTopologyResult() :
+	ServiceResult()
+{}
+
+GetDBTopologyResult::GetDBTopologyResult(const std::string &payload) :
+	ServiceResult()
+{
+	parse(payload);
+}
+
+GetDBTopologyResult::~GetDBTopologyResult()
+{}
+
+void GetDBTopologyResult::parse(const std::string &payload)
+{
+	Json::Reader reader;
+	Json::Value value;
+	reader.parse(payload, value);
+	setRequestId(value["RequestId"].asString());
+	auto dBTopologyNode = value["DBTopology"];
+	if(!dBTopologyNode["LogicDbId"].isNull())
+		dBTopology_.logicDbId = std::stol(dBTopologyNode["LogicDbId"].asString());
+	if(!dBTopologyNode["SearchName"].isNull())
+		dBTopology_.searchName = dBTopologyNode["SearchName"].asString();
+	if(!dBTopologyNode["Alias"].isNull())
+		dBTopology_.alias = dBTopologyNode["Alias"].asString();
+	if(!dBTopologyNode["LogicDbName"].isNull())
+		dBTopology_.logicDbName = dBTopologyNode["LogicDbName"].asString();
+	if(!dBTopologyNode["EnvType"].isNull())
+		dBTopology_.envType = dBTopologyNode["EnvType"].asString();
+	if(!dBTopologyNode["DbType"].isNull())
+		dBTopology_.dbType = dBTopologyNode["DbType"].asString();
+	auto allDBTopologyInfoListNode = dBTopologyNode["DBTopologyInfoList"]["DBTopologyInfo"];
+	for (auto dBTopologyNodeDBTopologyInfoListDBTopologyInfo : allDBTopologyInfoListNode)
+	{
+		DBTopology::DBTopologyInfo dBTopologyInfoObject;
+		if(!dBTopologyNodeDBTopologyInfoListDBTopologyInfo["InstanceSource"].isNull())
+			dBTopologyInfoObject.instanceSource = dBTopologyNodeDBTopologyInfoListDBTopologyInfo["InstanceSource"].asString();
+		if(!dBTopologyNodeDBTopologyInfoListDBTopologyInfo["InstanceResourceId"].isNull())
+			dBTopologyInfoObject.instanceResourceId = dBTopologyNodeDBTopologyInfoListDBTopologyInfo["InstanceResourceId"].asString();
+		if(!dBTopologyNodeDBTopologyInfoListDBTopologyInfo["InstanceId"].isNull())
+			dBTopologyInfoObject.instanceId = std::stol(dBTopologyNodeDBTopologyInfoListDBTopologyInfo["InstanceId"].asString());
+		if(!dBTopologyNodeDBTopologyInfoListDBTopologyInfo["SearchName"].isNull())
+			dBTopologyInfoObject.searchName = dBTopologyNodeDBTopologyInfoListDBTopologyInfo["SearchName"].asString();
+		if(!dBTopologyNodeDBTopologyInfoListDBTopologyInfo["DbId"].isNull())
+			dBTopologyInfoObject.dbId = std::stol(dBTopologyNodeDBTopologyInfoListDBTopologyInfo["DbId"].asString());
+		if(!dBTopologyNodeDBTopologyInfoListDBTopologyInfo["CatalogName"].isNull())
+			dBTopologyInfoObject.catalogName = dBTopologyNodeDBTopologyInfoListDBTopologyInfo["CatalogName"].asString();
+		if(!dBTopologyNodeDBTopologyInfoListDBTopologyInfo["RegionId"].isNull())
+			dBTopologyInfoObject.regionId = dBTopologyNodeDBTopologyInfoListDBTopologyInfo["RegionId"].asString();
+		if(!dBTopologyNodeDBTopologyInfoListDBTopologyInfo["EnvType"].isNull())
+			dBTopologyInfoObject.envType = dBTopologyNodeDBTopologyInfoListDBTopologyInfo["EnvType"].asString();
+		if(!dBTopologyNodeDBTopologyInfoListDBTopologyInfo["DbType"].isNull())
+			dBTopologyInfoObject.dbType = dBTopologyNodeDBTopologyInfoListDBTopologyInfo["DbType"].asString();
+		if(!dBTopologyNodeDBTopologyInfoListDBTopologyInfo["SchemaName"].isNull())
+			dBTopologyInfoObject.schemaName = dBTopologyNodeDBTopologyInfoListDBTopologyInfo["SchemaName"].asString();
+		dBTopology_.dBTopologyInfoList.push_back(dBTopologyInfoObject);
+	}
+	if(!value["ErrorCode"].isNull())
+		errorCode_ = value["ErrorCode"].asString();
+	if(!value["ErrorMessage"].isNull())
+		errorMessage_ = value["ErrorMessage"].asString();
+	if(!value["Success"].isNull())
+		success_ = value["Success"].asString() == "true";
+
+}
+
+GetDBTopologyResult::DBTopology GetDBTopologyResult::getDBTopology()const
+{
+	return dBTopology_;
+}
+
+std::string GetDBTopologyResult::getErrorCode()const
+{
+	return errorCode_;
+}
+
+std::string GetDBTopologyResult::getErrorMessage()const
+{
+	return errorMessage_;
+}
+
+bool GetDBTopologyResult::getSuccess()const
+{
+	return success_;
+}
+

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
dms-enterprise/version-2018-11-01.xml


Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor