Support new feature.
This commit is contained in:
@@ -2319,6 +2319,42 @@ PolardbClient::DescribeDBProxyPerformanceOutcomeCallable PolardbClient::describe
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
PolardbClient::DescribeDasConfigOutcome PolardbClient::describeDasConfig(const DescribeDasConfigRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DescribeDasConfigOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DescribeDasConfigOutcome(DescribeDasConfigResult(outcome.result()));
|
||||
else
|
||||
return DescribeDasConfigOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void PolardbClient::describeDasConfigAsync(const DescribeDasConfigRequest& request, const DescribeDasConfigAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, describeDasConfig(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
PolardbClient::DescribeDasConfigOutcomeCallable PolardbClient::describeDasConfigCallable(const DescribeDasConfigRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DescribeDasConfigOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->describeDasConfig(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
PolardbClient::DescribeDatabasesOutcome PolardbClient::describeDatabases(const DescribeDatabasesRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
@@ -88,6 +88,15 @@ void CreateAccountRequest::setAccountName(const std::string &accountName) {
|
||||
setParameter(std::string("AccountName"), accountName);
|
||||
}
|
||||
|
||||
std::string CreateAccountRequest::getTairAccountPassword() const {
|
||||
return tairAccountPassword_;
|
||||
}
|
||||
|
||||
void CreateAccountRequest::setTairAccountPassword(const std::string &tairAccountPassword) {
|
||||
tairAccountPassword_ = tairAccountPassword;
|
||||
setParameter(std::string("TairAccountPassword"), tairAccountPassword);
|
||||
}
|
||||
|
||||
std::string CreateAccountRequest::getResourceOwnerAccount() const {
|
||||
return resourceOwnerAccount_;
|
||||
}
|
||||
|
||||
@@ -201,11 +201,11 @@ void CreateDBClusterRequest::setDBMinorVersion(const std::string &dBMinorVersion
|
||||
setParameter(std::string("DBMinorVersion"), dBMinorVersion);
|
||||
}
|
||||
|
||||
int CreateDBClusterRequest::getProvisionedIops() const {
|
||||
long CreateDBClusterRequest::getProvisionedIops() const {
|
||||
return provisionedIops_;
|
||||
}
|
||||
|
||||
void CreateDBClusterRequest::setProvisionedIops(int provisionedIops) {
|
||||
void CreateDBClusterRequest::setProvisionedIops(long provisionedIops) {
|
||||
provisionedIops_ = provisionedIops;
|
||||
setParameter(std::string("ProvisionedIops"), std::to_string(provisionedIops));
|
||||
}
|
||||
|
||||
@@ -59,6 +59,8 @@ void DescribeAccountsResult::parse(const std::string &payload)
|
||||
accountsObject.accountName = valueAccountsDBAccount["AccountName"].asString();
|
||||
if(!valueAccountsDBAccount["AccountPassword"].isNull())
|
||||
accountsObject.accountPassword = valueAccountsDBAccount["AccountPassword"].asString();
|
||||
if(!valueAccountsDBAccount["TairPasswordSetted"].isNull())
|
||||
accountsObject.tairPasswordSetted = valueAccountsDBAccount["TairPasswordSetted"].asString();
|
||||
auto allDatabasePrivilegesNode = valueAccountsDBAccount["DatabasePrivileges"]["DatabasePrivilege"];
|
||||
for (auto valueAccountsDBAccountDatabasePrivilegesDatabasePrivilege : allDatabasePrivilegesNode)
|
||||
{
|
||||
|
||||
@@ -79,6 +79,10 @@ void DescribeDBClusterAttributeResult::parse(const std::string &payload)
|
||||
dBNodesObject.serverWeight = valueDBNodesDBNode["ServerWeight"].asString();
|
||||
if(!valueDBNodesDBNode["ServerlessType"].isNull())
|
||||
dBNodesObject.serverlessType = valueDBNodesDBNode["ServerlessType"].asString();
|
||||
if(!valueDBNodesDBNode["SubCluster"].isNull())
|
||||
dBNodesObject.subCluster = valueDBNodesDBNode["SubCluster"].asString();
|
||||
if(!valueDBNodesDBNode["Tair"].isNull())
|
||||
dBNodesObject.tair = valueDBNodesDBNode["Tair"].asString();
|
||||
dBNodes_.push_back(dBNodesObject);
|
||||
}
|
||||
auto allTagsNode = value["Tags"]["Tag"];
|
||||
@@ -212,6 +216,8 @@ void DescribeDBClusterAttributeResult::parse(const std::string &payload)
|
||||
aiType_ = value["AiType"].asString();
|
||||
if(!value["ProvisionedIops"].isNull())
|
||||
provisionedIops_ = value["ProvisionedIops"].asString();
|
||||
if(!value["HotStandbyHealthy"].isNull())
|
||||
hotStandbyHealthy_ = value["HotStandbyHealthy"].asString() == "true";
|
||||
|
||||
}
|
||||
|
||||
@@ -500,3 +506,8 @@ std::string DescribeDBClusterAttributeResult::getRegionId()const
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
bool DescribeDBClusterAttributeResult::getHotStandbyHealthy()const
|
||||
{
|
||||
return hotStandbyHealthy_;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,8 @@ void DescribeDBClusterMigrationResult::parse(const std::string &payload)
|
||||
dBClusterEndpointListObject.dBEndpointId = valueDBClusterEndpointListDBClusterEndpoint["DBEndpointId"].asString();
|
||||
if(!valueDBClusterEndpointListDBClusterEndpoint["EndpointType"].isNull())
|
||||
dBClusterEndpointListObject.endpointType = valueDBClusterEndpointListDBClusterEndpoint["EndpointType"].asString();
|
||||
if(!valueDBClusterEndpointListDBClusterEndpoint["ReadWriteMode"].isNull())
|
||||
dBClusterEndpointListObject.readWriteMode = valueDBClusterEndpointListDBClusterEndpoint["ReadWriteMode"].asString();
|
||||
auto allAddressItemsNode = valueDBClusterEndpointListDBClusterEndpoint["AddressItems"]["Address"];
|
||||
for (auto valueDBClusterEndpointListDBClusterEndpointAddressItemsAddress : allAddressItemsNode)
|
||||
{
|
||||
@@ -77,6 +79,8 @@ void DescribeDBClusterMigrationResult::parse(const std::string &payload)
|
||||
rdsEndpointListObject.dBEndpointId = valueRdsEndpointListRdsEndpoint["DBEndpointId"].asString();
|
||||
if(!valueRdsEndpointListRdsEndpoint["EndpointType"].isNull())
|
||||
rdsEndpointListObject.endpointType = valueRdsEndpointListRdsEndpoint["EndpointType"].asString();
|
||||
if(!valueRdsEndpointListRdsEndpoint["CustinsType"].isNull())
|
||||
rdsEndpointListObject.custinsType = valueRdsEndpointListRdsEndpoint["CustinsType"].asString();
|
||||
auto allAddressItems1Node = valueRdsEndpointListRdsEndpoint["AddressItems"]["Address"];
|
||||
for (auto valueRdsEndpointListRdsEndpointAddressItemsAddress : allAddressItems1Node)
|
||||
{
|
||||
|
||||
@@ -70,6 +70,15 @@ void DescribeDBClustersRequest::setRecentExpirationInterval(int recentExpiration
|
||||
setParameter(std::string("RecentExpirationInterval"), std::to_string(recentExpirationInterval));
|
||||
}
|
||||
|
||||
std::string DescribeDBClustersRequest::getDescribeType() const {
|
||||
return describeType_;
|
||||
}
|
||||
|
||||
void DescribeDBClustersRequest::setDescribeType(const std::string &describeType) {
|
||||
describeType_ = describeType;
|
||||
setParameter(std::string("DescribeType"), describeType);
|
||||
}
|
||||
|
||||
int DescribeDBClustersRequest::getPageNumber() const {
|
||||
return pageNumber_;
|
||||
}
|
||||
|
||||
81
polardb/src/model/DescribeDasConfigRequest.cc
Normal file
81
polardb/src/model/DescribeDasConfigRequest.cc
Normal file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* 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/DescribeDasConfigRequest.h>
|
||||
|
||||
using AlibabaCloud::Polardb::Model::DescribeDasConfigRequest;
|
||||
|
||||
DescribeDasConfigRequest::DescribeDasConfigRequest()
|
||||
: RpcServiceRequest("polardb", "2017-08-01", "DescribeDasConfig") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DescribeDasConfigRequest::~DescribeDasConfigRequest() {}
|
||||
|
||||
long DescribeDasConfigRequest::getResourceOwnerId() const {
|
||||
return resourceOwnerId_;
|
||||
}
|
||||
|
||||
void DescribeDasConfigRequest::setResourceOwnerId(long resourceOwnerId) {
|
||||
resourceOwnerId_ = resourceOwnerId;
|
||||
setParameter(std::string("ResourceOwnerId"), std::to_string(resourceOwnerId));
|
||||
}
|
||||
|
||||
std::string DescribeDasConfigRequest::getAccessKeyId() const {
|
||||
return accessKeyId_;
|
||||
}
|
||||
|
||||
void DescribeDasConfigRequest::setAccessKeyId(const std::string &accessKeyId) {
|
||||
accessKeyId_ = accessKeyId;
|
||||
setParameter(std::string("AccessKeyId"), accessKeyId);
|
||||
}
|
||||
|
||||
std::string DescribeDasConfigRequest::getResourceOwnerAccount() const {
|
||||
return resourceOwnerAccount_;
|
||||
}
|
||||
|
||||
void DescribeDasConfigRequest::setResourceOwnerAccount(const std::string &resourceOwnerAccount) {
|
||||
resourceOwnerAccount_ = resourceOwnerAccount;
|
||||
setParameter(std::string("ResourceOwnerAccount"), resourceOwnerAccount);
|
||||
}
|
||||
|
||||
std::string DescribeDasConfigRequest::getDBClusterId() const {
|
||||
return dBClusterId_;
|
||||
}
|
||||
|
||||
void DescribeDasConfigRequest::setDBClusterId(const std::string &dBClusterId) {
|
||||
dBClusterId_ = dBClusterId;
|
||||
setParameter(std::string("DBClusterId"), dBClusterId);
|
||||
}
|
||||
|
||||
std::string DescribeDasConfigRequest::getOwnerAccount() const {
|
||||
return ownerAccount_;
|
||||
}
|
||||
|
||||
void DescribeDasConfigRequest::setOwnerAccount(const std::string &ownerAccount) {
|
||||
ownerAccount_ = ownerAccount;
|
||||
setParameter(std::string("OwnerAccount"), ownerAccount);
|
||||
}
|
||||
|
||||
long DescribeDasConfigRequest::getOwnerId() const {
|
||||
return ownerId_;
|
||||
}
|
||||
|
||||
void DescribeDasConfigRequest::setOwnerId(long ownerId) {
|
||||
ownerId_ = ownerId;
|
||||
setParameter(std::string("OwnerId"), std::to_string(ownerId));
|
||||
}
|
||||
|
||||
58
polardb/src/model/DescribeDasConfigResult.cc
Normal file
58
polardb/src/model/DescribeDasConfigResult.cc
Normal file
@@ -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 <alibabacloud/polardb/model/DescribeDasConfigResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Polardb;
|
||||
using namespace AlibabaCloud::Polardb::Model;
|
||||
|
||||
DescribeDasConfigResult::DescribeDasConfigResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
DescribeDasConfigResult::DescribeDasConfigResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DescribeDasConfigResult::~DescribeDasConfigResult()
|
||||
{}
|
||||
|
||||
void DescribeDasConfigResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["StorageAutoScale"].isNull())
|
||||
storageAutoScale_ = value["StorageAutoScale"].asString();
|
||||
if(!value["StorageUpperBound"].isNull())
|
||||
storageUpperBound_ = std::stol(value["StorageUpperBound"].asString());
|
||||
|
||||
}
|
||||
|
||||
long DescribeDasConfigResult::getStorageUpperBound()const
|
||||
{
|
||||
return storageUpperBound_;
|
||||
}
|
||||
|
||||
std::string DescribeDasConfigResult::getStorageAutoScale()const
|
||||
{
|
||||
return storageAutoScale_;
|
||||
}
|
||||
|
||||
@@ -52,6 +52,15 @@ void FailoverDBClusterRequest::setAccessKeyId(const std::string &accessKeyId) {
|
||||
setParameter(std::string("AccessKeyId"), accessKeyId);
|
||||
}
|
||||
|
||||
bool FailoverDBClusterRequest::getRollBackForDisaster() const {
|
||||
return rollBackForDisaster_;
|
||||
}
|
||||
|
||||
void FailoverDBClusterRequest::setRollBackForDisaster(bool rollBackForDisaster) {
|
||||
rollBackForDisaster_ = rollBackForDisaster;
|
||||
setParameter(std::string("RollBackForDisaster"), rollBackForDisaster ? "true" : "false");
|
||||
}
|
||||
|
||||
std::string FailoverDBClusterRequest::getResourceOwnerAccount() const {
|
||||
return resourceOwnerAccount_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user