DBS SDK Auto Released By wanxin,Version:1.36.7

Signed-off-by: haowei.yao <haowei.yao@alibaba-inc.com>
This commit is contained in:
haowei.yao
2019-04-15 19:09:31 +08:00
parent 328288acb1
commit bcea2432e3
13 changed files with 847 additions and 3 deletions

View File

@@ -231,6 +231,42 @@ DbsClient::DescribeBackupGatewayListOutcomeCallable DbsClient::describeBackupGat
return task->get_future();
}
DbsClient::CreateRestoreTaskOutcome DbsClient::createRestoreTask(const CreateRestoreTaskRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return CreateRestoreTaskOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return CreateRestoreTaskOutcome(CreateRestoreTaskResult(outcome.result()));
else
return CreateRestoreTaskOutcome(outcome.error());
}
void DbsClient::createRestoreTaskAsync(const CreateRestoreTaskRequest& request, const CreateRestoreTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, createRestoreTask(request), context);
};
asyncExecute(new Runnable(fn));
}
DbsClient::CreateRestoreTaskOutcomeCallable DbsClient::createRestoreTaskCallable(const CreateRestoreTaskRequest &request) const
{
auto task = std::make_shared<std::packaged_task<CreateRestoreTaskOutcome()>>(
[this, request]()
{
return this->createRestoreTask(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
DbsClient::DescribeIncrementBackupListOutcome DbsClient::describeIncrementBackupList(const DescribeIncrementBackupListRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -339,3 +375,39 @@ DbsClient::DescribeFullBackupListOutcomeCallable DbsClient::describeFullBackupLi
return task->get_future();
}
DbsClient::StartRestoreTaskOutcome DbsClient::startRestoreTask(const StartRestoreTaskRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return StartRestoreTaskOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return StartRestoreTaskOutcome(StartRestoreTaskResult(outcome.result()));
else
return StartRestoreTaskOutcome(outcome.error());
}
void DbsClient::startRestoreTaskAsync(const StartRestoreTaskRequest& request, const StartRestoreTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, startRestoreTask(request), context);
};
asyncExecute(new Runnable(fn));
}
DbsClient::StartRestoreTaskOutcomeCallable DbsClient::startRestoreTaskCallable(const StartRestoreTaskRequest &request) const
{
auto task = std::make_shared<std::packaged_task<StartRestoreTaskOutcome()>>(
[this, request]()
{
return this->startRestoreTask(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}

View File

@@ -0,0 +1,236 @@
/*
* 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/CreateRestoreTaskRequest.h>
using AlibabaCloud::Dbs::Model::CreateRestoreTaskRequest;
CreateRestoreTaskRequest::CreateRestoreTaskRequest() :
RpcServiceRequest("dbs", "2019-03-06", "CreateRestoreTask")
{}
CreateRestoreTaskRequest::~CreateRestoreTaskRequest()
{}
long CreateRestoreTaskRequest::getBackupGatewayId()const
{
return backupGatewayId_;
}
void CreateRestoreTaskRequest::setBackupGatewayId(long backupGatewayId)
{
backupGatewayId_ = backupGatewayId;
setCoreParameter("BackupGatewayId", std::to_string(backupGatewayId));
}
std::string CreateRestoreTaskRequest::getDestinationEndpointOracleSID()const
{
return destinationEndpointOracleSID_;
}
void CreateRestoreTaskRequest::setDestinationEndpointOracleSID(const std::string& destinationEndpointOracleSID)
{
destinationEndpointOracleSID_ = destinationEndpointOracleSID;
setCoreParameter("DestinationEndpointOracleSID", destinationEndpointOracleSID);
}
long CreateRestoreTaskRequest::getRestoreTime()const
{
return restoreTime_;
}
void CreateRestoreTaskRequest::setRestoreTime(long restoreTime)
{
restoreTime_ = restoreTime;
setCoreParameter("RestoreTime", std::to_string(restoreTime));
}
std::string CreateRestoreTaskRequest::getDestinationEndpointInstanceType()const
{
return destinationEndpointInstanceType_;
}
void CreateRestoreTaskRequest::setDestinationEndpointInstanceType(const std::string& destinationEndpointInstanceType)
{
destinationEndpointInstanceType_ = destinationEndpointInstanceType;
setCoreParameter("DestinationEndpointInstanceType", destinationEndpointInstanceType);
}
std::string CreateRestoreTaskRequest::getClientToken()const
{
return clientToken_;
}
void CreateRestoreTaskRequest::setClientToken(const std::string& clientToken)
{
clientToken_ = clientToken;
setCoreParameter("ClientToken", clientToken);
}
std::string CreateRestoreTaskRequest::getDestinationEndpointInstanceID()const
{
return destinationEndpointInstanceID_;
}
void CreateRestoreTaskRequest::setDestinationEndpointInstanceID(const std::string& destinationEndpointInstanceID)
{
destinationEndpointInstanceID_ = destinationEndpointInstanceID;
setCoreParameter("DestinationEndpointInstanceID", destinationEndpointInstanceID);
}
int CreateRestoreTaskRequest::getDestinationEndpointPort()const
{
return destinationEndpointPort_;
}
void CreateRestoreTaskRequest::setDestinationEndpointPort(int destinationEndpointPort)
{
destinationEndpointPort_ = destinationEndpointPort;
setCoreParameter("DestinationEndpointPort", std::to_string(destinationEndpointPort));
}
std::string CreateRestoreTaskRequest::getBackupPlanId()const
{
return backupPlanId_;
}
void CreateRestoreTaskRequest::setBackupPlanId(const std::string& backupPlanId)
{
backupPlanId_ = backupPlanId;
setCoreParameter("BackupPlanId", backupPlanId);
}
std::string CreateRestoreTaskRequest::getBackupSetId()const
{
return backupSetId_;
}
void CreateRestoreTaskRequest::setBackupSetId(const std::string& backupSetId)
{
backupSetId_ = backupSetId;
setCoreParameter("BackupSetId", backupSetId);
}
std::string CreateRestoreTaskRequest::getOwnerId()const
{
return ownerId_;
}
void CreateRestoreTaskRequest::setOwnerId(const std::string& ownerId)
{
ownerId_ = ownerId;
setCoreParameter("OwnerId", ownerId);
}
std::string CreateRestoreTaskRequest::getDestinationEndpointRegion()const
{
return destinationEndpointRegion_;
}
void CreateRestoreTaskRequest::setDestinationEndpointRegion(const std::string& destinationEndpointRegion)
{
destinationEndpointRegion_ = destinationEndpointRegion;
setCoreParameter("DestinationEndpointRegion", destinationEndpointRegion);
}
std::string CreateRestoreTaskRequest::getRestoreDir()const
{
return restoreDir_;
}
void CreateRestoreTaskRequest::setRestoreDir(const std::string& restoreDir)
{
restoreDir_ = restoreDir;
setCoreParameter("RestoreDir", restoreDir);
}
std::string CreateRestoreTaskRequest::getDestinationEndpointIP()const
{
return destinationEndpointIP_;
}
void CreateRestoreTaskRequest::setDestinationEndpointIP(const std::string& destinationEndpointIP)
{
destinationEndpointIP_ = destinationEndpointIP;
setCoreParameter("DestinationEndpointIP", destinationEndpointIP);
}
std::string CreateRestoreTaskRequest::getRegionId()const
{
return regionId_;
}
void CreateRestoreTaskRequest::setRegionId(const std::string& regionId)
{
regionId_ = regionId;
setCoreParameter("RegionId", regionId);
}
std::string CreateRestoreTaskRequest::getDestinationEndpointDatabaseName()const
{
return destinationEndpointDatabaseName_;
}
void CreateRestoreTaskRequest::setDestinationEndpointDatabaseName(const std::string& destinationEndpointDatabaseName)
{
destinationEndpointDatabaseName_ = destinationEndpointDatabaseName;
setCoreParameter("DestinationEndpointDatabaseName", destinationEndpointDatabaseName);
}
std::string CreateRestoreTaskRequest::getDestinationEndpointUserName()const
{
return destinationEndpointUserName_;
}
void CreateRestoreTaskRequest::setDestinationEndpointUserName(const std::string& destinationEndpointUserName)
{
destinationEndpointUserName_ = destinationEndpointUserName;
setCoreParameter("DestinationEndpointUserName", destinationEndpointUserName);
}
std::string CreateRestoreTaskRequest::getRestoreObjects()const
{
return restoreObjects_;
}
void CreateRestoreTaskRequest::setRestoreObjects(const std::string& restoreObjects)
{
restoreObjects_ = restoreObjects;
setCoreParameter("RestoreObjects", restoreObjects);
}
std::string CreateRestoreTaskRequest::getRestoreTaskName()const
{
return restoreTaskName_;
}
void CreateRestoreTaskRequest::setRestoreTaskName(const std::string& restoreTaskName)
{
restoreTaskName_ = restoreTaskName;
setCoreParameter("RestoreTaskName", restoreTaskName);
}
std::string CreateRestoreTaskRequest::getDestinationEndpointPassword()const
{
return destinationEndpointPassword_;
}
void CreateRestoreTaskRequest::setDestinationEndpointPassword(const std::string& destinationEndpointPassword)
{
destinationEndpointPassword_ = destinationEndpointPassword;
setCoreParameter("DestinationEndpointPassword", destinationEndpointPassword);
}

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/CreateRestoreTaskResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Dbs;
using namespace AlibabaCloud::Dbs::Model;
CreateRestoreTaskResult::CreateRestoreTaskResult() :
ServiceResult()
{}
CreateRestoreTaskResult::CreateRestoreTaskResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
CreateRestoreTaskResult::~CreateRestoreTaskResult()
{}
void CreateRestoreTaskResult::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["RestoreTaskId"].isNull())
restoreTaskId_ = value["RestoreTaskId"].asString();
}
std::string CreateRestoreTaskResult::getRestoreTaskId()const
{
return restoreTaskId_;
}
int CreateRestoreTaskResult::getHttpStatusCode()const
{
return httpStatusCode_;
}
std::string CreateRestoreTaskResult::getErrMessage()const
{
return errMessage_;
}
bool CreateRestoreTaskResult::getSuccess()const
{
return success_;
}
std::string CreateRestoreTaskResult::getErrCode()const
{
return errCode_;
}

View File

@@ -0,0 +1,71 @@
/*
* 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/StartRestoreTaskRequest.h>
using AlibabaCloud::Dbs::Model::StartRestoreTaskRequest;
StartRestoreTaskRequest::StartRestoreTaskRequest() :
RpcServiceRequest("dbs", "2019-03-06", "StartRestoreTask")
{}
StartRestoreTaskRequest::~StartRestoreTaskRequest()
{}
std::string StartRestoreTaskRequest::getRegionId()const
{
return regionId_;
}
void StartRestoreTaskRequest::setRegionId(const std::string& regionId)
{
regionId_ = regionId;
setCoreParameter("RegionId", regionId);
}
std::string StartRestoreTaskRequest::getClientToken()const
{
return clientToken_;
}
void StartRestoreTaskRequest::setClientToken(const std::string& clientToken)
{
clientToken_ = clientToken;
setCoreParameter("ClientToken", clientToken);
}
std::string StartRestoreTaskRequest::getRestoreTaskId()const
{
return restoreTaskId_;
}
void StartRestoreTaskRequest::setRestoreTaskId(const std::string& restoreTaskId)
{
restoreTaskId_ = restoreTaskId;
setCoreParameter("RestoreTaskId", restoreTaskId);
}
std::string StartRestoreTaskRequest::getOwnerId()const
{
return ownerId_;
}
void StartRestoreTaskRequest::setOwnerId(const std::string& ownerId)
{
ownerId_ = ownerId;
setCoreParameter("OwnerId", ownerId);
}

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/StartRestoreTaskResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Dbs;
using namespace AlibabaCloud::Dbs::Model;
StartRestoreTaskResult::StartRestoreTaskResult() :
ServiceResult()
{}
StartRestoreTaskResult::StartRestoreTaskResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
StartRestoreTaskResult::~StartRestoreTaskResult()
{}
void StartRestoreTaskResult::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["RestoreTaskId"].isNull())
restoreTaskId_ = value["RestoreTaskId"].asString();
}
std::string StartRestoreTaskResult::getRestoreTaskId()const
{
return restoreTaskId_;
}
int StartRestoreTaskResult::getHttpStatusCode()const
{
return httpStatusCode_;
}
std::string StartRestoreTaskResult::getErrMessage()const
{
return errMessage_;
}
bool StartRestoreTaskResult::getSuccess()const
{
return success_;
}
std::string StartRestoreTaskResult::getErrCode()const
{
return errCode_;
}