Forráskód Böngészése

Change GetFileDetectResult Public.

sdk-team 4 éve
szülő
commit
6f733cd473

+ 1 - 1
VERSION

@@ -1 +1 @@
-1.36.1240
+1.36.1241

+ 4 - 0
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

+ 8 - 0
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<Error, Model::CheckSecurityEventIdResult> CheckSecurityEventIdOutcome;
 			typedef std::future<CheckSecurityEventIdOutcome> CheckSecurityEventIdOutcomeCallable;
 			typedef std::function<void(const SasClient*, const Model::CheckSecurityEventIdRequest&, const CheckSecurityEventIdOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CheckSecurityEventIdAsyncHandler;
+			typedef Outcome<Error, Model::CheckUserHasEcsResult> CheckUserHasEcsOutcome;
+			typedef std::future<CheckUserHasEcsOutcome> CheckUserHasEcsOutcomeCallable;
+			typedef std::function<void(const SasClient*, const Model::CheckUserHasEcsRequest&, const CheckUserHasEcsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CheckUserHasEcsAsyncHandler;
 			typedef Outcome<Error, Model::CreateAntiBruteForceRuleResult> CreateAntiBruteForceRuleOutcome;
 			typedef std::future<CreateAntiBruteForceRuleOutcome> CreateAntiBruteForceRuleOutcomeCallable;
 			typedef std::function<void(const SasClient*, const Model::CreateAntiBruteForceRuleRequest&, const CreateAntiBruteForceRuleOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> 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<const AsyncCallerContext>& 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<const AsyncCallerContext>& 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<const AsyncCallerContext>& context = nullptr) const;
 			CreateAntiBruteForceRuleOutcomeCallable createAntiBruteForceRuleCallable(const Model::CreateAntiBruteForceRuleRequest& request) const;

+ 48 - 0
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 <alibabacloud/sas/SasExport.h>
+#include <alibabacloud/core/RpcServiceRequest.h>
+#include <string>
+#include <vector>
+#include <map>
+
+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_

+ 57 - 0
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 <string>
+#include <vector>
+#include <utility>
+#include <alibabacloud/core/ServiceResult.h>
+#include <alibabacloud/sas/SasExport.h>
+
+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_

+ 1 - 0
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;

+ 3 - 3
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<List> getHoneypotNodeList()const;
+				std::vector<HoneypotNode> 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<List> honeypotNodeList_;
+				std::vector<HoneypotNode> honeypotNodeList_;
 				std::string message_;
 				int httpStatusCode_;
 				std::string code_;

+ 36 - 0
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<const AsyncCallerContext>& 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<std::packaged_task<CheckUserHasEcsOutcome()>>(
+			[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();

+ 54 - 0
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 <alibabacloud/sas/model/CheckUserHasEcsRequest.h>
+
+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));
+}
+

+ 72 - 0
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 <alibabacloud/sas/model/CheckUserHasEcsResult.h>
+#include <json/json.h>
+
+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_;
+}
+

+ 2 - 0
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)
 		{

+ 30 - 30
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::List> ListHoneypotNodeResult::getHoneypotNodeList()const
+std::vector<ListHoneypotNodeResult::HoneypotNode> ListHoneypotNodeResult::getHoneypotNodeList()const
 {
 	return honeypotNodeList_;
 }