@@ -25,12 +25,12 @@ set(yundun_public_header_model
|
||||
include/alibabacloud/yundun/model/TodayqpsByRegionResult.h
|
||||
include/alibabacloud/yundun/model/TodayAllppsRequest.h
|
||||
include/alibabacloud/yundun/model/TodayAllppsResult.h
|
||||
include/alibabacloud/yundun/model/TodayBackdoorRequest.h
|
||||
include/alibabacloud/yundun/model/TodayBackdoorResult.h
|
||||
include/alibabacloud/yundun/model/TodayCrackInterceptRequest.h
|
||||
include/alibabacloud/yundun/model/TodayCrackInterceptResult.h
|
||||
include/alibabacloud/yundun/model/AllMalwareNumRequest.h
|
||||
include/alibabacloud/yundun/model/AllMalwareNumResult.h
|
||||
include/alibabacloud/yundun/model/TodayCrackInterceptRequest.h
|
||||
include/alibabacloud/yundun/model/TodayCrackInterceptResult.h
|
||||
include/alibabacloud/yundun/model/TodayBackdoorRequest.h
|
||||
include/alibabacloud/yundun/model/TodayBackdoorResult.h
|
||||
include/alibabacloud/yundun/model/TodayMalwareNumRequest.h
|
||||
include/alibabacloud/yundun/model/TodayMalwareNumResult.h
|
||||
include/alibabacloud/yundun/model/WebAttackNumRequest.h
|
||||
@@ -48,12 +48,12 @@ set(yundun_src
|
||||
src/model/TodayqpsByRegionResult.cc
|
||||
src/model/TodayAllppsRequest.cc
|
||||
src/model/TodayAllppsResult.cc
|
||||
src/model/TodayBackdoorRequest.cc
|
||||
src/model/TodayBackdoorResult.cc
|
||||
src/model/TodayCrackInterceptRequest.cc
|
||||
src/model/TodayCrackInterceptResult.cc
|
||||
src/model/AllMalwareNumRequest.cc
|
||||
src/model/AllMalwareNumResult.cc
|
||||
src/model/TodayCrackInterceptRequest.cc
|
||||
src/model/TodayCrackInterceptResult.cc
|
||||
src/model/TodayBackdoorRequest.cc
|
||||
src/model/TodayBackdoorResult.cc
|
||||
src/model/TodayMalwareNumRequest.cc
|
||||
src/model/TodayMalwareNumResult.cc
|
||||
src/model/WebAttackNumRequest.cc
|
||||
|
||||
@@ -26,12 +26,12 @@
|
||||
#include "model/TodayqpsByRegionResult.h"
|
||||
#include "model/TodayAllppsRequest.h"
|
||||
#include "model/TodayAllppsResult.h"
|
||||
#include "model/TodayBackdoorRequest.h"
|
||||
#include "model/TodayBackdoorResult.h"
|
||||
#include "model/TodayCrackInterceptRequest.h"
|
||||
#include "model/TodayCrackInterceptResult.h"
|
||||
#include "model/AllMalwareNumRequest.h"
|
||||
#include "model/AllMalwareNumResult.h"
|
||||
#include "model/TodayCrackInterceptRequest.h"
|
||||
#include "model/TodayCrackInterceptResult.h"
|
||||
#include "model/TodayBackdoorRequest.h"
|
||||
#include "model/TodayBackdoorResult.h"
|
||||
#include "model/TodayMalwareNumRequest.h"
|
||||
#include "model/TodayMalwareNumResult.h"
|
||||
#include "model/WebAttackNumRequest.h"
|
||||
@@ -57,15 +57,15 @@ namespace AlibabaCloud
|
||||
typedef Outcome<Error, Model::TodayAllppsResult> TodayAllppsOutcome;
|
||||
typedef std::future<TodayAllppsOutcome> TodayAllppsOutcomeCallable;
|
||||
typedef std::function<void(const YundunClient*, const Model::TodayAllppsRequest&, const TodayAllppsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> TodayAllppsAsyncHandler;
|
||||
typedef Outcome<Error, Model::TodayBackdoorResult> TodayBackdoorOutcome;
|
||||
typedef std::future<TodayBackdoorOutcome> TodayBackdoorOutcomeCallable;
|
||||
typedef std::function<void(const YundunClient*, const Model::TodayBackdoorRequest&, const TodayBackdoorOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> TodayBackdoorAsyncHandler;
|
||||
typedef Outcome<Error, Model::TodayCrackInterceptResult> TodayCrackInterceptOutcome;
|
||||
typedef std::future<TodayCrackInterceptOutcome> TodayCrackInterceptOutcomeCallable;
|
||||
typedef std::function<void(const YundunClient*, const Model::TodayCrackInterceptRequest&, const TodayCrackInterceptOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> TodayCrackInterceptAsyncHandler;
|
||||
typedef Outcome<Error, Model::AllMalwareNumResult> AllMalwareNumOutcome;
|
||||
typedef std::future<AllMalwareNumOutcome> AllMalwareNumOutcomeCallable;
|
||||
typedef std::function<void(const YundunClient*, const Model::AllMalwareNumRequest&, const AllMalwareNumOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> AllMalwareNumAsyncHandler;
|
||||
typedef Outcome<Error, Model::TodayCrackInterceptResult> TodayCrackInterceptOutcome;
|
||||
typedef std::future<TodayCrackInterceptOutcome> TodayCrackInterceptOutcomeCallable;
|
||||
typedef std::function<void(const YundunClient*, const Model::TodayCrackInterceptRequest&, const TodayCrackInterceptOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> TodayCrackInterceptAsyncHandler;
|
||||
typedef Outcome<Error, Model::TodayBackdoorResult> TodayBackdoorOutcome;
|
||||
typedef std::future<TodayBackdoorOutcome> TodayBackdoorOutcomeCallable;
|
||||
typedef std::function<void(const YundunClient*, const Model::TodayBackdoorRequest&, const TodayBackdoorOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> TodayBackdoorAsyncHandler;
|
||||
typedef Outcome<Error, Model::TodayMalwareNumResult> TodayMalwareNumOutcome;
|
||||
typedef std::future<TodayMalwareNumOutcome> TodayMalwareNumOutcomeCallable;
|
||||
typedef std::function<void(const YundunClient*, const Model::TodayMalwareNumRequest&, const TodayMalwareNumOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> TodayMalwareNumAsyncHandler;
|
||||
@@ -92,15 +92,15 @@ namespace AlibabaCloud
|
||||
TodayAllppsOutcome todayAllpps(const Model::TodayAllppsRequest &request)const;
|
||||
void todayAllppsAsync(const Model::TodayAllppsRequest& request, const TodayAllppsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
TodayAllppsOutcomeCallable todayAllppsCallable(const Model::TodayAllppsRequest& request) const;
|
||||
TodayBackdoorOutcome todayBackdoor(const Model::TodayBackdoorRequest &request)const;
|
||||
void todayBackdoorAsync(const Model::TodayBackdoorRequest& request, const TodayBackdoorAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
TodayBackdoorOutcomeCallable todayBackdoorCallable(const Model::TodayBackdoorRequest& request) const;
|
||||
TodayCrackInterceptOutcome todayCrackIntercept(const Model::TodayCrackInterceptRequest &request)const;
|
||||
void todayCrackInterceptAsync(const Model::TodayCrackInterceptRequest& request, const TodayCrackInterceptAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
TodayCrackInterceptOutcomeCallable todayCrackInterceptCallable(const Model::TodayCrackInterceptRequest& request) const;
|
||||
AllMalwareNumOutcome allMalwareNum(const Model::AllMalwareNumRequest &request)const;
|
||||
void allMalwareNumAsync(const Model::AllMalwareNumRequest& request, const AllMalwareNumAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
AllMalwareNumOutcomeCallable allMalwareNumCallable(const Model::AllMalwareNumRequest& request) const;
|
||||
TodayCrackInterceptOutcome todayCrackIntercept(const Model::TodayCrackInterceptRequest &request)const;
|
||||
void todayCrackInterceptAsync(const Model::TodayCrackInterceptRequest& request, const TodayCrackInterceptAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
TodayCrackInterceptOutcomeCallable todayCrackInterceptCallable(const Model::TodayCrackInterceptRequest& request) const;
|
||||
TodayBackdoorOutcome todayBackdoor(const Model::TodayBackdoorRequest &request)const;
|
||||
void todayBackdoorAsync(const Model::TodayBackdoorRequest& request, const TodayBackdoorAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
TodayBackdoorOutcomeCallable todayBackdoorCallable(const Model::TodayBackdoorRequest& request) const;
|
||||
TodayMalwareNumOutcome todayMalwareNum(const Model::TodayMalwareNumRequest &request)const;
|
||||
void todayMalwareNumAsync(const Model::TodayMalwareNumRequest& request, const TodayMalwareNumAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
TodayMalwareNumOutcomeCallable todayMalwareNumCallable(const Model::TodayMalwareNumRequest& request) const;
|
||||
|
||||
@@ -123,36 +123,36 @@ YundunClient::TodayAllppsOutcomeCallable YundunClient::todayAllppsCallable(const
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
YundunClient::TodayBackdoorOutcome YundunClient::todayBackdoor(const TodayBackdoorRequest &request) const
|
||||
YundunClient::AllMalwareNumOutcome YundunClient::allMalwareNum(const AllMalwareNumRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return TodayBackdoorOutcome(endpointOutcome.error());
|
||||
return AllMalwareNumOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return TodayBackdoorOutcome(TodayBackdoorResult(outcome.result()));
|
||||
return AllMalwareNumOutcome(AllMalwareNumResult(outcome.result()));
|
||||
else
|
||||
return TodayBackdoorOutcome(outcome.error());
|
||||
return AllMalwareNumOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void YundunClient::todayBackdoorAsync(const TodayBackdoorRequest& request, const TodayBackdoorAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
void YundunClient::allMalwareNumAsync(const AllMalwareNumRequest& request, const AllMalwareNumAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, todayBackdoor(request), context);
|
||||
handler(this, request, allMalwareNum(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
YundunClient::TodayBackdoorOutcomeCallable YundunClient::todayBackdoorCallable(const TodayBackdoorRequest &request) const
|
||||
YundunClient::AllMalwareNumOutcomeCallable YundunClient::allMalwareNumCallable(const AllMalwareNumRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<TodayBackdoorOutcome()>>(
|
||||
auto task = std::make_shared<std::packaged_task<AllMalwareNumOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->todayBackdoor(request);
|
||||
return this->allMalwareNum(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
@@ -195,36 +195,36 @@ YundunClient::TodayCrackInterceptOutcomeCallable YundunClient::todayCrackInterce
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
YundunClient::AllMalwareNumOutcome YundunClient::allMalwareNum(const AllMalwareNumRequest &request) const
|
||||
YundunClient::TodayBackdoorOutcome YundunClient::todayBackdoor(const TodayBackdoorRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return AllMalwareNumOutcome(endpointOutcome.error());
|
||||
return TodayBackdoorOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return AllMalwareNumOutcome(AllMalwareNumResult(outcome.result()));
|
||||
return TodayBackdoorOutcome(TodayBackdoorResult(outcome.result()));
|
||||
else
|
||||
return AllMalwareNumOutcome(outcome.error());
|
||||
return TodayBackdoorOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void YundunClient::allMalwareNumAsync(const AllMalwareNumRequest& request, const AllMalwareNumAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
void YundunClient::todayBackdoorAsync(const TodayBackdoorRequest& request, const TodayBackdoorAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, allMalwareNum(request), context);
|
||||
handler(this, request, todayBackdoor(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
YundunClient::AllMalwareNumOutcomeCallable YundunClient::allMalwareNumCallable(const AllMalwareNumRequest &request) const
|
||||
YundunClient::TodayBackdoorOutcomeCallable YundunClient::todayBackdoorCallable(const TodayBackdoorRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<AllMalwareNumOutcome()>>(
|
||||
auto task = std::make_shared<std::packaged_task<TodayBackdoorOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->allMalwareNum(request);
|
||||
return this->todayBackdoor(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
|
||||
@@ -35,10 +35,13 @@ AllMalwareNumResult::~AllMalwareNumResult()
|
||||
|
||||
void AllMalwareNumResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::CharReaderBuilder builder;
|
||||
Json::CharReader *reader = builder.newCharReader();
|
||||
Json::Value *val;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
JSONCPP_STRING *errs;
|
||||
reader->parse(payload.data(), payload.data() + payload.size(), val, errs);
|
||||
value = *val;
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["AllMalwareNum"].isNull())
|
||||
allMalwareNum_ = std::stol(value["AllMalwareNum"].asString());
|
||||
|
||||
@@ -35,10 +35,13 @@ CurrentDdosAttackNumResult::~CurrentDdosAttackNumResult()
|
||||
|
||||
void CurrentDdosAttackNumResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::CharReaderBuilder builder;
|
||||
Json::CharReader *reader = builder.newCharReader();
|
||||
Json::Value *val;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
JSONCPP_STRING *errs;
|
||||
reader->parse(payload.data(), payload.data() + payload.size(), val, errs);
|
||||
value = *val;
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["CurrentDdosAttackNum"].isNull())
|
||||
currentDdosAttackNum_ = std::stol(value["CurrentDdosAttackNum"].asString());
|
||||
|
||||
@@ -35,10 +35,13 @@ TodayAegisOnlineRateResult::~TodayAegisOnlineRateResult()
|
||||
|
||||
void TodayAegisOnlineRateResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::CharReaderBuilder builder;
|
||||
Json::CharReader *reader = builder.newCharReader();
|
||||
Json::Value *val;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
JSONCPP_STRING *errs;
|
||||
reader->parse(payload.data(), payload.data() + payload.size(), val, errs);
|
||||
value = *val;
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Rate"].isNull())
|
||||
rate_ = std::stol(value["Rate"].asString());
|
||||
|
||||
@@ -35,10 +35,13 @@ TodayAllkbpsResult::~TodayAllkbpsResult()
|
||||
|
||||
void TodayAllkbpsResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::CharReaderBuilder builder;
|
||||
Json::CharReader *reader = builder.newCharReader();
|
||||
Json::Value *val;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
JSONCPP_STRING *errs;
|
||||
reader->parse(payload.data(), payload.data() + payload.size(), val, errs);
|
||||
value = *val;
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Kbps"].isNull())
|
||||
kbps_ = std::stol(value["Kbps"].asString());
|
||||
|
||||
@@ -35,10 +35,13 @@ TodayAllppsResult::~TodayAllppsResult()
|
||||
|
||||
void TodayAllppsResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::CharReaderBuilder builder;
|
||||
Json::CharReader *reader = builder.newCharReader();
|
||||
Json::Value *val;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
JSONCPP_STRING *errs;
|
||||
reader->parse(payload.data(), payload.data() + payload.size(), val, errs);
|
||||
value = *val;
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Pps"].isNull())
|
||||
pps_ = std::stol(value["Pps"].asString());
|
||||
|
||||
@@ -35,10 +35,13 @@ TodayBackdoorResult::~TodayBackdoorResult()
|
||||
|
||||
void TodayBackdoorResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::CharReaderBuilder builder;
|
||||
Json::CharReader *reader = builder.newCharReader();
|
||||
Json::Value *val;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
JSONCPP_STRING *errs;
|
||||
reader->parse(payload.data(), payload.data() + payload.size(), val, errs);
|
||||
value = *val;
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Backdoor"].isNull())
|
||||
backdoor_ = std::stol(value["Backdoor"].asString());
|
||||
|
||||
@@ -35,10 +35,13 @@ TodayCrackInterceptResult::~TodayCrackInterceptResult()
|
||||
|
||||
void TodayCrackInterceptResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::CharReaderBuilder builder;
|
||||
Json::CharReader *reader = builder.newCharReader();
|
||||
Json::Value *val;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
JSONCPP_STRING *errs;
|
||||
reader->parse(payload.data(), payload.data() + payload.size(), val, errs);
|
||||
value = *val;
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["InterceptNum"].isNull())
|
||||
interceptNum_ = std::stol(value["InterceptNum"].asString());
|
||||
|
||||
@@ -35,10 +35,13 @@ TodayMalwareNumResult::~TodayMalwareNumResult()
|
||||
|
||||
void TodayMalwareNumResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::CharReaderBuilder builder;
|
||||
Json::CharReader *reader = builder.newCharReader();
|
||||
Json::Value *val;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
JSONCPP_STRING *errs;
|
||||
reader->parse(payload.data(), payload.data() + payload.size(), val, errs);
|
||||
value = *val;
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["TodayMalwareNum"].isNull())
|
||||
todayMalwareNum_ = std::stol(value["TodayMalwareNum"].asString());
|
||||
|
||||
@@ -35,10 +35,13 @@ TodayqpsByRegionResult::~TodayqpsByRegionResult()
|
||||
|
||||
void TodayqpsByRegionResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::CharReaderBuilder builder;
|
||||
Json::CharReader *reader = builder.newCharReader();
|
||||
Json::Value *val;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
JSONCPP_STRING *errs;
|
||||
reader->parse(payload.data(), payload.data() + payload.size(), val, errs);
|
||||
value = *val;
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allData = value["Data"]["Region"];
|
||||
for (auto value : allData)
|
||||
|
||||
@@ -35,10 +35,13 @@ WebAttackNumResult::~WebAttackNumResult()
|
||||
|
||||
void WebAttackNumResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::CharReaderBuilder builder;
|
||||
Json::CharReader *reader = builder.newCharReader();
|
||||
Json::Value *val;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
JSONCPP_STRING *errs;
|
||||
reader->parse(payload.data(), payload.data() + payload.size(), val, errs);
|
||||
value = *val;
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["WebAttackNum"].isNull())
|
||||
webAttackNum_ = std::stol(value["WebAttackNum"].asString());
|
||||
|
||||
Reference in New Issue
Block a user