Generate dbfs sdk.

This commit is contained in:
sdk-team
2020-06-08 15:05:24 +08:00
parent 84659b3f3e
commit c811dc5d85
34 changed files with 2144 additions and 1 deletions

305
dbfs/src/DBFSClient.cc Normal file
View File

@@ -0,0 +1,305 @@
/*
* 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/DBFSClient.h>
#include <alibabacloud/core/SimpleCredentialsProvider.h>
using namespace AlibabaCloud;
using namespace AlibabaCloud::Location;
using namespace AlibabaCloud::DBFS;
using namespace AlibabaCloud::DBFS::Model;
namespace
{
const std::string SERVICE_NAME = "DBFS";
}
DBFSClient::DBFSClient(const Credentials &credentials, const ClientConfiguration &configuration) :
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
{
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
}
DBFSClient::DBFSClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
{
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
}
DBFSClient::DBFSClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
{
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
}
DBFSClient::~DBFSClient()
{}
DBFSClient::AttachDbfsOutcome DBFSClient::attachDbfs(const AttachDbfsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return AttachDbfsOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return AttachDbfsOutcome(AttachDbfsResult(outcome.result()));
else
return AttachDbfsOutcome(outcome.error());
}
void DBFSClient::attachDbfsAsync(const AttachDbfsRequest& request, const AttachDbfsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, attachDbfs(request), context);
};
asyncExecute(new Runnable(fn));
}
DBFSClient::AttachDbfsOutcomeCallable DBFSClient::attachDbfsCallable(const AttachDbfsRequest &request) const
{
auto task = std::make_shared<std::packaged_task<AttachDbfsOutcome()>>(
[this, request]()
{
return this->attachDbfs(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
DBFSClient::CreateDbfsOutcome DBFSClient::createDbfs(const CreateDbfsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return CreateDbfsOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return CreateDbfsOutcome(CreateDbfsResult(outcome.result()));
else
return CreateDbfsOutcome(outcome.error());
}
void DBFSClient::createDbfsAsync(const CreateDbfsRequest& request, const CreateDbfsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, createDbfs(request), context);
};
asyncExecute(new Runnable(fn));
}
DBFSClient::CreateDbfsOutcomeCallable DBFSClient::createDbfsCallable(const CreateDbfsRequest &request) const
{
auto task = std::make_shared<std::packaged_task<CreateDbfsOutcome()>>(
[this, request]()
{
return this->createDbfs(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
DBFSClient::DeleteDbfsOutcome DBFSClient::deleteDbfs(const DeleteDbfsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DeleteDbfsOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DeleteDbfsOutcome(DeleteDbfsResult(outcome.result()));
else
return DeleteDbfsOutcome(outcome.error());
}
void DBFSClient::deleteDbfsAsync(const DeleteDbfsRequest& request, const DeleteDbfsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, deleteDbfs(request), context);
};
asyncExecute(new Runnable(fn));
}
DBFSClient::DeleteDbfsOutcomeCallable DBFSClient::deleteDbfsCallable(const DeleteDbfsRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DeleteDbfsOutcome()>>(
[this, request]()
{
return this->deleteDbfs(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
DBFSClient::DetachDbfsOutcome DBFSClient::detachDbfs(const DetachDbfsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DetachDbfsOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DetachDbfsOutcome(DetachDbfsResult(outcome.result()));
else
return DetachDbfsOutcome(outcome.error());
}
void DBFSClient::detachDbfsAsync(const DetachDbfsRequest& request, const DetachDbfsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, detachDbfs(request), context);
};
asyncExecute(new Runnable(fn));
}
DBFSClient::DetachDbfsOutcomeCallable DBFSClient::detachDbfsCallable(const DetachDbfsRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DetachDbfsOutcome()>>(
[this, request]()
{
return this->detachDbfs(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
DBFSClient::GetDbfsOutcome DBFSClient::getDbfs(const GetDbfsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GetDbfsOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GetDbfsOutcome(GetDbfsResult(outcome.result()));
else
return GetDbfsOutcome(outcome.error());
}
void DBFSClient::getDbfsAsync(const GetDbfsRequest& request, const GetDbfsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, getDbfs(request), context);
};
asyncExecute(new Runnable(fn));
}
DBFSClient::GetDbfsOutcomeCallable DBFSClient::getDbfsCallable(const GetDbfsRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GetDbfsOutcome()>>(
[this, request]()
{
return this->getDbfs(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
DBFSClient::ListDbfsOutcome DBFSClient::listDbfs(const ListDbfsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ListDbfsOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ListDbfsOutcome(ListDbfsResult(outcome.result()));
else
return ListDbfsOutcome(outcome.error());
}
void DBFSClient::listDbfsAsync(const ListDbfsRequest& request, const ListDbfsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, listDbfs(request), context);
};
asyncExecute(new Runnable(fn));
}
DBFSClient::ListDbfsOutcomeCallable DBFSClient::listDbfsCallable(const ListDbfsRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ListDbfsOutcome()>>(
[this, request]()
{
return this->listDbfs(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
DBFSClient::ResizeDbfsOutcome DBFSClient::resizeDbfs(const ResizeDbfsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ResizeDbfsOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ResizeDbfsOutcome(ResizeDbfsResult(outcome.result()));
else
return ResizeDbfsOutcome(outcome.error());
}
void DBFSClient::resizeDbfsAsync(const ResizeDbfsRequest& request, const ResizeDbfsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, resizeDbfs(request), context);
};
asyncExecute(new Runnable(fn));
}
DBFSClient::ResizeDbfsOutcomeCallable DBFSClient::resizeDbfsCallable(const ResizeDbfsRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ResizeDbfsOutcome()>>(
[this, request]()
{
return this->resizeDbfs(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}

View 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/AttachDbfsRequest.h>
using AlibabaCloud::DBFS::Model::AttachDbfsRequest;
AttachDbfsRequest::AttachDbfsRequest() :
RpcServiceRequest("dbfs", "2020-02-19", "AttachDbfs")
{
setMethod(HttpRequest::Method::Post);
}
AttachDbfsRequest::~AttachDbfsRequest()
{}
std::string AttachDbfsRequest::getECSInstanceId()const
{
return eCSInstanceId_;
}
void AttachDbfsRequest::setECSInstanceId(const std::string& eCSInstanceId)
{
eCSInstanceId_ = eCSInstanceId;
setParameter("ECSInstanceId", eCSInstanceId);
}
std::string AttachDbfsRequest::getRegionId()const
{
return regionId_;
}
void AttachDbfsRequest::setRegionId(const std::string& regionId)
{
regionId_ = regionId;
setParameter("RegionId", regionId);
}
std::string AttachDbfsRequest::getFsId()const
{
return fsId_;
}
void AttachDbfsRequest::setFsId(const std::string& fsId)
{
fsId_ = fsId;
setParameter("FsId", fsId);
}

View File

@@ -0,0 +1,44 @@
/*
* 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/AttachDbfsResult.h>
#include <json/json.h>
using namespace AlibabaCloud::DBFS;
using namespace AlibabaCloud::DBFS::Model;
AttachDbfsResult::AttachDbfsResult() :
ServiceResult()
{}
AttachDbfsResult::AttachDbfsResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
AttachDbfsResult::~AttachDbfsResult()
{}
void AttachDbfsResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
}

View File

@@ -0,0 +1,95 @@
/*
* 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/CreateDbfsRequest.h>
using AlibabaCloud::DBFS::Model::CreateDbfsRequest;
CreateDbfsRequest::CreateDbfsRequest() :
RpcServiceRequest("dbfs", "2020-02-19", "CreateDbfs")
{
setMethod(HttpRequest::Method::Post);
}
CreateDbfsRequest::~CreateDbfsRequest()
{}
int CreateDbfsRequest::getSizeG()const
{
return sizeG_;
}
void CreateDbfsRequest::setSizeG(int sizeG)
{
sizeG_ = sizeG;
setParameter("SizeG", std::to_string(sizeG));
}
std::string CreateDbfsRequest::getClientToken()const
{
return clientToken_;
}
void CreateDbfsRequest::setClientToken(const std::string& clientToken)
{
clientToken_ = clientToken;
setParameter("ClientToken", clientToken);
}
std::string CreateDbfsRequest::getFsName()const
{
return fsName_;
}
void CreateDbfsRequest::setFsName(const std::string& fsName)
{
fsName_ = fsName;
setParameter("FsName", fsName);
}
std::string CreateDbfsRequest::getRegionId()const
{
return regionId_;
}
void CreateDbfsRequest::setRegionId(const std::string& regionId)
{
regionId_ = regionId;
setParameter("RegionId", regionId);
}
std::string CreateDbfsRequest::getZoneId()const
{
return zoneId_;
}
void CreateDbfsRequest::setZoneId(const std::string& zoneId)
{
zoneId_ = zoneId;
setParameter("ZoneId", zoneId);
}
std::string CreateDbfsRequest::getCategory()const
{
return category_;
}
void CreateDbfsRequest::setCategory(const std::string& category)
{
category_ = category;
setParameter("Category", category);
}

View File

@@ -0,0 +1,51 @@
/*
* 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/CreateDbfsResult.h>
#include <json/json.h>
using namespace AlibabaCloud::DBFS;
using namespace AlibabaCloud::DBFS::Model;
CreateDbfsResult::CreateDbfsResult() :
ServiceResult()
{}
CreateDbfsResult::CreateDbfsResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
CreateDbfsResult::~CreateDbfsResult()
{}
void CreateDbfsResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["FsId"].isNull())
fsId_ = value["FsId"].asString();
}
std::string CreateDbfsResult::getFsId()const
{
return fsId_;
}

View File

@@ -0,0 +1,51 @@
/*
* 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/DeleteDbfsRequest.h>
using AlibabaCloud::DBFS::Model::DeleteDbfsRequest;
DeleteDbfsRequest::DeleteDbfsRequest() :
RpcServiceRequest("dbfs", "2020-02-19", "DeleteDbfs")
{
setMethod(HttpRequest::Method::Post);
}
DeleteDbfsRequest::~DeleteDbfsRequest()
{}
std::string DeleteDbfsRequest::getRegionId()const
{
return regionId_;
}
void DeleteDbfsRequest::setRegionId(const std::string& regionId)
{
regionId_ = regionId;
setParameter("RegionId", regionId);
}
std::string DeleteDbfsRequest::getFsId()const
{
return fsId_;
}
void DeleteDbfsRequest::setFsId(const std::string& fsId)
{
fsId_ = fsId;
setParameter("FsId", fsId);
}

View File

@@ -0,0 +1,44 @@
/*
* 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/DeleteDbfsResult.h>
#include <json/json.h>
using namespace AlibabaCloud::DBFS;
using namespace AlibabaCloud::DBFS::Model;
DeleteDbfsResult::DeleteDbfsResult() :
ServiceResult()
{}
DeleteDbfsResult::DeleteDbfsResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DeleteDbfsResult::~DeleteDbfsResult()
{}
void DeleteDbfsResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
}

View 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/DetachDbfsRequest.h>
using AlibabaCloud::DBFS::Model::DetachDbfsRequest;
DetachDbfsRequest::DetachDbfsRequest() :
RpcServiceRequest("dbfs", "2020-02-19", "DetachDbfs")
{
setMethod(HttpRequest::Method::Post);
}
DetachDbfsRequest::~DetachDbfsRequest()
{}
std::string DetachDbfsRequest::getECSInstanceId()const
{
return eCSInstanceId_;
}
void DetachDbfsRequest::setECSInstanceId(const std::string& eCSInstanceId)
{
eCSInstanceId_ = eCSInstanceId;
setParameter("ECSInstanceId", eCSInstanceId);
}
std::string DetachDbfsRequest::getRegionId()const
{
return regionId_;
}
void DetachDbfsRequest::setRegionId(const std::string& regionId)
{
regionId_ = regionId;
setParameter("RegionId", regionId);
}
std::string DetachDbfsRequest::getFsId()const
{
return fsId_;
}
void DetachDbfsRequest::setFsId(const std::string& fsId)
{
fsId_ = fsId;
setParameter("FsId", fsId);
}

View File

@@ -0,0 +1,44 @@
/*
* 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/DetachDbfsResult.h>
#include <json/json.h>
using namespace AlibabaCloud::DBFS;
using namespace AlibabaCloud::DBFS::Model;
DetachDbfsResult::DetachDbfsResult() :
ServiceResult()
{}
DetachDbfsResult::DetachDbfsResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DetachDbfsResult::~DetachDbfsResult()
{}
void DetachDbfsResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
}

View File

@@ -0,0 +1,51 @@
/*
* 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/GetDbfsRequest.h>
using AlibabaCloud::DBFS::Model::GetDbfsRequest;
GetDbfsRequest::GetDbfsRequest() :
RpcServiceRequest("dbfs", "2020-02-19", "GetDbfs")
{
setMethod(HttpRequest::Method::Get);
}
GetDbfsRequest::~GetDbfsRequest()
{}
std::string GetDbfsRequest::getRegionId()const
{
return regionId_;
}
void GetDbfsRequest::setRegionId(const std::string& regionId)
{
regionId_ = regionId;
setParameter("RegionId", regionId);
}
std::string GetDbfsRequest::getFsId()const
{
return fsId_;
}
void GetDbfsRequest::setFsId(const std::string& fsId)
{
fsId_ = fsId;
setParameter("FsId", fsId);
}

View File

@@ -0,0 +1,75 @@
/*
* 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/GetDbfsResult.h>
#include <json/json.h>
using namespace AlibabaCloud::DBFS;
using namespace AlibabaCloud::DBFS::Model;
GetDbfsResult::GetDbfsResult() :
ServiceResult()
{}
GetDbfsResult::GetDbfsResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GetDbfsResult::~GetDbfsResult()
{}
void GetDbfsResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allDBFSInfoNode = value["DBFSInfo"]["Info"];
for (auto valueDBFSInfoInfo : allDBFSInfoNode)
{
Info dBFSInfoObject;
if(!valueDBFSInfoInfo["FsName"].isNull())
dBFSInfoObject.fsName = valueDBFSInfoInfo["FsName"].asString();
if(!valueDBFSInfoInfo["DBFSClusterId"].isNull())
dBFSInfoObject.dBFSClusterId = valueDBFSInfoInfo["DBFSClusterId"].asString();
if(!valueDBFSInfoInfo["Category"].isNull())
dBFSInfoObject.category = valueDBFSInfoInfo["Category"].asString();
if(!valueDBFSInfoInfo["Status"].isNull())
dBFSInfoObject.status = valueDBFSInfoInfo["Status"].asString();
if(!valueDBFSInfoInfo["RegionId"].isNull())
dBFSInfoObject.regionId = valueDBFSInfoInfo["RegionId"].asString();
if(!valueDBFSInfoInfo["ZoneId"].isNull())
dBFSInfoObject.zoneId = valueDBFSInfoInfo["ZoneId"].asString();
if(!valueDBFSInfoInfo["AttachNodeNumber"].isNull())
dBFSInfoObject.attachNodeNumber = std::stoi(valueDBFSInfoInfo["AttachNodeNumber"].asString());
if(!valueDBFSInfoInfo["PayType"].isNull())
dBFSInfoObject.payType = valueDBFSInfoInfo["PayType"].asString();
if(!valueDBFSInfoInfo["FsId"].isNull())
dBFSInfoObject.fsId = valueDBFSInfoInfo["FsId"].asString();
if(!valueDBFSInfoInfo["SizeG"].isNull())
dBFSInfoObject.sizeG = std::stoi(valueDBFSInfoInfo["SizeG"].asString());
dBFSInfo_.push_back(dBFSInfoObject);
}
}
std::vector<GetDbfsResult::Info> GetDbfsResult::getDBFSInfo()const
{
return dBFSInfo_;
}

View File

@@ -0,0 +1,40 @@
/*
* 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/ListDbfsRequest.h>
using AlibabaCloud::DBFS::Model::ListDbfsRequest;
ListDbfsRequest::ListDbfsRequest() :
RpcServiceRequest("dbfs", "2020-02-19", "ListDbfs")
{
setMethod(HttpRequest::Method::Post);
}
ListDbfsRequest::~ListDbfsRequest()
{}
std::string ListDbfsRequest::getRegionId()const
{
return regionId_;
}
void ListDbfsRequest::setRegionId(const std::string& regionId)
{
regionId_ = regionId;
setParameter("RegionId", regionId);
}

View File

@@ -0,0 +1,96 @@
/*
* 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/ListDbfsResult.h>
#include <json/json.h>
using namespace AlibabaCloud::DBFS;
using namespace AlibabaCloud::DBFS::Model;
ListDbfsResult::ListDbfsResult() :
ServiceResult()
{}
ListDbfsResult::ListDbfsResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ListDbfsResult::~ListDbfsResult()
{}
void ListDbfsResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allDBFSInfoNode = value["DBFSInfo"]["Info"];
for (auto valueDBFSInfoInfo : allDBFSInfoNode)
{
Info dBFSInfoObject;
if(!valueDBFSInfoInfo["FsName"].isNull())
dBFSInfoObject.fsName = valueDBFSInfoInfo["FsName"].asString();
if(!valueDBFSInfoInfo["DBFSClusterId"].isNull())
dBFSInfoObject.dBFSClusterId = valueDBFSInfoInfo["DBFSClusterId"].asString();
if(!valueDBFSInfoInfo["Category"].isNull())
dBFSInfoObject.category = valueDBFSInfoInfo["Category"].asString();
if(!valueDBFSInfoInfo["Status"].isNull())
dBFSInfoObject.status = valueDBFSInfoInfo["Status"].asString();
if(!valueDBFSInfoInfo["RegionId"].isNull())
dBFSInfoObject.regionId = valueDBFSInfoInfo["RegionId"].asString();
if(!valueDBFSInfoInfo["ZoneId"].isNull())
dBFSInfoObject.zoneId = valueDBFSInfoInfo["ZoneId"].asString();
if(!valueDBFSInfoInfo["AttachNodeNumber"].isNull())
dBFSInfoObject.attachNodeNumber = std::stoi(valueDBFSInfoInfo["AttachNodeNumber"].asString());
if(!valueDBFSInfoInfo["PayType"].isNull())
dBFSInfoObject.payType = valueDBFSInfoInfo["PayType"].asString();
if(!valueDBFSInfoInfo["FsId"].isNull())
dBFSInfoObject.fsId = valueDBFSInfoInfo["FsId"].asString();
if(!valueDBFSInfoInfo["SizeG"].isNull())
dBFSInfoObject.sizeG = std::stoi(valueDBFSInfoInfo["SizeG"].asString());
dBFSInfo_.push_back(dBFSInfoObject);
}
if(!value["TotalCount"].isNull())
totalCount_ = std::stoi(value["TotalCount"].asString());
if(!value["PageNumber"].isNull())
pageNumber_ = std::stoi(value["PageNumber"].asString());
if(!value["PageSize"].isNull())
pageSize_ = std::stoi(value["PageSize"].asString());
}
int ListDbfsResult::getTotalCount()const
{
return totalCount_;
}
int ListDbfsResult::getPageSize()const
{
return pageSize_;
}
int ListDbfsResult::getPageNumber()const
{
return pageNumber_;
}
std::vector<ListDbfsResult::Info> ListDbfsResult::getDBFSInfo()const
{
return dBFSInfo_;
}

View File

@@ -0,0 +1,73 @@
/*
* 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/ResizeDbfsRequest.h>
using AlibabaCloud::DBFS::Model::ResizeDbfsRequest;
ResizeDbfsRequest::ResizeDbfsRequest() :
RpcServiceRequest("dbfs", "2020-02-19", "ResizeDbfs")
{
setMethod(HttpRequest::Method::Post);
}
ResizeDbfsRequest::~ResizeDbfsRequest()
{}
std::string ResizeDbfsRequest::getClientToken()const
{
return clientToken_;
}
void ResizeDbfsRequest::setClientToken(const std::string& clientToken)
{
clientToken_ = clientToken;
setParameter("ClientToken", clientToken);
}
int ResizeDbfsRequest::getNewSizeG()const
{
return newSizeG_;
}
void ResizeDbfsRequest::setNewSizeG(int newSizeG)
{
newSizeG_ = newSizeG;
setParameter("NewSizeG", std::to_string(newSizeG));
}
std::string ResizeDbfsRequest::getRegionId()const
{
return regionId_;
}
void ResizeDbfsRequest::setRegionId(const std::string& regionId)
{
regionId_ = regionId;
setParameter("RegionId", regionId);
}
std::string ResizeDbfsRequest::getFsId()const
{
return fsId_;
}
void ResizeDbfsRequest::setFsId(const std::string& fsId)
{
fsId_ = fsId;
setParameter("FsId", fsId);
}

View File

@@ -0,0 +1,44 @@
/*
* 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/ResizeDbfsResult.h>
#include <json/json.h>
using namespace AlibabaCloud::DBFS;
using namespace AlibabaCloud::DBFS::Model;
ResizeDbfsResult::ResizeDbfsResult() :
ServiceResult()
{}
ResizeDbfsResult::ResizeDbfsResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ResizeDbfsResult::~ResizeDbfsResult()
{}
void ResizeDbfsResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
}