From 835983db86b4db79e04d15a5ff45cc0298f9e5bd Mon Sep 17 00:00:00 2001 From: sdk-team Date: Thu, 12 Aug 2021 11:40:09 +0000 Subject: [PATCH] Support query dbfs specification. --- CHANGELOG | 3 + VERSION | 2 +- dbfs/CMakeLists.txt | 4 ++ dbfs/include/alibabacloud/dbfs/DBFSClient.h | 8 +++ .../model/DescribeDbfsSpecificationsRequest.h | 54 ++++++++++++++++ .../model/DescribeDbfsSpecificationsResult.h | 53 ++++++++++++++++ dbfs/src/DBFSClient.cc | 36 +++++++++++ .../DescribeDbfsSpecificationsRequest.cc | 62 +++++++++++++++++++ .../model/DescribeDbfsSpecificationsResult.cc | 59 ++++++++++++++++++ 9 files changed, 280 insertions(+), 1 deletion(-) create mode 100644 dbfs/include/alibabacloud/dbfs/model/DescribeDbfsSpecificationsRequest.h create mode 100644 dbfs/include/alibabacloud/dbfs/model/DescribeDbfsSpecificationsResult.h create mode 100644 dbfs/src/model/DescribeDbfsSpecificationsRequest.cc create mode 100644 dbfs/src/model/DescribeDbfsSpecificationsResult.cc diff --git a/CHANGELOG b/CHANGELOG index 9e1a37d5b..4919eb075 100644 --- a/CHANGELOG +++ b/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. diff --git a/VERSION b/VERSION index b0731212b..7412d20cd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.849 \ No newline at end of file +1.36.850 \ No newline at end of file diff --git a/dbfs/CMakeLists.txt b/dbfs/CMakeLists.txt index dbbbb6d00..7fda8f0d1 100644 --- a/dbfs/CMakeLists.txt +++ b/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 diff --git a/dbfs/include/alibabacloud/dbfs/DBFSClient.h b/dbfs/include/alibabacloud/dbfs/DBFSClient.h index abb6fa36a..bfd9e74b3 100644 --- a/dbfs/include/alibabacloud/dbfs/DBFSClient.h +++ b/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 DeleteTagsBatchOutcome; typedef std::future DeleteTagsBatchOutcomeCallable; typedef std::function&)> DeleteTagsBatchAsyncHandler; + typedef Outcome DescribeDbfsSpecificationsOutcome; + typedef std::future DescribeDbfsSpecificationsOutcomeCallable; + typedef std::function&)> DescribeDbfsSpecificationsAsyncHandler; typedef Outcome DetachDbfsOutcome; typedef std::future DetachDbfsOutcomeCallable; typedef std::function&)> 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& 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& 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& context = nullptr) const; DetachDbfsOutcomeCallable detachDbfsCallable(const Model::DetachDbfsRequest& request) const; diff --git a/dbfs/include/alibabacloud/dbfs/model/DescribeDbfsSpecificationsRequest.h b/dbfs/include/alibabacloud/dbfs/model/DescribeDbfsSpecificationsRequest.h new file mode 100644 index 000000000..0487791be --- /dev/null +++ b/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 +#include +#include +#include + +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_ \ No newline at end of file diff --git a/dbfs/include/alibabacloud/dbfs/model/DescribeDbfsSpecificationsResult.h b/dbfs/include/alibabacloud/dbfs/model/DescribeDbfsSpecificationsResult.h new file mode 100644 index 000000000..8cbe3f061 --- /dev/null +++ b/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 +#include +#include +#include +#include + +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 getSupportedEcsInstanceTypeFamily()const; + + protected: + void parse(const std::string &payload); + private: + std::string maxDbfsNumberPerEcs_; + std::vector supportedEcsInstanceTypeFamily_; + + }; + } + } +} +#endif // !ALIBABACLOUD_DBFS_MODEL_DESCRIBEDBFSSPECIFICATIONSRESULT_H_ \ No newline at end of file diff --git a/dbfs/src/DBFSClient.cc b/dbfs/src/DBFSClient.cc index bc97eb399..d9a99d5ad 100644 --- a/dbfs/src/DBFSClient.cc +++ b/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& 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>( + [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(); diff --git a/dbfs/src/model/DescribeDbfsSpecificationsRequest.cc b/dbfs/src/model/DescribeDbfsSpecificationsRequest.cc new file mode 100644 index 000000000..18b5b08e5 --- /dev/null +++ b/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 + +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); +} + diff --git a/dbfs/src/model/DescribeDbfsSpecificationsResult.cc b/dbfs/src/model/DescribeDbfsSpecificationsResult.cc new file mode 100644 index 000000000..d20a153e7 --- /dev/null +++ b/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 +#include + +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 DescribeDbfsSpecificationsResult::getSupportedEcsInstanceTypeFamily()const +{ + return supportedEcsInstanceTypeFamily_; +} +