Quellcode durchsuchen

Support query dbfs specification.

sdk-team vor 5 Jahren
Ursprung
Commit
835983db86

+ 3 - 0
CHANGELOG

@@ -1,3 +1,6 @@
+2021-08-12 Version: 1.36.850
+- Support query dbfs specification.
+
 2021-08-12 Version: 1.36.849
 - DescirbeAvailableResource add NodeId input parameter.
 - CreateTairInstance add GlobalInstanceId input paramter.

+ 1 - 1
VERSION

@@ -1 +1 @@
-1.36.849
+1.36.850

+ 4 - 0
dbfs/CMakeLists.txt

@@ -43,6 +43,8 @@ set(dbfs_public_header_model
 	include/alibabacloud/dbfs/model/DeleteSnapshotResult.h
 	include/alibabacloud/dbfs/model/DeleteTagsBatchRequest.h
 	include/alibabacloud/dbfs/model/DeleteTagsBatchResult.h
+	include/alibabacloud/dbfs/model/DescribeDbfsSpecificationsRequest.h
+	include/alibabacloud/dbfs/model/DescribeDbfsSpecificationsResult.h
 	include/alibabacloud/dbfs/model/DetachDbfsRequest.h
 	include/alibabacloud/dbfs/model/DetachDbfsResult.h
 	include/alibabacloud/dbfs/model/GenerateUpgradeRecordRequest.h
@@ -110,6 +112,8 @@ set(dbfs_src
 	src/model/DeleteSnapshotResult.cc
 	src/model/DeleteTagsBatchRequest.cc
 	src/model/DeleteTagsBatchResult.cc
+	src/model/DescribeDbfsSpecificationsRequest.cc
+	src/model/DescribeDbfsSpecificationsResult.cc
 	src/model/DetachDbfsRequest.cc
 	src/model/DetachDbfsResult.cc
 	src/model/GenerateUpgradeRecordRequest.cc

+ 8 - 0
dbfs/include/alibabacloud/dbfs/DBFSClient.h

@@ -44,6 +44,8 @@
 #include "model/DeleteSnapshotResult.h"
 #include "model/DeleteTagsBatchRequest.h"
 #include "model/DeleteTagsBatchResult.h"
+#include "model/DescribeDbfsSpecificationsRequest.h"
+#include "model/DescribeDbfsSpecificationsResult.h"
 #include "model/DetachDbfsRequest.h"
 #include "model/DetachDbfsResult.h"
 #include "model/GenerateUpgradeRecordRequest.h"
@@ -128,6 +130,9 @@ namespace AlibabaCloud
 			typedef Outcome<Error, Model::DeleteTagsBatchResult> DeleteTagsBatchOutcome;
 			typedef std::future<DeleteTagsBatchOutcome> DeleteTagsBatchOutcomeCallable;
 			typedef std::function<void(const DBFSClient*, const Model::DeleteTagsBatchRequest&, const DeleteTagsBatchOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DeleteTagsBatchAsyncHandler;
+			typedef Outcome<Error, Model::DescribeDbfsSpecificationsResult> DescribeDbfsSpecificationsOutcome;
+			typedef std::future<DescribeDbfsSpecificationsOutcome> DescribeDbfsSpecificationsOutcomeCallable;
+			typedef std::function<void(const DBFSClient*, const Model::DescribeDbfsSpecificationsRequest&, const DescribeDbfsSpecificationsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeDbfsSpecificationsAsyncHandler;
 			typedef Outcome<Error, Model::DetachDbfsResult> DetachDbfsOutcome;
 			typedef std::future<DetachDbfsOutcome> DetachDbfsOutcomeCallable;
 			typedef std::function<void(const DBFSClient*, const Model::DetachDbfsRequest&, const DetachDbfsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DetachDbfsAsyncHandler;
@@ -229,6 +234,9 @@ namespace AlibabaCloud
 			DeleteTagsBatchOutcome deleteTagsBatch(const Model::DeleteTagsBatchRequest &request)const;
 			void deleteTagsBatchAsync(const Model::DeleteTagsBatchRequest& request, const DeleteTagsBatchAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
 			DeleteTagsBatchOutcomeCallable deleteTagsBatchCallable(const Model::DeleteTagsBatchRequest& request) const;
+			DescribeDbfsSpecificationsOutcome describeDbfsSpecifications(const Model::DescribeDbfsSpecificationsRequest &request)const;
+			void describeDbfsSpecificationsAsync(const Model::DescribeDbfsSpecificationsRequest& request, const DescribeDbfsSpecificationsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
+			DescribeDbfsSpecificationsOutcomeCallable describeDbfsSpecificationsCallable(const Model::DescribeDbfsSpecificationsRequest& request) const;
 			DetachDbfsOutcome detachDbfs(const Model::DetachDbfsRequest &request)const;
 			void detachDbfsAsync(const Model::DetachDbfsRequest& request, const DetachDbfsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
 			DetachDbfsOutcomeCallable detachDbfsCallable(const Model::DetachDbfsRequest& request) const;

+ 54 - 0
dbfs/include/alibabacloud/dbfs/model/DescribeDbfsSpecificationsRequest.h

@@ -0,0 +1,54 @@
+/*
+ * 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_DBFS_MODEL_DESCRIBEDBFSSPECIFICATIONSREQUEST_H_
+#define ALIBABACLOUD_DBFS_MODEL_DESCRIBEDBFSSPECIFICATIONSREQUEST_H_
+
+#include <string>
+#include <vector>
+#include <alibabacloud/core/RpcServiceRequest.h>
+#include <alibabacloud/dbfs/DBFSExport.h>
+
+namespace AlibabaCloud
+{
+	namespace DBFS
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_DBFS_EXPORT DescribeDbfsSpecificationsRequest : public RpcServiceRequest
+			{
+
+			public:
+				DescribeDbfsSpecificationsRequest();
+				~DescribeDbfsSpecificationsRequest();
+
+				std::string getEcsInstanceType()const;
+				void setEcsInstanceType(const std::string& ecsInstanceType);
+				std::string getRegionId()const;
+				void setRegionId(const std::string& regionId);
+				std::string getCategory()const;
+				void setCategory(const std::string& category);
+
+            private:
+				std::string ecsInstanceType_;
+				std::string regionId_;
+				std::string category_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_DBFS_MODEL_DESCRIBEDBFSSPECIFICATIONSREQUEST_H_

+ 53 - 0
dbfs/include/alibabacloud/dbfs/model/DescribeDbfsSpecificationsResult.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_DBFS_MODEL_DESCRIBEDBFSSPECIFICATIONSRESULT_H_
+#define ALIBABACLOUD_DBFS_MODEL_DESCRIBEDBFSSPECIFICATIONSRESULT_H_
+
+#include <string>
+#include <vector>
+#include <utility>
+#include <alibabacloud/core/ServiceResult.h>
+#include <alibabacloud/dbfs/DBFSExport.h>
+
+namespace AlibabaCloud
+{
+	namespace DBFS
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_DBFS_EXPORT DescribeDbfsSpecificationsResult : public ServiceResult
+			{
+			public:
+
+
+				DescribeDbfsSpecificationsResult();
+				explicit DescribeDbfsSpecificationsResult(const std::string &payload);
+				~DescribeDbfsSpecificationsResult();
+				std::string getMaxDbfsNumberPerEcs()const;
+				std::vector<std::string> getSupportedEcsInstanceTypeFamily()const;
+
+			protected:
+				void parse(const std::string &payload);
+			private:
+				std::string maxDbfsNumberPerEcs_;
+				std::vector<std::string> supportedEcsInstanceTypeFamily_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_DBFS_MODEL_DESCRIBEDBFSSPECIFICATIONSRESULT_H_

+ 36 - 0
dbfs/src/DBFSClient.cc

@@ -447,6 +447,42 @@ DBFSClient::DeleteTagsBatchOutcomeCallable DBFSClient::deleteTagsBatchCallable(c
 	return task->get_future();
 }
 
+DBFSClient::DescribeDbfsSpecificationsOutcome DBFSClient::describeDbfsSpecifications(const DescribeDbfsSpecificationsRequest &request) const
+{
+	auto endpointOutcome = endpointProvider_->getEndpoint();
+	if (!endpointOutcome.isSuccess())
+		return DescribeDbfsSpecificationsOutcome(endpointOutcome.error());
+
+	auto outcome = makeRequest(endpointOutcome.result(), request);
+
+	if (outcome.isSuccess())
+		return DescribeDbfsSpecificationsOutcome(DescribeDbfsSpecificationsResult(outcome.result()));
+	else
+		return DescribeDbfsSpecificationsOutcome(outcome.error());
+}
+
+void DBFSClient::describeDbfsSpecificationsAsync(const DescribeDbfsSpecificationsRequest& request, const DescribeDbfsSpecificationsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
+{
+	auto fn = [this, request, handler, context]()
+	{
+		handler(this, request, describeDbfsSpecifications(request), context);
+	};
+
+	asyncExecute(new Runnable(fn));
+}
+
+DBFSClient::DescribeDbfsSpecificationsOutcomeCallable DBFSClient::describeDbfsSpecificationsCallable(const DescribeDbfsSpecificationsRequest &request) const
+{
+	auto task = std::make_shared<std::packaged_task<DescribeDbfsSpecificationsOutcome()>>(
+			[this, request]()
+			{
+			return this->describeDbfsSpecifications(request);
+			});
+
+	asyncExecute(new Runnable([task]() { (*task)(); }));
+	return task->get_future();
+}
+
 DBFSClient::DetachDbfsOutcome DBFSClient::detachDbfs(const DetachDbfsRequest &request) const
 {
 	auto endpointOutcome = endpointProvider_->getEndpoint();

+ 62 - 0
dbfs/src/model/DescribeDbfsSpecificationsRequest.cc

@@ -0,0 +1,62 @@
+/*
+ * 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/dbfs/model/DescribeDbfsSpecificationsRequest.h>
+
+using AlibabaCloud::DBFS::Model::DescribeDbfsSpecificationsRequest;
+
+DescribeDbfsSpecificationsRequest::DescribeDbfsSpecificationsRequest() :
+	RpcServiceRequest("dbfs", "2020-04-18", "DescribeDbfsSpecifications")
+{
+	setMethod(HttpRequest::Method::Post);
+}
+
+DescribeDbfsSpecificationsRequest::~DescribeDbfsSpecificationsRequest()
+{}
+
+std::string DescribeDbfsSpecificationsRequest::getEcsInstanceType()const
+{
+	return ecsInstanceType_;
+}
+
+void DescribeDbfsSpecificationsRequest::setEcsInstanceType(const std::string& ecsInstanceType)
+{
+	ecsInstanceType_ = ecsInstanceType;
+	setParameter("EcsInstanceType", ecsInstanceType);
+}
+
+std::string DescribeDbfsSpecificationsRequest::getRegionId()const
+{
+	return regionId_;
+}
+
+void DescribeDbfsSpecificationsRequest::setRegionId(const std::string& regionId)
+{
+	regionId_ = regionId;
+	setParameter("RegionId", regionId);
+}
+
+std::string DescribeDbfsSpecificationsRequest::getCategory()const
+{
+	return category_;
+}
+
+void DescribeDbfsSpecificationsRequest::setCategory(const std::string& category)
+{
+	category_ = category;
+	setParameter("Category", category);
+}
+

+ 59 - 0
dbfs/src/model/DescribeDbfsSpecificationsResult.cc

@@ -0,0 +1,59 @@
+/*
+ * 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/dbfs/model/DescribeDbfsSpecificationsResult.h>
+#include <json/json.h>
+
+using namespace AlibabaCloud::DBFS;
+using namespace AlibabaCloud::DBFS::Model;
+
+DescribeDbfsSpecificationsResult::DescribeDbfsSpecificationsResult() :
+	ServiceResult()
+{}
+
+DescribeDbfsSpecificationsResult::DescribeDbfsSpecificationsResult(const std::string &payload) :
+	ServiceResult()
+{
+	parse(payload);
+}
+
+DescribeDbfsSpecificationsResult::~DescribeDbfsSpecificationsResult()
+{}
+
+void DescribeDbfsSpecificationsResult::parse(const std::string &payload)
+{
+	Json::Reader reader;
+	Json::Value value;
+	reader.parse(payload, value);
+	setRequestId(value["RequestId"].asString());
+	auto allSupportedEcsInstanceTypeFamily = value["SupportedEcsInstanceTypeFamily"]["EcsInstanceTypeFamily"];
+	for (const auto &item : allSupportedEcsInstanceTypeFamily)
+		supportedEcsInstanceTypeFamily_.push_back(item.asString());
+	if(!value["MaxDbfsNumberPerEcs"].isNull())
+		maxDbfsNumberPerEcs_ = value["MaxDbfsNumberPerEcs"].asString();
+
+}
+
+std::string DescribeDbfsSpecificationsResult::getMaxDbfsNumberPerEcs()const
+{
+	return maxDbfsNumberPerEcs_;
+}
+
+std::vector<std::string> DescribeDbfsSpecificationsResult::getSupportedEcsInstanceTypeFamily()const
+{
+	return supportedEcsInstanceTypeFamily_;
+}
+