Get the capicity which cloud siem user used until yesterday.
This commit is contained in:
94
cloud-siem/CMakeLists.txt
Normal file
94
cloud-siem/CMakeLists.txt
Normal file
@@ -0,0 +1,94 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
set(public_header_dir ${CMAKE_CURRENT_SOURCE_DIR}/../include)
|
||||
|
||||
set(cloud-siem_public_header
|
||||
include/alibabacloud/cloud-siem/Cloud_siemClient.h
|
||||
include/alibabacloud/cloud-siem/Cloud_siemExport.h )
|
||||
|
||||
set(cloud-siem_public_header_model
|
||||
include/alibabacloud/cloud-siem/model/BatchJobCheckRequest.h
|
||||
include/alibabacloud/cloud-siem/model/BatchJobCheckResult.h
|
||||
include/alibabacloud/cloud-siem/model/BatchJobSubmitRequest.h
|
||||
include/alibabacloud/cloud-siem/model/BatchJobSubmitResult.h
|
||||
include/alibabacloud/cloud-siem/model/SendMessageRequest.h
|
||||
include/alibabacloud/cloud-siem/model/SendMessageResult.h )
|
||||
|
||||
set(cloud-siem_src
|
||||
src/Cloud-siemClient.cc
|
||||
src/model/BatchJobCheckRequest.cc
|
||||
src/model/BatchJobCheckResult.cc
|
||||
src/model/BatchJobSubmitRequest.cc
|
||||
src/model/BatchJobSubmitResult.cc
|
||||
src/model/SendMessageRequest.cc
|
||||
src/model/SendMessageResult.cc )
|
||||
|
||||
add_library(cloud-siem ${LIB_TYPE}
|
||||
${cloud-siem_public_header}
|
||||
${cloud-siem_public_header_model}
|
||||
${cloud-siem_src})
|
||||
|
||||
set_target_properties(cloud-siem
|
||||
PROPERTIES
|
||||
LINKER_LANGUAGE CXX
|
||||
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
|
||||
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
|
||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||
OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}cloud-siem
|
||||
)
|
||||
|
||||
if(${LIB_TYPE} STREQUAL "SHARED")
|
||||
set_target_properties(cloud-siem
|
||||
PROPERTIES
|
||||
DEFINE_SYMBOL ALIBABACLOUD_CLOUD_SIEM_LIBRARY)
|
||||
endif()
|
||||
|
||||
target_include_directories(cloud-siem
|
||||
PRIVATE include
|
||||
${CMAKE_SOURCE_DIR}/core/include
|
||||
)
|
||||
target_link_libraries(cloud-siem
|
||||
core)
|
||||
|
||||
if(CMAKE_HOST_WIN32)
|
||||
ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
|
||||
set(jsoncpp_install_dir ${INSTALL_DIR})
|
||||
add_dependencies(cloud-siem
|
||||
jsoncpp)
|
||||
target_include_directories(cloud-siem
|
||||
PRIVATE ${jsoncpp_install_dir}/include)
|
||||
target_link_libraries(cloud-siem
|
||||
${jsoncpp_install_dir}/lib/jsoncpp.lib)
|
||||
set_target_properties(cloud-siem
|
||||
PROPERTIES
|
||||
COMPILE_OPTIONS "/bigobj")
|
||||
else()
|
||||
target_include_directories(cloud-siem
|
||||
PRIVATE /usr/include/jsoncpp)
|
||||
target_link_libraries(cloud-siem
|
||||
jsoncpp)
|
||||
endif()
|
||||
|
||||
install(FILES ${cloud-siem_public_header}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/cloud-siem)
|
||||
install(FILES ${cloud-siem_public_header_model}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/cloud-siem/model)
|
||||
install(TARGETS cloud-siem
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_CLOUD_SIEM_CLOUD_SIEMCLIENT_H_
|
||||
#define ALIBABACLOUD_CLOUD_SIEM_CLOUD_SIEMCLIENT_H_
|
||||
|
||||
#include <future>
|
||||
#include <alibabacloud/core/AsyncCallerContext.h>
|
||||
#include <alibabacloud/core/EndpointProvider.h>
|
||||
#include <alibabacloud/core/RpcServiceClient.h>
|
||||
#include "Cloud_siemExport.h"
|
||||
#include "model/BatchJobCheckRequest.h"
|
||||
#include "model/BatchJobCheckResult.h"
|
||||
#include "model/BatchJobSubmitRequest.h"
|
||||
#include "model/BatchJobSubmitResult.h"
|
||||
#include "model/SendMessageRequest.h"
|
||||
#include "model/SendMessageResult.h"
|
||||
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Cloud_siem
|
||||
{
|
||||
class ALIBABACLOUD_CLOUD_SIEM_EXPORT Cloud_siemClient : public RpcServiceClient
|
||||
{
|
||||
public:
|
||||
typedef Outcome<Error, Model::BatchJobCheckResult> BatchJobCheckOutcome;
|
||||
typedef std::future<BatchJobCheckOutcome> BatchJobCheckOutcomeCallable;
|
||||
typedef std::function<void(const Cloud_siemClient*, const Model::BatchJobCheckRequest&, const BatchJobCheckOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> BatchJobCheckAsyncHandler;
|
||||
typedef Outcome<Error, Model::BatchJobSubmitResult> BatchJobSubmitOutcome;
|
||||
typedef std::future<BatchJobSubmitOutcome> BatchJobSubmitOutcomeCallable;
|
||||
typedef std::function<void(const Cloud_siemClient*, const Model::BatchJobSubmitRequest&, const BatchJobSubmitOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> BatchJobSubmitAsyncHandler;
|
||||
typedef Outcome<Error, Model::SendMessageResult> SendMessageOutcome;
|
||||
typedef std::future<SendMessageOutcome> SendMessageOutcomeCallable;
|
||||
typedef std::function<void(const Cloud_siemClient*, const Model::SendMessageRequest&, const SendMessageOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> SendMessageAsyncHandler;
|
||||
|
||||
Cloud_siemClient(const Credentials &credentials, const ClientConfiguration &configuration);
|
||||
Cloud_siemClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
|
||||
Cloud_siemClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
|
||||
~Cloud_siemClient();
|
||||
BatchJobCheckOutcome batchJobCheck(const Model::BatchJobCheckRequest &request)const;
|
||||
void batchJobCheckAsync(const Model::BatchJobCheckRequest& request, const BatchJobCheckAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
BatchJobCheckOutcomeCallable batchJobCheckCallable(const Model::BatchJobCheckRequest& request) const;
|
||||
BatchJobSubmitOutcome batchJobSubmit(const Model::BatchJobSubmitRequest &request)const;
|
||||
void batchJobSubmitAsync(const Model::BatchJobSubmitRequest& request, const BatchJobSubmitAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
BatchJobSubmitOutcomeCallable batchJobSubmitCallable(const Model::BatchJobSubmitRequest& request) const;
|
||||
SendMessageOutcome sendMessage(const Model::SendMessageRequest &request)const;
|
||||
void sendMessageAsync(const Model::SendMessageRequest& request, const SendMessageAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
SendMessageOutcomeCallable sendMessageCallable(const Model::SendMessageRequest& request) const;
|
||||
|
||||
private:
|
||||
std::shared_ptr<EndpointProvider> endpointProvider_;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !ALIBABACLOUD_CLOUD_SIEM_CLOUD_SIEMCLIENT_H_
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* 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_CLOUD_SIEM_CLOUD_SIEMEXPORT_H_
|
||||
#define ALIBABACLOUD_CLOUD_SIEM_CLOUD_SIEMEXPORT_H_
|
||||
|
||||
#include <alibabacloud/core/Global.h>
|
||||
|
||||
#if defined(ALIBABACLOUD_SHARED)
|
||||
# if defined(ALIBABACLOUD_CLOUD_SIEM_LIBRARY)
|
||||
# define ALIBABACLOUD_CLOUD_SIEM_EXPORT ALIBABACLOUD_DECL_EXPORT
|
||||
# else
|
||||
# define ALIBABACLOUD_CLOUD_SIEM_EXPORT ALIBABACLOUD_DECL_IMPORT
|
||||
# endif
|
||||
#else
|
||||
# define ALIBABACLOUD_CLOUD_SIEM_EXPORT
|
||||
#endif
|
||||
|
||||
#endif // !ALIBABACLOUD_CLOUD_SIEM_CLOUD_SIEMEXPORT_H_
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_CLOUD_SIEM_MODEL_BATCHJOBCHECKREQUEST_H_
|
||||
#define ALIBABACLOUD_CLOUD_SIEM_MODEL_BATCHJOBCHECKREQUEST_H_
|
||||
|
||||
#include <alibabacloud/cloud-siem/Cloud_siemExport.h>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace Cloud_siem {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_CLOUD_SIEM_EXPORT BatchJobCheckRequest : public RpcServiceRequest {
|
||||
public:
|
||||
BatchJobCheckRequest();
|
||||
~BatchJobCheckRequest();
|
||||
std::string getRegionId() const;
|
||||
void setRegionId(const std::string ®ionId);
|
||||
std::string getSubmitId() const;
|
||||
void setSubmitId(const std::string &submitId);
|
||||
|
||||
private:
|
||||
std::string regionId_;
|
||||
std::string submitId_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace Cloud_siem
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_CLOUD_SIEM_MODEL_BATCHJOBCHECKREQUEST_H_
|
||||
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* 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_CLOUD_SIEM_MODEL_BATCHJOBCHECKRESULT_H_
|
||||
#define ALIBABACLOUD_CLOUD_SIEM_MODEL_BATCHJOBCHECKRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/cloud-siem/Cloud_siemExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Cloud_siem
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_CLOUD_SIEM_EXPORT BatchJobCheckResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct ErrTaskListItem
|
||||
{
|
||||
struct ProductListItem
|
||||
{
|
||||
struct LogListItem
|
||||
{
|
||||
std::string projectNamePattern;
|
||||
std::string regionCode;
|
||||
std::string logStoreNamePattern;
|
||||
std::string productCode;
|
||||
std::string errorCode;
|
||||
std::string logCode;
|
||||
};
|
||||
std::vector<ProductListItem::LogListItem> logList;
|
||||
std::string productCode;
|
||||
};
|
||||
std::vector<ErrTaskListItem::ProductListItem> productList;
|
||||
long userId;
|
||||
};
|
||||
int taskCount;
|
||||
int finishCount;
|
||||
int failedCount;
|
||||
std::string configId;
|
||||
std::string folderId;
|
||||
std::string taskStatus;
|
||||
std::vector<ErrTaskListItem> errTaskList;
|
||||
};
|
||||
|
||||
|
||||
BatchJobCheckResult();
|
||||
explicit BatchJobCheckResult(const std::string &payload);
|
||||
~BatchJobCheckResult();
|
||||
std::string getMessage()const;
|
||||
Data getData()const;
|
||||
int getCode()const;
|
||||
bool getSuccess()const;
|
||||
std::string getErrCode()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
Data data_;
|
||||
int code_;
|
||||
bool success_;
|
||||
std::string errCode_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_CLOUD_SIEM_MODEL_BATCHJOBCHECKRESULT_H_
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_CLOUD_SIEM_MODEL_BATCHJOBSUBMITREQUEST_H_
|
||||
#define ALIBABACLOUD_CLOUD_SIEM_MODEL_BATCHJOBSUBMITREQUEST_H_
|
||||
|
||||
#include <alibabacloud/cloud-siem/Cloud_siemExport.h>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace Cloud_siem {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_CLOUD_SIEM_EXPORT BatchJobSubmitRequest : public RpcServiceRequest {
|
||||
public:
|
||||
BatchJobSubmitRequest();
|
||||
~BatchJobSubmitRequest();
|
||||
std::string getRegionId() const;
|
||||
void setRegionId(const std::string ®ionId);
|
||||
std::string getJsonConfig() const;
|
||||
void setJsonConfig(const std::string &jsonConfig);
|
||||
|
||||
private:
|
||||
std::string regionId_;
|
||||
std::string jsonConfig_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace Cloud_siem
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_CLOUD_SIEM_MODEL_BATCHJOBSUBMITREQUEST_H_
|
||||
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* 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_CLOUD_SIEM_MODEL_BATCHJOBSUBMITRESULT_H_
|
||||
#define ALIBABACLOUD_CLOUD_SIEM_MODEL_BATCHJOBSUBMITRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/cloud-siem/Cloud_siemExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Cloud_siem
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_CLOUD_SIEM_EXPORT BatchJobSubmitResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct ConfigListItem
|
||||
{
|
||||
struct ProductListItem
|
||||
{
|
||||
struct LogListItem
|
||||
{
|
||||
std::string projectNamePattern;
|
||||
std::string regionCode;
|
||||
std::string logStoreNamePattern;
|
||||
std::string productCode;
|
||||
std::string errorCode;
|
||||
std::string logCode;
|
||||
};
|
||||
std::vector<ProductListItem::LogListItem> logList;
|
||||
std::string productCode;
|
||||
};
|
||||
std::vector<ConfigListItem::ProductListItem> productList;
|
||||
long userId;
|
||||
};
|
||||
std::string submitId;
|
||||
int taskCount;
|
||||
std::string configId;
|
||||
std::vector<ConfigListItem> configList;
|
||||
};
|
||||
|
||||
|
||||
BatchJobSubmitResult();
|
||||
explicit BatchJobSubmitResult(const std::string &payload);
|
||||
~BatchJobSubmitResult();
|
||||
std::string getMessage()const;
|
||||
Data getData()const;
|
||||
int getCode()const;
|
||||
bool getSuccess()const;
|
||||
std::string getErrCode()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
Data data_;
|
||||
int code_;
|
||||
bool success_;
|
||||
std::string errCode_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_CLOUD_SIEM_MODEL_BATCHJOBSUBMITRESULT_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_CLOUD_SIEM_MODEL_SENDMESSAGEREQUEST_H_
|
||||
#define ALIBABACLOUD_CLOUD_SIEM_MODEL_SENDMESSAGEREQUEST_H_
|
||||
|
||||
#include <alibabacloud/cloud-siem/Cloud_siemExport.h>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace Cloud_siem {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_CLOUD_SIEM_EXPORT SendMessageRequest : public RpcServiceRequest {
|
||||
public:
|
||||
SendMessageRequest();
|
||||
~SendMessageRequest();
|
||||
std::string getRegionId() const;
|
||||
void setRegionId(const std::string ®ionId);
|
||||
int getChannelType() const;
|
||||
void setChannelType(int channelType);
|
||||
long getReceiveUid() const;
|
||||
void setReceiveUid(long receiveUid);
|
||||
|
||||
private:
|
||||
std::string regionId_;
|
||||
int channelType_;
|
||||
long receiveUid_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace Cloud_siem
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_CLOUD_SIEM_MODEL_SENDMESSAGEREQUEST_H_
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* 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_CLOUD_SIEM_MODEL_SENDMESSAGERESULT_H_
|
||||
#define ALIBABACLOUD_CLOUD_SIEM_MODEL_SENDMESSAGERESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/cloud-siem/Cloud_siemExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Cloud_siem
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_CLOUD_SIEM_EXPORT SendMessageResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
SendMessageResult();
|
||||
explicit SendMessageResult(const std::string &payload);
|
||||
~SendMessageResult();
|
||||
std::string getMessage()const;
|
||||
bool getData()const;
|
||||
int getCode()const;
|
||||
bool getSuccess()const;
|
||||
std::string getErrCode()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
bool data_;
|
||||
int code_;
|
||||
bool success_;
|
||||
std::string errCode_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_CLOUD_SIEM_MODEL_SENDMESSAGERESULT_H_
|
||||
161
cloud-siem/src/Cloud-siemClient.cc
Normal file
161
cloud-siem/src/Cloud-siemClient.cc
Normal file
@@ -0,0 +1,161 @@
|
||||
/*
|
||||
* 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/cloud-siem/Cloud_siemClient.h>
|
||||
#include <alibabacloud/core/SimpleCredentialsProvider.h>
|
||||
|
||||
using namespace AlibabaCloud;
|
||||
using namespace AlibabaCloud::Location;
|
||||
using namespace AlibabaCloud::Cloud_siem;
|
||||
using namespace AlibabaCloud::Cloud_siem::Model;
|
||||
|
||||
namespace
|
||||
{
|
||||
const std::string SERVICE_NAME = "cloud-siem";
|
||||
}
|
||||
|
||||
Cloud_siemClient::Cloud_siemClient(const Credentials &credentials, const ClientConfiguration &configuration) :
|
||||
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "cloud-siem");
|
||||
}
|
||||
|
||||
Cloud_siemClient::Cloud_siemClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
|
||||
RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "cloud-siem");
|
||||
}
|
||||
|
||||
Cloud_siemClient::Cloud_siemClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
|
||||
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "cloud-siem");
|
||||
}
|
||||
|
||||
Cloud_siemClient::~Cloud_siemClient()
|
||||
{}
|
||||
|
||||
Cloud_siemClient::BatchJobCheckOutcome Cloud_siemClient::batchJobCheck(const BatchJobCheckRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return BatchJobCheckOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return BatchJobCheckOutcome(BatchJobCheckResult(outcome.result()));
|
||||
else
|
||||
return BatchJobCheckOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Cloud_siemClient::batchJobCheckAsync(const BatchJobCheckRequest& request, const BatchJobCheckAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, batchJobCheck(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Cloud_siemClient::BatchJobCheckOutcomeCallable Cloud_siemClient::batchJobCheckCallable(const BatchJobCheckRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<BatchJobCheckOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->batchJobCheck(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Cloud_siemClient::BatchJobSubmitOutcome Cloud_siemClient::batchJobSubmit(const BatchJobSubmitRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return BatchJobSubmitOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return BatchJobSubmitOutcome(BatchJobSubmitResult(outcome.result()));
|
||||
else
|
||||
return BatchJobSubmitOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Cloud_siemClient::batchJobSubmitAsync(const BatchJobSubmitRequest& request, const BatchJobSubmitAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, batchJobSubmit(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Cloud_siemClient::BatchJobSubmitOutcomeCallable Cloud_siemClient::batchJobSubmitCallable(const BatchJobSubmitRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<BatchJobSubmitOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->batchJobSubmit(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Cloud_siemClient::SendMessageOutcome Cloud_siemClient::sendMessage(const SendMessageRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return SendMessageOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return SendMessageOutcome(SendMessageResult(outcome.result()));
|
||||
else
|
||||
return SendMessageOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Cloud_siemClient::sendMessageAsync(const SendMessageRequest& request, const SendMessageAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, sendMessage(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Cloud_siemClient::SendMessageOutcomeCallable Cloud_siemClient::sendMessageCallable(const SendMessageRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<SendMessageOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->sendMessage(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
45
cloud-siem/src/model/BatchJobCheckRequest.cc
Normal file
45
cloud-siem/src/model/BatchJobCheckRequest.cc
Normal 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/cloud-siem/model/BatchJobCheckRequest.h>
|
||||
|
||||
using AlibabaCloud::Cloud_siem::Model::BatchJobCheckRequest;
|
||||
|
||||
BatchJobCheckRequest::BatchJobCheckRequest()
|
||||
: RpcServiceRequest("cloud-siem", "2022-06-16", "BatchJobCheck") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
BatchJobCheckRequest::~BatchJobCheckRequest() {}
|
||||
|
||||
std::string BatchJobCheckRequest::getRegionId() const {
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void BatchJobCheckRequest::setRegionId(const std::string ®ionId) {
|
||||
regionId_ = regionId;
|
||||
setBodyParameter(std::string("RegionId"), regionId);
|
||||
}
|
||||
|
||||
std::string BatchJobCheckRequest::getSubmitId() const {
|
||||
return submitId_;
|
||||
}
|
||||
|
||||
void BatchJobCheckRequest::setSubmitId(const std::string &submitId) {
|
||||
submitId_ = submitId;
|
||||
setBodyParameter(std::string("SubmitId"), submitId);
|
||||
}
|
||||
|
||||
124
cloud-siem/src/model/BatchJobCheckResult.cc
Normal file
124
cloud-siem/src/model/BatchJobCheckResult.cc
Normal file
@@ -0,0 +1,124 @@
|
||||
/*
|
||||
* 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/cloud-siem/model/BatchJobCheckResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Cloud_siem;
|
||||
using namespace AlibabaCloud::Cloud_siem::Model;
|
||||
|
||||
BatchJobCheckResult::BatchJobCheckResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
BatchJobCheckResult::BatchJobCheckResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
BatchJobCheckResult::~BatchJobCheckResult()
|
||||
{}
|
||||
|
||||
void BatchJobCheckResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["TaskCount"].isNull())
|
||||
data_.taskCount = std::stoi(dataNode["TaskCount"].asString());
|
||||
if(!dataNode["FinishCount"].isNull())
|
||||
data_.finishCount = std::stoi(dataNode["FinishCount"].asString());
|
||||
if(!dataNode["FailedCount"].isNull())
|
||||
data_.failedCount = std::stoi(dataNode["FailedCount"].asString());
|
||||
if(!dataNode["TaskStatus"].isNull())
|
||||
data_.taskStatus = dataNode["TaskStatus"].asString();
|
||||
if(!dataNode["ConfigId"].isNull())
|
||||
data_.configId = dataNode["ConfigId"].asString();
|
||||
if(!dataNode["FolderId"].isNull())
|
||||
data_.folderId = dataNode["FolderId"].asString();
|
||||
auto allErrTaskListNode = dataNode["ErrTaskList"]["ErrTaskListItem"];
|
||||
for (auto dataNodeErrTaskListErrTaskListItem : allErrTaskListNode)
|
||||
{
|
||||
Data::ErrTaskListItem errTaskListItemObject;
|
||||
if(!dataNodeErrTaskListErrTaskListItem["UserId"].isNull())
|
||||
errTaskListItemObject.userId = std::stol(dataNodeErrTaskListErrTaskListItem["UserId"].asString());
|
||||
auto allProductListNode = dataNodeErrTaskListErrTaskListItem["ProductList"]["ProductListItem"];
|
||||
for (auto dataNodeErrTaskListErrTaskListItemProductListProductListItem : allProductListNode)
|
||||
{
|
||||
Data::ErrTaskListItem::ProductListItem productListObject;
|
||||
if(!dataNodeErrTaskListErrTaskListItemProductListProductListItem["ProductCode"].isNull())
|
||||
productListObject.productCode = dataNodeErrTaskListErrTaskListItemProductListProductListItem["ProductCode"].asString();
|
||||
auto allLogListNode = dataNodeErrTaskListErrTaskListItemProductListProductListItem["LogList"]["LogListItem"];
|
||||
for (auto dataNodeErrTaskListErrTaskListItemProductListProductListItemLogListLogListItem : allLogListNode)
|
||||
{
|
||||
Data::ErrTaskListItem::ProductListItem::LogListItem logListObject;
|
||||
if(!dataNodeErrTaskListErrTaskListItemProductListProductListItemLogListLogListItem["ProductCode"].isNull())
|
||||
logListObject.productCode = dataNodeErrTaskListErrTaskListItemProductListProductListItemLogListLogListItem["ProductCode"].asString();
|
||||
if(!dataNodeErrTaskListErrTaskListItemProductListProductListItemLogListLogListItem["LogCode"].isNull())
|
||||
logListObject.logCode = dataNodeErrTaskListErrTaskListItemProductListProductListItemLogListLogListItem["LogCode"].asString();
|
||||
if(!dataNodeErrTaskListErrTaskListItemProductListProductListItemLogListLogListItem["RegionCode"].isNull())
|
||||
logListObject.regionCode = dataNodeErrTaskListErrTaskListItemProductListProductListItemLogListLogListItem["RegionCode"].asString();
|
||||
if(!dataNodeErrTaskListErrTaskListItemProductListProductListItemLogListLogListItem["ProjectNamePattern"].isNull())
|
||||
logListObject.projectNamePattern = dataNodeErrTaskListErrTaskListItemProductListProductListItemLogListLogListItem["ProjectNamePattern"].asString();
|
||||
if(!dataNodeErrTaskListErrTaskListItemProductListProductListItemLogListLogListItem["LogStoreNamePattern"].isNull())
|
||||
logListObject.logStoreNamePattern = dataNodeErrTaskListErrTaskListItemProductListProductListItemLogListLogListItem["LogStoreNamePattern"].asString();
|
||||
if(!dataNodeErrTaskListErrTaskListItemProductListProductListItemLogListLogListItem["ErrorCode"].isNull())
|
||||
logListObject.errorCode = dataNodeErrTaskListErrTaskListItemProductListProductListItemLogListLogListItem["ErrorCode"].asString();
|
||||
productListObject.logList.push_back(logListObject);
|
||||
}
|
||||
errTaskListItemObject.productList.push_back(productListObject);
|
||||
}
|
||||
data_.errTaskList.push_back(errTaskListItemObject);
|
||||
}
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stoi(value["Code"].asString());
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["ErrCode"].isNull())
|
||||
errCode_ = value["ErrCode"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string BatchJobCheckResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
BatchJobCheckResult::Data BatchJobCheckResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
int BatchJobCheckResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool BatchJobCheckResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
std::string BatchJobCheckResult::getErrCode()const
|
||||
{
|
||||
return errCode_;
|
||||
}
|
||||
|
||||
45
cloud-siem/src/model/BatchJobSubmitRequest.cc
Normal file
45
cloud-siem/src/model/BatchJobSubmitRequest.cc
Normal 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/cloud-siem/model/BatchJobSubmitRequest.h>
|
||||
|
||||
using AlibabaCloud::Cloud_siem::Model::BatchJobSubmitRequest;
|
||||
|
||||
BatchJobSubmitRequest::BatchJobSubmitRequest()
|
||||
: RpcServiceRequest("cloud-siem", "2022-06-16", "BatchJobSubmit") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
BatchJobSubmitRequest::~BatchJobSubmitRequest() {}
|
||||
|
||||
std::string BatchJobSubmitRequest::getRegionId() const {
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void BatchJobSubmitRequest::setRegionId(const std::string ®ionId) {
|
||||
regionId_ = regionId;
|
||||
setBodyParameter(std::string("RegionId"), regionId);
|
||||
}
|
||||
|
||||
std::string BatchJobSubmitRequest::getJsonConfig() const {
|
||||
return jsonConfig_;
|
||||
}
|
||||
|
||||
void BatchJobSubmitRequest::setJsonConfig(const std::string &jsonConfig) {
|
||||
jsonConfig_ = jsonConfig;
|
||||
setBodyParameter(std::string("JsonConfig"), jsonConfig);
|
||||
}
|
||||
|
||||
118
cloud-siem/src/model/BatchJobSubmitResult.cc
Normal file
118
cloud-siem/src/model/BatchJobSubmitResult.cc
Normal file
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
* 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/cloud-siem/model/BatchJobSubmitResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Cloud_siem;
|
||||
using namespace AlibabaCloud::Cloud_siem::Model;
|
||||
|
||||
BatchJobSubmitResult::BatchJobSubmitResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
BatchJobSubmitResult::BatchJobSubmitResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
BatchJobSubmitResult::~BatchJobSubmitResult()
|
||||
{}
|
||||
|
||||
void BatchJobSubmitResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["SubmitId"].isNull())
|
||||
data_.submitId = dataNode["SubmitId"].asString();
|
||||
if(!dataNode["TaskCount"].isNull())
|
||||
data_.taskCount = std::stoi(dataNode["TaskCount"].asString());
|
||||
if(!dataNode["ConfigId"].isNull())
|
||||
data_.configId = dataNode["ConfigId"].asString();
|
||||
auto allConfigListNode = dataNode["ConfigList"]["ConfigListItem"];
|
||||
for (auto dataNodeConfigListConfigListItem : allConfigListNode)
|
||||
{
|
||||
Data::ConfigListItem configListItemObject;
|
||||
if(!dataNodeConfigListConfigListItem["UserId"].isNull())
|
||||
configListItemObject.userId = std::stol(dataNodeConfigListConfigListItem["UserId"].asString());
|
||||
auto allProductListNode = dataNodeConfigListConfigListItem["ProductList"]["ProductListItem"];
|
||||
for (auto dataNodeConfigListConfigListItemProductListProductListItem : allProductListNode)
|
||||
{
|
||||
Data::ConfigListItem::ProductListItem productListObject;
|
||||
if(!dataNodeConfigListConfigListItemProductListProductListItem["ProductCode"].isNull())
|
||||
productListObject.productCode = dataNodeConfigListConfigListItemProductListProductListItem["ProductCode"].asString();
|
||||
auto allLogListNode = dataNodeConfigListConfigListItemProductListProductListItem["LogList"]["LogListItem"];
|
||||
for (auto dataNodeConfigListConfigListItemProductListProductListItemLogListLogListItem : allLogListNode)
|
||||
{
|
||||
Data::ConfigListItem::ProductListItem::LogListItem logListObject;
|
||||
if(!dataNodeConfigListConfigListItemProductListProductListItemLogListLogListItem["ProductCode"].isNull())
|
||||
logListObject.productCode = dataNodeConfigListConfigListItemProductListProductListItemLogListLogListItem["ProductCode"].asString();
|
||||
if(!dataNodeConfigListConfigListItemProductListProductListItemLogListLogListItem["LogCode"].isNull())
|
||||
logListObject.logCode = dataNodeConfigListConfigListItemProductListProductListItemLogListLogListItem["LogCode"].asString();
|
||||
if(!dataNodeConfigListConfigListItemProductListProductListItemLogListLogListItem["RegionCode"].isNull())
|
||||
logListObject.regionCode = dataNodeConfigListConfigListItemProductListProductListItemLogListLogListItem["RegionCode"].asString();
|
||||
if(!dataNodeConfigListConfigListItemProductListProductListItemLogListLogListItem["ProjectNamePattern"].isNull())
|
||||
logListObject.projectNamePattern = dataNodeConfigListConfigListItemProductListProductListItemLogListLogListItem["ProjectNamePattern"].asString();
|
||||
if(!dataNodeConfigListConfigListItemProductListProductListItemLogListLogListItem["LogStoreNamePattern"].isNull())
|
||||
logListObject.logStoreNamePattern = dataNodeConfigListConfigListItemProductListProductListItemLogListLogListItem["LogStoreNamePattern"].asString();
|
||||
if(!dataNodeConfigListConfigListItemProductListProductListItemLogListLogListItem["ErrorCode"].isNull())
|
||||
logListObject.errorCode = dataNodeConfigListConfigListItemProductListProductListItemLogListLogListItem["ErrorCode"].asString();
|
||||
productListObject.logList.push_back(logListObject);
|
||||
}
|
||||
configListItemObject.productList.push_back(productListObject);
|
||||
}
|
||||
data_.configList.push_back(configListItemObject);
|
||||
}
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stoi(value["Code"].asString());
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["ErrCode"].isNull())
|
||||
errCode_ = value["ErrCode"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string BatchJobSubmitResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
BatchJobSubmitResult::Data BatchJobSubmitResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
int BatchJobSubmitResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool BatchJobSubmitResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
std::string BatchJobSubmitResult::getErrCode()const
|
||||
{
|
||||
return errCode_;
|
||||
}
|
||||
|
||||
54
cloud-siem/src/model/SendMessageRequest.cc
Normal file
54
cloud-siem/src/model/SendMessageRequest.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/cloud-siem/model/SendMessageRequest.h>
|
||||
|
||||
using AlibabaCloud::Cloud_siem::Model::SendMessageRequest;
|
||||
|
||||
SendMessageRequest::SendMessageRequest()
|
||||
: RpcServiceRequest("cloud-siem", "2022-06-16", "SendMessage") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
SendMessageRequest::~SendMessageRequest() {}
|
||||
|
||||
std::string SendMessageRequest::getRegionId() const {
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void SendMessageRequest::setRegionId(const std::string ®ionId) {
|
||||
regionId_ = regionId;
|
||||
setBodyParameter(std::string("RegionId"), regionId);
|
||||
}
|
||||
|
||||
int SendMessageRequest::getChannelType() const {
|
||||
return channelType_;
|
||||
}
|
||||
|
||||
void SendMessageRequest::setChannelType(int channelType) {
|
||||
channelType_ = channelType;
|
||||
setBodyParameter(std::string("ChannelType"), std::to_string(channelType));
|
||||
}
|
||||
|
||||
long SendMessageRequest::getReceiveUid() const {
|
||||
return receiveUid_;
|
||||
}
|
||||
|
||||
void SendMessageRequest::setReceiveUid(long receiveUid) {
|
||||
receiveUid_ = receiveUid;
|
||||
setBodyParameter(std::string("ReceiveUid"), std::to_string(receiveUid));
|
||||
}
|
||||
|
||||
79
cloud-siem/src/model/SendMessageResult.cc
Normal file
79
cloud-siem/src/model/SendMessageResult.cc
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* 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/cloud-siem/model/SendMessageResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Cloud_siem;
|
||||
using namespace AlibabaCloud::Cloud_siem::Model;
|
||||
|
||||
SendMessageResult::SendMessageResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
SendMessageResult::SendMessageResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
SendMessageResult::~SendMessageResult()
|
||||
{}
|
||||
|
||||
void SendMessageResult::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_ = std::stoi(value["Code"].asString());
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["ErrCode"].isNull())
|
||||
errCode_ = value["ErrCode"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string SendMessageResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
bool SendMessageResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
int SendMessageResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool SendMessageResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
std::string SendMessageResult::getErrCode()const
|
||||
{
|
||||
return errCode_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user