From e2b6c81588e8b48ed45301569fc6990fa5d5001e Mon Sep 17 00:00:00 2001 From: sdk-team Date: Thu, 23 Sep 2021 08:52:35 +0000 Subject: [PATCH] Supports the purchase of polardb storage packages. --- CHANGELOG | 5 + VERSION | 2 +- polardb/CMakeLists.txt | 8 + .../alibabacloud/polardb/PolardbClient.h | 16 ++ .../polardb/model/CreateStoragePlanRequest.h | 75 +++++++++ .../polardb/model/CreateStoragePlanResult.h | 53 ++++++ .../model/DescribeDBClusterAttributeResult.h | 26 +-- .../polardb/model/DescribeDBClustersResult.h | 1 + .../DescribeGlobalDatabaseNetworkResult.h | 13 ++ .../model/DescribeScheduleTasksRequest.h | 6 + .../model/DescribeScheduleTasksResult.h | 4 +- .../polardb/model/TempModifyDBNodeRequest.h | 84 ++++++++++ .../polardb/model/TempModifyDBNodeResult.h | 55 +++++++ polardb/src/PolardbClient.cc | 72 ++++++++ polardb/src/model/CreateStoragePlanRequest.cc | 139 ++++++++++++++++ polardb/src/model/CreateStoragePlanResult.cc | 58 +++++++ .../model/DescribeDBClusterAttributeResult.cc | 99 +++++------ polardb/src/model/DescribeDBClustersResult.cc | 2 + .../DescribeGlobalDatabaseNetworkResult.cc | 24 +++ .../src/model/DescribeScheduleTasksRequest.cc | 22 +++ .../src/model/DescribeScheduleTasksResult.cc | 20 +-- polardb/src/model/TempModifyDBNodeRequest.cc | 155 ++++++++++++++++++ polardb/src/model/TempModifyDBNodeResult.cc | 66 ++++++++ 23 files changed, 934 insertions(+), 71 deletions(-) create mode 100644 polardb/include/alibabacloud/polardb/model/CreateStoragePlanRequest.h create mode 100644 polardb/include/alibabacloud/polardb/model/CreateStoragePlanResult.h create mode 100644 polardb/include/alibabacloud/polardb/model/TempModifyDBNodeRequest.h create mode 100644 polardb/include/alibabacloud/polardb/model/TempModifyDBNodeResult.h create mode 100644 polardb/src/model/CreateStoragePlanRequest.cc create mode 100644 polardb/src/model/CreateStoragePlanResult.cc create mode 100644 polardb/src/model/TempModifyDBNodeRequest.cc create mode 100644 polardb/src/model/TempModifyDBNodeResult.cc diff --git a/CHANGELOG b/CHANGELOG index 6451f9747..aeadc541d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,8 @@ +2021-09-23 Version: 1.36.883 +- Supports the purchase of polardb storage packages. +- Support temporary upgrades and allocations of instances. +- Query the detailed information of the node returned by the GDN instance. + 2021-09-23 Version: 1.36.882 - Update by sdk platform. diff --git a/VERSION b/VERSION index 761688d2c..cdb143201 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.882 \ No newline at end of file +1.36.883 \ No newline at end of file diff --git a/polardb/CMakeLists.txt b/polardb/CMakeLists.txt index f11c69a8c..409967c47 100644 --- a/polardb/CMakeLists.txt +++ b/polardb/CMakeLists.txt @@ -49,6 +49,8 @@ set(polardb_public_header_model include/alibabacloud/polardb/model/CreateGlobalDatabaseNetworkResult.h include/alibabacloud/polardb/model/CreateParameterGroupRequest.h include/alibabacloud/polardb/model/CreateParameterGroupResult.h + include/alibabacloud/polardb/model/CreateStoragePlanRequest.h + include/alibabacloud/polardb/model/CreateStoragePlanResult.h include/alibabacloud/polardb/model/DeleteAccountRequest.h include/alibabacloud/polardb/model/DeleteAccountResult.h include/alibabacloud/polardb/model/DeleteBackupRequest.h @@ -215,6 +217,8 @@ set(polardb_public_header_model include/alibabacloud/polardb/model/RevokeAccountPrivilegeResult.h include/alibabacloud/polardb/model/TagResourcesRequest.h include/alibabacloud/polardb/model/TagResourcesResult.h + include/alibabacloud/polardb/model/TempModifyDBNodeRequest.h + include/alibabacloud/polardb/model/TempModifyDBNodeResult.h include/alibabacloud/polardb/model/TransformDBClusterPayTypeRequest.h include/alibabacloud/polardb/model/TransformDBClusterPayTypeResult.h include/alibabacloud/polardb/model/UntagResourcesRequest.h @@ -254,6 +258,8 @@ set(polardb_src src/model/CreateGlobalDatabaseNetworkResult.cc src/model/CreateParameterGroupRequest.cc src/model/CreateParameterGroupResult.cc + src/model/CreateStoragePlanRequest.cc + src/model/CreateStoragePlanResult.cc src/model/DeleteAccountRequest.cc src/model/DeleteAccountResult.cc src/model/DeleteBackupRequest.cc @@ -420,6 +426,8 @@ set(polardb_src src/model/RevokeAccountPrivilegeResult.cc src/model/TagResourcesRequest.cc src/model/TagResourcesResult.cc + src/model/TempModifyDBNodeRequest.cc + src/model/TempModifyDBNodeResult.cc src/model/TransformDBClusterPayTypeRequest.cc src/model/TransformDBClusterPayTypeResult.cc src/model/UntagResourcesRequest.cc diff --git a/polardb/include/alibabacloud/polardb/PolardbClient.h b/polardb/include/alibabacloud/polardb/PolardbClient.h index 8e4e15f41..0c7cdcdfd 100644 --- a/polardb/include/alibabacloud/polardb/PolardbClient.h +++ b/polardb/include/alibabacloud/polardb/PolardbClient.h @@ -50,6 +50,8 @@ #include "model/CreateGlobalDatabaseNetworkResult.h" #include "model/CreateParameterGroupRequest.h" #include "model/CreateParameterGroupResult.h" +#include "model/CreateStoragePlanRequest.h" +#include "model/CreateStoragePlanResult.h" #include "model/DeleteAccountRequest.h" #include "model/DeleteAccountResult.h" #include "model/DeleteBackupRequest.h" @@ -216,6 +218,8 @@ #include "model/RevokeAccountPrivilegeResult.h" #include "model/TagResourcesRequest.h" #include "model/TagResourcesResult.h" +#include "model/TempModifyDBNodeRequest.h" +#include "model/TempModifyDBNodeResult.h" #include "model/TransformDBClusterPayTypeRequest.h" #include "model/TransformDBClusterPayTypeResult.h" #include "model/UntagResourcesRequest.h" @@ -275,6 +279,9 @@ namespace AlibabaCloud typedef Outcome CreateParameterGroupOutcome; typedef std::future CreateParameterGroupOutcomeCallable; typedef std::function&)> CreateParameterGroupAsyncHandler; + typedef Outcome CreateStoragePlanOutcome; + typedef std::future CreateStoragePlanOutcomeCallable; + typedef std::function&)> CreateStoragePlanAsyncHandler; typedef Outcome DeleteAccountOutcome; typedef std::future DeleteAccountOutcomeCallable; typedef std::function&)> DeleteAccountAsyncHandler; @@ -524,6 +531,9 @@ namespace AlibabaCloud typedef Outcome TagResourcesOutcome; typedef std::future TagResourcesOutcomeCallable; typedef std::function&)> TagResourcesAsyncHandler; + typedef Outcome TempModifyDBNodeOutcome; + typedef std::future TempModifyDBNodeOutcomeCallable; + typedef std::function&)> TempModifyDBNodeAsyncHandler; typedef Outcome TransformDBClusterPayTypeOutcome; typedef std::future TransformDBClusterPayTypeOutcomeCallable; typedef std::function&)> TransformDBClusterPayTypeAsyncHandler; @@ -583,6 +593,9 @@ namespace AlibabaCloud CreateParameterGroupOutcome createParameterGroup(const Model::CreateParameterGroupRequest &request)const; void createParameterGroupAsync(const Model::CreateParameterGroupRequest& request, const CreateParameterGroupAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; CreateParameterGroupOutcomeCallable createParameterGroupCallable(const Model::CreateParameterGroupRequest& request) const; + CreateStoragePlanOutcome createStoragePlan(const Model::CreateStoragePlanRequest &request)const; + void createStoragePlanAsync(const Model::CreateStoragePlanRequest& request, const CreateStoragePlanAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + CreateStoragePlanOutcomeCallable createStoragePlanCallable(const Model::CreateStoragePlanRequest& request) const; DeleteAccountOutcome deleteAccount(const Model::DeleteAccountRequest &request)const; void deleteAccountAsync(const Model::DeleteAccountRequest& request, const DeleteAccountAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; DeleteAccountOutcomeCallable deleteAccountCallable(const Model::DeleteAccountRequest& request) const; @@ -832,6 +845,9 @@ namespace AlibabaCloud TagResourcesOutcome tagResources(const Model::TagResourcesRequest &request)const; void tagResourcesAsync(const Model::TagResourcesRequest& request, const TagResourcesAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; TagResourcesOutcomeCallable tagResourcesCallable(const Model::TagResourcesRequest& request) const; + TempModifyDBNodeOutcome tempModifyDBNode(const Model::TempModifyDBNodeRequest &request)const; + void tempModifyDBNodeAsync(const Model::TempModifyDBNodeRequest& request, const TempModifyDBNodeAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + TempModifyDBNodeOutcomeCallable tempModifyDBNodeCallable(const Model::TempModifyDBNodeRequest& request) const; TransformDBClusterPayTypeOutcome transformDBClusterPayType(const Model::TransformDBClusterPayTypeRequest &request)const; void transformDBClusterPayTypeAsync(const Model::TransformDBClusterPayTypeRequest& request, const TransformDBClusterPayTypeAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; TransformDBClusterPayTypeOutcomeCallable transformDBClusterPayTypeCallable(const Model::TransformDBClusterPayTypeRequest& request) const; diff --git a/polardb/include/alibabacloud/polardb/model/CreateStoragePlanRequest.h b/polardb/include/alibabacloud/polardb/model/CreateStoragePlanRequest.h new file mode 100644 index 000000000..cf284fda8 --- /dev/null +++ b/polardb/include/alibabacloud/polardb/model/CreateStoragePlanRequest.h @@ -0,0 +1,75 @@ +/* + * 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_POLARDB_MODEL_CREATESTORAGEPLANREQUEST_H_ +#define ALIBABACLOUD_POLARDB_MODEL_CREATESTORAGEPLANREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Polardb + { + namespace Model + { + class ALIBABACLOUD_POLARDB_EXPORT CreateStoragePlanRequest : public RpcServiceRequest + { + + public: + CreateStoragePlanRequest(); + ~CreateStoragePlanRequest(); + + long getResourceOwnerId()const; + void setResourceOwnerId(long resourceOwnerId); + std::string getClientToken()const; + void setClientToken(const std::string& clientToken); + std::string getStorageType()const; + void setStorageType(const std::string& storageType); + std::string getAccessKeyId()const; + void setAccessKeyId(const std::string& accessKeyId); + std::string getPeriod()const; + void setPeriod(const std::string& period); + std::string getResourceOwnerAccount()const; + void setResourceOwnerAccount(const std::string& resourceOwnerAccount); + std::string getOwnerAccount()const; + void setOwnerAccount(const std::string& ownerAccount); + long getOwnerId()const; + void setOwnerId(long ownerId); + std::string getUsedTime()const; + void setUsedTime(const std::string& usedTime); + std::string getStorageClass()const; + void setStorageClass(const std::string& storageClass); + + private: + long resourceOwnerId_; + std::string clientToken_; + std::string storageType_; + std::string accessKeyId_; + std::string period_; + std::string resourceOwnerAccount_; + std::string ownerAccount_; + long ownerId_; + std::string usedTime_; + std::string storageClass_; + + }; + } + } +} +#endif // !ALIBABACLOUD_POLARDB_MODEL_CREATESTORAGEPLANREQUEST_H_ \ No newline at end of file diff --git a/polardb/include/alibabacloud/polardb/model/CreateStoragePlanResult.h b/polardb/include/alibabacloud/polardb/model/CreateStoragePlanResult.h new file mode 100644 index 000000000..3c7fef6b6 --- /dev/null +++ b/polardb/include/alibabacloud/polardb/model/CreateStoragePlanResult.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_POLARDB_MODEL_CREATESTORAGEPLANRESULT_H_ +#define ALIBABACLOUD_POLARDB_MODEL_CREATESTORAGEPLANRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Polardb + { + namespace Model + { + class ALIBABACLOUD_POLARDB_EXPORT CreateStoragePlanResult : public ServiceResult + { + public: + + + CreateStoragePlanResult(); + explicit CreateStoragePlanResult(const std::string &payload); + ~CreateStoragePlanResult(); + std::string getDBInstanceId()const; + std::string getOrderId()const; + + protected: + void parse(const std::string &payload); + private: + std::string dBInstanceId_; + std::string orderId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_POLARDB_MODEL_CREATESTORAGEPLANRESULT_H_ \ No newline at end of file diff --git a/polardb/include/alibabacloud/polardb/model/DescribeDBClusterAttributeResult.h b/polardb/include/alibabacloud/polardb/model/DescribeDBClusterAttributeResult.h index f6b467206..2d3a6f7fe 100644 --- a/polardb/include/alibabacloud/polardb/model/DescribeDBClusterAttributeResult.h +++ b/polardb/include/alibabacloud/polardb/model/DescribeDBClusterAttributeResult.h @@ -35,14 +35,14 @@ namespace AlibabaCloud struct DBNode { std::string dBNodeStatus; - int maxConnections; std::string zoneId; + int maxConnections; std::string dBNodeRole; std::string creationTime; std::string dBNodeId; int failoverPriority; - std::string dBNodeClass; int maxIOPS; + std::string dBNodeClass; }; struct Tag { @@ -59,11 +59,11 @@ namespace AlibabaCloud std::string getResourceGroupId()const; long getDataLevel1BackupChainSize()const; std::string getDBClusterId()const; - std::string getDBClusterNetworkType()const; std::string getDBType()const; + std::string getDBClusterNetworkType()const; bool getIsLatestVersion()const; - std::string getDBVersion()const; long getStorageMax()const; + std::string getDBVersion()const; std::vector getDBNodes()const; std::string getZoneIds()const; std::string getMaintainTime()const; @@ -74,14 +74,15 @@ namespace AlibabaCloud std::string getVSwitchId()const; std::string getDBClusterDescription()const; std::string getExpired()const; - std::string getLockMode()const; std::string getPayType()const; + std::string getLockMode()const; long getStorageUsed()const; + bool getIsProxyLatestVersion()const; std::string getDBVersionStatus()const; - std::string getSubCategory()const; std::string getCreationTime()const; - std::string getRegionId()const; + std::string getSubCategory()const; long getSQLSize()const; + std::string getRegionId()const; std::string getExpireTime()const; protected: @@ -92,11 +93,11 @@ namespace AlibabaCloud std::string resourceGroupId_; long dataLevel1BackupChainSize_; std::string dBClusterId_; - std::string dBClusterNetworkType_; std::string dBType_; + std::string dBClusterNetworkType_; bool isLatestVersion_; - std::string dBVersion_; long storageMax_; + std::string dBVersion_; std::vector dBNodes_; std::string zoneIds_; std::string maintainTime_; @@ -107,14 +108,15 @@ namespace AlibabaCloud std::string vSwitchId_; std::string dBClusterDescription_; std::string expired_; - std::string lockMode_; std::string payType_; + std::string lockMode_; long storageUsed_; + bool isProxyLatestVersion_; std::string dBVersionStatus_; - std::string subCategory_; std::string creationTime_; - std::string regionId_; + std::string subCategory_; long sQLSize_; + std::string regionId_; std::string expireTime_; }; diff --git a/polardb/include/alibabacloud/polardb/model/DescribeDBClustersResult.h b/polardb/include/alibabacloud/polardb/model/DescribeDBClustersResult.h index 17936bc70..4341b37f0 100644 --- a/polardb/include/alibabacloud/polardb/model/DescribeDBClustersResult.h +++ b/polardb/include/alibabacloud/polardb/model/DescribeDBClustersResult.h @@ -48,6 +48,7 @@ namespace AlibabaCloud std::string dBNodeClass; }; int deletionLock; + std::string category; std::string resourceGroupId; std::string zoneId; std::string dBClusterStatus; diff --git a/polardb/include/alibabacloud/polardb/model/DescribeGlobalDatabaseNetworkResult.h b/polardb/include/alibabacloud/polardb/model/DescribeGlobalDatabaseNetworkResult.h index 9fd46e995..b35a3e0be 100644 --- a/polardb/include/alibabacloud/polardb/model/DescribeGlobalDatabaseNetworkResult.h +++ b/polardb/include/alibabacloud/polardb/model/DescribeGlobalDatabaseNetworkResult.h @@ -40,6 +40,18 @@ namespace AlibabaCloud }; struct DBCluster { + struct DBNode + { + std::string dBNodeStatus; + std::string zoneId; + int maxConnections; + std::string dBNodeRole; + std::string creationTime; + std::string dBNodeId; + int failoverPriority; + std::string dBNodeClass; + int maxIOPS; + }; std::string dBClusterStatus; std::string dBClusterId; std::string dBClusterDescription; @@ -51,6 +63,7 @@ namespace AlibabaCloud std::string storageUsed; std::string role; std::string dBVersion; + std::vector dBNodes; std::string regionId; std::string expireTime; }; diff --git a/polardb/include/alibabacloud/polardb/model/DescribeScheduleTasksRequest.h b/polardb/include/alibabacloud/polardb/model/DescribeScheduleTasksRequest.h index 584081242..972696c46 100644 --- a/polardb/include/alibabacloud/polardb/model/DescribeScheduleTasksRequest.h +++ b/polardb/include/alibabacloud/polardb/model/DescribeScheduleTasksRequest.h @@ -37,6 +37,8 @@ namespace AlibabaCloud long getResourceOwnerId()const; void setResourceOwnerId(long resourceOwnerId); + std::string getDBClusterDescription()const; + void setDBClusterDescription(const std::string& dBClusterDescription); int getPageNumber()const; void setPageNumber(int pageNumber); std::string getAccessKeyId()const; @@ -47,6 +49,8 @@ namespace AlibabaCloud void setPageSize(int pageSize); std::string getResourceOwnerAccount()const; void setResourceOwnerAccount(const std::string& resourceOwnerAccount); + std::string getOrderId()const; + void setOrderId(const std::string& orderId); std::string getDBClusterId()const; void setDBClusterId(const std::string& dBClusterId); std::string getOwnerAccount()const; @@ -60,11 +64,13 @@ namespace AlibabaCloud private: long resourceOwnerId_; + std::string dBClusterDescription_; int pageNumber_; std::string accessKeyId_; std::string regionId_; int pageSize_; std::string resourceOwnerAccount_; + std::string orderId_; std::string dBClusterId_; std::string ownerAccount_; long ownerId_; diff --git a/polardb/include/alibabacloud/polardb/model/DescribeScheduleTasksResult.h b/polardb/include/alibabacloud/polardb/model/DescribeScheduleTasksResult.h index c1f682afa..8f16b65e3 100644 --- a/polardb/include/alibabacloud/polardb/model/DescribeScheduleTasksResult.h +++ b/polardb/include/alibabacloud/polardb/model/DescribeScheduleTasksResult.h @@ -38,11 +38,11 @@ namespace AlibabaCloud { std::string status; std::string action; - std::string taskId; std::string plannedTime; + std::string taskId; std::string dbClusterDescription; - std::string plannedStartTime; std::string dBClusterId; + std::string plannedStartTime; std::string region; std::string orderId; std::string plannedEndTime; diff --git a/polardb/include/alibabacloud/polardb/model/TempModifyDBNodeRequest.h b/polardb/include/alibabacloud/polardb/model/TempModifyDBNodeRequest.h new file mode 100644 index 000000000..19fcefe3a --- /dev/null +++ b/polardb/include/alibabacloud/polardb/model/TempModifyDBNodeRequest.h @@ -0,0 +1,84 @@ +/* + * 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_POLARDB_MODEL_TEMPMODIFYDBNODEREQUEST_H_ +#define ALIBABACLOUD_POLARDB_MODEL_TEMPMODIFYDBNODEREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Polardb + { + namespace Model + { + class ALIBABACLOUD_POLARDB_EXPORT TempModifyDBNodeRequest : public RpcServiceRequest + { + public: + struct DBNode + { + std::string targetClass; + std::string zoneId; + }; + + public: + TempModifyDBNodeRequest(); + ~TempModifyDBNodeRequest(); + + long getResourceOwnerId()const; + void setResourceOwnerId(long resourceOwnerId); + std::string getClientToken()const; + void setClientToken(const std::string& clientToken); + std::string getAccessKeyId()const; + void setAccessKeyId(const std::string& accessKeyId); + std::string getRestoreTime()const; + void setRestoreTime(const std::string& restoreTime); + std::string getResourceOwnerAccount()const; + void setResourceOwnerAccount(const std::string& resourceOwnerAccount); + std::string getDBClusterId()const; + void setDBClusterId(const std::string& dBClusterId); + std::string getOwnerAccount()const; + void setOwnerAccount(const std::string& ownerAccount); + std::string getOperationType()const; + void setOperationType(const std::string& operationType); + long getOwnerId()const; + void setOwnerId(long ownerId); + std::string getModifyType()const; + void setModifyType(const std::string& modifyType); + std::vector getDBNode()const; + void setDBNode(const std::vector& dBNode); + + private: + long resourceOwnerId_; + std::string clientToken_; + std::string accessKeyId_; + std::string restoreTime_; + std::string resourceOwnerAccount_; + std::string dBClusterId_; + std::string ownerAccount_; + std::string operationType_; + long ownerId_; + std::string modifyType_; + std::vector dBNode_; + + }; + } + } +} +#endif // !ALIBABACLOUD_POLARDB_MODEL_TEMPMODIFYDBNODEREQUEST_H_ \ No newline at end of file diff --git a/polardb/include/alibabacloud/polardb/model/TempModifyDBNodeResult.h b/polardb/include/alibabacloud/polardb/model/TempModifyDBNodeResult.h new file mode 100644 index 000000000..cef09395b --- /dev/null +++ b/polardb/include/alibabacloud/polardb/model/TempModifyDBNodeResult.h @@ -0,0 +1,55 @@ +/* + * 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_POLARDB_MODEL_TEMPMODIFYDBNODERESULT_H_ +#define ALIBABACLOUD_POLARDB_MODEL_TEMPMODIFYDBNODERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Polardb + { + namespace Model + { + class ALIBABACLOUD_POLARDB_EXPORT TempModifyDBNodeResult : public ServiceResult + { + public: + + + TempModifyDBNodeResult(); + explicit TempModifyDBNodeResult(const std::string &payload); + ~TempModifyDBNodeResult(); + std::vector getDBNodeIds()const; + std::string getDBClusterId()const; + std::string getOrderId()const; + + protected: + void parse(const std::string &payload); + private: + std::vector dBNodeIds_; + std::string dBClusterId_; + std::string orderId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_POLARDB_MODEL_TEMPMODIFYDBNODERESULT_H_ \ No newline at end of file diff --git a/polardb/src/PolardbClient.cc b/polardb/src/PolardbClient.cc index 818e821a8..86e7a905e 100644 --- a/polardb/src/PolardbClient.cc +++ b/polardb/src/PolardbClient.cc @@ -555,6 +555,42 @@ PolardbClient::CreateParameterGroupOutcomeCallable PolardbClient::createParamete return task->get_future(); } +PolardbClient::CreateStoragePlanOutcome PolardbClient::createStoragePlan(const CreateStoragePlanRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return CreateStoragePlanOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return CreateStoragePlanOutcome(CreateStoragePlanResult(outcome.result())); + else + return CreateStoragePlanOutcome(outcome.error()); +} + +void PolardbClient::createStoragePlanAsync(const CreateStoragePlanRequest& request, const CreateStoragePlanAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, createStoragePlan(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +PolardbClient::CreateStoragePlanOutcomeCallable PolardbClient::createStoragePlanCallable(const CreateStoragePlanRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->createStoragePlan(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + PolardbClient::DeleteAccountOutcome PolardbClient::deleteAccount(const DeleteAccountRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -3543,6 +3579,42 @@ PolardbClient::TagResourcesOutcomeCallable PolardbClient::tagResourcesCallable(c return task->get_future(); } +PolardbClient::TempModifyDBNodeOutcome PolardbClient::tempModifyDBNode(const TempModifyDBNodeRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return TempModifyDBNodeOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return TempModifyDBNodeOutcome(TempModifyDBNodeResult(outcome.result())); + else + return TempModifyDBNodeOutcome(outcome.error()); +} + +void PolardbClient::tempModifyDBNodeAsync(const TempModifyDBNodeRequest& request, const TempModifyDBNodeAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, tempModifyDBNode(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +PolardbClient::TempModifyDBNodeOutcomeCallable PolardbClient::tempModifyDBNodeCallable(const TempModifyDBNodeRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->tempModifyDBNode(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + PolardbClient::TransformDBClusterPayTypeOutcome PolardbClient::transformDBClusterPayType(const TransformDBClusterPayTypeRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/polardb/src/model/CreateStoragePlanRequest.cc b/polardb/src/model/CreateStoragePlanRequest.cc new file mode 100644 index 000000000..2f642a271 --- /dev/null +++ b/polardb/src/model/CreateStoragePlanRequest.cc @@ -0,0 +1,139 @@ +/* + * 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::Polardb::Model::CreateStoragePlanRequest; + +CreateStoragePlanRequest::CreateStoragePlanRequest() : + RpcServiceRequest("polardb", "2017-08-01", "CreateStoragePlan") +{ + setMethod(HttpRequest::Method::Post); +} + +CreateStoragePlanRequest::~CreateStoragePlanRequest() +{} + +long CreateStoragePlanRequest::getResourceOwnerId()const +{ + return resourceOwnerId_; +} + +void CreateStoragePlanRequest::setResourceOwnerId(long resourceOwnerId) +{ + resourceOwnerId_ = resourceOwnerId; + setParameter("ResourceOwnerId", std::to_string(resourceOwnerId)); +} + +std::string CreateStoragePlanRequest::getClientToken()const +{ + return clientToken_; +} + +void CreateStoragePlanRequest::setClientToken(const std::string& clientToken) +{ + clientToken_ = clientToken; + setParameter("ClientToken", clientToken); +} + +std::string CreateStoragePlanRequest::getStorageType()const +{ + return storageType_; +} + +void CreateStoragePlanRequest::setStorageType(const std::string& storageType) +{ + storageType_ = storageType; + setParameter("StorageType", storageType); +} + +std::string CreateStoragePlanRequest::getAccessKeyId()const +{ + return accessKeyId_; +} + +void CreateStoragePlanRequest::setAccessKeyId(const std::string& accessKeyId) +{ + accessKeyId_ = accessKeyId; + setParameter("AccessKeyId", accessKeyId); +} + +std::string CreateStoragePlanRequest::getPeriod()const +{ + return period_; +} + +void CreateStoragePlanRequest::setPeriod(const std::string& period) +{ + period_ = period; + setParameter("Period", period); +} + +std::string CreateStoragePlanRequest::getResourceOwnerAccount()const +{ + return resourceOwnerAccount_; +} + +void CreateStoragePlanRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount) +{ + resourceOwnerAccount_ = resourceOwnerAccount; + setParameter("ResourceOwnerAccount", resourceOwnerAccount); +} + +std::string CreateStoragePlanRequest::getOwnerAccount()const +{ + return ownerAccount_; +} + +void CreateStoragePlanRequest::setOwnerAccount(const std::string& ownerAccount) +{ + ownerAccount_ = ownerAccount; + setParameter("OwnerAccount", ownerAccount); +} + +long CreateStoragePlanRequest::getOwnerId()const +{ + return ownerId_; +} + +void CreateStoragePlanRequest::setOwnerId(long ownerId) +{ + ownerId_ = ownerId; + setParameter("OwnerId", std::to_string(ownerId)); +} + +std::string CreateStoragePlanRequest::getUsedTime()const +{ + return usedTime_; +} + +void CreateStoragePlanRequest::setUsedTime(const std::string& usedTime) +{ + usedTime_ = usedTime; + setParameter("UsedTime", usedTime); +} + +std::string CreateStoragePlanRequest::getStorageClass()const +{ + return storageClass_; +} + +void CreateStoragePlanRequest::setStorageClass(const std::string& storageClass) +{ + storageClass_ = storageClass; + setParameter("StorageClass", storageClass); +} + diff --git a/polardb/src/model/CreateStoragePlanResult.cc b/polardb/src/model/CreateStoragePlanResult.cc new file mode 100644 index 000000000..b15d3b795 --- /dev/null +++ b/polardb/src/model/CreateStoragePlanResult.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::Polardb; +using namespace AlibabaCloud::Polardb::Model; + +CreateStoragePlanResult::CreateStoragePlanResult() : + ServiceResult() +{} + +CreateStoragePlanResult::CreateStoragePlanResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +CreateStoragePlanResult::~CreateStoragePlanResult() +{} + +void CreateStoragePlanResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["DBInstanceId"].isNull()) + dBInstanceId_ = value["DBInstanceId"].asString(); + if(!value["OrderId"].isNull()) + orderId_ = value["OrderId"].asString(); + +} + +std::string CreateStoragePlanResult::getDBInstanceId()const +{ + return dBInstanceId_; +} + +std::string CreateStoragePlanResult::getOrderId()const +{ + return orderId_; +} + diff --git a/polardb/src/model/DescribeDBClusterAttributeResult.cc b/polardb/src/model/DescribeDBClusterAttributeResult.cc index 9c585814a..8d5a202f2 100644 --- a/polardb/src/model/DescribeDBClusterAttributeResult.cc +++ b/polardb/src/model/DescribeDBClusterAttributeResult.cc @@ -43,34 +43,34 @@ void DescribeDBClusterAttributeResult::parse(const std::string &payload) for (auto valueDBNodesDBNode : allDBNodesNode) { DBNode dBNodesObject; - if(!valueDBNodesDBNode["DBNodeStatus"].isNull()) - dBNodesObject.dBNodeStatus = valueDBNodesDBNode["DBNodeStatus"].asString(); - if(!valueDBNodesDBNode["MaxConnections"].isNull()) - dBNodesObject.maxConnections = std::stoi(valueDBNodesDBNode["MaxConnections"].asString()); - if(!valueDBNodesDBNode["ZoneId"].isNull()) - dBNodesObject.zoneId = valueDBNodesDBNode["ZoneId"].asString(); - if(!valueDBNodesDBNode["DBNodeRole"].isNull()) - dBNodesObject.dBNodeRole = valueDBNodesDBNode["DBNodeRole"].asString(); if(!valueDBNodesDBNode["CreationTime"].isNull()) dBNodesObject.creationTime = valueDBNodesDBNode["CreationTime"].asString(); - if(!valueDBNodesDBNode["DBNodeId"].isNull()) - dBNodesObject.dBNodeId = valueDBNodesDBNode["DBNodeId"].asString(); if(!valueDBNodesDBNode["FailoverPriority"].isNull()) dBNodesObject.failoverPriority = std::stoi(valueDBNodesDBNode["FailoverPriority"].asString()); - if(!valueDBNodesDBNode["DBNodeClass"].isNull()) - dBNodesObject.dBNodeClass = valueDBNodesDBNode["DBNodeClass"].asString(); if(!valueDBNodesDBNode["MaxIOPS"].isNull()) dBNodesObject.maxIOPS = std::stoi(valueDBNodesDBNode["MaxIOPS"].asString()); + if(!valueDBNodesDBNode["DBNodeClass"].isNull()) + dBNodesObject.dBNodeClass = valueDBNodesDBNode["DBNodeClass"].asString(); + if(!valueDBNodesDBNode["DBNodeRole"].isNull()) + dBNodesObject.dBNodeRole = valueDBNodesDBNode["DBNodeRole"].asString(); + if(!valueDBNodesDBNode["ZoneId"].isNull()) + dBNodesObject.zoneId = valueDBNodesDBNode["ZoneId"].asString(); + if(!valueDBNodesDBNode["MaxConnections"].isNull()) + dBNodesObject.maxConnections = std::stoi(valueDBNodesDBNode["MaxConnections"].asString()); + if(!valueDBNodesDBNode["DBNodeStatus"].isNull()) + dBNodesObject.dBNodeStatus = valueDBNodesDBNode["DBNodeStatus"].asString(); + if(!valueDBNodesDBNode["DBNodeId"].isNull()) + dBNodesObject.dBNodeId = valueDBNodesDBNode["DBNodeId"].asString(); dBNodes_.push_back(dBNodesObject); } auto allTagsNode = value["Tags"]["Tag"]; for (auto valueTagsTag : allTagsNode) { Tag tagsObject; - if(!valueTagsTag["Value"].isNull()) - tagsObject.value = valueTagsTag["Value"].asString(); if(!valueTagsTag["Key"].isNull()) tagsObject.key = valueTagsTag["Key"].asString(); + if(!valueTagsTag["Value"].isNull()) + tagsObject.value = valueTagsTag["Value"].asString(); tags_.push_back(tagsObject); } if(!value["DeletionLock"].isNull()) @@ -83,16 +83,16 @@ void DescribeDBClusterAttributeResult::parse(const std::string &payload) dataLevel1BackupChainSize_ = std::stol(value["DataLevel1BackupChainSize"].asString()); if(!value["DBClusterId"].isNull()) dBClusterId_ = value["DBClusterId"].asString(); - if(!value["DBClusterNetworkType"].isNull()) - dBClusterNetworkType_ = value["DBClusterNetworkType"].asString(); if(!value["DBType"].isNull()) dBType_ = value["DBType"].asString(); + if(!value["DBClusterNetworkType"].isNull()) + dBClusterNetworkType_ = value["DBClusterNetworkType"].asString(); if(!value["IsLatestVersion"].isNull()) isLatestVersion_ = value["IsLatestVersion"].asString() == "true"; - if(!value["DBVersion"].isNull()) - dBVersion_ = value["DBVersion"].asString(); if(!value["StorageMax"].isNull()) storageMax_ = std::stol(value["StorageMax"].asString()); + if(!value["DBVersion"].isNull()) + dBVersion_ = value["DBVersion"].asString(); if(!value["ZoneIds"].isNull()) zoneIds_ = value["ZoneIds"].asString(); if(!value["MaintainTime"].isNull()) @@ -109,24 +109,26 @@ void DescribeDBClusterAttributeResult::parse(const std::string &payload) dBClusterDescription_ = value["DBClusterDescription"].asString(); if(!value["Expired"].isNull()) expired_ = value["Expired"].asString(); - if(!value["LockMode"].isNull()) - lockMode_ = value["LockMode"].asString(); if(!value["PayType"].isNull()) payType_ = value["PayType"].asString(); + if(!value["LockMode"].isNull()) + lockMode_ = value["LockMode"].asString(); if(!value["StorageUsed"].isNull()) storageUsed_ = std::stol(value["StorageUsed"].asString()); if(!value["DBVersionStatus"].isNull()) dBVersionStatus_ = value["DBVersionStatus"].asString(); - if(!value["SubCategory"].isNull()) - subCategory_ = value["SubCategory"].asString(); if(!value["CreationTime"].isNull()) creationTime_ = value["CreationTime"].asString(); - if(!value["RegionId"].isNull()) - regionId_ = value["RegionId"].asString(); if(!value["SQLSize"].isNull()) sQLSize_ = std::stol(value["SQLSize"].asString()); + if(!value["RegionId"].isNull()) + regionId_ = value["RegionId"].asString(); if(!value["ExpireTime"].isNull()) expireTime_ = value["ExpireTime"].asString(); + if(!value["SubCategory"].isNull()) + subCategory_ = value["SubCategory"].asString(); + if(!value["IsProxyLatestVersion"].isNull()) + isProxyLatestVersion_ = value["IsProxyLatestVersion"].asString() == "true"; } @@ -155,31 +157,31 @@ std::string DescribeDBClusterAttributeResult::getDBClusterId()const return dBClusterId_; } -std::string DescribeDBClusterAttributeResult::getDBClusterNetworkType()const -{ - return dBClusterNetworkType_; -} - std::string DescribeDBClusterAttributeResult::getDBType()const { return dBType_; } +std::string DescribeDBClusterAttributeResult::getDBClusterNetworkType()const +{ + return dBClusterNetworkType_; +} + bool DescribeDBClusterAttributeResult::getIsLatestVersion()const { return isLatestVersion_; } -std::string DescribeDBClusterAttributeResult::getDBVersion()const -{ - return dBVersion_; -} - long DescribeDBClusterAttributeResult::getStorageMax()const { return storageMax_; } +std::string DescribeDBClusterAttributeResult::getDBVersion()const +{ + return dBVersion_; +} + std::vector DescribeDBClusterAttributeResult::getDBNodes()const { return dBNodes_; @@ -230,39 +232,39 @@ std::string DescribeDBClusterAttributeResult::getExpired()const return expired_; } -std::string DescribeDBClusterAttributeResult::getLockMode()const -{ - return lockMode_; -} - std::string DescribeDBClusterAttributeResult::getPayType()const { return payType_; } +std::string DescribeDBClusterAttributeResult::getLockMode()const +{ + return lockMode_; +} + long DescribeDBClusterAttributeResult::getStorageUsed()const { return storageUsed_; } +bool DescribeDBClusterAttributeResult::getIsProxyLatestVersion()const +{ + return isProxyLatestVersion_; +} + std::string DescribeDBClusterAttributeResult::getDBVersionStatus()const { return dBVersionStatus_; } -std::string DescribeDBClusterAttributeResult::getSubCategory()const -{ - return subCategory_; -} - std::string DescribeDBClusterAttributeResult::getCreationTime()const { return creationTime_; } -std::string DescribeDBClusterAttributeResult::getRegionId()const +std::string DescribeDBClusterAttributeResult::getSubCategory()const { - return regionId_; + return subCategory_; } long DescribeDBClusterAttributeResult::getSQLSize()const @@ -270,6 +272,11 @@ long DescribeDBClusterAttributeResult::getSQLSize()const return sQLSize_; } +std::string DescribeDBClusterAttributeResult::getRegionId()const +{ + return regionId_; +} + std::string DescribeDBClusterAttributeResult::getExpireTime()const { return expireTime_; diff --git a/polardb/src/model/DescribeDBClustersResult.cc b/polardb/src/model/DescribeDBClustersResult.cc index 495b21113..b5a49fb4b 100644 --- a/polardb/src/model/DescribeDBClustersResult.cc +++ b/polardb/src/model/DescribeDBClustersResult.cc @@ -83,6 +83,8 @@ void DescribeDBClustersResult::parse(const std::string &payload) itemsObject.zoneId = valueItemsDBCluster["ZoneId"].asString(); if(!valueItemsDBCluster["Engine"].isNull()) itemsObject.engine = valueItemsDBCluster["Engine"].asString(); + if(!valueItemsDBCluster["Category"].isNull()) + itemsObject.category = valueItemsDBCluster["Category"].asString(); auto allTagsNode = valueItemsDBCluster["Tags"]["Tag"]; for (auto valueItemsDBClusterTagsTag : allTagsNode) { diff --git a/polardb/src/model/DescribeGlobalDatabaseNetworkResult.cc b/polardb/src/model/DescribeGlobalDatabaseNetworkResult.cc index 866acc9f7..ee54ff648 100644 --- a/polardb/src/model/DescribeGlobalDatabaseNetworkResult.cc +++ b/polardb/src/model/DescribeGlobalDatabaseNetworkResult.cc @@ -81,6 +81,30 @@ void DescribeGlobalDatabaseNetworkResult::parse(const std::string &payload) dBClustersObject.dBClusterDescription = valueDBClustersDBCluster["DBClusterDescription"].asString(); if(!valueDBClustersDBCluster["Role"].isNull()) dBClustersObject.role = valueDBClustersDBCluster["Role"].asString(); + auto allDBNodesNode = valueDBClustersDBCluster["DBNodes"]["DBNode"]; + for (auto valueDBClustersDBClusterDBNodesDBNode : allDBNodesNode) + { + DBCluster::DBNode dBNodesObject; + if(!valueDBClustersDBClusterDBNodesDBNode["DBNodeClass"].isNull()) + dBNodesObject.dBNodeClass = valueDBClustersDBClusterDBNodesDBNode["DBNodeClass"].asString(); + if(!valueDBClustersDBClusterDBNodesDBNode["ZoneId"].isNull()) + dBNodesObject.zoneId = valueDBClustersDBClusterDBNodesDBNode["ZoneId"].asString(); + if(!valueDBClustersDBClusterDBNodesDBNode["CreationTime"].isNull()) + dBNodesObject.creationTime = valueDBClustersDBClusterDBNodesDBNode["CreationTime"].asString(); + if(!valueDBClustersDBClusterDBNodesDBNode["DBNodeRole"].isNull()) + dBNodesObject.dBNodeRole = valueDBClustersDBClusterDBNodesDBNode["DBNodeRole"].asString(); + if(!valueDBClustersDBClusterDBNodesDBNode["DBNodeStatus"].isNull()) + dBNodesObject.dBNodeStatus = valueDBClustersDBClusterDBNodesDBNode["DBNodeStatus"].asString(); + if(!valueDBClustersDBClusterDBNodesDBNode["FailoverPriority"].isNull()) + dBNodesObject.failoverPriority = std::stoi(valueDBClustersDBClusterDBNodesDBNode["FailoverPriority"].asString()); + if(!valueDBClustersDBClusterDBNodesDBNode["MaxConnections"].isNull()) + dBNodesObject.maxConnections = std::stoi(valueDBClustersDBClusterDBNodesDBNode["MaxConnections"].asString()); + if(!valueDBClustersDBClusterDBNodesDBNode["MaxIOPS"].isNull()) + dBNodesObject.maxIOPS = std::stoi(valueDBClustersDBClusterDBNodesDBNode["MaxIOPS"].asString()); + if(!valueDBClustersDBClusterDBNodesDBNode["DBNodeId"].isNull()) + dBNodesObject.dBNodeId = valueDBClustersDBClusterDBNodesDBNode["DBNodeId"].asString(); + dBClustersObject.dBNodes.push_back(dBNodesObject); + } dBClusters_.push_back(dBClustersObject); } if(!value["GDNStatus"].isNull()) diff --git a/polardb/src/model/DescribeScheduleTasksRequest.cc b/polardb/src/model/DescribeScheduleTasksRequest.cc index dbdefb991..f9a138ba9 100644 --- a/polardb/src/model/DescribeScheduleTasksRequest.cc +++ b/polardb/src/model/DescribeScheduleTasksRequest.cc @@ -38,6 +38,17 @@ void DescribeScheduleTasksRequest::setResourceOwnerId(long resourceOwnerId) setParameter("ResourceOwnerId", std::to_string(resourceOwnerId)); } +std::string DescribeScheduleTasksRequest::getDBClusterDescription()const +{ + return dBClusterDescription_; +} + +void DescribeScheduleTasksRequest::setDBClusterDescription(const std::string& dBClusterDescription) +{ + dBClusterDescription_ = dBClusterDescription; + setParameter("DBClusterDescription", dBClusterDescription); +} + int DescribeScheduleTasksRequest::getPageNumber()const { return pageNumber_; @@ -93,6 +104,17 @@ void DescribeScheduleTasksRequest::setResourceOwnerAccount(const std::string& re setParameter("ResourceOwnerAccount", resourceOwnerAccount); } +std::string DescribeScheduleTasksRequest::getOrderId()const +{ + return orderId_; +} + +void DescribeScheduleTasksRequest::setOrderId(const std::string& orderId) +{ + orderId_ = orderId; + setParameter("OrderId", orderId); +} + std::string DescribeScheduleTasksRequest::getDBClusterId()const { return dBClusterId_; diff --git a/polardb/src/model/DescribeScheduleTasksResult.cc b/polardb/src/model/DescribeScheduleTasksResult.cc index 4c9c2c040..8af111a9f 100644 --- a/polardb/src/model/DescribeScheduleTasksResult.cc +++ b/polardb/src/model/DescribeScheduleTasksResult.cc @@ -42,10 +42,10 @@ void DescribeScheduleTasksResult::parse(const std::string &payload) auto dataNode = value["Data"]; if(!dataNode["TotalRecordCount"].isNull()) data_.totalRecordCount = std::stoi(dataNode["TotalRecordCount"].asString()); - if(!dataNode["PageSize"].isNull()) - data_.pageSize = std::stoi(dataNode["PageSize"].asString()); if(!dataNode["PageNumber"].isNull()) data_.pageNumber = std::stoi(dataNode["PageNumber"].asString()); + if(!dataNode["PageSize"].isNull()) + data_.pageSize = std::stoi(dataNode["PageSize"].asString()); auto allTimerInfosNode = dataNode["TimerInfos"]["timerInfosItem"]; for (auto dataNodeTimerInfostimerInfosItem : allTimerInfosNode) { @@ -54,24 +54,24 @@ void DescribeScheduleTasksResult::parse(const std::string &payload) timerInfosItemObject.status = dataNodeTimerInfostimerInfosItem["Status"].asString(); if(!dataNodeTimerInfostimerInfosItem["Action"].isNull()) timerInfosItemObject.action = dataNodeTimerInfostimerInfosItem["Action"].asString(); - if(!dataNodeTimerInfostimerInfosItem["TaskId"].isNull()) - timerInfosItemObject.taskId = dataNodeTimerInfostimerInfosItem["TaskId"].asString(); + if(!dataNodeTimerInfostimerInfosItem["PlannedEndTime"].isNull()) + timerInfosItemObject.plannedEndTime = dataNodeTimerInfostimerInfosItem["PlannedEndTime"].asString(); if(!dataNodeTimerInfostimerInfosItem["PlannedTime"].isNull()) timerInfosItemObject.plannedTime = dataNodeTimerInfostimerInfosItem["PlannedTime"].asString(); - if(!dataNodeTimerInfostimerInfosItem["DbClusterDescription"].isNull()) - timerInfosItemObject.dbClusterDescription = dataNodeTimerInfostimerInfosItem["DbClusterDescription"].asString(); - if(!dataNodeTimerInfostimerInfosItem["PlannedStartTime"].isNull()) - timerInfosItemObject.plannedStartTime = dataNodeTimerInfostimerInfosItem["PlannedStartTime"].asString(); if(!dataNodeTimerInfostimerInfosItem["DBClusterId"].isNull()) timerInfosItemObject.dBClusterId = dataNodeTimerInfostimerInfosItem["DBClusterId"].asString(); if(!dataNodeTimerInfostimerInfosItem["Region"].isNull()) timerInfosItemObject.region = dataNodeTimerInfostimerInfosItem["Region"].asString(); + if(!dataNodeTimerInfostimerInfosItem["PlannedStartTime"].isNull()) + timerInfosItemObject.plannedStartTime = dataNodeTimerInfostimerInfosItem["PlannedStartTime"].asString(); + if(!dataNodeTimerInfostimerInfosItem["TaskId"].isNull()) + timerInfosItemObject.taskId = dataNodeTimerInfostimerInfosItem["TaskId"].asString(); if(!dataNodeTimerInfostimerInfosItem["OrderId"].isNull()) timerInfosItemObject.orderId = dataNodeTimerInfostimerInfosItem["OrderId"].asString(); - if(!dataNodeTimerInfostimerInfosItem["PlannedEndTime"].isNull()) - timerInfosItemObject.plannedEndTime = dataNodeTimerInfostimerInfosItem["PlannedEndTime"].asString(); if(!dataNodeTimerInfostimerInfosItem["DbClusterStatus"].isNull()) timerInfosItemObject.dbClusterStatus = dataNodeTimerInfostimerInfosItem["DbClusterStatus"].asString(); + if(!dataNodeTimerInfostimerInfosItem["DbClusterDescription"].isNull()) + timerInfosItemObject.dbClusterDescription = dataNodeTimerInfostimerInfosItem["DbClusterDescription"].asString(); data_.timerInfos.push_back(timerInfosItemObject); } if(!value["Message"].isNull()) diff --git a/polardb/src/model/TempModifyDBNodeRequest.cc b/polardb/src/model/TempModifyDBNodeRequest.cc new file mode 100644 index 000000000..0dd0e2759 --- /dev/null +++ b/polardb/src/model/TempModifyDBNodeRequest.cc @@ -0,0 +1,155 @@ +/* + * 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::Polardb::Model::TempModifyDBNodeRequest; + +TempModifyDBNodeRequest::TempModifyDBNodeRequest() : + RpcServiceRequest("polardb", "2017-08-01", "TempModifyDBNode") +{ + setMethod(HttpRequest::Method::Post); +} + +TempModifyDBNodeRequest::~TempModifyDBNodeRequest() +{} + +long TempModifyDBNodeRequest::getResourceOwnerId()const +{ + return resourceOwnerId_; +} + +void TempModifyDBNodeRequest::setResourceOwnerId(long resourceOwnerId) +{ + resourceOwnerId_ = resourceOwnerId; + setParameter("ResourceOwnerId", std::to_string(resourceOwnerId)); +} + +std::string TempModifyDBNodeRequest::getClientToken()const +{ + return clientToken_; +} + +void TempModifyDBNodeRequest::setClientToken(const std::string& clientToken) +{ + clientToken_ = clientToken; + setParameter("ClientToken", clientToken); +} + +std::string TempModifyDBNodeRequest::getAccessKeyId()const +{ + return accessKeyId_; +} + +void TempModifyDBNodeRequest::setAccessKeyId(const std::string& accessKeyId) +{ + accessKeyId_ = accessKeyId; + setParameter("AccessKeyId", accessKeyId); +} + +std::string TempModifyDBNodeRequest::getRestoreTime()const +{ + return restoreTime_; +} + +void TempModifyDBNodeRequest::setRestoreTime(const std::string& restoreTime) +{ + restoreTime_ = restoreTime; + setParameter("RestoreTime", restoreTime); +} + +std::string TempModifyDBNodeRequest::getResourceOwnerAccount()const +{ + return resourceOwnerAccount_; +} + +void TempModifyDBNodeRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount) +{ + resourceOwnerAccount_ = resourceOwnerAccount; + setParameter("ResourceOwnerAccount", resourceOwnerAccount); +} + +std::string TempModifyDBNodeRequest::getDBClusterId()const +{ + return dBClusterId_; +} + +void TempModifyDBNodeRequest::setDBClusterId(const std::string& dBClusterId) +{ + dBClusterId_ = dBClusterId; + setParameter("DBClusterId", dBClusterId); +} + +std::string TempModifyDBNodeRequest::getOwnerAccount()const +{ + return ownerAccount_; +} + +void TempModifyDBNodeRequest::setOwnerAccount(const std::string& ownerAccount) +{ + ownerAccount_ = ownerAccount; + setParameter("OwnerAccount", ownerAccount); +} + +std::string TempModifyDBNodeRequest::getOperationType()const +{ + return operationType_; +} + +void TempModifyDBNodeRequest::setOperationType(const std::string& operationType) +{ + operationType_ = operationType; + setParameter("OperationType", operationType); +} + +long TempModifyDBNodeRequest::getOwnerId()const +{ + return ownerId_; +} + +void TempModifyDBNodeRequest::setOwnerId(long ownerId) +{ + ownerId_ = ownerId; + setParameter("OwnerId", std::to_string(ownerId)); +} + +std::string TempModifyDBNodeRequest::getModifyType()const +{ + return modifyType_; +} + +void TempModifyDBNodeRequest::setModifyType(const std::string& modifyType) +{ + modifyType_ = modifyType; + setParameter("ModifyType", modifyType); +} + +std::vector TempModifyDBNodeRequest::getDBNode()const +{ + return dBNode_; +} + +void TempModifyDBNodeRequest::setDBNode(const std::vector& dBNode) +{ + dBNode_ = dBNode; + for(int dep1 = 0; dep1!= dBNode.size(); dep1++) { + auto dBNodeObj = dBNode.at(dep1); + std::string dBNodeObjStr = "DBNode." + std::to_string(dep1 + 1); + setParameter(dBNodeObjStr + ".TargetClass", dBNodeObj.targetClass); + setParameter(dBNodeObjStr + ".ZoneId", dBNodeObj.zoneId); + } +} + diff --git a/polardb/src/model/TempModifyDBNodeResult.cc b/polardb/src/model/TempModifyDBNodeResult.cc new file mode 100644 index 000000000..ffe06f62b --- /dev/null +++ b/polardb/src/model/TempModifyDBNodeResult.cc @@ -0,0 +1,66 @@ +/* + * 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::Polardb; +using namespace AlibabaCloud::Polardb::Model; + +TempModifyDBNodeResult::TempModifyDBNodeResult() : + ServiceResult() +{} + +TempModifyDBNodeResult::TempModifyDBNodeResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +TempModifyDBNodeResult::~TempModifyDBNodeResult() +{} + +void TempModifyDBNodeResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto allDBNodeIds = value["DBNodeIds"]["DBNodeId"]; + for (const auto &item : allDBNodeIds) + dBNodeIds_.push_back(item.asString()); + if(!value["DBClusterId"].isNull()) + dBClusterId_ = value["DBClusterId"].asString(); + if(!value["OrderId"].isNull()) + orderId_ = value["OrderId"].asString(); + +} + +std::vector TempModifyDBNodeResult::getDBNodeIds()const +{ + return dBNodeIds_; +} + +std::string TempModifyDBNodeResult::getDBClusterId()const +{ + return dBClusterId_; +} + +std::string TempModifyDBNodeResult::getOrderId()const +{ + return orderId_; +} +