Support query dbfs specification.
This commit is contained in:
@@ -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
dbfs/src/model/DescribeDbfsSpecificationsRequest.cc
Normal file
62
dbfs/src/model/DescribeDbfsSpecificationsRequest.cc
Normal file
@@ -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
dbfs/src/model/DescribeDbfsSpecificationsResult.cc
Normal file
59
dbfs/src/model/DescribeDbfsSpecificationsResult.cc
Normal file
@@ -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_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user