From 80439374d55be8cfb26bad851806ce6f9a98669e Mon Sep 17 00:00:00 2001 From: sdk-team Date: Tue, 9 Aug 2022 05:24:35 +0000 Subject: [PATCH] Support API ARMInstance. --- CHANGELOG | 4 ++ VERSION | 2 +- ens/CMakeLists.txt | 8 +++ ens/include/alibabacloud/ens/EnsClient.h | 16 +++++ .../ens/model/CreateNatGatewayRequest.h | 3 + .../ens/model/CreateSnatEntryRequest.h | 3 + .../ens/model/DescribeNatGatewaysResult.h | 1 + .../GetOssStorageAndAccByBucketsRequest.h | 42 +++++++++++ .../GetOssStorageAndAccByBucketsResult.h | 57 +++++++++++++++ .../ens/model/ReinitInstanceRequest.h | 48 +++++++++++++ .../ens/model/ReinitInstanceResult.h | 49 +++++++++++++ ens/src/EnsClient.cc | 72 +++++++++++++++++++ ens/src/model/CreateNatGatewayRequest.cc | 9 +++ ens/src/model/CreateSnatEntryRequest.cc | 9 +++ ens/src/model/DescribeNatGatewaysResult.cc | 2 + .../GetOssStorageAndAccByBucketsRequest.cc | 36 ++++++++++ .../GetOssStorageAndAccByBucketsResult.cc | 61 ++++++++++++++++ ens/src/model/ReinitInstanceRequest.cc | 54 ++++++++++++++ ens/src/model/ReinitInstanceResult.cc | 44 ++++++++++++ 19 files changed, 519 insertions(+), 1 deletion(-) create mode 100644 ens/include/alibabacloud/ens/model/GetOssStorageAndAccByBucketsRequest.h create mode 100644 ens/include/alibabacloud/ens/model/GetOssStorageAndAccByBucketsResult.h create mode 100644 ens/include/alibabacloud/ens/model/ReinitInstanceRequest.h create mode 100644 ens/include/alibabacloud/ens/model/ReinitInstanceResult.h create mode 100644 ens/src/model/GetOssStorageAndAccByBucketsRequest.cc create mode 100644 ens/src/model/GetOssStorageAndAccByBucketsResult.cc create mode 100644 ens/src/model/ReinitInstanceRequest.cc create mode 100644 ens/src/model/ReinitInstanceResult.cc diff --git a/CHANGELOG b/CHANGELOG index 66135fd5b..f09f01aab 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +2022-08-09 Version: 1.36.1219 +- Support API ARMInstance. +- Support Control ARM API. + 2022-08-05 Version: 1.36.1218 - Automatically generate sdk tasks. diff --git a/VERSION b/VERSION index de4304d3a..c8f3d1437 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.1218 \ No newline at end of file +1.36.1219 \ No newline at end of file diff --git a/ens/CMakeLists.txt b/ens/CMakeLists.txt index d63c9ef60..3c0aa73eb 100644 --- a/ens/CMakeLists.txt +++ b/ens/CMakeLists.txt @@ -253,6 +253,8 @@ set(ens_public_header_model include/alibabacloud/ens/model/ExportMeasurementDataResult.h include/alibabacloud/ens/model/GetDeviceInternetPortRequest.h include/alibabacloud/ens/model/GetDeviceInternetPortResult.h + include/alibabacloud/ens/model/GetOssStorageAndAccByBucketsRequest.h + include/alibabacloud/ens/model/GetOssStorageAndAccByBucketsResult.h include/alibabacloud/ens/model/ImportKeyPairRequest.h include/alibabacloud/ens/model/ImportKeyPairResult.h include/alibabacloud/ens/model/JoinPublicIpsToEpnInstanceRequest.h @@ -301,6 +303,8 @@ set(ens_public_header_model include/alibabacloud/ens/model/RebootARMServerInstanceResult.h include/alibabacloud/ens/model/RebootInstanceRequest.h include/alibabacloud/ens/model/RebootInstanceResult.h + include/alibabacloud/ens/model/ReinitInstanceRequest.h + include/alibabacloud/ens/model/ReinitInstanceResult.h include/alibabacloud/ens/model/ReleaseARMServerInstanceRequest.h include/alibabacloud/ens/model/ReleaseARMServerInstanceResult.h include/alibabacloud/ens/model/ReleaseInstanceRequest.h @@ -606,6 +610,8 @@ set(ens_src src/model/ExportMeasurementDataResult.cc src/model/GetDeviceInternetPortRequest.cc src/model/GetDeviceInternetPortResult.cc + src/model/GetOssStorageAndAccByBucketsRequest.cc + src/model/GetOssStorageAndAccByBucketsResult.cc src/model/ImportKeyPairRequest.cc src/model/ImportKeyPairResult.cc src/model/JoinPublicIpsToEpnInstanceRequest.cc @@ -654,6 +660,8 @@ set(ens_src src/model/RebootARMServerInstanceResult.cc src/model/RebootInstanceRequest.cc src/model/RebootInstanceResult.cc + src/model/ReinitInstanceRequest.cc + src/model/ReinitInstanceResult.cc src/model/ReleaseARMServerInstanceRequest.cc src/model/ReleaseARMServerInstanceResult.cc src/model/ReleaseInstanceRequest.cc diff --git a/ens/include/alibabacloud/ens/EnsClient.h b/ens/include/alibabacloud/ens/EnsClient.h index b628fee58..384a192c4 100644 --- a/ens/include/alibabacloud/ens/EnsClient.h +++ b/ens/include/alibabacloud/ens/EnsClient.h @@ -254,6 +254,8 @@ #include "model/ExportMeasurementDataResult.h" #include "model/GetDeviceInternetPortRequest.h" #include "model/GetDeviceInternetPortResult.h" +#include "model/GetOssStorageAndAccByBucketsRequest.h" +#include "model/GetOssStorageAndAccByBucketsResult.h" #include "model/ImportKeyPairRequest.h" #include "model/ImportKeyPairResult.h" #include "model/JoinPublicIpsToEpnInstanceRequest.h" @@ -302,6 +304,8 @@ #include "model/RebootARMServerInstanceResult.h" #include "model/RebootInstanceRequest.h" #include "model/RebootInstanceResult.h" +#include "model/ReinitInstanceRequest.h" +#include "model/ReinitInstanceResult.h" #include "model/ReleaseARMServerInstanceRequest.h" #include "model/ReleaseARMServerInstanceResult.h" #include "model/ReleaseInstanceRequest.h" @@ -729,6 +733,9 @@ namespace AlibabaCloud typedef Outcome GetDeviceInternetPortOutcome; typedef std::future GetDeviceInternetPortOutcomeCallable; typedef std::function&)> GetDeviceInternetPortAsyncHandler; + typedef Outcome GetOssStorageAndAccByBucketsOutcome; + typedef std::future GetOssStorageAndAccByBucketsOutcomeCallable; + typedef std::function&)> GetOssStorageAndAccByBucketsAsyncHandler; typedef Outcome ImportKeyPairOutcome; typedef std::future ImportKeyPairOutcomeCallable; typedef std::function&)> ImportKeyPairAsyncHandler; @@ -801,6 +808,9 @@ namespace AlibabaCloud typedef Outcome RebootInstanceOutcome; typedef std::future RebootInstanceOutcomeCallable; typedef std::function&)> RebootInstanceAsyncHandler; + typedef Outcome ReinitInstanceOutcome; + typedef std::future ReinitInstanceOutcomeCallable; + typedef std::function&)> ReinitInstanceAsyncHandler; typedef Outcome ReleaseARMServerInstanceOutcome; typedef std::future ReleaseARMServerInstanceOutcomeCallable; typedef std::function&)> ReleaseARMServerInstanceAsyncHandler; @@ -1259,6 +1269,9 @@ namespace AlibabaCloud GetDeviceInternetPortOutcome getDeviceInternetPort(const Model::GetDeviceInternetPortRequest &request)const; void getDeviceInternetPortAsync(const Model::GetDeviceInternetPortRequest& request, const GetDeviceInternetPortAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetDeviceInternetPortOutcomeCallable getDeviceInternetPortCallable(const Model::GetDeviceInternetPortRequest& request) const; + GetOssStorageAndAccByBucketsOutcome getOssStorageAndAccByBuckets(const Model::GetOssStorageAndAccByBucketsRequest &request)const; + void getOssStorageAndAccByBucketsAsync(const Model::GetOssStorageAndAccByBucketsRequest& request, const GetOssStorageAndAccByBucketsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetOssStorageAndAccByBucketsOutcomeCallable getOssStorageAndAccByBucketsCallable(const Model::GetOssStorageAndAccByBucketsRequest& request) const; ImportKeyPairOutcome importKeyPair(const Model::ImportKeyPairRequest &request)const; void importKeyPairAsync(const Model::ImportKeyPairRequest& request, const ImportKeyPairAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ImportKeyPairOutcomeCallable importKeyPairCallable(const Model::ImportKeyPairRequest& request) const; @@ -1331,6 +1344,9 @@ namespace AlibabaCloud RebootInstanceOutcome rebootInstance(const Model::RebootInstanceRequest &request)const; void rebootInstanceAsync(const Model::RebootInstanceRequest& request, const RebootInstanceAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; RebootInstanceOutcomeCallable rebootInstanceCallable(const Model::RebootInstanceRequest& request) const; + ReinitInstanceOutcome reinitInstance(const Model::ReinitInstanceRequest &request)const; + void reinitInstanceAsync(const Model::ReinitInstanceRequest& request, const ReinitInstanceAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ReinitInstanceOutcomeCallable reinitInstanceCallable(const Model::ReinitInstanceRequest& request) const; ReleaseARMServerInstanceOutcome releaseARMServerInstance(const Model::ReleaseARMServerInstanceRequest &request)const; void releaseARMServerInstanceAsync(const Model::ReleaseARMServerInstanceRequest& request, const ReleaseARMServerInstanceAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ReleaseARMServerInstanceOutcomeCallable releaseARMServerInstanceCallable(const Model::ReleaseARMServerInstanceRequest& request) const; diff --git a/ens/include/alibabacloud/ens/model/CreateNatGatewayRequest.h b/ens/include/alibabacloud/ens/model/CreateNatGatewayRequest.h index 99efcd150..3d6a85c7d 100644 --- a/ens/include/alibabacloud/ens/model/CreateNatGatewayRequest.h +++ b/ens/include/alibabacloud/ens/model/CreateNatGatewayRequest.h @@ -32,6 +32,8 @@ public: ~CreateNatGatewayRequest(); std::string getEnsRegionId() const; void setEnsRegionId(const std::string &ensRegionId); + std::string getInstanceType() const; + void setInstanceType(const std::string &instanceType); std::string getVSwitchId() const; void setVSwitchId(const std::string &vSwitchId); std::string getName() const; @@ -41,6 +43,7 @@ public: private: std::string ensRegionId_; + std::string instanceType_; std::string vSwitchId_; std::string name_; std::string networkId_; diff --git a/ens/include/alibabacloud/ens/model/CreateSnatEntryRequest.h b/ens/include/alibabacloud/ens/model/CreateSnatEntryRequest.h index 8c763f668..858d9b36d 100644 --- a/ens/include/alibabacloud/ens/model/CreateSnatEntryRequest.h +++ b/ens/include/alibabacloud/ens/model/CreateSnatEntryRequest.h @@ -36,6 +36,8 @@ public: void setSnatIp(const std::string &snatIp); std::string getSourceVSwitchId() const; void setSourceVSwitchId(const std::string &sourceVSwitchId); + std::string getSourceNetworkId() const; + void setSourceNetworkId(const std::string &sourceNetworkId); std::string getNatGatewayId() const; void setNatGatewayId(const std::string &natGatewayId); std::string getSnatEntryName() const; @@ -45,6 +47,7 @@ private: std::string sourceCIDR_; std::string snatIp_; std::string sourceVSwitchId_; + std::string sourceNetworkId_; std::string natGatewayId_; std::string snatEntryName_; }; diff --git a/ens/include/alibabacloud/ens/model/DescribeNatGatewaysResult.h b/ens/include/alibabacloud/ens/model/DescribeNatGatewaysResult.h index b97ff26aa..d4ac66dd8 100644 --- a/ens/include/alibabacloud/ens/model/DescribeNatGatewaysResult.h +++ b/ens/include/alibabacloud/ens/model/DescribeNatGatewaysResult.h @@ -38,6 +38,7 @@ namespace AlibabaCloud std::string creationTime; std::string ensRegionId; std::string networkId; + std::string spec; std::string natGatewayId; std::string name; }; diff --git a/ens/include/alibabacloud/ens/model/GetOssStorageAndAccByBucketsRequest.h b/ens/include/alibabacloud/ens/model/GetOssStorageAndAccByBucketsRequest.h new file mode 100644 index 000000000..b79bcff2c --- /dev/null +++ b/ens/include/alibabacloud/ens/model/GetOssStorageAndAccByBucketsRequest.h @@ -0,0 +1,42 @@ +/* + * 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_ENS_MODEL_GETOSSSTORAGEANDACCBYBUCKETSREQUEST_H_ +#define ALIBABACLOUD_ENS_MODEL_GETOSSSTORAGEANDACCBYBUCKETSREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace Ens { +namespace Model { +class ALIBABACLOUD_ENS_EXPORT GetOssStorageAndAccByBucketsRequest : public RpcServiceRequest { +public: + GetOssStorageAndAccByBucketsRequest(); + ~GetOssStorageAndAccByBucketsRequest(); + std::string getBucketList() const; + void setBucketList(const std::string &bucketList); + +private: + std::string bucketList_; +}; +} // namespace Model +} // namespace Ens +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_ENS_MODEL_GETOSSSTORAGEANDACCBYBUCKETSREQUEST_H_ diff --git a/ens/include/alibabacloud/ens/model/GetOssStorageAndAccByBucketsResult.h b/ens/include/alibabacloud/ens/model/GetOssStorageAndAccByBucketsResult.h new file mode 100644 index 000000000..392ac8e47 --- /dev/null +++ b/ens/include/alibabacloud/ens/model/GetOssStorageAndAccByBucketsResult.h @@ -0,0 +1,57 @@ +/* + * 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_ENS_MODEL_GETOSSSTORAGEANDACCBYBUCKETSRESULT_H_ +#define ALIBABACLOUD_ENS_MODEL_GETOSSSTORAGEANDACCBYBUCKETSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ens + { + namespace Model + { + class ALIBABACLOUD_ENS_EXPORT GetOssStorageAndAccByBucketsResult : public ServiceResult + { + public: + struct BucketListItem + { + long acc; + std::string bucket; + long storageUsageByte; + }; + + + GetOssStorageAndAccByBucketsResult(); + explicit GetOssStorageAndAccByBucketsResult(const std::string &payload); + ~GetOssStorageAndAccByBucketsResult(); + std::vector getBucketList()const; + + protected: + void parse(const std::string &payload); + private: + std::vector bucketList_; + + }; + } + } +} +#endif // !ALIBABACLOUD_ENS_MODEL_GETOSSSTORAGEANDACCBYBUCKETSRESULT_H_ \ No newline at end of file diff --git a/ens/include/alibabacloud/ens/model/ReinitInstanceRequest.h b/ens/include/alibabacloud/ens/model/ReinitInstanceRequest.h new file mode 100644 index 000000000..2ebf0d651 --- /dev/null +++ b/ens/include/alibabacloud/ens/model/ReinitInstanceRequest.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_ENS_MODEL_REINITINSTANCEREQUEST_H_ +#define ALIBABACLOUD_ENS_MODEL_REINITINSTANCEREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace Ens { +namespace Model { +class ALIBABACLOUD_ENS_EXPORT ReinitInstanceRequest : public RpcServiceRequest { +public: + ReinitInstanceRequest(); + ~ReinitInstanceRequest(); + std::string getImageId() const; + void setImageId(const std::string &imageId); + std::string getPassword() const; + void setPassword(const std::string &password); + std::string getInstanceId() const; + void setInstanceId(const std::string &instanceId); + +private: + std::string imageId_; + std::string password_; + std::string instanceId_; +}; +} // namespace Model +} // namespace Ens +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_ENS_MODEL_REINITINSTANCEREQUEST_H_ diff --git a/ens/include/alibabacloud/ens/model/ReinitInstanceResult.h b/ens/include/alibabacloud/ens/model/ReinitInstanceResult.h new file mode 100644 index 000000000..56d11b1f4 --- /dev/null +++ b/ens/include/alibabacloud/ens/model/ReinitInstanceResult.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_ENS_MODEL_REINITINSTANCERESULT_H_ +#define ALIBABACLOUD_ENS_MODEL_REINITINSTANCERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ens + { + namespace Model + { + class ALIBABACLOUD_ENS_EXPORT ReinitInstanceResult : public ServiceResult + { + public: + + + ReinitInstanceResult(); + explicit ReinitInstanceResult(const std::string &payload); + ~ReinitInstanceResult(); + + protected: + void parse(const std::string &payload); + private: + + }; + } + } +} +#endif // !ALIBABACLOUD_ENS_MODEL_REINITINSTANCERESULT_H_ \ No newline at end of file diff --git a/ens/src/EnsClient.cc b/ens/src/EnsClient.cc index 6ab45d159..5c563e28a 100644 --- a/ens/src/EnsClient.cc +++ b/ens/src/EnsClient.cc @@ -4227,6 +4227,42 @@ EnsClient::GetDeviceInternetPortOutcomeCallable EnsClient::getDeviceInternetPort return task->get_future(); } +EnsClient::GetOssStorageAndAccByBucketsOutcome EnsClient::getOssStorageAndAccByBuckets(const GetOssStorageAndAccByBucketsRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetOssStorageAndAccByBucketsOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetOssStorageAndAccByBucketsOutcome(GetOssStorageAndAccByBucketsResult(outcome.result())); + else + return GetOssStorageAndAccByBucketsOutcome(outcome.error()); +} + +void EnsClient::getOssStorageAndAccByBucketsAsync(const GetOssStorageAndAccByBucketsRequest& request, const GetOssStorageAndAccByBucketsAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getOssStorageAndAccByBuckets(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +EnsClient::GetOssStorageAndAccByBucketsOutcomeCallable EnsClient::getOssStorageAndAccByBucketsCallable(const GetOssStorageAndAccByBucketsRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getOssStorageAndAccByBuckets(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + EnsClient::ImportKeyPairOutcome EnsClient::importKeyPair(const ImportKeyPairRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -5091,6 +5127,42 @@ EnsClient::RebootInstanceOutcomeCallable EnsClient::rebootInstanceCallable(const return task->get_future(); } +EnsClient::ReinitInstanceOutcome EnsClient::reinitInstance(const ReinitInstanceRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ReinitInstanceOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ReinitInstanceOutcome(ReinitInstanceResult(outcome.result())); + else + return ReinitInstanceOutcome(outcome.error()); +} + +void EnsClient::reinitInstanceAsync(const ReinitInstanceRequest& request, const ReinitInstanceAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, reinitInstance(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +EnsClient::ReinitInstanceOutcomeCallable EnsClient::reinitInstanceCallable(const ReinitInstanceRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->reinitInstance(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + EnsClient::ReleaseARMServerInstanceOutcome EnsClient::releaseARMServerInstance(const ReleaseARMServerInstanceRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/ens/src/model/CreateNatGatewayRequest.cc b/ens/src/model/CreateNatGatewayRequest.cc index 90d083cae..22cff1047 100644 --- a/ens/src/model/CreateNatGatewayRequest.cc +++ b/ens/src/model/CreateNatGatewayRequest.cc @@ -34,6 +34,15 @@ void CreateNatGatewayRequest::setEnsRegionId(const std::string &ensRegionId) { setParameter(std::string("EnsRegionId"), ensRegionId); } +std::string CreateNatGatewayRequest::getInstanceType() const { + return instanceType_; +} + +void CreateNatGatewayRequest::setInstanceType(const std::string &instanceType) { + instanceType_ = instanceType; + setParameter(std::string("InstanceType"), instanceType); +} + std::string CreateNatGatewayRequest::getVSwitchId() const { return vSwitchId_; } diff --git a/ens/src/model/CreateSnatEntryRequest.cc b/ens/src/model/CreateSnatEntryRequest.cc index b5fcf8af9..d8e20a021 100644 --- a/ens/src/model/CreateSnatEntryRequest.cc +++ b/ens/src/model/CreateSnatEntryRequest.cc @@ -52,6 +52,15 @@ void CreateSnatEntryRequest::setSourceVSwitchId(const std::string &sourceVSwitch setParameter(std::string("SourceVSwitchId"), sourceVSwitchId); } +std::string CreateSnatEntryRequest::getSourceNetworkId() const { + return sourceNetworkId_; +} + +void CreateSnatEntryRequest::setSourceNetworkId(const std::string &sourceNetworkId) { + sourceNetworkId_ = sourceNetworkId; + setParameter(std::string("SourceNetworkId"), sourceNetworkId); +} + std::string CreateSnatEntryRequest::getNatGatewayId() const { return natGatewayId_; } diff --git a/ens/src/model/DescribeNatGatewaysResult.cc b/ens/src/model/DescribeNatGatewaysResult.cc index 98e4864e7..c0060660f 100644 --- a/ens/src/model/DescribeNatGatewaysResult.cc +++ b/ens/src/model/DescribeNatGatewaysResult.cc @@ -55,6 +55,8 @@ void DescribeNatGatewaysResult::parse(const std::string &payload) natGatewaysObject.name = valueNatGatewaysNatGateway["Name"].asString(); if(!valueNatGatewaysNatGateway["CreationTime"].isNull()) natGatewaysObject.creationTime = valueNatGatewaysNatGateway["CreationTime"].asString(); + if(!valueNatGatewaysNatGateway["Spec"].isNull()) + natGatewaysObject.spec = valueNatGatewaysNatGateway["Spec"].asString(); natGateways_.push_back(natGatewaysObject); } if(!value["PageNumber"].isNull()) diff --git a/ens/src/model/GetOssStorageAndAccByBucketsRequest.cc b/ens/src/model/GetOssStorageAndAccByBucketsRequest.cc new file mode 100644 index 000000000..4834cccc4 --- /dev/null +++ b/ens/src/model/GetOssStorageAndAccByBucketsRequest.cc @@ -0,0 +1,36 @@ +/* + * 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::Ens::Model::GetOssStorageAndAccByBucketsRequest; + +GetOssStorageAndAccByBucketsRequest::GetOssStorageAndAccByBucketsRequest() + : RpcServiceRequest("ens", "2017-11-10", "GetOssStorageAndAccByBuckets") { + setMethod(HttpRequest::Method::Get); +} + +GetOssStorageAndAccByBucketsRequest::~GetOssStorageAndAccByBucketsRequest() {} + +std::string GetOssStorageAndAccByBucketsRequest::getBucketList() const { + return bucketList_; +} + +void GetOssStorageAndAccByBucketsRequest::setBucketList(const std::string &bucketList) { + bucketList_ = bucketList; + setParameter(std::string("BucketList"), bucketList); +} + diff --git a/ens/src/model/GetOssStorageAndAccByBucketsResult.cc b/ens/src/model/GetOssStorageAndAccByBucketsResult.cc new file mode 100644 index 000000000..900150a8f --- /dev/null +++ b/ens/src/model/GetOssStorageAndAccByBucketsResult.cc @@ -0,0 +1,61 @@ +/* + * 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::Ens; +using namespace AlibabaCloud::Ens::Model; + +GetOssStorageAndAccByBucketsResult::GetOssStorageAndAccByBucketsResult() : + ServiceResult() +{} + +GetOssStorageAndAccByBucketsResult::GetOssStorageAndAccByBucketsResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetOssStorageAndAccByBucketsResult::~GetOssStorageAndAccByBucketsResult() +{} + +void GetOssStorageAndAccByBucketsResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto allBucketListNode = value["BucketList"]["BucketListItem"]; + for (auto valueBucketListBucketListItem : allBucketListNode) + { + BucketListItem bucketListObject; + if(!valueBucketListBucketListItem["Acc"].isNull()) + bucketListObject.acc = std::stol(valueBucketListBucketListItem["Acc"].asString()); + if(!valueBucketListBucketListItem["Bucket"].isNull()) + bucketListObject.bucket = valueBucketListBucketListItem["Bucket"].asString(); + if(!valueBucketListBucketListItem["StorageUsageByte"].isNull()) + bucketListObject.storageUsageByte = std::stol(valueBucketListBucketListItem["StorageUsageByte"].asString()); + bucketList_.push_back(bucketListObject); + } + +} + +std::vector GetOssStorageAndAccByBucketsResult::getBucketList()const +{ + return bucketList_; +} + diff --git a/ens/src/model/ReinitInstanceRequest.cc b/ens/src/model/ReinitInstanceRequest.cc new file mode 100644 index 000000000..e8cf32c5e --- /dev/null +++ b/ens/src/model/ReinitInstanceRequest.cc @@ -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. + */ + +#include + +using AlibabaCloud::Ens::Model::ReinitInstanceRequest; + +ReinitInstanceRequest::ReinitInstanceRequest() + : RpcServiceRequest("ens", "2017-11-10", "ReinitInstance") { + setMethod(HttpRequest::Method::Post); +} + +ReinitInstanceRequest::~ReinitInstanceRequest() {} + +std::string ReinitInstanceRequest::getImageId() const { + return imageId_; +} + +void ReinitInstanceRequest::setImageId(const std::string &imageId) { + imageId_ = imageId; + setBodyParameter(std::string("ImageId"), imageId); +} + +std::string ReinitInstanceRequest::getPassword() const { + return password_; +} + +void ReinitInstanceRequest::setPassword(const std::string &password) { + password_ = password; + setBodyParameter(std::string("Password"), password); +} + +std::string ReinitInstanceRequest::getInstanceId() const { + return instanceId_; +} + +void ReinitInstanceRequest::setInstanceId(const std::string &instanceId) { + instanceId_ = instanceId; + setBodyParameter(std::string("InstanceId"), instanceId); +} + diff --git a/ens/src/model/ReinitInstanceResult.cc b/ens/src/model/ReinitInstanceResult.cc new file mode 100644 index 000000000..9bbc34ef4 --- /dev/null +++ b/ens/src/model/ReinitInstanceResult.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::Ens; +using namespace AlibabaCloud::Ens::Model; + +ReinitInstanceResult::ReinitInstanceResult() : + ServiceResult() +{} + +ReinitInstanceResult::ReinitInstanceResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ReinitInstanceResult::~ReinitInstanceResult() +{} + +void ReinitInstanceResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + +} +