Add new apis.

This commit is contained in:
sdk-team
2023-08-30 09:38:32 +00:00
parent 3fba042126
commit 40f61e3ce6
28 changed files with 1923 additions and 1 deletions

View File

@@ -87,6 +87,42 @@ SWAS_OPENClient::AllocatePublicConnectionOutcomeCallable SWAS_OPENClient::alloca
return task->get_future();
}
SWAS_OPENClient::CreateCommandOutcome SWAS_OPENClient::createCommand(const CreateCommandRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return CreateCommandOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return CreateCommandOutcome(CreateCommandResult(outcome.result()));
else
return CreateCommandOutcome(outcome.error());
}
void SWAS_OPENClient::createCommandAsync(const CreateCommandRequest& request, const CreateCommandAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, createCommand(request), context);
};
asyncExecute(new Runnable(fn));
}
SWAS_OPENClient::CreateCommandOutcomeCallable SWAS_OPENClient::createCommandCallable(const CreateCommandRequest &request) const
{
auto task = std::make_shared<std::packaged_task<CreateCommandOutcome()>>(
[this, request]()
{
return this->createCommand(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
SWAS_OPENClient::CreateCustomImageOutcome SWAS_OPENClient::createCustomImage(const CreateCustomImageRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -303,6 +339,42 @@ SWAS_OPENClient::CreateSnapshotOutcomeCallable SWAS_OPENClient::createSnapshotCa
return task->get_future();
}
SWAS_OPENClient::DeleteCommandOutcome SWAS_OPENClient::deleteCommand(const DeleteCommandRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DeleteCommandOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DeleteCommandOutcome(DeleteCommandResult(outcome.result()));
else
return DeleteCommandOutcome(outcome.error());
}
void SWAS_OPENClient::deleteCommandAsync(const DeleteCommandRequest& request, const DeleteCommandAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, deleteCommand(request), context);
};
asyncExecute(new Runnable(fn));
}
SWAS_OPENClient::DeleteCommandOutcomeCallable SWAS_OPENClient::deleteCommandCallable(const DeleteCommandRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DeleteCommandOutcome()>>(
[this, request]()
{
return this->deleteCommand(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
SWAS_OPENClient::DeleteCustomImageOutcome SWAS_OPENClient::deleteCustomImage(const DeleteCustomImageRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -555,6 +627,78 @@ SWAS_OPENClient::DescribeCloudMonitorAgentStatusesOutcomeCallable SWAS_OPENClien
return task->get_future();
}
SWAS_OPENClient::DescribeCommandInvocationsOutcome SWAS_OPENClient::describeCommandInvocations(const DescribeCommandInvocationsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DescribeCommandInvocationsOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DescribeCommandInvocationsOutcome(DescribeCommandInvocationsResult(outcome.result()));
else
return DescribeCommandInvocationsOutcome(outcome.error());
}
void SWAS_OPENClient::describeCommandInvocationsAsync(const DescribeCommandInvocationsRequest& request, const DescribeCommandInvocationsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, describeCommandInvocations(request), context);
};
asyncExecute(new Runnable(fn));
}
SWAS_OPENClient::DescribeCommandInvocationsOutcomeCallable SWAS_OPENClient::describeCommandInvocationsCallable(const DescribeCommandInvocationsRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DescribeCommandInvocationsOutcome()>>(
[this, request]()
{
return this->describeCommandInvocations(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
SWAS_OPENClient::DescribeCommandsOutcome SWAS_OPENClient::describeCommands(const DescribeCommandsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DescribeCommandsOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DescribeCommandsOutcome(DescribeCommandsResult(outcome.result()));
else
return DescribeCommandsOutcome(outcome.error());
}
void SWAS_OPENClient::describeCommandsAsync(const DescribeCommandsRequest& request, const DescribeCommandsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, describeCommands(request), context);
};
asyncExecute(new Runnable(fn));
}
SWAS_OPENClient::DescribeCommandsOutcomeCallable SWAS_OPENClient::describeCommandsCallable(const DescribeCommandsRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DescribeCommandsOutcome()>>(
[this, request]()
{
return this->describeCommands(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
SWAS_OPENClient::DescribeDatabaseErrorLogsOutcome SWAS_OPENClient::describeDatabaseErrorLogs(const DescribeDatabaseErrorLogsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -1131,6 +1275,42 @@ SWAS_OPENClient::InstallCloudMonitorAgentOutcomeCallable SWAS_OPENClient::instal
return task->get_future();
}
SWAS_OPENClient::InvokeCommandOutcome SWAS_OPENClient::invokeCommand(const InvokeCommandRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return InvokeCommandOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return InvokeCommandOutcome(InvokeCommandResult(outcome.result()));
else
return InvokeCommandOutcome(outcome.error());
}
void SWAS_OPENClient::invokeCommandAsync(const InvokeCommandRequest& request, const InvokeCommandAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, invokeCommand(request), context);
};
asyncExecute(new Runnable(fn));
}
SWAS_OPENClient::InvokeCommandOutcomeCallable SWAS_OPENClient::invokeCommandCallable(const InvokeCommandRequest &request) const
{
auto task = std::make_shared<std::packaged_task<InvokeCommandOutcome()>>(
[this, request]()
{
return this->invokeCommand(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
SWAS_OPENClient::ListCustomImagesOutcome SWAS_OPENClient::listCustomImages(const ListCustomImagesRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -2319,6 +2499,42 @@ SWAS_OPENClient::StopInstancesOutcomeCallable SWAS_OPENClient::stopInstancesCall
return task->get_future();
}
SWAS_OPENClient::UpdateCommandAttributeOutcome SWAS_OPENClient::updateCommandAttribute(const UpdateCommandAttributeRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return UpdateCommandAttributeOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return UpdateCommandAttributeOutcome(UpdateCommandAttributeResult(outcome.result()));
else
return UpdateCommandAttributeOutcome(outcome.error());
}
void SWAS_OPENClient::updateCommandAttributeAsync(const UpdateCommandAttributeRequest& request, const UpdateCommandAttributeAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, updateCommandAttribute(request), context);
};
asyncExecute(new Runnable(fn));
}
SWAS_OPENClient::UpdateCommandAttributeOutcomeCallable SWAS_OPENClient::updateCommandAttributeCallable(const UpdateCommandAttributeRequest &request) const
{
auto task = std::make_shared<std::packaged_task<UpdateCommandAttributeOutcome()>>(
[this, request]()
{
return this->updateCommandAttribute(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
SWAS_OPENClient::UpdateDiskAttributeOutcome SWAS_OPENClient::updateDiskAttribute(const UpdateDiskAttributeRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -0,0 +1,99 @@
/*
* 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/swas-open/model/CreateCommandRequest.h>
using AlibabaCloud::SWAS_OPEN::Model::CreateCommandRequest;
CreateCommandRequest::CreateCommandRequest()
: RpcServiceRequest("swas-open", "2020-06-01", "CreateCommand") {
setMethod(HttpRequest::Method::Post);
}
CreateCommandRequest::~CreateCommandRequest() {}
std::string CreateCommandRequest::getWorkingDir() const {
return workingDir_;
}
void CreateCommandRequest::setWorkingDir(const std::string &workingDir) {
workingDir_ = workingDir;
setParameter(std::string("WorkingDir"), workingDir);
}
std::string CreateCommandRequest::getDescription() const {
return description_;
}
void CreateCommandRequest::setDescription(const std::string &description) {
description_ = description;
setParameter(std::string("Description"), description);
}
std::string CreateCommandRequest::getType() const {
return type_;
}
void CreateCommandRequest::setType(const std::string &type) {
type_ = type;
setParameter(std::string("Type"), type);
}
std::string CreateCommandRequest::getCommandContent() const {
return commandContent_;
}
void CreateCommandRequest::setCommandContent(const std::string &commandContent) {
commandContent_ = commandContent;
setParameter(std::string("CommandContent"), commandContent);
}
long CreateCommandRequest::getTimeout() const {
return timeout_;
}
void CreateCommandRequest::setTimeout(long timeout) {
timeout_ = timeout;
setParameter(std::string("Timeout"), std::to_string(timeout));
}
std::string CreateCommandRequest::getRegionId() const {
return regionId_;
}
void CreateCommandRequest::setRegionId(const std::string &regionId) {
regionId_ = regionId;
setParameter(std::string("RegionId"), regionId);
}
std::string CreateCommandRequest::getName() const {
return name_;
}
void CreateCommandRequest::setName(const std::string &name) {
name_ = name;
setParameter(std::string("Name"), name);
}
bool CreateCommandRequest::getEnableParameter() const {
return enableParameter_;
}
void CreateCommandRequest::setEnableParameter(bool enableParameter) {
enableParameter_ = enableParameter;
setParameter(std::string("EnableParameter"), enableParameter ? "true" : "false");
}

View File

@@ -0,0 +1,51 @@
/*
* 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/swas-open/model/CreateCommandResult.h>
#include <json/json.h>
using namespace AlibabaCloud::SWAS_OPEN;
using namespace AlibabaCloud::SWAS_OPEN::Model;
CreateCommandResult::CreateCommandResult() :
ServiceResult()
{}
CreateCommandResult::CreateCommandResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
CreateCommandResult::~CreateCommandResult()
{}
void CreateCommandResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["CommandId"].isNull())
commandId_ = value["CommandId"].asString();
}
std::string CreateCommandResult::getCommandId()const
{
return commandId_;
}

View File

@@ -0,0 +1,45 @@
/*
* 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/swas-open/model/DeleteCommandRequest.h>
using AlibabaCloud::SWAS_OPEN::Model::DeleteCommandRequest;
DeleteCommandRequest::DeleteCommandRequest()
: RpcServiceRequest("swas-open", "2020-06-01", "DeleteCommand") {
setMethod(HttpRequest::Method::Post);
}
DeleteCommandRequest::~DeleteCommandRequest() {}
std::string DeleteCommandRequest::getCommandId() const {
return commandId_;
}
void DeleteCommandRequest::setCommandId(const std::string &commandId) {
commandId_ = commandId;
setParameter(std::string("CommandId"), commandId);
}
std::string DeleteCommandRequest::getRegionId() const {
return regionId_;
}
void DeleteCommandRequest::setRegionId(const std::string &regionId) {
regionId_ = regionId;
setParameter(std::string("RegionId"), regionId);
}

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

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/swas-open/model/DescribeCommandInvocationsRequest.h>
using AlibabaCloud::SWAS_OPEN::Model::DescribeCommandInvocationsRequest;
DescribeCommandInvocationsRequest::DescribeCommandInvocationsRequest()
: RpcServiceRequest("swas-open", "2020-06-01", "DescribeCommandInvocations") {
setMethod(HttpRequest::Method::Post);
}
DescribeCommandInvocationsRequest::~DescribeCommandInvocationsRequest() {}
std::string DescribeCommandInvocationsRequest::getCommandId() const {
return commandId_;
}
void DescribeCommandInvocationsRequest::setCommandId(const std::string &commandId) {
commandId_ = commandId;
setParameter(std::string("CommandId"), commandId);
}
std::string DescribeCommandInvocationsRequest::getPageNumber() const {
return pageNumber_;
}
void DescribeCommandInvocationsRequest::setPageNumber(const std::string &pageNumber) {
pageNumber_ = pageNumber;
setParameter(std::string("PageNumber"), pageNumber);
}
std::string DescribeCommandInvocationsRequest::getRegionId() const {
return regionId_;
}
void DescribeCommandInvocationsRequest::setRegionId(const std::string &regionId) {
regionId_ = regionId;
setParameter(std::string("RegionId"), regionId);
}
std::string DescribeCommandInvocationsRequest::getPageSize() const {
return pageSize_;
}
void DescribeCommandInvocationsRequest::setPageSize(const std::string &pageSize) {
pageSize_ = pageSize;
setParameter(std::string("PageSize"), pageSize);
}
std::string DescribeCommandInvocationsRequest::getInvokeId() const {
return invokeId_;
}
void DescribeCommandInvocationsRequest::setInvokeId(const std::string &invokeId) {
invokeId_ = invokeId;
setParameter(std::string("InvokeId"), invokeId);
}
std::string DescribeCommandInvocationsRequest::getCommandName() const {
return commandName_;
}
void DescribeCommandInvocationsRequest::setCommandName(const std::string &commandName) {
commandName_ = commandName;
setParameter(std::string("CommandName"), commandName);
}
std::string DescribeCommandInvocationsRequest::getCommandType() const {
return commandType_;
}
void DescribeCommandInvocationsRequest::setCommandType(const std::string &commandType) {
commandType_ = commandType;
setParameter(std::string("CommandType"), commandType);
}
std::string DescribeCommandInvocationsRequest::getInstanceId() const {
return instanceId_;
}
void DescribeCommandInvocationsRequest::setInstanceId(const std::string &instanceId) {
instanceId_ = instanceId;
setParameter(std::string("InstanceId"), instanceId);
}
std::string DescribeCommandInvocationsRequest::getInvocationStatus() const {
return invocationStatus_;
}
void DescribeCommandInvocationsRequest::setInvocationStatus(const std::string &invocationStatus) {
invocationStatus_ = invocationStatus;
setParameter(std::string("InvocationStatus"), invocationStatus);
}

View File

@@ -0,0 +1,122 @@
/*
* 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/swas-open/model/DescribeCommandInvocationsResult.h>
#include <json/json.h>
using namespace AlibabaCloud::SWAS_OPEN;
using namespace AlibabaCloud::SWAS_OPEN::Model;
DescribeCommandInvocationsResult::DescribeCommandInvocationsResult() :
ServiceResult()
{}
DescribeCommandInvocationsResult::DescribeCommandInvocationsResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DescribeCommandInvocationsResult::~DescribeCommandInvocationsResult()
{}
void DescribeCommandInvocationsResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allCommandInvocationsNode = value["CommandInvocations"]["command"];
for (auto valueCommandInvocationscommand : allCommandInvocationsNode)
{
Command commandInvocationsObject;
if(!valueCommandInvocationscommand["InvokeId"].isNull())
commandInvocationsObject.invokeId = valueCommandInvocationscommand["InvokeId"].asString();
if(!valueCommandInvocationscommand["CreationTime"].isNull())
commandInvocationsObject.creationTime = valueCommandInvocationscommand["CreationTime"].asString();
if(!valueCommandInvocationscommand["CommandId"].isNull())
commandInvocationsObject.commandId = valueCommandInvocationscommand["CommandId"].asString();
if(!valueCommandInvocationscommand["InvocationStatus"].isNull())
commandInvocationsObject.invocationStatus = valueCommandInvocationscommand["InvocationStatus"].asString();
if(!valueCommandInvocationscommand["CommandName"].isNull())
commandInvocationsObject.commandName = valueCommandInvocationscommand["CommandName"].asString();
if(!valueCommandInvocationscommand["CommandType"].isNull())
commandInvocationsObject.commandType = valueCommandInvocationscommand["CommandType"].asString();
if(!valueCommandInvocationscommand["CommandDescription"].isNull())
commandInvocationsObject.commandDescription = valueCommandInvocationscommand["CommandDescription"].asString();
if(!valueCommandInvocationscommand["Username"].isNull())
commandInvocationsObject.username = valueCommandInvocationscommand["Username"].asString();
if(!valueCommandInvocationscommand["WorkingDir"].isNull())
commandInvocationsObject.workingDir = valueCommandInvocationscommand["WorkingDir"].asString();
if(!valueCommandInvocationscommand["Timeout"].isNull())
commandInvocationsObject.timeout = std::stol(valueCommandInvocationscommand["Timeout"].asString());
if(!valueCommandInvocationscommand["CommandContent"].isNull())
commandInvocationsObject.commandContent = valueCommandInvocationscommand["CommandContent"].asString();
if(!valueCommandInvocationscommand["Parameters"].isNull())
commandInvocationsObject.parameters = valueCommandInvocationscommand["Parameters"].asString();
auto allInvokeInstancesNode = valueCommandInvocationscommand["InvokeInstances"]["invokeInstance"];
for (auto valueCommandInvocationscommandInvokeInstancesinvokeInstance : allInvokeInstancesNode)
{
Command::InvokeInstance invokeInstancesObject;
if(!valueCommandInvocationscommandInvokeInstancesinvokeInstance["InstanceId"].isNull())
invokeInstancesObject.instanceId = valueCommandInvocationscommandInvokeInstancesinvokeInstance["InstanceId"].asString();
if(!valueCommandInvocationscommandInvokeInstancesinvokeInstance["StartTime"].isNull())
invokeInstancesObject.startTime = valueCommandInvocationscommandInvokeInstancesinvokeInstance["StartTime"].asString();
if(!valueCommandInvocationscommandInvokeInstancesinvokeInstance["FinishTime"].isNull())
invokeInstancesObject.finishTime = valueCommandInvocationscommandInvokeInstancesinvokeInstance["FinishTime"].asString();
if(!valueCommandInvocationscommandInvokeInstancesinvokeInstance["InvocationStatus"].isNull())
invokeInstancesObject.invocationStatus = valueCommandInvocationscommandInvokeInstancesinvokeInstance["InvocationStatus"].asString();
if(!valueCommandInvocationscommandInvokeInstancesinvokeInstance["Output"].isNull())
invokeInstancesObject.output = valueCommandInvocationscommandInvokeInstancesinvokeInstance["Output"].asString();
if(!valueCommandInvocationscommandInvokeInstancesinvokeInstance["ExitCode"].isNull())
invokeInstancesObject.exitCode = std::stol(valueCommandInvocationscommandInvokeInstancesinvokeInstance["ExitCode"].asString());
if(!valueCommandInvocationscommandInvokeInstancesinvokeInstance["ErrorInfo"].isNull())
invokeInstancesObject.errorInfo = valueCommandInvocationscommandInvokeInstancesinvokeInstance["ErrorInfo"].asString();
if(!valueCommandInvocationscommandInvokeInstancesinvokeInstance["ErrorCode"].isNull())
invokeInstancesObject.errorCode = valueCommandInvocationscommandInvokeInstancesinvokeInstance["ErrorCode"].asString();
commandInvocationsObject.invokeInstances.push_back(invokeInstancesObject);
}
commandInvocations_.push_back(commandInvocationsObject);
}
if(!value["TotalCount"].isNull())
totalCount_ = std::stoi(value["TotalCount"].asString());
if(!value["PageNumber"].isNull())
pageNumber_ = std::stoi(value["PageNumber"].asString());
if(!value["PageSize"].isNull())
pageSize_ = std::stoi(value["PageSize"].asString());
}
int DescribeCommandInvocationsResult::getTotalCount()const
{
return totalCount_;
}
int DescribeCommandInvocationsResult::getPageSize()const
{
return pageSize_;
}
int DescribeCommandInvocationsResult::getPageNumber()const
{
return pageNumber_;
}
std::vector<DescribeCommandInvocationsResult::Command> DescribeCommandInvocationsResult::getCommandInvocations()const
{
return commandInvocations_;
}

View File

@@ -0,0 +1,90 @@
/*
* 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/swas-open/model/DescribeCommandsRequest.h>
using AlibabaCloud::SWAS_OPEN::Model::DescribeCommandsRequest;
DescribeCommandsRequest::DescribeCommandsRequest()
: RpcServiceRequest("swas-open", "2020-06-01", "DescribeCommands") {
setMethod(HttpRequest::Method::Post);
}
DescribeCommandsRequest::~DescribeCommandsRequest() {}
std::string DescribeCommandsRequest::getType() const {
return type_;
}
void DescribeCommandsRequest::setType(const std::string &type) {
type_ = type;
setParameter(std::string("Type"), type);
}
std::string DescribeCommandsRequest::getCommandId() const {
return commandId_;
}
void DescribeCommandsRequest::setCommandId(const std::string &commandId) {
commandId_ = commandId;
setParameter(std::string("CommandId"), commandId);
}
std::string DescribeCommandsRequest::getPageNumber() const {
return pageNumber_;
}
void DescribeCommandsRequest::setPageNumber(const std::string &pageNumber) {
pageNumber_ = pageNumber;
setParameter(std::string("PageNumber"), pageNumber);
}
std::string DescribeCommandsRequest::getRegionId() const {
return regionId_;
}
void DescribeCommandsRequest::setRegionId(const std::string &regionId) {
regionId_ = regionId;
setParameter(std::string("RegionId"), regionId);
}
std::string DescribeCommandsRequest::getProvider() const {
return provider_;
}
void DescribeCommandsRequest::setProvider(const std::string &provider) {
provider_ = provider;
setParameter(std::string("Provider"), provider);
}
std::string DescribeCommandsRequest::getName() const {
return name_;
}
void DescribeCommandsRequest::setName(const std::string &name) {
name_ = name;
setParameter(std::string("Name"), name);
}
std::string DescribeCommandsRequest::getPageSize() const {
return pageSize_;
}
void DescribeCommandsRequest::setPageSize(const std::string &pageSize) {
pageSize_ = pageSize;
setParameter(std::string("PageSize"), pageSize);
}

View File

@@ -0,0 +1,116 @@
/*
* 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/swas-open/model/DescribeCommandsResult.h>
#include <json/json.h>
using namespace AlibabaCloud::SWAS_OPEN;
using namespace AlibabaCloud::SWAS_OPEN::Model;
DescribeCommandsResult::DescribeCommandsResult() :
ServiceResult()
{}
DescribeCommandsResult::DescribeCommandsResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DescribeCommandsResult::~DescribeCommandsResult()
{}
void DescribeCommandsResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allCommandsNode = value["Commands"]["command"];
for (auto valueCommandscommand : allCommandsNode)
{
Command commandsObject;
if(!valueCommandscommand["CommandId"].isNull())
commandsObject.commandId = valueCommandscommand["CommandId"].asString();
if(!valueCommandscommand["CreationTime"].isNull())
commandsObject.creationTime = valueCommandscommand["CreationTime"].asString();
if(!valueCommandscommand["Name"].isNull())
commandsObject.name = valueCommandscommand["Name"].asString();
if(!valueCommandscommand["Provider"].isNull())
commandsObject.provider = valueCommandscommand["Provider"].asString();
if(!valueCommandscommand["Type"].isNull())
commandsObject.type = valueCommandscommand["Type"].asString();
if(!valueCommandscommand["Timeout"].isNull())
commandsObject.timeout = std::stol(valueCommandscommand["Timeout"].asString());
if(!valueCommandscommand["Description"].isNull())
commandsObject.description = valueCommandscommand["Description"].asString();
if(!valueCommandscommand["WorkingDir"].isNull())
commandsObject.workingDir = valueCommandscommand["WorkingDir"].asString();
if(!valueCommandscommand["CommandContent"].isNull())
commandsObject.commandContent = valueCommandscommand["CommandContent"].asString();
if(!valueCommandscommand["EnableParameter"].isNull())
commandsObject.enableParameter = valueCommandscommand["EnableParameter"].asString() == "true";
auto allParameterDefinitionsNode = valueCommandscommand["ParameterDefinitions"]["parameterDefinition"];
for (auto valueCommandscommandParameterDefinitionsparameterDefinition : allParameterDefinitionsNode)
{
Command::ParameterDefinition parameterDefinitionsObject;
if(!valueCommandscommandParameterDefinitionsparameterDefinition["Required"].isNull())
parameterDefinitionsObject.required = valueCommandscommandParameterDefinitionsparameterDefinition["Required"].asString() == "true";
if(!valueCommandscommandParameterDefinitionsparameterDefinition["Description"].isNull())
parameterDefinitionsObject.description = valueCommandscommandParameterDefinitionsparameterDefinition["Description"].asString();
if(!valueCommandscommandParameterDefinitionsparameterDefinition["DefaultValue"].isNull())
parameterDefinitionsObject.defaultValue = valueCommandscommandParameterDefinitionsparameterDefinition["DefaultValue"].asString();
if(!valueCommandscommandParameterDefinitionsparameterDefinition["ParameterName"].isNull())
parameterDefinitionsObject.parameterName = valueCommandscommandParameterDefinitionsparameterDefinition["ParameterName"].asString();
auto allPossibleValues = value["PossibleValues"]["possibleValue"];
for (auto value : allPossibleValues)
parameterDefinitionsObject.possibleValues.push_back(value.asString());
commandsObject.parameterDefinitions.push_back(parameterDefinitionsObject);
}
auto allParameterNames = value["ParameterNames"]["parameterName"];
for (auto value : allParameterNames)
commandsObject.parameterNames.push_back(value.asString());
commands_.push_back(commandsObject);
}
if(!value["TotalCount"].isNull())
totalCount_ = std::stoi(value["TotalCount"].asString());
if(!value["PageNumber"].isNull())
pageNumber_ = std::stoi(value["PageNumber"].asString());
if(!value["PageSize"].isNull())
pageSize_ = std::stoi(value["PageSize"].asString());
}
int DescribeCommandsResult::getTotalCount()const
{
return totalCount_;
}
int DescribeCommandsResult::getPageSize()const
{
return pageSize_;
}
int DescribeCommandsResult::getPageNumber()const
{
return pageNumber_;
}
std::vector<DescribeCommandsResult::Command> DescribeCommandsResult::getCommands()const
{
return commands_;
}

View File

@@ -0,0 +1,74 @@
/*
* 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/swas-open/model/InvokeCommandRequest.h>
using AlibabaCloud::SWAS_OPEN::Model::InvokeCommandRequest;
InvokeCommandRequest::InvokeCommandRequest()
: RpcServiceRequest("swas-open", "2020-06-01", "InvokeCommand") {
setMethod(HttpRequest::Method::Post);
}
InvokeCommandRequest::~InvokeCommandRequest() {}
std::string InvokeCommandRequest::getCommandId() const {
return commandId_;
}
void InvokeCommandRequest::setCommandId(const std::string &commandId) {
commandId_ = commandId;
setParameter(std::string("CommandId"), commandId);
}
std::string InvokeCommandRequest::getRegionId() const {
return regionId_;
}
void InvokeCommandRequest::setRegionId(const std::string &regionId) {
regionId_ = regionId;
setParameter(std::string("RegionId"), regionId);
}
std::string InvokeCommandRequest::getInstanceIds() const {
return instanceIds_;
}
void InvokeCommandRequest::setInstanceIds(const std::string &instanceIds) {
instanceIds_ = instanceIds;
setParameter(std::string("InstanceIds"), instanceIds);
}
std::map<std::string, std::string> InvokeCommandRequest::getParameters() const {
return parameters_;
}
void InvokeCommandRequest::setParameters(const std::map<std::string, std::string> &parameters) {
parameters_ = parameters;
for(auto const &iter1 : parameters) {
setParameter(std::string("Parameters") + "." + iter1.first, iter1.second);
}
}
std::string InvokeCommandRequest::getUsername() const {
return username_;
}
void InvokeCommandRequest::setUsername(const std::string &username) {
username_ = username;
setParameter(std::string("Username"), username);
}

View File

@@ -0,0 +1,51 @@
/*
* 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/swas-open/model/InvokeCommandResult.h>
#include <json/json.h>
using namespace AlibabaCloud::SWAS_OPEN;
using namespace AlibabaCloud::SWAS_OPEN::Model;
InvokeCommandResult::InvokeCommandResult() :
ServiceResult()
{}
InvokeCommandResult::InvokeCommandResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
InvokeCommandResult::~InvokeCommandResult()
{}
void InvokeCommandResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["InvokeId"].isNull())
invokeId_ = value["InvokeId"].asString();
}
std::string InvokeCommandResult::getInvokeId()const
{
return invokeId_;
}

View File

@@ -0,0 +1,81 @@
/*
* 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/swas-open/model/UpdateCommandAttributeRequest.h>
using AlibabaCloud::SWAS_OPEN::Model::UpdateCommandAttributeRequest;
UpdateCommandAttributeRequest::UpdateCommandAttributeRequest()
: RpcServiceRequest("swas-open", "2020-06-01", "UpdateCommandAttribute") {
setMethod(HttpRequest::Method::Post);
}
UpdateCommandAttributeRequest::~UpdateCommandAttributeRequest() {}
std::string UpdateCommandAttributeRequest::getWorkingDir() const {
return workingDir_;
}
void UpdateCommandAttributeRequest::setWorkingDir(const std::string &workingDir) {
workingDir_ = workingDir;
setParameter(std::string("WorkingDir"), workingDir);
}
std::string UpdateCommandAttributeRequest::getDescription() const {
return description_;
}
void UpdateCommandAttributeRequest::setDescription(const std::string &description) {
description_ = description;
setParameter(std::string("Description"), description);
}
std::string UpdateCommandAttributeRequest::getCommandId() const {
return commandId_;
}
void UpdateCommandAttributeRequest::setCommandId(const std::string &commandId) {
commandId_ = commandId;
setParameter(std::string("CommandId"), commandId);
}
long UpdateCommandAttributeRequest::getTimeout() const {
return timeout_;
}
void UpdateCommandAttributeRequest::setTimeout(long timeout) {
timeout_ = timeout;
setParameter(std::string("Timeout"), std::to_string(timeout));
}
std::string UpdateCommandAttributeRequest::getRegionId() const {
return regionId_;
}
void UpdateCommandAttributeRequest::setRegionId(const std::string &regionId) {
regionId_ = regionId;
setParameter(std::string("RegionId"), regionId);
}
std::string UpdateCommandAttributeRequest::getName() const {
return name_;
}
void UpdateCommandAttributeRequest::setName(const std::string &name) {
name_ = name;
setParameter(std::string("Name"), name);
}

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