Change GetFileDetectResult Public.
This commit is contained in:
@@ -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
sas/src/model/CheckUserHasEcsRequest.cc
Normal file
54
sas/src/model/CheckUserHasEcsRequest.cc
Normal 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/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
sas/src/model/CheckUserHasEcsResult.cc
Normal file
72
sas/src/model/CheckUserHasEcsResult.cc
Normal 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/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_;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user