From 0b562444434555e10cbc00aeaa7623bc82fff8a6 Mon Sep 17 00:00:00 2001 From: sdk-team Date: Thu, 7 Aug 2025 07:31:46 +0000 Subject: [PATCH] Generated 2019-09-01 for OceanBasePro. --- VERSION | 2 +- oceanbasepro/CMakeLists.txt | 4 + .../oceanbasepro/OceanBaseProClient.h | 8 ++ .../model/CreateBackupSetDownloadLinkResult.h | 8 +- .../model/DescribeInstanceResult.h | 2 +- .../model/DescribeMetricsDataV2Request.h | 69 +++++++++++ .../model/DescribeMetricsDataV2Result.h | 61 +++++++++ .../model/DescribeProxyServiceResult.h | 5 + .../model/DescribeSQLSamplesResult.h | 2 + .../oceanbasepro/model/DescribeTenantResult.h | 4 +- oceanbasepro/src/OceanBaseProClient.cc | 36 ++++++ .../CreateBackupSetDownloadLinkResult.cc | 9 +- .../src/model/DescribeInstanceResult.cc | 2 +- .../src/model/DescribeMetricsDataV2Request.cc | 117 ++++++++++++++++++ .../src/model/DescribeMetricsDataV2Result.cc | 67 ++++++++++ .../src/model/DescribeProxyServiceResult.cc | 10 ++ .../src/model/DescribeSQLSamplesResult.cc | 4 + .../src/model/DescribeTenantResult.cc | 6 +- 18 files changed, 405 insertions(+), 11 deletions(-) create mode 100644 oceanbasepro/include/alibabacloud/oceanbasepro/model/DescribeMetricsDataV2Request.h create mode 100644 oceanbasepro/include/alibabacloud/oceanbasepro/model/DescribeMetricsDataV2Result.h create mode 100644 oceanbasepro/src/model/DescribeMetricsDataV2Request.cc create mode 100644 oceanbasepro/src/model/DescribeMetricsDataV2Result.cc diff --git a/VERSION b/VERSION index 701aa4b57..6df8630ec 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.2096 \ No newline at end of file +1.36.2097 \ No newline at end of file diff --git a/oceanbasepro/CMakeLists.txt b/oceanbasepro/CMakeLists.txt index a0bbbbe8e..ec8f57145 100644 --- a/oceanbasepro/CMakeLists.txt +++ b/oceanbasepro/CMakeLists.txt @@ -125,6 +125,8 @@ set(oceanbasepro_public_header_model include/alibabacloud/oceanbasepro/model/DescribeInstancesResult.h include/alibabacloud/oceanbasepro/model/DescribeMetricsDataRequest.h include/alibabacloud/oceanbasepro/model/DescribeMetricsDataResult.h + include/alibabacloud/oceanbasepro/model/DescribeMetricsDataV2Request.h + include/alibabacloud/oceanbasepro/model/DescribeMetricsDataV2Result.h include/alibabacloud/oceanbasepro/model/DescribeNodeMetricsRequest.h include/alibabacloud/oceanbasepro/model/DescribeNodeMetricsResult.h include/alibabacloud/oceanbasepro/model/DescribeOasAnomalySQLListRequest.h @@ -406,6 +408,8 @@ set(oceanbasepro_src src/model/DescribeInstancesResult.cc src/model/DescribeMetricsDataRequest.cc src/model/DescribeMetricsDataResult.cc + src/model/DescribeMetricsDataV2Request.cc + src/model/DescribeMetricsDataV2Result.cc src/model/DescribeNodeMetricsRequest.cc src/model/DescribeNodeMetricsResult.cc src/model/DescribeOasAnomalySQLListRequest.cc diff --git a/oceanbasepro/include/alibabacloud/oceanbasepro/OceanBaseProClient.h b/oceanbasepro/include/alibabacloud/oceanbasepro/OceanBaseProClient.h index b646d3846..c1870f3b1 100644 --- a/oceanbasepro/include/alibabacloud/oceanbasepro/OceanBaseProClient.h +++ b/oceanbasepro/include/alibabacloud/oceanbasepro/OceanBaseProClient.h @@ -126,6 +126,8 @@ #include "model/DescribeInstancesResult.h" #include "model/DescribeMetricsDataRequest.h" #include "model/DescribeMetricsDataResult.h" +#include "model/DescribeMetricsDataV2Request.h" +#include "model/DescribeMetricsDataV2Result.h" #include "model/DescribeNodeMetricsRequest.h" #include "model/DescribeNodeMetricsResult.h" #include "model/DescribeOasAnomalySQLListRequest.h" @@ -465,6 +467,9 @@ namespace AlibabaCloud typedef Outcome DescribeMetricsDataOutcome; typedef std::future DescribeMetricsDataOutcomeCallable; typedef std::function&)> DescribeMetricsDataAsyncHandler; + typedef Outcome DescribeMetricsDataV2Outcome; + typedef std::future DescribeMetricsDataV2OutcomeCallable; + typedef std::function&)> DescribeMetricsDataV2AsyncHandler; typedef Outcome DescribeNodeMetricsOutcome; typedef std::future DescribeNodeMetricsOutcomeCallable; typedef std::function&)> DescribeNodeMetricsAsyncHandler; @@ -887,6 +892,9 @@ namespace AlibabaCloud DescribeMetricsDataOutcome describeMetricsData(const Model::DescribeMetricsDataRequest &request)const; void describeMetricsDataAsync(const Model::DescribeMetricsDataRequest& request, const DescribeMetricsDataAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; DescribeMetricsDataOutcomeCallable describeMetricsDataCallable(const Model::DescribeMetricsDataRequest& request) const; + DescribeMetricsDataV2Outcome describeMetricsDataV2(const Model::DescribeMetricsDataV2Request &request)const; + void describeMetricsDataV2Async(const Model::DescribeMetricsDataV2Request& request, const DescribeMetricsDataV2AsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + DescribeMetricsDataV2OutcomeCallable describeMetricsDataV2Callable(const Model::DescribeMetricsDataV2Request& request) const; DescribeNodeMetricsOutcome describeNodeMetrics(const Model::DescribeNodeMetricsRequest &request)const; void describeNodeMetricsAsync(const Model::DescribeNodeMetricsRequest& request, const DescribeNodeMetricsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; DescribeNodeMetricsOutcomeCallable describeNodeMetricsCallable(const Model::DescribeNodeMetricsRequest& request) const; diff --git a/oceanbasepro/include/alibabacloud/oceanbasepro/model/CreateBackupSetDownloadLinkResult.h b/oceanbasepro/include/alibabacloud/oceanbasepro/model/CreateBackupSetDownloadLinkResult.h index ff3c6d4d3..c5e26eae0 100644 --- a/oceanbasepro/include/alibabacloud/oceanbasepro/model/CreateBackupSetDownloadLinkResult.h +++ b/oceanbasepro/include/alibabacloud/oceanbasepro/model/CreateBackupSetDownloadLinkResult.h @@ -32,17 +32,21 @@ namespace AlibabaCloud class ALIBABACLOUD_OCEANBASEPRO_EXPORT CreateBackupSetDownloadLinkResult : public ServiceResult { public: + struct Data + { + long downloadTaskId; + }; CreateBackupSetDownloadLinkResult(); explicit CreateBackupSetDownloadLinkResult(const std::string &payload); ~CreateBackupSetDownloadLinkResult(); - long getDownloadTaskId()const; + Data getData()const; protected: void parse(const std::string &payload); private: - long downloadTaskId_; + Data data_; }; } diff --git a/oceanbasepro/include/alibabacloud/oceanbasepro/model/DescribeInstanceResult.h b/oceanbasepro/include/alibabacloud/oceanbasepro/model/DescribeInstanceResult.h index 2235b9d62..47a9efc6d 100644 --- a/oceanbasepro/include/alibabacloud/oceanbasepro/model/DescribeInstanceResult.h +++ b/oceanbasepro/include/alibabacloud/oceanbasepro/model/DescribeInstanceResult.h @@ -151,7 +151,7 @@ namespace AlibabaCloud std::string deployType; std::string proxyServiceStatus; ReadOnlyResource readOnlyResource; - std::string nodeNum; + long nodeNum; bool enableIsolationOptimization; std::string dataMergeTime; std::string specType; diff --git a/oceanbasepro/include/alibabacloud/oceanbasepro/model/DescribeMetricsDataV2Request.h b/oceanbasepro/include/alibabacloud/oceanbasepro/model/DescribeMetricsDataV2Request.h new file mode 100644 index 000000000..0e87d3df8 --- /dev/null +++ b/oceanbasepro/include/alibabacloud/oceanbasepro/model/DescribeMetricsDataV2Request.h @@ -0,0 +1,69 @@ +/* + * 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_OCEANBASEPRO_MODEL_DESCRIBEMETRICSDATAV2REQUEST_H_ +#define ALIBABACLOUD_OCEANBASEPRO_MODEL_DESCRIBEMETRICSDATAV2REQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace OceanBasePro { +namespace Model { +class ALIBABACLOUD_OCEANBASEPRO_EXPORT DescribeMetricsDataV2Request : public RpcServiceRequest { +public: + DescribeMetricsDataV2Request(); + ~DescribeMetricsDataV2Request(); + std::string getGroupByLabels() const; + void setGroupByLabels(const std::string &groupByLabels); + std::string getStartTime() const; + void setStartTime(const std::string &startTime); + std::string getLimit() const; + void setLimit(const std::string &limit); + std::string getSortOrder() const; + void setSortOrder(const std::string &sortOrder); + std::string getSortMetricKey() const; + void setSortMetricKey(const std::string &sortMetricKey); + std::string getReplicaType() const; + void setReplicaType(const std::string &replicaType); + std::string getEndTime() const; + void setEndTime(const std::string &endTime); + std::string getLabels() const; + void setLabels(const std::string &labels); + std::string getInstanceId() const; + void setInstanceId(const std::string &instanceId); + std::string getMetrics() const; + void setMetrics(const std::string &metrics); + +private: + std::string groupByLabels_; + std::string startTime_; + std::string limit_; + std::string sortOrder_; + std::string sortMetricKey_; + std::string replicaType_; + std::string endTime_; + std::string labels_; + std::string instanceId_; + std::string metrics_; +}; +} // namespace Model +} // namespace OceanBasePro +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_OCEANBASEPRO_MODEL_DESCRIBEMETRICSDATAV2REQUEST_H_ diff --git a/oceanbasepro/include/alibabacloud/oceanbasepro/model/DescribeMetricsDataV2Result.h b/oceanbasepro/include/alibabacloud/oceanbasepro/model/DescribeMetricsDataV2Result.h new file mode 100644 index 000000000..439f4abb1 --- /dev/null +++ b/oceanbasepro/include/alibabacloud/oceanbasepro/model/DescribeMetricsDataV2Result.h @@ -0,0 +1,61 @@ +/* + * 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_OCEANBASEPRO_MODEL_DESCRIBEMETRICSDATAV2RESULT_H_ +#define ALIBABACLOUD_OCEANBASEPRO_MODEL_DESCRIBEMETRICSDATAV2RESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace OceanBasePro + { + namespace Model + { + class ALIBABACLOUD_OCEANBASEPRO_EXPORT DescribeMetricsDataV2Result : public ServiceResult + { + public: + struct DataItem + { + struct DataItem2 + { + std::string metricValue; + long timestamp; + }; + std::string labels; + std::vector data1; + }; + + + DescribeMetricsDataV2Result(); + explicit DescribeMetricsDataV2Result(const std::string &payload); + ~DescribeMetricsDataV2Result(); + std::vector getData()const; + + protected: + void parse(const std::string &payload); + private: + std::vector data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_OCEANBASEPRO_MODEL_DESCRIBEMETRICSDATAV2RESULT_H_ \ No newline at end of file diff --git a/oceanbasepro/include/alibabacloud/oceanbasepro/model/DescribeProxyServiceResult.h b/oceanbasepro/include/alibabacloud/oceanbasepro/model/DescribeProxyServiceResult.h index f75628e33..92b3bd6d8 100644 --- a/oceanbasepro/include/alibabacloud/oceanbasepro/model/DescribeProxyServiceResult.h +++ b/oceanbasepro/include/alibabacloud/oceanbasepro/model/DescribeProxyServiceResult.h @@ -38,11 +38,16 @@ namespace AlibabaCloud long currentEndpointNum; std::string zone; long unitNum; + long exclusiveUnitNumLimit; std::string createTime; std::string proxyVersion; std::string proxyClusterId; long unitNumLimit; + long serverNumLimit; + bool allowModifyServerNum; + long sharedUnitNumLimit; long endpointNumQuota; + std::string deployMode; std::string unitSpec; std::string expireTime; std::string proxyServiceVersion; diff --git a/oceanbasepro/include/alibabacloud/oceanbasepro/model/DescribeSQLSamplesResult.h b/oceanbasepro/include/alibabacloud/oceanbasepro/model/DescribeSQLSamplesResult.h index 5d4efe378..020b1054d 100644 --- a/oceanbasepro/include/alibabacloud/oceanbasepro/model/DescribeSQLSamplesResult.h +++ b/oceanbasepro/include/alibabacloud/oceanbasepro/model/DescribeSQLSamplesResult.h @@ -53,7 +53,9 @@ namespace AlibabaCloud long requestId; std::string requestTime; std::string paramsValue; + std::string sqlId; long ssstoreReadRows; + std::string sqlTextShort; double scheduleTime; long obUserId; std::string traceId; diff --git a/oceanbasepro/include/alibabacloud/oceanbasepro/model/DescribeTenantResult.h b/oceanbasepro/include/alibabacloud/oceanbasepro/model/DescribeTenantResult.h index d32ce9732..d59e27d8e 100644 --- a/oceanbasepro/include/alibabacloud/oceanbasepro/model/DescribeTenantResult.h +++ b/oceanbasepro/include/alibabacloud/oceanbasepro/model/DescribeTenantResult.h @@ -119,6 +119,7 @@ namespace AlibabaCloud std::string proxyClusterId; int intranetPort; long parallelQueryDegree; + std::string intranetAddressServiceType; int internetSqlPort; int internetRpcPort; std::string connectionReplicaType; @@ -131,6 +132,7 @@ namespace AlibabaCloud long internetMaxConnectionLimit; int intranetRpcPort; std::string odpVersion; + std::string internetAddressServiceType; std::string intranetAddress; std::string vpcId; std::vector connectionLogicalZones; @@ -193,7 +195,7 @@ namespace AlibabaCloud std::string timeZone; TenantResource tenantResource; std::string vpcId; - std::string tenantMaxConnections; + long tenantMaxConnections; }; diff --git a/oceanbasepro/src/OceanBaseProClient.cc b/oceanbasepro/src/OceanBaseProClient.cc index f2c4d45f3..5ef3ae381 100644 --- a/oceanbasepro/src/OceanBaseProClient.cc +++ b/oceanbasepro/src/OceanBaseProClient.cc @@ -1923,6 +1923,42 @@ OceanBaseProClient::DescribeMetricsDataOutcomeCallable OceanBaseProClient::descr return task->get_future(); } +OceanBaseProClient::DescribeMetricsDataV2Outcome OceanBaseProClient::describeMetricsDataV2(const DescribeMetricsDataV2Request &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return DescribeMetricsDataV2Outcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return DescribeMetricsDataV2Outcome(DescribeMetricsDataV2Result(outcome.result())); + else + return DescribeMetricsDataV2Outcome(outcome.error()); +} + +void OceanBaseProClient::describeMetricsDataV2Async(const DescribeMetricsDataV2Request& request, const DescribeMetricsDataV2AsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, describeMetricsDataV2(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +OceanBaseProClient::DescribeMetricsDataV2OutcomeCallable OceanBaseProClient::describeMetricsDataV2Callable(const DescribeMetricsDataV2Request &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->describeMetricsDataV2(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + OceanBaseProClient::DescribeNodeMetricsOutcome OceanBaseProClient::describeNodeMetrics(const DescribeNodeMetricsRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/oceanbasepro/src/model/CreateBackupSetDownloadLinkResult.cc b/oceanbasepro/src/model/CreateBackupSetDownloadLinkResult.cc index bb1c832d4..634d64ddb 100644 --- a/oceanbasepro/src/model/CreateBackupSetDownloadLinkResult.cc +++ b/oceanbasepro/src/model/CreateBackupSetDownloadLinkResult.cc @@ -39,13 +39,14 @@ void CreateBackupSetDownloadLinkResult::parse(const std::string &payload) Json::Value value; reader.parse(payload, value); setRequestId(value["RequestId"].asString()); - if(!value["DownloadTaskId"].isNull()) - downloadTaskId_ = std::stol(value["DownloadTaskId"].asString()); + auto dataNode = value["Data"]; + if(!dataNode["DownloadTaskId"].isNull()) + data_.downloadTaskId = std::stol(dataNode["DownloadTaskId"].asString()); } -long CreateBackupSetDownloadLinkResult::getDownloadTaskId()const +CreateBackupSetDownloadLinkResult::Data CreateBackupSetDownloadLinkResult::getData()const { - return downloadTaskId_; + return data_; } diff --git a/oceanbasepro/src/model/DescribeInstanceResult.cc b/oceanbasepro/src/model/DescribeInstanceResult.cc index 980fd2719..758b17429 100644 --- a/oceanbasepro/src/model/DescribeInstanceResult.cc +++ b/oceanbasepro/src/model/DescribeInstanceResult.cc @@ -83,7 +83,7 @@ void DescribeInstanceResult::parse(const std::string &payload) if(!instanceNode["InstanceRole"].isNull()) instance_.instanceRole = instanceNode["InstanceRole"].asString(); if(!instanceNode["NodeNum"].isNull()) - instance_.nodeNum = instanceNode["NodeNum"].asString(); + instance_.nodeNum = std::stol(instanceNode["NodeNum"].asString()); if(!instanceNode["ReplicaMode"].isNull()) instance_.replicaMode = instanceNode["ReplicaMode"].asString(); if(!instanceNode["IsolationOptimization"].isNull()) diff --git a/oceanbasepro/src/model/DescribeMetricsDataV2Request.cc b/oceanbasepro/src/model/DescribeMetricsDataV2Request.cc new file mode 100644 index 000000000..8f010ebb5 --- /dev/null +++ b/oceanbasepro/src/model/DescribeMetricsDataV2Request.cc @@ -0,0 +1,117 @@ +/* + * 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::OceanBasePro::Model::DescribeMetricsDataV2Request; + +DescribeMetricsDataV2Request::DescribeMetricsDataV2Request() + : RpcServiceRequest("oceanbasepro", "2019-09-01", "DescribeMetricsDataV2") { + setMethod(HttpRequest::Method::Post); +} + +DescribeMetricsDataV2Request::~DescribeMetricsDataV2Request() {} + +std::string DescribeMetricsDataV2Request::getGroupByLabels() const { + return groupByLabels_; +} + +void DescribeMetricsDataV2Request::setGroupByLabels(const std::string &groupByLabels) { + groupByLabels_ = groupByLabels; + setBodyParameter(std::string("GroupByLabels"), groupByLabels); +} + +std::string DescribeMetricsDataV2Request::getStartTime() const { + return startTime_; +} + +void DescribeMetricsDataV2Request::setStartTime(const std::string &startTime) { + startTime_ = startTime; + setBodyParameter(std::string("StartTime"), startTime); +} + +std::string DescribeMetricsDataV2Request::getLimit() const { + return limit_; +} + +void DescribeMetricsDataV2Request::setLimit(const std::string &limit) { + limit_ = limit; + setBodyParameter(std::string("Limit"), limit); +} + +std::string DescribeMetricsDataV2Request::getSortOrder() const { + return sortOrder_; +} + +void DescribeMetricsDataV2Request::setSortOrder(const std::string &sortOrder) { + sortOrder_ = sortOrder; + setBodyParameter(std::string("SortOrder"), sortOrder); +} + +std::string DescribeMetricsDataV2Request::getSortMetricKey() const { + return sortMetricKey_; +} + +void DescribeMetricsDataV2Request::setSortMetricKey(const std::string &sortMetricKey) { + sortMetricKey_ = sortMetricKey; + setBodyParameter(std::string("SortMetricKey"), sortMetricKey); +} + +std::string DescribeMetricsDataV2Request::getReplicaType() const { + return replicaType_; +} + +void DescribeMetricsDataV2Request::setReplicaType(const std::string &replicaType) { + replicaType_ = replicaType; + setBodyParameter(std::string("ReplicaType"), replicaType); +} + +std::string DescribeMetricsDataV2Request::getEndTime() const { + return endTime_; +} + +void DescribeMetricsDataV2Request::setEndTime(const std::string &endTime) { + endTime_ = endTime; + setBodyParameter(std::string("EndTime"), endTime); +} + +std::string DescribeMetricsDataV2Request::getLabels() const { + return labels_; +} + +void DescribeMetricsDataV2Request::setLabels(const std::string &labels) { + labels_ = labels; + setBodyParameter(std::string("Labels"), labels); +} + +std::string DescribeMetricsDataV2Request::getInstanceId() const { + return instanceId_; +} + +void DescribeMetricsDataV2Request::setInstanceId(const std::string &instanceId) { + instanceId_ = instanceId; + setBodyParameter(std::string("InstanceId"), instanceId); +} + +std::string DescribeMetricsDataV2Request::getMetrics() const { + return metrics_; +} + +void DescribeMetricsDataV2Request::setMetrics(const std::string &metrics) { + metrics_ = metrics; + setBodyParameter(std::string("Metrics"), metrics); +} + diff --git a/oceanbasepro/src/model/DescribeMetricsDataV2Result.cc b/oceanbasepro/src/model/DescribeMetricsDataV2Result.cc new file mode 100644 index 000000000..0fcef1918 --- /dev/null +++ b/oceanbasepro/src/model/DescribeMetricsDataV2Result.cc @@ -0,0 +1,67 @@ +/* + * 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::OceanBasePro; +using namespace AlibabaCloud::OceanBasePro::Model; + +DescribeMetricsDataV2Result::DescribeMetricsDataV2Result() : + ServiceResult() +{} + +DescribeMetricsDataV2Result::DescribeMetricsDataV2Result(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +DescribeMetricsDataV2Result::~DescribeMetricsDataV2Result() +{} + +void DescribeMetricsDataV2Result::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto allDataNode = value["Data"]["DataItem"]; + for (auto valueDataDataItem : allDataNode) + { + DataItem dataObject; + if(!valueDataDataItem["Labels"].isNull()) + dataObject.labels = valueDataDataItem["Labels"].asString(); + auto allData1Node = valueDataDataItem["Data"]["DataItem"]; + for (auto valueDataDataItemDataDataItem : allData1Node) + { + DataItem::DataItem2 data1Object; + if(!valueDataDataItemDataDataItem["MetricValue"].isNull()) + data1Object.metricValue = valueDataDataItemDataDataItem["MetricValue"].asString(); + if(!valueDataDataItemDataDataItem["Timestamp"].isNull()) + data1Object.timestamp = std::stol(valueDataDataItemDataDataItem["Timestamp"].asString()); + dataObject.data1.push_back(data1Object); + } + data_.push_back(dataObject); + } + +} + +std::vector DescribeMetricsDataV2Result::getData()const +{ + return data_; +} + diff --git a/oceanbasepro/src/model/DescribeProxyServiceResult.cc b/oceanbasepro/src/model/DescribeProxyServiceResult.cc index c71865935..affb81a74 100644 --- a/oceanbasepro/src/model/DescribeProxyServiceResult.cc +++ b/oceanbasepro/src/model/DescribeProxyServiceResult.cc @@ -66,6 +66,16 @@ void DescribeProxyServiceResult::parse(const std::string &payload) data_.unitNumLimit = std::stol(dataNode["UnitNumLimit"].asString()); if(!dataNode["ProxyVersion"].isNull()) data_.proxyVersion = dataNode["ProxyVersion"].asString(); + if(!dataNode["DeployMode"].isNull()) + data_.deployMode = dataNode["DeployMode"].asString(); + if(!dataNode["ServerNumLimit"].isNull()) + data_.serverNumLimit = std::stol(dataNode["ServerNumLimit"].asString()); + if(!dataNode["AllowModifyServerNum"].isNull()) + data_.allowModifyServerNum = dataNode["AllowModifyServerNum"].asString() == "true"; + if(!dataNode["SharedUnitNumLimit"].isNull()) + data_.sharedUnitNumLimit = std::stol(dataNode["SharedUnitNumLimit"].asString()); + if(!dataNode["ExclusiveUnitNumLimit"].isNull()) + data_.exclusiveUnitNumLimit = std::stol(dataNode["ExclusiveUnitNumLimit"].asString()); } diff --git a/oceanbasepro/src/model/DescribeSQLSamplesResult.cc b/oceanbasepro/src/model/DescribeSQLSamplesResult.cc index 416a53c67..07512df75 100644 --- a/oceanbasepro/src/model/DescribeSQLSamplesResult.cc +++ b/oceanbasepro/src/model/DescribeSQLSamplesResult.cc @@ -151,6 +151,10 @@ void DescribeSQLSamplesResult::parse(const std::string &payload) dataObject.sqlText = valueDataDataItem["SqlText"].asString(); if(!valueDataDataItem["ParamsValue"].isNull()) dataObject.paramsValue = valueDataDataItem["ParamsValue"].asString(); + if(!valueDataDataItem["SqlId"].isNull()) + dataObject.sqlId = valueDataDataItem["SqlId"].asString(); + if(!valueDataDataItem["SqlTextShort"].isNull()) + dataObject.sqlTextShort = valueDataDataItem["SqlTextShort"].asString(); data_.push_back(dataObject); } diff --git a/oceanbasepro/src/model/DescribeTenantResult.cc b/oceanbasepro/src/model/DescribeTenantResult.cc index 710bff0fb..ceadafb0d 100644 --- a/oceanbasepro/src/model/DescribeTenantResult.cc +++ b/oceanbasepro/src/model/DescribeTenantResult.cc @@ -105,7 +105,7 @@ void DescribeTenantResult::parse(const std::string &payload) if(!tenantNode["OdpVersion"].isNull()) tenant_.odpVersion = tenantNode["OdpVersion"].asString(); if(!tenantNode["TenantMaxConnections"].isNull()) - tenant_.tenantMaxConnections = tenantNode["TenantMaxConnections"].asString(); + tenant_.tenantMaxConnections = std::stol(tenantNode["TenantMaxConnections"].asString()); if(!tenantNode["ParameterTemplate"].isNull()) tenant_.parameterTemplate = tenantNode["ParameterTemplate"].asString(); if(!tenantNode["Iops"].isNull()) @@ -166,6 +166,10 @@ void DescribeTenantResult::parse(const std::string &payload) tenantConnectionsItemObject.odpVersion = tenantNodeTenantConnectionsTenantConnectionsItem["OdpVersion"].asString(); if(!tenantNodeTenantConnectionsTenantConnectionsItem["InternetSqlPort"].isNull()) tenantConnectionsItemObject.internetSqlPort = std::stoi(tenantNodeTenantConnectionsTenantConnectionsItem["InternetSqlPort"].asString()); + if(!tenantNodeTenantConnectionsTenantConnectionsItem["InternetAddressServiceType"].isNull()) + tenantConnectionsItemObject.internetAddressServiceType = tenantNodeTenantConnectionsTenantConnectionsItem["InternetAddressServiceType"].asString(); + if(!tenantNodeTenantConnectionsTenantConnectionsItem["IntranetAddressServiceType"].isNull()) + tenantConnectionsItemObject.intranetAddressServiceType = tenantNodeTenantConnectionsTenantConnectionsItem["IntranetAddressServiceType"].asString(); auto allConnectionZones = value["ConnectionZones"]["ConnectionZones"]; for (auto value : allConnectionZones) tenantConnectionsItemObject.connectionZones.push_back(value.asString());