Support RefreshProxyLevel.

This commit is contained in:
sdk-team
2022-02-22 07:29:13 +00:00
parent 213faf8f4f
commit 5dbd88a76d
11 changed files with 376 additions and 4 deletions

View File

@@ -31,21 +31,21 @@ PolardbClient::PolardbClient(const Credentials &credentials, const ClientConfigu
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
{
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "polardb");
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
}
PolardbClient::PolardbClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
{
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "polardb");
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
}
PolardbClient::PolardbClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
{
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "polardb");
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
}
PolardbClient::~PolardbClient()
@@ -3507,6 +3507,42 @@ PolardbClient::ModifyPendingMaintenanceActionOutcomeCallable PolardbClient::modi
return task->get_future();
}
PolardbClient::RefreshProxyLevelOutcome PolardbClient::refreshProxyLevel(const RefreshProxyLevelRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return RefreshProxyLevelOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return RefreshProxyLevelOutcome(RefreshProxyLevelResult(outcome.result()));
else
return RefreshProxyLevelOutcome(outcome.error());
}
void PolardbClient::refreshProxyLevelAsync(const RefreshProxyLevelRequest& request, const RefreshProxyLevelAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, refreshProxyLevel(request), context);
};
asyncExecute(new Runnable(fn));
}
PolardbClient::RefreshProxyLevelOutcomeCallable PolardbClient::refreshProxyLevelCallable(const RefreshProxyLevelRequest &request) const
{
auto task = std::make_shared<std::packaged_task<RefreshProxyLevelOutcome()>>(
[this, request]()
{
return this->refreshProxyLevel(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
PolardbClient::RemoveDBClusterFromGDNOutcome PolardbClient::removeDBClusterFromGDN(const RemoveDBClusterFromGDNRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -148,3 +148,14 @@ void ModifyDBNodeClassRequest::setModifyType(const std::string& modifyType)
setParameter("ModifyType", modifyType);
}
std::string ModifyDBNodeClassRequest::getSubCategory()const
{
return subCategory_;
}
void ModifyDBNodeClassRequest::setSubCategory(const std::string& subCategory)
{
subCategory_ = subCategory;
setParameter("SubCategory", subCategory);
}

View File

@@ -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 <alibabacloud/polardb/model/RefreshProxyLevelRequest.h>
using AlibabaCloud::Polardb::Model::RefreshProxyLevelRequest;
RefreshProxyLevelRequest::RefreshProxyLevelRequest() :
RpcServiceRequest("polardb", "2017-08-01", "RefreshProxyLevel")
{
setMethod(HttpRequest::Method::Post);
}
RefreshProxyLevelRequest::~RefreshProxyLevelRequest()
{}
long RefreshProxyLevelRequest::getResourceOwnerId()const
{
return resourceOwnerId_;
}
void RefreshProxyLevelRequest::setResourceOwnerId(long resourceOwnerId)
{
resourceOwnerId_ = resourceOwnerId;
setParameter("ResourceOwnerId", std::to_string(resourceOwnerId));
}
std::string RefreshProxyLevelRequest::getPlannedEndTime()const
{
return plannedEndTime_;
}
void RefreshProxyLevelRequest::setPlannedEndTime(const std::string& plannedEndTime)
{
plannedEndTime_ = plannedEndTime;
setParameter("PlannedEndTime", plannedEndTime);
}
std::string RefreshProxyLevelRequest::getAccessKeyId()const
{
return accessKeyId_;
}
void RefreshProxyLevelRequest::setAccessKeyId(const std::string& accessKeyId)
{
accessKeyId_ = accessKeyId;
setParameter("AccessKeyId", accessKeyId);
}
std::string RefreshProxyLevelRequest::getProxyTargetClass()const
{
return proxyTargetClass_;
}
void RefreshProxyLevelRequest::setProxyTargetClass(const std::string& proxyTargetClass)
{
proxyTargetClass_ = proxyTargetClass;
setParameter("ProxyTargetClass", proxyTargetClass);
}
std::string RefreshProxyLevelRequest::getResourceOwnerAccount()const
{
return resourceOwnerAccount_;
}
void RefreshProxyLevelRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount)
{
resourceOwnerAccount_ = resourceOwnerAccount;
setParameter("ResourceOwnerAccount", resourceOwnerAccount);
}
std::string RefreshProxyLevelRequest::getDBClusterId()const
{
return dBClusterId_;
}
void RefreshProxyLevelRequest::setDBClusterId(const std::string& dBClusterId)
{
dBClusterId_ = dBClusterId;
setParameter("DBClusterId", dBClusterId);
}
std::string RefreshProxyLevelRequest::getOwnerAccount()const
{
return ownerAccount_;
}
void RefreshProxyLevelRequest::setOwnerAccount(const std::string& ownerAccount)
{
ownerAccount_ = ownerAccount;
setParameter("OwnerAccount", ownerAccount);
}
long RefreshProxyLevelRequest::getOwnerId()const
{
return ownerId_;
}
void RefreshProxyLevelRequest::setOwnerId(long ownerId)
{
ownerId_ = ownerId;
setParameter("OwnerId", std::to_string(ownerId));
}
std::string RefreshProxyLevelRequest::getPlannedStartTime()const
{
return plannedStartTime_;
}
void RefreshProxyLevelRequest::setPlannedStartTime(const std::string& plannedStartTime)
{
plannedStartTime_ = plannedStartTime;
setParameter("PlannedStartTime", plannedStartTime);
}
bool RefreshProxyLevelRequest::getFromTimeService()const
{
return fromTimeService_;
}
void RefreshProxyLevelRequest::setFromTimeService(bool fromTimeService)
{
fromTimeService_ = fromTimeService;
setParameter("FromTimeService", fromTimeService ? "true" : "false");
}

View File

@@ -0,0 +1,44 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/polardb/model/RefreshProxyLevelResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Polardb;
using namespace AlibabaCloud::Polardb::Model;
RefreshProxyLevelResult::RefreshProxyLevelResult() :
ServiceResult()
{}
RefreshProxyLevelResult::RefreshProxyLevelResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
RefreshProxyLevelResult::~RefreshProxyLevelResult()
{}
void RefreshProxyLevelResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
}