From bfffa0a645067d5238611567914c20c3b495393b Mon Sep 17 00:00:00 2001 From: sdk-team Date: Sun, 29 Jan 2023 03:04:35 +0000 Subject: [PATCH] Update autoSnapshotPolicy. --- VERSION | 2 +- dbfs/CMakeLists.txt | 8 ++ dbfs/include/alibabacloud/dbfs/DBFSClient.h | 16 +++ .../dbfs/model/GetSnapshotLinkRequest.h | 45 +++++++++ .../dbfs/model/GetSnapshotLinkResult.h | 67 +++++++++++++ .../ListAutoSnapshotPolicyAppliedDbfsResult.h | 4 +- ...istAutoSnapshotPolicyUnappliedDbfsResult.h | 2 +- .../dbfs/model/ListSnapshotLinksRequest.h | 54 ++++++++++ .../dbfs/model/ListSnapshotLinksResult.h | 72 ++++++++++++++ dbfs/src/DBFSClient.cc | 78 ++++++++++++++- dbfs/src/model/GetSnapshotLinkRequest.cc | 45 +++++++++ dbfs/src/model/GetSnapshotLinkResult.cc | 74 ++++++++++++++ ...ListAutoSnapshotPolicyAppliedDbfsResult.cc | 4 +- ...stAutoSnapshotPolicyUnappliedDbfsResult.cc | 2 +- dbfs/src/model/ListSnapshotLinksRequest.cc | 72 ++++++++++++++ dbfs/src/model/ListSnapshotLinksResult.cc | 98 +++++++++++++++++++ 16 files changed, 633 insertions(+), 10 deletions(-) create mode 100644 dbfs/include/alibabacloud/dbfs/model/GetSnapshotLinkRequest.h create mode 100644 dbfs/include/alibabacloud/dbfs/model/GetSnapshotLinkResult.h create mode 100644 dbfs/include/alibabacloud/dbfs/model/ListSnapshotLinksRequest.h create mode 100644 dbfs/include/alibabacloud/dbfs/model/ListSnapshotLinksResult.h create mode 100644 dbfs/src/model/GetSnapshotLinkRequest.cc create mode 100644 dbfs/src/model/GetSnapshotLinkResult.cc create mode 100644 dbfs/src/model/ListSnapshotLinksRequest.cc create mode 100644 dbfs/src/model/ListSnapshotLinksResult.cc diff --git a/VERSION b/VERSION index 1c13e689a..9662b9b1e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.1426 \ No newline at end of file +1.36.1427 \ No newline at end of file diff --git a/dbfs/CMakeLists.txt b/dbfs/CMakeLists.txt index 4b953fc88..5e1df0a22 100644 --- a/dbfs/CMakeLists.txt +++ b/dbfs/CMakeLists.txt @@ -57,6 +57,8 @@ set(dbfs_public_header_model include/alibabacloud/dbfs/model/GetDbfsResult.h include/alibabacloud/dbfs/model/GetServiceLinkedRoleRequest.h include/alibabacloud/dbfs/model/GetServiceLinkedRoleResult.h + include/alibabacloud/dbfs/model/GetSnapshotLinkRequest.h + include/alibabacloud/dbfs/model/GetSnapshotLinkResult.h include/alibabacloud/dbfs/model/ListAutoSnapshotPoliciesRequest.h include/alibabacloud/dbfs/model/ListAutoSnapshotPoliciesResult.h include/alibabacloud/dbfs/model/ListAutoSnapshotPolicyAppliedDbfsRequest.h @@ -71,6 +73,8 @@ set(dbfs_public_header_model include/alibabacloud/dbfs/model/ListDbfsAttachedEcsInstancesResult.h include/alibabacloud/dbfs/model/ListSnapshotRequest.h include/alibabacloud/dbfs/model/ListSnapshotResult.h + include/alibabacloud/dbfs/model/ListSnapshotLinksRequest.h + include/alibabacloud/dbfs/model/ListSnapshotLinksResult.h include/alibabacloud/dbfs/model/ListTagKeysRequest.h include/alibabacloud/dbfs/model/ListTagKeysResult.h include/alibabacloud/dbfs/model/ListTagValuesRequest.h @@ -126,6 +130,8 @@ set(dbfs_src src/model/GetDbfsResult.cc src/model/GetServiceLinkedRoleRequest.cc src/model/GetServiceLinkedRoleResult.cc + src/model/GetSnapshotLinkRequest.cc + src/model/GetSnapshotLinkResult.cc src/model/ListAutoSnapshotPoliciesRequest.cc src/model/ListAutoSnapshotPoliciesResult.cc src/model/ListAutoSnapshotPolicyAppliedDbfsRequest.cc @@ -140,6 +146,8 @@ set(dbfs_src src/model/ListDbfsAttachedEcsInstancesResult.cc src/model/ListSnapshotRequest.cc src/model/ListSnapshotResult.cc + src/model/ListSnapshotLinksRequest.cc + src/model/ListSnapshotLinksResult.cc src/model/ListTagKeysRequest.cc src/model/ListTagKeysResult.cc src/model/ListTagValuesRequest.cc diff --git a/dbfs/include/alibabacloud/dbfs/DBFSClient.h b/dbfs/include/alibabacloud/dbfs/DBFSClient.h index 43fc5f5df..6c1148da1 100644 --- a/dbfs/include/alibabacloud/dbfs/DBFSClient.h +++ b/dbfs/include/alibabacloud/dbfs/DBFSClient.h @@ -58,6 +58,8 @@ #include "model/GetDbfsResult.h" #include "model/GetServiceLinkedRoleRequest.h" #include "model/GetServiceLinkedRoleResult.h" +#include "model/GetSnapshotLinkRequest.h" +#include "model/GetSnapshotLinkResult.h" #include "model/ListAutoSnapshotPoliciesRequest.h" #include "model/ListAutoSnapshotPoliciesResult.h" #include "model/ListAutoSnapshotPolicyAppliedDbfsRequest.h" @@ -72,6 +74,8 @@ #include "model/ListDbfsAttachedEcsInstancesResult.h" #include "model/ListSnapshotRequest.h" #include "model/ListSnapshotResult.h" +#include "model/ListSnapshotLinksRequest.h" +#include "model/ListSnapshotLinksResult.h" #include "model/ListTagKeysRequest.h" #include "model/ListTagKeysResult.h" #include "model/ListTagValuesRequest.h" @@ -151,6 +155,9 @@ namespace AlibabaCloud typedef Outcome GetServiceLinkedRoleOutcome; typedef std::future GetServiceLinkedRoleOutcomeCallable; typedef std::function&)> GetServiceLinkedRoleAsyncHandler; + typedef Outcome GetSnapshotLinkOutcome; + typedef std::future GetSnapshotLinkOutcomeCallable; + typedef std::function&)> GetSnapshotLinkAsyncHandler; typedef Outcome ListAutoSnapshotPoliciesOutcome; typedef std::future ListAutoSnapshotPoliciesOutcomeCallable; typedef std::function&)> ListAutoSnapshotPoliciesAsyncHandler; @@ -172,6 +179,9 @@ namespace AlibabaCloud typedef Outcome ListSnapshotOutcome; typedef std::future ListSnapshotOutcomeCallable; typedef std::function&)> ListSnapshotAsyncHandler; + typedef Outcome ListSnapshotLinksOutcome; + typedef std::future ListSnapshotLinksOutcomeCallable; + typedef std::function&)> ListSnapshotLinksAsyncHandler; typedef Outcome ListTagKeysOutcome; typedef std::future ListTagKeysOutcomeCallable; typedef std::function&)> ListTagKeysAsyncHandler; @@ -255,6 +265,9 @@ namespace AlibabaCloud GetServiceLinkedRoleOutcome getServiceLinkedRole(const Model::GetServiceLinkedRoleRequest &request)const; void getServiceLinkedRoleAsync(const Model::GetServiceLinkedRoleRequest& request, const GetServiceLinkedRoleAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetServiceLinkedRoleOutcomeCallable getServiceLinkedRoleCallable(const Model::GetServiceLinkedRoleRequest& request) const; + GetSnapshotLinkOutcome getSnapshotLink(const Model::GetSnapshotLinkRequest &request)const; + void getSnapshotLinkAsync(const Model::GetSnapshotLinkRequest& request, const GetSnapshotLinkAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetSnapshotLinkOutcomeCallable getSnapshotLinkCallable(const Model::GetSnapshotLinkRequest& request) const; ListAutoSnapshotPoliciesOutcome listAutoSnapshotPolicies(const Model::ListAutoSnapshotPoliciesRequest &request)const; void listAutoSnapshotPoliciesAsync(const Model::ListAutoSnapshotPoliciesRequest& request, const ListAutoSnapshotPoliciesAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListAutoSnapshotPoliciesOutcomeCallable listAutoSnapshotPoliciesCallable(const Model::ListAutoSnapshotPoliciesRequest& request) const; @@ -276,6 +289,9 @@ namespace AlibabaCloud ListSnapshotOutcome listSnapshot(const Model::ListSnapshotRequest &request)const; void listSnapshotAsync(const Model::ListSnapshotRequest& request, const ListSnapshotAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListSnapshotOutcomeCallable listSnapshotCallable(const Model::ListSnapshotRequest& request) const; + ListSnapshotLinksOutcome listSnapshotLinks(const Model::ListSnapshotLinksRequest &request)const; + void listSnapshotLinksAsync(const Model::ListSnapshotLinksRequest& request, const ListSnapshotLinksAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ListSnapshotLinksOutcomeCallable listSnapshotLinksCallable(const Model::ListSnapshotLinksRequest& request) const; ListTagKeysOutcome listTagKeys(const Model::ListTagKeysRequest &request)const; void listTagKeysAsync(const Model::ListTagKeysRequest& request, const ListTagKeysAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListTagKeysOutcomeCallable listTagKeysCallable(const Model::ListTagKeysRequest& request) const; diff --git a/dbfs/include/alibabacloud/dbfs/model/GetSnapshotLinkRequest.h b/dbfs/include/alibabacloud/dbfs/model/GetSnapshotLinkRequest.h new file mode 100644 index 000000000..0eba3709f --- /dev/null +++ b/dbfs/include/alibabacloud/dbfs/model/GetSnapshotLinkRequest.h @@ -0,0 +1,45 @@ +/* + * 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_GETSNAPSHOTLINKREQUEST_H_ +#define ALIBABACLOUD_DBFS_MODEL_GETSNAPSHOTLINKREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace DBFS { +namespace Model { +class ALIBABACLOUD_DBFS_EXPORT GetSnapshotLinkRequest : public RpcServiceRequest { +public: + GetSnapshotLinkRequest(); + ~GetSnapshotLinkRequest(); + std::string getLinkId() const; + void setLinkId(const std::string &linkId); + std::string getRegionId() const; + void setRegionId(const std::string ®ionId); + +private: + std::string linkId_; + std::string regionId_; +}; +} // namespace Model +} // namespace DBFS +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_DBFS_MODEL_GETSNAPSHOTLINKREQUEST_H_ diff --git a/dbfs/include/alibabacloud/dbfs/model/GetSnapshotLinkResult.h b/dbfs/include/alibabacloud/dbfs/model/GetSnapshotLinkResult.h new file mode 100644 index 000000000..2c0ee0777 --- /dev/null +++ b/dbfs/include/alibabacloud/dbfs/model/GetSnapshotLinkResult.h @@ -0,0 +1,67 @@ +/* + * 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_GETSNAPSHOTLINKRESULT_H_ +#define ALIBABACLOUD_DBFS_MODEL_GETSNAPSHOTLINKRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace DBFS + { + namespace Model + { + class ALIBABACLOUD_DBFS_EXPORT GetSnapshotLinkResult : public ServiceResult + { + public: + struct Data + { + struct EcsListItem + { + std::string ecsId; + }; + std::string status; + int snapshotCount; + std::string category; + std::string fsName; + std::vector ecsList; + std::string fsId; + long totalSize; + int sourceSize; + std::string linkId; + }; + + + GetSnapshotLinkResult(); + explicit GetSnapshotLinkResult(const std::string &payload); + ~GetSnapshotLinkResult(); + Data getData()const; + + protected: + void parse(const std::string &payload); + private: + Data data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_DBFS_MODEL_GETSNAPSHOTLINKRESULT_H_ \ No newline at end of file diff --git a/dbfs/include/alibabacloud/dbfs/model/ListAutoSnapshotPolicyAppliedDbfsResult.h b/dbfs/include/alibabacloud/dbfs/model/ListAutoSnapshotPolicyAppliedDbfsResult.h index 76f6cc61e..369ca21b4 100644 --- a/dbfs/include/alibabacloud/dbfs/model/ListAutoSnapshotPolicyAppliedDbfsResult.h +++ b/dbfs/include/alibabacloud/dbfs/model/ListAutoSnapshotPolicyAppliedDbfsResult.h @@ -35,12 +35,12 @@ namespace AlibabaCloud struct DbfsListItem { std::string status; - std::string snapshotCount; + int snapshotCount; std::string fsName; long sizeG; std::string fsId; std::string regionId; - std::string totalSize; + long totalSize; }; diff --git a/dbfs/include/alibabacloud/dbfs/model/ListAutoSnapshotPolicyUnappliedDbfsResult.h b/dbfs/include/alibabacloud/dbfs/model/ListAutoSnapshotPolicyUnappliedDbfsResult.h index 28a693dab..344481edb 100644 --- a/dbfs/include/alibabacloud/dbfs/model/ListAutoSnapshotPolicyUnappliedDbfsResult.h +++ b/dbfs/include/alibabacloud/dbfs/model/ListAutoSnapshotPolicyUnappliedDbfsResult.h @@ -35,7 +35,7 @@ namespace AlibabaCloud struct DbfsListItem { std::string status; - std::string snapshotCount; + int snapshotCount; std::string fsName; long sizeG; std::string fsId; diff --git a/dbfs/include/alibabacloud/dbfs/model/ListSnapshotLinksRequest.h b/dbfs/include/alibabacloud/dbfs/model/ListSnapshotLinksRequest.h new file mode 100644 index 000000000..cf8cbde80 --- /dev/null +++ b/dbfs/include/alibabacloud/dbfs/model/ListSnapshotLinksRequest.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_LISTSNAPSHOTLINKSREQUEST_H_ +#define ALIBABACLOUD_DBFS_MODEL_LISTSNAPSHOTLINKSREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace DBFS { +namespace Model { +class ALIBABACLOUD_DBFS_EXPORT ListSnapshotLinksRequest : public RpcServiceRequest { +public: + ListSnapshotLinksRequest(); + ~ListSnapshotLinksRequest(); + std::string getFilterValue() const; + void setFilterValue(const std::string &filterValue); + int getPageNumber() const; + void setPageNumber(int pageNumber); + std::string getFilterKey() const; + void setFilterKey(const std::string &filterKey); + std::string getRegionId() const; + void setRegionId(const std::string ®ionId); + int getPageSize() const; + void setPageSize(int pageSize); + +private: + std::string filterValue_; + int pageNumber_; + std::string filterKey_; + std::string regionId_; + int pageSize_; +}; +} // namespace Model +} // namespace DBFS +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_DBFS_MODEL_LISTSNAPSHOTLINKSREQUEST_H_ diff --git a/dbfs/include/alibabacloud/dbfs/model/ListSnapshotLinksResult.h b/dbfs/include/alibabacloud/dbfs/model/ListSnapshotLinksResult.h new file mode 100644 index 000000000..cdb60f14b --- /dev/null +++ b/dbfs/include/alibabacloud/dbfs/model/ListSnapshotLinksResult.h @@ -0,0 +1,72 @@ +/* + * 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_LISTSNAPSHOTLINKSRESULT_H_ +#define ALIBABACLOUD_DBFS_MODEL_LISTSNAPSHOTLINKSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace DBFS + { + namespace Model + { + class ALIBABACLOUD_DBFS_EXPORT ListSnapshotLinksResult : public ServiceResult + { + public: + struct Info + { + struct EcsListItem + { + std::string ecsId; + }; + std::string status; + int snapshotCount; + std::string fsName; + std::vector ecsList; + std::string fsId; + long totalSize; + int sourceSize; + std::string linkId; + }; + + + ListSnapshotLinksResult(); + explicit ListSnapshotLinksResult(const std::string &payload); + ~ListSnapshotLinksResult(); + std::vector getSnapshotLinks()const; + int getTotalCount()const; + int getPageSize()const; + int getPageNumber()const; + + protected: + void parse(const std::string &payload); + private: + std::vector snapshotLinks_; + int totalCount_; + int pageSize_; + int pageNumber_; + + }; + } + } +} +#endif // !ALIBABACLOUD_DBFS_MODEL_LISTSNAPSHOTLINKSRESULT_H_ \ No newline at end of file diff --git a/dbfs/src/DBFSClient.cc b/dbfs/src/DBFSClient.cc index 59502e92a..2ff297896 100644 --- a/dbfs/src/DBFSClient.cc +++ b/dbfs/src/DBFSClient.cc @@ -31,21 +31,21 @@ DBFSClient::DBFSClient(const Credentials &credentials, const ClientConfiguration RpcServiceClient(SERVICE_NAME, std::make_shared(credentials), configuration) { auto locationClient = std::make_shared(credentials, configuration); - endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "dbfs"); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); } DBFSClient::DBFSClient(const std::shared_ptr& credentialsProvider, const ClientConfiguration & configuration) : RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration) { auto locationClient = std::make_shared(credentialsProvider, configuration); - endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "dbfs"); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); } DBFSClient::DBFSClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) : RpcServiceClient(SERVICE_NAME, std::make_shared(accessKeyId, accessKeySecret), configuration) { auto locationClient = std::make_shared(accessKeyId, accessKeySecret, configuration); - endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "dbfs"); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); } DBFSClient::~DBFSClient() @@ -699,6 +699,42 @@ DBFSClient::GetServiceLinkedRoleOutcomeCallable DBFSClient::getServiceLinkedRole return task->get_future(); } +DBFSClient::GetSnapshotLinkOutcome DBFSClient::getSnapshotLink(const GetSnapshotLinkRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetSnapshotLinkOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetSnapshotLinkOutcome(GetSnapshotLinkResult(outcome.result())); + else + return GetSnapshotLinkOutcome(outcome.error()); +} + +void DBFSClient::getSnapshotLinkAsync(const GetSnapshotLinkRequest& request, const GetSnapshotLinkAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getSnapshotLink(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +DBFSClient::GetSnapshotLinkOutcomeCallable DBFSClient::getSnapshotLinkCallable(const GetSnapshotLinkRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getSnapshotLink(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + DBFSClient::ListAutoSnapshotPoliciesOutcome DBFSClient::listAutoSnapshotPolicies(const ListAutoSnapshotPoliciesRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -951,6 +987,42 @@ DBFSClient::ListSnapshotOutcomeCallable DBFSClient::listSnapshotCallable(const L return task->get_future(); } +DBFSClient::ListSnapshotLinksOutcome DBFSClient::listSnapshotLinks(const ListSnapshotLinksRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ListSnapshotLinksOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ListSnapshotLinksOutcome(ListSnapshotLinksResult(outcome.result())); + else + return ListSnapshotLinksOutcome(outcome.error()); +} + +void DBFSClient::listSnapshotLinksAsync(const ListSnapshotLinksRequest& request, const ListSnapshotLinksAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, listSnapshotLinks(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +DBFSClient::ListSnapshotLinksOutcomeCallable DBFSClient::listSnapshotLinksCallable(const ListSnapshotLinksRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->listSnapshotLinks(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + DBFSClient::ListTagKeysOutcome DBFSClient::listTagKeys(const ListTagKeysRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/dbfs/src/model/GetSnapshotLinkRequest.cc b/dbfs/src/model/GetSnapshotLinkRequest.cc new file mode 100644 index 000000000..e5b743477 --- /dev/null +++ b/dbfs/src/model/GetSnapshotLinkRequest.cc @@ -0,0 +1,45 @@ +/* + * 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::GetSnapshotLinkRequest; + +GetSnapshotLinkRequest::GetSnapshotLinkRequest() + : RpcServiceRequest("dbfs", "2020-04-18", "GetSnapshotLink") { + setMethod(HttpRequest::Method::Get); +} + +GetSnapshotLinkRequest::~GetSnapshotLinkRequest() {} + +std::string GetSnapshotLinkRequest::getLinkId() const { + return linkId_; +} + +void GetSnapshotLinkRequest::setLinkId(const std::string &linkId) { + linkId_ = linkId; + setParameter(std::string("LinkId"), linkId); +} + +std::string GetSnapshotLinkRequest::getRegionId() const { + return regionId_; +} + +void GetSnapshotLinkRequest::setRegionId(const std::string ®ionId) { + regionId_ = regionId; + setParameter(std::string("RegionId"), regionId); +} + diff --git a/dbfs/src/model/GetSnapshotLinkResult.cc b/dbfs/src/model/GetSnapshotLinkResult.cc new file mode 100644 index 000000000..a2dddeee0 --- /dev/null +++ b/dbfs/src/model/GetSnapshotLinkResult.cc @@ -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. + */ + +#include +#include + +using namespace AlibabaCloud::DBFS; +using namespace AlibabaCloud::DBFS::Model; + +GetSnapshotLinkResult::GetSnapshotLinkResult() : + ServiceResult() +{} + +GetSnapshotLinkResult::GetSnapshotLinkResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetSnapshotLinkResult::~GetSnapshotLinkResult() +{} + +void GetSnapshotLinkResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto dataNode = value["Data"]; + if(!dataNode["Status"].isNull()) + data_.status = dataNode["Status"].asString(); + if(!dataNode["TotalSize"].isNull()) + data_.totalSize = std::stol(dataNode["TotalSize"].asString()); + if(!dataNode["SourceSize"].isNull()) + data_.sourceSize = std::stoi(dataNode["SourceSize"].asString()); + if(!dataNode["FsId"].isNull()) + data_.fsId = dataNode["FsId"].asString(); + if(!dataNode["SnapshotCount"].isNull()) + data_.snapshotCount = std::stoi(dataNode["SnapshotCount"].asString()); + if(!dataNode["FsName"].isNull()) + data_.fsName = dataNode["FsName"].asString(); + if(!dataNode["LinkId"].isNull()) + data_.linkId = dataNode["LinkId"].asString(); + if(!dataNode["Category"].isNull()) + data_.category = dataNode["Category"].asString(); + auto allEcsListNode = dataNode["EcsList"]["EcsListItem"]; + for (auto dataNodeEcsListEcsListItem : allEcsListNode) + { + Data::EcsListItem ecsListItemObject; + if(!dataNodeEcsListEcsListItem["EcsId"].isNull()) + ecsListItemObject.ecsId = dataNodeEcsListEcsListItem["EcsId"].asString(); + data_.ecsList.push_back(ecsListItemObject); + } + +} + +GetSnapshotLinkResult::Data GetSnapshotLinkResult::getData()const +{ + return data_; +} + diff --git a/dbfs/src/model/ListAutoSnapshotPolicyAppliedDbfsResult.cc b/dbfs/src/model/ListAutoSnapshotPolicyAppliedDbfsResult.cc index e3d053829..68e132d18 100644 --- a/dbfs/src/model/ListAutoSnapshotPolicyAppliedDbfsResult.cc +++ b/dbfs/src/model/ListAutoSnapshotPolicyAppliedDbfsResult.cc @@ -54,9 +54,9 @@ void ListAutoSnapshotPolicyAppliedDbfsResult::parse(const std::string &payload) if(!valueDbfsListDbfsListItem["RegionId"].isNull()) dbfsListObject.regionId = valueDbfsListDbfsListItem["RegionId"].asString(); if(!valueDbfsListDbfsListItem["SnapshotCount"].isNull()) - dbfsListObject.snapshotCount = valueDbfsListDbfsListItem["SnapshotCount"].asString(); + dbfsListObject.snapshotCount = std::stoi(valueDbfsListDbfsListItem["SnapshotCount"].asString()); if(!valueDbfsListDbfsListItem["TotalSize"].isNull()) - dbfsListObject.totalSize = valueDbfsListDbfsListItem["TotalSize"].asString(); + dbfsListObject.totalSize = std::stol(valueDbfsListDbfsListItem["TotalSize"].asString()); dbfsList_.push_back(dbfsListObject); } if(!value["PageNumber"].isNull()) diff --git a/dbfs/src/model/ListAutoSnapshotPolicyUnappliedDbfsResult.cc b/dbfs/src/model/ListAutoSnapshotPolicyUnappliedDbfsResult.cc index 1532b22a6..1bbf65afc 100644 --- a/dbfs/src/model/ListAutoSnapshotPolicyUnappliedDbfsResult.cc +++ b/dbfs/src/model/ListAutoSnapshotPolicyUnappliedDbfsResult.cc @@ -54,7 +54,7 @@ void ListAutoSnapshotPolicyUnappliedDbfsResult::parse(const std::string &payload if(!valueDbfsListDbfsListItem["RegionId"].isNull()) dbfsListObject.regionId = valueDbfsListDbfsListItem["RegionId"].asString(); if(!valueDbfsListDbfsListItem["SnapshotCount"].isNull()) - dbfsListObject.snapshotCount = valueDbfsListDbfsListItem["SnapshotCount"].asString(); + dbfsListObject.snapshotCount = std::stoi(valueDbfsListDbfsListItem["SnapshotCount"].asString()); if(!valueDbfsListDbfsListItem["TotalSize"].isNull()) dbfsListObject.totalSize = std::stol(valueDbfsListDbfsListItem["TotalSize"].asString()); dbfsList_.push_back(dbfsListObject); diff --git a/dbfs/src/model/ListSnapshotLinksRequest.cc b/dbfs/src/model/ListSnapshotLinksRequest.cc new file mode 100644 index 000000000..05c470df7 --- /dev/null +++ b/dbfs/src/model/ListSnapshotLinksRequest.cc @@ -0,0 +1,72 @@ +/* + * 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::ListSnapshotLinksRequest; + +ListSnapshotLinksRequest::ListSnapshotLinksRequest() + : RpcServiceRequest("dbfs", "2020-04-18", "ListSnapshotLinks") { + setMethod(HttpRequest::Method::Post); +} + +ListSnapshotLinksRequest::~ListSnapshotLinksRequest() {} + +std::string ListSnapshotLinksRequest::getFilterValue() const { + return filterValue_; +} + +void ListSnapshotLinksRequest::setFilterValue(const std::string &filterValue) { + filterValue_ = filterValue; + setParameter(std::string("FilterValue"), filterValue); +} + +int ListSnapshotLinksRequest::getPageNumber() const { + return pageNumber_; +} + +void ListSnapshotLinksRequest::setPageNumber(int pageNumber) { + pageNumber_ = pageNumber; + setParameter(std::string("PageNumber"), std::to_string(pageNumber)); +} + +std::string ListSnapshotLinksRequest::getFilterKey() const { + return filterKey_; +} + +void ListSnapshotLinksRequest::setFilterKey(const std::string &filterKey) { + filterKey_ = filterKey; + setParameter(std::string("FilterKey"), filterKey); +} + +std::string ListSnapshotLinksRequest::getRegionId() const { + return regionId_; +} + +void ListSnapshotLinksRequest::setRegionId(const std::string ®ionId) { + regionId_ = regionId; + setParameter(std::string("RegionId"), regionId); +} + +int ListSnapshotLinksRequest::getPageSize() const { + return pageSize_; +} + +void ListSnapshotLinksRequest::setPageSize(int pageSize) { + pageSize_ = pageSize; + setParameter(std::string("PageSize"), std::to_string(pageSize)); +} + diff --git a/dbfs/src/model/ListSnapshotLinksResult.cc b/dbfs/src/model/ListSnapshotLinksResult.cc new file mode 100644 index 000000000..1b2a573e9 --- /dev/null +++ b/dbfs/src/model/ListSnapshotLinksResult.cc @@ -0,0 +1,98 @@ +/* + * 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; + +ListSnapshotLinksResult::ListSnapshotLinksResult() : + ServiceResult() +{} + +ListSnapshotLinksResult::ListSnapshotLinksResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ListSnapshotLinksResult::~ListSnapshotLinksResult() +{} + +void ListSnapshotLinksResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto allSnapshotLinksNode = value["SnapshotLinks"]["Info"]; + for (auto valueSnapshotLinksInfo : allSnapshotLinksNode) + { + Info snapshotLinksObject; + if(!valueSnapshotLinksInfo["Status"].isNull()) + snapshotLinksObject.status = valueSnapshotLinksInfo["Status"].asString(); + if(!valueSnapshotLinksInfo["TotalSize"].isNull()) + snapshotLinksObject.totalSize = std::stol(valueSnapshotLinksInfo["TotalSize"].asString()); + if(!valueSnapshotLinksInfo["SourceSize"].isNull()) + snapshotLinksObject.sourceSize = std::stoi(valueSnapshotLinksInfo["SourceSize"].asString()); + if(!valueSnapshotLinksInfo["FsId"].isNull()) + snapshotLinksObject.fsId = valueSnapshotLinksInfo["FsId"].asString(); + if(!valueSnapshotLinksInfo["SnapshotCount"].isNull()) + snapshotLinksObject.snapshotCount = std::stoi(valueSnapshotLinksInfo["SnapshotCount"].asString()); + if(!valueSnapshotLinksInfo["FsName"].isNull()) + snapshotLinksObject.fsName = valueSnapshotLinksInfo["FsName"].asString(); + if(!valueSnapshotLinksInfo["LinkId"].isNull()) + snapshotLinksObject.linkId = valueSnapshotLinksInfo["LinkId"].asString(); + auto allEcsListNode = valueSnapshotLinksInfo["EcsList"]["EcsListItem"]; + for (auto valueSnapshotLinksInfoEcsListEcsListItem : allEcsListNode) + { + Info::EcsListItem ecsListObject; + if(!valueSnapshotLinksInfoEcsListEcsListItem["EcsId"].isNull()) + ecsListObject.ecsId = valueSnapshotLinksInfoEcsListEcsListItem["EcsId"].asString(); + snapshotLinksObject.ecsList.push_back(ecsListObject); + } + snapshotLinks_.push_back(snapshotLinksObject); + } + if(!value["TotalCount"].isNull()) + totalCount_ = std::stoi(value["TotalCount"].asString()); + if(!value["PageSize"].isNull()) + pageSize_ = std::stoi(value["PageSize"].asString()); + if(!value["PageNumber"].isNull()) + pageNumber_ = std::stoi(value["PageNumber"].asString()); + +} + +std::vector ListSnapshotLinksResult::getSnapshotLinks()const +{ + return snapshotLinks_; +} + +int ListSnapshotLinksResult::getTotalCount()const +{ + return totalCount_; +} + +int ListSnapshotLinksResult::getPageSize()const +{ + return pageSize_; +} + +int ListSnapshotLinksResult::getPageNumber()const +{ + return pageNumber_; +} +