Support new feature.

This commit is contained in:
sdk-team
2023-07-19 11:05:39 +00:00
parent 410b5a1a3e
commit c8936fb4cf
8 changed files with 334 additions and 1 deletions

View File

@@ -1 +1 @@
1.36.1667
1.36.1668

View File

@@ -205,6 +205,8 @@ set(polardb_public_header_model
include/alibabacloud/polardb/model/ModifyAutoRenewAttributeResult.h
include/alibabacloud/polardb/model/ModifyBackupPolicyRequest.h
include/alibabacloud/polardb/model/ModifyBackupPolicyResult.h
include/alibabacloud/polardb/model/ModifyDBClusterRequest.h
include/alibabacloud/polardb/model/ModifyDBClusterResult.h
include/alibabacloud/polardb/model/ModifyDBClusterAccessWhitelistRequest.h
include/alibabacloud/polardb/model/ModifyDBClusterAccessWhitelistResult.h
include/alibabacloud/polardb/model/ModifyDBClusterAndNodesParametersRequest.h
@@ -480,6 +482,8 @@ set(polardb_src
src/model/ModifyAutoRenewAttributeResult.cc
src/model/ModifyBackupPolicyRequest.cc
src/model/ModifyBackupPolicyResult.cc
src/model/ModifyDBClusterRequest.cc
src/model/ModifyDBClusterResult.cc
src/model/ModifyDBClusterAccessWhitelistRequest.cc
src/model/ModifyDBClusterAccessWhitelistResult.cc
src/model/ModifyDBClusterAndNodesParametersRequest.cc

View File

@@ -206,6 +206,8 @@
#include "model/ModifyAutoRenewAttributeResult.h"
#include "model/ModifyBackupPolicyRequest.h"
#include "model/ModifyBackupPolicyResult.h"
#include "model/ModifyDBClusterRequest.h"
#include "model/ModifyDBClusterResult.h"
#include "model/ModifyDBClusterAccessWhitelistRequest.h"
#include "model/ModifyDBClusterAccessWhitelistResult.h"
#include "model/ModifyDBClusterAndNodesParametersRequest.h"
@@ -579,6 +581,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::ModifyBackupPolicyResult> ModifyBackupPolicyOutcome;
typedef std::future<ModifyBackupPolicyOutcome> ModifyBackupPolicyOutcomeCallable;
typedef std::function<void(const PolardbClient*, const Model::ModifyBackupPolicyRequest&, const ModifyBackupPolicyOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ModifyBackupPolicyAsyncHandler;
typedef Outcome<Error, Model::ModifyDBClusterResult> ModifyDBClusterOutcome;
typedef std::future<ModifyDBClusterOutcome> ModifyDBClusterOutcomeCallable;
typedef std::function<void(const PolardbClient*, const Model::ModifyDBClusterRequest&, const ModifyDBClusterOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ModifyDBClusterAsyncHandler;
typedef Outcome<Error, Model::ModifyDBClusterAccessWhitelistResult> ModifyDBClusterAccessWhitelistOutcome;
typedef std::future<ModifyDBClusterAccessWhitelistOutcome> ModifyDBClusterAccessWhitelistOutcomeCallable;
typedef std::function<void(const PolardbClient*, const Model::ModifyDBClusterAccessWhitelistRequest&, const ModifyDBClusterAccessWhitelistOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ModifyDBClusterAccessWhitelistAsyncHandler;
@@ -992,6 +997,9 @@ namespace AlibabaCloud
ModifyBackupPolicyOutcome modifyBackupPolicy(const Model::ModifyBackupPolicyRequest &request)const;
void modifyBackupPolicyAsync(const Model::ModifyBackupPolicyRequest& request, const ModifyBackupPolicyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ModifyBackupPolicyOutcomeCallable modifyBackupPolicyCallable(const Model::ModifyBackupPolicyRequest& request) const;
ModifyDBClusterOutcome modifyDBCluster(const Model::ModifyDBClusterRequest &request)const;
void modifyDBClusterAsync(const Model::ModifyDBClusterRequest& request, const ModifyDBClusterAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ModifyDBClusterOutcomeCallable modifyDBClusterCallable(const Model::ModifyDBClusterRequest& request) const;
ModifyDBClusterAccessWhitelistOutcome modifyDBClusterAccessWhitelist(const Model::ModifyDBClusterAccessWhitelistRequest &request)const;
void modifyDBClusterAccessWhitelistAsync(const Model::ModifyDBClusterAccessWhitelistRequest& request, const ModifyDBClusterAccessWhitelistAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ModifyDBClusterAccessWhitelistOutcomeCallable modifyDBClusterAccessWhitelistCallable(const Model::ModifyDBClusterAccessWhitelistRequest& request) const;

View File

@@ -0,0 +1,66 @@
/*
* 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.
*/
#ifndef ALIBABACLOUD_POLARDB_MODEL_MODIFYDBCLUSTERREQUEST_H_
#define ALIBABACLOUD_POLARDB_MODEL_MODIFYDBCLUSTERREQUEST_H_
#include <alibabacloud/polardb/PolardbExport.h>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <string>
#include <vector>
#include <map>
namespace AlibabaCloud {
namespace Polardb {
namespace Model {
class ALIBABACLOUD_POLARDB_EXPORT ModifyDBClusterRequest : public RpcServiceRequest {
public:
ModifyDBClusterRequest();
~ModifyDBClusterRequest();
long getResourceOwnerId() const;
void setResourceOwnerId(long resourceOwnerId);
std::string getAccessKeyId() const;
void setAccessKeyId(const std::string &accessKeyId);
std::string getStandbyHAMode() const;
void setStandbyHAMode(const std::string &standbyHAMode);
std::string getResourceOwnerAccount() const;
void setResourceOwnerAccount(const std::string &resourceOwnerAccount);
std::string getDBClusterId() const;
void setDBClusterId(const std::string &dBClusterId);
std::string getOwnerAccount() const;
void setOwnerAccount(const std::string &ownerAccount);
std::string getFaultSimulateMode() const;
void setFaultSimulateMode(const std::string &faultSimulateMode);
long getOwnerId() const;
void setOwnerId(long ownerId);
std::string getDataSyncMode() const;
void setDataSyncMode(const std::string &dataSyncMode);
private:
long resourceOwnerId_;
std::string accessKeyId_;
std::string standbyHAMode_;
std::string resourceOwnerAccount_;
std::string dBClusterId_;
std::string ownerAccount_;
std::string faultSimulateMode_;
long ownerId_;
std::string dataSyncMode_;
};
} // namespace Model
} // namespace Polardb
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_POLARDB_MODEL_MODIFYDBCLUSTERREQUEST_H_

View File

@@ -0,0 +1,53 @@
/*
* 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.
*/
#ifndef ALIBABACLOUD_POLARDB_MODEL_MODIFYDBCLUSTERRESULT_H_
#define ALIBABACLOUD_POLARDB_MODEL_MODIFYDBCLUSTERRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/polardb/PolardbExport.h>
namespace AlibabaCloud
{
namespace Polardb
{
namespace Model
{
class ALIBABACLOUD_POLARDB_EXPORT ModifyDBClusterResult : public ServiceResult
{
public:
ModifyDBClusterResult();
explicit ModifyDBClusterResult(const std::string &payload);
~ModifyDBClusterResult();
std::string getDBClusterId()const;
std::string getOrderId()const;
protected:
void parse(const std::string &payload);
private:
std::string dBClusterId_;
std::string orderId_;
};
}
}
}
#endif // !ALIBABACLOUD_POLARDB_MODEL_MODIFYDBCLUSTERRESULT_H_

View File

@@ -3363,6 +3363,42 @@ PolardbClient::ModifyBackupPolicyOutcomeCallable PolardbClient::modifyBackupPoli
return task->get_future();
}
PolardbClient::ModifyDBClusterOutcome PolardbClient::modifyDBCluster(const ModifyDBClusterRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ModifyDBClusterOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ModifyDBClusterOutcome(ModifyDBClusterResult(outcome.result()));
else
return ModifyDBClusterOutcome(outcome.error());
}
void PolardbClient::modifyDBClusterAsync(const ModifyDBClusterRequest& request, const ModifyDBClusterAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, modifyDBCluster(request), context);
};
asyncExecute(new Runnable(fn));
}
PolardbClient::ModifyDBClusterOutcomeCallable PolardbClient::modifyDBClusterCallable(const ModifyDBClusterRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ModifyDBClusterOutcome()>>(
[this, request]()
{
return this->modifyDBCluster(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
PolardbClient::ModifyDBClusterAccessWhitelistOutcome PolardbClient::modifyDBClusterAccessWhitelist(const ModifyDBClusterAccessWhitelistRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -0,0 +1,108 @@
/*
* 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/ModifyDBClusterRequest.h>
using AlibabaCloud::Polardb::Model::ModifyDBClusterRequest;
ModifyDBClusterRequest::ModifyDBClusterRequest()
: RpcServiceRequest("polardb", "2017-08-01", "ModifyDBCluster") {
setMethod(HttpRequest::Method::Post);
}
ModifyDBClusterRequest::~ModifyDBClusterRequest() {}
long ModifyDBClusterRequest::getResourceOwnerId() const {
return resourceOwnerId_;
}
void ModifyDBClusterRequest::setResourceOwnerId(long resourceOwnerId) {
resourceOwnerId_ = resourceOwnerId;
setParameter(std::string("ResourceOwnerId"), std::to_string(resourceOwnerId));
}
std::string ModifyDBClusterRequest::getAccessKeyId() const {
return accessKeyId_;
}
void ModifyDBClusterRequest::setAccessKeyId(const std::string &accessKeyId) {
accessKeyId_ = accessKeyId;
setParameter(std::string("AccessKeyId"), accessKeyId);
}
std::string ModifyDBClusterRequest::getStandbyHAMode() const {
return standbyHAMode_;
}
void ModifyDBClusterRequest::setStandbyHAMode(const std::string &standbyHAMode) {
standbyHAMode_ = standbyHAMode;
setParameter(std::string("StandbyHAMode"), standbyHAMode);
}
std::string ModifyDBClusterRequest::getResourceOwnerAccount() const {
return resourceOwnerAccount_;
}
void ModifyDBClusterRequest::setResourceOwnerAccount(const std::string &resourceOwnerAccount) {
resourceOwnerAccount_ = resourceOwnerAccount;
setParameter(std::string("ResourceOwnerAccount"), resourceOwnerAccount);
}
std::string ModifyDBClusterRequest::getDBClusterId() const {
return dBClusterId_;
}
void ModifyDBClusterRequest::setDBClusterId(const std::string &dBClusterId) {
dBClusterId_ = dBClusterId;
setParameter(std::string("DBClusterId"), dBClusterId);
}
std::string ModifyDBClusterRequest::getOwnerAccount() const {
return ownerAccount_;
}
void ModifyDBClusterRequest::setOwnerAccount(const std::string &ownerAccount) {
ownerAccount_ = ownerAccount;
setParameter(std::string("OwnerAccount"), ownerAccount);
}
std::string ModifyDBClusterRequest::getFaultSimulateMode() const {
return faultSimulateMode_;
}
void ModifyDBClusterRequest::setFaultSimulateMode(const std::string &faultSimulateMode) {
faultSimulateMode_ = faultSimulateMode;
setParameter(std::string("FaultSimulateMode"), faultSimulateMode);
}
long ModifyDBClusterRequest::getOwnerId() const {
return ownerId_;
}
void ModifyDBClusterRequest::setOwnerId(long ownerId) {
ownerId_ = ownerId;
setParameter(std::string("OwnerId"), std::to_string(ownerId));
}
std::string ModifyDBClusterRequest::getDataSyncMode() const {
return dataSyncMode_;
}
void ModifyDBClusterRequest::setDataSyncMode(const std::string &dataSyncMode) {
dataSyncMode_ = dataSyncMode;
setParameter(std::string("DataSyncMode"), dataSyncMode);
}

View 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/ModifyDBClusterResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Polardb;
using namespace AlibabaCloud::Polardb::Model;
ModifyDBClusterResult::ModifyDBClusterResult() :
ServiceResult()
{}
ModifyDBClusterResult::ModifyDBClusterResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ModifyDBClusterResult::~ModifyDBClusterResult()
{}
void ModifyDBClusterResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["DBClusterId"].isNull())
dBClusterId_ = value["DBClusterId"].asString();
if(!value["OrderId"].isNull())
orderId_ = value["OrderId"].asString();
}
std::string ModifyDBClusterResult::getDBClusterId()const
{
return dBClusterId_;
}
std::string ModifyDBClusterResult::getOrderId()const
{
return orderId_;
}