Generated 2020-06-01 for SWAS-OPEN.

This commit is contained in:
sdk-team
2024-06-17 11:00:44 +00:00
parent d37523f568
commit 29b4bc0ce3
50 changed files with 1831 additions and 30 deletions

View File

@@ -87,6 +87,42 @@ SWAS_OPENClient::AllocatePublicConnectionOutcomeCallable SWAS_OPENClient::alloca
return task->get_future();
}
SWAS_OPENClient::AttachKeyPairOutcome SWAS_OPENClient::attachKeyPair(const AttachKeyPairRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return AttachKeyPairOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return AttachKeyPairOutcome(AttachKeyPairResult(outcome.result()));
else
return AttachKeyPairOutcome(outcome.error());
}
void SWAS_OPENClient::attachKeyPairAsync(const AttachKeyPairRequest& request, const AttachKeyPairAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, attachKeyPair(request), context);
};
asyncExecute(new Runnable(fn));
}
SWAS_OPENClient::AttachKeyPairOutcomeCallable SWAS_OPENClient::attachKeyPairCallable(const AttachKeyPairRequest &request) const
{
auto task = std::make_shared<std::packaged_task<AttachKeyPairOutcome()>>(
[this, request]()
{
return this->attachKeyPair(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
SWAS_OPENClient::CreateCommandOutcome SWAS_OPENClient::createCommand(const CreateCommandRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -303,6 +339,42 @@ SWAS_OPENClient::CreateInstancesOutcomeCallable SWAS_OPENClient::createInstances
return task->get_future();
}
SWAS_OPENClient::CreateKeyPairOutcome SWAS_OPENClient::createKeyPair(const CreateKeyPairRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return CreateKeyPairOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return CreateKeyPairOutcome(CreateKeyPairResult(outcome.result()));
else
return CreateKeyPairOutcome(outcome.error());
}
void SWAS_OPENClient::createKeyPairAsync(const CreateKeyPairRequest& request, const CreateKeyPairAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, createKeyPair(request), context);
};
asyncExecute(new Runnable(fn));
}
SWAS_OPENClient::CreateKeyPairOutcomeCallable SWAS_OPENClient::createKeyPairCallable(const CreateKeyPairRequest &request) const
{
auto task = std::make_shared<std::packaged_task<CreateKeyPairOutcome()>>(
[this, request]()
{
return this->createKeyPair(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
SWAS_OPENClient::CreateSnapshotOutcome SWAS_OPENClient::createSnapshot(const CreateSnapshotRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -555,6 +627,42 @@ SWAS_OPENClient::DeleteInstanceKeyPairOutcomeCallable SWAS_OPENClient::deleteIns
return task->get_future();
}
SWAS_OPENClient::DeleteKeyPairsOutcome SWAS_OPENClient::deleteKeyPairs(const DeleteKeyPairsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DeleteKeyPairsOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DeleteKeyPairsOutcome(DeleteKeyPairsResult(outcome.result()));
else
return DeleteKeyPairsOutcome(outcome.error());
}
void SWAS_OPENClient::deleteKeyPairsAsync(const DeleteKeyPairsRequest& request, const DeleteKeyPairsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, deleteKeyPairs(request), context);
};
asyncExecute(new Runnable(fn));
}
SWAS_OPENClient::DeleteKeyPairsOutcomeCallable SWAS_OPENClient::deleteKeyPairsCallable(const DeleteKeyPairsRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DeleteKeyPairsOutcome()>>(
[this, request]()
{
return this->deleteKeyPairs(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
SWAS_OPENClient::DeleteSnapshotOutcome SWAS_OPENClient::deleteSnapshot(const DeleteSnapshotRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -1239,6 +1347,42 @@ SWAS_OPENClient::DescribeSecurityAgentStatusOutcomeCallable SWAS_OPENClient::des
return task->get_future();
}
SWAS_OPENClient::DetachKeyPairOutcome SWAS_OPENClient::detachKeyPair(const DetachKeyPairRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DetachKeyPairOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DetachKeyPairOutcome(DetachKeyPairResult(outcome.result()));
else
return DetachKeyPairOutcome(outcome.error());
}
void SWAS_OPENClient::detachKeyPairAsync(const DetachKeyPairRequest& request, const DetachKeyPairAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, detachKeyPair(request), context);
};
asyncExecute(new Runnable(fn));
}
SWAS_OPENClient::DetachKeyPairOutcomeCallable SWAS_OPENClient::detachKeyPairCallable(const DetachKeyPairRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DetachKeyPairOutcome()>>(
[this, request]()
{
return this->detachKeyPair(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
SWAS_OPENClient::DisableFirewallRuleOutcome SWAS_OPENClient::disableFirewallRule(const DisableFirewallRuleRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -1311,6 +1455,42 @@ SWAS_OPENClient::EnableFirewallRuleOutcomeCallable SWAS_OPENClient::enableFirewa
return task->get_future();
}
SWAS_OPENClient::ImportKeyPairOutcome SWAS_OPENClient::importKeyPair(const ImportKeyPairRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ImportKeyPairOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ImportKeyPairOutcome(ImportKeyPairResult(outcome.result()));
else
return ImportKeyPairOutcome(outcome.error());
}
void SWAS_OPENClient::importKeyPairAsync(const ImportKeyPairRequest& request, const ImportKeyPairAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, importKeyPair(request), context);
};
asyncExecute(new Runnable(fn));
}
SWAS_OPENClient::ImportKeyPairOutcomeCallable SWAS_OPENClient::importKeyPairCallable(const ImportKeyPairRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ImportKeyPairOutcome()>>(
[this, request]()
{
return this->importKeyPair(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
SWAS_OPENClient::InstallCloudAssistantOutcome SWAS_OPENClient::installCloudAssistant(const InstallCloudAssistantRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -1707,6 +1887,42 @@ SWAS_OPENClient::ListInstancesTrafficPackagesOutcomeCallable SWAS_OPENClient::li
return task->get_future();
}
SWAS_OPENClient::ListKeyPairsOutcome SWAS_OPENClient::listKeyPairs(const ListKeyPairsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ListKeyPairsOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ListKeyPairsOutcome(ListKeyPairsResult(outcome.result()));
else
return ListKeyPairsOutcome(outcome.error());
}
void SWAS_OPENClient::listKeyPairsAsync(const ListKeyPairsRequest& request, const ListKeyPairsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, listKeyPairs(request), context);
};
asyncExecute(new Runnable(fn));
}
SWAS_OPENClient::ListKeyPairsOutcomeCallable SWAS_OPENClient::listKeyPairsCallable(const ListKeyPairsRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ListKeyPairsOutcome()>>(
[this, request]()
{
return this->listKeyPairs(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
SWAS_OPENClient::ListPlansOutcome SWAS_OPENClient::listPlans(const ListPlansRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -0,0 +1,62 @@
/*
* 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/AttachKeyPairRequest.h>
using AlibabaCloud::SWAS_OPEN::Model::AttachKeyPairRequest;
AttachKeyPairRequest::AttachKeyPairRequest()
: RpcServiceRequest("swas-open", "2020-06-01", "AttachKeyPair") {
setMethod(HttpRequest::Method::Post);
}
AttachKeyPairRequest::~AttachKeyPairRequest() {}
std::string AttachKeyPairRequest::getClientToken() const {
return clientToken_;
}
void AttachKeyPairRequest::setClientToken(const std::string &clientToken) {
clientToken_ = clientToken;
setParameter(std::string("ClientToken"), clientToken);
}
std::string AttachKeyPairRequest::getKeyPairName() const {
return keyPairName_;
}
void AttachKeyPairRequest::setKeyPairName(const std::string &keyPairName) {
keyPairName_ = keyPairName;
setParameter(std::string("KeyPairName"), keyPairName);
}
std::string AttachKeyPairRequest::getRegionId() const {
return regionId_;
}
void AttachKeyPairRequest::setRegionId(const std::string &regionId) {
regionId_ = regionId;
setParameter(std::string("RegionId"), regionId);
}
std::vector<std::string> AttachKeyPairRequest::getInstanceIds() const {
return instanceIds_;
}
void AttachKeyPairRequest::setInstanceIds(const std::vector<std::string> &instanceIds) {
instanceIds_ = instanceIds;
}

View File

@@ -0,0 +1,77 @@
/*
* 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/AttachKeyPairResult.h>
#include <json/json.h>
using namespace AlibabaCloud::SWAS_OPEN;
using namespace AlibabaCloud::SWAS_OPEN::Model;
AttachKeyPairResult::AttachKeyPairResult() :
ServiceResult()
{}
AttachKeyPairResult::AttachKeyPairResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
AttachKeyPairResult::~AttachKeyPairResult()
{}
void AttachKeyPairResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allResultsNode = value["Results"]["Result"];
for (auto valueResultsResult : allResultsNode)
{
Result resultsObject;
if(!valueResultsResult["Code"].isNull())
resultsObject.code = valueResultsResult["Code"].asString();
if(!valueResultsResult["Message"].isNull())
resultsObject.message = valueResultsResult["Message"].asString();
if(!valueResultsResult["Success"].isNull())
resultsObject.success = valueResultsResult["Success"].asString();
if(!valueResultsResult["InstanceId"].isNull())
resultsObject.instanceId = valueResultsResult["InstanceId"].asString();
results_.push_back(resultsObject);
}
if(!value["TotalCount"].isNull())
totalCount_ = std::stoi(value["TotalCount"].asString());
if(!value["FailCount"].isNull())
failCount_ = std::stoi(value["FailCount"].asString());
}
int AttachKeyPairResult::getTotalCount()const
{
return totalCount_;
}
std::vector<AttachKeyPairResult::Result> AttachKeyPairResult::getResults()const
{
return results_;
}
int AttachKeyPairResult::getFailCount()const
{
return failCount_;
}

View File

@@ -70,6 +70,15 @@ void CreateCommandRequest::setTimeout(long timeout) {
setParameter(std::string("Timeout"), std::to_string(timeout));
}
std::string CreateCommandRequest::getResourceGroupId() const {
return resourceGroupId_;
}
void CreateCommandRequest::setResourceGroupId(const std::string &resourceGroupId) {
resourceGroupId_ = resourceGroupId;
setParameter(std::string("ResourceGroupId"), resourceGroupId);
}
std::string CreateCommandRequest::getRegionId() const {
return regionId_;
}

View File

@@ -61,6 +61,15 @@ void CreateCustomImageRequest::setDescription(const std::string &description) {
setParameter(std::string("Description"), description);
}
std::string CreateCustomImageRequest::getResoureGroupId() const {
return resoureGroupId_;
}
void CreateCustomImageRequest::setResoureGroupId(const std::string &resoureGroupId) {
resoureGroupId_ = resoureGroupId;
setParameter(std::string("ResoureGroupId"), resoureGroupId);
}
std::string CreateCustomImageRequest::getPlatform() const {
return platform_;
}

View File

@@ -0,0 +1,54 @@
/*
* 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/CreateKeyPairRequest.h>
using AlibabaCloud::SWAS_OPEN::Model::CreateKeyPairRequest;
CreateKeyPairRequest::CreateKeyPairRequest()
: RpcServiceRequest("swas-open", "2020-06-01", "CreateKeyPair") {
setMethod(HttpRequest::Method::Post);
}
CreateKeyPairRequest::~CreateKeyPairRequest() {}
std::string CreateKeyPairRequest::getClientToken() const {
return clientToken_;
}
void CreateKeyPairRequest::setClientToken(const std::string &clientToken) {
clientToken_ = clientToken;
setParameter(std::string("ClientToken"), clientToken);
}
std::string CreateKeyPairRequest::getKeyPairName() const {
return keyPairName_;
}
void CreateKeyPairRequest::setKeyPairName(const std::string &keyPairName) {
keyPairName_ = keyPairName;
setParameter(std::string("KeyPairName"), keyPairName);
}
std::string CreateKeyPairRequest::getRegionId() const {
return regionId_;
}
void CreateKeyPairRequest::setRegionId(const std::string &regionId) {
regionId_ = regionId;
setParameter(std::string("RegionId"), regionId);
}

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/swas-open/model/CreateKeyPairResult.h>
#include <json/json.h>
using namespace AlibabaCloud::SWAS_OPEN;
using namespace AlibabaCloud::SWAS_OPEN::Model;
CreateKeyPairResult::CreateKeyPairResult() :
ServiceResult()
{}
CreateKeyPairResult::CreateKeyPairResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
CreateKeyPairResult::~CreateKeyPairResult()
{}
void CreateKeyPairResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["KeyPairName"].isNull())
keyPairName_ = value["KeyPairName"].asString();
if(!value["PrivateKeyBody"].isNull())
privateKeyBody_ = value["PrivateKeyBody"].asString();
}
std::string CreateKeyPairResult::getKeyPairName()const
{
return keyPairName_;
}
std::string CreateKeyPairResult::getPrivateKeyBody()const
{
return privateKeyBody_;
}

View File

@@ -43,6 +43,15 @@ void CreateSnapshotRequest::setSnapshotName(const std::string &snapshotName) {
setParameter(std::string("SnapshotName"), snapshotName);
}
std::string CreateSnapshotRequest::getResourceGroupId() const {
return resourceGroupId_;
}
void CreateSnapshotRequest::setResourceGroupId(const std::string &resourceGroupId) {
resourceGroupId_ = resourceGroupId;
setParameter(std::string("ResourceGroupId"), resourceGroupId);
}
std::string CreateSnapshotRequest::getRegionId() const {
return regionId_;
}

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.
*/
#include <alibabacloud/swas-open/model/DeleteKeyPairsRequest.h>
using AlibabaCloud::SWAS_OPEN::Model::DeleteKeyPairsRequest;
DeleteKeyPairsRequest::DeleteKeyPairsRequest()
: RpcServiceRequest("swas-open", "2020-06-01", "DeleteKeyPairs") {
setMethod(HttpRequest::Method::Post);
}
DeleteKeyPairsRequest::~DeleteKeyPairsRequest() {}
std::string DeleteKeyPairsRequest::getClientToken() const {
return clientToken_;
}
void DeleteKeyPairsRequest::setClientToken(const std::string &clientToken) {
clientToken_ = clientToken;
setParameter(std::string("ClientToken"), clientToken);
}
std::vector<std::string> DeleteKeyPairsRequest::getKeyPairNames() const {
return keyPairNames_;
}
void DeleteKeyPairsRequest::setKeyPairNames(const std::vector<std::string> &keyPairNames) {
keyPairNames_ = keyPairNames;
}
std::string DeleteKeyPairsRequest::getRegionId() const {
return regionId_;
}
void DeleteKeyPairsRequest::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/DeleteKeyPairsResult.h>
#include <json/json.h>
using namespace AlibabaCloud::SWAS_OPEN;
using namespace AlibabaCloud::SWAS_OPEN::Model;
DeleteKeyPairsResult::DeleteKeyPairsResult() :
ServiceResult()
{}
DeleteKeyPairsResult::DeleteKeyPairsResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DeleteKeyPairsResult::~DeleteKeyPairsResult()
{}
void DeleteKeyPairsResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
}

View File

@@ -52,6 +52,15 @@ void DescribeCommandsRequest::setPageNumber(const std::string &pageNumber) {
setParameter(std::string("PageNumber"), pageNumber);
}
std::string DescribeCommandsRequest::getResourceGroupId() const {
return resourceGroupId_;
}
void DescribeCommandsRequest::setResourceGroupId(const std::string &resourceGroupId) {
resourceGroupId_ = resourceGroupId;
setParameter(std::string("ResourceGroupId"), resourceGroupId);
}
std::string DescribeCommandsRequest::getRegionId() const {
return regionId_;
}

View File

@@ -63,6 +63,8 @@ void DescribeCommandsResult::parse(const std::string &payload)
commandsObject.commandContent = valueCommandscommand["CommandContent"].asString();
if(!valueCommandscommand["EnableParameter"].isNull())
commandsObject.enableParameter = valueCommandscommand["EnableParameter"].asString() == "true";
if(!valueCommandscommand["ResourceGroupId"].isNull())
commandsObject.resourceGroupId = valueCommandscommand["ResourceGroupId"].asString();
auto allTagsNode = valueCommandscommand["Tags"]["tag"];
for (auto valueCommandscommandTagstag : allTagsNode)
{

View File

@@ -0,0 +1,62 @@
/*
* 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/DetachKeyPairRequest.h>
using AlibabaCloud::SWAS_OPEN::Model::DetachKeyPairRequest;
DetachKeyPairRequest::DetachKeyPairRequest()
: RpcServiceRequest("swas-open", "2020-06-01", "DetachKeyPair") {
setMethod(HttpRequest::Method::Post);
}
DetachKeyPairRequest::~DetachKeyPairRequest() {}
std::string DetachKeyPairRequest::getClientToken() const {
return clientToken_;
}
void DetachKeyPairRequest::setClientToken(const std::string &clientToken) {
clientToken_ = clientToken;
setParameter(std::string("ClientToken"), clientToken);
}
std::string DetachKeyPairRequest::getKeyPairName() const {
return keyPairName_;
}
void DetachKeyPairRequest::setKeyPairName(const std::string &keyPairName) {
keyPairName_ = keyPairName;
setParameter(std::string("KeyPairName"), keyPairName);
}
std::string DetachKeyPairRequest::getRegionId() const {
return regionId_;
}
void DetachKeyPairRequest::setRegionId(const std::string &regionId) {
regionId_ = regionId;
setParameter(std::string("RegionId"), regionId);
}
std::vector<std::string> DetachKeyPairRequest::getInstanceIds() const {
return instanceIds_;
}
void DetachKeyPairRequest::setInstanceIds(const std::vector<std::string> &instanceIds) {
instanceIds_ = instanceIds;
}

View File

@@ -0,0 +1,77 @@
/*
* 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/DetachKeyPairResult.h>
#include <json/json.h>
using namespace AlibabaCloud::SWAS_OPEN;
using namespace AlibabaCloud::SWAS_OPEN::Model;
DetachKeyPairResult::DetachKeyPairResult() :
ServiceResult()
{}
DetachKeyPairResult::DetachKeyPairResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DetachKeyPairResult::~DetachKeyPairResult()
{}
void DetachKeyPairResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allResultsNode = value["Results"]["Result"];
for (auto valueResultsResult : allResultsNode)
{
Result resultsObject;
if(!valueResultsResult["Code"].isNull())
resultsObject.code = valueResultsResult["Code"].asString();
if(!valueResultsResult["Message"].isNull())
resultsObject.message = valueResultsResult["Message"].asString();
if(!valueResultsResult["Success"].isNull())
resultsObject.success = valueResultsResult["Success"].asString();
if(!valueResultsResult["InstanceId"].isNull())
resultsObject.instanceId = valueResultsResult["InstanceId"].asString();
results_.push_back(resultsObject);
}
if(!value["TotalCount"].isNull())
totalCount_ = std::stoi(value["TotalCount"].asString());
if(!value["FailCount"].isNull())
failCount_ = std::stoi(value["FailCount"].asString());
}
int DetachKeyPairResult::getTotalCount()const
{
return totalCount_;
}
std::vector<DetachKeyPairResult::Result> DetachKeyPairResult::getResults()const
{
return results_;
}
int DetachKeyPairResult::getFailCount()const
{
return failCount_;
}

View File

@@ -0,0 +1,63 @@
/*
* 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/ImportKeyPairRequest.h>
using AlibabaCloud::SWAS_OPEN::Model::ImportKeyPairRequest;
ImportKeyPairRequest::ImportKeyPairRequest()
: RpcServiceRequest("swas-open", "2020-06-01", "ImportKeyPair") {
setMethod(HttpRequest::Method::Post);
}
ImportKeyPairRequest::~ImportKeyPairRequest() {}
std::string ImportKeyPairRequest::getClientToken() const {
return clientToken_;
}
void ImportKeyPairRequest::setClientToken(const std::string &clientToken) {
clientToken_ = clientToken;
setParameter(std::string("ClientToken"), clientToken);
}
std::string ImportKeyPairRequest::getPublicKeyBody() const {
return publicKeyBody_;
}
void ImportKeyPairRequest::setPublicKeyBody(const std::string &publicKeyBody) {
publicKeyBody_ = publicKeyBody;
setParameter(std::string("PublicKeyBody"), publicKeyBody);
}
std::string ImportKeyPairRequest::getKeyPairName() const {
return keyPairName_;
}
void ImportKeyPairRequest::setKeyPairName(const std::string &keyPairName) {
keyPairName_ = keyPairName;
setParameter(std::string("KeyPairName"), keyPairName);
}
std::string ImportKeyPairRequest::getRegionId() const {
return regionId_;
}
void ImportKeyPairRequest::setRegionId(const std::string &regionId) {
regionId_ = regionId;
setParameter(std::string("RegionId"), regionId);
}

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/ImportKeyPairResult.h>
#include <json/json.h>
using namespace AlibabaCloud::SWAS_OPEN;
using namespace AlibabaCloud::SWAS_OPEN::Model;
ImportKeyPairResult::ImportKeyPairResult() :
ServiceResult()
{}
ImportKeyPairResult::ImportKeyPairResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ImportKeyPairResult::~ImportKeyPairResult()
{}
void ImportKeyPairResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["KeyPairName"].isNull())
keyPairName_ = value["KeyPairName"].asString();
}
std::string ImportKeyPairResult::getKeyPairName()const
{
return keyPairName_;
}

View File

@@ -25,15 +25,6 @@ ListDisksRequest::ListDisksRequest()
ListDisksRequest::~ListDisksRequest() {}
std::string ListDisksRequest::getDiskType() const {
return diskType_;
}
void ListDisksRequest::setDiskType(const std::string &diskType) {
diskType_ = diskType;
setParameter(std::string("DiskType"), diskType);
}
int ListDisksRequest::getPageNumber() const {
return pageNumber_;
}
@@ -43,13 +34,13 @@ void ListDisksRequest::setPageNumber(int pageNumber) {
setParameter(std::string("PageNumber"), std::to_string(pageNumber));
}
std::string ListDisksRequest::getInstanceId() const {
return instanceId_;
std::string ListDisksRequest::getResourceGroupId() const {
return resourceGroupId_;
}
void ListDisksRequest::setInstanceId(const std::string &instanceId) {
instanceId_ = instanceId;
setParameter(std::string("InstanceId"), instanceId);
void ListDisksRequest::setResourceGroupId(const std::string &resourceGroupId) {
resourceGroupId_ = resourceGroupId;
setParameter(std::string("ResourceGroupId"), resourceGroupId);
}
std::string ListDisksRequest::getRegionId() const {
@@ -93,3 +84,21 @@ void ListDisksRequest::setTag(const std::vector<ListDisksRequest::Tag> &tag) {
}
}
std::string ListDisksRequest::getDiskType() const {
return diskType_;
}
void ListDisksRequest::setDiskType(const std::string &diskType) {
diskType_ = diskType;
setParameter(std::string("DiskType"), diskType);
}
std::string ListDisksRequest::getInstanceId() const {
return instanceId_;
}
void ListDisksRequest::setInstanceId(const std::string &instanceId) {
instanceId_ = instanceId;
setParameter(std::string("InstanceId"), instanceId);
}

View File

@@ -69,6 +69,8 @@ void ListDisksResult::parse(const std::string &payload)
disksObject.remark = valueDisksDisk["Remark"].asString();
if(!valueDisksDisk["InstanceName"].isNull())
disksObject.instanceName = valueDisksDisk["InstanceName"].asString();
if(!valueDisksDisk["ResourceGroupId"].isNull())
disksObject.resourceGroupId = valueDisksDisk["ResourceGroupId"].asString();
auto allTagsNode = valueDisksDisk["Tags"]["tag"];
for (auto valueDisksDiskTagstag : allTagsNode)
{

View File

@@ -34,6 +34,15 @@ void ListInstancesRequest::setPageNumber(int pageNumber) {
setParameter(std::string("PageNumber"), std::to_string(pageNumber));
}
std::string ListInstancesRequest::getResourceGroupId() const {
return resourceGroupId_;
}
void ListInstancesRequest::setResourceGroupId(const std::string &resourceGroupId) {
resourceGroupId_ = resourceGroupId;
setParameter(std::string("ResourceGroupId"), resourceGroupId);
}
std::string ListInstancesRequest::getRegionId() const {
return regionId_;
}
@@ -75,6 +84,15 @@ void ListInstancesRequest::setTag(const std::vector<ListInstancesRequest::Tag> &
}
}
std::string ListInstancesRequest::getInstanceName() const {
return instanceName_;
}
void ListInstancesRequest::setInstanceName(const std::string &instanceName) {
instanceName_ = instanceName;
setParameter(std::string("InstanceName"), instanceName);
}
std::string ListInstancesRequest::getInstanceIds() const {
return instanceIds_;
}

View File

@@ -77,6 +77,8 @@ void ListInstancesResult::parse(const std::string &payload)
instancesObject.combinationInstanceId = valueInstancesInstance["CombinationInstanceId"].asString();
if(!valueInstancesInstance["Uuid"].isNull())
instancesObject.uuid = valueInstancesInstance["Uuid"].asString();
if(!valueInstancesInstance["ResourceGroupId"].isNull())
instancesObject.resourceGroupId = valueInstancesInstance["ResourceGroupId"].asString();
auto allTagsNode = valueInstancesInstance["Tags"]["tag"];
for (auto valueInstancesInstanceTagstag : allTagsNode)
{
@@ -113,6 +115,8 @@ void ListInstancesResult::parse(const std::string &payload)
disksObject.regionId = valueInstancesInstanceDisksdisk["RegionId"].asString();
if(!valueInstancesInstanceDisksdisk["Remark"].isNull())
disksObject.remark = valueInstancesInstanceDisksdisk["Remark"].asString();
if(!valueInstancesInstanceDisksdisk["ResourceGroupId"].isNull())
disksObject.resourceGroupId = valueInstancesInstanceDisksdisk["ResourceGroupId"].asString();
auto allDiskTagsNode = valueInstancesInstanceDisksdisk["DiskTags"]["tag"];
for (auto valueInstancesInstanceDisksdiskDiskTagstag : allDiskTagsNode)
{

View File

@@ -0,0 +1,72 @@
/*
* 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/ListKeyPairsRequest.h>
using AlibabaCloud::SWAS_OPEN::Model::ListKeyPairsRequest;
ListKeyPairsRequest::ListKeyPairsRequest()
: RpcServiceRequest("swas-open", "2020-06-01", "ListKeyPairs") {
setMethod(HttpRequest::Method::Get);
}
ListKeyPairsRequest::~ListKeyPairsRequest() {}
std::string ListKeyPairsRequest::getClientToken() const {
return clientToken_;
}
void ListKeyPairsRequest::setClientToken(const std::string &clientToken) {
clientToken_ = clientToken;
setParameter(std::string("ClientToken"), clientToken);
}
std::string ListKeyPairsRequest::getKeyPairName() const {
return keyPairName_;
}
void ListKeyPairsRequest::setKeyPairName(const std::string &keyPairName) {
keyPairName_ = keyPairName;
setParameter(std::string("KeyPairName"), keyPairName);
}
int ListKeyPairsRequest::getPageNumber() const {
return pageNumber_;
}
void ListKeyPairsRequest::setPageNumber(int pageNumber) {
pageNumber_ = pageNumber;
setParameter(std::string("PageNumber"), std::to_string(pageNumber));
}
std::string ListKeyPairsRequest::getRegionId() const {
return regionId_;
}
void ListKeyPairsRequest::setRegionId(const std::string &regionId) {
regionId_ = regionId;
setParameter(std::string("RegionId"), regionId);
}
int ListKeyPairsRequest::getPageSize() const {
return pageSize_;
}
void ListKeyPairsRequest::setPageSize(int pageSize) {
pageSize_ = pageSize;
setParameter(std::string("PageSize"), std::to_string(pageSize));
}

View File

@@ -0,0 +1,85 @@
/*
* 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/ListKeyPairsResult.h>
#include <json/json.h>
using namespace AlibabaCloud::SWAS_OPEN;
using namespace AlibabaCloud::SWAS_OPEN::Model;
ListKeyPairsResult::ListKeyPairsResult() :
ServiceResult()
{}
ListKeyPairsResult::ListKeyPairsResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ListKeyPairsResult::~ListKeyPairsResult()
{}
void ListKeyPairsResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allKeyPairsNode = value["KeyPairs"]["KeyPair"];
for (auto valueKeyPairsKeyPair : allKeyPairsNode)
{
KeyPair keyPairsObject;
if(!valueKeyPairsKeyPair["CreationTime"].isNull())
keyPairsObject.creationTime = valueKeyPairsKeyPair["CreationTime"].asString();
if(!valueKeyPairsKeyPair["KeyPairName"].isNull())
keyPairsObject.keyPairName = valueKeyPairsKeyPair["KeyPairName"].asString();
if(!valueKeyPairsKeyPair["PublicKey"].isNull())
keyPairsObject.publicKey = valueKeyPairsKeyPair["PublicKey"].asString();
auto allInstanceIds = value["InstanceIds"]["InstanceId"];
for (auto value : allInstanceIds)
keyPairsObject.instanceIds.push_back(value.asString());
keyPairs_.push_back(keyPairsObject);
}
if(!value["TotalCount"].isNull())
totalCount_ = std::stoi(value["TotalCount"].asString());
if(!value["PageSize"].isNull())
pageSize_ = std::stoi(value["PageSize"].asString());
if(!value["PageNumber"].isNull())
pageNumber_ = std::stoi(value["PageNumber"].asString());
}
int ListKeyPairsResult::getTotalCount()const
{
return totalCount_;
}
int ListKeyPairsResult::getPageSize()const
{
return pageSize_;
}
int ListKeyPairsResult::getPageNumber()const
{
return pageNumber_;
}
std::vector<ListKeyPairsResult::KeyPair> ListKeyPairsResult::getKeyPairs()const
{
return keyPairs_;
}

View File

@@ -43,6 +43,15 @@ void ListSnapshotsRequest::setPageNumber(int pageNumber) {
setParameter(std::string("PageNumber"), std::to_string(pageNumber));
}
std::string ListSnapshotsRequest::getResourceGroupId() const {
return resourceGroupId_;
}
void ListSnapshotsRequest::setResourceGroupId(const std::string &resourceGroupId) {
resourceGroupId_ = resourceGroupId;
setParameter(std::string("ResourceGroupId"), resourceGroupId);
}
std::string ListSnapshotsRequest::getRegionId() const {
return regionId_;
}

View File

@@ -65,6 +65,8 @@ void ListSnapshotsResult::parse(const std::string &payload)
snapshotsObject.instanceId = valueSnapshotsSnapshot["InstanceId"].asString();
if(!valueSnapshotsSnapshot["RollbackTime"].isNull())
snapshotsObject.rollbackTime = valueSnapshotsSnapshot["RollbackTime"].asString();
if(!valueSnapshotsSnapshot["ResourceGroupId"].isNull())
snapshotsObject.resourceGroupId = valueSnapshotsSnapshot["ResourceGroupId"].asString();
auto allTagsNode = valueSnapshotsSnapshot["Tags"]["tag"];
for (auto valueSnapshotsSnapshotTagstag : allTagsNode)
{