From 20195cdd921f162d068c77a87621af91948b8388 Mon Sep 17 00:00:00 2001 From: "yixiong.jxy" Date: Thu, 26 Jul 2018 09:26:49 +0800 Subject: [PATCH] =?UTF-8?q?TESLASTREAM=20SDK=20Auto=20Released=20By=20tony?= =?UTF-8?q?.ly,Version=EF=BC=9A1.20.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yixiong.jxy --- CHANGELOG | 5 + CMakeLists.txt | 3 +- VERSION | 2 +- teslastream/CMakeLists.txt | 94 ++++++++++ .../teslastream/TeslaStreamClient.h | 70 ++++++++ .../teslastream/TeslaStreamExport.h | 32 ++++ .../model/BatchGetJobMetricInfoRequest.h | 48 ++++++ .../model/BatchGetJobMetricInfoResult.h | 68 ++++++++ .../model/BatchGetPluginConfigInfoRequest.h | 48 ++++++ .../model/BatchGetPluginConfigInfoResult.h | 60 +++++++ .../teslastream/model/GetJobTopologyRequest.h | 48 ++++++ .../teslastream/model/GetJobTopologyResult.h | 63 +++++++ teslastream/src/TeslaStreamClient.cc | 161 ++++++++++++++++++ .../src/model/BatchGetJobMetricInfoRequest.cc | 38 +++++ .../src/model/BatchGetJobMetricInfoResult.cc | 90 ++++++++++ .../model/BatchGetPluginConfigInfoRequest.cc | 38 +++++ .../model/BatchGetPluginConfigInfoResult.cc | 74 ++++++++ .../src/model/GetJobTopologyRequest.cc | 38 +++++ teslastream/src/model/GetJobTopologyResult.cc | 82 +++++++++ 19 files changed, 1060 insertions(+), 2 deletions(-) create mode 100644 teslastream/CMakeLists.txt create mode 100644 teslastream/include/alibabacloud/teslastream/TeslaStreamClient.h create mode 100644 teslastream/include/alibabacloud/teslastream/TeslaStreamExport.h create mode 100644 teslastream/include/alibabacloud/teslastream/model/BatchGetJobMetricInfoRequest.h create mode 100644 teslastream/include/alibabacloud/teslastream/model/BatchGetJobMetricInfoResult.h create mode 100644 teslastream/include/alibabacloud/teslastream/model/BatchGetPluginConfigInfoRequest.h create mode 100644 teslastream/include/alibabacloud/teslastream/model/BatchGetPluginConfigInfoResult.h create mode 100644 teslastream/include/alibabacloud/teslastream/model/GetJobTopologyRequest.h create mode 100644 teslastream/include/alibabacloud/teslastream/model/GetJobTopologyResult.h create mode 100644 teslastream/src/TeslaStreamClient.cc create mode 100644 teslastream/src/model/BatchGetJobMetricInfoRequest.cc create mode 100644 teslastream/src/model/BatchGetJobMetricInfoResult.cc create mode 100644 teslastream/src/model/BatchGetPluginConfigInfoRequest.cc create mode 100644 teslastream/src/model/BatchGetPluginConfigInfoResult.cc create mode 100644 teslastream/src/model/GetJobTopologyRequest.cc create mode 100644 teslastream/src/model/GetJobTopologyResult.cc diff --git a/CHANGELOG b/CHANGELOG index 667050047..0a6700545 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,8 @@ +2018-07-26 Version: 1.20.2 +1, Add BatchGetJobMetricInfo API. +2, Add BatchGetPluginConfigInfo API. +3, Add GetJobTopology API. + 2018-07-25 Version: 1.20.1 1, Add RemoveTerminals API. diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f6ba71d3..8aa8cd454 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,4 +79,5 @@ add_subdirectory(jarvis) add_subdirectory(scdn) add_subdirectory(live) add_subdirectory(rtc) -add_subdirectory(chatbot) \ No newline at end of file +add_subdirectory(chatbot) +add_subdirectory(teslastream) \ No newline at end of file diff --git a/VERSION b/VERSION index 1acb46a42..341e509f1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.20.1 \ No newline at end of file +1.20.2 \ No newline at end of file diff --git a/teslastream/CMakeLists.txt b/teslastream/CMakeLists.txt new file mode 100644 index 000000000..a727ce3e3 --- /dev/null +++ b/teslastream/CMakeLists.txt @@ -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(teslastream_public_header + include/alibabacloud/teslastream/TeslaStreamClient.h + include/alibabacloud/teslastream/TeslaStreamExport.h ) + +set(teslastream_public_header_model + include/alibabacloud/teslastream/model/GetJobTopologyRequest.h + include/alibabacloud/teslastream/model/GetJobTopologyResult.h + include/alibabacloud/teslastream/model/BatchGetJobMetricInfoRequest.h + include/alibabacloud/teslastream/model/BatchGetJobMetricInfoResult.h + include/alibabacloud/teslastream/model/BatchGetPluginConfigInfoRequest.h + include/alibabacloud/teslastream/model/BatchGetPluginConfigInfoResult.h ) + +set(teslastream_src + src/TeslaStreamClient.cc + src/model/GetJobTopologyRequest.cc + src/model/GetJobTopologyResult.cc + src/model/BatchGetJobMetricInfoRequest.cc + src/model/BatchGetJobMetricInfoResult.cc + src/model/BatchGetPluginConfigInfoRequest.cc + src/model/BatchGetPluginConfigInfoResult.cc ) + +add_library(teslastream ${LIB_TYPE} + ${teslastream_public_header} + ${teslastream_public_header_model} + ${teslastream_src}) + +set_target_properties(teslastream + 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}teslastream + ) + +if(${LIB_TYPE} STREQUAL "SHARED") + set_target_properties(teslastream + PROPERTIES + DEFINE_SYMBOL ALIBABACLOUD_TESLASTREAM_LIBRARY) +endif() + +target_include_directories(teslastream + PRIVATE include + ${CMAKE_SOURCE_DIR}/core/include + ) +target_link_libraries(teslastream + core) + +if(CMAKE_HOST_WIN32) + ExternalProject_Get_Property(jsoncpp INSTALL_DIR) + set(jsoncpp_install_dir ${INSTALL_DIR}) + add_dependencies(teslastream + jsoncpp) + target_include_directories(teslastream + PRIVATE ${jsoncpp_install_dir}/include) + target_link_libraries(teslastream + ${jsoncpp_install_dir}/lib/jsoncpp.lib) + set_target_properties(teslastream + PROPERTIES + COMPILE_OPTIONS "/bigobj") +else() + target_include_directories(teslastream + PRIVATE /usr/include/jsoncpp) + target_link_libraries(teslastream + jsoncpp) +endif() + +install(FILES ${teslastream_public_header} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/teslastream) +install(FILES ${teslastream_public_header_model} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/teslastream/model) +install(TARGETS teslastream + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) \ No newline at end of file diff --git a/teslastream/include/alibabacloud/teslastream/TeslaStreamClient.h b/teslastream/include/alibabacloud/teslastream/TeslaStreamClient.h new file mode 100644 index 000000000..f93c9750d --- /dev/null +++ b/teslastream/include/alibabacloud/teslastream/TeslaStreamClient.h @@ -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_TESLASTREAM_TESLASTREAMCLIENT_H_ +#define ALIBABACLOUD_TESLASTREAM_TESLASTREAMCLIENT_H_ + +#include +#include +#include +#include +#include "TeslaStreamExport.h" +#include "model/GetJobTopologyRequest.h" +#include "model/GetJobTopologyResult.h" +#include "model/BatchGetJobMetricInfoRequest.h" +#include "model/BatchGetJobMetricInfoResult.h" +#include "model/BatchGetPluginConfigInfoRequest.h" +#include "model/BatchGetPluginConfigInfoResult.h" + + +namespace AlibabaCloud +{ + namespace TeslaStream + { + class ALIBABACLOUD_TESLASTREAM_EXPORT TeslaStreamClient : public RpcServiceClient + { + public: + typedef Outcome GetJobTopologyOutcome; + typedef std::future GetJobTopologyOutcomeCallable; + typedef std::function&)> GetJobTopologyAsyncHandler; + typedef Outcome BatchGetJobMetricInfoOutcome; + typedef std::future BatchGetJobMetricInfoOutcomeCallable; + typedef std::function&)> BatchGetJobMetricInfoAsyncHandler; + typedef Outcome BatchGetPluginConfigInfoOutcome; + typedef std::future BatchGetPluginConfigInfoOutcomeCallable; + typedef std::function&)> BatchGetPluginConfigInfoAsyncHandler; + + TeslaStreamClient(const Credentials &credentials, const ClientConfiguration &configuration); + TeslaStreamClient(const std::shared_ptr &credentialsProvider, const ClientConfiguration &configuration); + TeslaStreamClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration); + ~TeslaStreamClient(); + GetJobTopologyOutcome getJobTopology(const Model::GetJobTopologyRequest &request)const; + void getJobTopologyAsync(const Model::GetJobTopologyRequest& request, const GetJobTopologyAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetJobTopologyOutcomeCallable getJobTopologyCallable(const Model::GetJobTopologyRequest& request) const; + BatchGetJobMetricInfoOutcome batchGetJobMetricInfo(const Model::BatchGetJobMetricInfoRequest &request)const; + void batchGetJobMetricInfoAsync(const Model::BatchGetJobMetricInfoRequest& request, const BatchGetJobMetricInfoAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + BatchGetJobMetricInfoOutcomeCallable batchGetJobMetricInfoCallable(const Model::BatchGetJobMetricInfoRequest& request) const; + BatchGetPluginConfigInfoOutcome batchGetPluginConfigInfo(const Model::BatchGetPluginConfigInfoRequest &request)const; + void batchGetPluginConfigInfoAsync(const Model::BatchGetPluginConfigInfoRequest& request, const BatchGetPluginConfigInfoAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + BatchGetPluginConfigInfoOutcomeCallable batchGetPluginConfigInfoCallable(const Model::BatchGetPluginConfigInfoRequest& request) const; + + private: + std::shared_ptr endpointProvider_; + }; + } +} + +#endif // !ALIBABACLOUD_TESLASTREAM_TESLASTREAMCLIENT_H_ diff --git a/teslastream/include/alibabacloud/teslastream/TeslaStreamExport.h b/teslastream/include/alibabacloud/teslastream/TeslaStreamExport.h new file mode 100644 index 000000000..eb6a70739 --- /dev/null +++ b/teslastream/include/alibabacloud/teslastream/TeslaStreamExport.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_TESLASTREAM_TESLASTREAMEXPORT_H_ +#define ALIBABACLOUD_TESLASTREAM_TESLASTREAMEXPORT_H_ + +#include + +#if defined(ALIBABACLOUD_SHARED) +# if defined(ALIBABACLOUD_TESLASTREAM_LIBRARY) +# define ALIBABACLOUD_TESLASTREAM_EXPORT ALIBABACLOUD_DECL_EXPORT +# else +# define ALIBABACLOUD_TESLASTREAM_EXPORT ALIBABACLOUD_DECL_IMPORT +# endif +#else +# define ALIBABACLOUD_TESLASTREAM_EXPORT +#endif + +#endif // !ALIBABACLOUD_TESLASTREAM_TESLASTREAMEXPORT_H_ \ No newline at end of file diff --git a/teslastream/include/alibabacloud/teslastream/model/BatchGetJobMetricInfoRequest.h b/teslastream/include/alibabacloud/teslastream/model/BatchGetJobMetricInfoRequest.h new file mode 100644 index 000000000..07e3a64ee --- /dev/null +++ b/teslastream/include/alibabacloud/teslastream/model/BatchGetJobMetricInfoRequest.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_TESLASTREAM_MODEL_BATCHGETJOBMETRICINFOREQUEST_H_ +#define ALIBABACLOUD_TESLASTREAM_MODEL_BATCHGETJOBMETRICINFOREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace TeslaStream + { + namespace Model + { + class ALIBABACLOUD_TESLASTREAM_EXPORT BatchGetJobMetricInfoRequest : public RpcServiceRequest + { + + public: + BatchGetJobMetricInfoRequest(); + ~BatchGetJobMetricInfoRequest(); + + std::string getJobInfos()const; + void setJobInfos(const std::string& jobInfos); + + private: + std::string jobInfos_; + + }; + } + } +} +#endif // !ALIBABACLOUD_TESLASTREAM_MODEL_BATCHGETJOBMETRICINFOREQUEST_H_ \ No newline at end of file diff --git a/teslastream/include/alibabacloud/teslastream/model/BatchGetJobMetricInfoResult.h b/teslastream/include/alibabacloud/teslastream/model/BatchGetJobMetricInfoResult.h new file mode 100644 index 000000000..c48c364cf --- /dev/null +++ b/teslastream/include/alibabacloud/teslastream/model/BatchGetJobMetricInfoResult.h @@ -0,0 +1,68 @@ +/* + * 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_TESLASTREAM_MODEL_BATCHGETJOBMETRICINFORESULT_H_ +#define ALIBABACLOUD_TESLASTREAM_MODEL_BATCHGETJOBMETRICINFORESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace TeslaStream + { + namespace Model + { + class ALIBABACLOUD_TESLASTREAM_EXPORT BatchGetJobMetricInfoResult : public ServiceResult + { + public: + struct Job + { + int tpsOut; + float memUsed; + int memRequest; + std::string priority; + int tpsIn; + float cpuUsed; + std::string jobUniqKey; + int cpuRequest; + int delay; + std::string nickname; + }; + + + BatchGetJobMetricInfoResult(); + explicit BatchGetJobMetricInfoResult(const std::string &payload); + ~BatchGetJobMetricInfoResult(); + std::string getMessage()const; + std::vector getData()const; + int getCode()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + std::vector data_; + int code_; + + }; + } + } +} +#endif // !ALIBABACLOUD_TESLASTREAM_MODEL_BATCHGETJOBMETRICINFORESULT_H_ \ No newline at end of file diff --git a/teslastream/include/alibabacloud/teslastream/model/BatchGetPluginConfigInfoRequest.h b/teslastream/include/alibabacloud/teslastream/model/BatchGetPluginConfigInfoRequest.h new file mode 100644 index 000000000..30943d043 --- /dev/null +++ b/teslastream/include/alibabacloud/teslastream/model/BatchGetPluginConfigInfoRequest.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_TESLASTREAM_MODEL_BATCHGETPLUGINCONFIGINFOREQUEST_H_ +#define ALIBABACLOUD_TESLASTREAM_MODEL_BATCHGETPLUGINCONFIGINFOREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace TeslaStream + { + namespace Model + { + class ALIBABACLOUD_TESLASTREAM_EXPORT BatchGetPluginConfigInfoRequest : public RpcServiceRequest + { + + public: + BatchGetPluginConfigInfoRequest(); + ~BatchGetPluginConfigInfoRequest(); + + std::string getPluginInfos()const; + void setPluginInfos(const std::string& pluginInfos); + + private: + std::string pluginInfos_; + + }; + } + } +} +#endif // !ALIBABACLOUD_TESLASTREAM_MODEL_BATCHGETPLUGINCONFIGINFOREQUEST_H_ \ No newline at end of file diff --git a/teslastream/include/alibabacloud/teslastream/model/BatchGetPluginConfigInfoResult.h b/teslastream/include/alibabacloud/teslastream/model/BatchGetPluginConfigInfoResult.h new file mode 100644 index 000000000..df1b0ea8c --- /dev/null +++ b/teslastream/include/alibabacloud/teslastream/model/BatchGetPluginConfigInfoResult.h @@ -0,0 +1,60 @@ +/* + * 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_TESLASTREAM_MODEL_BATCHGETPLUGINCONFIGINFORESULT_H_ +#define ALIBABACLOUD_TESLASTREAM_MODEL_BATCHGETPLUGINCONFIGINFORESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace TeslaStream + { + namespace Model + { + class ALIBABACLOUD_TESLASTREAM_EXPORT BatchGetPluginConfigInfoResult : public ServiceResult + { + public: + struct Plugin + { + std::string pluginUniqKey; + std::string pluginProperties; + }; + + + BatchGetPluginConfigInfoResult(); + explicit BatchGetPluginConfigInfoResult(const std::string &payload); + ~BatchGetPluginConfigInfoResult(); + std::string getMessage()const; + std::vector getData()const; + int getCode()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + std::vector data_; + int code_; + + }; + } + } +} +#endif // !ALIBABACLOUD_TESLASTREAM_MODEL_BATCHGETPLUGINCONFIGINFORESULT_H_ \ No newline at end of file diff --git a/teslastream/include/alibabacloud/teslastream/model/GetJobTopologyRequest.h b/teslastream/include/alibabacloud/teslastream/model/GetJobTopologyRequest.h new file mode 100644 index 000000000..07babbb89 --- /dev/null +++ b/teslastream/include/alibabacloud/teslastream/model/GetJobTopologyRequest.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_TESLASTREAM_MODEL_GETJOBTOPOLOGYREQUEST_H_ +#define ALIBABACLOUD_TESLASTREAM_MODEL_GETJOBTOPOLOGYREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace TeslaStream + { + namespace Model + { + class ALIBABACLOUD_TESLASTREAM_EXPORT GetJobTopologyRequest : public RpcServiceRequest + { + + public: + GetJobTopologyRequest(); + ~GetJobTopologyRequest(); + + std::string getJobName()const; + void setJobName(const std::string& jobName); + + private: + std::string jobName_; + + }; + } + } +} +#endif // !ALIBABACLOUD_TESLASTREAM_MODEL_GETJOBTOPOLOGYREQUEST_H_ \ No newline at end of file diff --git a/teslastream/include/alibabacloud/teslastream/model/GetJobTopologyResult.h b/teslastream/include/alibabacloud/teslastream/model/GetJobTopologyResult.h new file mode 100644 index 000000000..aa6651040 --- /dev/null +++ b/teslastream/include/alibabacloud/teslastream/model/GetJobTopologyResult.h @@ -0,0 +1,63 @@ +/* + * 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_TESLASTREAM_MODEL_GETJOBTOPOLOGYRESULT_H_ +#define ALIBABACLOUD_TESLASTREAM_MODEL_GETJOBTOPOLOGYRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace TeslaStream + { + namespace Model + { + class ALIBABACLOUD_TESLASTREAM_EXPORT GetJobTopologyResult : public ServiceResult + { + public: + struct Job + { + std::string pluginRelation; + std::string type; + std::vector parents; + std::vector childrens; + std::string text; + }; + + + GetJobTopologyResult(); + explicit GetJobTopologyResult(const std::string &payload); + ~GetJobTopologyResult(); + std::string getMessage()const; + std::vector getData()const; + int getCode()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + std::vector data_; + int code_; + + }; + } + } +} +#endif // !ALIBABACLOUD_TESLASTREAM_MODEL_GETJOBTOPOLOGYRESULT_H_ \ No newline at end of file diff --git a/teslastream/src/TeslaStreamClient.cc b/teslastream/src/TeslaStreamClient.cc new file mode 100644 index 000000000..735b7a58c --- /dev/null +++ b/teslastream/src/TeslaStreamClient.cc @@ -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 +#include + +using namespace AlibabaCloud; +using namespace AlibabaCloud::Location; +using namespace AlibabaCloud::TeslaStream; +using namespace AlibabaCloud::TeslaStream::Model; + +namespace +{ + const std::string SERVICE_NAME = "TeslaStream"; +} + +TeslaStreamClient::TeslaStreamClient(const Credentials &credentials, const ClientConfiguration &configuration) : + RpcServiceClient(SERVICE_NAME, std::make_shared(credentials), configuration) +{ + auto locationClient = std::make_shared(credentials, configuration); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); +} + +TeslaStreamClient::TeslaStreamClient(const std::shared_ptr& credentialsProvider, const ClientConfiguration & configuration) : + RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration) +{ + auto locationClient = std::make_shared(credentialsProvider, configuration); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); +} + +TeslaStreamClient::TeslaStreamClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) : + RpcServiceClient(SERVICE_NAME, std::make_shared(accessKeyId, accessKeySecret), configuration) +{ + auto locationClient = std::make_shared(accessKeyId, accessKeySecret, configuration); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); +} + +TeslaStreamClient::~TeslaStreamClient() +{} + +TeslaStreamClient::GetJobTopologyOutcome TeslaStreamClient::getJobTopology(const GetJobTopologyRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetJobTopologyOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetJobTopologyOutcome(GetJobTopologyResult(outcome.result())); + else + return GetJobTopologyOutcome(outcome.error()); +} + +void TeslaStreamClient::getJobTopologyAsync(const GetJobTopologyRequest& request, const GetJobTopologyAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getJobTopology(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +TeslaStreamClient::GetJobTopologyOutcomeCallable TeslaStreamClient::getJobTopologyCallable(const GetJobTopologyRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getJobTopology(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +TeslaStreamClient::BatchGetJobMetricInfoOutcome TeslaStreamClient::batchGetJobMetricInfo(const BatchGetJobMetricInfoRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return BatchGetJobMetricInfoOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return BatchGetJobMetricInfoOutcome(BatchGetJobMetricInfoResult(outcome.result())); + else + return BatchGetJobMetricInfoOutcome(outcome.error()); +} + +void TeslaStreamClient::batchGetJobMetricInfoAsync(const BatchGetJobMetricInfoRequest& request, const BatchGetJobMetricInfoAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, batchGetJobMetricInfo(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +TeslaStreamClient::BatchGetJobMetricInfoOutcomeCallable TeslaStreamClient::batchGetJobMetricInfoCallable(const BatchGetJobMetricInfoRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->batchGetJobMetricInfo(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +TeslaStreamClient::BatchGetPluginConfigInfoOutcome TeslaStreamClient::batchGetPluginConfigInfo(const BatchGetPluginConfigInfoRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return BatchGetPluginConfigInfoOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return BatchGetPluginConfigInfoOutcome(BatchGetPluginConfigInfoResult(outcome.result())); + else + return BatchGetPluginConfigInfoOutcome(outcome.error()); +} + +void TeslaStreamClient::batchGetPluginConfigInfoAsync(const BatchGetPluginConfigInfoRequest& request, const BatchGetPluginConfigInfoAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, batchGetPluginConfigInfo(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +TeslaStreamClient::BatchGetPluginConfigInfoOutcomeCallable TeslaStreamClient::batchGetPluginConfigInfoCallable(const BatchGetPluginConfigInfoRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->batchGetPluginConfigInfo(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + diff --git a/teslastream/src/model/BatchGetJobMetricInfoRequest.cc b/teslastream/src/model/BatchGetJobMetricInfoRequest.cc new file mode 100644 index 000000000..160fc48ef --- /dev/null +++ b/teslastream/src/model/BatchGetJobMetricInfoRequest.cc @@ -0,0 +1,38 @@ +/* + * 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 + +using AlibabaCloud::TeslaStream::Model::BatchGetJobMetricInfoRequest; + +BatchGetJobMetricInfoRequest::BatchGetJobMetricInfoRequest() : + RpcServiceRequest("teslastream", "2018-01-15", "BatchGetJobMetricInfo") +{} + +BatchGetJobMetricInfoRequest::~BatchGetJobMetricInfoRequest() +{} + +std::string BatchGetJobMetricInfoRequest::getJobInfos()const +{ + return jobInfos_; +} + +void BatchGetJobMetricInfoRequest::setJobInfos(const std::string& jobInfos) +{ + jobInfos_ = jobInfos; + setParameter("JobInfos", jobInfos); +} + diff --git a/teslastream/src/model/BatchGetJobMetricInfoResult.cc b/teslastream/src/model/BatchGetJobMetricInfoResult.cc new file mode 100644 index 000000000..afba4e794 --- /dev/null +++ b/teslastream/src/model/BatchGetJobMetricInfoResult.cc @@ -0,0 +1,90 @@ +/* + * 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 +#include + +using namespace AlibabaCloud::TeslaStream; +using namespace AlibabaCloud::TeslaStream::Model; + +BatchGetJobMetricInfoResult::BatchGetJobMetricInfoResult() : + ServiceResult() +{} + +BatchGetJobMetricInfoResult::BatchGetJobMetricInfoResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +BatchGetJobMetricInfoResult::~BatchGetJobMetricInfoResult() +{} + +void BatchGetJobMetricInfoResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + + setRequestId(value["RequestId"].asString()); + auto allData = value["Data"]["Job"]; + for (auto value : allData) + { + Job dataObject; + if(!value["Delay"].isNull()) + dataObject.delay = std::stoi(value["Delay"].asString()); + if(!value["TpsOut"].isNull()) + dataObject.tpsOut = std::stoi(value["TpsOut"].asString()); + if(!value["MemRequest"].isNull()) + dataObject.memRequest = std::stoi(value["MemRequest"].asString()); + if(!value["JobUniqKey"].isNull()) + dataObject.jobUniqKey = value["JobUniqKey"].asString(); + if(!value["MemUsed"].isNull()) + dataObject.memUsed = std::stof(value["MemUsed"].asString()); + if(!value["CpuUsed"].isNull()) + dataObject.cpuUsed = std::stof(value["CpuUsed"].asString()); + if(!value["CpuRequest"].isNull()) + dataObject.cpuRequest = std::stoi(value["CpuRequest"].asString()); + if(!value["Nickname"].isNull()) + dataObject.nickname = value["Nickname"].asString(); + if(!value["TpsIn"].isNull()) + dataObject.tpsIn = std::stoi(value["TpsIn"].asString()); + if(!value["Priority"].isNull()) + dataObject.priority = value["Priority"].asString(); + data_.push_back(dataObject); + } + if(!value["Code"].isNull()) + code_ = std::stoi(value["Code"].asString()); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + +} + +std::string BatchGetJobMetricInfoResult::getMessage()const +{ + return message_; +} + +std::vector BatchGetJobMetricInfoResult::getData()const +{ + return data_; +} + +int BatchGetJobMetricInfoResult::getCode()const +{ + return code_; +} + diff --git a/teslastream/src/model/BatchGetPluginConfigInfoRequest.cc b/teslastream/src/model/BatchGetPluginConfigInfoRequest.cc new file mode 100644 index 000000000..8811027c0 --- /dev/null +++ b/teslastream/src/model/BatchGetPluginConfigInfoRequest.cc @@ -0,0 +1,38 @@ +/* + * 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 + +using AlibabaCloud::TeslaStream::Model::BatchGetPluginConfigInfoRequest; + +BatchGetPluginConfigInfoRequest::BatchGetPluginConfigInfoRequest() : + RpcServiceRequest("teslastream", "2018-01-15", "BatchGetPluginConfigInfo") +{} + +BatchGetPluginConfigInfoRequest::~BatchGetPluginConfigInfoRequest() +{} + +std::string BatchGetPluginConfigInfoRequest::getPluginInfos()const +{ + return pluginInfos_; +} + +void BatchGetPluginConfigInfoRequest::setPluginInfos(const std::string& pluginInfos) +{ + pluginInfos_ = pluginInfos; + setParameter("PluginInfos", pluginInfos); +} + diff --git a/teslastream/src/model/BatchGetPluginConfigInfoResult.cc b/teslastream/src/model/BatchGetPluginConfigInfoResult.cc new file mode 100644 index 000000000..37c37ffd6 --- /dev/null +++ b/teslastream/src/model/BatchGetPluginConfigInfoResult.cc @@ -0,0 +1,74 @@ +/* + * 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 +#include + +using namespace AlibabaCloud::TeslaStream; +using namespace AlibabaCloud::TeslaStream::Model; + +BatchGetPluginConfigInfoResult::BatchGetPluginConfigInfoResult() : + ServiceResult() +{} + +BatchGetPluginConfigInfoResult::BatchGetPluginConfigInfoResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +BatchGetPluginConfigInfoResult::~BatchGetPluginConfigInfoResult() +{} + +void BatchGetPluginConfigInfoResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + + setRequestId(value["RequestId"].asString()); + auto allData = value["Data"]["plugin"]; + for (auto value : allData) + { + Plugin dataObject; + if(!value["PluginProperties"].isNull()) + dataObject.pluginProperties = value["PluginProperties"].asString(); + if(!value["PluginUniqKey"].isNull()) + dataObject.pluginUniqKey = value["PluginUniqKey"].asString(); + data_.push_back(dataObject); + } + if(!value["Code"].isNull()) + code_ = std::stoi(value["Code"].asString()); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + +} + +std::string BatchGetPluginConfigInfoResult::getMessage()const +{ + return message_; +} + +std::vector BatchGetPluginConfigInfoResult::getData()const +{ + return data_; +} + +int BatchGetPluginConfigInfoResult::getCode()const +{ + return code_; +} + diff --git a/teslastream/src/model/GetJobTopologyRequest.cc b/teslastream/src/model/GetJobTopologyRequest.cc new file mode 100644 index 000000000..1580e9902 --- /dev/null +++ b/teslastream/src/model/GetJobTopologyRequest.cc @@ -0,0 +1,38 @@ +/* + * 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 + +using AlibabaCloud::TeslaStream::Model::GetJobTopologyRequest; + +GetJobTopologyRequest::GetJobTopologyRequest() : + RpcServiceRequest("teslastream", "2018-01-15", "GetJobTopology") +{} + +GetJobTopologyRequest::~GetJobTopologyRequest() +{} + +std::string GetJobTopologyRequest::getJobName()const +{ + return jobName_; +} + +void GetJobTopologyRequest::setJobName(const std::string& jobName) +{ + jobName_ = jobName; + setParameter("JobName", jobName); +} + diff --git a/teslastream/src/model/GetJobTopologyResult.cc b/teslastream/src/model/GetJobTopologyResult.cc new file mode 100644 index 000000000..c8ec9b640 --- /dev/null +++ b/teslastream/src/model/GetJobTopologyResult.cc @@ -0,0 +1,82 @@ +/* + * 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 +#include + +using namespace AlibabaCloud::TeslaStream; +using namespace AlibabaCloud::TeslaStream::Model; + +GetJobTopologyResult::GetJobTopologyResult() : + ServiceResult() +{} + +GetJobTopologyResult::GetJobTopologyResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetJobTopologyResult::~GetJobTopologyResult() +{} + +void GetJobTopologyResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + + setRequestId(value["RequestId"].asString()); + auto allData = value["Data"]["Job"]; + for (auto value : allData) + { + Job dataObject; + if(!value["Text"].isNull()) + dataObject.text = value["Text"].asString(); + if(!value["Type"].isNull()) + dataObject.type = value["Type"].asString(); + if(!value["PluginRelation"].isNull()) + dataObject.pluginRelation = value["PluginRelation"].asString(); + auto allParents = value["Parents"]["Parent"]; + for (auto value : allParents) + dataObject.parents.push_back(value.asString()); + auto allChildrens = value["Childrens"]["Children"]; + for (auto value : allChildrens) + dataObject.childrens.push_back(value.asString()); + data_.push_back(dataObject); + } + if(!value["Code"].isNull()) + code_ = std::stoi(value["Code"].asString()); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + +} + +std::string GetJobTopologyResult::getMessage()const +{ + return message_; +} + +std::vector GetJobTopologyResult::getData()const +{ + return data_; +} + +int GetJobTopologyResult::getCode()const +{ + return code_; +} +