Generated 2019-09-01 for OceanBasePro.

This commit is contained in:
sdk-team
2025-08-07 07:31:46 +00:00
parent d8723973a4
commit 0b56244443
18 changed files with 405 additions and 11 deletions

View File

@@ -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<const AsyncCallerContext>& 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<std::packaged_task<DescribeMetricsDataV2Outcome()>>(
[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();

View File

@@ -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_;
}

View File

@@ -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())

View File

@@ -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 <alibabacloud/oceanbasepro/model/DescribeMetricsDataV2Request.h>
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);
}

View File

@@ -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 <alibabacloud/oceanbasepro/model/DescribeMetricsDataV2Result.h>
#include <json/json.h>
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::DataItem> DescribeMetricsDataV2Result::getData()const
{
return data_;
}

View File

@@ -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());
}

View File

@@ -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);
}

View File

@@ -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());