Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
78ee1b30bd | ||
|
|
96d9eb7efd |
@@ -1,3 +1,10 @@
|
||||
2018-02-28 Version: 1.2.4
|
||||
1, Add query resource inventory API.
|
||||
2, Add query topology API.
|
||||
|
||||
2018-02-27 Version: 1.2.3
|
||||
1, Add query topology API.
|
||||
|
||||
2018-02-27 Version: 1.2.2
|
||||
1, Add new API: ListRecordingsByContactId.
|
||||
|
||||
|
||||
@@ -63,4 +63,5 @@ add_subdirectory(afs)
|
||||
add_subdirectory(aegis)
|
||||
add_subdirectory(ehpc)
|
||||
add_subdirectory(cs)
|
||||
add_subdirectory(ccc)
|
||||
add_subdirectory(ccc)
|
||||
add_subdirectory(teslamaxcompute)
|
||||
114
teslamaxcompute/CMakeLists.txt
Normal file
114
teslamaxcompute/CMakeLists.txt
Normal file
@@ -0,0 +1,114 @@
|
||||
#
|
||||
# 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(teslamaxcompute_public_header
|
||||
include/alibabacloud/teslamaxcompute/TeslaMaxComputeClient.h
|
||||
include/alibabacloud/teslamaxcompute/TeslaMaxComputeExport.h )
|
||||
|
||||
set(teslamaxcompute_public_header_model
|
||||
include/alibabacloud/teslamaxcompute/model/GetUserInstanceRequest.h
|
||||
include/alibabacloud/teslamaxcompute/model/GetUserInstanceResult.h
|
||||
include/alibabacloud/teslamaxcompute/model/GetProjectInstanceRequest.h
|
||||
include/alibabacloud/teslamaxcompute/model/GetProjectInstanceResult.h
|
||||
include/alibabacloud/teslamaxcompute/model/QueryResourceInventoryRequest.h
|
||||
include/alibabacloud/teslamaxcompute/model/QueryResourceInventoryResult.h
|
||||
include/alibabacloud/teslamaxcompute/model/QueryTopologyRequest.h
|
||||
include/alibabacloud/teslamaxcompute/model/QueryTopologyResult.h
|
||||
include/alibabacloud/teslamaxcompute/model/GetInstancesStatusCountRequest.h
|
||||
include/alibabacloud/teslamaxcompute/model/GetInstancesStatusCountResult.h
|
||||
include/alibabacloud/teslamaxcompute/model/GetQuotaInstanceRequest.h
|
||||
include/alibabacloud/teslamaxcompute/model/GetQuotaInstanceResult.h
|
||||
include/alibabacloud/teslamaxcompute/model/GetClusterInstanceRequest.h
|
||||
include/alibabacloud/teslamaxcompute/model/GetClusterInstanceResult.h
|
||||
include/alibabacloud/teslamaxcompute/model/GetQuotaHistoryInfoRequest.h
|
||||
include/alibabacloud/teslamaxcompute/model/GetQuotaHistoryInfoResult.h )
|
||||
|
||||
set(teslamaxcompute_src
|
||||
src/TeslaMaxComputeClient.cc
|
||||
src/model/GetUserInstanceRequest.cc
|
||||
src/model/GetUserInstanceResult.cc
|
||||
src/model/GetProjectInstanceRequest.cc
|
||||
src/model/GetProjectInstanceResult.cc
|
||||
src/model/QueryResourceInventoryRequest.cc
|
||||
src/model/QueryResourceInventoryResult.cc
|
||||
src/model/QueryTopologyRequest.cc
|
||||
src/model/QueryTopologyResult.cc
|
||||
src/model/GetInstancesStatusCountRequest.cc
|
||||
src/model/GetInstancesStatusCountResult.cc
|
||||
src/model/GetQuotaInstanceRequest.cc
|
||||
src/model/GetQuotaInstanceResult.cc
|
||||
src/model/GetClusterInstanceRequest.cc
|
||||
src/model/GetClusterInstanceResult.cc
|
||||
src/model/GetQuotaHistoryInfoRequest.cc
|
||||
src/model/GetQuotaHistoryInfoResult.cc )
|
||||
|
||||
add_library(teslamaxcompute ${LIB_TYPE}
|
||||
${teslamaxcompute_public_header}
|
||||
${teslamaxcompute_public_header_model}
|
||||
${teslamaxcompute_src})
|
||||
|
||||
set_target_properties(teslamaxcompute
|
||||
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}teslamaxcompute
|
||||
)
|
||||
|
||||
if(${LIB_TYPE} STREQUAL "SHARED")
|
||||
set_target_properties(teslamaxcompute
|
||||
PROPERTIES
|
||||
DEFINE_SYMBOL ALIBABACLOUD_TESLAMAXCOMPUTE_LIBRARY)
|
||||
endif()
|
||||
|
||||
target_include_directories(teslamaxcompute
|
||||
PRIVATE include
|
||||
${CMAKE_SOURCE_DIR}/core/include
|
||||
)
|
||||
target_link_libraries(teslamaxcompute
|
||||
core)
|
||||
|
||||
if(CMAKE_HOST_WIN32)
|
||||
ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
|
||||
set(jsoncpp_install_dir ${INSTALL_DIR})
|
||||
add_dependencies(teslamaxcompute
|
||||
jsoncpp)
|
||||
target_include_directories(teslamaxcompute
|
||||
PRIVATE ${jsoncpp_install_dir}/include)
|
||||
target_link_libraries(teslamaxcompute
|
||||
${jsoncpp_install_dir}/lib/jsoncpp.lib)
|
||||
set_target_properties(teslamaxcompute
|
||||
PROPERTIES
|
||||
COMPILE_OPTIONS "/bigobj")
|
||||
else()
|
||||
target_include_directories(teslamaxcompute
|
||||
PRIVATE /usr/include/jsoncpp)
|
||||
target_link_libraries(teslamaxcompute
|
||||
jsoncpp)
|
||||
endif()
|
||||
|
||||
install(FILES ${teslamaxcompute_public_header}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/teslamaxcompute)
|
||||
install(FILES ${teslamaxcompute_public_header_model}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/teslamaxcompute/model)
|
||||
install(TARGETS teslamaxcompute
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* 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_TESLAMAXCOMPUTE_TESLAMAXCOMPUTECLIENT_H_
|
||||
#define ALIBABACLOUD_TESLAMAXCOMPUTE_TESLAMAXCOMPUTECLIENT_H_
|
||||
|
||||
#include <future>
|
||||
#include <alibabacloud/core/AsyncCallerContext.h>
|
||||
#include <alibabacloud/core/EndpointProvider.h>
|
||||
#include <alibabacloud/core/RpcServiceClient.h>
|
||||
#include "TeslaMaxComputeExport.h"
|
||||
#include "model/GetUserInstanceRequest.h"
|
||||
#include "model/GetUserInstanceResult.h"
|
||||
#include "model/GetProjectInstanceRequest.h"
|
||||
#include "model/GetProjectInstanceResult.h"
|
||||
#include "model/QueryResourceInventoryRequest.h"
|
||||
#include "model/QueryResourceInventoryResult.h"
|
||||
#include "model/QueryTopologyRequest.h"
|
||||
#include "model/QueryTopologyResult.h"
|
||||
#include "model/GetInstancesStatusCountRequest.h"
|
||||
#include "model/GetInstancesStatusCountResult.h"
|
||||
#include "model/GetQuotaInstanceRequest.h"
|
||||
#include "model/GetQuotaInstanceResult.h"
|
||||
#include "model/GetClusterInstanceRequest.h"
|
||||
#include "model/GetClusterInstanceResult.h"
|
||||
#include "model/GetQuotaHistoryInfoRequest.h"
|
||||
#include "model/GetQuotaHistoryInfoResult.h"
|
||||
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace TeslaMaxCompute
|
||||
{
|
||||
class ALIBABACLOUD_TESLAMAXCOMPUTE_EXPORT TeslaMaxComputeClient : public RpcServiceClient
|
||||
{
|
||||
public:
|
||||
typedef Outcome<Error, Model::GetUserInstanceResult> GetUserInstanceOutcome;
|
||||
typedef std::future<GetUserInstanceOutcome> GetUserInstanceOutcomeCallable;
|
||||
typedef std::function<void(const TeslaMaxComputeClient*, const Model::GetUserInstanceRequest&, const GetUserInstanceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetUserInstanceAsyncHandler;
|
||||
typedef Outcome<Error, Model::GetProjectInstanceResult> GetProjectInstanceOutcome;
|
||||
typedef std::future<GetProjectInstanceOutcome> GetProjectInstanceOutcomeCallable;
|
||||
typedef std::function<void(const TeslaMaxComputeClient*, const Model::GetProjectInstanceRequest&, const GetProjectInstanceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetProjectInstanceAsyncHandler;
|
||||
typedef Outcome<Error, Model::QueryResourceInventoryResult> QueryResourceInventoryOutcome;
|
||||
typedef std::future<QueryResourceInventoryOutcome> QueryResourceInventoryOutcomeCallable;
|
||||
typedef std::function<void(const TeslaMaxComputeClient*, const Model::QueryResourceInventoryRequest&, const QueryResourceInventoryOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> QueryResourceInventoryAsyncHandler;
|
||||
typedef Outcome<Error, Model::QueryTopologyResult> QueryTopologyOutcome;
|
||||
typedef std::future<QueryTopologyOutcome> QueryTopologyOutcomeCallable;
|
||||
typedef std::function<void(const TeslaMaxComputeClient*, const Model::QueryTopologyRequest&, const QueryTopologyOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> QueryTopologyAsyncHandler;
|
||||
typedef Outcome<Error, Model::GetInstancesStatusCountResult> GetInstancesStatusCountOutcome;
|
||||
typedef std::future<GetInstancesStatusCountOutcome> GetInstancesStatusCountOutcomeCallable;
|
||||
typedef std::function<void(const TeslaMaxComputeClient*, const Model::GetInstancesStatusCountRequest&, const GetInstancesStatusCountOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetInstancesStatusCountAsyncHandler;
|
||||
typedef Outcome<Error, Model::GetQuotaInstanceResult> GetQuotaInstanceOutcome;
|
||||
typedef std::future<GetQuotaInstanceOutcome> GetQuotaInstanceOutcomeCallable;
|
||||
typedef std::function<void(const TeslaMaxComputeClient*, const Model::GetQuotaInstanceRequest&, const GetQuotaInstanceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetQuotaInstanceAsyncHandler;
|
||||
typedef Outcome<Error, Model::GetClusterInstanceResult> GetClusterInstanceOutcome;
|
||||
typedef std::future<GetClusterInstanceOutcome> GetClusterInstanceOutcomeCallable;
|
||||
typedef std::function<void(const TeslaMaxComputeClient*, const Model::GetClusterInstanceRequest&, const GetClusterInstanceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetClusterInstanceAsyncHandler;
|
||||
typedef Outcome<Error, Model::GetQuotaHistoryInfoResult> GetQuotaHistoryInfoOutcome;
|
||||
typedef std::future<GetQuotaHistoryInfoOutcome> GetQuotaHistoryInfoOutcomeCallable;
|
||||
typedef std::function<void(const TeslaMaxComputeClient*, const Model::GetQuotaHistoryInfoRequest&, const GetQuotaHistoryInfoOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetQuotaHistoryInfoAsyncHandler;
|
||||
|
||||
TeslaMaxComputeClient(const Credentials &credentials, const ClientConfiguration &configuration);
|
||||
TeslaMaxComputeClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
|
||||
TeslaMaxComputeClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
|
||||
~TeslaMaxComputeClient();
|
||||
GetUserInstanceOutcome getUserInstance(const Model::GetUserInstanceRequest &request)const;
|
||||
void getUserInstanceAsync(const Model::GetUserInstanceRequest& request, const GetUserInstanceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetUserInstanceOutcomeCallable getUserInstanceCallable(const Model::GetUserInstanceRequest& request) const;
|
||||
GetProjectInstanceOutcome getProjectInstance(const Model::GetProjectInstanceRequest &request)const;
|
||||
void getProjectInstanceAsync(const Model::GetProjectInstanceRequest& request, const GetProjectInstanceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetProjectInstanceOutcomeCallable getProjectInstanceCallable(const Model::GetProjectInstanceRequest& request) const;
|
||||
QueryResourceInventoryOutcome queryResourceInventory(const Model::QueryResourceInventoryRequest &request)const;
|
||||
void queryResourceInventoryAsync(const Model::QueryResourceInventoryRequest& request, const QueryResourceInventoryAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
QueryResourceInventoryOutcomeCallable queryResourceInventoryCallable(const Model::QueryResourceInventoryRequest& request) const;
|
||||
QueryTopologyOutcome queryTopology(const Model::QueryTopologyRequest &request)const;
|
||||
void queryTopologyAsync(const Model::QueryTopologyRequest& request, const QueryTopologyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
QueryTopologyOutcomeCallable queryTopologyCallable(const Model::QueryTopologyRequest& request) const;
|
||||
GetInstancesStatusCountOutcome getInstancesStatusCount(const Model::GetInstancesStatusCountRequest &request)const;
|
||||
void getInstancesStatusCountAsync(const Model::GetInstancesStatusCountRequest& request, const GetInstancesStatusCountAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetInstancesStatusCountOutcomeCallable getInstancesStatusCountCallable(const Model::GetInstancesStatusCountRequest& request) const;
|
||||
GetQuotaInstanceOutcome getQuotaInstance(const Model::GetQuotaInstanceRequest &request)const;
|
||||
void getQuotaInstanceAsync(const Model::GetQuotaInstanceRequest& request, const GetQuotaInstanceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetQuotaInstanceOutcomeCallable getQuotaInstanceCallable(const Model::GetQuotaInstanceRequest& request) const;
|
||||
GetClusterInstanceOutcome getClusterInstance(const Model::GetClusterInstanceRequest &request)const;
|
||||
void getClusterInstanceAsync(const Model::GetClusterInstanceRequest& request, const GetClusterInstanceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetClusterInstanceOutcomeCallable getClusterInstanceCallable(const Model::GetClusterInstanceRequest& request) const;
|
||||
GetQuotaHistoryInfoOutcome getQuotaHistoryInfo(const Model::GetQuotaHistoryInfoRequest &request)const;
|
||||
void getQuotaHistoryInfoAsync(const Model::GetQuotaHistoryInfoRequest& request, const GetQuotaHistoryInfoAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetQuotaHistoryInfoOutcomeCallable getQuotaHistoryInfoCallable(const Model::GetQuotaHistoryInfoRequest& request) const;
|
||||
|
||||
private:
|
||||
virtual EndpointOutcome endpoint()const override;
|
||||
std::shared_ptr<EndpointProvider> endpointProvider_;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !ALIBABACLOUD_TESLAMAXCOMPUTE_TESLAMAXCOMPUTECLIENT_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_TESLAMAXCOMPUTE_TESLAMAXCOMPUTEEXPORT_H_
|
||||
#define ALIBABACLOUD_TESLAMAXCOMPUTE_TESLAMAXCOMPUTEEXPORT_H_
|
||||
|
||||
#include <alibabacloud/core/Global.h>
|
||||
|
||||
#if defined(ALIBABACLOUD_SHARED)
|
||||
# if defined(ALIBABACLOUD_TESLAMAXCOMPUTE_LIBRARY)
|
||||
# define ALIBABACLOUD_TESLAMAXCOMPUTE_EXPORT ALIBABACLOUD_DECL_EXPORT
|
||||
# else
|
||||
# define ALIBABACLOUD_TESLAMAXCOMPUTE_EXPORT ALIBABACLOUD_DECL_IMPORT
|
||||
# endif
|
||||
#else
|
||||
# define ALIBABACLOUD_TESLAMAXCOMPUTE_EXPORT
|
||||
#endif
|
||||
|
||||
#endif // !ALIBABACLOUD_TESLAMAXCOMPUTE_TESLAMAXCOMPUTEEXPORT_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_TESLAMAXCOMPUTE_MODEL_GETCLUSTERINSTANCEREQUEST_H_
|
||||
#define ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_GETCLUSTERINSTANCEREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/teslamaxcompute/TeslaMaxComputeExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace TeslaMaxCompute
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_TESLAMAXCOMPUTE_EXPORT GetClusterInstanceRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
GetClusterInstanceRequest();
|
||||
~GetClusterInstanceRequest();
|
||||
|
||||
std::string getCluster()const;
|
||||
void setCluster(const std::string& cluster);
|
||||
int getPageSize()const;
|
||||
void setPageSize(int pageSize);
|
||||
int getPageNum()const;
|
||||
void setPageNum(int pageNum);
|
||||
std::string getRegion()const;
|
||||
void setRegion(const std::string& region);
|
||||
std::string getStatus()const;
|
||||
void setStatus(const std::string& status);
|
||||
|
||||
private:
|
||||
std::string cluster_;
|
||||
int pageSize_;
|
||||
int pageNum_;
|
||||
std::string region_;
|
||||
std::string status_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_GETCLUSTERINSTANCEREQUEST_H_
|
||||
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* 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_TESLAMAXCOMPUTE_MODEL_GETCLUSTERINSTANCERESULT_H_
|
||||
#define ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_GETCLUSTERINSTANCERESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/teslamaxcompute/TeslaMaxComputeExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace TeslaMaxCompute
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_TESLAMAXCOMPUTE_EXPORT GetClusterInstanceResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct Instance
|
||||
{
|
||||
std::string status;
|
||||
int quotaId;
|
||||
float cpuUsedRatioMin;
|
||||
std::string runTime;
|
||||
std::string skynetId;
|
||||
long memRequest;
|
||||
std::string instanceId;
|
||||
std::string cluster;
|
||||
float memUsedRatioMax;
|
||||
std::string nickName;
|
||||
long memUsedTotal;
|
||||
float cpuUsedRatioMax;
|
||||
std::string project;
|
||||
std::string quotaName;
|
||||
long memUsed;
|
||||
long cpuUsedTotal;
|
||||
std::string taskType;
|
||||
float memUsedRatioMin;
|
||||
long cpuUsed;
|
||||
std::string userAccount;
|
||||
long cpuRequest;
|
||||
};
|
||||
int total;
|
||||
std::vector<Instance> detail;
|
||||
};
|
||||
|
||||
|
||||
GetClusterInstanceResult();
|
||||
explicit GetClusterInstanceResult(const std::string &payload);
|
||||
~GetClusterInstanceResult();
|
||||
std::string getMessage()const;
|
||||
std::vector<Data> getData()const;
|
||||
int getCode()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::vector<Data> data_;
|
||||
int code_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_GETCLUSTERINSTANCERESULT_H_
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* 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_TESLAMAXCOMPUTE_MODEL_GETINSTANCESSTATUSCOUNTREQUEST_H_
|
||||
#define ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_GETINSTANCESSTATUSCOUNTREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/teslamaxcompute/TeslaMaxComputeExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace TeslaMaxCompute
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_TESLAMAXCOMPUTE_EXPORT GetInstancesStatusCountRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
GetInstancesStatusCountRequest();
|
||||
~GetInstancesStatusCountRequest();
|
||||
|
||||
std::string getCluster()const;
|
||||
void setCluster(const std::string& cluster);
|
||||
std::string getRegion()const;
|
||||
void setRegion(const std::string& region);
|
||||
|
||||
private:
|
||||
std::string cluster_;
|
||||
std::string region_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_GETINSTANCESSTATUSCOUNTREQUEST_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_TESLAMAXCOMPUTE_MODEL_GETINSTANCESSTATUSCOUNTRESULT_H_
|
||||
#define ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_GETINSTANCESSTATUSCOUNTRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/teslamaxcompute/TeslaMaxComputeExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace TeslaMaxCompute
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_TESLAMAXCOMPUTE_EXPORT GetInstancesStatusCountResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct DataItem
|
||||
{
|
||||
std::string status;
|
||||
int size;
|
||||
};
|
||||
|
||||
|
||||
GetInstancesStatusCountResult();
|
||||
explicit GetInstancesStatusCountResult(const std::string &payload);
|
||||
~GetInstancesStatusCountResult();
|
||||
std::string getMessage()const;
|
||||
std::vector<DataItem> getData()const;
|
||||
int getCode()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::vector<DataItem> data_;
|
||||
int code_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_GETINSTANCESSTATUSCOUNTRESULT_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_TESLAMAXCOMPUTE_MODEL_GETPROJECTINSTANCEREQUEST_H_
|
||||
#define ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_GETPROJECTINSTANCEREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/teslamaxcompute/TeslaMaxComputeExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace TeslaMaxCompute
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_TESLAMAXCOMPUTE_EXPORT GetProjectInstanceRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
GetProjectInstanceRequest();
|
||||
~GetProjectInstanceRequest();
|
||||
|
||||
int getPageSize()const;
|
||||
void setPageSize(int pageSize);
|
||||
std::string getProject()const;
|
||||
void setProject(const std::string& project);
|
||||
int getPageNum()const;
|
||||
void setPageNum(int pageNum);
|
||||
std::string getRegion()const;
|
||||
void setRegion(const std::string& region);
|
||||
std::string getStatus()const;
|
||||
void setStatus(const std::string& status);
|
||||
|
||||
private:
|
||||
int pageSize_;
|
||||
std::string project_;
|
||||
int pageNum_;
|
||||
std::string region_;
|
||||
std::string status_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_GETPROJECTINSTANCEREQUEST_H_
|
||||
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* 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_TESLAMAXCOMPUTE_MODEL_GETPROJECTINSTANCERESULT_H_
|
||||
#define ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_GETPROJECTINSTANCERESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/teslamaxcompute/TeslaMaxComputeExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace TeslaMaxCompute
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_TESLAMAXCOMPUTE_EXPORT GetProjectInstanceResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct Instance
|
||||
{
|
||||
std::string status;
|
||||
int quotaId;
|
||||
float cpuUsedRatioMin;
|
||||
std::string runTime;
|
||||
std::string skynetId;
|
||||
long memRequest;
|
||||
std::string instanceId;
|
||||
std::string cluster;
|
||||
float memUsedRatioMax;
|
||||
std::string nickName;
|
||||
long memUsedTotal;
|
||||
float cpuUsedRatioMax;
|
||||
std::string project;
|
||||
std::string quotaName;
|
||||
long memUsed;
|
||||
long cpuUsedTotal;
|
||||
std::string taskType;
|
||||
float memUsedRatioMin;
|
||||
long cpuUsed;
|
||||
std::string userAccount;
|
||||
long cpuRequest;
|
||||
};
|
||||
int total;
|
||||
std::vector<Instance> detail;
|
||||
};
|
||||
|
||||
|
||||
GetProjectInstanceResult();
|
||||
explicit GetProjectInstanceResult(const std::string &payload);
|
||||
~GetProjectInstanceResult();
|
||||
std::string getMessage()const;
|
||||
std::vector<Data> getData()const;
|
||||
int getCode()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::vector<Data> data_;
|
||||
int code_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_GETPROJECTINSTANCERESULT_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_TESLAMAXCOMPUTE_MODEL_GETQUOTAHISTORYINFOREQUEST_H_
|
||||
#define ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_GETQUOTAHISTORYINFOREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/teslamaxcompute/TeslaMaxComputeExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace TeslaMaxCompute
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_TESLAMAXCOMPUTE_EXPORT GetQuotaHistoryInfoRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
GetQuotaHistoryInfoRequest();
|
||||
~GetQuotaHistoryInfoRequest();
|
||||
|
||||
std::string getCluster()const;
|
||||
void setCluster(const std::string& cluster);
|
||||
int getEndTime()const;
|
||||
void setEndTime(int endTime);
|
||||
int getStartTime()const;
|
||||
void setStartTime(int startTime);
|
||||
std::string getRegion()const;
|
||||
void setRegion(const std::string& region);
|
||||
std::string getQuotaName()const;
|
||||
void setQuotaName(const std::string& quotaName);
|
||||
|
||||
private:
|
||||
std::string cluster_;
|
||||
int endTime_;
|
||||
int startTime_;
|
||||
std::string region_;
|
||||
std::string quotaName_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_GETQUOTAHISTORYINFOREQUEST_H_
|
||||
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* 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_TESLAMAXCOMPUTE_MODEL_GETQUOTAHISTORYINFORESULT_H_
|
||||
#define ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_GETQUOTAHISTORYINFORESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/teslamaxcompute/TeslaMaxComputeExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace TeslaMaxCompute
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_TESLAMAXCOMPUTE_EXPORT GetQuotaHistoryInfoResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct DataItem
|
||||
{
|
||||
struct Point
|
||||
{
|
||||
struct CpuMaxQuota
|
||||
{
|
||||
int min;
|
||||
int avg;
|
||||
int max;
|
||||
};
|
||||
struct CpuMinQuota
|
||||
{
|
||||
int min;
|
||||
int avg;
|
||||
int max;
|
||||
};
|
||||
struct MemUsed
|
||||
{
|
||||
int min;
|
||||
int avg;
|
||||
int max;
|
||||
};
|
||||
struct CpuUsed
|
||||
{
|
||||
int min;
|
||||
int avg;
|
||||
int max;
|
||||
};
|
||||
std::vector<CpuMinQuota> cpuMinQuota;
|
||||
std::vector<MemUsed> memUsed;
|
||||
std::vector<CpuMaxQuota> cpuMaxQuota;
|
||||
std::vector<CpuUsed> cpuUsed;
|
||||
};
|
||||
int times;
|
||||
std::vector<Point> point;
|
||||
};
|
||||
|
||||
|
||||
GetQuotaHistoryInfoResult();
|
||||
explicit GetQuotaHistoryInfoResult(const std::string &payload);
|
||||
~GetQuotaHistoryInfoResult();
|
||||
std::string getMessage()const;
|
||||
std::vector<DataItem> getData()const;
|
||||
int getCode()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::vector<DataItem> data_;
|
||||
int code_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_GETQUOTAHISTORYINFORESULT_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_TESLAMAXCOMPUTE_MODEL_GETQUOTAINSTANCEREQUEST_H_
|
||||
#define ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_GETQUOTAINSTANCEREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/teslamaxcompute/TeslaMaxComputeExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace TeslaMaxCompute
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_TESLAMAXCOMPUTE_EXPORT GetQuotaInstanceRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
GetQuotaInstanceRequest();
|
||||
~GetQuotaInstanceRequest();
|
||||
|
||||
std::string getCluster()const;
|
||||
void setCluster(const std::string& cluster);
|
||||
int getPageSize()const;
|
||||
void setPageSize(int pageSize);
|
||||
std::string getQuotaId()const;
|
||||
void setQuotaId(const std::string& quotaId);
|
||||
int getPageNum()const;
|
||||
void setPageNum(int pageNum);
|
||||
std::string getStatus()const;
|
||||
void setStatus(const std::string& status);
|
||||
|
||||
private:
|
||||
std::string cluster_;
|
||||
int pageSize_;
|
||||
std::string quotaId_;
|
||||
int pageNum_;
|
||||
std::string status_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_GETQUOTAINSTANCEREQUEST_H_
|
||||
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* 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_TESLAMAXCOMPUTE_MODEL_GETQUOTAINSTANCERESULT_H_
|
||||
#define ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_GETQUOTAINSTANCERESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/teslamaxcompute/TeslaMaxComputeExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace TeslaMaxCompute
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_TESLAMAXCOMPUTE_EXPORT GetQuotaInstanceResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct Instance
|
||||
{
|
||||
std::string status;
|
||||
int quotaId;
|
||||
float cpuUsedRatioMin;
|
||||
std::string runTime;
|
||||
std::string skynetId;
|
||||
long memRequest;
|
||||
std::string instanceId;
|
||||
std::string cluster;
|
||||
float memUsedRatioMax;
|
||||
std::string nickName;
|
||||
long memUsedTotal;
|
||||
float cpuUsedRatioMax;
|
||||
std::string project;
|
||||
std::string quotaName;
|
||||
long memUsed;
|
||||
long cpuUsedTotal;
|
||||
std::string taskType;
|
||||
float memUsedRatioMin;
|
||||
long cpuUsed;
|
||||
std::string userAccount;
|
||||
long cpuRequest;
|
||||
};
|
||||
int total;
|
||||
std::vector<Instance> detail;
|
||||
};
|
||||
|
||||
|
||||
GetQuotaInstanceResult();
|
||||
explicit GetQuotaInstanceResult(const std::string &payload);
|
||||
~GetQuotaInstanceResult();
|
||||
std::string getMessage()const;
|
||||
std::vector<Data> getData()const;
|
||||
int getCode()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::vector<Data> data_;
|
||||
int code_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_GETQUOTAINSTANCERESULT_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_TESLAMAXCOMPUTE_MODEL_GETUSERINSTANCEREQUEST_H_
|
||||
#define ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_GETUSERINSTANCEREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/teslamaxcompute/TeslaMaxComputeExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace TeslaMaxCompute
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_TESLAMAXCOMPUTE_EXPORT GetUserInstanceRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
GetUserInstanceRequest();
|
||||
~GetUserInstanceRequest();
|
||||
|
||||
int getPageSize()const;
|
||||
void setPageSize(int pageSize);
|
||||
int getPageNum()const;
|
||||
void setPageNum(int pageNum);
|
||||
std::string getRegion()const;
|
||||
void setRegion(const std::string& region);
|
||||
std::string getUser()const;
|
||||
void setUser(const std::string& user);
|
||||
std::string getStatus()const;
|
||||
void setStatus(const std::string& status);
|
||||
|
||||
private:
|
||||
int pageSize_;
|
||||
int pageNum_;
|
||||
std::string region_;
|
||||
std::string user_;
|
||||
std::string status_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_GETUSERINSTANCEREQUEST_H_
|
||||
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* 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_TESLAMAXCOMPUTE_MODEL_GETUSERINSTANCERESULT_H_
|
||||
#define ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_GETUSERINSTANCERESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/teslamaxcompute/TeslaMaxComputeExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace TeslaMaxCompute
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_TESLAMAXCOMPUTE_EXPORT GetUserInstanceResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct Instance
|
||||
{
|
||||
std::string status;
|
||||
int quotaId;
|
||||
float cpuUsedRatioMin;
|
||||
std::string runTime;
|
||||
std::string skynetId;
|
||||
long memRequest;
|
||||
std::string instanceId;
|
||||
std::string cluster;
|
||||
float memUsedRatioMax;
|
||||
std::string nickName;
|
||||
long memUsedTotal;
|
||||
float cpuUsedRatioMax;
|
||||
std::string project;
|
||||
std::string quotaName;
|
||||
long memUsed;
|
||||
long cpuUsedTotal;
|
||||
std::string taskType;
|
||||
float memUsedRatioMin;
|
||||
long cpuUsed;
|
||||
std::string userAccount;
|
||||
long cpuRequest;
|
||||
};
|
||||
int total;
|
||||
std::vector<Instance> detail;
|
||||
};
|
||||
|
||||
|
||||
GetUserInstanceResult();
|
||||
explicit GetUserInstanceResult(const std::string &payload);
|
||||
~GetUserInstanceResult();
|
||||
std::string getMessage()const;
|
||||
std::vector<Data> getData()const;
|
||||
int getCode()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::vector<Data> data_;
|
||||
int code_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_GETUSERINSTANCERESULT_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_TESLAMAXCOMPUTE_MODEL_QUERYRESOURCEINVENTORYREQUEST_H_
|
||||
#define ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_QUERYRESOURCEINVENTORYREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/teslamaxcompute/TeslaMaxComputeExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace TeslaMaxCompute
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_TESLAMAXCOMPUTE_EXPORT QueryResourceInventoryRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
QueryResourceInventoryRequest();
|
||||
~QueryResourceInventoryRequest();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_QUERYRESOURCEINVENTORYREQUEST_H_
|
||||
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* 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_TESLAMAXCOMPUTE_MODEL_QUERYRESOURCEINVENTORYRESULT_H_
|
||||
#define ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_QUERYRESOURCEINVENTORYRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/teslamaxcompute/TeslaMaxComputeExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace TeslaMaxCompute
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_TESLAMAXCOMPUTE_EXPORT QueryResourceInventoryResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct Cluster
|
||||
{
|
||||
struct ResourceParameter
|
||||
{
|
||||
std::string paraName;
|
||||
std::string paraValue;
|
||||
};
|
||||
struct ResourceInventory
|
||||
{
|
||||
long used;
|
||||
long total;
|
||||
long available;
|
||||
std::string resourceType;
|
||||
};
|
||||
std::string status;
|
||||
std::vector<Cluster::ResourceInventory> resourceInventories;
|
||||
std::string cluster;
|
||||
std::string region;
|
||||
std::string machineRoom;
|
||||
std::vector<Cluster::ResourceParameter> resourceParameters;
|
||||
};
|
||||
std::string lastUpdate;
|
||||
std::vector<Cluster> clusters;
|
||||
};
|
||||
|
||||
|
||||
QueryResourceInventoryResult();
|
||||
explicit QueryResourceInventoryResult(const std::string &payload);
|
||||
~QueryResourceInventoryResult();
|
||||
std::string getMessage()const;
|
||||
std::vector<Data> getData()const;
|
||||
int getCode()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::vector<Data> data_;
|
||||
int code_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_QUERYRESOURCEINVENTORYRESULT_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_TESLAMAXCOMPUTE_MODEL_QUERYTOPOLOGYREQUEST_H_
|
||||
#define ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_QUERYTOPOLOGYREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/teslamaxcompute/TeslaMaxComputeExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace TeslaMaxCompute
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_TESLAMAXCOMPUTE_EXPORT QueryTopologyRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
QueryTopologyRequest();
|
||||
~QueryTopologyRequest();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_QUERYTOPOLOGYREQUEST_H_
|
||||
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* 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_TESLAMAXCOMPUTE_MODEL_QUERYTOPOLOGYRESULT_H_
|
||||
#define ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_QUERYTOPOLOGYRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/teslamaxcompute/TeslaMaxComputeExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace TeslaMaxCompute
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_TESLAMAXCOMPUTE_EXPORT QueryTopologyResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct ResultItem
|
||||
{
|
||||
struct RegionItem
|
||||
{
|
||||
struct ClusterItem
|
||||
{
|
||||
std::string netArch;
|
||||
std::string netCode;
|
||||
std::string cluster;
|
||||
std::string machineRoom;
|
||||
std::string productClass;
|
||||
std::string productLine;
|
||||
std::string business;
|
||||
};
|
||||
std::vector<RegionItem::ClusterItem> clusters;
|
||||
std::string regionEnName;
|
||||
std::string region;
|
||||
std::string regionCnName;
|
||||
};
|
||||
std::string lastUpdate;
|
||||
std::vector<ResultItem::RegionItem> regions;
|
||||
};
|
||||
|
||||
|
||||
QueryTopologyResult();
|
||||
explicit QueryTopologyResult(const std::string &payload);
|
||||
~QueryTopologyResult();
|
||||
std::string getMessage()const;
|
||||
int getCode()const;
|
||||
std::vector<ResultItem> getResult()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
int code_;
|
||||
std::vector<ResultItem> result_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_QUERYTOPOLOGYRESULT_H_
|
||||
349
teslamaxcompute/src/TeslaMaxComputeClient.cc
Normal file
349
teslamaxcompute/src/TeslaMaxComputeClient.cc
Normal file
@@ -0,0 +1,349 @@
|
||||
/*
|
||||
* 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/teslamaxcompute/TeslaMaxComputeClient.h>
|
||||
#include <alibabacloud/core/SimpleCredentialsProvider.h>
|
||||
|
||||
using namespace AlibabaCloud;
|
||||
using namespace AlibabaCloud::Location;
|
||||
using namespace AlibabaCloud::TeslaMaxCompute;
|
||||
using namespace AlibabaCloud::TeslaMaxCompute::Model;
|
||||
|
||||
TeslaMaxComputeClient::TeslaMaxComputeClient(const Credentials &credentials, const ClientConfiguration &configuration) :
|
||||
RpcServiceClient(std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), "");
|
||||
}
|
||||
|
||||
TeslaMaxComputeClient::TeslaMaxComputeClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
|
||||
RpcServiceClient(credentialsProvider, configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), "");
|
||||
}
|
||||
|
||||
TeslaMaxComputeClient::TeslaMaxComputeClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
|
||||
RpcServiceClient(std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), "");
|
||||
}
|
||||
|
||||
TeslaMaxComputeClient::~TeslaMaxComputeClient()
|
||||
{}
|
||||
|
||||
CoreClient::EndpointOutcome TeslaMaxComputeClient::endpoint()const
|
||||
{
|
||||
if(!configuration().endpoint().empty())
|
||||
return CoreClient::EndpointOutcome(configuration().endpoint());
|
||||
|
||||
auto endpoint = endpointProvider_->getEndpoint();
|
||||
|
||||
if (endpoint.empty())
|
||||
return CoreClient::EndpointOutcome(Error("InvalidEndpoint",""));
|
||||
else
|
||||
return CoreClient::EndpointOutcome(endpoint);
|
||||
}
|
||||
|
||||
TeslaMaxComputeClient::GetUserInstanceOutcome TeslaMaxComputeClient::getUserInstance(const GetUserInstanceRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetUserInstanceOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetUserInstanceOutcome(GetUserInstanceResult(outcome.result()));
|
||||
else
|
||||
return GetUserInstanceOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void TeslaMaxComputeClient::getUserInstanceAsync(const GetUserInstanceRequest& request, const GetUserInstanceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getUserInstance(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
TeslaMaxComputeClient::GetUserInstanceOutcomeCallable TeslaMaxComputeClient::getUserInstanceCallable(const GetUserInstanceRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetUserInstanceOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getUserInstance(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
TeslaMaxComputeClient::GetProjectInstanceOutcome TeslaMaxComputeClient::getProjectInstance(const GetProjectInstanceRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetProjectInstanceOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetProjectInstanceOutcome(GetProjectInstanceResult(outcome.result()));
|
||||
else
|
||||
return GetProjectInstanceOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void TeslaMaxComputeClient::getProjectInstanceAsync(const GetProjectInstanceRequest& request, const GetProjectInstanceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getProjectInstance(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
TeslaMaxComputeClient::GetProjectInstanceOutcomeCallable TeslaMaxComputeClient::getProjectInstanceCallable(const GetProjectInstanceRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetProjectInstanceOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getProjectInstance(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
TeslaMaxComputeClient::QueryResourceInventoryOutcome TeslaMaxComputeClient::queryResourceInventory(const QueryResourceInventoryRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return QueryResourceInventoryOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return QueryResourceInventoryOutcome(QueryResourceInventoryResult(outcome.result()));
|
||||
else
|
||||
return QueryResourceInventoryOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void TeslaMaxComputeClient::queryResourceInventoryAsync(const QueryResourceInventoryRequest& request, const QueryResourceInventoryAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, queryResourceInventory(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
TeslaMaxComputeClient::QueryResourceInventoryOutcomeCallable TeslaMaxComputeClient::queryResourceInventoryCallable(const QueryResourceInventoryRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<QueryResourceInventoryOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->queryResourceInventory(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
TeslaMaxComputeClient::QueryTopologyOutcome TeslaMaxComputeClient::queryTopology(const QueryTopologyRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return QueryTopologyOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return QueryTopologyOutcome(QueryTopologyResult(outcome.result()));
|
||||
else
|
||||
return QueryTopologyOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void TeslaMaxComputeClient::queryTopologyAsync(const QueryTopologyRequest& request, const QueryTopologyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, queryTopology(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
TeslaMaxComputeClient::QueryTopologyOutcomeCallable TeslaMaxComputeClient::queryTopologyCallable(const QueryTopologyRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<QueryTopologyOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->queryTopology(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
TeslaMaxComputeClient::GetInstancesStatusCountOutcome TeslaMaxComputeClient::getInstancesStatusCount(const GetInstancesStatusCountRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetInstancesStatusCountOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetInstancesStatusCountOutcome(GetInstancesStatusCountResult(outcome.result()));
|
||||
else
|
||||
return GetInstancesStatusCountOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void TeslaMaxComputeClient::getInstancesStatusCountAsync(const GetInstancesStatusCountRequest& request, const GetInstancesStatusCountAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getInstancesStatusCount(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
TeslaMaxComputeClient::GetInstancesStatusCountOutcomeCallable TeslaMaxComputeClient::getInstancesStatusCountCallable(const GetInstancesStatusCountRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetInstancesStatusCountOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getInstancesStatusCount(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
TeslaMaxComputeClient::GetQuotaInstanceOutcome TeslaMaxComputeClient::getQuotaInstance(const GetQuotaInstanceRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetQuotaInstanceOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetQuotaInstanceOutcome(GetQuotaInstanceResult(outcome.result()));
|
||||
else
|
||||
return GetQuotaInstanceOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void TeslaMaxComputeClient::getQuotaInstanceAsync(const GetQuotaInstanceRequest& request, const GetQuotaInstanceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getQuotaInstance(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
TeslaMaxComputeClient::GetQuotaInstanceOutcomeCallable TeslaMaxComputeClient::getQuotaInstanceCallable(const GetQuotaInstanceRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetQuotaInstanceOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getQuotaInstance(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
TeslaMaxComputeClient::GetClusterInstanceOutcome TeslaMaxComputeClient::getClusterInstance(const GetClusterInstanceRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetClusterInstanceOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetClusterInstanceOutcome(GetClusterInstanceResult(outcome.result()));
|
||||
else
|
||||
return GetClusterInstanceOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void TeslaMaxComputeClient::getClusterInstanceAsync(const GetClusterInstanceRequest& request, const GetClusterInstanceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getClusterInstance(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
TeslaMaxComputeClient::GetClusterInstanceOutcomeCallable TeslaMaxComputeClient::getClusterInstanceCallable(const GetClusterInstanceRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetClusterInstanceOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getClusterInstance(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
TeslaMaxComputeClient::GetQuotaHistoryInfoOutcome TeslaMaxComputeClient::getQuotaHistoryInfo(const GetQuotaHistoryInfoRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetQuotaHistoryInfoOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetQuotaHistoryInfoOutcome(GetQuotaHistoryInfoResult(outcome.result()));
|
||||
else
|
||||
return GetQuotaHistoryInfoOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void TeslaMaxComputeClient::getQuotaHistoryInfoAsync(const GetQuotaHistoryInfoRequest& request, const GetQuotaHistoryInfoAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getQuotaHistoryInfo(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
TeslaMaxComputeClient::GetQuotaHistoryInfoOutcomeCallable TeslaMaxComputeClient::getQuotaHistoryInfoCallable(const GetQuotaHistoryInfoRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetQuotaHistoryInfoOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getQuotaHistoryInfo(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
82
teslamaxcompute/src/model/GetClusterInstanceRequest.cc
Normal file
82
teslamaxcompute/src/model/GetClusterInstanceRequest.cc
Normal 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/teslamaxcompute/model/GetClusterInstanceRequest.h>
|
||||
|
||||
using AlibabaCloud::TeslaMaxCompute::Model::GetClusterInstanceRequest;
|
||||
|
||||
GetClusterInstanceRequest::GetClusterInstanceRequest() :
|
||||
RpcServiceRequest("teslamaxcompute", "2018-01-04", "GetClusterInstance")
|
||||
{}
|
||||
|
||||
GetClusterInstanceRequest::~GetClusterInstanceRequest()
|
||||
{}
|
||||
|
||||
std::string GetClusterInstanceRequest::getCluster()const
|
||||
{
|
||||
return cluster_;
|
||||
}
|
||||
|
||||
void GetClusterInstanceRequest::setCluster(const std::string& cluster)
|
||||
{
|
||||
cluster_ = cluster;
|
||||
setParameter("Cluster", cluster);
|
||||
}
|
||||
|
||||
int GetClusterInstanceRequest::getPageSize()const
|
||||
{
|
||||
return pageSize_;
|
||||
}
|
||||
|
||||
void GetClusterInstanceRequest::setPageSize(int pageSize)
|
||||
{
|
||||
pageSize_ = pageSize;
|
||||
setParameter("PageSize", std::to_string(pageSize));
|
||||
}
|
||||
|
||||
int GetClusterInstanceRequest::getPageNum()const
|
||||
{
|
||||
return pageNum_;
|
||||
}
|
||||
|
||||
void GetClusterInstanceRequest::setPageNum(int pageNum)
|
||||
{
|
||||
pageNum_ = pageNum;
|
||||
setParameter("PageNum", std::to_string(pageNum));
|
||||
}
|
||||
|
||||
std::string GetClusterInstanceRequest::getRegion()const
|
||||
{
|
||||
return region_;
|
||||
}
|
||||
|
||||
void GetClusterInstanceRequest::setRegion(const std::string& region)
|
||||
{
|
||||
region_ = region;
|
||||
setParameter("Region", region);
|
||||
}
|
||||
|
||||
std::string GetClusterInstanceRequest::getStatus()const
|
||||
{
|
||||
return status_;
|
||||
}
|
||||
|
||||
void GetClusterInstanceRequest::setStatus(const std::string& status)
|
||||
{
|
||||
status_ = status;
|
||||
setParameter("Status", status);
|
||||
}
|
||||
|
||||
120
teslamaxcompute/src/model/GetClusterInstanceResult.cc
Normal file
120
teslamaxcompute/src/model/GetClusterInstanceResult.cc
Normal file
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
* 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/teslamaxcompute/model/GetClusterInstanceResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::TeslaMaxCompute;
|
||||
using namespace AlibabaCloud::TeslaMaxCompute::Model;
|
||||
|
||||
GetClusterInstanceResult::GetClusterInstanceResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetClusterInstanceResult::GetClusterInstanceResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetClusterInstanceResult::~GetClusterInstanceResult()
|
||||
{}
|
||||
|
||||
void GetClusterInstanceResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allData = value["Data"];
|
||||
for (auto value : allData)
|
||||
{
|
||||
Data dataObject;
|
||||
if(!value["Total"].isNull())
|
||||
dataObject.total = std::stoi(value["Total"].asString());
|
||||
auto allDetail = value["Detail"]["instance"];
|
||||
for (auto value : allDetail)
|
||||
{
|
||||
Data::Instance instanceObject;
|
||||
if(!value["Project"].isNull())
|
||||
instanceObject.project = value["Project"].asString();
|
||||
if(!value["InstanceId"].isNull())
|
||||
instanceObject.instanceId = value["InstanceId"].asString();
|
||||
if(!value["Status"].isNull())
|
||||
instanceObject.status = value["Status"].asString();
|
||||
if(!value["UserAccount"].isNull())
|
||||
instanceObject.userAccount = value["UserAccount"].asString();
|
||||
if(!value["NickName"].isNull())
|
||||
instanceObject.nickName = value["NickName"].asString();
|
||||
if(!value["Cluster"].isNull())
|
||||
instanceObject.cluster = value["Cluster"].asString();
|
||||
if(!value["RunTime"].isNull())
|
||||
instanceObject.runTime = value["RunTime"].asString();
|
||||
if(!value["CpuUsed"].isNull())
|
||||
instanceObject.cpuUsed = std::stol(value["CpuUsed"].asString());
|
||||
if(!value["CpuRequest"].isNull())
|
||||
instanceObject.cpuRequest = std::stol(value["CpuRequest"].asString());
|
||||
if(!value["CpuUsedTotal"].isNull())
|
||||
instanceObject.cpuUsedTotal = std::stol(value["CpuUsedTotal"].asString());
|
||||
if(!value["CpuUsedRatioMax"].isNull())
|
||||
instanceObject.cpuUsedRatioMax = std::stof(value["CpuUsedRatioMax"].asString());
|
||||
if(!value["CpuUsedRatioMin"].isNull())
|
||||
instanceObject.cpuUsedRatioMin = std::stof(value["CpuUsedRatioMin"].asString());
|
||||
if(!value["MemUsed"].isNull())
|
||||
instanceObject.memUsed = std::stol(value["MemUsed"].asString());
|
||||
if(!value["MemRequest"].isNull())
|
||||
instanceObject.memRequest = std::stol(value["MemRequest"].asString());
|
||||
if(!value["MemUsedTotal"].isNull())
|
||||
instanceObject.memUsedTotal = std::stol(value["MemUsedTotal"].asString());
|
||||
if(!value["MemUsedRatioMax"].isNull())
|
||||
instanceObject.memUsedRatioMax = std::stof(value["MemUsedRatioMax"].asString());
|
||||
if(!value["MemUsedRatioMin"].isNull())
|
||||
instanceObject.memUsedRatioMin = std::stof(value["MemUsedRatioMin"].asString());
|
||||
if(!value["TaskType"].isNull())
|
||||
instanceObject.taskType = value["TaskType"].asString();
|
||||
if(!value["SkynetId"].isNull())
|
||||
instanceObject.skynetId = value["SkynetId"].asString();
|
||||
if(!value["QuotaName"].isNull())
|
||||
instanceObject.quotaName = value["QuotaName"].asString();
|
||||
if(!value["QuotaId"].isNull())
|
||||
instanceObject.quotaId = std::stoi(value["QuotaId"].asString());
|
||||
dataObject.detail.push_back(instanceObject);
|
||||
}
|
||||
data_.push_back(dataObject);
|
||||
}
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stoi(value["Code"].asString());
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string GetClusterInstanceResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::vector<GetClusterInstanceResult::Data> GetClusterInstanceResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
int GetClusterInstanceResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
49
teslamaxcompute/src/model/GetInstancesStatusCountRequest.cc
Normal file
49
teslamaxcompute/src/model/GetInstancesStatusCountRequest.cc
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* 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/teslamaxcompute/model/GetInstancesStatusCountRequest.h>
|
||||
|
||||
using AlibabaCloud::TeslaMaxCompute::Model::GetInstancesStatusCountRequest;
|
||||
|
||||
GetInstancesStatusCountRequest::GetInstancesStatusCountRequest() :
|
||||
RpcServiceRequest("teslamaxcompute", "2018-01-04", "GetInstancesStatusCount")
|
||||
{}
|
||||
|
||||
GetInstancesStatusCountRequest::~GetInstancesStatusCountRequest()
|
||||
{}
|
||||
|
||||
std::string GetInstancesStatusCountRequest::getCluster()const
|
||||
{
|
||||
return cluster_;
|
||||
}
|
||||
|
||||
void GetInstancesStatusCountRequest::setCluster(const std::string& cluster)
|
||||
{
|
||||
cluster_ = cluster;
|
||||
setParameter("Cluster", cluster);
|
||||
}
|
||||
|
||||
std::string GetInstancesStatusCountRequest::getRegion()const
|
||||
{
|
||||
return region_;
|
||||
}
|
||||
|
||||
void GetInstancesStatusCountRequest::setRegion(const std::string& region)
|
||||
{
|
||||
region_ = region;
|
||||
setParameter("Region", region);
|
||||
}
|
||||
|
||||
74
teslamaxcompute/src/model/GetInstancesStatusCountResult.cc
Normal file
74
teslamaxcompute/src/model/GetInstancesStatusCountResult.cc
Normal 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/teslamaxcompute/model/GetInstancesStatusCountResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::TeslaMaxCompute;
|
||||
using namespace AlibabaCloud::TeslaMaxCompute::Model;
|
||||
|
||||
GetInstancesStatusCountResult::GetInstancesStatusCountResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetInstancesStatusCountResult::GetInstancesStatusCountResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetInstancesStatusCountResult::~GetInstancesStatusCountResult()
|
||||
{}
|
||||
|
||||
void GetInstancesStatusCountResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allData = value["Data"]["DataItem"];
|
||||
for (auto value : allData)
|
||||
{
|
||||
DataItem dataObject;
|
||||
if(!value["Status"].isNull())
|
||||
dataObject.status = value["Status"].asString();
|
||||
if(!value["Size"].isNull())
|
||||
dataObject.size = std::stoi(value["Size"].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 GetInstancesStatusCountResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::vector<GetInstancesStatusCountResult::DataItem> GetInstancesStatusCountResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
int GetInstancesStatusCountResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
82
teslamaxcompute/src/model/GetProjectInstanceRequest.cc
Normal file
82
teslamaxcompute/src/model/GetProjectInstanceRequest.cc
Normal 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/teslamaxcompute/model/GetProjectInstanceRequest.h>
|
||||
|
||||
using AlibabaCloud::TeslaMaxCompute::Model::GetProjectInstanceRequest;
|
||||
|
||||
GetProjectInstanceRequest::GetProjectInstanceRequest() :
|
||||
RpcServiceRequest("teslamaxcompute", "2018-01-04", "GetProjectInstance")
|
||||
{}
|
||||
|
||||
GetProjectInstanceRequest::~GetProjectInstanceRequest()
|
||||
{}
|
||||
|
||||
int GetProjectInstanceRequest::getPageSize()const
|
||||
{
|
||||
return pageSize_;
|
||||
}
|
||||
|
||||
void GetProjectInstanceRequest::setPageSize(int pageSize)
|
||||
{
|
||||
pageSize_ = pageSize;
|
||||
setParameter("PageSize", std::to_string(pageSize));
|
||||
}
|
||||
|
||||
std::string GetProjectInstanceRequest::getProject()const
|
||||
{
|
||||
return project_;
|
||||
}
|
||||
|
||||
void GetProjectInstanceRequest::setProject(const std::string& project)
|
||||
{
|
||||
project_ = project;
|
||||
setParameter("Project", project);
|
||||
}
|
||||
|
||||
int GetProjectInstanceRequest::getPageNum()const
|
||||
{
|
||||
return pageNum_;
|
||||
}
|
||||
|
||||
void GetProjectInstanceRequest::setPageNum(int pageNum)
|
||||
{
|
||||
pageNum_ = pageNum;
|
||||
setParameter("PageNum", std::to_string(pageNum));
|
||||
}
|
||||
|
||||
std::string GetProjectInstanceRequest::getRegion()const
|
||||
{
|
||||
return region_;
|
||||
}
|
||||
|
||||
void GetProjectInstanceRequest::setRegion(const std::string& region)
|
||||
{
|
||||
region_ = region;
|
||||
setParameter("Region", region);
|
||||
}
|
||||
|
||||
std::string GetProjectInstanceRequest::getStatus()const
|
||||
{
|
||||
return status_;
|
||||
}
|
||||
|
||||
void GetProjectInstanceRequest::setStatus(const std::string& status)
|
||||
{
|
||||
status_ = status;
|
||||
setParameter("Status", status);
|
||||
}
|
||||
|
||||
120
teslamaxcompute/src/model/GetProjectInstanceResult.cc
Normal file
120
teslamaxcompute/src/model/GetProjectInstanceResult.cc
Normal file
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
* 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/teslamaxcompute/model/GetProjectInstanceResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::TeslaMaxCompute;
|
||||
using namespace AlibabaCloud::TeslaMaxCompute::Model;
|
||||
|
||||
GetProjectInstanceResult::GetProjectInstanceResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetProjectInstanceResult::GetProjectInstanceResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetProjectInstanceResult::~GetProjectInstanceResult()
|
||||
{}
|
||||
|
||||
void GetProjectInstanceResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allData = value["Data"];
|
||||
for (auto value : allData)
|
||||
{
|
||||
Data dataObject;
|
||||
if(!value["Total"].isNull())
|
||||
dataObject.total = std::stoi(value["Total"].asString());
|
||||
auto allDetail = value["Detail"]["instance"];
|
||||
for (auto value : allDetail)
|
||||
{
|
||||
Data::Instance instanceObject;
|
||||
if(!value["Project"].isNull())
|
||||
instanceObject.project = value["Project"].asString();
|
||||
if(!value["InstanceId"].isNull())
|
||||
instanceObject.instanceId = value["InstanceId"].asString();
|
||||
if(!value["Status"].isNull())
|
||||
instanceObject.status = value["Status"].asString();
|
||||
if(!value["UserAccount"].isNull())
|
||||
instanceObject.userAccount = value["UserAccount"].asString();
|
||||
if(!value["NickName"].isNull())
|
||||
instanceObject.nickName = value["NickName"].asString();
|
||||
if(!value["Cluster"].isNull())
|
||||
instanceObject.cluster = value["Cluster"].asString();
|
||||
if(!value["RunTime"].isNull())
|
||||
instanceObject.runTime = value["RunTime"].asString();
|
||||
if(!value["CpuUsed"].isNull())
|
||||
instanceObject.cpuUsed = std::stol(value["CpuUsed"].asString());
|
||||
if(!value["CpuRequest"].isNull())
|
||||
instanceObject.cpuRequest = std::stol(value["CpuRequest"].asString());
|
||||
if(!value["CpuUsedTotal"].isNull())
|
||||
instanceObject.cpuUsedTotal = std::stol(value["CpuUsedTotal"].asString());
|
||||
if(!value["CpuUsedRatioMax"].isNull())
|
||||
instanceObject.cpuUsedRatioMax = std::stof(value["CpuUsedRatioMax"].asString());
|
||||
if(!value["CpuUsedRatioMin"].isNull())
|
||||
instanceObject.cpuUsedRatioMin = std::stof(value["CpuUsedRatioMin"].asString());
|
||||
if(!value["MemUsed"].isNull())
|
||||
instanceObject.memUsed = std::stol(value["MemUsed"].asString());
|
||||
if(!value["MemRequest"].isNull())
|
||||
instanceObject.memRequest = std::stol(value["MemRequest"].asString());
|
||||
if(!value["MemUsedTotal"].isNull())
|
||||
instanceObject.memUsedTotal = std::stol(value["MemUsedTotal"].asString());
|
||||
if(!value["MemUsedRatioMax"].isNull())
|
||||
instanceObject.memUsedRatioMax = std::stof(value["MemUsedRatioMax"].asString());
|
||||
if(!value["MemUsedRatioMin"].isNull())
|
||||
instanceObject.memUsedRatioMin = std::stof(value["MemUsedRatioMin"].asString());
|
||||
if(!value["TaskType"].isNull())
|
||||
instanceObject.taskType = value["TaskType"].asString();
|
||||
if(!value["SkynetId"].isNull())
|
||||
instanceObject.skynetId = value["SkynetId"].asString();
|
||||
if(!value["QuotaName"].isNull())
|
||||
instanceObject.quotaName = value["QuotaName"].asString();
|
||||
if(!value["QuotaId"].isNull())
|
||||
instanceObject.quotaId = std::stoi(value["QuotaId"].asString());
|
||||
dataObject.detail.push_back(instanceObject);
|
||||
}
|
||||
data_.push_back(dataObject);
|
||||
}
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stoi(value["Code"].asString());
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string GetProjectInstanceResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::vector<GetProjectInstanceResult::Data> GetProjectInstanceResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
int GetProjectInstanceResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
82
teslamaxcompute/src/model/GetQuotaHistoryInfoRequest.cc
Normal file
82
teslamaxcompute/src/model/GetQuotaHistoryInfoRequest.cc
Normal 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/teslamaxcompute/model/GetQuotaHistoryInfoRequest.h>
|
||||
|
||||
using AlibabaCloud::TeslaMaxCompute::Model::GetQuotaHistoryInfoRequest;
|
||||
|
||||
GetQuotaHistoryInfoRequest::GetQuotaHistoryInfoRequest() :
|
||||
RpcServiceRequest("teslamaxcompute", "2018-01-04", "GetQuotaHistoryInfo")
|
||||
{}
|
||||
|
||||
GetQuotaHistoryInfoRequest::~GetQuotaHistoryInfoRequest()
|
||||
{}
|
||||
|
||||
std::string GetQuotaHistoryInfoRequest::getCluster()const
|
||||
{
|
||||
return cluster_;
|
||||
}
|
||||
|
||||
void GetQuotaHistoryInfoRequest::setCluster(const std::string& cluster)
|
||||
{
|
||||
cluster_ = cluster;
|
||||
setParameter("Cluster", cluster);
|
||||
}
|
||||
|
||||
int GetQuotaHistoryInfoRequest::getEndTime()const
|
||||
{
|
||||
return endTime_;
|
||||
}
|
||||
|
||||
void GetQuotaHistoryInfoRequest::setEndTime(int endTime)
|
||||
{
|
||||
endTime_ = endTime;
|
||||
setParameter("EndTime", std::to_string(endTime));
|
||||
}
|
||||
|
||||
int GetQuotaHistoryInfoRequest::getStartTime()const
|
||||
{
|
||||
return startTime_;
|
||||
}
|
||||
|
||||
void GetQuotaHistoryInfoRequest::setStartTime(int startTime)
|
||||
{
|
||||
startTime_ = startTime;
|
||||
setParameter("StartTime", std::to_string(startTime));
|
||||
}
|
||||
|
||||
std::string GetQuotaHistoryInfoRequest::getRegion()const
|
||||
{
|
||||
return region_;
|
||||
}
|
||||
|
||||
void GetQuotaHistoryInfoRequest::setRegion(const std::string& region)
|
||||
{
|
||||
region_ = region;
|
||||
setParameter("Region", region);
|
||||
}
|
||||
|
||||
std::string GetQuotaHistoryInfoRequest::getQuotaName()const
|
||||
{
|
||||
return quotaName_;
|
||||
}
|
||||
|
||||
void GetQuotaHistoryInfoRequest::setQuotaName(const std::string& quotaName)
|
||||
{
|
||||
quotaName_ = quotaName;
|
||||
setParameter("QuotaName", quotaName);
|
||||
}
|
||||
|
||||
126
teslamaxcompute/src/model/GetQuotaHistoryInfoResult.cc
Normal file
126
teslamaxcompute/src/model/GetQuotaHistoryInfoResult.cc
Normal file
@@ -0,0 +1,126 @@
|
||||
/*
|
||||
* 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/teslamaxcompute/model/GetQuotaHistoryInfoResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::TeslaMaxCompute;
|
||||
using namespace AlibabaCloud::TeslaMaxCompute::Model;
|
||||
|
||||
GetQuotaHistoryInfoResult::GetQuotaHistoryInfoResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetQuotaHistoryInfoResult::GetQuotaHistoryInfoResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetQuotaHistoryInfoResult::~GetQuotaHistoryInfoResult()
|
||||
{}
|
||||
|
||||
void GetQuotaHistoryInfoResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allData = value["Data"]["DataItem"];
|
||||
for (auto value : allData)
|
||||
{
|
||||
DataItem dataObject;
|
||||
if(!value["Times"].isNull())
|
||||
dataObject.times = std::stoi(value["Times"].asString());
|
||||
auto allPoint = value["Point"];
|
||||
for (auto value : allPoint)
|
||||
{
|
||||
DataItem::Point pointObject;
|
||||
auto allCpuMaxQuota = value["CpuMaxQuota"];
|
||||
for (auto value : allCpuMaxQuota)
|
||||
{
|
||||
DataItem::Point::CpuMaxQuota cpuMaxQuotaObject;
|
||||
if(!value["Min"].isNull())
|
||||
cpuMaxQuotaObject.min = std::stoi(value["Min"].asString());
|
||||
if(!value["Max"].isNull())
|
||||
cpuMaxQuotaObject.max = std::stoi(value["Max"].asString());
|
||||
if(!value["Avg"].isNull())
|
||||
cpuMaxQuotaObject.avg = std::stoi(value["Avg"].asString());
|
||||
pointObject.cpuMaxQuota.push_back(cpuMaxQuotaObject);
|
||||
}
|
||||
auto allCpuMinQuota = value["CpuMinQuota"];
|
||||
for (auto value : allCpuMinQuota)
|
||||
{
|
||||
DataItem::Point::CpuMinQuota cpuMinQuotaObject;
|
||||
if(!value["Min"].isNull())
|
||||
cpuMinQuotaObject.min = std::stoi(value["Min"].asString());
|
||||
if(!value["Max"].isNull())
|
||||
cpuMinQuotaObject.max = std::stoi(value["Max"].asString());
|
||||
if(!value["Avg"].isNull())
|
||||
cpuMinQuotaObject.avg = std::stoi(value["Avg"].asString());
|
||||
pointObject.cpuMinQuota.push_back(cpuMinQuotaObject);
|
||||
}
|
||||
auto allMemUsed = value["MemUsed"];
|
||||
for (auto value : allMemUsed)
|
||||
{
|
||||
DataItem::Point::MemUsed memUsedObject;
|
||||
if(!value["Min"].isNull())
|
||||
memUsedObject.min = std::stoi(value["Min"].asString());
|
||||
if(!value["Max"].isNull())
|
||||
memUsedObject.max = std::stoi(value["Max"].asString());
|
||||
if(!value["Avg"].isNull())
|
||||
memUsedObject.avg = std::stoi(value["Avg"].asString());
|
||||
pointObject.memUsed.push_back(memUsedObject);
|
||||
}
|
||||
auto allCpuUsed = value["CpuUsed"];
|
||||
for (auto value : allCpuUsed)
|
||||
{
|
||||
DataItem::Point::CpuUsed cpuUsedObject;
|
||||
if(!value["Min"].isNull())
|
||||
cpuUsedObject.min = std::stoi(value["Min"].asString());
|
||||
if(!value["Max"].isNull())
|
||||
cpuUsedObject.max = std::stoi(value["Max"].asString());
|
||||
if(!value["Avg"].isNull())
|
||||
cpuUsedObject.avg = std::stoi(value["Avg"].asString());
|
||||
pointObject.cpuUsed.push_back(cpuUsedObject);
|
||||
}
|
||||
dataObject.point.push_back(pointObject);
|
||||
}
|
||||
data_.push_back(dataObject);
|
||||
}
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stoi(value["Code"].asString());
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string GetQuotaHistoryInfoResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::vector<GetQuotaHistoryInfoResult::DataItem> GetQuotaHistoryInfoResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
int GetQuotaHistoryInfoResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
82
teslamaxcompute/src/model/GetQuotaInstanceRequest.cc
Normal file
82
teslamaxcompute/src/model/GetQuotaInstanceRequest.cc
Normal 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/teslamaxcompute/model/GetQuotaInstanceRequest.h>
|
||||
|
||||
using AlibabaCloud::TeslaMaxCompute::Model::GetQuotaInstanceRequest;
|
||||
|
||||
GetQuotaInstanceRequest::GetQuotaInstanceRequest() :
|
||||
RpcServiceRequest("teslamaxcompute", "2018-01-04", "GetQuotaInstance")
|
||||
{}
|
||||
|
||||
GetQuotaInstanceRequest::~GetQuotaInstanceRequest()
|
||||
{}
|
||||
|
||||
std::string GetQuotaInstanceRequest::getCluster()const
|
||||
{
|
||||
return cluster_;
|
||||
}
|
||||
|
||||
void GetQuotaInstanceRequest::setCluster(const std::string& cluster)
|
||||
{
|
||||
cluster_ = cluster;
|
||||
setParameter("Cluster", cluster);
|
||||
}
|
||||
|
||||
int GetQuotaInstanceRequest::getPageSize()const
|
||||
{
|
||||
return pageSize_;
|
||||
}
|
||||
|
||||
void GetQuotaInstanceRequest::setPageSize(int pageSize)
|
||||
{
|
||||
pageSize_ = pageSize;
|
||||
setParameter("PageSize", std::to_string(pageSize));
|
||||
}
|
||||
|
||||
std::string GetQuotaInstanceRequest::getQuotaId()const
|
||||
{
|
||||
return quotaId_;
|
||||
}
|
||||
|
||||
void GetQuotaInstanceRequest::setQuotaId(const std::string& quotaId)
|
||||
{
|
||||
quotaId_ = quotaId;
|
||||
setParameter("QuotaId", quotaId);
|
||||
}
|
||||
|
||||
int GetQuotaInstanceRequest::getPageNum()const
|
||||
{
|
||||
return pageNum_;
|
||||
}
|
||||
|
||||
void GetQuotaInstanceRequest::setPageNum(int pageNum)
|
||||
{
|
||||
pageNum_ = pageNum;
|
||||
setParameter("PageNum", std::to_string(pageNum));
|
||||
}
|
||||
|
||||
std::string GetQuotaInstanceRequest::getStatus()const
|
||||
{
|
||||
return status_;
|
||||
}
|
||||
|
||||
void GetQuotaInstanceRequest::setStatus(const std::string& status)
|
||||
{
|
||||
status_ = status;
|
||||
setParameter("Status", status);
|
||||
}
|
||||
|
||||
120
teslamaxcompute/src/model/GetQuotaInstanceResult.cc
Normal file
120
teslamaxcompute/src/model/GetQuotaInstanceResult.cc
Normal file
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
* 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/teslamaxcompute/model/GetQuotaInstanceResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::TeslaMaxCompute;
|
||||
using namespace AlibabaCloud::TeslaMaxCompute::Model;
|
||||
|
||||
GetQuotaInstanceResult::GetQuotaInstanceResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetQuotaInstanceResult::GetQuotaInstanceResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetQuotaInstanceResult::~GetQuotaInstanceResult()
|
||||
{}
|
||||
|
||||
void GetQuotaInstanceResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allData = value["Data"];
|
||||
for (auto value : allData)
|
||||
{
|
||||
Data dataObject;
|
||||
if(!value["Total"].isNull())
|
||||
dataObject.total = std::stoi(value["Total"].asString());
|
||||
auto allDetail = value["Detail"]["instance"];
|
||||
for (auto value : allDetail)
|
||||
{
|
||||
Data::Instance instanceObject;
|
||||
if(!value["Project"].isNull())
|
||||
instanceObject.project = value["Project"].asString();
|
||||
if(!value["InstanceId"].isNull())
|
||||
instanceObject.instanceId = value["InstanceId"].asString();
|
||||
if(!value["Status"].isNull())
|
||||
instanceObject.status = value["Status"].asString();
|
||||
if(!value["UserAccount"].isNull())
|
||||
instanceObject.userAccount = value["UserAccount"].asString();
|
||||
if(!value["NickName"].isNull())
|
||||
instanceObject.nickName = value["NickName"].asString();
|
||||
if(!value["Cluster"].isNull())
|
||||
instanceObject.cluster = value["Cluster"].asString();
|
||||
if(!value["RunTime"].isNull())
|
||||
instanceObject.runTime = value["RunTime"].asString();
|
||||
if(!value["CpuUsed"].isNull())
|
||||
instanceObject.cpuUsed = std::stol(value["CpuUsed"].asString());
|
||||
if(!value["CpuRequest"].isNull())
|
||||
instanceObject.cpuRequest = std::stol(value["CpuRequest"].asString());
|
||||
if(!value["CpuUsedTotal"].isNull())
|
||||
instanceObject.cpuUsedTotal = std::stol(value["CpuUsedTotal"].asString());
|
||||
if(!value["CpuUsedRatioMax"].isNull())
|
||||
instanceObject.cpuUsedRatioMax = std::stof(value["CpuUsedRatioMax"].asString());
|
||||
if(!value["CpuUsedRatioMin"].isNull())
|
||||
instanceObject.cpuUsedRatioMin = std::stof(value["CpuUsedRatioMin"].asString());
|
||||
if(!value["MemUsed"].isNull())
|
||||
instanceObject.memUsed = std::stol(value["MemUsed"].asString());
|
||||
if(!value["MemRequest"].isNull())
|
||||
instanceObject.memRequest = std::stol(value["MemRequest"].asString());
|
||||
if(!value["MemUsedTotal"].isNull())
|
||||
instanceObject.memUsedTotal = std::stol(value["MemUsedTotal"].asString());
|
||||
if(!value["MemUsedRatioMax"].isNull())
|
||||
instanceObject.memUsedRatioMax = std::stof(value["MemUsedRatioMax"].asString());
|
||||
if(!value["MemUsedRatioMin"].isNull())
|
||||
instanceObject.memUsedRatioMin = std::stof(value["MemUsedRatioMin"].asString());
|
||||
if(!value["TaskType"].isNull())
|
||||
instanceObject.taskType = value["TaskType"].asString();
|
||||
if(!value["SkynetId"].isNull())
|
||||
instanceObject.skynetId = value["SkynetId"].asString();
|
||||
if(!value["QuotaName"].isNull())
|
||||
instanceObject.quotaName = value["QuotaName"].asString();
|
||||
if(!value["QuotaId"].isNull())
|
||||
instanceObject.quotaId = std::stoi(value["QuotaId"].asString());
|
||||
dataObject.detail.push_back(instanceObject);
|
||||
}
|
||||
data_.push_back(dataObject);
|
||||
}
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stoi(value["Code"].asString());
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string GetQuotaInstanceResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::vector<GetQuotaInstanceResult::Data> GetQuotaInstanceResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
int GetQuotaInstanceResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
82
teslamaxcompute/src/model/GetUserInstanceRequest.cc
Normal file
82
teslamaxcompute/src/model/GetUserInstanceRequest.cc
Normal 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/teslamaxcompute/model/GetUserInstanceRequest.h>
|
||||
|
||||
using AlibabaCloud::TeslaMaxCompute::Model::GetUserInstanceRequest;
|
||||
|
||||
GetUserInstanceRequest::GetUserInstanceRequest() :
|
||||
RpcServiceRequest("teslamaxcompute", "2018-01-04", "GetUserInstance")
|
||||
{}
|
||||
|
||||
GetUserInstanceRequest::~GetUserInstanceRequest()
|
||||
{}
|
||||
|
||||
int GetUserInstanceRequest::getPageSize()const
|
||||
{
|
||||
return pageSize_;
|
||||
}
|
||||
|
||||
void GetUserInstanceRequest::setPageSize(int pageSize)
|
||||
{
|
||||
pageSize_ = pageSize;
|
||||
setParameter("PageSize", std::to_string(pageSize));
|
||||
}
|
||||
|
||||
int GetUserInstanceRequest::getPageNum()const
|
||||
{
|
||||
return pageNum_;
|
||||
}
|
||||
|
||||
void GetUserInstanceRequest::setPageNum(int pageNum)
|
||||
{
|
||||
pageNum_ = pageNum;
|
||||
setParameter("PageNum", std::to_string(pageNum));
|
||||
}
|
||||
|
||||
std::string GetUserInstanceRequest::getRegion()const
|
||||
{
|
||||
return region_;
|
||||
}
|
||||
|
||||
void GetUserInstanceRequest::setRegion(const std::string& region)
|
||||
{
|
||||
region_ = region;
|
||||
setParameter("Region", region);
|
||||
}
|
||||
|
||||
std::string GetUserInstanceRequest::getUser()const
|
||||
{
|
||||
return user_;
|
||||
}
|
||||
|
||||
void GetUserInstanceRequest::setUser(const std::string& user)
|
||||
{
|
||||
user_ = user;
|
||||
setParameter("User", user);
|
||||
}
|
||||
|
||||
std::string GetUserInstanceRequest::getStatus()const
|
||||
{
|
||||
return status_;
|
||||
}
|
||||
|
||||
void GetUserInstanceRequest::setStatus(const std::string& status)
|
||||
{
|
||||
status_ = status;
|
||||
setParameter("Status", status);
|
||||
}
|
||||
|
||||
120
teslamaxcompute/src/model/GetUserInstanceResult.cc
Normal file
120
teslamaxcompute/src/model/GetUserInstanceResult.cc
Normal file
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
* 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/teslamaxcompute/model/GetUserInstanceResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::TeslaMaxCompute;
|
||||
using namespace AlibabaCloud::TeslaMaxCompute::Model;
|
||||
|
||||
GetUserInstanceResult::GetUserInstanceResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetUserInstanceResult::GetUserInstanceResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetUserInstanceResult::~GetUserInstanceResult()
|
||||
{}
|
||||
|
||||
void GetUserInstanceResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allData = value["Data"];
|
||||
for (auto value : allData)
|
||||
{
|
||||
Data dataObject;
|
||||
if(!value["Total"].isNull())
|
||||
dataObject.total = std::stoi(value["Total"].asString());
|
||||
auto allDetail = value["Detail"]["instance"];
|
||||
for (auto value : allDetail)
|
||||
{
|
||||
Data::Instance instanceObject;
|
||||
if(!value["Project"].isNull())
|
||||
instanceObject.project = value["Project"].asString();
|
||||
if(!value["InstanceId"].isNull())
|
||||
instanceObject.instanceId = value["InstanceId"].asString();
|
||||
if(!value["Status"].isNull())
|
||||
instanceObject.status = value["Status"].asString();
|
||||
if(!value["UserAccount"].isNull())
|
||||
instanceObject.userAccount = value["UserAccount"].asString();
|
||||
if(!value["NickName"].isNull())
|
||||
instanceObject.nickName = value["NickName"].asString();
|
||||
if(!value["Cluster"].isNull())
|
||||
instanceObject.cluster = value["Cluster"].asString();
|
||||
if(!value["RunTime"].isNull())
|
||||
instanceObject.runTime = value["RunTime"].asString();
|
||||
if(!value["CpuUsed"].isNull())
|
||||
instanceObject.cpuUsed = std::stol(value["CpuUsed"].asString());
|
||||
if(!value["CpuRequest"].isNull())
|
||||
instanceObject.cpuRequest = std::stol(value["CpuRequest"].asString());
|
||||
if(!value["CpuUsedTotal"].isNull())
|
||||
instanceObject.cpuUsedTotal = std::stol(value["CpuUsedTotal"].asString());
|
||||
if(!value["CpuUsedRatioMax"].isNull())
|
||||
instanceObject.cpuUsedRatioMax = std::stof(value["CpuUsedRatioMax"].asString());
|
||||
if(!value["CpuUsedRatioMin"].isNull())
|
||||
instanceObject.cpuUsedRatioMin = std::stof(value["CpuUsedRatioMin"].asString());
|
||||
if(!value["MemUsed"].isNull())
|
||||
instanceObject.memUsed = std::stol(value["MemUsed"].asString());
|
||||
if(!value["MemRequest"].isNull())
|
||||
instanceObject.memRequest = std::stol(value["MemRequest"].asString());
|
||||
if(!value["MemUsedTotal"].isNull())
|
||||
instanceObject.memUsedTotal = std::stol(value["MemUsedTotal"].asString());
|
||||
if(!value["MemUsedRatioMax"].isNull())
|
||||
instanceObject.memUsedRatioMax = std::stof(value["MemUsedRatioMax"].asString());
|
||||
if(!value["MemUsedRatioMin"].isNull())
|
||||
instanceObject.memUsedRatioMin = std::stof(value["MemUsedRatioMin"].asString());
|
||||
if(!value["TaskType"].isNull())
|
||||
instanceObject.taskType = value["TaskType"].asString();
|
||||
if(!value["SkynetId"].isNull())
|
||||
instanceObject.skynetId = value["SkynetId"].asString();
|
||||
if(!value["QuotaName"].isNull())
|
||||
instanceObject.quotaName = value["QuotaName"].asString();
|
||||
if(!value["QuotaId"].isNull())
|
||||
instanceObject.quotaId = std::stoi(value["QuotaId"].asString());
|
||||
dataObject.detail.push_back(instanceObject);
|
||||
}
|
||||
data_.push_back(dataObject);
|
||||
}
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stoi(value["Code"].asString());
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string GetUserInstanceResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::vector<GetUserInstanceResult::Data> GetUserInstanceResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
int GetUserInstanceResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
27
teslamaxcompute/src/model/QueryResourceInventoryRequest.cc
Normal file
27
teslamaxcompute/src/model/QueryResourceInventoryRequest.cc
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* 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/teslamaxcompute/model/QueryResourceInventoryRequest.h>
|
||||
|
||||
using AlibabaCloud::TeslaMaxCompute::Model::QueryResourceInventoryRequest;
|
||||
|
||||
QueryResourceInventoryRequest::QueryResourceInventoryRequest() :
|
||||
RpcServiceRequest("teslamaxcompute", "2018-01-04", "QueryResourceInventory")
|
||||
{}
|
||||
|
||||
QueryResourceInventoryRequest::~QueryResourceInventoryRequest()
|
||||
{}
|
||||
|
||||
110
teslamaxcompute/src/model/QueryResourceInventoryResult.cc
Normal file
110
teslamaxcompute/src/model/QueryResourceInventoryResult.cc
Normal file
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
* 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/teslamaxcompute/model/QueryResourceInventoryResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::TeslaMaxCompute;
|
||||
using namespace AlibabaCloud::TeslaMaxCompute::Model;
|
||||
|
||||
QueryResourceInventoryResult::QueryResourceInventoryResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
QueryResourceInventoryResult::QueryResourceInventoryResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
QueryResourceInventoryResult::~QueryResourceInventoryResult()
|
||||
{}
|
||||
|
||||
void QueryResourceInventoryResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allData = value["Data"];
|
||||
for (auto value : allData)
|
||||
{
|
||||
Data dataObject;
|
||||
if(!value["LastUpdate"].isNull())
|
||||
dataObject.lastUpdate = value["LastUpdate"].asString();
|
||||
auto allClusters = value["Clusters"]["cluster"];
|
||||
for (auto value : allClusters)
|
||||
{
|
||||
Data::Cluster clusterObject;
|
||||
if(!value["Status"].isNull())
|
||||
clusterObject.status = value["Status"].asString();
|
||||
if(!value["Cluster"].isNull())
|
||||
clusterObject.cluster = value["Cluster"].asString();
|
||||
if(!value["MachineRoom"].isNull())
|
||||
clusterObject.machineRoom = value["MachineRoom"].asString();
|
||||
if(!value["Region"].isNull())
|
||||
clusterObject.region = value["Region"].asString();
|
||||
auto allResourceParameters = value["ResourceParameters"]["resourceParameter"];
|
||||
for (auto value : allResourceParameters)
|
||||
{
|
||||
Data::Cluster::ResourceParameter resourceParametersObject;
|
||||
if(!value["ParaName"].isNull())
|
||||
resourceParametersObject.paraName = value["ParaName"].asString();
|
||||
if(!value["ParaValue"].isNull())
|
||||
resourceParametersObject.paraValue = value["ParaValue"].asString();
|
||||
clusterObject.resourceParameters.push_back(resourceParametersObject);
|
||||
}
|
||||
auto allResourceInventories = value["ResourceInventories"]["resourceInventory"];
|
||||
for (auto value : allResourceInventories)
|
||||
{
|
||||
Data::Cluster::ResourceInventory resourceInventoriesObject;
|
||||
if(!value["Total"].isNull())
|
||||
resourceInventoriesObject.total = std::stol(value["Total"].asString());
|
||||
if(!value["Available"].isNull())
|
||||
resourceInventoriesObject.available = std::stol(value["Available"].asString());
|
||||
if(!value["Used"].isNull())
|
||||
resourceInventoriesObject.used = std::stol(value["Used"].asString());
|
||||
if(!value["ResourceType"].isNull())
|
||||
resourceInventoriesObject.resourceType = value["ResourceType"].asString();
|
||||
clusterObject.resourceInventories.push_back(resourceInventoriesObject);
|
||||
}
|
||||
dataObject.clusters.push_back(clusterObject);
|
||||
}
|
||||
data_.push_back(dataObject);
|
||||
}
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stoi(value["Code"].asString());
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string QueryResourceInventoryResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::vector<QueryResourceInventoryResult::Data> QueryResourceInventoryResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
int QueryResourceInventoryResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
27
teslamaxcompute/src/model/QueryTopologyRequest.cc
Normal file
27
teslamaxcompute/src/model/QueryTopologyRequest.cc
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* 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/teslamaxcompute/model/QueryTopologyRequest.h>
|
||||
|
||||
using AlibabaCloud::TeslaMaxCompute::Model::QueryTopologyRequest;
|
||||
|
||||
QueryTopologyRequest::QueryTopologyRequest() :
|
||||
RpcServiceRequest("teslamaxcompute", "2018-01-04", "QueryTopology")
|
||||
{}
|
||||
|
||||
QueryTopologyRequest::~QueryTopologyRequest()
|
||||
{}
|
||||
|
||||
104
teslamaxcompute/src/model/QueryTopologyResult.cc
Normal file
104
teslamaxcompute/src/model/QueryTopologyResult.cc
Normal file
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
* 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/teslamaxcompute/model/QueryTopologyResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::TeslaMaxCompute;
|
||||
using namespace AlibabaCloud::TeslaMaxCompute::Model;
|
||||
|
||||
QueryTopologyResult::QueryTopologyResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
QueryTopologyResult::QueryTopologyResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
QueryTopologyResult::~QueryTopologyResult()
|
||||
{}
|
||||
|
||||
void QueryTopologyResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allResult = value["Result"]["resultItem"];
|
||||
for (auto value : allResult)
|
||||
{
|
||||
ResultItem resultObject;
|
||||
if(!value["LastUpdate"].isNull())
|
||||
resultObject.lastUpdate = value["LastUpdate"].asString();
|
||||
auto allRegions = value["Regions"]["regionItem"];
|
||||
for (auto value : allRegions)
|
||||
{
|
||||
ResultItem::RegionItem regionsObject;
|
||||
if(!value["Region"].isNull())
|
||||
regionsObject.region = value["Region"].asString();
|
||||
if(!value["RegionEnName"].isNull())
|
||||
regionsObject.regionEnName = value["RegionEnName"].asString();
|
||||
if(!value["RegionCnName"].isNull())
|
||||
regionsObject.regionCnName = value["RegionCnName"].asString();
|
||||
auto allClusters = value["Clusters"]["clusterItem"];
|
||||
for (auto value : allClusters)
|
||||
{
|
||||
ResultItem::RegionItem::ClusterItem clustersObject;
|
||||
if(!value["Cluster"].isNull())
|
||||
clustersObject.cluster = value["Cluster"].asString();
|
||||
if(!value["ProductLine"].isNull())
|
||||
clustersObject.productLine = value["ProductLine"].asString();
|
||||
if(!value["ProductClass"].isNull())
|
||||
clustersObject.productClass = value["ProductClass"].asString();
|
||||
if(!value["NetCode"].isNull())
|
||||
clustersObject.netCode = value["NetCode"].asString();
|
||||
if(!value["Business"].isNull())
|
||||
clustersObject.business = value["Business"].asString();
|
||||
if(!value["MachineRoom"].isNull())
|
||||
clustersObject.machineRoom = value["MachineRoom"].asString();
|
||||
if(!value["NetArch"].isNull())
|
||||
clustersObject.netArch = value["NetArch"].asString();
|
||||
regionsObject.clusters.push_back(clustersObject);
|
||||
}
|
||||
resultObject.regions.push_back(regionsObject);
|
||||
}
|
||||
result_.push_back(resultObject);
|
||||
}
|
||||
if(!value["Code"].isNull())
|
||||
code_ = std::stoi(value["Code"].asString());
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string QueryTopologyResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
int QueryTopologyResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
std::vector<QueryTopologyResult::ResultItem> QueryTopologyResult::getResult()const
|
||||
{
|
||||
return result_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user