diff --git a/VERSION b/VERSION index 3204f1785..47a07ed89 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.1394 \ No newline at end of file +1.36.1395 \ No newline at end of file diff --git a/dms-enterprise/CMakeLists.txt b/dms-enterprise/CMakeLists.txt index 87f66497c..2a181300b 100644 --- a/dms-enterprise/CMakeLists.txt +++ b/dms-enterprise/CMakeLists.txt @@ -169,6 +169,8 @@ set(dms-enterprise_public_header_model include/alibabacloud/dms-enterprise/model/GetPhysicalDatabaseResult.h include/alibabacloud/dms-enterprise/model/GetProxyRequest.h include/alibabacloud/dms-enterprise/model/GetProxyResult.h + include/alibabacloud/dms-enterprise/model/GetProxyAccessRequest.h + include/alibabacloud/dms-enterprise/model/GetProxyAccessResult.h include/alibabacloud/dms-enterprise/model/GetRuleNumLimitOfSLARequest.h include/alibabacloud/dms-enterprise/model/GetRuleNumLimitOfSLAResult.h include/alibabacloud/dms-enterprise/model/GetSQLReviewCheckResultStatusRequest.h @@ -536,6 +538,8 @@ set(dms-enterprise_src src/model/GetPhysicalDatabaseResult.cc src/model/GetProxyRequest.cc src/model/GetProxyResult.cc + src/model/GetProxyAccessRequest.cc + src/model/GetProxyAccessResult.cc src/model/GetRuleNumLimitOfSLARequest.cc src/model/GetRuleNumLimitOfSLAResult.cc src/model/GetSQLReviewCheckResultStatusRequest.cc diff --git a/dms-enterprise/include/alibabacloud/dms-enterprise/Dms_enterpriseClient.h b/dms-enterprise/include/alibabacloud/dms-enterprise/Dms_enterpriseClient.h index 7041730c2..db9c3e356 100644 --- a/dms-enterprise/include/alibabacloud/dms-enterprise/Dms_enterpriseClient.h +++ b/dms-enterprise/include/alibabacloud/dms-enterprise/Dms_enterpriseClient.h @@ -170,6 +170,8 @@ #include "model/GetPhysicalDatabaseResult.h" #include "model/GetProxyRequest.h" #include "model/GetProxyResult.h" +#include "model/GetProxyAccessRequest.h" +#include "model/GetProxyAccessResult.h" #include "model/GetRuleNumLimitOfSLARequest.h" #include "model/GetRuleNumLimitOfSLAResult.h" #include "model/GetSQLReviewCheckResultStatusRequest.h" @@ -617,6 +619,9 @@ namespace AlibabaCloud typedef Outcome GetProxyOutcome; typedef std::future GetProxyOutcomeCallable; typedef std::function&)> GetProxyAsyncHandler; + typedef Outcome GetProxyAccessOutcome; + typedef std::future GetProxyAccessOutcomeCallable; + typedef std::function&)> GetProxyAccessAsyncHandler; typedef Outcome GetRuleNumLimitOfSLAOutcome; typedef std::future GetRuleNumLimitOfSLAOutcomeCallable; typedef std::function&)> GetRuleNumLimitOfSLAAsyncHandler; @@ -1168,6 +1173,9 @@ namespace AlibabaCloud GetProxyOutcome getProxy(const Model::GetProxyRequest &request)const; void getProxyAsync(const Model::GetProxyRequest& request, const GetProxyAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetProxyOutcomeCallable getProxyCallable(const Model::GetProxyRequest& request) const; + GetProxyAccessOutcome getProxyAccess(const Model::GetProxyAccessRequest &request)const; + void getProxyAccessAsync(const Model::GetProxyAccessRequest& request, const GetProxyAccessAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetProxyAccessOutcomeCallable getProxyAccessCallable(const Model::GetProxyAccessRequest& request) const; GetRuleNumLimitOfSLAOutcome getRuleNumLimitOfSLA(const Model::GetRuleNumLimitOfSLARequest &request)const; void getRuleNumLimitOfSLAAsync(const Model::GetRuleNumLimitOfSLARequest& request, const GetRuleNumLimitOfSLAAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetRuleNumLimitOfSLAOutcomeCallable getRuleNumLimitOfSLACallable(const Model::GetRuleNumLimitOfSLARequest& request) const; diff --git a/dms-enterprise/include/alibabacloud/dms-enterprise/model/AddTaskFlowEdgesResult.h b/dms-enterprise/include/alibabacloud/dms-enterprise/model/AddTaskFlowEdgesResult.h index 1f234f0fb..d911279ac 100644 --- a/dms-enterprise/include/alibabacloud/dms-enterprise/model/AddTaskFlowEdgesResult.h +++ b/dms-enterprise/include/alibabacloud/dms-enterprise/model/AddTaskFlowEdgesResult.h @@ -37,6 +37,7 @@ namespace AlibabaCloud AddTaskFlowEdgesResult(); explicit AddTaskFlowEdgesResult(const std::string &payload); ~AddTaskFlowEdgesResult(); + std::vector getEdgeIds()const; std::string getErrorCode()const; std::string getErrorMessage()const; bool getSuccess()const; @@ -44,6 +45,7 @@ namespace AlibabaCloud protected: void parse(const std::string &payload); private: + std::vector edgeIds_; std::string errorCode_; std::string errorMessage_; bool success_; diff --git a/dms-enterprise/include/alibabacloud/dms-enterprise/model/GetProxyAccessRequest.h b/dms-enterprise/include/alibabacloud/dms-enterprise/model/GetProxyAccessRequest.h new file mode 100644 index 000000000..49b00dff9 --- /dev/null +++ b/dms-enterprise/include/alibabacloud/dms-enterprise/model/GetProxyAccessRequest.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_GETPROXYACCESSREQUEST_H_ +#define ALIBABACLOUD_DMS_ENTERPRISE_MODEL_GETPROXYACCESSREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace Dms_enterprise { +namespace Model { +class ALIBABACLOUD_DMS_ENTERPRISE_EXPORT GetProxyAccessRequest : public RpcServiceRequest { +public: + GetProxyAccessRequest(); + ~GetProxyAccessRequest(); + long getProxyAccessId() const; + void setProxyAccessId(long proxyAccessId); + long getTid() const; + void setTid(long tid); + +private: + long proxyAccessId_; + long tid_; +}; +} // namespace Model +} // namespace Dms_enterprise +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_DMS_ENTERPRISE_MODEL_GETPROXYACCESSREQUEST_H_ diff --git a/dms-enterprise/include/alibabacloud/dms-enterprise/model/GetProxyAccessResult.h b/dms-enterprise/include/alibabacloud/dms-enterprise/model/GetProxyAccessResult.h new file mode 100644 index 000000000..628b27c93 --- /dev/null +++ b/dms-enterprise/include/alibabacloud/dms-enterprise/model/GetProxyAccessResult.h @@ -0,0 +1,70 @@ +/* + * 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_GETPROXYACCESSRESULT_H_ +#define ALIBABACLOUD_DMS_ENTERPRISE_MODEL_GETPROXYACCESSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Dms_enterprise + { + namespace Model + { + class ALIBABACLOUD_DMS_ENTERPRISE_EXPORT GetProxyAccessResult : public ServiceResult + { + public: + struct ProxyAccess + { + std::string gmtCreate; + std::string userName; + std::string accessId; + long instanceId; + long userId; + std::string userUid; + long proxyId; + long proxyAccessId; + std::string originInfo; + std::string indepAccount; + }; + + + GetProxyAccessResult(); + explicit GetProxyAccessResult(const std::string &payload); + ~GetProxyAccessResult(); + ProxyAccess getProxyAccess()const; + std::string getErrorCode()const; + std::string getErrorMessage()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + ProxyAccess proxyAccess_; + std::string errorCode_; + std::string errorMessage_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_DMS_ENTERPRISE_MODEL_GETPROXYACCESSRESULT_H_ \ No newline at end of file diff --git a/dms-enterprise/include/alibabacloud/dms-enterprise/model/ListTaskFlowCooperatorsResult.h b/dms-enterprise/include/alibabacloud/dms-enterprise/model/ListTaskFlowCooperatorsResult.h index 7d67e3df2..4e537f894 100644 --- a/dms-enterprise/include/alibabacloud/dms-enterprise/model/ListTaskFlowCooperatorsResult.h +++ b/dms-enterprise/include/alibabacloud/dms-enterprise/model/ListTaskFlowCooperatorsResult.h @@ -36,6 +36,7 @@ namespace AlibabaCloud { std::string loginName; std::string email; + std::string userId; std::string realName; std::string nickName; }; diff --git a/dms-enterprise/src/Dms-enterpriseClient.cc b/dms-enterprise/src/Dms-enterpriseClient.cc index 3fca2718c..d0c12f246 100644 --- a/dms-enterprise/src/Dms-enterpriseClient.cc +++ b/dms-enterprise/src/Dms-enterpriseClient.cc @@ -2715,6 +2715,42 @@ Dms_enterpriseClient::GetProxyOutcomeCallable Dms_enterpriseClient::getProxyCall return task->get_future(); } +Dms_enterpriseClient::GetProxyAccessOutcome Dms_enterpriseClient::getProxyAccess(const GetProxyAccessRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetProxyAccessOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetProxyAccessOutcome(GetProxyAccessResult(outcome.result())); + else + return GetProxyAccessOutcome(outcome.error()); +} + +void Dms_enterpriseClient::getProxyAccessAsync(const GetProxyAccessRequest& request, const GetProxyAccessAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getProxyAccess(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +Dms_enterpriseClient::GetProxyAccessOutcomeCallable Dms_enterpriseClient::getProxyAccessCallable(const GetProxyAccessRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getProxyAccess(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + Dms_enterpriseClient::GetRuleNumLimitOfSLAOutcome Dms_enterpriseClient::getRuleNumLimitOfSLA(const GetRuleNumLimitOfSLARequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/dms-enterprise/src/model/AddTaskFlowEdgesResult.cc b/dms-enterprise/src/model/AddTaskFlowEdgesResult.cc index 7444b279c..e55bccd61 100644 --- a/dms-enterprise/src/model/AddTaskFlowEdgesResult.cc +++ b/dms-enterprise/src/model/AddTaskFlowEdgesResult.cc @@ -39,6 +39,9 @@ void AddTaskFlowEdgesResult::parse(const std::string &payload) Json::Value value; reader.parse(payload, value); setRequestId(value["RequestId"].asString()); + auto allEdgeIds = value["EdgeIds"]["EdgeId"]; + for (const auto &item : allEdgeIds) + edgeIds_.push_back(item.asString()); if(!value["ErrorCode"].isNull()) errorCode_ = value["ErrorCode"].asString(); if(!value["ErrorMessage"].isNull()) @@ -48,6 +51,11 @@ void AddTaskFlowEdgesResult::parse(const std::string &payload) } +std::vector AddTaskFlowEdgesResult::getEdgeIds()const +{ + return edgeIds_; +} + std::string AddTaskFlowEdgesResult::getErrorCode()const { return errorCode_; diff --git a/dms-enterprise/src/model/GetProxyAccessRequest.cc b/dms-enterprise/src/model/GetProxyAccessRequest.cc new file mode 100644 index 000000000..3b3a7dcfd --- /dev/null +++ b/dms-enterprise/src/model/GetProxyAccessRequest.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::GetProxyAccessRequest; + +GetProxyAccessRequest::GetProxyAccessRequest() + : RpcServiceRequest("dms-enterprise", "2018-11-01", "GetProxyAccess") { + setMethod(HttpRequest::Method::Post); +} + +GetProxyAccessRequest::~GetProxyAccessRequest() {} + +long GetProxyAccessRequest::getProxyAccessId() const { + return proxyAccessId_; +} + +void GetProxyAccessRequest::setProxyAccessId(long proxyAccessId) { + proxyAccessId_ = proxyAccessId; + setParameter(std::string("ProxyAccessId"), std::to_string(proxyAccessId)); +} + +long GetProxyAccessRequest::getTid() const { + return tid_; +} + +void GetProxyAccessRequest::setTid(long tid) { + tid_ = tid; + setParameter(std::string("Tid"), std::to_string(tid)); +} + diff --git a/dms-enterprise/src/model/GetProxyAccessResult.cc b/dms-enterprise/src/model/GetProxyAccessResult.cc new file mode 100644 index 000000000..9febcd80b --- /dev/null +++ b/dms-enterprise/src/model/GetProxyAccessResult.cc @@ -0,0 +1,91 @@ +/* + * 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; + +GetProxyAccessResult::GetProxyAccessResult() : + ServiceResult() +{} + +GetProxyAccessResult::GetProxyAccessResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetProxyAccessResult::~GetProxyAccessResult() +{} + +void GetProxyAccessResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto proxyAccessNode = value["ProxyAccess"]; + if(!proxyAccessNode["ProxyAccessId"].isNull()) + proxyAccess_.proxyAccessId = std::stol(proxyAccessNode["ProxyAccessId"].asString()); + if(!proxyAccessNode["GmtCreate"].isNull()) + proxyAccess_.gmtCreate = proxyAccessNode["GmtCreate"].asString(); + if(!proxyAccessNode["AccessId"].isNull()) + proxyAccess_.accessId = proxyAccessNode["AccessId"].asString(); + if(!proxyAccessNode["OriginInfo"].isNull()) + proxyAccess_.originInfo = proxyAccessNode["OriginInfo"].asString(); + if(!proxyAccessNode["IndepAccount"].isNull()) + proxyAccess_.indepAccount = proxyAccessNode["IndepAccount"].asString(); + if(!proxyAccessNode["UserId"].isNull()) + proxyAccess_.userId = std::stol(proxyAccessNode["UserId"].asString()); + if(!proxyAccessNode["UserUid"].isNull()) + proxyAccess_.userUid = proxyAccessNode["UserUid"].asString(); + if(!proxyAccessNode["UserName"].isNull()) + proxyAccess_.userName = proxyAccessNode["UserName"].asString(); + if(!proxyAccessNode["ProxyId"].isNull()) + proxyAccess_.proxyId = std::stol(proxyAccessNode["ProxyId"].asString()); + if(!proxyAccessNode["InstanceId"].isNull()) + proxyAccess_.instanceId = std::stol(proxyAccessNode["InstanceId"].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(); + +} + +GetProxyAccessResult::ProxyAccess GetProxyAccessResult::getProxyAccess()const +{ + return proxyAccess_; +} + +std::string GetProxyAccessResult::getErrorCode()const +{ + return errorCode_; +} + +std::string GetProxyAccessResult::getErrorMessage()const +{ + return errorMessage_; +} + +bool GetProxyAccessResult::getSuccess()const +{ + return success_; +} + diff --git a/dms-enterprise/src/model/ListTaskFlowCooperatorsResult.cc b/dms-enterprise/src/model/ListTaskFlowCooperatorsResult.cc index e99170ff4..4aa993df1 100644 --- a/dms-enterprise/src/model/ListTaskFlowCooperatorsResult.cc +++ b/dms-enterprise/src/model/ListTaskFlowCooperatorsResult.cc @@ -51,6 +51,8 @@ void ListTaskFlowCooperatorsResult::parse(const std::string &payload) cooperatorListObject.loginName = valueCooperatorListCooperator["LoginName"].asString(); if(!valueCooperatorListCooperator["RealName"].isNull()) cooperatorListObject.realName = valueCooperatorListCooperator["RealName"].asString(); + if(!valueCooperatorListCooperator["UserId"].isNull()) + cooperatorListObject.userId = valueCooperatorListCooperator["UserId"].asString(); cooperatorList_.push_back(cooperatorListObject); } if(!value["ErrorCode"].isNull())