Explorar el Código

Add DescribeRestoreRangeInfo.

sdk-team hace 6 años
padre
commit
7a898c20fc

+ 3 - 0
CHANGELOG

@@ -1,3 +1,6 @@
+2019-11-15 Version 1.36.177
+- Add DescribeRestoreRangeInfo.
+
 2019-11-14 Version 1.36.176
 - Released dysms OpenAPI.
 

+ 1 - 1
VERSION

@@ -1 +1 @@
-1.36.176
+1.36.177

+ 4 - 0
dbs/CMakeLists.txt

@@ -41,6 +41,8 @@ set(dbs_public_header_model
 	include/alibabacloud/dbs/model/DescribeNodeCidrListResult.h
 	include/alibabacloud/dbs/model/DescribePreCheckProgressListRequest.h
 	include/alibabacloud/dbs/model/DescribePreCheckProgressListResult.h
+	include/alibabacloud/dbs/model/DescribeRestoreRangeInfoRequest.h
+	include/alibabacloud/dbs/model/DescribeRestoreRangeInfoResult.h
 	include/alibabacloud/dbs/model/DescribeRestoreTaskListRequest.h
 	include/alibabacloud/dbs/model/DescribeRestoreTaskListResult.h
 	include/alibabacloud/dbs/model/ModifyBackupObjectsRequest.h
@@ -84,6 +86,8 @@ set(dbs_src
 	src/model/DescribeNodeCidrListResult.cc
 	src/model/DescribePreCheckProgressListRequest.cc
 	src/model/DescribePreCheckProgressListResult.cc
+	src/model/DescribeRestoreRangeInfoRequest.cc
+	src/model/DescribeRestoreRangeInfoResult.cc
 	src/model/DescribeRestoreTaskListRequest.cc
 	src/model/DescribeRestoreTaskListResult.cc
 	src/model/ModifyBackupObjectsRequest.cc

+ 8 - 0
dbs/include/alibabacloud/dbs/DbsClient.h

@@ -42,6 +42,8 @@
 #include "model/DescribeNodeCidrListResult.h"
 #include "model/DescribePreCheckProgressListRequest.h"
 #include "model/DescribePreCheckProgressListResult.h"
+#include "model/DescribeRestoreRangeInfoRequest.h"
+#include "model/DescribeRestoreRangeInfoResult.h"
 #include "model/DescribeRestoreTaskListRequest.h"
 #include "model/DescribeRestoreTaskListResult.h"
 #include "model/ModifyBackupObjectsRequest.h"
@@ -101,6 +103,9 @@ namespace AlibabaCloud
 			typedef Outcome<Error, Model::DescribePreCheckProgressListResult> DescribePreCheckProgressListOutcome;
 			typedef std::future<DescribePreCheckProgressListOutcome> DescribePreCheckProgressListOutcomeCallable;
 			typedef std::function<void(const DbsClient*, const Model::DescribePreCheckProgressListRequest&, const DescribePreCheckProgressListOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribePreCheckProgressListAsyncHandler;
+			typedef Outcome<Error, Model::DescribeRestoreRangeInfoResult> DescribeRestoreRangeInfoOutcome;
+			typedef std::future<DescribeRestoreRangeInfoOutcome> DescribeRestoreRangeInfoOutcomeCallable;
+			typedef std::function<void(const DbsClient*, const Model::DescribeRestoreRangeInfoRequest&, const DescribeRestoreRangeInfoOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeRestoreRangeInfoAsyncHandler;
 			typedef Outcome<Error, Model::DescribeRestoreTaskListResult> DescribeRestoreTaskListOutcome;
 			typedef std::future<DescribeRestoreTaskListOutcome> DescribeRestoreTaskListOutcomeCallable;
 			typedef std::function<void(const DbsClient*, const Model::DescribeRestoreTaskListRequest&, const DescribeRestoreTaskListOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeRestoreTaskListAsyncHandler;
@@ -166,6 +171,9 @@ namespace AlibabaCloud
 			DescribePreCheckProgressListOutcome describePreCheckProgressList(const Model::DescribePreCheckProgressListRequest &request)const;
 			void describePreCheckProgressListAsync(const Model::DescribePreCheckProgressListRequest& request, const DescribePreCheckProgressListAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
 			DescribePreCheckProgressListOutcomeCallable describePreCheckProgressListCallable(const Model::DescribePreCheckProgressListRequest& request) const;
+			DescribeRestoreRangeInfoOutcome describeRestoreRangeInfo(const Model::DescribeRestoreRangeInfoRequest &request)const;
+			void describeRestoreRangeInfoAsync(const Model::DescribeRestoreRangeInfoRequest& request, const DescribeRestoreRangeInfoAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
+			DescribeRestoreRangeInfoOutcomeCallable describeRestoreRangeInfoCallable(const Model::DescribeRestoreRangeInfoRequest& request) const;
 			DescribeRestoreTaskListOutcome describeRestoreTaskList(const Model::DescribeRestoreTaskListRequest &request)const;
 			void describeRestoreTaskListAsync(const Model::DescribeRestoreTaskListRequest& request, const DescribeRestoreTaskListAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
 			DescribeRestoreTaskListOutcomeCallable describeRestoreTaskListCallable(const Model::DescribeRestoreTaskListRequest& request) const;

+ 60 - 0
dbs/include/alibabacloud/dbs/model/DescribeRestoreRangeInfoRequest.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_DBS_MODEL_DESCRIBERESTORERANGEINFOREQUEST_H_
+#define ALIBABACLOUD_DBS_MODEL_DESCRIBERESTORERANGEINFOREQUEST_H_
+
+#include <string>
+#include <vector>
+#include <alibabacloud/core/RpcServiceRequest.h>
+#include <alibabacloud/dbs/DbsExport.h>
+
+namespace AlibabaCloud
+{
+	namespace Dbs
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_DBS_EXPORT DescribeRestoreRangeInfoRequest : public RpcServiceRequest
+			{
+
+			public:
+				DescribeRestoreRangeInfoRequest();
+				~DescribeRestoreRangeInfoRequest();
+
+				long getBeginTimestampForRestore()const;
+				void setBeginTimestampForRestore(long beginTimestampForRestore);
+				long getEndTimestampForRestore()const;
+				void setEndTimestampForRestore(long endTimestampForRestore);
+				std::string getClientToken()const;
+				void setClientToken(const std::string& clientToken);
+				std::string getBackupPlanId()const;
+				void setBackupPlanId(const std::string& backupPlanId);
+				std::string getOwnerId()const;
+				void setOwnerId(const std::string& ownerId);
+
+            private:
+				long beginTimestampForRestore_;
+				long endTimestampForRestore_;
+				std::string clientToken_;
+				std::string backupPlanId_;
+				std::string ownerId_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_DBS_MODEL_DESCRIBERESTORERANGEINFOREQUEST_H_

+ 74 - 0
dbs/include/alibabacloud/dbs/model/DescribeRestoreRangeInfoResult.h

@@ -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.
+ */
+
+#ifndef ALIBABACLOUD_DBS_MODEL_DESCRIBERESTORERANGEINFORESULT_H_
+#define ALIBABACLOUD_DBS_MODEL_DESCRIBERESTORERANGEINFORESULT_H_
+
+#include <string>
+#include <vector>
+#include <utility>
+#include <alibabacloud/core/ServiceResult.h>
+#include <alibabacloud/dbs/DbsExport.h>
+
+namespace AlibabaCloud
+{
+	namespace Dbs
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_DBS_EXPORT DescribeRestoreRangeInfoResult : public ServiceResult
+			{
+			public:
+				struct DBSRecoverRange
+				{
+					struct FullBackupDetail
+					{
+						std::string endTime;
+						std::string startTime;
+						std::string backupSetId;
+					};
+					std::string rangeType;
+					std::vector<DBSRecoverRange::FullBackupDetail> fullBackupList;
+					std::string sourceEndpointInstanceID;
+					std::string sourceEndpointInstanceType;
+					std::string endTimestampForRestore;
+					std::string beginTimestampForRestore;
+				};
+
+
+				DescribeRestoreRangeInfoResult();
+				explicit DescribeRestoreRangeInfoResult(const std::string &payload);
+				~DescribeRestoreRangeInfoResult();
+				int getHttpStatusCode()const;
+				std::vector<DBSRecoverRange> getItems()const;
+				std::string getErrMessage()const;
+				bool getSuccess()const;
+				std::string getErrCode()const;
+
+			protected:
+				void parse(const std::string &payload);
+			private:
+				int httpStatusCode_;
+				std::vector<DBSRecoverRange> items_;
+				std::string errMessage_;
+				bool success_;
+				std::string errCode_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_DBS_MODEL_DESCRIBERESTORERANGEINFORESULT_H_

+ 36 - 0
dbs/src/DbsClient.cc

@@ -411,6 +411,42 @@ DbsClient::DescribePreCheckProgressListOutcomeCallable DbsClient::describePreChe
 	return task->get_future();
 }
 
+DbsClient::DescribeRestoreRangeInfoOutcome DbsClient::describeRestoreRangeInfo(const DescribeRestoreRangeInfoRequest &request) const
+{
+	auto endpointOutcome = endpointProvider_->getEndpoint();
+	if (!endpointOutcome.isSuccess())
+		return DescribeRestoreRangeInfoOutcome(endpointOutcome.error());
+
+	auto outcome = makeRequest(endpointOutcome.result(), request);
+
+	if (outcome.isSuccess())
+		return DescribeRestoreRangeInfoOutcome(DescribeRestoreRangeInfoResult(outcome.result()));
+	else
+		return DescribeRestoreRangeInfoOutcome(outcome.error());
+}
+
+void DbsClient::describeRestoreRangeInfoAsync(const DescribeRestoreRangeInfoRequest& request, const DescribeRestoreRangeInfoAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
+{
+	auto fn = [this, request, handler, context]()
+	{
+		handler(this, request, describeRestoreRangeInfo(request), context);
+	};
+
+	asyncExecute(new Runnable(fn));
+}
+
+DbsClient::DescribeRestoreRangeInfoOutcomeCallable DbsClient::describeRestoreRangeInfoCallable(const DescribeRestoreRangeInfoRequest &request) const
+{
+	auto task = std::make_shared<std::packaged_task<DescribeRestoreRangeInfoOutcome()>>(
+			[this, request]()
+			{
+			return this->describeRestoreRangeInfo(request);
+			});
+
+	asyncExecute(new Runnable([task]() { (*task)(); }));
+	return task->get_future();
+}
+
 DbsClient::DescribeRestoreTaskListOutcome DbsClient::describeRestoreTaskList(const DescribeRestoreTaskListRequest &request) const
 {
 	auto endpointOutcome = endpointProvider_->getEndpoint();

+ 84 - 0
dbs/src/model/DescribeRestoreRangeInfoRequest.cc

@@ -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.
+ */
+
+#include <alibabacloud/dbs/model/DescribeRestoreRangeInfoRequest.h>
+
+using AlibabaCloud::Dbs::Model::DescribeRestoreRangeInfoRequest;
+
+DescribeRestoreRangeInfoRequest::DescribeRestoreRangeInfoRequest() :
+	RpcServiceRequest("dbs", "2019-03-06", "DescribeRestoreRangeInfo")
+{
+	setMethod(HttpRequest::Method::Post);
+}
+
+DescribeRestoreRangeInfoRequest::~DescribeRestoreRangeInfoRequest()
+{}
+
+long DescribeRestoreRangeInfoRequest::getBeginTimestampForRestore()const
+{
+	return beginTimestampForRestore_;
+}
+
+void DescribeRestoreRangeInfoRequest::setBeginTimestampForRestore(long beginTimestampForRestore)
+{
+	beginTimestampForRestore_ = beginTimestampForRestore;
+	setCoreParameter("BeginTimestampForRestore", std::to_string(beginTimestampForRestore));
+}
+
+long DescribeRestoreRangeInfoRequest::getEndTimestampForRestore()const
+{
+	return endTimestampForRestore_;
+}
+
+void DescribeRestoreRangeInfoRequest::setEndTimestampForRestore(long endTimestampForRestore)
+{
+	endTimestampForRestore_ = endTimestampForRestore;
+	setCoreParameter("EndTimestampForRestore", std::to_string(endTimestampForRestore));
+}
+
+std::string DescribeRestoreRangeInfoRequest::getClientToken()const
+{
+	return clientToken_;
+}
+
+void DescribeRestoreRangeInfoRequest::setClientToken(const std::string& clientToken)
+{
+	clientToken_ = clientToken;
+	setCoreParameter("ClientToken", clientToken);
+}
+
+std::string DescribeRestoreRangeInfoRequest::getBackupPlanId()const
+{
+	return backupPlanId_;
+}
+
+void DescribeRestoreRangeInfoRequest::setBackupPlanId(const std::string& backupPlanId)
+{
+	backupPlanId_ = backupPlanId;
+	setCoreParameter("BackupPlanId", backupPlanId);
+}
+
+std::string DescribeRestoreRangeInfoRequest::getOwnerId()const
+{
+	return ownerId_;
+}
+
+void DescribeRestoreRangeInfoRequest::setOwnerId(const std::string& ownerId)
+{
+	ownerId_ = ownerId;
+	setCoreParameter("OwnerId", ownerId);
+}
+

+ 105 - 0
dbs/src/model/DescribeRestoreRangeInfoResult.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/dbs/model/DescribeRestoreRangeInfoResult.h>
+#include <json/json.h>
+
+using namespace AlibabaCloud::Dbs;
+using namespace AlibabaCloud::Dbs::Model;
+
+DescribeRestoreRangeInfoResult::DescribeRestoreRangeInfoResult() :
+	ServiceResult()
+{}
+
+DescribeRestoreRangeInfoResult::DescribeRestoreRangeInfoResult(const std::string &payload) :
+	ServiceResult()
+{
+	parse(payload);
+}
+
+DescribeRestoreRangeInfoResult::~DescribeRestoreRangeInfoResult()
+{}
+
+void DescribeRestoreRangeInfoResult::parse(const std::string &payload)
+{
+	Json::Reader reader;
+	Json::Value value;
+	reader.parse(payload, value);
+	setRequestId(value["RequestId"].asString());
+	auto allItemsNode = value["Items"]["DBSRecoverRange"];
+	for (auto valueItemsDBSRecoverRange : allItemsNode)
+	{
+		DBSRecoverRange itemsObject;
+		if(!valueItemsDBSRecoverRange["SourceEndpointInstanceType"].isNull())
+			itemsObject.sourceEndpointInstanceType = valueItemsDBSRecoverRange["SourceEndpointInstanceType"].asString();
+		if(!valueItemsDBSRecoverRange["SourceEndpointInstanceID"].isNull())
+			itemsObject.sourceEndpointInstanceID = valueItemsDBSRecoverRange["SourceEndpointInstanceID"].asString();
+		if(!valueItemsDBSRecoverRange["BeginTimestampForRestore"].isNull())
+			itemsObject.beginTimestampForRestore = valueItemsDBSRecoverRange["BeginTimestampForRestore"].asString();
+		if(!valueItemsDBSRecoverRange["EndTimestampForRestore"].isNull())
+			itemsObject.endTimestampForRestore = valueItemsDBSRecoverRange["EndTimestampForRestore"].asString();
+		if(!valueItemsDBSRecoverRange["RangeType"].isNull())
+			itemsObject.rangeType = valueItemsDBSRecoverRange["RangeType"].asString();
+		auto allFullBackupListNode = allItemsNode["FullBackupList"]["FullBackupDetail"];
+		for (auto allItemsNodeFullBackupListFullBackupDetail : allFullBackupListNode)
+		{
+			DBSRecoverRange::FullBackupDetail fullBackupListObject;
+			if(!allItemsNodeFullBackupListFullBackupDetail["BackupSetId"].isNull())
+				fullBackupListObject.backupSetId = allItemsNodeFullBackupListFullBackupDetail["BackupSetId"].asString();
+			if(!allItemsNodeFullBackupListFullBackupDetail["StartTime"].isNull())
+				fullBackupListObject.startTime = allItemsNodeFullBackupListFullBackupDetail["StartTime"].asString();
+			if(!allItemsNodeFullBackupListFullBackupDetail["EndTime"].isNull())
+				fullBackupListObject.endTime = allItemsNodeFullBackupListFullBackupDetail["EndTime"].asString();
+			itemsObject.fullBackupList.push_back(fullBackupListObject);
+		}
+		items_.push_back(itemsObject);
+	}
+	if(!value["Success"].isNull())
+		success_ = value["Success"].asString() == "true";
+	if(!value["ErrCode"].isNull())
+		errCode_ = value["ErrCode"].asString();
+	if(!value["ErrMessage"].isNull())
+		errMessage_ = value["ErrMessage"].asString();
+	if(!value["HttpStatusCode"].isNull())
+		httpStatusCode_ = std::stoi(value["HttpStatusCode"].asString());
+
+}
+
+int DescribeRestoreRangeInfoResult::getHttpStatusCode()const
+{
+	return httpStatusCode_;
+}
+
+std::vector<DescribeRestoreRangeInfoResult::DBSRecoverRange> DescribeRestoreRangeInfoResult::getItems()const
+{
+	return items_;
+}
+
+std::string DescribeRestoreRangeInfoResult::getErrMessage()const
+{
+	return errMessage_;
+}
+
+bool DescribeRestoreRangeInfoResult::getSuccess()const
+{
+	return success_;
+}
+
+std::string DescribeRestoreRangeInfoResult::getErrCode()const
+{
+	return errCode_;
+}
+