Support ModifyDBClusterPrimaryZone.

This commit is contained in:
sdk-team
2020-11-17 09:16:08 +00:00
parent d6ea0cf35d
commit 4dea5b58b8
12 changed files with 710 additions and 0 deletions

View File

@@ -1383,6 +1383,42 @@ PolardbClient::DescribeDetachedBackupsOutcomeCallable PolardbClient::describeDet
return task->get_future();
}
PolardbClient::DescribeGlobalDatabaseNetworksOutcome PolardbClient::describeGlobalDatabaseNetworks(const DescribeGlobalDatabaseNetworksRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DescribeGlobalDatabaseNetworksOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DescribeGlobalDatabaseNetworksOutcome(DescribeGlobalDatabaseNetworksResult(outcome.result()));
else
return DescribeGlobalDatabaseNetworksOutcome(outcome.error());
}
void PolardbClient::describeGlobalDatabaseNetworksAsync(const DescribeGlobalDatabaseNetworksRequest& request, const DescribeGlobalDatabaseNetworksAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, describeGlobalDatabaseNetworks(request), context);
};
asyncExecute(new Runnable(fn));
}
PolardbClient::DescribeGlobalDatabaseNetworksOutcomeCallable PolardbClient::describeGlobalDatabaseNetworksCallable(const DescribeGlobalDatabaseNetworksRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DescribeGlobalDatabaseNetworksOutcome()>>(
[this, request]()
{
return this->describeGlobalDatabaseNetworks(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
PolardbClient::DescribeLogBackupPolicyOutcome PolardbClient::describeLogBackupPolicy(const DescribeLogBackupPolicyRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -2139,6 +2175,42 @@ PolardbClient::ModifyDBClusterParametersOutcomeCallable PolardbClient::modifyDBC
return task->get_future();
}
PolardbClient::ModifyDBClusterPrimaryZoneOutcome PolardbClient::modifyDBClusterPrimaryZone(const ModifyDBClusterPrimaryZoneRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ModifyDBClusterPrimaryZoneOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ModifyDBClusterPrimaryZoneOutcome(ModifyDBClusterPrimaryZoneResult(outcome.result()));
else
return ModifyDBClusterPrimaryZoneOutcome(outcome.error());
}
void PolardbClient::modifyDBClusterPrimaryZoneAsync(const ModifyDBClusterPrimaryZoneRequest& request, const ModifyDBClusterPrimaryZoneAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, modifyDBClusterPrimaryZone(request), context);
};
asyncExecute(new Runnable(fn));
}
PolardbClient::ModifyDBClusterPrimaryZoneOutcomeCallable PolardbClient::modifyDBClusterPrimaryZoneCallable(const ModifyDBClusterPrimaryZoneRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ModifyDBClusterPrimaryZoneOutcome()>>(
[this, request]()
{
return this->modifyDBClusterPrimaryZone(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
PolardbClient::ModifyDBClusterSSLOutcome PolardbClient::modifyDBClusterSSL(const ModifyDBClusterSSLRequest &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/DescribeGlobalDatabaseNetworksRequest.h>
using AlibabaCloud::Polardb::Model::DescribeGlobalDatabaseNetworksRequest;
DescribeGlobalDatabaseNetworksRequest::DescribeGlobalDatabaseNetworksRequest() :
RpcServiceRequest("polardb", "2017-08-01", "DescribeGlobalDatabaseNetworks")
{
setMethod(HttpRequest::Method::Post);
}
DescribeGlobalDatabaseNetworksRequest::~DescribeGlobalDatabaseNetworksRequest()
{}
long DescribeGlobalDatabaseNetworksRequest::getResourceOwnerId()const
{
return resourceOwnerId_;
}
void DescribeGlobalDatabaseNetworksRequest::setResourceOwnerId(long resourceOwnerId)
{
resourceOwnerId_ = resourceOwnerId;
setParameter("ResourceOwnerId", std::to_string(resourceOwnerId));
}
std::string DescribeGlobalDatabaseNetworksRequest::getAccessKeyId()const
{
return accessKeyId_;
}
void DescribeGlobalDatabaseNetworksRequest::setAccessKeyId(const std::string& accessKeyId)
{
accessKeyId_ = accessKeyId;
setParameter("AccessKeyId", accessKeyId);
}
std::string DescribeGlobalDatabaseNetworksRequest::getSecurityToken()const
{
return securityToken_;
}
void DescribeGlobalDatabaseNetworksRequest::setSecurityToken(const std::string& securityToken)
{
securityToken_ = securityToken;
setParameter("SecurityToken", securityToken);
}
std::string DescribeGlobalDatabaseNetworksRequest::getResourceOwnerAccount()const
{
return resourceOwnerAccount_;
}
void DescribeGlobalDatabaseNetworksRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount)
{
resourceOwnerAccount_ = resourceOwnerAccount;
setParameter("ResourceOwnerAccount", resourceOwnerAccount);
}
std::string DescribeGlobalDatabaseNetworksRequest::getOwnerAccount()const
{
return ownerAccount_;
}
void DescribeGlobalDatabaseNetworksRequest::setOwnerAccount(const std::string& ownerAccount)
{
ownerAccount_ = ownerAccount;
setParameter("OwnerAccount", ownerAccount);
}
long DescribeGlobalDatabaseNetworksRequest::getOwnerId()const
{
return ownerId_;
}
void DescribeGlobalDatabaseNetworksRequest::setOwnerId(long ownerId)
{
ownerId_ = ownerId;
setParameter("OwnerId", std::to_string(ownerId));
}

View File

@@ -0,0 +1,100 @@
/*
* 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/DescribeGlobalDatabaseNetworksResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Polardb;
using namespace AlibabaCloud::Polardb::Model;
DescribeGlobalDatabaseNetworksResult::DescribeGlobalDatabaseNetworksResult() :
ServiceResult()
{}
DescribeGlobalDatabaseNetworksResult::DescribeGlobalDatabaseNetworksResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DescribeGlobalDatabaseNetworksResult::~DescribeGlobalDatabaseNetworksResult()
{}
void DescribeGlobalDatabaseNetworksResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allItemsNode = value["Items"]["GlobalDatabaseNetwork"];
for (auto valueItemsGlobalDatabaseNetwork : allItemsNode)
{
GlobalDatabaseNetwork itemsObject;
if(!valueItemsGlobalDatabaseNetwork["GDNId"].isNull())
itemsObject.gDNId = valueItemsGlobalDatabaseNetwork["GDNId"].asString();
if(!valueItemsGlobalDatabaseNetwork["GDNStatus"].isNull())
itemsObject.gDNStatus = valueItemsGlobalDatabaseNetwork["GDNStatus"].asString();
if(!valueItemsGlobalDatabaseNetwork["GDNDescription"].isNull())
itemsObject.gDNDescription = valueItemsGlobalDatabaseNetwork["GDNDescription"].asString();
if(!valueItemsGlobalDatabaseNetwork["DBType"].isNull())
itemsObject.dBType = valueItemsGlobalDatabaseNetwork["DBType"].asString();
if(!valueItemsGlobalDatabaseNetwork["DBVersion"].isNull())
itemsObject.dBVersion = valueItemsGlobalDatabaseNetwork["DBVersion"].asString();
if(!valueItemsGlobalDatabaseNetwork["CreateTime"].isNull())
itemsObject.createTime = valueItemsGlobalDatabaseNetwork["CreateTime"].asString();
auto allDBClustersNode = valueItemsGlobalDatabaseNetwork["DBClusters"]["DBCluster"];
for (auto valueItemsGlobalDatabaseNetworkDBClustersDBCluster : allDBClustersNode)
{
GlobalDatabaseNetwork::DBCluster dBClustersObject;
if(!valueItemsGlobalDatabaseNetworkDBClustersDBCluster["DBClusterId"].isNull())
dBClustersObject.dBClusterId = valueItemsGlobalDatabaseNetworkDBClustersDBCluster["DBClusterId"].asString();
if(!valueItemsGlobalDatabaseNetworkDBClustersDBCluster["RegionId"].isNull())
dBClustersObject.regionId = valueItemsGlobalDatabaseNetworkDBClustersDBCluster["RegionId"].asString();
if(!valueItemsGlobalDatabaseNetworkDBClustersDBCluster["Role"].isNull())
dBClustersObject.role = valueItemsGlobalDatabaseNetworkDBClustersDBCluster["Role"].asString();
itemsObject.dBClusters.push_back(dBClustersObject);
}
items_.push_back(itemsObject);
}
if(!value["PageNumber"].isNull())
pageNumber_ = std::stoi(value["PageNumber"].asString());
if(!value["TotalRecordCount"].isNull())
totalRecordCount_ = std::stoi(value["TotalRecordCount"].asString());
if(!value["PageRecordCount"].isNull())
pageRecordCount_ = std::stoi(value["PageRecordCount"].asString());
}
int DescribeGlobalDatabaseNetworksResult::getTotalRecordCount()const
{
return totalRecordCount_;
}
int DescribeGlobalDatabaseNetworksResult::getPageRecordCount()const
{
return pageRecordCount_;
}
int DescribeGlobalDatabaseNetworksResult::getPageNumber()const
{
return pageNumber_;
}
std::vector<DescribeGlobalDatabaseNetworksResult::GlobalDatabaseNetwork> DescribeGlobalDatabaseNetworksResult::getItems()const
{
return items_;
}

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/polardb/model/ModifyDBClusterPrimaryZoneRequest.h>
using AlibabaCloud::Polardb::Model::ModifyDBClusterPrimaryZoneRequest;
ModifyDBClusterPrimaryZoneRequest::ModifyDBClusterPrimaryZoneRequest() :
RpcServiceRequest("polardb", "2017-08-01", "ModifyDBClusterPrimaryZone")
{
setMethod(HttpRequest::Method::Post);
}
ModifyDBClusterPrimaryZoneRequest::~ModifyDBClusterPrimaryZoneRequest()
{}
long ModifyDBClusterPrimaryZoneRequest::getResourceOwnerId()const
{
return resourceOwnerId_;
}
void ModifyDBClusterPrimaryZoneRequest::setResourceOwnerId(long resourceOwnerId)
{
resourceOwnerId_ = resourceOwnerId;
setParameter("ResourceOwnerId", std::to_string(resourceOwnerId));
}
std::string ModifyDBClusterPrimaryZoneRequest::getAccessKeyId()const
{
return accessKeyId_;
}
void ModifyDBClusterPrimaryZoneRequest::setAccessKeyId(const std::string& accessKeyId)
{
accessKeyId_ = accessKeyId;
setParameter("AccessKeyId", accessKeyId);
}
std::string ModifyDBClusterPrimaryZoneRequest::getResourceOwnerAccount()const
{
return resourceOwnerAccount_;
}
void ModifyDBClusterPrimaryZoneRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount)
{
resourceOwnerAccount_ = resourceOwnerAccount;
setParameter("ResourceOwnerAccount", resourceOwnerAccount);
}
std::string ModifyDBClusterPrimaryZoneRequest::getDBClusterId()const
{
return dBClusterId_;
}
void ModifyDBClusterPrimaryZoneRequest::setDBClusterId(const std::string& dBClusterId)
{
dBClusterId_ = dBClusterId;
setParameter("DBClusterId", dBClusterId);
}
std::string ModifyDBClusterPrimaryZoneRequest::getOwnerAccount()const
{
return ownerAccount_;
}
void ModifyDBClusterPrimaryZoneRequest::setOwnerAccount(const std::string& ownerAccount)
{
ownerAccount_ = ownerAccount;
setParameter("OwnerAccount", ownerAccount);
}
long ModifyDBClusterPrimaryZoneRequest::getOwnerId()const
{
return ownerId_;
}
void ModifyDBClusterPrimaryZoneRequest::setOwnerId(long ownerId)
{
ownerId_ = ownerId;
setParameter("OwnerId", std::to_string(ownerId));
}
std::string ModifyDBClusterPrimaryZoneRequest::getVSwitchId()const
{
return vSwitchId_;
}
void ModifyDBClusterPrimaryZoneRequest::setVSwitchId(const std::string& vSwitchId)
{
vSwitchId_ = vSwitchId;
setParameter("VSwitchId", vSwitchId);
}
std::string ModifyDBClusterPrimaryZoneRequest::getZoneId()const
{
return zoneId_;
}
void ModifyDBClusterPrimaryZoneRequest::setZoneId(const std::string& zoneId)
{
zoneId_ = zoneId;
setParameter("ZoneId", zoneId);
}

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