diff --git a/VERSION b/VERSION index 2cdd2e67a..18c5c9984 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.1240 \ No newline at end of file +1.36.1241 \ No newline at end of file diff --git a/sas/CMakeLists.txt b/sas/CMakeLists.txt index 0a384aa23..88018ac8f 100644 --- a/sas/CMakeLists.txt +++ b/sas/CMakeLists.txt @@ -29,6 +29,8 @@ set(sas_public_header_model include/alibabacloud/sas/model/CheckQuaraFileIdResult.h include/alibabacloud/sas/model/CheckSecurityEventIdRequest.h include/alibabacloud/sas/model/CheckSecurityEventIdResult.h + include/alibabacloud/sas/model/CheckUserHasEcsRequest.h + include/alibabacloud/sas/model/CheckUserHasEcsResult.h include/alibabacloud/sas/model/CreateAntiBruteForceRuleRequest.h include/alibabacloud/sas/model/CreateAntiBruteForceRuleResult.h include/alibabacloud/sas/model/CreateBackupPolicyRequest.h @@ -470,6 +472,8 @@ set(sas_src src/model/CheckQuaraFileIdResult.cc src/model/CheckSecurityEventIdRequest.cc src/model/CheckSecurityEventIdResult.cc + src/model/CheckUserHasEcsRequest.cc + src/model/CheckUserHasEcsResult.cc src/model/CreateAntiBruteForceRuleRequest.cc src/model/CreateAntiBruteForceRuleResult.cc src/model/CreateBackupPolicyRequest.cc diff --git a/sas/include/alibabacloud/sas/SasClient.h b/sas/include/alibabacloud/sas/SasClient.h index 2388fd8c1..b355b16db 100644 --- a/sas/include/alibabacloud/sas/SasClient.h +++ b/sas/include/alibabacloud/sas/SasClient.h @@ -30,6 +30,8 @@ #include "model/CheckQuaraFileIdResult.h" #include "model/CheckSecurityEventIdRequest.h" #include "model/CheckSecurityEventIdResult.h" +#include "model/CheckUserHasEcsRequest.h" +#include "model/CheckUserHasEcsResult.h" #include "model/CreateAntiBruteForceRuleRequest.h" #include "model/CreateAntiBruteForceRuleResult.h" #include "model/CreateBackupPolicyRequest.h" @@ -481,6 +483,9 @@ namespace AlibabaCloud typedef Outcome CheckSecurityEventIdOutcome; typedef std::future CheckSecurityEventIdOutcomeCallable; typedef std::function&)> CheckSecurityEventIdAsyncHandler; + typedef Outcome CheckUserHasEcsOutcome; + typedef std::future CheckUserHasEcsOutcomeCallable; + typedef std::function&)> CheckUserHasEcsAsyncHandler; typedef Outcome CreateAntiBruteForceRuleOutcome; typedef std::future CreateAntiBruteForceRuleOutcomeCallable; typedef std::function&)> CreateAntiBruteForceRuleAsyncHandler; @@ -1143,6 +1148,9 @@ namespace AlibabaCloud CheckSecurityEventIdOutcome checkSecurityEventId(const Model::CheckSecurityEventIdRequest &request)const; void checkSecurityEventIdAsync(const Model::CheckSecurityEventIdRequest& request, const CheckSecurityEventIdAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; CheckSecurityEventIdOutcomeCallable checkSecurityEventIdCallable(const Model::CheckSecurityEventIdRequest& request) const; + CheckUserHasEcsOutcome checkUserHasEcs(const Model::CheckUserHasEcsRequest &request)const; + void checkUserHasEcsAsync(const Model::CheckUserHasEcsRequest& request, const CheckUserHasEcsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + CheckUserHasEcsOutcomeCallable checkUserHasEcsCallable(const Model::CheckUserHasEcsRequest& request) const; CreateAntiBruteForceRuleOutcome createAntiBruteForceRule(const Model::CreateAntiBruteForceRuleRequest &request)const; void createAntiBruteForceRuleAsync(const Model::CreateAntiBruteForceRuleRequest& request, const CreateAntiBruteForceRuleAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; CreateAntiBruteForceRuleOutcomeCallable createAntiBruteForceRuleCallable(const Model::CreateAntiBruteForceRuleRequest& request) const; diff --git a/sas/include/alibabacloud/sas/model/CheckUserHasEcsRequest.h b/sas/include/alibabacloud/sas/model/CheckUserHasEcsRequest.h new file mode 100644 index 000000000..8b11e69e7 --- /dev/null +++ b/sas/include/alibabacloud/sas/model/CheckUserHasEcsRequest.h @@ -0,0 +1,48 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_SAS_MODEL_CHECKUSERHASECSREQUEST_H_ +#define ALIBABACLOUD_SAS_MODEL_CHECKUSERHASECSREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace Sas { +namespace Model { +class ALIBABACLOUD_SAS_EXPORT CheckUserHasEcsRequest : public RpcServiceRequest { +public: + CheckUserHasEcsRequest(); + ~CheckUserHasEcsRequest(); + int getPageSize() const; + void setPageSize(int pageSize); + std::string getLang() const; + void setLang(const std::string &lang); + int getCurrentPage() const; + void setCurrentPage(int currentPage); + +private: + int pageSize_; + std::string lang_; + int currentPage_; +}; +} // namespace Model +} // namespace Sas +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_SAS_MODEL_CHECKUSERHASECSREQUEST_H_ diff --git a/sas/include/alibabacloud/sas/model/CheckUserHasEcsResult.h b/sas/include/alibabacloud/sas/model/CheckUserHasEcsResult.h new file mode 100644 index 000000000..758c8ab7f --- /dev/null +++ b/sas/include/alibabacloud/sas/model/CheckUserHasEcsResult.h @@ -0,0 +1,57 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_SAS_MODEL_CHECKUSERHASECSRESULT_H_ +#define ALIBABACLOUD_SAS_MODEL_CHECKUSERHASECSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Sas + { + namespace Model + { + class ALIBABACLOUD_SAS_EXPORT CheckUserHasEcsResult : public ServiceResult + { + public: + + + CheckUserHasEcsResult(); + explicit CheckUserHasEcsResult(const std::string &payload); + ~CheckUserHasEcsResult(); + std::string getMessage()const; + bool getData()const; + std::string getCode()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + bool data_; + std::string code_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_SAS_MODEL_CHECKUSERHASECSRESULT_H_ \ No newline at end of file diff --git a/sas/include/alibabacloud/sas/model/DescribeSuspEventsResult.h b/sas/include/alibabacloud/sas/model/DescribeSuspEventsResult.h index 627b203d6..0ea2c036e 100644 --- a/sas/include/alibabacloud/sas/model/DescribeSuspEventsResult.h +++ b/sas/include/alibabacloud/sas/model/DescribeSuspEventsResult.h @@ -74,6 +74,7 @@ namespace AlibabaCloud std::string saleVersion; std::string containerImageId; std::string dataSource; + bool displaySandboxResult; std::string occurrenceTime; std::string instanceName; long operateTime; diff --git a/sas/include/alibabacloud/sas/model/ListHoneypotNodeResult.h b/sas/include/alibabacloud/sas/model/ListHoneypotNodeResult.h index de22a1d54..172467be6 100644 --- a/sas/include/alibabacloud/sas/model/ListHoneypotNodeResult.h +++ b/sas/include/alibabacloud/sas/model/ListHoneypotNodeResult.h @@ -40,7 +40,7 @@ namespace AlibabaCloud int count; std::string lastRowKey; }; - struct List + struct HoneypotNode { int probeTotalCount; std::string nodeName; @@ -63,7 +63,7 @@ namespace AlibabaCloud explicit ListHoneypotNodeResult(const std::string &payload); ~ListHoneypotNodeResult(); PageInfo getPageInfo()const; - std::vector getHoneypotNodeList()const; + std::vector getHoneypotNodeList()const; std::string getMessage()const; int getHttpStatusCode()const; std::string getCode()const; @@ -73,7 +73,7 @@ namespace AlibabaCloud void parse(const std::string &payload); private: PageInfo pageInfo_; - std::vector honeypotNodeList_; + std::vector honeypotNodeList_; std::string message_; int httpStatusCode_; std::string code_; diff --git a/sas/src/SasClient.cc b/sas/src/SasClient.cc index 8451b37e1..65224e8e5 100644 --- a/sas/src/SasClient.cc +++ b/sas/src/SasClient.cc @@ -195,6 +195,42 @@ SasClient::CheckSecurityEventIdOutcomeCallable SasClient::checkSecurityEventIdCa return task->get_future(); } +SasClient::CheckUserHasEcsOutcome SasClient::checkUserHasEcs(const CheckUserHasEcsRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return CheckUserHasEcsOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return CheckUserHasEcsOutcome(CheckUserHasEcsResult(outcome.result())); + else + return CheckUserHasEcsOutcome(outcome.error()); +} + +void SasClient::checkUserHasEcsAsync(const CheckUserHasEcsRequest& request, const CheckUserHasEcsAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, checkUserHasEcs(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +SasClient::CheckUserHasEcsOutcomeCallable SasClient::checkUserHasEcsCallable(const CheckUserHasEcsRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->checkUserHasEcs(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + SasClient::CreateAntiBruteForceRuleOutcome SasClient::createAntiBruteForceRule(const CreateAntiBruteForceRuleRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/sas/src/model/CheckUserHasEcsRequest.cc b/sas/src/model/CheckUserHasEcsRequest.cc new file mode 100644 index 000000000..67203f1d4 --- /dev/null +++ b/sas/src/model/CheckUserHasEcsRequest.cc @@ -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 + +using AlibabaCloud::Sas::Model::CheckUserHasEcsRequest; + +CheckUserHasEcsRequest::CheckUserHasEcsRequest() + : RpcServiceRequest("sas", "2018-12-03", "CheckUserHasEcs") { + setMethod(HttpRequest::Method::Post); +} + +CheckUserHasEcsRequest::~CheckUserHasEcsRequest() {} + +int CheckUserHasEcsRequest::getPageSize() const { + return pageSize_; +} + +void CheckUserHasEcsRequest::setPageSize(int pageSize) { + pageSize_ = pageSize; + setParameter(std::string("PageSize"), std::to_string(pageSize)); +} + +std::string CheckUserHasEcsRequest::getLang() const { + return lang_; +} + +void CheckUserHasEcsRequest::setLang(const std::string &lang) { + lang_ = lang; + setParameter(std::string("Lang"), lang); +} + +int CheckUserHasEcsRequest::getCurrentPage() const { + return currentPage_; +} + +void CheckUserHasEcsRequest::setCurrentPage(int currentPage) { + currentPage_ = currentPage; + setParameter(std::string("CurrentPage"), std::to_string(currentPage)); +} + diff --git a/sas/src/model/CheckUserHasEcsResult.cc b/sas/src/model/CheckUserHasEcsResult.cc new file mode 100644 index 000000000..ef762a5ce --- /dev/null +++ b/sas/src/model/CheckUserHasEcsResult.cc @@ -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 +#include + +using namespace AlibabaCloud::Sas; +using namespace AlibabaCloud::Sas::Model; + +CheckUserHasEcsResult::CheckUserHasEcsResult() : + ServiceResult() +{} + +CheckUserHasEcsResult::CheckUserHasEcsResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +CheckUserHasEcsResult::~CheckUserHasEcsResult() +{} + +void CheckUserHasEcsResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["Data"].isNull()) + data_ = value["Data"].asString() == "true"; + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; + if(!value["Code"].isNull()) + code_ = value["Code"].asString(); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + +} + +std::string CheckUserHasEcsResult::getMessage()const +{ + return message_; +} + +bool CheckUserHasEcsResult::getData()const +{ + return data_; +} + +std::string CheckUserHasEcsResult::getCode()const +{ + return code_; +} + +bool CheckUserHasEcsResult::getSuccess()const +{ + return success_; +} + diff --git a/sas/src/model/DescribeSuspEventsResult.cc b/sas/src/model/DescribeSuspEventsResult.cc index 63e23ddd0..01f4832b0 100644 --- a/sas/src/model/DescribeSuspEventsResult.cc +++ b/sas/src/model/DescribeSuspEventsResult.cc @@ -135,6 +135,8 @@ void DescribeSuspEventsResult::parse(const std::string &payload) suspEventsObject.level = valueSuspEventsWarningSummary["Level"].asString(); if(!valueSuspEventsWarningSummary["Id"].isNull()) suspEventsObject.id = std::stol(valueSuspEventsWarningSummary["Id"].asString()); + if(!valueSuspEventsWarningSummary["DisplaySandboxResult"].isNull()) + suspEventsObject.displaySandboxResult = valueSuspEventsWarningSummary["DisplaySandboxResult"].asString() == "true"; auto allTacticItemsNode = valueSuspEventsWarningSummary["TacticItems"]["TacticItem"]; for (auto valueSuspEventsWarningSummaryTacticItemsTacticItem : allTacticItemsNode) { diff --git a/sas/src/model/ListHoneypotNodeResult.cc b/sas/src/model/ListHoneypotNodeResult.cc index 78664512d..db3b0c404 100644 --- a/sas/src/model/ListHoneypotNodeResult.cc +++ b/sas/src/model/ListHoneypotNodeResult.cc @@ -39,36 +39,36 @@ void ListHoneypotNodeResult::parse(const std::string &payload) Json::Value value; reader.parse(payload, value); setRequestId(value["RequestId"].asString()); - auto allHoneypotNodeListNode = value["HoneypotNodeList"]["List"]; - for (auto valueHoneypotNodeListList : allHoneypotNodeListNode) + auto allHoneypotNodeListNode = value["HoneypotNodeList"]["HoneypotNode"]; + for (auto valueHoneypotNodeListHoneypotNode : allHoneypotNodeListNode) { - List honeypotNodeListObject; - if(!valueHoneypotNodeListList["NodeId"].isNull()) - honeypotNodeListObject.nodeId = valueHoneypotNodeListList["NodeId"].asString(); - if(!valueHoneypotNodeListList["NodeName"].isNull()) - honeypotNodeListObject.nodeName = valueHoneypotNodeListList["NodeName"].asString(); - if(!valueHoneypotNodeListList["NodeVersion"].isNull()) - honeypotNodeListObject.nodeVersion = valueHoneypotNodeListList["NodeVersion"].asString(); - if(!valueHoneypotNodeListList["HoneypotTotalCount"].isNull()) - honeypotNodeListObject.honeypotTotalCount = std::stoi(valueHoneypotNodeListList["HoneypotTotalCount"].asString()); - if(!valueHoneypotNodeListList["HoneypotUsedCount"].isNull()) - honeypotNodeListObject.honeypotUsedCount = std::stoi(valueHoneypotNodeListList["HoneypotUsedCount"].asString()); - if(!valueHoneypotNodeListList["ProbeTotalCount"].isNull()) - honeypotNodeListObject.probeTotalCount = std::stoi(valueHoneypotNodeListList["ProbeTotalCount"].asString()); - if(!valueHoneypotNodeListList["ProbeUsedCount"].isNull()) - honeypotNodeListObject.probeUsedCount = std::stoi(valueHoneypotNodeListList["ProbeUsedCount"].asString()); - if(!valueHoneypotNodeListList["TotalStatus"].isNull()) - honeypotNodeListObject.totalStatus = std::stoi(valueHoneypotNodeListList["TotalStatus"].asString()); - if(!valueHoneypotNodeListList["EcsInstanceId"].isNull()) - honeypotNodeListObject.ecsInstanceId = valueHoneypotNodeListList["EcsInstanceId"].asString(); - if(!valueHoneypotNodeListList["CreateTime"].isNull()) - honeypotNodeListObject.createTime = valueHoneypotNodeListList["CreateTime"].asString(); - if(!valueHoneypotNodeListList["AllowHoneypotAccessInternet"].isNull()) - honeypotNodeListObject.allowHoneypotAccessInternet = valueHoneypotNodeListList["AllowHoneypotAccessInternet"].asString() == "true"; - if(!valueHoneypotNodeListList["DefaultNode"].isNull()) - honeypotNodeListObject.defaultNode = valueHoneypotNodeListList["DefaultNode"].asString() == "true"; - if(!valueHoneypotNodeListList["NodeIp"].isNull()) - honeypotNodeListObject.nodeIp = valueHoneypotNodeListList["NodeIp"].asString(); + HoneypotNode honeypotNodeListObject; + if(!valueHoneypotNodeListHoneypotNode["NodeId"].isNull()) + honeypotNodeListObject.nodeId = valueHoneypotNodeListHoneypotNode["NodeId"].asString(); + if(!valueHoneypotNodeListHoneypotNode["NodeName"].isNull()) + honeypotNodeListObject.nodeName = valueHoneypotNodeListHoneypotNode["NodeName"].asString(); + if(!valueHoneypotNodeListHoneypotNode["NodeVersion"].isNull()) + honeypotNodeListObject.nodeVersion = valueHoneypotNodeListHoneypotNode["NodeVersion"].asString(); + if(!valueHoneypotNodeListHoneypotNode["HoneypotTotalCount"].isNull()) + honeypotNodeListObject.honeypotTotalCount = std::stoi(valueHoneypotNodeListHoneypotNode["HoneypotTotalCount"].asString()); + if(!valueHoneypotNodeListHoneypotNode["HoneypotUsedCount"].isNull()) + honeypotNodeListObject.honeypotUsedCount = std::stoi(valueHoneypotNodeListHoneypotNode["HoneypotUsedCount"].asString()); + if(!valueHoneypotNodeListHoneypotNode["ProbeTotalCount"].isNull()) + honeypotNodeListObject.probeTotalCount = std::stoi(valueHoneypotNodeListHoneypotNode["ProbeTotalCount"].asString()); + if(!valueHoneypotNodeListHoneypotNode["ProbeUsedCount"].isNull()) + honeypotNodeListObject.probeUsedCount = std::stoi(valueHoneypotNodeListHoneypotNode["ProbeUsedCount"].asString()); + if(!valueHoneypotNodeListHoneypotNode["TotalStatus"].isNull()) + honeypotNodeListObject.totalStatus = std::stoi(valueHoneypotNodeListHoneypotNode["TotalStatus"].asString()); + if(!valueHoneypotNodeListHoneypotNode["EcsInstanceId"].isNull()) + honeypotNodeListObject.ecsInstanceId = valueHoneypotNodeListHoneypotNode["EcsInstanceId"].asString(); + if(!valueHoneypotNodeListHoneypotNode["CreateTime"].isNull()) + honeypotNodeListObject.createTime = valueHoneypotNodeListHoneypotNode["CreateTime"].asString(); + if(!valueHoneypotNodeListHoneypotNode["AllowHoneypotAccessInternet"].isNull()) + honeypotNodeListObject.allowHoneypotAccessInternet = valueHoneypotNodeListHoneypotNode["AllowHoneypotAccessInternet"].asString() == "true"; + if(!valueHoneypotNodeListHoneypotNode["DefaultNode"].isNull()) + honeypotNodeListObject.defaultNode = valueHoneypotNodeListHoneypotNode["DefaultNode"].asString() == "true"; + if(!valueHoneypotNodeListHoneypotNode["NodeIp"].isNull()) + honeypotNodeListObject.nodeIp = valueHoneypotNodeListHoneypotNode["NodeIp"].asString(); auto allSecurityGroupProbeIpList = value["SecurityGroupProbeIpList"]["SecurityGroupProbeIp"]; for (auto value : allSecurityGroupProbeIpList) honeypotNodeListObject.securityGroupProbeIpList.push_back(value.asString()); @@ -101,7 +101,7 @@ ListHoneypotNodeResult::PageInfo ListHoneypotNodeResult::getPageInfo()const return pageInfo_; } -std::vector ListHoneypotNodeResult::getHoneypotNodeList()const +std::vector ListHoneypotNodeResult::getHoneypotNodeList()const { return honeypotNodeList_; }