Add open file detect api.

This commit is contained in:
sdk-team
2022-07-15 02:25:17 +00:00
parent 143a7b3400
commit 25bbb2bf65
25 changed files with 545 additions and 39 deletions

View File

@@ -2823,6 +2823,42 @@ SasClient::DescribeInstanceAntiBruteForceRulesOutcomeCallable SasClient::describ
return task->get_future();
}
SasClient::DescribeInstanceRebootStatusOutcome SasClient::describeInstanceRebootStatus(const DescribeInstanceRebootStatusRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DescribeInstanceRebootStatusOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DescribeInstanceRebootStatusOutcome(DescribeInstanceRebootStatusResult(outcome.result()));
else
return DescribeInstanceRebootStatusOutcome(outcome.error());
}
void SasClient::describeInstanceRebootStatusAsync(const DescribeInstanceRebootStatusRequest& request, const DescribeInstanceRebootStatusAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, describeInstanceRebootStatus(request), context);
};
asyncExecute(new Runnable(fn));
}
SasClient::DescribeInstanceRebootStatusOutcomeCallable SasClient::describeInstanceRebootStatusCallable(const DescribeInstanceRebootStatusRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DescribeInstanceRebootStatusOutcome()>>(
[this, request]()
{
return this->describeInstanceRebootStatus(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
SasClient::DescribeInstanceStatisticsOutcome SasClient::describeInstanceStatistics(const DescribeInstanceStatisticsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -6927,6 +6963,42 @@ SasClient::QueryGroupedSecurityEventMarkMissListOutcomeCallable SasClient::query
return task->get_future();
}
SasClient::RebootMachineOutcome SasClient::rebootMachine(const RebootMachineRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return RebootMachineOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return RebootMachineOutcome(RebootMachineResult(outcome.result()));
else
return RebootMachineOutcome(outcome.error());
}
void SasClient::rebootMachineAsync(const RebootMachineRequest& request, const RebootMachineAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, rebootMachine(request), context);
};
asyncExecute(new Runnable(fn));
}
SasClient::RebootMachineOutcomeCallable SasClient::rebootMachineCallable(const RebootMachineRequest &request) const
{
auto task = std::make_shared<std::packaged_task<RebootMachineOutcome()>>(
[this, request]()
{
return this->rebootMachine(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
SasClient::RefreshAssetsOutcome SasClient::refreshAssets(const RefreshAssetsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -65,6 +65,10 @@ void DescribeCheckWarningSummaryResult::parse(const std::string &payload)
warningSummarysObject.riskName = valueWarningSummarysWarningSummary["RiskName"].asString();
if(!valueWarningSummarysWarningSummary["Level"].isNull())
warningSummarysObject.level = valueWarningSummarysWarningSummary["Level"].asString();
if(!valueWarningSummarysWarningSummary["CheckExploit"].isNull())
warningSummarysObject.checkExploit = valueWarningSummarysWarningSummary["CheckExploit"].asString() == "true";
if(!valueWarningSummarysWarningSummary["DatabaseRisk"].isNull())
warningSummarysObject.databaseRisk = valueWarningSummarysWarningSummary["DatabaseRisk"].asString() == "true";
warningSummarys_.push_back(warningSummarysObject);
}
if(!value["CurrentPage"].isNull())

View File

@@ -34,6 +34,15 @@ void DescribeCheckWarningsRequest::setUuid(const std::string &uuid) {
setParameter(std::string("Uuid"), uuid);
}
std::string DescribeCheckWarningsRequest::getCheckType() const {
return checkType_;
}
void DescribeCheckWarningsRequest::setCheckType(const std::string &checkType) {
checkType_ = checkType;
setParameter(std::string("CheckType"), checkType);
}
std::string DescribeCheckWarningsRequest::getSourceIp() const {
return sourceIp_;
}

View File

@@ -57,6 +57,10 @@ void DescribeCheckWarningsResult::parse(const std::string &payload)
checkWarningsObject.checkId = std::stol(valueCheckWarningsCheckWarning["CheckId"].asString());
if(!valueCheckWarningsCheckWarning["Level"].isNull())
checkWarningsObject.level = valueCheckWarningsCheckWarning["Level"].asString();
if(!valueCheckWarningsCheckWarning["Reason"].isNull())
checkWarningsObject.reason = valueCheckWarningsCheckWarning["Reason"].asString();
if(!valueCheckWarningsCheckWarning["FixStatus"].isNull())
checkWarningsObject.fixStatus = std::stoi(valueCheckWarningsCheckWarning["FixStatus"].asString());
checkWarnings_.push_back(checkWarningsObject);
}
if(!value["CurrentPage"].isNull())

View File

@@ -49,6 +49,8 @@ void DescribeCriteriaResult::parse(const std::string &payload)
criteriaListObject.name = valueCriteriaListCriteria["Name"].asString();
if(!valueCriteriaListCriteria["Values"].isNull())
criteriaListObject.values = valueCriteriaListCriteria["Values"].asString();
if(!valueCriteriaListCriteria["MultiValues"].isNull())
criteriaListObject.multiValues = valueCriteriaListCriteria["MultiValues"].asString();
criteriaList_.push_back(criteriaListObject);
}

View File

@@ -0,0 +1,45 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/sas/model/DescribeInstanceRebootStatusRequest.h>
using AlibabaCloud::Sas::Model::DescribeInstanceRebootStatusRequest;
DescribeInstanceRebootStatusRequest::DescribeInstanceRebootStatusRequest()
: RpcServiceRequest("sas", "2018-12-03", "DescribeInstanceRebootStatus") {
setMethod(HttpRequest::Method::Post);
}
DescribeInstanceRebootStatusRequest::~DescribeInstanceRebootStatusRequest() {}
std::string DescribeInstanceRebootStatusRequest::getSourceIp() const {
return sourceIp_;
}
void DescribeInstanceRebootStatusRequest::setSourceIp(const std::string &sourceIp) {
sourceIp_ = sourceIp;
setParameter(std::string("SourceIp"), sourceIp);
}
std::string DescribeInstanceRebootStatusRequest::getUuids() const {
return uuids_;
}
void DescribeInstanceRebootStatusRequest::setUuids(const std::string &uuids) {
uuids_ = uuids;
setParameter(std::string("Uuids"), uuids);
}

View File

@@ -0,0 +1,70 @@
/*
* 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/DescribeInstanceRebootStatusResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Sas;
using namespace AlibabaCloud::Sas::Model;
DescribeInstanceRebootStatusResult::DescribeInstanceRebootStatusResult() :
ServiceResult()
{}
DescribeInstanceRebootStatusResult::DescribeInstanceRebootStatusResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DescribeInstanceRebootStatusResult::~DescribeInstanceRebootStatusResult()
{}
void DescribeInstanceRebootStatusResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allRebootStatusesNode = value["RebootStatuses"]["RebootStatus"];
for (auto valueRebootStatusesRebootStatus : allRebootStatusesNode)
{
RebootStatus rebootStatusesObject;
if(!valueRebootStatusesRebootStatus["Uuid"].isNull())
rebootStatusesObject.uuid = valueRebootStatusesRebootStatus["Uuid"].asString();
if(!valueRebootStatusesRebootStatus["RebootStatus"].isNull())
rebootStatusesObject.rebootStatus = std::stoi(valueRebootStatusesRebootStatus["RebootStatus"].asString());
if(!valueRebootStatusesRebootStatus["Code"].isNull())
rebootStatusesObject.code = valueRebootStatusesRebootStatus["Code"].asString();
if(!valueRebootStatusesRebootStatus["Msg"].isNull())
rebootStatusesObject.msg = valueRebootStatusesRebootStatus["Msg"].asString();
rebootStatuses_.push_back(rebootStatusesObject);
}
if(!value["TotalCount"].isNull())
totalCount_ = std::stoi(value["TotalCount"].asString());
}
std::vector<DescribeInstanceRebootStatusResult::RebootStatus> DescribeInstanceRebootStatusResult::getRebootStatuses()const
{
return rebootStatuses_;
}
int DescribeInstanceRebootStatusResult::getTotalCount()const
{
return totalCount_;
}

View File

@@ -39,24 +39,6 @@ void DescribeRiskCheckItemResultResult::parse(const std::string &payload)
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto pageContentResourceNode = value["PageContentResource"];
if(!pageContentResourceNode["CurrentPage"].isNull())
pageContentResource_.currentPage = std::stoi(pageContentResourceNode["CurrentPage"].asString());
if(!pageContentResourceNode["ContentResource"].isNull())
pageContentResource_.contentResource = pageContentResourceNode["ContentResource"].asString();
if(!pageContentResourceNode["PageSize"].isNull())
pageContentResource_.pageSize = std::stoi(pageContentResourceNode["PageSize"].asString());
if(!pageContentResourceNode["TotalCount"].isNull())
pageContentResource_.totalCount = std::stoi(pageContentResourceNode["TotalCount"].asString());
if(!pageContentResourceNode["PageCount"].isNull())
pageContentResource_.pageCount = std::stoi(pageContentResourceNode["PageCount"].asString());
if(!pageContentResourceNode["Count"].isNull())
pageContentResource_.count = std::stoi(pageContentResourceNode["Count"].asString());
}
DescribeRiskCheckItemResultResult::PageContentResource DescribeRiskCheckItemResultResult::getPageContentResource()const
{
return pageContentResource_;
}

View File

@@ -67,6 +67,10 @@ void DescribeWarningMachinesResult::parse(const std::string &payload)
warningMachinesObject.passCount = std::stoi(valueWarningMachinesWarningMachine["PassCount"].asString());
if(!valueWarningMachinesWarningMachine["InstanceName"].isNull())
warningMachinesObject.instanceName = valueWarningMachinesWarningMachine["InstanceName"].asString();
if(!valueWarningMachinesWarningMachine["Bind"].isNull())
warningMachinesObject.bind = valueWarningMachinesWarningMachine["Bind"].asString() == "true";
if(!valueWarningMachinesWarningMachine["AuthVersion"].isNull())
warningMachinesObject.authVersion = std::stoi(valueWarningMachinesWarningMachine["AuthVersion"].asString());
warningMachines_.push_back(warningMachinesObject);
}
if(!value["CurrentPage"].isNull())

View File

@@ -0,0 +1,45 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/sas/model/RebootMachineRequest.h>
using AlibabaCloud::Sas::Model::RebootMachineRequest;
RebootMachineRequest::RebootMachineRequest()
: RpcServiceRequest("sas", "2018-12-03", "RebootMachine") {
setMethod(HttpRequest::Method::Post);
}
RebootMachineRequest::~RebootMachineRequest() {}
std::string RebootMachineRequest::getUuid() const {
return uuid_;
}
void RebootMachineRequest::setUuid(const std::string &uuid) {
uuid_ = uuid;
setParameter(std::string("Uuid"), uuid);
}
std::string RebootMachineRequest::getSourceIp() const {
return sourceIp_;
}
void RebootMachineRequest::setSourceIp(const std::string &sourceIp) {
sourceIp_ = sourceIp;
setParameter(std::string("SourceIp"), sourceIp);
}

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