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

@@ -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();