From 1e31c73a54b52f9d9d84a95fbfe160cce4bb333d Mon Sep 17 00:00:00 2001 From: sdk-team Date: Thu, 15 Dec 2022 06:40:42 +0000 Subject: [PATCH] Supported delete snapshots. --- VERSION | 2 +- dbfs/CMakeLists.txt | 8 ++ dbfs/include/alibabacloud/dbfs/DBFSClient.h | 16 ++++ .../model/CancelAutoSnapshotPolicyRequest.h | 48 ++++++++++++ .../model/CancelAutoSnapshotPolicyResult.h | 49 ++++++++++++ .../model/CreateAutoSnapshotPolicyRequest.h | 54 +++++++++++++ .../model/CreateAutoSnapshotPolicyResult.h | 51 +++++++++++++ dbfs/src/DBFSClient.cc | 72 ++++++++++++++++++ .../model/CancelAutoSnapshotPolicyRequest.cc | 56 ++++++++++++++ .../model/CancelAutoSnapshotPolicyResult.cc | 44 +++++++++++ .../model/CreateAutoSnapshotPolicyRequest.cc | 76 +++++++++++++++++++ .../model/CreateAutoSnapshotPolicyResult.cc | 51 +++++++++++++ 12 files changed, 526 insertions(+), 1 deletion(-) create mode 100644 dbfs/include/alibabacloud/dbfs/model/CancelAutoSnapshotPolicyRequest.h create mode 100644 dbfs/include/alibabacloud/dbfs/model/CancelAutoSnapshotPolicyResult.h create mode 100644 dbfs/include/alibabacloud/dbfs/model/CreateAutoSnapshotPolicyRequest.h create mode 100644 dbfs/include/alibabacloud/dbfs/model/CreateAutoSnapshotPolicyResult.h create mode 100644 dbfs/src/model/CancelAutoSnapshotPolicyRequest.cc create mode 100644 dbfs/src/model/CancelAutoSnapshotPolicyResult.cc create mode 100644 dbfs/src/model/CreateAutoSnapshotPolicyRequest.cc create mode 100644 dbfs/src/model/CreateAutoSnapshotPolicyResult.cc diff --git a/VERSION b/VERSION index 05b87ce75..b8a5331ae 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.1390 \ No newline at end of file +1.36.1391 \ No newline at end of file diff --git a/dbfs/CMakeLists.txt b/dbfs/CMakeLists.txt index b52c1bd97..ff12742f3 100644 --- a/dbfs/CMakeLists.txt +++ b/dbfs/CMakeLists.txt @@ -25,6 +25,10 @@ set(dbfs_public_header_model include/alibabacloud/dbfs/model/AddTagsBatchResult.h include/alibabacloud/dbfs/model/AttachDbfsRequest.h include/alibabacloud/dbfs/model/AttachDbfsResult.h + include/alibabacloud/dbfs/model/CancelAutoSnapshotPolicyRequest.h + include/alibabacloud/dbfs/model/CancelAutoSnapshotPolicyResult.h + include/alibabacloud/dbfs/model/CreateAutoSnapshotPolicyRequest.h + include/alibabacloud/dbfs/model/CreateAutoSnapshotPolicyResult.h include/alibabacloud/dbfs/model/CreateDbfsRequest.h include/alibabacloud/dbfs/model/CreateDbfsResult.h include/alibabacloud/dbfs/model/CreateServiceLinkedRoleRequest.h @@ -74,6 +78,10 @@ set(dbfs_src src/model/AddTagsBatchResult.cc src/model/AttachDbfsRequest.cc src/model/AttachDbfsResult.cc + src/model/CancelAutoSnapshotPolicyRequest.cc + src/model/CancelAutoSnapshotPolicyResult.cc + src/model/CreateAutoSnapshotPolicyRequest.cc + src/model/CreateAutoSnapshotPolicyResult.cc src/model/CreateDbfsRequest.cc src/model/CreateDbfsResult.cc src/model/CreateServiceLinkedRoleRequest.cc diff --git a/dbfs/include/alibabacloud/dbfs/DBFSClient.h b/dbfs/include/alibabacloud/dbfs/DBFSClient.h index a83ad7345..9e0e70db2 100644 --- a/dbfs/include/alibabacloud/dbfs/DBFSClient.h +++ b/dbfs/include/alibabacloud/dbfs/DBFSClient.h @@ -26,6 +26,10 @@ #include "model/AddTagsBatchResult.h" #include "model/AttachDbfsRequest.h" #include "model/AttachDbfsResult.h" +#include "model/CancelAutoSnapshotPolicyRequest.h" +#include "model/CancelAutoSnapshotPolicyResult.h" +#include "model/CreateAutoSnapshotPolicyRequest.h" +#include "model/CreateAutoSnapshotPolicyResult.h" #include "model/CreateDbfsRequest.h" #include "model/CreateDbfsResult.h" #include "model/CreateServiceLinkedRoleRequest.h" @@ -83,6 +87,12 @@ namespace AlibabaCloud typedef Outcome AttachDbfsOutcome; typedef std::future AttachDbfsOutcomeCallable; typedef std::function&)> AttachDbfsAsyncHandler; + typedef Outcome CancelAutoSnapshotPolicyOutcome; + typedef std::future CancelAutoSnapshotPolicyOutcomeCallable; + typedef std::function&)> CancelAutoSnapshotPolicyAsyncHandler; + typedef Outcome CreateAutoSnapshotPolicyOutcome; + typedef std::future CreateAutoSnapshotPolicyOutcomeCallable; + typedef std::function&)> CreateAutoSnapshotPolicyAsyncHandler; typedef Outcome CreateDbfsOutcome; typedef std::future CreateDbfsOutcomeCallable; typedef std::function&)> CreateDbfsAsyncHandler; @@ -157,6 +167,12 @@ namespace AlibabaCloud AttachDbfsOutcome attachDbfs(const Model::AttachDbfsRequest &request)const; void attachDbfsAsync(const Model::AttachDbfsRequest& request, const AttachDbfsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; AttachDbfsOutcomeCallable attachDbfsCallable(const Model::AttachDbfsRequest& request) const; + CancelAutoSnapshotPolicyOutcome cancelAutoSnapshotPolicy(const Model::CancelAutoSnapshotPolicyRequest &request)const; + void cancelAutoSnapshotPolicyAsync(const Model::CancelAutoSnapshotPolicyRequest& request, const CancelAutoSnapshotPolicyAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + CancelAutoSnapshotPolicyOutcomeCallable cancelAutoSnapshotPolicyCallable(const Model::CancelAutoSnapshotPolicyRequest& request) const; + CreateAutoSnapshotPolicyOutcome createAutoSnapshotPolicy(const Model::CreateAutoSnapshotPolicyRequest &request)const; + void createAutoSnapshotPolicyAsync(const Model::CreateAutoSnapshotPolicyRequest& request, const CreateAutoSnapshotPolicyAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + CreateAutoSnapshotPolicyOutcomeCallable createAutoSnapshotPolicyCallable(const Model::CreateAutoSnapshotPolicyRequest& request) const; CreateDbfsOutcome createDbfs(const Model::CreateDbfsRequest &request)const; void createDbfsAsync(const Model::CreateDbfsRequest& request, const CreateDbfsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; CreateDbfsOutcomeCallable createDbfsCallable(const Model::CreateDbfsRequest& request) const; diff --git a/dbfs/include/alibabacloud/dbfs/model/CancelAutoSnapshotPolicyRequest.h b/dbfs/include/alibabacloud/dbfs/model/CancelAutoSnapshotPolicyRequest.h new file mode 100644 index 000000000..c2ab0eb27 --- /dev/null +++ b/dbfs/include/alibabacloud/dbfs/model/CancelAutoSnapshotPolicyRequest.h @@ -0,0 +1,48 @@ +/* + * 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_CANCELAUTOSNAPSHOTPOLICYREQUEST_H_ +#define ALIBABACLOUD_DBFS_MODEL_CANCELAUTOSNAPSHOTPOLICYREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace DBFS { +namespace Model { +class ALIBABACLOUD_DBFS_EXPORT CancelAutoSnapshotPolicyRequest : public RpcServiceRequest { +public: + CancelAutoSnapshotPolicyRequest(); + ~CancelAutoSnapshotPolicyRequest(); + std::vector getDbfsIds() const; + void setDbfsIds(const std::vector &dbfsIds); + std::string getPolicyId() const; + void setPolicyId(const std::string &policyId); + std::string getRegionId() const; + void setRegionId(const std::string ®ionId); + +private: + std::vector dbfsIds_; + std::string policyId_; + std::string regionId_; +}; +} // namespace Model +} // namespace DBFS +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_DBFS_MODEL_CANCELAUTOSNAPSHOTPOLICYREQUEST_H_ diff --git a/dbfs/include/alibabacloud/dbfs/model/CancelAutoSnapshotPolicyResult.h b/dbfs/include/alibabacloud/dbfs/model/CancelAutoSnapshotPolicyResult.h new file mode 100644 index 000000000..d2061efb0 --- /dev/null +++ b/dbfs/include/alibabacloud/dbfs/model/CancelAutoSnapshotPolicyResult.h @@ -0,0 +1,49 @@ +/* + * 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_CANCELAUTOSNAPSHOTPOLICYRESULT_H_ +#define ALIBABACLOUD_DBFS_MODEL_CANCELAUTOSNAPSHOTPOLICYRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace DBFS + { + namespace Model + { + class ALIBABACLOUD_DBFS_EXPORT CancelAutoSnapshotPolicyResult : public ServiceResult + { + public: + + + CancelAutoSnapshotPolicyResult(); + explicit CancelAutoSnapshotPolicyResult(const std::string &payload); + ~CancelAutoSnapshotPolicyResult(); + + protected: + void parse(const std::string &payload); + private: + + }; + } + } +} +#endif // !ALIBABACLOUD_DBFS_MODEL_CANCELAUTOSNAPSHOTPOLICYRESULT_H_ \ No newline at end of file diff --git a/dbfs/include/alibabacloud/dbfs/model/CreateAutoSnapshotPolicyRequest.h b/dbfs/include/alibabacloud/dbfs/model/CreateAutoSnapshotPolicyRequest.h new file mode 100644 index 000000000..d62dbf7e9 --- /dev/null +++ b/dbfs/include/alibabacloud/dbfs/model/CreateAutoSnapshotPolicyRequest.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_CREATEAUTOSNAPSHOTPOLICYREQUEST_H_ +#define ALIBABACLOUD_DBFS_MODEL_CREATEAUTOSNAPSHOTPOLICYREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace DBFS { +namespace Model { +class ALIBABACLOUD_DBFS_EXPORT CreateAutoSnapshotPolicyRequest : public RpcServiceRequest { +public: + CreateAutoSnapshotPolicyRequest(); + ~CreateAutoSnapshotPolicyRequest(); + std::vector getTimePoints() const; + void setTimePoints(const std::vector &timePoints); + std::vector getRepeatWeekdays() const; + void setRepeatWeekdays(const std::vector &repeatWeekdays); + std::string getRegionId() const; + void setRegionId(const std::string ®ionId); + std::string getPolicyName() const; + void setPolicyName(const std::string &policyName); + int getRetentionDays() const; + void setRetentionDays(int retentionDays); + +private: + std::vector timePoints_; + std::vector repeatWeekdays_; + std::string regionId_; + std::string policyName_; + int retentionDays_; +}; +} // namespace Model +} // namespace DBFS +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_DBFS_MODEL_CREATEAUTOSNAPSHOTPOLICYREQUEST_H_ diff --git a/dbfs/include/alibabacloud/dbfs/model/CreateAutoSnapshotPolicyResult.h b/dbfs/include/alibabacloud/dbfs/model/CreateAutoSnapshotPolicyResult.h new file mode 100644 index 000000000..e39ee4175 --- /dev/null +++ b/dbfs/include/alibabacloud/dbfs/model/CreateAutoSnapshotPolicyResult.h @@ -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. + */ + +#ifndef ALIBABACLOUD_DBFS_MODEL_CREATEAUTOSNAPSHOTPOLICYRESULT_H_ +#define ALIBABACLOUD_DBFS_MODEL_CREATEAUTOSNAPSHOTPOLICYRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace DBFS + { + namespace Model + { + class ALIBABACLOUD_DBFS_EXPORT CreateAutoSnapshotPolicyResult : public ServiceResult + { + public: + + + CreateAutoSnapshotPolicyResult(); + explicit CreateAutoSnapshotPolicyResult(const std::string &payload); + ~CreateAutoSnapshotPolicyResult(); + std::string getPolicyId()const; + + protected: + void parse(const std::string &payload); + private: + std::string policyId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_DBFS_MODEL_CREATEAUTOSNAPSHOTPOLICYRESULT_H_ \ No newline at end of file diff --git a/dbfs/src/DBFSClient.cc b/dbfs/src/DBFSClient.cc index ffe7afb3f..8a03e9406 100644 --- a/dbfs/src/DBFSClient.cc +++ b/dbfs/src/DBFSClient.cc @@ -123,6 +123,78 @@ DBFSClient::AttachDbfsOutcomeCallable DBFSClient::attachDbfsCallable(const Attac return task->get_future(); } +DBFSClient::CancelAutoSnapshotPolicyOutcome DBFSClient::cancelAutoSnapshotPolicy(const CancelAutoSnapshotPolicyRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return CancelAutoSnapshotPolicyOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return CancelAutoSnapshotPolicyOutcome(CancelAutoSnapshotPolicyResult(outcome.result())); + else + return CancelAutoSnapshotPolicyOutcome(outcome.error()); +} + +void DBFSClient::cancelAutoSnapshotPolicyAsync(const CancelAutoSnapshotPolicyRequest& request, const CancelAutoSnapshotPolicyAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, cancelAutoSnapshotPolicy(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +DBFSClient::CancelAutoSnapshotPolicyOutcomeCallable DBFSClient::cancelAutoSnapshotPolicyCallable(const CancelAutoSnapshotPolicyRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->cancelAutoSnapshotPolicy(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +DBFSClient::CreateAutoSnapshotPolicyOutcome DBFSClient::createAutoSnapshotPolicy(const CreateAutoSnapshotPolicyRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return CreateAutoSnapshotPolicyOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return CreateAutoSnapshotPolicyOutcome(CreateAutoSnapshotPolicyResult(outcome.result())); + else + return CreateAutoSnapshotPolicyOutcome(outcome.error()); +} + +void DBFSClient::createAutoSnapshotPolicyAsync(const CreateAutoSnapshotPolicyRequest& request, const CreateAutoSnapshotPolicyAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, createAutoSnapshotPolicy(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +DBFSClient::CreateAutoSnapshotPolicyOutcomeCallable DBFSClient::createAutoSnapshotPolicyCallable(const CreateAutoSnapshotPolicyRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->createAutoSnapshotPolicy(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + DBFSClient::CreateDbfsOutcome DBFSClient::createDbfs(const CreateDbfsRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/dbfs/src/model/CancelAutoSnapshotPolicyRequest.cc b/dbfs/src/model/CancelAutoSnapshotPolicyRequest.cc new file mode 100644 index 000000000..b183bf9a3 --- /dev/null +++ b/dbfs/src/model/CancelAutoSnapshotPolicyRequest.cc @@ -0,0 +1,56 @@ +/* + * 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::CancelAutoSnapshotPolicyRequest; + +CancelAutoSnapshotPolicyRequest::CancelAutoSnapshotPolicyRequest() + : RpcServiceRequest("dbfs", "2020-04-18", "CancelAutoSnapshotPolicy") { + setMethod(HttpRequest::Method::Post); +} + +CancelAutoSnapshotPolicyRequest::~CancelAutoSnapshotPolicyRequest() {} + +std::vector CancelAutoSnapshotPolicyRequest::getDbfsIds() const { + return dbfsIds_; +} + +void CancelAutoSnapshotPolicyRequest::setDbfsIds(const std::vector &dbfsIds) { + dbfsIds_ = dbfsIds; + for(int dep1 = 0; dep1 != dbfsIds.size(); dep1++) { + setParameter(std::string("DbfsIds") + "." + std::to_string(dep1 + 1), dbfsIds[dep1]); + } +} + +std::string CancelAutoSnapshotPolicyRequest::getPolicyId() const { + return policyId_; +} + +void CancelAutoSnapshotPolicyRequest::setPolicyId(const std::string &policyId) { + policyId_ = policyId; + setParameter(std::string("PolicyId"), policyId); +} + +std::string CancelAutoSnapshotPolicyRequest::getRegionId() const { + return regionId_; +} + +void CancelAutoSnapshotPolicyRequest::setRegionId(const std::string ®ionId) { + regionId_ = regionId; + setParameter(std::string("RegionId"), regionId); +} + diff --git a/dbfs/src/model/CancelAutoSnapshotPolicyResult.cc b/dbfs/src/model/CancelAutoSnapshotPolicyResult.cc new file mode 100644 index 000000000..d08b8a1d8 --- /dev/null +++ b/dbfs/src/model/CancelAutoSnapshotPolicyResult.cc @@ -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 +#include + +using namespace AlibabaCloud::DBFS; +using namespace AlibabaCloud::DBFS::Model; + +CancelAutoSnapshotPolicyResult::CancelAutoSnapshotPolicyResult() : + ServiceResult() +{} + +CancelAutoSnapshotPolicyResult::CancelAutoSnapshotPolicyResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +CancelAutoSnapshotPolicyResult::~CancelAutoSnapshotPolicyResult() +{} + +void CancelAutoSnapshotPolicyResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + +} + diff --git a/dbfs/src/model/CreateAutoSnapshotPolicyRequest.cc b/dbfs/src/model/CreateAutoSnapshotPolicyRequest.cc new file mode 100644 index 000000000..1d43d5701 --- /dev/null +++ b/dbfs/src/model/CreateAutoSnapshotPolicyRequest.cc @@ -0,0 +1,76 @@ +/* + * 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::CreateAutoSnapshotPolicyRequest; + +CreateAutoSnapshotPolicyRequest::CreateAutoSnapshotPolicyRequest() + : RpcServiceRequest("dbfs", "2020-04-18", "CreateAutoSnapshotPolicy") { + setMethod(HttpRequest::Method::Post); +} + +CreateAutoSnapshotPolicyRequest::~CreateAutoSnapshotPolicyRequest() {} + +std::vector CreateAutoSnapshotPolicyRequest::getTimePoints() const { + return timePoints_; +} + +void CreateAutoSnapshotPolicyRequest::setTimePoints(const std::vector &timePoints) { + timePoints_ = timePoints; + for(int dep1 = 0; dep1 != timePoints.size(); dep1++) { + setParameter(std::string("TimePoints") + "." + std::to_string(dep1 + 1), timePoints[dep1]); + } +} + +std::vector CreateAutoSnapshotPolicyRequest::getRepeatWeekdays() const { + return repeatWeekdays_; +} + +void CreateAutoSnapshotPolicyRequest::setRepeatWeekdays(const std::vector &repeatWeekdays) { + repeatWeekdays_ = repeatWeekdays; + for(int dep1 = 0; dep1 != repeatWeekdays.size(); dep1++) { + setParameter(std::string("RepeatWeekdays") + "." + std::to_string(dep1 + 1), repeatWeekdays[dep1]); + } +} + +std::string CreateAutoSnapshotPolicyRequest::getRegionId() const { + return regionId_; +} + +void CreateAutoSnapshotPolicyRequest::setRegionId(const std::string ®ionId) { + regionId_ = regionId; + setParameter(std::string("RegionId"), regionId); +} + +std::string CreateAutoSnapshotPolicyRequest::getPolicyName() const { + return policyName_; +} + +void CreateAutoSnapshotPolicyRequest::setPolicyName(const std::string &policyName) { + policyName_ = policyName; + setParameter(std::string("PolicyName"), policyName); +} + +int CreateAutoSnapshotPolicyRequest::getRetentionDays() const { + return retentionDays_; +} + +void CreateAutoSnapshotPolicyRequest::setRetentionDays(int retentionDays) { + retentionDays_ = retentionDays; + setParameter(std::string("RetentionDays"), std::to_string(retentionDays)); +} + diff --git a/dbfs/src/model/CreateAutoSnapshotPolicyResult.cc b/dbfs/src/model/CreateAutoSnapshotPolicyResult.cc new file mode 100644 index 000000000..d4027814f --- /dev/null +++ b/dbfs/src/model/CreateAutoSnapshotPolicyResult.cc @@ -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 +#include + +using namespace AlibabaCloud::DBFS; +using namespace AlibabaCloud::DBFS::Model; + +CreateAutoSnapshotPolicyResult::CreateAutoSnapshotPolicyResult() : + ServiceResult() +{} + +CreateAutoSnapshotPolicyResult::CreateAutoSnapshotPolicyResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +CreateAutoSnapshotPolicyResult::~CreateAutoSnapshotPolicyResult() +{} + +void CreateAutoSnapshotPolicyResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["PolicyId"].isNull()) + policyId_ = value["PolicyId"].asString(); + +} + +std::string CreateAutoSnapshotPolicyResult::getPolicyId()const +{ + return policyId_; +} +