Add DescribeDBClusterSSL.

This commit is contained in:
sdk-team
2020-02-15 10:05:15 +08:00
parent e2dc1dc7ef
commit b2ee54bbfa
13 changed files with 673 additions and 1 deletions

View File

@@ -987,6 +987,42 @@ PolardbClient::DescribeDBClusterPerformanceOutcomeCallable PolardbClient::descri
return task->get_future();
}
PolardbClient::DescribeDBClusterSSLOutcome PolardbClient::describeDBClusterSSL(const DescribeDBClusterSSLRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DescribeDBClusterSSLOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DescribeDBClusterSSLOutcome(DescribeDBClusterSSLResult(outcome.result()));
else
return DescribeDBClusterSSLOutcome(outcome.error());
}
void PolardbClient::describeDBClusterSSLAsync(const DescribeDBClusterSSLRequest& request, const DescribeDBClusterSSLAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, describeDBClusterSSL(request), context);
};
asyncExecute(new Runnable(fn));
}
PolardbClient::DescribeDBClusterSSLOutcomeCallable PolardbClient::describeDBClusterSSLCallable(const DescribeDBClusterSSLRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DescribeDBClusterSSLOutcome()>>(
[this, request]()
{
return this->describeDBClusterSSL(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
PolardbClient::DescribeDBClustersOutcome PolardbClient::describeDBClusters(const DescribeDBClustersRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -1671,6 +1707,42 @@ PolardbClient::ModifyDBClusterParametersOutcomeCallable PolardbClient::modifyDBC
return task->get_future();
}
PolardbClient::ModifyDBClusterSSLOutcome PolardbClient::modifyDBClusterSSL(const ModifyDBClusterSSLRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ModifyDBClusterSSLOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ModifyDBClusterSSLOutcome(ModifyDBClusterSSLResult(outcome.result()));
else
return ModifyDBClusterSSLOutcome(outcome.error());
}
void PolardbClient::modifyDBClusterSSLAsync(const ModifyDBClusterSSLRequest& request, const ModifyDBClusterSSLAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, modifyDBClusterSSL(request), context);
};
asyncExecute(new Runnable(fn));
}
PolardbClient::ModifyDBClusterSSLOutcomeCallable PolardbClient::modifyDBClusterSSLCallable(const ModifyDBClusterSSLRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ModifyDBClusterSSLOutcome()>>(
[this, request]()
{
return this->modifyDBClusterSSL(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
PolardbClient::ModifyDBDescriptionOutcome PolardbClient::modifyDBDescription(const ModifyDBDescriptionRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -0,0 +1,95 @@
/*
* 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/DescribeDBClusterSSLRequest.h>
using AlibabaCloud::Polardb::Model::DescribeDBClusterSSLRequest;
DescribeDBClusterSSLRequest::DescribeDBClusterSSLRequest() :
RpcServiceRequest("polardb", "2017-08-01", "DescribeDBClusterSSL")
{
setMethod(HttpRequest::Method::Post);
}
DescribeDBClusterSSLRequest::~DescribeDBClusterSSLRequest()
{}
long DescribeDBClusterSSLRequest::getResourceOwnerId()const
{
return resourceOwnerId_;
}
void DescribeDBClusterSSLRequest::setResourceOwnerId(long resourceOwnerId)
{
resourceOwnerId_ = resourceOwnerId;
setParameter("ResourceOwnerId", std::to_string(resourceOwnerId));
}
std::string DescribeDBClusterSSLRequest::getAccessKeyId()const
{
return accessKeyId_;
}
void DescribeDBClusterSSLRequest::setAccessKeyId(const std::string& accessKeyId)
{
accessKeyId_ = accessKeyId;
setParameter("AccessKeyId", accessKeyId);
}
std::string DescribeDBClusterSSLRequest::getResourceOwnerAccount()const
{
return resourceOwnerAccount_;
}
void DescribeDBClusterSSLRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount)
{
resourceOwnerAccount_ = resourceOwnerAccount;
setParameter("ResourceOwnerAccount", resourceOwnerAccount);
}
std::string DescribeDBClusterSSLRequest::getDBClusterId()const
{
return dBClusterId_;
}
void DescribeDBClusterSSLRequest::setDBClusterId(const std::string& dBClusterId)
{
dBClusterId_ = dBClusterId;
setParameter("DBClusterId", dBClusterId);
}
std::string DescribeDBClusterSSLRequest::getOwnerAccount()const
{
return ownerAccount_;
}
void DescribeDBClusterSSLRequest::setOwnerAccount(const std::string& ownerAccount)
{
ownerAccount_ = ownerAccount;
setParameter("OwnerAccount", ownerAccount);
}
long DescribeDBClusterSSLRequest::getOwnerId()const
{
return ownerId_;
}
void DescribeDBClusterSSLRequest::setOwnerId(long ownerId)
{
ownerId_ = ownerId;
setParameter("OwnerId", std::to_string(ownerId));
}

View File

@@ -0,0 +1,63 @@
/*
* 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/DescribeDBClusterSSLResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Polardb;
using namespace AlibabaCloud::Polardb::Model;
DescribeDBClusterSSLResult::DescribeDBClusterSSLResult() :
ServiceResult()
{}
DescribeDBClusterSSLResult::DescribeDBClusterSSLResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DescribeDBClusterSSLResult::~DescribeDBClusterSSLResult()
{}
void DescribeDBClusterSSLResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allItemsNode = value["Items"]["Item"];
for (auto valueItemsItem : allItemsNode)
{
Item itemsObject;
if(!valueItemsItem["DBEndpointId"].isNull())
itemsObject.dBEndpointId = valueItemsItem["DBEndpointId"].asString();
if(!valueItemsItem["SSLEnabled"].isNull())
itemsObject.sSLEnabled = valueItemsItem["SSLEnabled"].asString();
if(!valueItemsItem["SSLConnectionString"].isNull())
itemsObject.sSLConnectionString = valueItemsItem["SSLConnectionString"].asString();
if(!valueItemsItem["SSLExpireTime"].isNull())
itemsObject.sSLExpireTime = valueItemsItem["SSLExpireTime"].asString();
items_.push_back(itemsObject);
}
}
std::vector<DescribeDBClusterSSLResult::Item> DescribeDBClusterSSLResult::getItems()const
{
return items_;
}

View File

@@ -0,0 +1,128 @@
/*
* 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/ModifyDBClusterSSLRequest.h>
using AlibabaCloud::Polardb::Model::ModifyDBClusterSSLRequest;
ModifyDBClusterSSLRequest::ModifyDBClusterSSLRequest() :
RpcServiceRequest("polardb", "2017-08-01", "ModifyDBClusterSSL")
{
setMethod(HttpRequest::Method::Post);
}
ModifyDBClusterSSLRequest::~ModifyDBClusterSSLRequest()
{}
long ModifyDBClusterSSLRequest::getResourceOwnerId()const
{
return resourceOwnerId_;
}
void ModifyDBClusterSSLRequest::setResourceOwnerId(long resourceOwnerId)
{
resourceOwnerId_ = resourceOwnerId;
setParameter("ResourceOwnerId", std::to_string(resourceOwnerId));
}
std::string ModifyDBClusterSSLRequest::getDBEndpointId()const
{
return dBEndpointId_;
}
void ModifyDBClusterSSLRequest::setDBEndpointId(const std::string& dBEndpointId)
{
dBEndpointId_ = dBEndpointId;
setParameter("DBEndpointId", dBEndpointId);
}
std::string ModifyDBClusterSSLRequest::getAccessKeyId()const
{
return accessKeyId_;
}
void ModifyDBClusterSSLRequest::setAccessKeyId(const std::string& accessKeyId)
{
accessKeyId_ = accessKeyId;
setParameter("AccessKeyId", accessKeyId);
}
std::string ModifyDBClusterSSLRequest::getResourceOwnerAccount()const
{
return resourceOwnerAccount_;
}
void ModifyDBClusterSSLRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount)
{
resourceOwnerAccount_ = resourceOwnerAccount;
setParameter("ResourceOwnerAccount", resourceOwnerAccount);
}
std::string ModifyDBClusterSSLRequest::getDBClusterId()const
{
return dBClusterId_;
}
void ModifyDBClusterSSLRequest::setDBClusterId(const std::string& dBClusterId)
{
dBClusterId_ = dBClusterId;
setParameter("DBClusterId", dBClusterId);
}
std::string ModifyDBClusterSSLRequest::getOwnerAccount()const
{
return ownerAccount_;
}
void ModifyDBClusterSSLRequest::setOwnerAccount(const std::string& ownerAccount)
{
ownerAccount_ = ownerAccount;
setParameter("OwnerAccount", ownerAccount);
}
long ModifyDBClusterSSLRequest::getOwnerId()const
{
return ownerId_;
}
void ModifyDBClusterSSLRequest::setOwnerId(long ownerId)
{
ownerId_ = ownerId;
setParameter("OwnerId", std::to_string(ownerId));
}
std::string ModifyDBClusterSSLRequest::getNetType()const
{
return netType_;
}
void ModifyDBClusterSSLRequest::setNetType(const std::string& netType)
{
netType_ = netType;
setParameter("NetType", netType);
}
std::string ModifyDBClusterSSLRequest::getSSLEnabled()const
{
return sSLEnabled_;
}
void ModifyDBClusterSSLRequest::setSSLEnabled(const std::string& sSLEnabled)
{
sSLEnabled_ = sSLEnabled;
setParameter("SSLEnabled", sSLEnabled);
}

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/ModifyDBClusterSSLResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Polardb;
using namespace AlibabaCloud::Polardb::Model;
ModifyDBClusterSSLResult::ModifyDBClusterSSLResult() :
ServiceResult()
{}
ModifyDBClusterSSLResult::ModifyDBClusterSSLResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ModifyDBClusterSSLResult::~ModifyDBClusterSSLResult()
{}
void ModifyDBClusterSSLResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
}