Browse Source

由荣旸发起的TESLADAM SDK自动发布, BUILD_ID=272, 版本号:1.0.6
发布日志:
1, Tesla Dam API release.
2, Add ActionDiskCheck, ActionDiskMask, ActionDiskRma, HostGets.

haowei.yao 8 years ago
parent
commit
19820726b9

+ 2 - 1
CMakeLists.txt

@@ -56,4 +56,5 @@ add_subdirectory(vpc)
 add_subdirectory(cdn)
 add_subdirectory(rds)
 add_subdirectory(cloudphoto)
-add_subdirectory(ess)
+add_subdirectory(ess)
+add_subdirectory(tesladam)

+ 1 - 1
VERSION

@@ -1 +1 @@
-1.0.5
+1.0.6

+ 94 - 0
tesladam/CMakeLists.txt

@@ -0,0 +1,94 @@
+#
+# Copyright 2009-2017 Alibaba Cloud All rights reserved.
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#      http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+set(public_header_dir ${CMAKE_CURRENT_SOURCE_DIR}/../include)
+set(tesladam_public_header
+	include/alibabacloud/tesladam/model/ActionDiskRmaRequest.h
+	include/alibabacloud/tesladam/model/ActionDiskRmaResult.h
+	include/alibabacloud/tesladam/model/ActionDiskMaskRequest.h
+	include/alibabacloud/tesladam/model/ActionDiskMaskResult.h
+	include/alibabacloud/tesladam/model/ActionDiskCheckRequest.h
+	include/alibabacloud/tesladam/model/ActionDiskCheckResult.h
+	include/alibabacloud/tesladam/model/HostGetsRequest.h
+	include/alibabacloud/tesladam/model/HostGetsResult.h
+	include/alibabacloud/tesladam/TeslaDamClient.h
+	include/alibabacloud/tesladam/TeslaDamExport.h
+	include/alibabacloud/tesladam/TeslaDamRequest.h
+	)
+
+set(tesladam_src
+	src/model/ActionDiskRmaRequest.cc
+	src/model/ActionDiskRmaResult.cc
+	src/model/ActionDiskMaskRequest.cc
+	src/model/ActionDiskMaskResult.cc
+	src/model/ActionDiskCheckRequest.cc
+	src/model/ActionDiskCheckResult.cc
+	src/model/HostGetsRequest.cc
+	src/model/HostGetsResult.cc
+	src/TeslaDamClient.cc
+	src/TeslaDamRequest.cc
+	)
+
+add_library(tesladam ${LIB_TYPE} ${tesladam_public_header} ${tesladam_src})
+
+set_target_properties(tesladam
+	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}tesladam
+	PUBLIC_HEADER "${tesladam_public_header}"
+	)
+
+if(${LIB_TYPE} STREQUAL "SHARED")
+	set_target_properties(tesladam
+		PROPERTIES
+		DEFINE_SYMBOL ALIBABACLOUD_TESLADAM_LIBRARY)
+endif()
+
+target_include_directories(tesladam
+	PRIVATE include
+		${CMAKE_SOURCE_DIR}/core/include
+	)
+target_link_libraries(tesladam
+	core)
+
+if(CMAKE_HOST_WIN32)
+	ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
+	set(jsoncpp_install_dir ${INSTALL_DIR})
+	add_dependencies(tesladam
+		jsoncpp)
+	target_include_directories(tesladam
+		PRIVATE	${jsoncpp_install_dir}/include)
+	target_link_libraries(tesladam
+		${jsoncpp_install_dir}/lib/jsoncpp.lib)
+	set_target_properties(tesladam
+    	PROPERTIES
+    		COMPILE_OPTIONS "/bigobj")
+else()
+	target_include_directories(tesladam
+		PRIVATE /usr/include/jsoncpp)
+	target_link_libraries(tesladam
+		jsoncpp)
+endif()
+
+install(TARGETS tesladam
+	ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+	LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+	RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+	PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/tesladam
+	)

+ 4 - 0
tesladam/ChangeLog.txt

@@ -0,0 +1,4 @@
+2018-01-23 Version: 1.0.6
+1, Tesla Dam API release.
+2, Add ActionDiskCheck, ActionDiskMask, ActionDiskRma, HostGets.
+

+ 81 - 0
tesladam/include/alibabacloud/tesladam/TeslaDamClient.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_TESLADAM_TESLADAMCLIENT_H_
+#define ALIBABACLOUD_TESLADAM_TESLADAMCLIENT_H_
+
+#include <future>
+#include <alibabacloud/core/AsyncCallerContext.h>
+#include <alibabacloud/core/EndpointProvider.h>
+#include <alibabacloud/core/RpcServiceClient.h>
+#include "TeslaDamExport.h"
+#include "model/ActionDiskRmaRequest.h"
+#include "model/ActionDiskRmaResult.h"
+#include "model/ActionDiskMaskRequest.h"
+#include "model/ActionDiskMaskResult.h"
+#include "model/ActionDiskCheckRequest.h"
+#include "model/ActionDiskCheckResult.h"
+#include "model/HostGetsRequest.h"
+#include "model/HostGetsResult.h"
+
+
+namespace AlibabaCloud
+{
+	namespace TeslaDam
+	{
+		class ALIBABACLOUD_TESLADAM_EXPORT TeslaDamClient : public RpcServiceClient
+		{
+		public:
+			typedef Outcome<Error, Model::ActionDiskRmaResult> ActionDiskRmaOutcome;			
+			typedef std::future<ActionDiskRmaOutcome> ActionDiskRmaOutcomeCallable;			
+			typedef std::function<void(const TeslaDamClient*, const Model::ActionDiskRmaRequest&, const ActionDiskRmaOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ActionDiskRmaAsyncHandler;
+			typedef Outcome<Error, Model::ActionDiskMaskResult> ActionDiskMaskOutcome;			
+			typedef std::future<ActionDiskMaskOutcome> ActionDiskMaskOutcomeCallable;			
+			typedef std::function<void(const TeslaDamClient*, const Model::ActionDiskMaskRequest&, const ActionDiskMaskOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ActionDiskMaskAsyncHandler;
+			typedef Outcome<Error, Model::ActionDiskCheckResult> ActionDiskCheckOutcome;			
+			typedef std::future<ActionDiskCheckOutcome> ActionDiskCheckOutcomeCallable;			
+			typedef std::function<void(const TeslaDamClient*, const Model::ActionDiskCheckRequest&, const ActionDiskCheckOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ActionDiskCheckAsyncHandler;
+			typedef Outcome<Error, Model::HostGetsResult> HostGetsOutcome;			
+			typedef std::future<HostGetsOutcome> HostGetsOutcomeCallable;			
+			typedef std::function<void(const TeslaDamClient*, const Model::HostGetsRequest&, const HostGetsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> HostGetsAsyncHandler;
+
+
+			TeslaDamClient(const Credentials &credentials, const ClientConfiguration &configuration);
+			TeslaDamClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
+			TeslaDamClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
+			~TeslaDamClient();
+
+            ActionDiskRmaOutcome actionDiskRma(const Model::ActionDiskRmaRequest &request)const;
+            void actionDiskRmaAsync(const Model::ActionDiskRmaRequest& request, const ActionDiskRmaAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
+            ActionDiskRmaOutcomeCallable actionDiskRmaCallable(const Model::ActionDiskRmaRequest& request) const;
+            ActionDiskMaskOutcome actionDiskMask(const Model::ActionDiskMaskRequest &request)const;
+            void actionDiskMaskAsync(const Model::ActionDiskMaskRequest& request, const ActionDiskMaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
+            ActionDiskMaskOutcomeCallable actionDiskMaskCallable(const Model::ActionDiskMaskRequest& request) const;
+            ActionDiskCheckOutcome actionDiskCheck(const Model::ActionDiskCheckRequest &request)const;
+            void actionDiskCheckAsync(const Model::ActionDiskCheckRequest& request, const ActionDiskCheckAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
+            ActionDiskCheckOutcomeCallable actionDiskCheckCallable(const Model::ActionDiskCheckRequest& request) const;
+            HostGetsOutcome hostGets(const Model::HostGetsRequest &request)const;
+            void hostGetsAsync(const Model::HostGetsRequest& request, const HostGetsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
+            HostGetsOutcomeCallable hostGetsCallable(const Model::HostGetsRequest& request) const;
+	
+		private:
+			virtual EndpointOutcome endpoint()const override;
+			std::shared_ptr<EndpointProvider> endpointProvider_;
+		};
+	}
+}
+
+#endif // !ALIBABACLOUD_TESLADAM_TESLADAMCLIENT_H_

+ 32 - 0
tesladam/include/alibabacloud/tesladam/TeslaDamExport.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_TESLADAM_TESLADAMEXPORT_H_
+#define ALIBABACLOUD_TESLADAM_TESLADAMEXPORT_H_
+
+#include <alibabacloud/core/Global.h>
+
+#if defined(ALIBABACLOUD_SHARED)
+#	if defined(ALIBABACLOUD_TESLADAM_LIBRARY)
+#		define ALIBABACLOUD_TESLADAM_EXPORT ALIBABACLOUD_DECL_EXPORT
+#	else
+#		define ALIBABACLOUD_TESLADAM_EXPORT ALIBABACLOUD_DECL_IMPORT
+#	endif
+#else
+#	define ALIBABACLOUD_TESLADAM_EXPORT
+#endif
+
+#endif // !ALIBABACLOUD_TESLADAM_TESLADAMEXPORT_H_

+ 39 - 0
tesladam/include/alibabacloud/tesladam/TeslaDamRequest.h

@@ -0,0 +1,39 @@
+/*
+ * 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_TESLADAM_TESLADAMREQUEST_H_
+#define ALIBABACLOUD_TESLADAM_TESLADAMREQUEST_H_
+
+#include <alibabacloud/core/RpcServiceRequest.h>
+#include "TeslaDamExport.h"
+
+namespace AlibabaCloud
+{
+	namespace TeslaDam
+	{
+		class ALIBABACLOUD_TESLADAM_EXPORT TeslaDamRequest : public RpcServiceRequest
+		{
+		public:
+			explicit TeslaDamRequest(const std::string & action);
+			virtual ~TeslaDamRequest();
+
+		private:
+
+		};
+	}
+}
+
+#endif // !ALIBABACLOUD_TESLADAM_TESLADAMREQUEST_H_

+ 50 - 0
tesladam/include/alibabacloud/tesladam/model/ActionDiskCheckRequest.h

@@ -0,0 +1,50 @@
+/*
+ * 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_TESLADAM_MODEL_ACTIONDISKCHECKREQUEST_H_
+#define ALIBABACLOUD_TESLADAM_MODEL_ACTIONDISKCHECKREQUEST_H_
+
+#include <string>
+#include <vector>
+#include <alibabacloud/tesladam/TeslaDamRequest.h>
+
+namespace AlibabaCloud
+{
+	namespace TeslaDam
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_TESLADAM_EXPORT ActionDiskCheckRequest : public TeslaDamRequest
+			{
+
+			public:
+				ActionDiskCheckRequest();
+				~ActionDiskCheckRequest();
+
+				std::string getDiskMount()const;
+				void setDiskMount(const std::string& diskMount);
+				std::string getIp()const;
+				void setIp(const std::string& ip);
+
+            private:
+				std::string diskMount_;
+				std::string ip_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_TESLADAM_MODEL_ACTIONDISKCHECKREQUEST_H_

+ 55 - 0
tesladam/include/alibabacloud/tesladam/model/ActionDiskCheckResult.h

@@ -0,0 +1,55 @@
+/*
+ * 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_TESLADAM_MODEL_ACTIONDISKCHECKRESULT_H_
+#define ALIBABACLOUD_TESLADAM_MODEL_ACTIONDISKCHECKRESULT_H_
+
+#include <string>
+#include <vector>
+#include <utility>
+#include <alibabacloud/core/ServiceResult.h>
+#include <alibabacloud/tesladam/TeslaDamExport.h>
+
+namespace AlibabaCloud
+{
+	namespace TeslaDam
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_TESLADAM_EXPORT ActionDiskCheckResult : public ServiceResult
+			{
+			public:
+
+
+				ActionDiskCheckResult();
+				explicit ActionDiskCheckResult(const std::string &payload);
+				~ActionDiskCheckResult();
+				bool getStatus()const;
+				std::string getMessage()const;
+				std::string getResult()const;
+
+			protected:
+				void parse(const std::string &payload);
+			private:
+				bool status_;
+				std::string message_;
+				std::string result_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_TESLADAM_MODEL_ACTIONDISKCHECKRESULT_H_

+ 53 - 0
tesladam/include/alibabacloud/tesladam/model/ActionDiskMaskRequest.h

@@ -0,0 +1,53 @@
+/*
+ * 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_TESLADAM_MODEL_ACTIONDISKMASKREQUEST_H_
+#define ALIBABACLOUD_TESLADAM_MODEL_ACTIONDISKMASKREQUEST_H_
+
+#include <string>
+#include <vector>
+#include <alibabacloud/tesladam/TeslaDamRequest.h>
+
+namespace AlibabaCloud
+{
+	namespace TeslaDam
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_TESLADAM_EXPORT ActionDiskMaskRequest : public TeslaDamRequest
+			{
+
+			public:
+				ActionDiskMaskRequest();
+				~ActionDiskMaskRequest();
+
+				std::string getOp()const;
+				void setOp(const std::string& op);
+				std::string getDiskMount()const;
+				void setDiskMount(const std::string& diskMount);
+				std::string getIp()const;
+				void setIp(const std::string& ip);
+
+            private:
+				std::string op_;
+				std::string diskMount_;
+				std::string ip_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_TESLADAM_MODEL_ACTIONDISKMASKREQUEST_H_

+ 55 - 0
tesladam/include/alibabacloud/tesladam/model/ActionDiskMaskResult.h

@@ -0,0 +1,55 @@
+/*
+ * 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_TESLADAM_MODEL_ACTIONDISKMASKRESULT_H_
+#define ALIBABACLOUD_TESLADAM_MODEL_ACTIONDISKMASKRESULT_H_
+
+#include <string>
+#include <vector>
+#include <utility>
+#include <alibabacloud/core/ServiceResult.h>
+#include <alibabacloud/tesladam/TeslaDamExport.h>
+
+namespace AlibabaCloud
+{
+	namespace TeslaDam
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_TESLADAM_EXPORT ActionDiskMaskResult : public ServiceResult
+			{
+			public:
+
+
+				ActionDiskMaskResult();
+				explicit ActionDiskMaskResult(const std::string &payload);
+				~ActionDiskMaskResult();
+				bool getStatus()const;
+				std::string getMessage()const;
+				std::string getResult()const;
+
+			protected:
+				void parse(const std::string &payload);
+			private:
+				bool status_;
+				std::string message_;
+				std::string result_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_TESLADAM_MODEL_ACTIONDISKMASKRESULT_H_

+ 65 - 0
tesladam/include/alibabacloud/tesladam/model/ActionDiskRmaRequest.h

@@ -0,0 +1,65 @@
+/*
+ * 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_TESLADAM_MODEL_ACTIONDISKRMAREQUEST_H_
+#define ALIBABACLOUD_TESLADAM_MODEL_ACTIONDISKRMAREQUEST_H_
+
+#include <string>
+#include <vector>
+#include <alibabacloud/tesladam/TeslaDamRequest.h>
+
+namespace AlibabaCloud
+{
+	namespace TeslaDam
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_TESLADAM_EXPORT ActionDiskRmaRequest : public TeslaDamRequest
+			{
+
+			public:
+				ActionDiskRmaRequest();
+				~ActionDiskRmaRequest();
+
+				std::string getDiskName()const;
+				void setDiskName(const std::string& diskName);
+				std::string getExecutionId()const;
+				void setExecutionId(const std::string& executionId);
+				std::string getDiskSlot()const;
+				void setDiskSlot(const std::string& diskSlot);
+				std::string getHostname()const;
+				void setHostname(const std::string& hostname);
+				std::string getDiskMount()const;
+				void setDiskMount(const std::string& diskMount);
+				std::string getDiskReason()const;
+				void setDiskReason(const std::string& diskReason);
+				std::string getDiskSn()const;
+				void setDiskSn(const std::string& diskSn);
+
+            private:
+				std::string diskName_;
+				std::string executionId_;
+				std::string diskSlot_;
+				std::string hostname_;
+				std::string diskMount_;
+				std::string diskReason_;
+				std::string diskSn_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_TESLADAM_MODEL_ACTIONDISKRMAREQUEST_H_

+ 55 - 0
tesladam/include/alibabacloud/tesladam/model/ActionDiskRmaResult.h

@@ -0,0 +1,55 @@
+/*
+ * 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_TESLADAM_MODEL_ACTIONDISKRMARESULT_H_
+#define ALIBABACLOUD_TESLADAM_MODEL_ACTIONDISKRMARESULT_H_
+
+#include <string>
+#include <vector>
+#include <utility>
+#include <alibabacloud/core/ServiceResult.h>
+#include <alibabacloud/tesladam/TeslaDamExport.h>
+
+namespace AlibabaCloud
+{
+	namespace TeslaDam
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_TESLADAM_EXPORT ActionDiskRmaResult : public ServiceResult
+			{
+			public:
+
+
+				ActionDiskRmaResult();
+				explicit ActionDiskRmaResult(const std::string &payload);
+				~ActionDiskRmaResult();
+				bool getStatus()const;
+				std::string getMessage()const;
+				std::string getResult()const;
+
+			protected:
+				void parse(const std::string &payload);
+			private:
+				bool status_;
+				std::string message_;
+				std::string result_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_TESLADAM_MODEL_ACTIONDISKRMARESULT_H_

+ 56 - 0
tesladam/include/alibabacloud/tesladam/model/HostGetsRequest.h

@@ -0,0 +1,56 @@
+/*
+ * 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_TESLADAM_MODEL_HOSTGETSREQUEST_H_
+#define ALIBABACLOUD_TESLADAM_MODEL_HOSTGETSREQUEST_H_
+
+#include <string>
+#include <vector>
+#include <alibabacloud/tesladam/TeslaDamRequest.h>
+
+namespace AlibabaCloud
+{
+	namespace TeslaDam
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_TESLADAM_EXPORT HostGetsRequest : public TeslaDamRequest
+			{
+
+			public:
+				HostGetsRequest();
+				~HostGetsRequest();
+
+				std::string getQuery()const;
+				void setQuery(const std::string& query);
+				int getEndTime()const;
+				void setEndTime(int endTime);
+				int getStartTime()const;
+				void setStartTime(int startTime);
+				std::string getQueryType()const;
+				void setQueryType(const std::string& queryType);
+
+            private:
+				std::string query_;
+				int endTime_;
+				int startTime_;
+				std::string queryType_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_TESLADAM_MODEL_HOSTGETSREQUEST_H_

+ 66 - 0
tesladam/include/alibabacloud/tesladam/model/HostGetsResult.h

@@ -0,0 +1,66 @@
+/*
+ * 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_TESLADAM_MODEL_HOSTGETSRESULT_H_
+#define ALIBABACLOUD_TESLADAM_MODEL_HOSTGETSRESULT_H_
+
+#include <string>
+#include <vector>
+#include <utility>
+#include <alibabacloud/core/ServiceResult.h>
+#include <alibabacloud/tesladam/TeslaDamExport.h>
+
+namespace AlibabaCloud
+{
+	namespace TeslaDam
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_TESLADAM_EXPORT HostGetsResult : public ServiceResult
+			{
+			public:
+				struct DataItem
+				{
+					std::string appCode;
+					std::string clusterCode;
+					int healthScoreLast;
+					std::string ip;
+					std::string hostname;
+					std::string healthReasonLast;
+					int sshStatus;
+					int heartStatus;
+				};
+
+
+				HostGetsResult();
+				explicit HostGetsResult(const std::string &payload);
+				~HostGetsResult();
+				bool getStatus()const;
+				std::string getMessage()const;
+				std::vector<DataItem> getData()const;
+
+			protected:
+				void parse(const std::string &payload);
+			private:
+				bool status_;
+				std::string message_;
+				std::vector<DataItem> data_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_TESLADAM_MODEL_HOSTGETSRESULT_H_

+ 205 - 0
tesladam/src/TeslaDamClient.cc

@@ -0,0 +1,205 @@
+/*
+ * 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/tesladam/TeslaDamClient.h>
+#include <alibabacloud/core/SimpleCredentialsProvider.h>
+
+using namespace AlibabaCloud;
+using namespace AlibabaCloud::Location;
+using namespace AlibabaCloud::TeslaDam;
+using namespace AlibabaCloud::TeslaDam::Model;
+
+TeslaDamClient::TeslaDamClient(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(), "");
+}
+
+TeslaDamClient::TeslaDamClient(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(), "");
+}
+
+TeslaDamClient::TeslaDamClient(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(), "");
+}
+
+TeslaDamClient::~TeslaDamClient()
+{}
+
+CoreClient::EndpointOutcome TeslaDamClient::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);
+}
+
+TeslaDamClient::ActionDiskRmaOutcome TeslaDamClient::actionDiskRma(const ActionDiskRmaRequest &request) const
+{
+	auto endpointOutcome = endpoint();
+	if (!endpointOutcome.isSuccess())
+		return ActionDiskRmaOutcome(endpointOutcome.error());
+
+	auto outcome = makeRequest(endpointOutcome.result(), request);
+
+	if (outcome.isSuccess())
+		return ActionDiskRmaOutcome(ActionDiskRmaResult(outcome.result()));
+	else
+		return ActionDiskRmaOutcome(outcome.error());
+}
+
+void TeslaDamClient::actionDiskRmaAsync(const ActionDiskRmaRequest& request, const ActionDiskRmaAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
+{
+	auto fn = [this, request, handler, context]()
+	{
+		handler(this, request, actionDiskRma(request), context);
+	};
+
+	asyncExecute(new Runnable(fn));
+}
+
+TeslaDamClient::ActionDiskRmaOutcomeCallable TeslaDamClient::actionDiskRmaCallable(const ActionDiskRmaRequest &request) const
+{
+	auto task = std::make_shared<std::packaged_task<ActionDiskRmaOutcome()>>(
+			[this, request]()
+			{
+			return this->actionDiskRma(request);
+			});
+
+	asyncExecute(new Runnable([task]() { (*task)(); }));
+	return task->get_future();
+}
+
+TeslaDamClient::ActionDiskMaskOutcome TeslaDamClient::actionDiskMask(const ActionDiskMaskRequest &request) const
+{
+	auto endpointOutcome = endpoint();
+	if (!endpointOutcome.isSuccess())
+		return ActionDiskMaskOutcome(endpointOutcome.error());
+
+	auto outcome = makeRequest(endpointOutcome.result(), request);
+
+	if (outcome.isSuccess())
+		return ActionDiskMaskOutcome(ActionDiskMaskResult(outcome.result()));
+	else
+		return ActionDiskMaskOutcome(outcome.error());
+}
+
+void TeslaDamClient::actionDiskMaskAsync(const ActionDiskMaskRequest& request, const ActionDiskMaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
+{
+	auto fn = [this, request, handler, context]()
+	{
+		handler(this, request, actionDiskMask(request), context);
+	};
+
+	asyncExecute(new Runnable(fn));
+}
+
+TeslaDamClient::ActionDiskMaskOutcomeCallable TeslaDamClient::actionDiskMaskCallable(const ActionDiskMaskRequest &request) const
+{
+	auto task = std::make_shared<std::packaged_task<ActionDiskMaskOutcome()>>(
+			[this, request]()
+			{
+			return this->actionDiskMask(request);
+			});
+
+	asyncExecute(new Runnable([task]() { (*task)(); }));
+	return task->get_future();
+}
+
+TeslaDamClient::ActionDiskCheckOutcome TeslaDamClient::actionDiskCheck(const ActionDiskCheckRequest &request) const
+{
+	auto endpointOutcome = endpoint();
+	if (!endpointOutcome.isSuccess())
+		return ActionDiskCheckOutcome(endpointOutcome.error());
+
+	auto outcome = makeRequest(endpointOutcome.result(), request);
+
+	if (outcome.isSuccess())
+		return ActionDiskCheckOutcome(ActionDiskCheckResult(outcome.result()));
+	else
+		return ActionDiskCheckOutcome(outcome.error());
+}
+
+void TeslaDamClient::actionDiskCheckAsync(const ActionDiskCheckRequest& request, const ActionDiskCheckAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
+{
+	auto fn = [this, request, handler, context]()
+	{
+		handler(this, request, actionDiskCheck(request), context);
+	};
+
+	asyncExecute(new Runnable(fn));
+}
+
+TeslaDamClient::ActionDiskCheckOutcomeCallable TeslaDamClient::actionDiskCheckCallable(const ActionDiskCheckRequest &request) const
+{
+	auto task = std::make_shared<std::packaged_task<ActionDiskCheckOutcome()>>(
+			[this, request]()
+			{
+			return this->actionDiskCheck(request);
+			});
+
+	asyncExecute(new Runnable([task]() { (*task)(); }));
+	return task->get_future();
+}
+
+TeslaDamClient::HostGetsOutcome TeslaDamClient::hostGets(const HostGetsRequest &request) const
+{
+	auto endpointOutcome = endpoint();
+	if (!endpointOutcome.isSuccess())
+		return HostGetsOutcome(endpointOutcome.error());
+
+	auto outcome = makeRequest(endpointOutcome.result(), request);
+
+	if (outcome.isSuccess())
+		return HostGetsOutcome(HostGetsResult(outcome.result()));
+	else
+		return HostGetsOutcome(outcome.error());
+}
+
+void TeslaDamClient::hostGetsAsync(const HostGetsRequest& request, const HostGetsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
+{
+	auto fn = [this, request, handler, context]()
+	{
+		handler(this, request, hostGets(request), context);
+	};
+
+	asyncExecute(new Runnable(fn));
+}
+
+TeslaDamClient::HostGetsOutcomeCallable TeslaDamClient::hostGetsCallable(const HostGetsRequest &request) const
+{
+	auto task = std::make_shared<std::packaged_task<HostGetsOutcome()>>(
+			[this, request]()
+			{
+			return this->hostGets(request);
+			});
+
+	asyncExecute(new Runnable([task]() { (*task)(); }));
+	return task->get_future();
+}
+

+ 27 - 0
tesladam/src/TeslaDamRequest.cc

@@ -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/tesladam/TeslaDamRequest.h>
+
+using namespace AlibabaCloud;
+using namespace AlibabaCloud::TeslaDam;
+
+TeslaDamRequest::TeslaDamRequest(const std::string & action) :
+	RpcServiceRequest("tesladam", "2018-01-18", action)
+{ }
+
+TeslaDamRequest::~TeslaDamRequest()
+{ }

+ 50 - 0
tesladam/src/model/ActionDiskCheckRequest.cc

@@ -0,0 +1,50 @@
+/*
+ * 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/tesladam/model/ActionDiskCheckRequest.h>
+
+using namespace AlibabaCloud::TeslaDam;
+using namespace AlibabaCloud::TeslaDam::Model;
+
+ActionDiskCheckRequest::ActionDiskCheckRequest() :
+	TeslaDamRequest("ActionDiskCheck")
+{}
+
+ActionDiskCheckRequest::~ActionDiskCheckRequest()
+{}
+
+std::string ActionDiskCheckRequest::getDiskMount()const
+{
+	return diskMount_;
+}
+
+void ActionDiskCheckRequest::setDiskMount(const std::string& diskMount)
+{
+	diskMount_ = diskMount;
+	setParameter("DiskMount", diskMount);
+}
+
+std::string ActionDiskCheckRequest::getIp()const
+{
+	return ip_;
+}
+
+void ActionDiskCheckRequest::setIp(const std::string& ip)
+{
+	ip_ = ip;
+	setParameter("Ip", ip);
+}
+

+ 66 - 0
tesladam/src/model/ActionDiskCheckResult.cc

@@ -0,0 +1,66 @@
+/*
+ * 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/tesladam/model/ActionDiskCheckResult.h>
+#include <json/json.h>
+
+using namespace AlibabaCloud::TeslaDam;
+using namespace AlibabaCloud::TeslaDam::Model;
+
+ActionDiskCheckResult::ActionDiskCheckResult() :
+	ServiceResult()
+{}
+
+ActionDiskCheckResult::ActionDiskCheckResult(const std::string &payload) :
+	ServiceResult()
+{
+	parse(payload);
+}
+
+ActionDiskCheckResult::~ActionDiskCheckResult()
+{}
+
+void ActionDiskCheckResult::parse(const std::string &payload)
+{
+	Json::Reader reader;
+	Json::Value value;
+	reader.parse(payload, value);
+
+	setRequestId(value["RequestId"].asString());
+	if(!value["Status"].isNull())
+		status_ = value["Status"].asString() == "true";
+	if(!value["Message"].isNull())
+		message_ = value["Message"].asString();
+	if(!value["Result"].isNull())
+		result_ = value["Result"].asString();
+
+}
+
+bool ActionDiskCheckResult::getStatus()const
+{
+	return status_;
+}
+
+std::string ActionDiskCheckResult::getMessage()const
+{
+	return message_;
+}
+
+std::string ActionDiskCheckResult::getResult()const
+{
+	return result_;
+}
+

+ 61 - 0
tesladam/src/model/ActionDiskMaskRequest.cc

@@ -0,0 +1,61 @@
+/*
+ * 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/tesladam/model/ActionDiskMaskRequest.h>
+
+using namespace AlibabaCloud::TeslaDam;
+using namespace AlibabaCloud::TeslaDam::Model;
+
+ActionDiskMaskRequest::ActionDiskMaskRequest() :
+	TeslaDamRequest("ActionDiskMask")
+{}
+
+ActionDiskMaskRequest::~ActionDiskMaskRequest()
+{}
+
+std::string ActionDiskMaskRequest::getOp()const
+{
+	return op_;
+}
+
+void ActionDiskMaskRequest::setOp(const std::string& op)
+{
+	op_ = op;
+	setParameter("Op", op);
+}
+
+std::string ActionDiskMaskRequest::getDiskMount()const
+{
+	return diskMount_;
+}
+
+void ActionDiskMaskRequest::setDiskMount(const std::string& diskMount)
+{
+	diskMount_ = diskMount;
+	setParameter("DiskMount", diskMount);
+}
+
+std::string ActionDiskMaskRequest::getIp()const
+{
+	return ip_;
+}
+
+void ActionDiskMaskRequest::setIp(const std::string& ip)
+{
+	ip_ = ip;
+	setParameter("Ip", ip);
+}
+

+ 66 - 0
tesladam/src/model/ActionDiskMaskResult.cc

@@ -0,0 +1,66 @@
+/*
+ * 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/tesladam/model/ActionDiskMaskResult.h>
+#include <json/json.h>
+
+using namespace AlibabaCloud::TeslaDam;
+using namespace AlibabaCloud::TeslaDam::Model;
+
+ActionDiskMaskResult::ActionDiskMaskResult() :
+	ServiceResult()
+{}
+
+ActionDiskMaskResult::ActionDiskMaskResult(const std::string &payload) :
+	ServiceResult()
+{
+	parse(payload);
+}
+
+ActionDiskMaskResult::~ActionDiskMaskResult()
+{}
+
+void ActionDiskMaskResult::parse(const std::string &payload)
+{
+	Json::Reader reader;
+	Json::Value value;
+	reader.parse(payload, value);
+
+	setRequestId(value["RequestId"].asString());
+	if(!value["Status"].isNull())
+		status_ = value["Status"].asString() == "true";
+	if(!value["Message"].isNull())
+		message_ = value["Message"].asString();
+	if(!value["Result"].isNull())
+		result_ = value["Result"].asString();
+
+}
+
+bool ActionDiskMaskResult::getStatus()const
+{
+	return status_;
+}
+
+std::string ActionDiskMaskResult::getMessage()const
+{
+	return message_;
+}
+
+std::string ActionDiskMaskResult::getResult()const
+{
+	return result_;
+}
+

+ 105 - 0
tesladam/src/model/ActionDiskRmaRequest.cc

@@ -0,0 +1,105 @@
+/*
+ * 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/tesladam/model/ActionDiskRmaRequest.h>
+
+using namespace AlibabaCloud::TeslaDam;
+using namespace AlibabaCloud::TeslaDam::Model;
+
+ActionDiskRmaRequest::ActionDiskRmaRequest() :
+	TeslaDamRequest("ActionDiskRma")
+{}
+
+ActionDiskRmaRequest::~ActionDiskRmaRequest()
+{}
+
+std::string ActionDiskRmaRequest::getDiskName()const
+{
+	return diskName_;
+}
+
+void ActionDiskRmaRequest::setDiskName(const std::string& diskName)
+{
+	diskName_ = diskName;
+	setParameter("DiskName", diskName);
+}
+
+std::string ActionDiskRmaRequest::getExecutionId()const
+{
+	return executionId_;
+}
+
+void ActionDiskRmaRequest::setExecutionId(const std::string& executionId)
+{
+	executionId_ = executionId;
+	setParameter("ExecutionId", executionId);
+}
+
+std::string ActionDiskRmaRequest::getDiskSlot()const
+{
+	return diskSlot_;
+}
+
+void ActionDiskRmaRequest::setDiskSlot(const std::string& diskSlot)
+{
+	diskSlot_ = diskSlot;
+	setParameter("DiskSlot", diskSlot);
+}
+
+std::string ActionDiskRmaRequest::getHostname()const
+{
+	return hostname_;
+}
+
+void ActionDiskRmaRequest::setHostname(const std::string& hostname)
+{
+	hostname_ = hostname;
+	setParameter("Hostname", hostname);
+}
+
+std::string ActionDiskRmaRequest::getDiskMount()const
+{
+	return diskMount_;
+}
+
+void ActionDiskRmaRequest::setDiskMount(const std::string& diskMount)
+{
+	diskMount_ = diskMount;
+	setParameter("DiskMount", diskMount);
+}
+
+std::string ActionDiskRmaRequest::getDiskReason()const
+{
+	return diskReason_;
+}
+
+void ActionDiskRmaRequest::setDiskReason(const std::string& diskReason)
+{
+	diskReason_ = diskReason;
+	setParameter("DiskReason", diskReason);
+}
+
+std::string ActionDiskRmaRequest::getDiskSn()const
+{
+	return diskSn_;
+}
+
+void ActionDiskRmaRequest::setDiskSn(const std::string& diskSn)
+{
+	diskSn_ = diskSn;
+	setParameter("DiskSn", diskSn);
+}
+

+ 66 - 0
tesladam/src/model/ActionDiskRmaResult.cc

@@ -0,0 +1,66 @@
+/*
+ * 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/tesladam/model/ActionDiskRmaResult.h>
+#include <json/json.h>
+
+using namespace AlibabaCloud::TeslaDam;
+using namespace AlibabaCloud::TeslaDam::Model;
+
+ActionDiskRmaResult::ActionDiskRmaResult() :
+	ServiceResult()
+{}
+
+ActionDiskRmaResult::ActionDiskRmaResult(const std::string &payload) :
+	ServiceResult()
+{
+	parse(payload);
+}
+
+ActionDiskRmaResult::~ActionDiskRmaResult()
+{}
+
+void ActionDiskRmaResult::parse(const std::string &payload)
+{
+	Json::Reader reader;
+	Json::Value value;
+	reader.parse(payload, value);
+
+	setRequestId(value["RequestId"].asString());
+	if(!value["Status"].isNull())
+		status_ = value["Status"].asString() == "true";
+	if(!value["Message"].isNull())
+		message_ = value["Message"].asString();
+	if(!value["Result"].isNull())
+		result_ = value["Result"].asString();
+
+}
+
+bool ActionDiskRmaResult::getStatus()const
+{
+	return status_;
+}
+
+std::string ActionDiskRmaResult::getMessage()const
+{
+	return message_;
+}
+
+std::string ActionDiskRmaResult::getResult()const
+{
+	return result_;
+}
+

+ 72 - 0
tesladam/src/model/HostGetsRequest.cc

@@ -0,0 +1,72 @@
+/*
+ * 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/tesladam/model/HostGetsRequest.h>
+
+using namespace AlibabaCloud::TeslaDam;
+using namespace AlibabaCloud::TeslaDam::Model;
+
+HostGetsRequest::HostGetsRequest() :
+	TeslaDamRequest("HostGets")
+{}
+
+HostGetsRequest::~HostGetsRequest()
+{}
+
+std::string HostGetsRequest::getQuery()const
+{
+	return query_;
+}
+
+void HostGetsRequest::setQuery(const std::string& query)
+{
+	query_ = query;
+	setParameter("Query", query);
+}
+
+int HostGetsRequest::getEndTime()const
+{
+	return endTime_;
+}
+
+void HostGetsRequest::setEndTime(int endTime)
+{
+	endTime_ = endTime;
+	setParameter("EndTime", std::to_string(endTime));
+}
+
+int HostGetsRequest::getStartTime()const
+{
+	return startTime_;
+}
+
+void HostGetsRequest::setStartTime(int startTime)
+{
+	startTime_ = startTime;
+	setParameter("StartTime", std::to_string(startTime));
+}
+
+std::string HostGetsRequest::getQueryType()const
+{
+	return queryType_;
+}
+
+void HostGetsRequest::setQueryType(const std::string& queryType)
+{
+	queryType_ = queryType;
+	setParameter("QueryType", queryType);
+}
+

+ 86 - 0
tesladam/src/model/HostGetsResult.cc

@@ -0,0 +1,86 @@
+/*
+ * 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/tesladam/model/HostGetsResult.h>
+#include <json/json.h>
+
+using namespace AlibabaCloud::TeslaDam;
+using namespace AlibabaCloud::TeslaDam::Model;
+
+HostGetsResult::HostGetsResult() :
+	ServiceResult()
+{}
+
+HostGetsResult::HostGetsResult(const std::string &payload) :
+	ServiceResult()
+{
+	parse(payload);
+}
+
+HostGetsResult::~HostGetsResult()
+{}
+
+void HostGetsResult::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["Hostname"].isNull())
+			dataObject.hostname = value["Hostname"].asString();
+		if(!value["Ip"].isNull())
+			dataObject.ip = value["Ip"].asString();
+		if(!value["AppCode"].isNull())
+			dataObject.appCode = value["AppCode"].asString();
+		if(!value["ClusterCode"].isNull())
+			dataObject.clusterCode = value["ClusterCode"].asString();
+		if(!value["SshStatus"].isNull())
+			dataObject.sshStatus = std::stoi(value["SshStatus"].asString());
+		if(!value["heartStatus"].isNull())
+			dataObject.heartStatus = std::stoi(value["heartStatus"].asString());
+		if(!value["HealthScoreLast"].isNull())
+			dataObject.healthScoreLast = std::stoi(value["HealthScoreLast"].asString());
+		if(!value["HealthReasonLast"].isNull())
+			dataObject.healthReasonLast = value["HealthReasonLast"].asString();
+		data_.push_back(dataObject);
+	}
+	if(!value["Status"].isNull())
+		status_ = value["Status"].asString() == "true";
+	if(!value["Message"].isNull())
+		message_ = value["Message"].asString();
+
+}
+
+bool HostGetsResult::getStatus()const
+{
+	return status_;
+}
+
+std::string HostGetsResult::getMessage()const
+{
+	return message_;
+}
+
+std::vector<HostGetsResult::DataItem> HostGetsResult::getData()const
+{
+	return data_;
+}
+