Support query user tenant list and current active tenant.

This commit is contained in:
sdk-team
2020-09-19 07:29:55 +00:00
parent 7ac1c23a9f
commit d69766bdfd
40 changed files with 1703 additions and 43 deletions

View File

@@ -771,6 +771,78 @@ Dms_enterpriseClient::GetLogicDatabaseOutcomeCallable Dms_enterpriseClient::getL
return task->get_future();
}
Dms_enterpriseClient::GetMetaTableColumnOutcome Dms_enterpriseClient::getMetaTableColumn(const GetMetaTableColumnRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GetMetaTableColumnOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GetMetaTableColumnOutcome(GetMetaTableColumnResult(outcome.result()));
else
return GetMetaTableColumnOutcome(outcome.error());
}
void Dms_enterpriseClient::getMetaTableColumnAsync(const GetMetaTableColumnRequest& request, const GetMetaTableColumnAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, getMetaTableColumn(request), context);
};
asyncExecute(new Runnable(fn));
}
Dms_enterpriseClient::GetMetaTableColumnOutcomeCallable Dms_enterpriseClient::getMetaTableColumnCallable(const GetMetaTableColumnRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GetMetaTableColumnOutcome()>>(
[this, request]()
{
return this->getMetaTableColumn(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
Dms_enterpriseClient::GetMetaTableDetailInfoOutcome Dms_enterpriseClient::getMetaTableDetailInfo(const GetMetaTableDetailInfoRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GetMetaTableDetailInfoOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GetMetaTableDetailInfoOutcome(GetMetaTableDetailInfoResult(outcome.result()));
else
return GetMetaTableDetailInfoOutcome(outcome.error());
}
void Dms_enterpriseClient::getMetaTableDetailInfoAsync(const GetMetaTableDetailInfoRequest& request, const GetMetaTableDetailInfoAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, getMetaTableDetailInfo(request), context);
};
asyncExecute(new Runnable(fn));
}
Dms_enterpriseClient::GetMetaTableDetailInfoOutcomeCallable Dms_enterpriseClient::getMetaTableDetailInfoCallable(const GetMetaTableDetailInfoRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GetMetaTableDetailInfoOutcome()>>(
[this, request]()
{
return this->getMetaTableDetailInfo(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
Dms_enterpriseClient::GetOpLogOutcome Dms_enterpriseClient::getOpLog(const GetOpLogRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -843,6 +915,42 @@ Dms_enterpriseClient::GetOrderBaseInfoOutcomeCallable Dms_enterpriseClient::getO
return task->get_future();
}
Dms_enterpriseClient::GetTableDBTopologyOutcome Dms_enterpriseClient::getTableDBTopology(const GetTableDBTopologyRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GetTableDBTopologyOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GetTableDBTopologyOutcome(GetTableDBTopologyResult(outcome.result()));
else
return GetTableDBTopologyOutcome(outcome.error());
}
void Dms_enterpriseClient::getTableDBTopologyAsync(const GetTableDBTopologyRequest& request, const GetTableDBTopologyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, getTableDBTopology(request), context);
};
asyncExecute(new Runnable(fn));
}
Dms_enterpriseClient::GetTableDBTopologyOutcomeCallable Dms_enterpriseClient::getTableDBTopologyCallable(const GetTableDBTopologyRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GetTableDBTopologyOutcome()>>(
[this, request]()
{
return this->getTableDBTopology(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
Dms_enterpriseClient::GetUserOutcome Dms_enterpriseClient::getUser(const GetUserRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -879,6 +987,42 @@ Dms_enterpriseClient::GetUserOutcomeCallable Dms_enterpriseClient::getUserCallab
return task->get_future();
}
Dms_enterpriseClient::GetUserActiveTenantOutcome Dms_enterpriseClient::getUserActiveTenant(const GetUserActiveTenantRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GetUserActiveTenantOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GetUserActiveTenantOutcome(GetUserActiveTenantResult(outcome.result()));
else
return GetUserActiveTenantOutcome(outcome.error());
}
void Dms_enterpriseClient::getUserActiveTenantAsync(const GetUserActiveTenantRequest& request, const GetUserActiveTenantAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, getUserActiveTenant(request), context);
};
asyncExecute(new Runnable(fn));
}
Dms_enterpriseClient::GetUserActiveTenantOutcomeCallable Dms_enterpriseClient::getUserActiveTenantCallable(const GetUserActiveTenantRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GetUserActiveTenantOutcome()>>(
[this, request]()
{
return this->getUserActiveTenant(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
Dms_enterpriseClient::GrantUserPermissionOutcome Dms_enterpriseClient::grantUserPermission(const GrantUserPermissionRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -1347,6 +1491,42 @@ Dms_enterpriseClient::ListUserPermissionsOutcomeCallable Dms_enterpriseClient::l
return task->get_future();
}
Dms_enterpriseClient::ListUserTenantsOutcome Dms_enterpriseClient::listUserTenants(const ListUserTenantsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ListUserTenantsOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ListUserTenantsOutcome(ListUserTenantsResult(outcome.result()));
else
return ListUserTenantsOutcome(outcome.error());
}
void Dms_enterpriseClient::listUserTenantsAsync(const ListUserTenantsRequest& request, const ListUserTenantsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, listUserTenants(request), context);
};
asyncExecute(new Runnable(fn));
}
Dms_enterpriseClient::ListUserTenantsOutcomeCallable Dms_enterpriseClient::listUserTenantsCallable(const ListUserTenantsRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ListUserTenantsOutcome()>>(
[this, request]()
{
return this->listUserTenants(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
Dms_enterpriseClient::ListUsersOutcome Dms_enterpriseClient::listUsers(const ListUsersRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -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/GetMetaTableColumnRequest.h>
using AlibabaCloud::Dms_enterprise::Model::GetMetaTableColumnRequest;
GetMetaTableColumnRequest::GetMetaTableColumnRequest() :
RpcServiceRequest("dms-enterprise", "2018-11-01", "GetMetaTableColumn")
{
setMethod(HttpRequest::Method::Post);
}
GetMetaTableColumnRequest::~GetMetaTableColumnRequest()
{}
std::string GetMetaTableColumnRequest::getTableGuid()const
{
return tableGuid_;
}
void GetMetaTableColumnRequest::setTableGuid(const std::string& tableGuid)
{
tableGuid_ = tableGuid;
setParameter("TableGuid", tableGuid);
}
long GetMetaTableColumnRequest::getTid()const
{
return tid_;
}
void GetMetaTableColumnRequest::setTid(long tid)
{
tid_ = tid;
setParameter("Tid", std::to_string(tid));
}

View File

@@ -0,0 +1,100 @@
/*
* 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/GetMetaTableColumnResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Dms_enterprise;
using namespace AlibabaCloud::Dms_enterprise::Model;
GetMetaTableColumnResult::GetMetaTableColumnResult() :
ServiceResult()
{}
GetMetaTableColumnResult::GetMetaTableColumnResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GetMetaTableColumnResult::~GetMetaTableColumnResult()
{}
void GetMetaTableColumnResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allColumnListNode = value["ColumnList"]["Column"];
for (auto valueColumnListColumn : allColumnListNode)
{
Column columnListObject;
if(!valueColumnListColumn["ColumnId"].isNull())
columnListObject.columnId = valueColumnListColumn["ColumnId"].asString();
if(!valueColumnListColumn["ColumnName"].isNull())
columnListObject.columnName = valueColumnListColumn["ColumnName"].asString();
if(!valueColumnListColumn["ColumnType"].isNull())
columnListObject.columnType = valueColumnListColumn["ColumnType"].asString();
if(!valueColumnListColumn["DataLength"].isNull())
columnListObject.dataLength = std::stoi(valueColumnListColumn["DataLength"].asString());
if(!valueColumnListColumn["Description"].isNull())
columnListObject.description = valueColumnListColumn["Description"].asString();
if(!valueColumnListColumn["Position"].isNull())
columnListObject.position = std::stoi(valueColumnListColumn["Position"].asString());
if(!valueColumnListColumn["AutoIncrement"].isNull())
columnListObject.autoIncrement = valueColumnListColumn["AutoIncrement"].asString() == "true";
if(!valueColumnListColumn["Nullable"].isNull())
columnListObject.nullable = valueColumnListColumn["Nullable"].asString() == "true";
if(!valueColumnListColumn["SecurityLevel"].isNull())
columnListObject.securityLevel = valueColumnListColumn["SecurityLevel"].asString();
if(!valueColumnListColumn["PrimaryKey"].isNull())
columnListObject.primaryKey = valueColumnListColumn["PrimaryKey"].asString();
if(!valueColumnListColumn["DataScale"].isNull())
columnListObject.dataScale = std::stoi(valueColumnListColumn["DataScale"].asString());
if(!valueColumnListColumn["DataPrecision"].isNull())
columnListObject.dataPrecision = std::stoi(valueColumnListColumn["DataPrecision"].asString());
columnList_.push_back(columnListObject);
}
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();
}
std::vector<GetMetaTableColumnResult::Column> GetMetaTableColumnResult::getColumnList()const
{
return columnList_;
}
std::string GetMetaTableColumnResult::getErrorCode()const
{
return errorCode_;
}
std::string GetMetaTableColumnResult::getErrorMessage()const
{
return errorMessage_;
}
bool GetMetaTableColumnResult::getSuccess()const
{
return success_;
}

View File

@@ -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/GetMetaTableDetailInfoRequest.h>
using AlibabaCloud::Dms_enterprise::Model::GetMetaTableDetailInfoRequest;
GetMetaTableDetailInfoRequest::GetMetaTableDetailInfoRequest() :
RpcServiceRequest("dms-enterprise", "2018-11-01", "GetMetaTableDetailInfo")
{
setMethod(HttpRequest::Method::Post);
}
GetMetaTableDetailInfoRequest::~GetMetaTableDetailInfoRequest()
{}
std::string GetMetaTableDetailInfoRequest::getTableGuid()const
{
return tableGuid_;
}
void GetMetaTableDetailInfoRequest::setTableGuid(const std::string& tableGuid)
{
tableGuid_ = tableGuid;
setParameter("TableGuid", tableGuid);
}
long GetMetaTableDetailInfoRequest::getTid()const
{
return tid_;
}
void GetMetaTableDetailInfoRequest::setTid(long tid)
{
tid_ = tid;
setParameter("Tid", std::to_string(tid));
}

View File

@@ -0,0 +1,114 @@
/*
* 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/GetMetaTableDetailInfoResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Dms_enterprise;
using namespace AlibabaCloud::Dms_enterprise::Model;
GetMetaTableDetailInfoResult::GetMetaTableDetailInfoResult() :
ServiceResult()
{}
GetMetaTableDetailInfoResult::GetMetaTableDetailInfoResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GetMetaTableDetailInfoResult::~GetMetaTableDetailInfoResult()
{}
void GetMetaTableDetailInfoResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto detailInfoNode = value["DetailInfo"];
auto allColumnListNode = detailInfoNode["ColumnList"]["Column"];
for (auto detailInfoNodeColumnListColumn : allColumnListNode)
{
DetailInfo::Column columnObject;
if(!detailInfoNodeColumnListColumn["Description"].isNull())
columnObject.description = detailInfoNodeColumnListColumn["Description"].asString();
if(!detailInfoNodeColumnListColumn["ColumnType"].isNull())
columnObject.columnType = detailInfoNodeColumnListColumn["ColumnType"].asString();
if(!detailInfoNodeColumnListColumn["Position"].isNull())
columnObject.position = detailInfoNodeColumnListColumn["Position"].asString();
if(!detailInfoNodeColumnListColumn["DataLength"].isNull())
columnObject.dataLength = std::stoi(detailInfoNodeColumnListColumn["DataLength"].asString());
if(!detailInfoNodeColumnListColumn["Nullable"].isNull())
columnObject.nullable = detailInfoNodeColumnListColumn["Nullable"].asString() == "true";
if(!detailInfoNodeColumnListColumn["ColumnName"].isNull())
columnObject.columnName = detailInfoNodeColumnListColumn["ColumnName"].asString();
if(!detailInfoNodeColumnListColumn["AutoIncrement"].isNull())
columnObject.autoIncrement = detailInfoNodeColumnListColumn["AutoIncrement"].asString() == "true";
if(!detailInfoNodeColumnListColumn["DataPrecision"].isNull())
columnObject.dataPrecision = std::stoi(detailInfoNodeColumnListColumn["DataPrecision"].asString());
if(!detailInfoNodeColumnListColumn["DataScale"].isNull())
columnObject.dataScale = std::stoi(detailInfoNodeColumnListColumn["DataScale"].asString());
if(!detailInfoNodeColumnListColumn["ColumnId"].isNull())
columnObject.columnId = detailInfoNodeColumnListColumn["ColumnId"].asString();
detailInfo_.columnList.push_back(columnObject);
}
auto allIndexListNode = detailInfoNode["IndexList"]["Index"];
for (auto detailInfoNodeIndexListIndex : allIndexListNode)
{
DetailInfo::Index indexObject;
if(!detailInfoNodeIndexListIndex["IndexName"].isNull())
indexObject.indexName = detailInfoNodeIndexListIndex["IndexName"].asString();
if(!detailInfoNodeIndexListIndex["IndexType"].isNull())
indexObject.indexType = detailInfoNodeIndexListIndex["IndexType"].asString();
if(!detailInfoNodeIndexListIndex["Unique"].isNull())
indexObject.unique = detailInfoNodeIndexListIndex["Unique"].asString() == "true";
if(!detailInfoNodeIndexListIndex["IndexId"].isNull())
indexObject.indexId = detailInfoNodeIndexListIndex["IndexId"].asString();
auto allIndexColumns = value["IndexColumns"]["ColumnNames"];
for (auto value : allIndexColumns)
indexObject.indexColumns.push_back(value.asString());
detailInfo_.indexList.push_back(indexObject);
}
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();
}
GetMetaTableDetailInfoResult::DetailInfo GetMetaTableDetailInfoResult::getDetailInfo()const
{
return detailInfo_;
}
std::string GetMetaTableDetailInfoResult::getErrorCode()const
{
return errorCode_;
}
std::string GetMetaTableDetailInfoResult::getErrorMessage()const
{
return errorMessage_;
}
bool GetMetaTableDetailInfoResult::getSuccess()const
{
return success_;
}

View File

@@ -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/GetTableDBTopologyRequest.h>
using AlibabaCloud::Dms_enterprise::Model::GetTableDBTopologyRequest;
GetTableDBTopologyRequest::GetTableDBTopologyRequest() :
RpcServiceRequest("dms-enterprise", "2018-11-01", "GetTableDBTopology")
{
setMethod(HttpRequest::Method::Post);
}
GetTableDBTopologyRequest::~GetTableDBTopologyRequest()
{}
std::string GetTableDBTopologyRequest::getTableGuid()const
{
return tableGuid_;
}
void GetTableDBTopologyRequest::setTableGuid(const std::string& tableGuid)
{
tableGuid_ = tableGuid;
setParameter("TableGuid", tableGuid);
}
long GetTableDBTopologyRequest::getTid()const
{
return tid_;
}
void GetTableDBTopologyRequest::setTid(long tid)
{
tid_ = tid;
setParameter("Tid", std::to_string(tid));
}

View File

@@ -0,0 +1,115 @@
/*
* 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/GetTableDBTopologyResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Dms_enterprise;
using namespace AlibabaCloud::Dms_enterprise::Model;
GetTableDBTopologyResult::GetTableDBTopologyResult() :
ServiceResult()
{}
GetTableDBTopologyResult::GetTableDBTopologyResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GetTableDBTopologyResult::~GetTableDBTopologyResult()
{}
void GetTableDBTopologyResult::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["TableName"].isNull())
dBTopology_.tableName = dBTopologyNode["TableName"].asString();
if(!dBTopologyNode["TableGuid"].isNull())
dBTopology_.tableGuid = dBTopologyNode["TableGuid"].asString();
auto allDataSourceListNode = dBTopologyNode["DataSourceList"]["DataSource"];
for (auto dBTopologyNodeDataSourceListDataSource : allDataSourceListNode)
{
DBTopology::DataSource dataSourceObject;
if(!dBTopologyNodeDataSourceListDataSource["Host"].isNull())
dataSourceObject.host = dBTopologyNodeDataSourceListDataSource["Host"].asString();
if(!dBTopologyNodeDataSourceListDataSource["Port"].isNull())
dataSourceObject.port = std::stoi(dBTopologyNodeDataSourceListDataSource["Port"].asString());
if(!dBTopologyNodeDataSourceListDataSource["DbType"].isNull())
dataSourceObject.dbType = dBTopologyNodeDataSourceListDataSource["DbType"].asString();
if(!dBTopologyNodeDataSourceListDataSource["Sid"].isNull())
dataSourceObject.sid = dBTopologyNodeDataSourceListDataSource["Sid"].asString();
auto allDatabaseListNode = allDataSourceListNode["DatabaseList"]["Database"];
for (auto allDataSourceListNodeDatabaseListDatabase : allDatabaseListNode)
{
DBTopology::DataSource::Database databaseListObject;
if(!allDataSourceListNodeDatabaseListDatabase["DbName"].isNull())
databaseListObject.dbName = allDataSourceListNodeDatabaseListDatabase["DbName"].asString();
if(!allDataSourceListNodeDatabaseListDatabase["DbId"].isNull())
databaseListObject.dbId = allDataSourceListNodeDatabaseListDatabase["DbId"].asString();
if(!allDataSourceListNodeDatabaseListDatabase["EnvType"].isNull())
databaseListObject.envType = allDataSourceListNodeDatabaseListDatabase["EnvType"].asString();
if(!allDataSourceListNodeDatabaseListDatabase["DbType"].isNull())
databaseListObject.dbType = allDataSourceListNodeDatabaseListDatabase["DbType"].asString();
auto allTableListNode = allDatabaseListNode["TableList"]["Table"];
for (auto allDatabaseListNodeTableListTable : allTableListNode)
{
DBTopology::DataSource::Database::Table tableListObject;
if(!allDatabaseListNodeTableListTable["TableName"].isNull())
tableListObject.tableName = allDatabaseListNodeTableListTable["TableName"].asString();
if(!allDatabaseListNodeTableListTable["TableId"].isNull())
tableListObject.tableId = allDatabaseListNodeTableListTable["TableId"].asString();
if(!allDatabaseListNodeTableListTable["TableType"].isNull())
tableListObject.tableType = allDatabaseListNodeTableListTable["TableType"].asString();
databaseListObject.tableList.push_back(tableListObject);
}
dataSourceObject.databaseList.push_back(databaseListObject);
}
dBTopology_.dataSourceList.push_back(dataSourceObject);
}
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();
}
GetTableDBTopologyResult::DBTopology GetTableDBTopologyResult::getDBTopology()const
{
return dBTopology_;
}
std::string GetTableDBTopologyResult::getErrorCode()const
{
return errorCode_;
}
std::string GetTableDBTopologyResult::getErrorMessage()const
{
return errorMessage_;
}
bool GetTableDBTopologyResult::getSuccess()const
{
return success_;
}

View File

@@ -0,0 +1,29 @@
/*
* 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/GetUserActiveTenantRequest.h>
using AlibabaCloud::Dms_enterprise::Model::GetUserActiveTenantRequest;
GetUserActiveTenantRequest::GetUserActiveTenantRequest() :
RpcServiceRequest("dms-enterprise", "2018-11-01", "GetUserActiveTenant")
{
setMethod(HttpRequest::Method::Post);
}
GetUserActiveTenantRequest::~GetUserActiveTenantRequest()
{}

View File

@@ -0,0 +1,77 @@
/*
* 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/GetUserActiveTenantResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Dms_enterprise;
using namespace AlibabaCloud::Dms_enterprise::Model;
GetUserActiveTenantResult::GetUserActiveTenantResult() :
ServiceResult()
{}
GetUserActiveTenantResult::GetUserActiveTenantResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GetUserActiveTenantResult::~GetUserActiveTenantResult()
{}
void GetUserActiveTenantResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto tenantNode = value["Tenant"];
if(!tenantNode["Tid"].isNull())
tenant_.tid = std::stol(tenantNode["Tid"].asString());
if(!tenantNode["TenantName"].isNull())
tenant_.tenantName = tenantNode["TenantName"].asString();
if(!tenantNode["Status"].isNull())
tenant_.status = tenantNode["Status"].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();
}
GetUserActiveTenantResult::Tenant GetUserActiveTenantResult::getTenant()const
{
return tenant_;
}
std::string GetUserActiveTenantResult::getErrorCode()const
{
return errorCode_;
}
std::string GetUserActiveTenantResult::getErrorMessage()const
{
return errorMessage_;
}
bool GetUserActiveTenantResult::getSuccess()const
{
return success_;
}

View File

@@ -38,6 +38,17 @@ void ListLogicTablesRequest::setSearchName(const std::string& searchName)
setParameter("SearchName", searchName);
}
bool ListLogicTablesRequest::getReturnGuid()const
{
return returnGuid_;
}
void ListLogicTablesRequest::setReturnGuid(bool returnGuid)
{
returnGuid_ = returnGuid;
setParameter("ReturnGuid", returnGuid ? "true" : "false");
}
int ListLogicTablesRequest::getPageSize()const
{
return pageSize_;

View File

@@ -55,6 +55,10 @@ void ListLogicTablesResult::parse(const std::string &payload)
logicTableListObject.tableExpr = valueLogicTableListLogicTable["TableExpr"].asString();
if(!valueLogicTableListLogicTable["TableCount"].isNull())
logicTableListObject.tableCount = valueLogicTableListLogicTable["TableCount"].asString();
if(!valueLogicTableListLogicTable["TableGuid"].isNull())
logicTableListObject.tableGuid = valueLogicTableListLogicTable["TableGuid"].asString();
if(!valueLogicTableListLogicTable["SchemaName"].isNull())
logicTableListObject.schemaName = valueLogicTableListLogicTable["SchemaName"].asString();
auto allOwnerIdList = value["OwnerIdList"]["OwnerIds"];
for (auto value : allOwnerIdList)
logicTableListObject.ownerIdList.push_back(value.asString());

View File

@@ -38,6 +38,17 @@ void ListTablesRequest::setSearchName(const std::string& searchName)
setParameter("SearchName", searchName);
}
bool ListTablesRequest::getReturnGuid()const
{
return returnGuid_;
}
void ListTablesRequest::setReturnGuid(bool returnGuid)
{
returnGuid_ = returnGuid;
setParameter("ReturnGuid", returnGuid ? "true" : "false");
}
int ListTablesRequest::getPageSize()const
{
return pageSize_;

View File

@@ -61,6 +61,10 @@ void ListTablesResult::parse(const std::string &payload)
tableListObject.numRows = std::stol(valueTableListTable["NumRows"].asString());
if(!valueTableListTable["StoreCapacity"].isNull())
tableListObject.storeCapacity = std::stol(valueTableListTable["StoreCapacity"].asString());
if(!valueTableListTable["TableGuid"].isNull())
tableListObject.tableGuid = valueTableListTable["TableGuid"].asString();
if(!valueTableListTable["Description"].isNull())
tableListObject.description = valueTableListTable["Description"].asString();
auto allOwnerIdList = value["OwnerIdList"]["OwnerIds"];
for (auto value : allOwnerIdList)
tableListObject.ownerIdList.push_back(value.asString());

View File

@@ -0,0 +1,29 @@
/*
* 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/ListUserTenantsRequest.h>
using AlibabaCloud::Dms_enterprise::Model::ListUserTenantsRequest;
ListUserTenantsRequest::ListUserTenantsRequest() :
RpcServiceRequest("dms-enterprise", "2018-11-01", "ListUserTenants")
{
setMethod(HttpRequest::Method::Post);
}
ListUserTenantsRequest::~ListUserTenantsRequest()
{}

View File

@@ -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 <alibabacloud/dms-enterprise/model/ListUserTenantsResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Dms_enterprise;
using namespace AlibabaCloud::Dms_enterprise::Model;
ListUserTenantsResult::ListUserTenantsResult() :
ServiceResult()
{}
ListUserTenantsResult::ListUserTenantsResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ListUserTenantsResult::~ListUserTenantsResult()
{}
void ListUserTenantsResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allTenantListNode = value["TenantList"]["Tenant"];
for (auto valueTenantListTenant : allTenantListNode)
{
Tenant tenantListObject;
if(!valueTenantListTenant["Tid"].isNull())
tenantListObject.tid = std::stol(valueTenantListTenant["Tid"].asString());
if(!valueTenantListTenant["TenantName"].isNull())
tenantListObject.tenantName = valueTenantListTenant["TenantName"].asString();
if(!valueTenantListTenant["Status"].isNull())
tenantListObject.status = valueTenantListTenant["Status"].asString();
tenantList_.push_back(tenantListObject);
}
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();
}
std::vector<ListUserTenantsResult::Tenant> ListUserTenantsResult::getTenantList()const
{
return tenantList_;
}
std::string ListUserTenantsResult::getErrorCode()const
{
return errorCode_;
}
std::string ListUserTenantsResult::getErrorMessage()const
{
return errorMessage_;
}
bool ListUserTenantsResult::getSuccess()const
{
return success_;
}

View File

@@ -247,6 +247,17 @@ void RegisterInstanceRequest::setDbaUid(long dbaUid)
setParameter("DbaUid", std::to_string(dbaUid));
}
bool RegisterInstanceRequest::getSkipTest()const
{
return skipTest_;
}
void RegisterInstanceRequest::setSkipTest(bool skipTest)
{
skipTest_ = skipTest;
setParameter("SkipTest", skipTest ? "true" : "false");
}
std::string RegisterInstanceRequest::getSafeRule()const
{
return safeRule_;

View File

@@ -27,37 +27,15 @@ SearchTableRequest::SearchTableRequest() :
SearchTableRequest::~SearchTableRequest()
{}
std::string SearchTableRequest::getSearchTarget()const
bool SearchTableRequest::getReturnGuid()const
{
return searchTarget_;
return returnGuid_;
}
void SearchTableRequest::setSearchTarget(const std::string& searchTarget)
void SearchTableRequest::setReturnGuid(bool returnGuid)
{
searchTarget_ = searchTarget;
setParameter("SearchTarget", searchTarget);
}
int SearchTableRequest::getPageSize()const
{
return pageSize_;
}
void SearchTableRequest::setPageSize(int pageSize)
{
pageSize_ = pageSize;
setParameter("PageSize", std::to_string(pageSize));
}
std::string SearchTableRequest::getEnvType()const
{
return envType_;
}
void SearchTableRequest::setEnvType(const std::string& envType)
{
envType_ = envType;
setParameter("EnvType", envType);
returnGuid_ = returnGuid;
setParameter("ReturnGuid", returnGuid ? "true" : "false");
}
std::string SearchTableRequest::getSearchKey()const
@@ -104,3 +82,47 @@ void SearchTableRequest::setPageNumber(int pageNumber)
setParameter("PageNumber", std::to_string(pageNumber));
}
std::string SearchTableRequest::getSearchTarget()const
{
return searchTarget_;
}
void SearchTableRequest::setSearchTarget(const std::string& searchTarget)
{
searchTarget_ = searchTarget;
setParameter("SearchTarget", searchTarget);
}
int SearchTableRequest::getPageSize()const
{
return pageSize_;
}
void SearchTableRequest::setPageSize(int pageSize)
{
pageSize_ = pageSize;
setParameter("PageSize", std::to_string(pageSize));
}
std::string SearchTableRequest::getEnvType()const
{
return envType_;
}
void SearchTableRequest::setEnvType(const std::string& envType)
{
envType_ = envType;
setParameter("EnvType", envType);
}
std::string SearchTableRequest::getDbType()const
{
return dbType_;
}
void SearchTableRequest::setDbType(const std::string& dbType)
{
dbType_ = dbType;
setParameter("DbType", dbType);
}

View File

@@ -61,6 +61,14 @@ void SearchTableResult::parse(const std::string &payload)
searchTableListObject.envType = valueSearchTableListSearchTable["EnvType"].asString();
if(!valueSearchTableListSearchTable["DBSearchName"].isNull())
searchTableListObject.dBSearchName = valueSearchTableListSearchTable["DBSearchName"].asString();
if(!valueSearchTableListSearchTable["DbType"].isNull())
searchTableListObject.dbType = valueSearchTableListSearchTable["DbType"].asString();
if(!valueSearchTableListSearchTable["Description"].isNull())
searchTableListObject.description = valueSearchTableListSearchTable["Description"].asString();
if(!valueSearchTableListSearchTable["DbName"].isNull())
searchTableListObject.dbName = valueSearchTableListSearchTable["DbName"].asString();
if(!valueSearchTableListSearchTable["TableGuid"].isNull())
searchTableListObject.tableGuid = valueSearchTableListSearchTable["TableGuid"].asString();
auto allOwnerIdList = value["OwnerIdList"]["OwnerIds"];
for (auto value : allOwnerIdList)
searchTableListObject.ownerIdList.push_back(value.asString());

View File

@@ -258,3 +258,14 @@ void UpdateInstanceRequest::setVpcId(const std::string& vpcId)
setParameter("VpcId", vpcId);
}
bool UpdateInstanceRequest::getSkipTest()const
{
return skipTest_;
}
void UpdateInstanceRequest::setSkipTest(bool skipTest)
{
skipTest_ = skipTest;
setParameter("SkipTest", skipTest ? "true" : "false");
}