Procházet zdrojové kódy

Support GetPhysicalDatabase API.

sdk-team před 5 roky
rodič
revize
9f6ab32ea8

+ 3 - 0
CHANGELOG

@@ -1,3 +1,6 @@
+2021-04-22 Version: 1.36.694
+- Support GetPhysicalDatabase API.
+
 2021-04-21 Version: 1.36.693
 - Add API to list repo members with group inherited info.
 

+ 1 - 1
VERSION

@@ -1 +1 @@
-1.36.693
+1.36.694

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
dms-enterprise/2018-11-01/GetOrderBaseInfo.xml


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 0
dms-enterprise/2018-11-01/GetPhysicalDatabase.xml


+ 4 - 0
dms-enterprise/CMakeLists.txt

@@ -95,6 +95,8 @@ set(dms-enterprise_public_header_model
 	include/alibabacloud/dms-enterprise/model/GetOwnerApplyOrderDetailResult.h
 	include/alibabacloud/dms-enterprise/model/GetPermApplyOrderDetailRequest.h
 	include/alibabacloud/dms-enterprise/model/GetPermApplyOrderDetailResult.h
+	include/alibabacloud/dms-enterprise/model/GetPhysicalDatabaseRequest.h
+	include/alibabacloud/dms-enterprise/model/GetPhysicalDatabaseResult.h
 	include/alibabacloud/dms-enterprise/model/GetStructSyncExecSqlDetailRequest.h
 	include/alibabacloud/dms-enterprise/model/GetStructSyncExecSqlDetailResult.h
 	include/alibabacloud/dms-enterprise/model/GetStructSyncJobAnalyzeResultRequest.h
@@ -254,6 +256,8 @@ set(dms-enterprise_src
 	src/model/GetOwnerApplyOrderDetailResult.cc
 	src/model/GetPermApplyOrderDetailRequest.cc
 	src/model/GetPermApplyOrderDetailResult.cc
+	src/model/GetPhysicalDatabaseRequest.cc
+	src/model/GetPhysicalDatabaseResult.cc
 	src/model/GetStructSyncExecSqlDetailRequest.cc
 	src/model/GetStructSyncExecSqlDetailResult.cc
 	src/model/GetStructSyncJobAnalyzeResultRequest.cc

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

@@ -96,6 +96,8 @@
 #include "model/GetOwnerApplyOrderDetailResult.h"
 #include "model/GetPermApplyOrderDetailRequest.h"
 #include "model/GetPermApplyOrderDetailResult.h"
+#include "model/GetPhysicalDatabaseRequest.h"
+#include "model/GetPhysicalDatabaseResult.h"
 #include "model/GetStructSyncExecSqlDetailRequest.h"
 #include "model/GetStructSyncExecSqlDetailResult.h"
 #include "model/GetStructSyncJobAnalyzeResultRequest.h"
@@ -298,6 +300,9 @@ namespace AlibabaCloud
 			typedef Outcome<Error, Model::GetPermApplyOrderDetailResult> GetPermApplyOrderDetailOutcome;
 			typedef std::future<GetPermApplyOrderDetailOutcome> GetPermApplyOrderDetailOutcomeCallable;
 			typedef std::function<void(const Dms_enterpriseClient*, const Model::GetPermApplyOrderDetailRequest&, const GetPermApplyOrderDetailOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetPermApplyOrderDetailAsyncHandler;
+			typedef Outcome<Error, Model::GetPhysicalDatabaseResult> GetPhysicalDatabaseOutcome;
+			typedef std::future<GetPhysicalDatabaseOutcome> GetPhysicalDatabaseOutcomeCallable;
+			typedef std::function<void(const Dms_enterpriseClient*, const Model::GetPhysicalDatabaseRequest&, const GetPhysicalDatabaseOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetPhysicalDatabaseAsyncHandler;
 			typedef Outcome<Error, Model::GetStructSyncExecSqlDetailResult> GetStructSyncExecSqlDetailOutcome;
 			typedef std::future<GetStructSyncExecSqlDetailOutcome> GetStructSyncExecSqlDetailOutcomeCallable;
 			typedef std::function<void(const Dms_enterpriseClient*, const Model::GetStructSyncExecSqlDetailRequest&, const GetStructSyncExecSqlDetailOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetStructSyncExecSqlDetailAsyncHandler;
@@ -537,6 +542,9 @@ namespace AlibabaCloud
 			GetPermApplyOrderDetailOutcome getPermApplyOrderDetail(const Model::GetPermApplyOrderDetailRequest &request)const;
 			void getPermApplyOrderDetailAsync(const Model::GetPermApplyOrderDetailRequest& request, const GetPermApplyOrderDetailAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
 			GetPermApplyOrderDetailOutcomeCallable getPermApplyOrderDetailCallable(const Model::GetPermApplyOrderDetailRequest& request) const;
+			GetPhysicalDatabaseOutcome getPhysicalDatabase(const Model::GetPhysicalDatabaseRequest &request)const;
+			void getPhysicalDatabaseAsync(const Model::GetPhysicalDatabaseRequest& request, const GetPhysicalDatabaseAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
+			GetPhysicalDatabaseOutcomeCallable getPhysicalDatabaseCallable(const Model::GetPhysicalDatabaseRequest& request) const;
 			GetStructSyncExecSqlDetailOutcome getStructSyncExecSqlDetail(const Model::GetStructSyncExecSqlDetailRequest &request)const;
 			void getStructSyncExecSqlDetailAsync(const Model::GetStructSyncExecSqlDetailRequest& request, const GetStructSyncExecSqlDetailAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
 			GetStructSyncExecSqlDetailOutcomeCallable getStructSyncExecSqlDetailCallable(const Model::GetStructSyncExecSqlDetailRequest& request) const;

+ 51 - 0
dms-enterprise/include/alibabacloud/dms-enterprise/model/GetPhysicalDatabaseRequest.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_GETPHYSICALDATABASEREQUEST_H_
+#define ALIBABACLOUD_DMS_ENTERPRISE_MODEL_GETPHYSICALDATABASEREQUEST_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 GetPhysicalDatabaseRequest : public RpcServiceRequest
+			{
+
+			public:
+				GetPhysicalDatabaseRequest();
+				~GetPhysicalDatabaseRequest();
+
+				long getDbId()const;
+				void setDbId(long dbId);
+				long getTid()const;
+				void setTid(long tid);
+
+            private:
+				long dbId_;
+				long tid_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_DMS_ENTERPRISE_MODEL_GETPHYSICALDATABASEREQUEST_H_

+ 76 - 0
dms-enterprise/include/alibabacloud/dms-enterprise/model/GetPhysicalDatabaseResult.h

@@ -0,0 +1,76 @@
+/*
+ * 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_GETPHYSICALDATABASERESULT_H_
+#define ALIBABACLOUD_DMS_ENTERPRISE_MODEL_GETPHYSICALDATABASERESULT_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 GetPhysicalDatabaseResult : public ServiceResult
+			{
+			public:
+				struct Database
+				{
+					std::string searchName;
+					std::string instanceId;
+					int port;
+					std::string encoding;
+					std::string host;
+					std::string databaseId;
+					std::string dbType;
+					std::string envType;
+					std::string sid;
+					std::string dbaName;
+					std::string dbaId;
+					std::string state;
+					std::string catalogName;
+					std::vector<std::string> ownerNameList;
+					std::string schemaName;
+					std::vector<std::string> ownerIdList;
+				};
+
+
+				GetPhysicalDatabaseResult();
+				explicit GetPhysicalDatabaseResult(const std::string &payload);
+				~GetPhysicalDatabaseResult();
+				Database getDatabase()const;
+				std::string getErrorCode()const;
+				std::string getErrorMessage()const;
+				bool getSuccess()const;
+
+			protected:
+				void parse(const std::string &payload);
+			private:
+				Database database_;
+				std::string errorCode_;
+				std::string errorMessage_;
+				bool success_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_DMS_ENTERPRISE_MODEL_GETPHYSICALDATABASERESULT_H_

+ 39 - 3
dms-enterprise/src/Dms-enterpriseClient.cc

@@ -31,21 +31,21 @@ Dms_enterpriseClient::Dms_enterpriseClient(const Credentials &credentials, const
 	RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
 {
 	auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
-	endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
+	endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "dms-enterprise");
 }
 
 Dms_enterpriseClient::Dms_enterpriseClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
 	RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
 {
 	auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
-	endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
+	endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "dms-enterprise");
 }
 
 Dms_enterpriseClient::Dms_enterpriseClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
 	RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
 {
 	auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
-	endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
+	endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "dms-enterprise");
 }
 
 Dms_enterpriseClient::~Dms_enterpriseClient()
@@ -1383,6 +1383,42 @@ Dms_enterpriseClient::GetPermApplyOrderDetailOutcomeCallable Dms_enterpriseClien
 	return task->get_future();
 }
 
+Dms_enterpriseClient::GetPhysicalDatabaseOutcome Dms_enterpriseClient::getPhysicalDatabase(const GetPhysicalDatabaseRequest &request) const
+{
+	auto endpointOutcome = endpointProvider_->getEndpoint();
+	if (!endpointOutcome.isSuccess())
+		return GetPhysicalDatabaseOutcome(endpointOutcome.error());
+
+	auto outcome = makeRequest(endpointOutcome.result(), request);
+
+	if (outcome.isSuccess())
+		return GetPhysicalDatabaseOutcome(GetPhysicalDatabaseResult(outcome.result()));
+	else
+		return GetPhysicalDatabaseOutcome(outcome.error());
+}
+
+void Dms_enterpriseClient::getPhysicalDatabaseAsync(const GetPhysicalDatabaseRequest& request, const GetPhysicalDatabaseAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
+{
+	auto fn = [this, request, handler, context]()
+	{
+		handler(this, request, getPhysicalDatabase(request), context);
+	};
+
+	asyncExecute(new Runnable(fn));
+}
+
+Dms_enterpriseClient::GetPhysicalDatabaseOutcomeCallable Dms_enterpriseClient::getPhysicalDatabaseCallable(const GetPhysicalDatabaseRequest &request) const
+{
+	auto task = std::make_shared<std::packaged_task<GetPhysicalDatabaseOutcome()>>(
+			[this, request]()
+			{
+			return this->getPhysicalDatabase(request);
+			});
+
+	asyncExecute(new Runnable([task]() { (*task)(); }));
+	return task->get_future();
+}
+
 Dms_enterpriseClient::GetStructSyncExecSqlDetailOutcome Dms_enterpriseClient::getStructSyncExecSqlDetail(const GetStructSyncExecSqlDetailRequest &request) const
 {
 	auto endpointOutcome = endpointProvider_->getEndpoint();

+ 51 - 0
dms-enterprise/src/model/GetPhysicalDatabaseRequest.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/GetPhysicalDatabaseRequest.h>
+
+using AlibabaCloud::Dms_enterprise::Model::GetPhysicalDatabaseRequest;
+
+GetPhysicalDatabaseRequest::GetPhysicalDatabaseRequest() :
+	RpcServiceRequest("dms-enterprise", "2018-11-01", "GetPhysicalDatabase")
+{
+	setMethod(HttpRequest::Method::Post);
+}
+
+GetPhysicalDatabaseRequest::~GetPhysicalDatabaseRequest()
+{}
+
+long GetPhysicalDatabaseRequest::getDbId()const
+{
+	return dbId_;
+}
+
+void GetPhysicalDatabaseRequest::setDbId(long dbId)
+{
+	dbId_ = dbId;
+	setParameter("DbId", std::to_string(dbId));
+}
+
+long GetPhysicalDatabaseRequest::getTid()const
+{
+	return tid_;
+}
+
+void GetPhysicalDatabaseRequest::setTid(long tid)
+{
+	tid_ = tid;
+	setParameter("Tid", std::to_string(tid));
+}
+

+ 105 - 0
dms-enterprise/src/model/GetPhysicalDatabaseResult.cc

@@ -0,0 +1,105 @@
+/*
+ * 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/GetPhysicalDatabaseResult.h>
+#include <json/json.h>
+
+using namespace AlibabaCloud::Dms_enterprise;
+using namespace AlibabaCloud::Dms_enterprise::Model;
+
+GetPhysicalDatabaseResult::GetPhysicalDatabaseResult() :
+	ServiceResult()
+{}
+
+GetPhysicalDatabaseResult::GetPhysicalDatabaseResult(const std::string &payload) :
+	ServiceResult()
+{
+	parse(payload);
+}
+
+GetPhysicalDatabaseResult::~GetPhysicalDatabaseResult()
+{}
+
+void GetPhysicalDatabaseResult::parse(const std::string &payload)
+{
+	Json::Reader reader;
+	Json::Value value;
+	reader.parse(payload, value);
+	setRequestId(value["RequestId"].asString());
+	auto databaseNode = value["Database"];
+	if(!databaseNode["SearchName"].isNull())
+		database_.searchName = databaseNode["SearchName"].asString();
+	if(!databaseNode["InstanceId"].isNull())
+		database_.instanceId = databaseNode["InstanceId"].asString();
+	if(!databaseNode["Port"].isNull())
+		database_.port = std::stoi(databaseNode["Port"].asString());
+	if(!databaseNode["Encoding"].isNull())
+		database_.encoding = databaseNode["Encoding"].asString();
+	if(!databaseNode["Host"].isNull())
+		database_.host = databaseNode["Host"].asString();
+	if(!databaseNode["DatabaseId"].isNull())
+		database_.databaseId = databaseNode["DatabaseId"].asString();
+	if(!databaseNode["DbType"].isNull())
+		database_.dbType = databaseNode["DbType"].asString();
+	if(!databaseNode["EnvType"].isNull())
+		database_.envType = databaseNode["EnvType"].asString();
+	if(!databaseNode["Sid"].isNull())
+		database_.sid = databaseNode["Sid"].asString();
+	if(!databaseNode["DbaName"].isNull())
+		database_.dbaName = databaseNode["DbaName"].asString();
+	if(!databaseNode["DbaId"].isNull())
+		database_.dbaId = databaseNode["DbaId"].asString();
+	if(!databaseNode["State"].isNull())
+		database_.state = databaseNode["State"].asString();
+	if(!databaseNode["CatalogName"].isNull())
+		database_.catalogName = databaseNode["CatalogName"].asString();
+	if(!databaseNode["SchemaName"].isNull())
+		database_.schemaName = databaseNode["SchemaName"].asString();
+		auto allOwnerNameList = databaseNode["OwnerNameList"]["OwnerNames"];
+		for (auto value : allOwnerNameList)
+			database_.ownerNameList.push_back(value.asString());
+		auto allOwnerIdList = databaseNode["OwnerIdList"]["OwnerIds"];
+		for (auto value : allOwnerIdList)
+			database_.ownerIdList.push_back(value.asString());
+	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";
+
+}
+
+GetPhysicalDatabaseResult::Database GetPhysicalDatabaseResult::getDatabase()const
+{
+	return database_;
+}
+
+std::string GetPhysicalDatabaseResult::getErrorCode()const
+{
+	return errorCode_;
+}
+
+std::string GetPhysicalDatabaseResult::getErrorMessage()const
+{
+	return errorMessage_;
+}
+
+bool GetPhysicalDatabaseResult::getSuccess()const
+{
+	return success_;
+}
+

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
dms-enterprise/version-2018-11-01.xml


Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů