From ec5269015c43ea67c0cc58e5cea2cf4ea9e46e1a Mon Sep 17 00:00:00 2001 From: sdk-team Date: Wed, 27 May 2020 14:17:37 +0800 Subject: [PATCH] Add support for create hbaseue multizone instance. --- CHANGELOG | 3 + VERSION | 2 +- hbase/CMakeLists.txt | 8 + .../include/alibabacloud/hbase/HBaseClient.h | 16 + .../model/CreateMultiZoneClusterRequest.h | 129 +++++++ .../model/CreateMultiZoneClusterResult.h | 53 +++ .../model/DeleteMultiZoneClusterRequest.h | 51 +++ .../model/DeleteMultiZoneClusterResult.h | 49 +++ .../model/DescribeAvailableResourceResult.h | 1 + .../hbase/model/DescribeInstancesResult.h | 1 + hbase/src/HBaseClient.cc | 72 ++++ .../model/CreateMultiZoneClusterRequest.cc | 337 ++++++++++++++++++ .../src/model/CreateMultiZoneClusterResult.cc | 58 +++ .../model/DeleteMultiZoneClusterRequest.cc | 51 +++ .../src/model/DeleteMultiZoneClusterResult.cc | 44 +++ .../model/DescribeAvailableResourceResult.cc | 2 + hbase/src/model/DescribeInstancesResult.cc | 2 + 17 files changed, 878 insertions(+), 1 deletion(-) create mode 100644 hbase/include/alibabacloud/hbase/model/CreateMultiZoneClusterRequest.h create mode 100644 hbase/include/alibabacloud/hbase/model/CreateMultiZoneClusterResult.h create mode 100644 hbase/include/alibabacloud/hbase/model/DeleteMultiZoneClusterRequest.h create mode 100644 hbase/include/alibabacloud/hbase/model/DeleteMultiZoneClusterResult.h create mode 100644 hbase/src/model/CreateMultiZoneClusterRequest.cc create mode 100644 hbase/src/model/CreateMultiZoneClusterResult.cc create mode 100644 hbase/src/model/DeleteMultiZoneClusterRequest.cc create mode 100644 hbase/src/model/DeleteMultiZoneClusterResult.cc diff --git a/CHANGELOG b/CHANGELOG index 09ca5a15b..2ebb48e0a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2020-05-27 Version: 1.36.438 +- Add support for create hbaseue multizone instance. + 2020-05-26 Version: 1.36.437 - Support DescribeAllEntity API. diff --git a/VERSION b/VERSION index f724944ab..d637659c6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.437 \ No newline at end of file +1.36.438 \ No newline at end of file diff --git a/hbase/CMakeLists.txt b/hbase/CMakeLists.txt index 3f7041d97..849239abd 100644 --- a/hbase/CMakeLists.txt +++ b/hbase/CMakeLists.txt @@ -31,12 +31,16 @@ set(hbase_public_header_model include/alibabacloud/hbase/model/CreateClusterResult.h include/alibabacloud/hbase/model/CreateHbaseHaSlbRequest.h include/alibabacloud/hbase/model/CreateHbaseHaSlbResult.h + include/alibabacloud/hbase/model/CreateMultiZoneClusterRequest.h + include/alibabacloud/hbase/model/CreateMultiZoneClusterResult.h include/alibabacloud/hbase/model/CreateRestorePlanRequest.h include/alibabacloud/hbase/model/CreateRestorePlanResult.h include/alibabacloud/hbase/model/DeleteHbaseHaSlbRequest.h include/alibabacloud/hbase/model/DeleteHbaseHaSlbResult.h include/alibabacloud/hbase/model/DeleteInstanceRequest.h include/alibabacloud/hbase/model/DeleteInstanceResult.h + include/alibabacloud/hbase/model/DeleteMultiZoneClusterRequest.h + include/alibabacloud/hbase/model/DeleteMultiZoneClusterResult.h include/alibabacloud/hbase/model/DeleteUserHdfsInfoRequest.h include/alibabacloud/hbase/model/DeleteUserHdfsInfoResult.h include/alibabacloud/hbase/model/DescribeAvailableResourceRequest.h @@ -130,12 +134,16 @@ set(hbase_src src/model/CreateClusterResult.cc src/model/CreateHbaseHaSlbRequest.cc src/model/CreateHbaseHaSlbResult.cc + src/model/CreateMultiZoneClusterRequest.cc + src/model/CreateMultiZoneClusterResult.cc src/model/CreateRestorePlanRequest.cc src/model/CreateRestorePlanResult.cc src/model/DeleteHbaseHaSlbRequest.cc src/model/DeleteHbaseHaSlbResult.cc src/model/DeleteInstanceRequest.cc src/model/DeleteInstanceResult.cc + src/model/DeleteMultiZoneClusterRequest.cc + src/model/DeleteMultiZoneClusterResult.cc src/model/DeleteUserHdfsInfoRequest.cc src/model/DeleteUserHdfsInfoResult.cc src/model/DescribeAvailableResourceRequest.cc diff --git a/hbase/include/alibabacloud/hbase/HBaseClient.h b/hbase/include/alibabacloud/hbase/HBaseClient.h index 58c49fe1e..3b702143c 100644 --- a/hbase/include/alibabacloud/hbase/HBaseClient.h +++ b/hbase/include/alibabacloud/hbase/HBaseClient.h @@ -32,12 +32,16 @@ #include "model/CreateClusterResult.h" #include "model/CreateHbaseHaSlbRequest.h" #include "model/CreateHbaseHaSlbResult.h" +#include "model/CreateMultiZoneClusterRequest.h" +#include "model/CreateMultiZoneClusterResult.h" #include "model/CreateRestorePlanRequest.h" #include "model/CreateRestorePlanResult.h" #include "model/DeleteHbaseHaSlbRequest.h" #include "model/DeleteHbaseHaSlbResult.h" #include "model/DeleteInstanceRequest.h" #include "model/DeleteInstanceResult.h" +#include "model/DeleteMultiZoneClusterRequest.h" +#include "model/DeleteMultiZoneClusterResult.h" #include "model/DeleteUserHdfsInfoRequest.h" #include "model/DeleteUserHdfsInfoResult.h" #include "model/DescribeAvailableResourceRequest.h" @@ -142,6 +146,9 @@ namespace AlibabaCloud typedef Outcome CreateHbaseHaSlbOutcome; typedef std::future CreateHbaseHaSlbOutcomeCallable; typedef std::function&)> CreateHbaseHaSlbAsyncHandler; + typedef Outcome CreateMultiZoneClusterOutcome; + typedef std::future CreateMultiZoneClusterOutcomeCallable; + typedef std::function&)> CreateMultiZoneClusterAsyncHandler; typedef Outcome CreateRestorePlanOutcome; typedef std::future CreateRestorePlanOutcomeCallable; typedef std::function&)> CreateRestorePlanAsyncHandler; @@ -151,6 +158,9 @@ namespace AlibabaCloud typedef Outcome DeleteInstanceOutcome; typedef std::future DeleteInstanceOutcomeCallable; typedef std::function&)> DeleteInstanceAsyncHandler; + typedef Outcome DeleteMultiZoneClusterOutcome; + typedef std::future DeleteMultiZoneClusterOutcomeCallable; + typedef std::function&)> DeleteMultiZoneClusterAsyncHandler; typedef Outcome DeleteUserHdfsInfoOutcome; typedef std::future DeleteUserHdfsInfoOutcomeCallable; typedef std::function&)> DeleteUserHdfsInfoAsyncHandler; @@ -291,6 +301,9 @@ namespace AlibabaCloud CreateHbaseHaSlbOutcome createHbaseHaSlb(const Model::CreateHbaseHaSlbRequest &request)const; void createHbaseHaSlbAsync(const Model::CreateHbaseHaSlbRequest& request, const CreateHbaseHaSlbAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; CreateHbaseHaSlbOutcomeCallable createHbaseHaSlbCallable(const Model::CreateHbaseHaSlbRequest& request) const; + CreateMultiZoneClusterOutcome createMultiZoneCluster(const Model::CreateMultiZoneClusterRequest &request)const; + void createMultiZoneClusterAsync(const Model::CreateMultiZoneClusterRequest& request, const CreateMultiZoneClusterAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + CreateMultiZoneClusterOutcomeCallable createMultiZoneClusterCallable(const Model::CreateMultiZoneClusterRequest& request) const; CreateRestorePlanOutcome createRestorePlan(const Model::CreateRestorePlanRequest &request)const; void createRestorePlanAsync(const Model::CreateRestorePlanRequest& request, const CreateRestorePlanAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; CreateRestorePlanOutcomeCallable createRestorePlanCallable(const Model::CreateRestorePlanRequest& request) const; @@ -300,6 +313,9 @@ namespace AlibabaCloud DeleteInstanceOutcome deleteInstance(const Model::DeleteInstanceRequest &request)const; void deleteInstanceAsync(const Model::DeleteInstanceRequest& request, const DeleteInstanceAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; DeleteInstanceOutcomeCallable deleteInstanceCallable(const Model::DeleteInstanceRequest& request) const; + DeleteMultiZoneClusterOutcome deleteMultiZoneCluster(const Model::DeleteMultiZoneClusterRequest &request)const; + void deleteMultiZoneClusterAsync(const Model::DeleteMultiZoneClusterRequest& request, const DeleteMultiZoneClusterAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + DeleteMultiZoneClusterOutcomeCallable deleteMultiZoneClusterCallable(const Model::DeleteMultiZoneClusterRequest& request) const; DeleteUserHdfsInfoOutcome deleteUserHdfsInfo(const Model::DeleteUserHdfsInfoRequest &request)const; void deleteUserHdfsInfoAsync(const Model::DeleteUserHdfsInfoRequest& request, const DeleteUserHdfsInfoAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; DeleteUserHdfsInfoOutcomeCallable deleteUserHdfsInfoCallable(const Model::DeleteUserHdfsInfoRequest& request) const; diff --git a/hbase/include/alibabacloud/hbase/model/CreateMultiZoneClusterRequest.h b/hbase/include/alibabacloud/hbase/model/CreateMultiZoneClusterRequest.h new file mode 100644 index 000000000..2a1e772f9 --- /dev/null +++ b/hbase/include/alibabacloud/hbase/model/CreateMultiZoneClusterRequest.h @@ -0,0 +1,129 @@ +/* + * 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_HBASE_MODEL_CREATEMULTIZONECLUSTERREQUEST_H_ +#define ALIBABACLOUD_HBASE_MODEL_CREATEMULTIZONECLUSTERREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace HBase + { + namespace Model + { + class ALIBABACLOUD_HBASE_EXPORT CreateMultiZoneClusterRequest : public RpcServiceRequest + { + + public: + CreateMultiZoneClusterRequest(); + ~CreateMultiZoneClusterRequest(); + + std::string getArchVersion()const; + void setArchVersion(const std::string& archVersion); + std::string getClusterName()const; + void setClusterName(const std::string& clusterName); + std::string getEngineVersion()const; + void setEngineVersion(const std::string& engineVersion); + std::string getLogDiskType()const; + void setLogDiskType(const std::string& logDiskType); + std::string getPrimaryVSwitchId()const; + void setPrimaryVSwitchId(const std::string& primaryVSwitchId); + std::string getLogInstanceType()const; + void setLogInstanceType(const std::string& logInstanceType); + int getAutoRenewPeriod()const; + void setAutoRenewPeriod(int autoRenewPeriod); + int getPeriod()const; + void setPeriod(int period); + int getLogNodeCount()const; + void setLogNodeCount(int logNodeCount); + std::string getSecurityIPList()const; + void setSecurityIPList(const std::string& securityIPList); + std::string getPeriodUnit()const; + void setPeriodUnit(const std::string& periodUnit); + std::string getCoreDiskType()const; + void setCoreDiskType(const std::string& coreDiskType); + std::string getArbiterZoneId()const; + void setArbiterZoneId(const std::string& arbiterZoneId); + std::string getClientToken()const; + void setClientToken(const std::string& clientToken); + std::string getMultiZoneCombination()const; + void setMultiZoneCombination(const std::string& multiZoneCombination); + std::string getPrimaryZoneId()const; + void setPrimaryZoneId(const std::string& primaryZoneId); + std::string getEngine()const; + void setEngine(const std::string& engine); + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + std::string getStandbyVSwitchId()const; + void setStandbyVSwitchId(const std::string& standbyVSwitchId); + std::string getStandbyZoneId()const; + void setStandbyZoneId(const std::string& standbyZoneId); + std::string getMasterInstanceType()const; + void setMasterInstanceType(const std::string& masterInstanceType); + int getCoreNodeCount()const; + void setCoreNodeCount(int coreNodeCount); + int getLogDiskSize()const; + void setLogDiskSize(int logDiskSize); + std::string getCoreInstanceType()const; + void setCoreInstanceType(const std::string& coreInstanceType); + int getCoreDiskSize()const; + void setCoreDiskSize(int coreDiskSize); + std::string getVpcId()const; + void setVpcId(const std::string& vpcId); + std::string getPayType()const; + void setPayType(const std::string& payType); + std::string getArbiterVSwitchId()const; + void setArbiterVSwitchId(const std::string& arbiterVSwitchId); + + private: + std::string archVersion_; + std::string clusterName_; + std::string engineVersion_; + std::string logDiskType_; + std::string primaryVSwitchId_; + std::string logInstanceType_; + int autoRenewPeriod_; + int period_; + int logNodeCount_; + std::string securityIPList_; + std::string periodUnit_; + std::string coreDiskType_; + std::string arbiterZoneId_; + std::string clientToken_; + std::string multiZoneCombination_; + std::string primaryZoneId_; + std::string engine_; + std::string regionId_; + std::string standbyVSwitchId_; + std::string standbyZoneId_; + std::string masterInstanceType_; + int coreNodeCount_; + int logDiskSize_; + std::string coreInstanceType_; + int coreDiskSize_; + std::string vpcId_; + std::string payType_; + std::string arbiterVSwitchId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_HBASE_MODEL_CREATEMULTIZONECLUSTERREQUEST_H_ \ No newline at end of file diff --git a/hbase/include/alibabacloud/hbase/model/CreateMultiZoneClusterResult.h b/hbase/include/alibabacloud/hbase/model/CreateMultiZoneClusterResult.h new file mode 100644 index 000000000..abe905db3 --- /dev/null +++ b/hbase/include/alibabacloud/hbase/model/CreateMultiZoneClusterResult.h @@ -0,0 +1,53 @@ +/* + * 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_HBASE_MODEL_CREATEMULTIZONECLUSTERRESULT_H_ +#define ALIBABACLOUD_HBASE_MODEL_CREATEMULTIZONECLUSTERRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace HBase + { + namespace Model + { + class ALIBABACLOUD_HBASE_EXPORT CreateMultiZoneClusterResult : public ServiceResult + { + public: + + + CreateMultiZoneClusterResult(); + explicit CreateMultiZoneClusterResult(const std::string &payload); + ~CreateMultiZoneClusterResult(); + std::string getClusterId()const; + std::string getOrderId()const; + + protected: + void parse(const std::string &payload); + private: + std::string clusterId_; + std::string orderId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_HBASE_MODEL_CREATEMULTIZONECLUSTERRESULT_H_ \ No newline at end of file diff --git a/hbase/include/alibabacloud/hbase/model/DeleteMultiZoneClusterRequest.h b/hbase/include/alibabacloud/hbase/model/DeleteMultiZoneClusterRequest.h new file mode 100644 index 000000000..ca8f3fada --- /dev/null +++ b/hbase/include/alibabacloud/hbase/model/DeleteMultiZoneClusterRequest.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_HBASE_MODEL_DELETEMULTIZONECLUSTERREQUEST_H_ +#define ALIBABACLOUD_HBASE_MODEL_DELETEMULTIZONECLUSTERREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace HBase + { + namespace Model + { + class ALIBABACLOUD_HBASE_EXPORT DeleteMultiZoneClusterRequest : public RpcServiceRequest + { + + public: + DeleteMultiZoneClusterRequest(); + ~DeleteMultiZoneClusterRequest(); + + bool getImmediateDeleteFlag()const; + void setImmediateDeleteFlag(bool immediateDeleteFlag); + std::string getClusterId()const; + void setClusterId(const std::string& clusterId); + + private: + bool immediateDeleteFlag_; + std::string clusterId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_HBASE_MODEL_DELETEMULTIZONECLUSTERREQUEST_H_ \ No newline at end of file diff --git a/hbase/include/alibabacloud/hbase/model/DeleteMultiZoneClusterResult.h b/hbase/include/alibabacloud/hbase/model/DeleteMultiZoneClusterResult.h new file mode 100644 index 000000000..91e78c280 --- /dev/null +++ b/hbase/include/alibabacloud/hbase/model/DeleteMultiZoneClusterResult.h @@ -0,0 +1,49 @@ +/* + * 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_HBASE_MODEL_DELETEMULTIZONECLUSTERRESULT_H_ +#define ALIBABACLOUD_HBASE_MODEL_DELETEMULTIZONECLUSTERRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace HBase + { + namespace Model + { + class ALIBABACLOUD_HBASE_EXPORT DeleteMultiZoneClusterResult : public ServiceResult + { + public: + + + DeleteMultiZoneClusterResult(); + explicit DeleteMultiZoneClusterResult(const std::string &payload); + ~DeleteMultiZoneClusterResult(); + + protected: + void parse(const std::string &payload); + private: + + }; + } + } +} +#endif // !ALIBABACLOUD_HBASE_MODEL_DELETEMULTIZONECLUSTERRESULT_H_ \ No newline at end of file diff --git a/hbase/include/alibabacloud/hbase/model/DescribeAvailableResourceResult.h b/hbase/include/alibabacloud/hbase/model/DescribeAvailableResourceResult.h index 3c2217bbf..bc4b88765 100644 --- a/hbase/include/alibabacloud/hbase/model/DescribeAvailableResourceResult.h +++ b/hbase/include/alibabacloud/hbase/model/DescribeAvailableResourceResult.h @@ -58,6 +58,7 @@ namespace AlibabaCloud InstanceTypeDetail instanceTypeDetail; DBInstanceStorageRange dBInstanceStorageRange; std::string instanceType; + int maxCoreCount; }; std::string storageType; std::vector coreResources; diff --git a/hbase/include/alibabacloud/hbase/model/DescribeInstancesResult.h b/hbase/include/alibabacloud/hbase/model/DescribeInstancesResult.h index 28207cb47..84f3ecdb6 100644 --- a/hbase/include/alibabacloud/hbase/model/DescribeInstancesResult.h +++ b/hbase/include/alibabacloud/hbase/model/DescribeInstancesResult.h @@ -54,6 +54,7 @@ namespace AlibabaCloud std::string status; std::string majorVersion; std::string parentId; + std::string coreDiskCount; int masterDiskSize; std::string expireTimeUTC; std::string zoneId; diff --git a/hbase/src/HBaseClient.cc b/hbase/src/HBaseClient.cc index 7b36bf6ff..d15dec6ba 100644 --- a/hbase/src/HBaseClient.cc +++ b/hbase/src/HBaseClient.cc @@ -231,6 +231,42 @@ HBaseClient::CreateHbaseHaSlbOutcomeCallable HBaseClient::createHbaseHaSlbCallab return task->get_future(); } +HBaseClient::CreateMultiZoneClusterOutcome HBaseClient::createMultiZoneCluster(const CreateMultiZoneClusterRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return CreateMultiZoneClusterOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return CreateMultiZoneClusterOutcome(CreateMultiZoneClusterResult(outcome.result())); + else + return CreateMultiZoneClusterOutcome(outcome.error()); +} + +void HBaseClient::createMultiZoneClusterAsync(const CreateMultiZoneClusterRequest& request, const CreateMultiZoneClusterAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, createMultiZoneCluster(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +HBaseClient::CreateMultiZoneClusterOutcomeCallable HBaseClient::createMultiZoneClusterCallable(const CreateMultiZoneClusterRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->createMultiZoneCluster(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + HBaseClient::CreateRestorePlanOutcome HBaseClient::createRestorePlan(const CreateRestorePlanRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -339,6 +375,42 @@ HBaseClient::DeleteInstanceOutcomeCallable HBaseClient::deleteInstanceCallable(c return task->get_future(); } +HBaseClient::DeleteMultiZoneClusterOutcome HBaseClient::deleteMultiZoneCluster(const DeleteMultiZoneClusterRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return DeleteMultiZoneClusterOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return DeleteMultiZoneClusterOutcome(DeleteMultiZoneClusterResult(outcome.result())); + else + return DeleteMultiZoneClusterOutcome(outcome.error()); +} + +void HBaseClient::deleteMultiZoneClusterAsync(const DeleteMultiZoneClusterRequest& request, const DeleteMultiZoneClusterAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, deleteMultiZoneCluster(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +HBaseClient::DeleteMultiZoneClusterOutcomeCallable HBaseClient::deleteMultiZoneClusterCallable(const DeleteMultiZoneClusterRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->deleteMultiZoneCluster(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + HBaseClient::DeleteUserHdfsInfoOutcome HBaseClient::deleteUserHdfsInfo(const DeleteUserHdfsInfoRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/hbase/src/model/CreateMultiZoneClusterRequest.cc b/hbase/src/model/CreateMultiZoneClusterRequest.cc new file mode 100644 index 000000000..0e04888fb --- /dev/null +++ b/hbase/src/model/CreateMultiZoneClusterRequest.cc @@ -0,0 +1,337 @@ +/* + * 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::HBase::Model::CreateMultiZoneClusterRequest; + +CreateMultiZoneClusterRequest::CreateMultiZoneClusterRequest() : + RpcServiceRequest("hbase", "2019-01-01", "CreateMultiZoneCluster") +{ + setMethod(HttpRequest::Method::Post); +} + +CreateMultiZoneClusterRequest::~CreateMultiZoneClusterRequest() +{} + +std::string CreateMultiZoneClusterRequest::getArchVersion()const +{ + return archVersion_; +} + +void CreateMultiZoneClusterRequest::setArchVersion(const std::string& archVersion) +{ + archVersion_ = archVersion; + setParameter("ArchVersion", archVersion); +} + +std::string CreateMultiZoneClusterRequest::getClusterName()const +{ + return clusterName_; +} + +void CreateMultiZoneClusterRequest::setClusterName(const std::string& clusterName) +{ + clusterName_ = clusterName; + setParameter("ClusterName", clusterName); +} + +std::string CreateMultiZoneClusterRequest::getEngineVersion()const +{ + return engineVersion_; +} + +void CreateMultiZoneClusterRequest::setEngineVersion(const std::string& engineVersion) +{ + engineVersion_ = engineVersion; + setParameter("EngineVersion", engineVersion); +} + +std::string CreateMultiZoneClusterRequest::getLogDiskType()const +{ + return logDiskType_; +} + +void CreateMultiZoneClusterRequest::setLogDiskType(const std::string& logDiskType) +{ + logDiskType_ = logDiskType; + setParameter("LogDiskType", logDiskType); +} + +std::string CreateMultiZoneClusterRequest::getPrimaryVSwitchId()const +{ + return primaryVSwitchId_; +} + +void CreateMultiZoneClusterRequest::setPrimaryVSwitchId(const std::string& primaryVSwitchId) +{ + primaryVSwitchId_ = primaryVSwitchId; + setParameter("PrimaryVSwitchId", primaryVSwitchId); +} + +std::string CreateMultiZoneClusterRequest::getLogInstanceType()const +{ + return logInstanceType_; +} + +void CreateMultiZoneClusterRequest::setLogInstanceType(const std::string& logInstanceType) +{ + logInstanceType_ = logInstanceType; + setParameter("LogInstanceType", logInstanceType); +} + +int CreateMultiZoneClusterRequest::getAutoRenewPeriod()const +{ + return autoRenewPeriod_; +} + +void CreateMultiZoneClusterRequest::setAutoRenewPeriod(int autoRenewPeriod) +{ + autoRenewPeriod_ = autoRenewPeriod; + setParameter("AutoRenewPeriod", std::to_string(autoRenewPeriod)); +} + +int CreateMultiZoneClusterRequest::getPeriod()const +{ + return period_; +} + +void CreateMultiZoneClusterRequest::setPeriod(int period) +{ + period_ = period; + setParameter("Period", std::to_string(period)); +} + +int CreateMultiZoneClusterRequest::getLogNodeCount()const +{ + return logNodeCount_; +} + +void CreateMultiZoneClusterRequest::setLogNodeCount(int logNodeCount) +{ + logNodeCount_ = logNodeCount; + setParameter("LogNodeCount", std::to_string(logNodeCount)); +} + +std::string CreateMultiZoneClusterRequest::getSecurityIPList()const +{ + return securityIPList_; +} + +void CreateMultiZoneClusterRequest::setSecurityIPList(const std::string& securityIPList) +{ + securityIPList_ = securityIPList; + setParameter("SecurityIPList", securityIPList); +} + +std::string CreateMultiZoneClusterRequest::getPeriodUnit()const +{ + return periodUnit_; +} + +void CreateMultiZoneClusterRequest::setPeriodUnit(const std::string& periodUnit) +{ + periodUnit_ = periodUnit; + setParameter("PeriodUnit", periodUnit); +} + +std::string CreateMultiZoneClusterRequest::getCoreDiskType()const +{ + return coreDiskType_; +} + +void CreateMultiZoneClusterRequest::setCoreDiskType(const std::string& coreDiskType) +{ + coreDiskType_ = coreDiskType; + setParameter("CoreDiskType", coreDiskType); +} + +std::string CreateMultiZoneClusterRequest::getArbiterZoneId()const +{ + return arbiterZoneId_; +} + +void CreateMultiZoneClusterRequest::setArbiterZoneId(const std::string& arbiterZoneId) +{ + arbiterZoneId_ = arbiterZoneId; + setParameter("ArbiterZoneId", arbiterZoneId); +} + +std::string CreateMultiZoneClusterRequest::getClientToken()const +{ + return clientToken_; +} + +void CreateMultiZoneClusterRequest::setClientToken(const std::string& clientToken) +{ + clientToken_ = clientToken; + setParameter("ClientToken", clientToken); +} + +std::string CreateMultiZoneClusterRequest::getMultiZoneCombination()const +{ + return multiZoneCombination_; +} + +void CreateMultiZoneClusterRequest::setMultiZoneCombination(const std::string& multiZoneCombination) +{ + multiZoneCombination_ = multiZoneCombination; + setParameter("MultiZoneCombination", multiZoneCombination); +} + +std::string CreateMultiZoneClusterRequest::getPrimaryZoneId()const +{ + return primaryZoneId_; +} + +void CreateMultiZoneClusterRequest::setPrimaryZoneId(const std::string& primaryZoneId) +{ + primaryZoneId_ = primaryZoneId; + setParameter("PrimaryZoneId", primaryZoneId); +} + +std::string CreateMultiZoneClusterRequest::getEngine()const +{ + return engine_; +} + +void CreateMultiZoneClusterRequest::setEngine(const std::string& engine) +{ + engine_ = engine; + setParameter("Engine", engine); +} + +std::string CreateMultiZoneClusterRequest::getRegionId()const +{ + return regionId_; +} + +void CreateMultiZoneClusterRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setParameter("RegionId", regionId); +} + +std::string CreateMultiZoneClusterRequest::getStandbyVSwitchId()const +{ + return standbyVSwitchId_; +} + +void CreateMultiZoneClusterRequest::setStandbyVSwitchId(const std::string& standbyVSwitchId) +{ + standbyVSwitchId_ = standbyVSwitchId; + setParameter("StandbyVSwitchId", standbyVSwitchId); +} + +std::string CreateMultiZoneClusterRequest::getStandbyZoneId()const +{ + return standbyZoneId_; +} + +void CreateMultiZoneClusterRequest::setStandbyZoneId(const std::string& standbyZoneId) +{ + standbyZoneId_ = standbyZoneId; + setParameter("StandbyZoneId", standbyZoneId); +} + +std::string CreateMultiZoneClusterRequest::getMasterInstanceType()const +{ + return masterInstanceType_; +} + +void CreateMultiZoneClusterRequest::setMasterInstanceType(const std::string& masterInstanceType) +{ + masterInstanceType_ = masterInstanceType; + setParameter("MasterInstanceType", masterInstanceType); +} + +int CreateMultiZoneClusterRequest::getCoreNodeCount()const +{ + return coreNodeCount_; +} + +void CreateMultiZoneClusterRequest::setCoreNodeCount(int coreNodeCount) +{ + coreNodeCount_ = coreNodeCount; + setParameter("CoreNodeCount", std::to_string(coreNodeCount)); +} + +int CreateMultiZoneClusterRequest::getLogDiskSize()const +{ + return logDiskSize_; +} + +void CreateMultiZoneClusterRequest::setLogDiskSize(int logDiskSize) +{ + logDiskSize_ = logDiskSize; + setParameter("LogDiskSize", std::to_string(logDiskSize)); +} + +std::string CreateMultiZoneClusterRequest::getCoreInstanceType()const +{ + return coreInstanceType_; +} + +void CreateMultiZoneClusterRequest::setCoreInstanceType(const std::string& coreInstanceType) +{ + coreInstanceType_ = coreInstanceType; + setParameter("CoreInstanceType", coreInstanceType); +} + +int CreateMultiZoneClusterRequest::getCoreDiskSize()const +{ + return coreDiskSize_; +} + +void CreateMultiZoneClusterRequest::setCoreDiskSize(int coreDiskSize) +{ + coreDiskSize_ = coreDiskSize; + setParameter("CoreDiskSize", std::to_string(coreDiskSize)); +} + +std::string CreateMultiZoneClusterRequest::getVpcId()const +{ + return vpcId_; +} + +void CreateMultiZoneClusterRequest::setVpcId(const std::string& vpcId) +{ + vpcId_ = vpcId; + setParameter("VpcId", vpcId); +} + +std::string CreateMultiZoneClusterRequest::getPayType()const +{ + return payType_; +} + +void CreateMultiZoneClusterRequest::setPayType(const std::string& payType) +{ + payType_ = payType; + setParameter("PayType", payType); +} + +std::string CreateMultiZoneClusterRequest::getArbiterVSwitchId()const +{ + return arbiterVSwitchId_; +} + +void CreateMultiZoneClusterRequest::setArbiterVSwitchId(const std::string& arbiterVSwitchId) +{ + arbiterVSwitchId_ = arbiterVSwitchId; + setParameter("ArbiterVSwitchId", arbiterVSwitchId); +} + diff --git a/hbase/src/model/CreateMultiZoneClusterResult.cc b/hbase/src/model/CreateMultiZoneClusterResult.cc new file mode 100644 index 000000000..d04a63faa --- /dev/null +++ b/hbase/src/model/CreateMultiZoneClusterResult.cc @@ -0,0 +1,58 @@ +/* + * 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::HBase; +using namespace AlibabaCloud::HBase::Model; + +CreateMultiZoneClusterResult::CreateMultiZoneClusterResult() : + ServiceResult() +{} + +CreateMultiZoneClusterResult::CreateMultiZoneClusterResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +CreateMultiZoneClusterResult::~CreateMultiZoneClusterResult() +{} + +void CreateMultiZoneClusterResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["ClusterId"].isNull()) + clusterId_ = value["ClusterId"].asString(); + if(!value["OrderId"].isNull()) + orderId_ = value["OrderId"].asString(); + +} + +std::string CreateMultiZoneClusterResult::getClusterId()const +{ + return clusterId_; +} + +std::string CreateMultiZoneClusterResult::getOrderId()const +{ + return orderId_; +} + diff --git a/hbase/src/model/DeleteMultiZoneClusterRequest.cc b/hbase/src/model/DeleteMultiZoneClusterRequest.cc new file mode 100644 index 000000000..9dcc9f025 --- /dev/null +++ b/hbase/src/model/DeleteMultiZoneClusterRequest.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 + +using AlibabaCloud::HBase::Model::DeleteMultiZoneClusterRequest; + +DeleteMultiZoneClusterRequest::DeleteMultiZoneClusterRequest() : + RpcServiceRequest("hbase", "2019-01-01", "DeleteMultiZoneCluster") +{ + setMethod(HttpRequest::Method::Post); +} + +DeleteMultiZoneClusterRequest::~DeleteMultiZoneClusterRequest() +{} + +bool DeleteMultiZoneClusterRequest::getImmediateDeleteFlag()const +{ + return immediateDeleteFlag_; +} + +void DeleteMultiZoneClusterRequest::setImmediateDeleteFlag(bool immediateDeleteFlag) +{ + immediateDeleteFlag_ = immediateDeleteFlag; + setParameter("ImmediateDeleteFlag", immediateDeleteFlag ? "true" : "false"); +} + +std::string DeleteMultiZoneClusterRequest::getClusterId()const +{ + return clusterId_; +} + +void DeleteMultiZoneClusterRequest::setClusterId(const std::string& clusterId) +{ + clusterId_ = clusterId; + setParameter("ClusterId", clusterId); +} + diff --git a/hbase/src/model/DeleteMultiZoneClusterResult.cc b/hbase/src/model/DeleteMultiZoneClusterResult.cc new file mode 100644 index 000000000..cb70f5c5a --- /dev/null +++ b/hbase/src/model/DeleteMultiZoneClusterResult.cc @@ -0,0 +1,44 @@ +/* + * 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::HBase; +using namespace AlibabaCloud::HBase::Model; + +DeleteMultiZoneClusterResult::DeleteMultiZoneClusterResult() : + ServiceResult() +{} + +DeleteMultiZoneClusterResult::DeleteMultiZoneClusterResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +DeleteMultiZoneClusterResult::~DeleteMultiZoneClusterResult() +{} + +void DeleteMultiZoneClusterResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + +} + diff --git a/hbase/src/model/DescribeAvailableResourceResult.cc b/hbase/src/model/DescribeAvailableResourceResult.cc index fa142887b..444710061 100644 --- a/hbase/src/model/DescribeAvailableResourceResult.cc +++ b/hbase/src/model/DescribeAvailableResourceResult.cc @@ -77,6 +77,8 @@ void DescribeAvailableResourceResult::parse(const std::string &payload) AvailableZone::SupportedEngine::SupportedEngineVersion::SupportedCategoriesItem::SupportedStorageType::CoreResource coreResourcesObject; if(!allSupportedStorageTypesNodeCoreResourcesCoreResource["InstanceType"].isNull()) coreResourcesObject.instanceType = allSupportedStorageTypesNodeCoreResourcesCoreResource["InstanceType"].asString(); + if(!allSupportedStorageTypesNodeCoreResourcesCoreResource["MaxCoreCount"].isNull()) + coreResourcesObject.maxCoreCount = std::stoi(allSupportedStorageTypesNodeCoreResourcesCoreResource["MaxCoreCount"].asString()); auto dBInstanceStorageRangeNode = value["DBInstanceStorageRange"]; if(!dBInstanceStorageRangeNode["MaxSize"].isNull()) coreResourcesObject.dBInstanceStorageRange.maxSize = std::stoi(dBInstanceStorageRangeNode["MaxSize"].asString()); diff --git a/hbase/src/model/DescribeInstancesResult.cc b/hbase/src/model/DescribeInstancesResult.cc index 41e6abc17..3ca566315 100644 --- a/hbase/src/model/DescribeInstancesResult.cc +++ b/hbase/src/model/DescribeInstancesResult.cc @@ -109,6 +109,8 @@ void DescribeInstancesResult::parse(const std::string &payload) instancesObject.moduleId = std::stoi(valueInstancesInstance["ModuleId"].asString()); if(!valueInstancesInstance["ModuleStackVersion"].isNull()) instancesObject.moduleStackVersion = valueInstancesInstance["ModuleStackVersion"].asString(); + if(!valueInstancesInstance["CoreDiskCount"].isNull()) + instancesObject.coreDiskCount = valueInstancesInstance["CoreDiskCount"].asString(); auto allTagsNode = allInstancesNode["Tags"]["Tag"]; for (auto allInstancesNodeTagsTag : allTagsNode) {