Add CreateGetDBListFromAgentTask.

This commit is contained in:
sdk-team
2020-07-29 17:42:31 +08:00
parent 5b5f0128c9
commit 49e97628f4
13 changed files with 694 additions and 1 deletions

View File

@@ -27,6 +27,8 @@ set(dbs_public_header_model
include/alibabacloud/dbs/model/CreateBackupPlanResult.h
include/alibabacloud/dbs/model/CreateFullBackupSetDownloadRequest.h
include/alibabacloud/dbs/model/CreateFullBackupSetDownloadResult.h
include/alibabacloud/dbs/model/CreateGetDBListFromAgentTaskRequest.h
include/alibabacloud/dbs/model/CreateGetDBListFromAgentTaskResult.h
include/alibabacloud/dbs/model/CreateIncrementBackupSetDownloadRequest.h
include/alibabacloud/dbs/model/CreateIncrementBackupSetDownloadResult.h
include/alibabacloud/dbs/model/CreateRestoreTaskRequest.h
@@ -55,6 +57,8 @@ set(dbs_public_header_model
include/alibabacloud/dbs/model/DescribeRestoreRangeInfoResult.h
include/alibabacloud/dbs/model/DescribeRestoreTaskListRequest.h
include/alibabacloud/dbs/model/DescribeRestoreTaskListResult.h
include/alibabacloud/dbs/model/GetDBListFromAgentRequest.h
include/alibabacloud/dbs/model/GetDBListFromAgentResult.h
include/alibabacloud/dbs/model/ModifyBackupObjectsRequest.h
include/alibabacloud/dbs/model/ModifyBackupObjectsResult.h
include/alibabacloud/dbs/model/ModifyBackupPlanNameRequest.h
@@ -86,6 +90,8 @@ set(dbs_src
src/model/CreateBackupPlanResult.cc
src/model/CreateFullBackupSetDownloadRequest.cc
src/model/CreateFullBackupSetDownloadResult.cc
src/model/CreateGetDBListFromAgentTaskRequest.cc
src/model/CreateGetDBListFromAgentTaskResult.cc
src/model/CreateIncrementBackupSetDownloadRequest.cc
src/model/CreateIncrementBackupSetDownloadResult.cc
src/model/CreateRestoreTaskRequest.cc
@@ -114,6 +120,8 @@ set(dbs_src
src/model/DescribeRestoreRangeInfoResult.cc
src/model/DescribeRestoreTaskListRequest.cc
src/model/DescribeRestoreTaskListResult.cc
src/model/GetDBListFromAgentRequest.cc
src/model/GetDBListFromAgentResult.cc
src/model/ModifyBackupObjectsRequest.cc
src/model/ModifyBackupObjectsResult.cc
src/model/ModifyBackupPlanNameRequest.cc

View File

@@ -28,6 +28,8 @@
#include "model/CreateBackupPlanResult.h"
#include "model/CreateFullBackupSetDownloadRequest.h"
#include "model/CreateFullBackupSetDownloadResult.h"
#include "model/CreateGetDBListFromAgentTaskRequest.h"
#include "model/CreateGetDBListFromAgentTaskResult.h"
#include "model/CreateIncrementBackupSetDownloadRequest.h"
#include "model/CreateIncrementBackupSetDownloadResult.h"
#include "model/CreateRestoreTaskRequest.h"
@@ -56,6 +58,8 @@
#include "model/DescribeRestoreRangeInfoResult.h"
#include "model/DescribeRestoreTaskListRequest.h"
#include "model/DescribeRestoreTaskListResult.h"
#include "model/GetDBListFromAgentRequest.h"
#include "model/GetDBListFromAgentResult.h"
#include "model/ModifyBackupObjectsRequest.h"
#include "model/ModifyBackupObjectsResult.h"
#include "model/ModifyBackupPlanNameRequest.h"
@@ -96,6 +100,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::CreateFullBackupSetDownloadResult> CreateFullBackupSetDownloadOutcome;
typedef std::future<CreateFullBackupSetDownloadOutcome> CreateFullBackupSetDownloadOutcomeCallable;
typedef std::function<void(const DbsClient*, const Model::CreateFullBackupSetDownloadRequest&, const CreateFullBackupSetDownloadOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateFullBackupSetDownloadAsyncHandler;
typedef Outcome<Error, Model::CreateGetDBListFromAgentTaskResult> CreateGetDBListFromAgentTaskOutcome;
typedef std::future<CreateGetDBListFromAgentTaskOutcome> CreateGetDBListFromAgentTaskOutcomeCallable;
typedef std::function<void(const DbsClient*, const Model::CreateGetDBListFromAgentTaskRequest&, const CreateGetDBListFromAgentTaskOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateGetDBListFromAgentTaskAsyncHandler;
typedef Outcome<Error, Model::CreateIncrementBackupSetDownloadResult> CreateIncrementBackupSetDownloadOutcome;
typedef std::future<CreateIncrementBackupSetDownloadOutcome> CreateIncrementBackupSetDownloadOutcomeCallable;
typedef std::function<void(const DbsClient*, const Model::CreateIncrementBackupSetDownloadRequest&, const CreateIncrementBackupSetDownloadOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateIncrementBackupSetDownloadAsyncHandler;
@@ -138,6 +145,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::DescribeRestoreTaskListResult> DescribeRestoreTaskListOutcome;
typedef std::future<DescribeRestoreTaskListOutcome> DescribeRestoreTaskListOutcomeCallable;
typedef std::function<void(const DbsClient*, const Model::DescribeRestoreTaskListRequest&, const DescribeRestoreTaskListOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeRestoreTaskListAsyncHandler;
typedef Outcome<Error, Model::GetDBListFromAgentResult> GetDBListFromAgentOutcome;
typedef std::future<GetDBListFromAgentOutcome> GetDBListFromAgentOutcomeCallable;
typedef std::function<void(const DbsClient*, const Model::GetDBListFromAgentRequest&, const GetDBListFromAgentOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetDBListFromAgentAsyncHandler;
typedef Outcome<Error, Model::ModifyBackupObjectsResult> ModifyBackupObjectsOutcome;
typedef std::future<ModifyBackupObjectsOutcome> ModifyBackupObjectsOutcomeCallable;
typedef std::function<void(const DbsClient*, const Model::ModifyBackupObjectsRequest&, const ModifyBackupObjectsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ModifyBackupObjectsAsyncHandler;
@@ -185,6 +195,9 @@ namespace AlibabaCloud
CreateFullBackupSetDownloadOutcome createFullBackupSetDownload(const Model::CreateFullBackupSetDownloadRequest &request)const;
void createFullBackupSetDownloadAsync(const Model::CreateFullBackupSetDownloadRequest& request, const CreateFullBackupSetDownloadAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
CreateFullBackupSetDownloadOutcomeCallable createFullBackupSetDownloadCallable(const Model::CreateFullBackupSetDownloadRequest& request) const;
CreateGetDBListFromAgentTaskOutcome createGetDBListFromAgentTask(const Model::CreateGetDBListFromAgentTaskRequest &request)const;
void createGetDBListFromAgentTaskAsync(const Model::CreateGetDBListFromAgentTaskRequest& request, const CreateGetDBListFromAgentTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
CreateGetDBListFromAgentTaskOutcomeCallable createGetDBListFromAgentTaskCallable(const Model::CreateGetDBListFromAgentTaskRequest& request) const;
CreateIncrementBackupSetDownloadOutcome createIncrementBackupSetDownload(const Model::CreateIncrementBackupSetDownloadRequest &request)const;
void createIncrementBackupSetDownloadAsync(const Model::CreateIncrementBackupSetDownloadRequest& request, const CreateIncrementBackupSetDownloadAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
CreateIncrementBackupSetDownloadOutcomeCallable createIncrementBackupSetDownloadCallable(const Model::CreateIncrementBackupSetDownloadRequest& request) const;
@@ -227,6 +240,9 @@ namespace AlibabaCloud
DescribeRestoreTaskListOutcome describeRestoreTaskList(const Model::DescribeRestoreTaskListRequest &request)const;
void describeRestoreTaskListAsync(const Model::DescribeRestoreTaskListRequest& request, const DescribeRestoreTaskListAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
DescribeRestoreTaskListOutcomeCallable describeRestoreTaskListCallable(const Model::DescribeRestoreTaskListRequest& request) const;
GetDBListFromAgentOutcome getDBListFromAgent(const Model::GetDBListFromAgentRequest &request)const;
void getDBListFromAgentAsync(const Model::GetDBListFromAgentRequest& request, const GetDBListFromAgentAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GetDBListFromAgentOutcomeCallable getDBListFromAgentCallable(const Model::GetDBListFromAgentRequest& request) const;
ModifyBackupObjectsOutcome modifyBackupObjects(const Model::ModifyBackupObjectsRequest &request)const;
void modifyBackupObjectsAsync(const Model::ModifyBackupObjectsRequest& request, const ModifyBackupObjectsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ModifyBackupObjectsOutcomeCallable modifyBackupObjectsCallable(const Model::ModifyBackupObjectsRequest& 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_DBS_MODEL_CREATEGETDBLISTFROMAGENTTASKREQUEST_H_
#define ALIBABACLOUD_DBS_MODEL_CREATEGETDBLISTFROMAGENTTASKREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/dbs/DbsExport.h>
namespace AlibabaCloud
{
namespace Dbs
{
namespace Model
{
class ALIBABACLOUD_DBS_EXPORT CreateGetDBListFromAgentTaskRequest : public RpcServiceRequest
{
public:
CreateGetDBListFromAgentTaskRequest();
~CreateGetDBListFromAgentTaskRequest();
std::string getSourceEndpointRegion()const;
void setSourceEndpointRegion(const std::string& sourceEndpointRegion);
long getBackupGatewayId()const;
void setBackupGatewayId(long backupGatewayId);
std::string getDatabaseType()const;
void setDatabaseType(const std::string& databaseType);
std::string getClientToken()const;
void setClientToken(const std::string& clientToken);
std::string getOwnerId()const;
void setOwnerId(const std::string& ownerId);
int getSourceEndpointPort()const;
void setSourceEndpointPort(int sourceEndpointPort);
std::string getSourceEndpointIP()const;
void setSourceEndpointIP(const std::string& sourceEndpointIP);
private:
std::string sourceEndpointRegion_;
long backupGatewayId_;
std::string databaseType_;
std::string clientToken_;
std::string ownerId_;
int sourceEndpointPort_;
std::string sourceEndpointIP_;
};
}
}
}
#endif // !ALIBABACLOUD_DBS_MODEL_CREATEGETDBLISTFROMAGENTTASKREQUEST_H_

View File

@@ -0,0 +1,59 @@
/*
* 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_DBS_MODEL_CREATEGETDBLISTFROMAGENTTASKRESULT_H_
#define ALIBABACLOUD_DBS_MODEL_CREATEGETDBLISTFROMAGENTTASKRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/dbs/DbsExport.h>
namespace AlibabaCloud
{
namespace Dbs
{
namespace Model
{
class ALIBABACLOUD_DBS_EXPORT CreateGetDBListFromAgentTaskResult : public ServiceResult
{
public:
CreateGetDBListFromAgentTaskResult();
explicit CreateGetDBListFromAgentTaskResult(const std::string &payload);
~CreateGetDBListFromAgentTaskResult();
long getTaskId()const;
int getHttpStatusCode()const;
std::string getErrMessage()const;
bool getSuccess()const;
std::string getErrCode()const;
protected:
void parse(const std::string &payload);
private:
long taskId_;
int httpStatusCode_;
std::string errMessage_;
bool success_;
std::string errCode_;
};
}
}
}
#endif // !ALIBABACLOUD_DBS_MODEL_CREATEGETDBLISTFROMAGENTTASKRESULT_H_

View File

@@ -0,0 +1,60 @@
/*
* 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_DBS_MODEL_GETDBLISTFROMAGENTREQUEST_H_
#define ALIBABACLOUD_DBS_MODEL_GETDBLISTFROMAGENTREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/dbs/DbsExport.h>
namespace AlibabaCloud
{
namespace Dbs
{
namespace Model
{
class ALIBABACLOUD_DBS_EXPORT GetDBListFromAgentRequest : public RpcServiceRequest
{
public:
GetDBListFromAgentRequest();
~GetDBListFromAgentRequest();
std::string getSourceEndpointRegion()const;
void setSourceEndpointRegion(const std::string& sourceEndpointRegion);
long getBackupGatewayId()const;
void setBackupGatewayId(long backupGatewayId);
std::string getClientToken()const;
void setClientToken(const std::string& clientToken);
std::string getOwnerId()const;
void setOwnerId(const std::string& ownerId);
long getTaskId()const;
void setTaskId(long taskId);
private:
std::string sourceEndpointRegion_;
long backupGatewayId_;
std::string clientToken_;
std::string ownerId_;
long taskId_;
};
}
}
}
#endif // !ALIBABACLOUD_DBS_MODEL_GETDBLISTFROMAGENTREQUEST_H_

View File

@@ -0,0 +1,59 @@
/*
* 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_DBS_MODEL_GETDBLISTFROMAGENTRESULT_H_
#define ALIBABACLOUD_DBS_MODEL_GETDBLISTFROMAGENTRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/dbs/DbsExport.h>
namespace AlibabaCloud
{
namespace Dbs
{
namespace Model
{
class ALIBABACLOUD_DBS_EXPORT GetDBListFromAgentResult : public ServiceResult
{
public:
GetDBListFromAgentResult();
explicit GetDBListFromAgentResult(const std::string &payload);
~GetDBListFromAgentResult();
int getHttpStatusCode()const;
std::string getErrMessage()const;
std::vector<std::string> getDbList()const;
bool getSuccess()const;
std::string getErrCode()const;
protected:
void parse(const std::string &payload);
private:
int httpStatusCode_;
std::string errMessage_;
std::vector<std::string> dbList_;
bool success_;
std::string errCode_;
};
}
}
}
#endif // !ALIBABACLOUD_DBS_MODEL_GETDBLISTFROMAGENTRESULT_H_

View File

@@ -159,6 +159,42 @@ DbsClient::CreateFullBackupSetDownloadOutcomeCallable DbsClient::createFullBacku
return task->get_future();
}
DbsClient::CreateGetDBListFromAgentTaskOutcome DbsClient::createGetDBListFromAgentTask(const CreateGetDBListFromAgentTaskRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return CreateGetDBListFromAgentTaskOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return CreateGetDBListFromAgentTaskOutcome(CreateGetDBListFromAgentTaskResult(outcome.result()));
else
return CreateGetDBListFromAgentTaskOutcome(outcome.error());
}
void DbsClient::createGetDBListFromAgentTaskAsync(const CreateGetDBListFromAgentTaskRequest& request, const CreateGetDBListFromAgentTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, createGetDBListFromAgentTask(request), context);
};
asyncExecute(new Runnable(fn));
}
DbsClient::CreateGetDBListFromAgentTaskOutcomeCallable DbsClient::createGetDBListFromAgentTaskCallable(const CreateGetDBListFromAgentTaskRequest &request) const
{
auto task = std::make_shared<std::packaged_task<CreateGetDBListFromAgentTaskOutcome()>>(
[this, request]()
{
return this->createGetDBListFromAgentTask(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
DbsClient::CreateIncrementBackupSetDownloadOutcome DbsClient::createIncrementBackupSetDownload(const CreateIncrementBackupSetDownloadRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -663,6 +699,42 @@ DbsClient::DescribeRestoreTaskListOutcomeCallable DbsClient::describeRestoreTask
return task->get_future();
}
DbsClient::GetDBListFromAgentOutcome DbsClient::getDBListFromAgent(const GetDBListFromAgentRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GetDBListFromAgentOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GetDBListFromAgentOutcome(GetDBListFromAgentResult(outcome.result()));
else
return GetDBListFromAgentOutcome(outcome.error());
}
void DbsClient::getDBListFromAgentAsync(const GetDBListFromAgentRequest& request, const GetDBListFromAgentAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, getDBListFromAgent(request), context);
};
asyncExecute(new Runnable(fn));
}
DbsClient::GetDBListFromAgentOutcomeCallable DbsClient::getDBListFromAgentCallable(const GetDBListFromAgentRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GetDBListFromAgentOutcome()>>(
[this, request]()
{
return this->getDBListFromAgent(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
DbsClient::ModifyBackupObjectsOutcome DbsClient::modifyBackupObjects(const ModifyBackupObjectsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -0,0 +1,106 @@
/*
* 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/dbs/model/CreateGetDBListFromAgentTaskRequest.h>
using AlibabaCloud::Dbs::Model::CreateGetDBListFromAgentTaskRequest;
CreateGetDBListFromAgentTaskRequest::CreateGetDBListFromAgentTaskRequest() :
RpcServiceRequest("dbs", "2019-03-06", "CreateGetDBListFromAgentTask")
{
setMethod(HttpRequest::Method::Post);
}
CreateGetDBListFromAgentTaskRequest::~CreateGetDBListFromAgentTaskRequest()
{}
std::string CreateGetDBListFromAgentTaskRequest::getSourceEndpointRegion()const
{
return sourceEndpointRegion_;
}
void CreateGetDBListFromAgentTaskRequest::setSourceEndpointRegion(const std::string& sourceEndpointRegion)
{
sourceEndpointRegion_ = sourceEndpointRegion;
setParameter("SourceEndpointRegion", sourceEndpointRegion);
}
long CreateGetDBListFromAgentTaskRequest::getBackupGatewayId()const
{
return backupGatewayId_;
}
void CreateGetDBListFromAgentTaskRequest::setBackupGatewayId(long backupGatewayId)
{
backupGatewayId_ = backupGatewayId;
setParameter("BackupGatewayId", std::to_string(backupGatewayId));
}
std::string CreateGetDBListFromAgentTaskRequest::getDatabaseType()const
{
return databaseType_;
}
void CreateGetDBListFromAgentTaskRequest::setDatabaseType(const std::string& databaseType)
{
databaseType_ = databaseType;
setParameter("DatabaseType", databaseType);
}
std::string CreateGetDBListFromAgentTaskRequest::getClientToken()const
{
return clientToken_;
}
void CreateGetDBListFromAgentTaskRequest::setClientToken(const std::string& clientToken)
{
clientToken_ = clientToken;
setParameter("ClientToken", clientToken);
}
std::string CreateGetDBListFromAgentTaskRequest::getOwnerId()const
{
return ownerId_;
}
void CreateGetDBListFromAgentTaskRequest::setOwnerId(const std::string& ownerId)
{
ownerId_ = ownerId;
setParameter("OwnerId", ownerId);
}
int CreateGetDBListFromAgentTaskRequest::getSourceEndpointPort()const
{
return sourceEndpointPort_;
}
void CreateGetDBListFromAgentTaskRequest::setSourceEndpointPort(int sourceEndpointPort)
{
sourceEndpointPort_ = sourceEndpointPort;
setParameter("SourceEndpointPort", std::to_string(sourceEndpointPort));
}
std::string CreateGetDBListFromAgentTaskRequest::getSourceEndpointIP()const
{
return sourceEndpointIP_;
}
void CreateGetDBListFromAgentTaskRequest::setSourceEndpointIP(const std::string& sourceEndpointIP)
{
sourceEndpointIP_ = sourceEndpointIP;
setParameter("SourceEndpointIP", sourceEndpointIP);
}

View File

@@ -0,0 +1,79 @@
/*
* 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/dbs/model/CreateGetDBListFromAgentTaskResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Dbs;
using namespace AlibabaCloud::Dbs::Model;
CreateGetDBListFromAgentTaskResult::CreateGetDBListFromAgentTaskResult() :
ServiceResult()
{}
CreateGetDBListFromAgentTaskResult::CreateGetDBListFromAgentTaskResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
CreateGetDBListFromAgentTaskResult::~CreateGetDBListFromAgentTaskResult()
{}
void CreateGetDBListFromAgentTaskResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["ErrCode"].isNull())
errCode_ = value["ErrCode"].asString();
if(!value["ErrMessage"].isNull())
errMessage_ = value["ErrMessage"].asString();
if(!value["HttpStatusCode"].isNull())
httpStatusCode_ = std::stoi(value["HttpStatusCode"].asString());
if(!value["TaskId"].isNull())
taskId_ = std::stol(value["TaskId"].asString());
}
long CreateGetDBListFromAgentTaskResult::getTaskId()const
{
return taskId_;
}
int CreateGetDBListFromAgentTaskResult::getHttpStatusCode()const
{
return httpStatusCode_;
}
std::string CreateGetDBListFromAgentTaskResult::getErrMessage()const
{
return errMessage_;
}
bool CreateGetDBListFromAgentTaskResult::getSuccess()const
{
return success_;
}
std::string CreateGetDBListFromAgentTaskResult::getErrCode()const
{
return errCode_;
}

View File

@@ -0,0 +1,84 @@
/*
* 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/dbs/model/GetDBListFromAgentRequest.h>
using AlibabaCloud::Dbs::Model::GetDBListFromAgentRequest;
GetDBListFromAgentRequest::GetDBListFromAgentRequest() :
RpcServiceRequest("dbs", "2019-03-06", "GetDBListFromAgent")
{
setMethod(HttpRequest::Method::Post);
}
GetDBListFromAgentRequest::~GetDBListFromAgentRequest()
{}
std::string GetDBListFromAgentRequest::getSourceEndpointRegion()const
{
return sourceEndpointRegion_;
}
void GetDBListFromAgentRequest::setSourceEndpointRegion(const std::string& sourceEndpointRegion)
{
sourceEndpointRegion_ = sourceEndpointRegion;
setParameter("SourceEndpointRegion", sourceEndpointRegion);
}
long GetDBListFromAgentRequest::getBackupGatewayId()const
{
return backupGatewayId_;
}
void GetDBListFromAgentRequest::setBackupGatewayId(long backupGatewayId)
{
backupGatewayId_ = backupGatewayId;
setParameter("BackupGatewayId", std::to_string(backupGatewayId));
}
std::string GetDBListFromAgentRequest::getClientToken()const
{
return clientToken_;
}
void GetDBListFromAgentRequest::setClientToken(const std::string& clientToken)
{
clientToken_ = clientToken;
setParameter("ClientToken", clientToken);
}
std::string GetDBListFromAgentRequest::getOwnerId()const
{
return ownerId_;
}
void GetDBListFromAgentRequest::setOwnerId(const std::string& ownerId)
{
ownerId_ = ownerId;
setParameter("OwnerId", ownerId);
}
long GetDBListFromAgentRequest::getTaskId()const
{
return taskId_;
}
void GetDBListFromAgentRequest::setTaskId(long taskId)
{
taskId_ = taskId;
setParameter("TaskId", std::to_string(taskId));
}

View File

@@ -0,0 +1,80 @@
/*
* 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/dbs/model/GetDBListFromAgentResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Dbs;
using namespace AlibabaCloud::Dbs::Model;
GetDBListFromAgentResult::GetDBListFromAgentResult() :
ServiceResult()
{}
GetDBListFromAgentResult::GetDBListFromAgentResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GetDBListFromAgentResult::~GetDBListFromAgentResult()
{}
void GetDBListFromAgentResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allDbList = value["DbList"]["dbName"];
for (const auto &item : allDbList)
dbList_.push_back(item.asString());
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["ErrCode"].isNull())
errCode_ = value["ErrCode"].asString();
if(!value["ErrMessage"].isNull())
errMessage_ = value["ErrMessage"].asString();
if(!value["HttpStatusCode"].isNull())
httpStatusCode_ = std::stoi(value["HttpStatusCode"].asString());
}
int GetDBListFromAgentResult::getHttpStatusCode()const
{
return httpStatusCode_;
}
std::string GetDBListFromAgentResult::getErrMessage()const
{
return errMessage_;
}
std::vector<std::string> GetDBListFromAgentResult::getDbList()const
{
return dbList_;
}
bool GetDBListFromAgentResult::getSuccess()const
{
return success_;
}
std::string GetDBListFromAgentResult::getErrCode()const
{
return errCode_;
}