TESLASTREAM SDK Auto Released By tony.ly,Version:1.20.2

Signed-off-by: yixiong.jxy <yixiong.jxy@alibaba-inc.com>
This commit is contained in:
yixiong.jxy
2018-07-26 09:26:49 +08:00
parent 7e24ec0ded
commit 20195cdd92
19 changed files with 1060 additions and 2 deletions

View File

@@ -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.

View File

@@ -79,4 +79,5 @@ add_subdirectory(jarvis)
add_subdirectory(scdn)
add_subdirectory(live)
add_subdirectory(rtc)
add_subdirectory(chatbot)
add_subdirectory(chatbot)
add_subdirectory(teslastream)

View File

@@ -1 +1 @@
1.20.1
1.20.2

View 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(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}
)

View File

@@ -0,0 +1,70 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_TESLASTREAM_TESLASTREAMCLIENT_H_
#define ALIBABACLOUD_TESLASTREAM_TESLASTREAMCLIENT_H_
#include <future>
#include <alibabacloud/core/AsyncCallerContext.h>
#include <alibabacloud/core/EndpointProvider.h>
#include <alibabacloud/core/RpcServiceClient.h>
#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<Error, Model::GetJobTopologyResult> GetJobTopologyOutcome;
typedef std::future<GetJobTopologyOutcome> GetJobTopologyOutcomeCallable;
typedef std::function<void(const TeslaStreamClient*, const Model::GetJobTopologyRequest&, const GetJobTopologyOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetJobTopologyAsyncHandler;
typedef Outcome<Error, Model::BatchGetJobMetricInfoResult> BatchGetJobMetricInfoOutcome;
typedef std::future<BatchGetJobMetricInfoOutcome> BatchGetJobMetricInfoOutcomeCallable;
typedef std::function<void(const TeslaStreamClient*, const Model::BatchGetJobMetricInfoRequest&, const BatchGetJobMetricInfoOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> BatchGetJobMetricInfoAsyncHandler;
typedef Outcome<Error, Model::BatchGetPluginConfigInfoResult> BatchGetPluginConfigInfoOutcome;
typedef std::future<BatchGetPluginConfigInfoOutcome> BatchGetPluginConfigInfoOutcomeCallable;
typedef std::function<void(const TeslaStreamClient*, const Model::BatchGetPluginConfigInfoRequest&, const BatchGetPluginConfigInfoOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> BatchGetPluginConfigInfoAsyncHandler;
TeslaStreamClient(const Credentials &credentials, const ClientConfiguration &configuration);
TeslaStreamClient(const std::shared_ptr<CredentialsProvider> &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<const AsyncCallerContext>& 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<const AsyncCallerContext>& 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<const AsyncCallerContext>& context = nullptr) const;
BatchGetPluginConfigInfoOutcomeCallable batchGetPluginConfigInfoCallable(const Model::BatchGetPluginConfigInfoRequest& request) const;
private:
std::shared_ptr<EndpointProvider> endpointProvider_;
};
}
}
#endif // !ALIBABACLOUD_TESLASTREAM_TESLASTREAMCLIENT_H_

View File

@@ -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 <alibabacloud/core/Global.h>
#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_

View File

@@ -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 <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/teslastream/TeslaStreamExport.h>
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_

View File

@@ -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 <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/teslastream/TeslaStreamExport.h>
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<Job> getData()const;
int getCode()const;
protected:
void parse(const std::string &payload);
private:
std::string message_;
std::vector<Job> data_;
int code_;
};
}
}
}
#endif // !ALIBABACLOUD_TESLASTREAM_MODEL_BATCHGETJOBMETRICINFORESULT_H_

View File

@@ -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 <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/teslastream/TeslaStreamExport.h>
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_

View File

@@ -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 <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/teslastream/TeslaStreamExport.h>
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<Plugin> getData()const;
int getCode()const;
protected:
void parse(const std::string &payload);
private:
std::string message_;
std::vector<Plugin> data_;
int code_;
};
}
}
}
#endif // !ALIBABACLOUD_TESLASTREAM_MODEL_BATCHGETPLUGINCONFIGINFORESULT_H_

View File

@@ -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 <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/teslastream/TeslaStreamExport.h>
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_

View File

@@ -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 <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/teslastream/TeslaStreamExport.h>
namespace AlibabaCloud
{
namespace TeslaStream
{
namespace Model
{
class ALIBABACLOUD_TESLASTREAM_EXPORT GetJobTopologyResult : public ServiceResult
{
public:
struct Job
{
std::string pluginRelation;
std::string type;
std::vector<std::string> parents;
std::vector<std::string> childrens;
std::string text;
};
GetJobTopologyResult();
explicit GetJobTopologyResult(const std::string &payload);
~GetJobTopologyResult();
std::string getMessage()const;
std::vector<Job> getData()const;
int getCode()const;
protected:
void parse(const std::string &payload);
private:
std::string message_;
std::vector<Job> data_;
int code_;
};
}
}
}
#endif // !ALIBABACLOUD_TESLASTREAM_MODEL_GETJOBTOPOLOGYRESULT_H_

View 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/teslastream/TeslaStreamClient.h>
#include <alibabacloud/core/SimpleCredentialsProvider.h>
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<SimpleCredentialsProvider>(credentials), configuration)
{
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
}
TeslaStreamClient::TeslaStreamClient(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, "");
}
TeslaStreamClient::TeslaStreamClient(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, "");
}
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<const AsyncCallerContext>& 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<std::packaged_task<GetJobTopologyOutcome()>>(
[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<const AsyncCallerContext>& 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<std::packaged_task<BatchGetJobMetricInfoOutcome()>>(
[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<const AsyncCallerContext>& 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<std::packaged_task<BatchGetPluginConfigInfoOutcome()>>(
[this, request]()
{
return this->batchGetPluginConfigInfo(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}

View File

@@ -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 <alibabacloud/teslastream/model/BatchGetJobMetricInfoRequest.h>
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);
}

View File

@@ -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 <alibabacloud/teslastream/model/BatchGetJobMetricInfoResult.h>
#include <json/json.h>
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::Job> BatchGetJobMetricInfoResult::getData()const
{
return data_;
}
int BatchGetJobMetricInfoResult::getCode()const
{
return code_;
}

View File

@@ -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 <alibabacloud/teslastream/model/BatchGetPluginConfigInfoRequest.h>
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);
}

View File

@@ -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 <alibabacloud/teslastream/model/BatchGetPluginConfigInfoResult.h>
#include <json/json.h>
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::Plugin> BatchGetPluginConfigInfoResult::getData()const
{
return data_;
}
int BatchGetPluginConfigInfoResult::getCode()const
{
return code_;
}

View File

@@ -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 <alibabacloud/teslastream/model/GetJobTopologyRequest.h>
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);
}

View File

@@ -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 <alibabacloud/teslastream/model/GetJobTopologyResult.h>
#include <json/json.h>
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::Job> GetJobTopologyResult::getData()const
{
return data_;
}
int GetJobTopologyResult::getCode()const
{
return code_;
}