diff --git a/CHANGELOG b/CHANGELOG index f2cbda949..feec05d99 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2018-11-28 Version: 1.34.0 +1, Add RedeployInstance interface, and support to migrate ecs instance with specified maintenance events actively + 2018-11-28 Version: 1.33.6 1, Add APIs InvokeThingsService, SetDevicesProperty and QueryDeviceByTags . diff --git a/VERSION b/VERSION index cbe255284..2404d9590 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.33.6 \ No newline at end of file +1.34.0 \ No newline at end of file diff --git a/ecs/CMakeLists.txt b/ecs/CMakeLists.txt index 95592b9de..dfbec70a8 100644 --- a/ecs/CMakeLists.txt +++ b/ecs/CMakeLists.txt @@ -115,6 +115,8 @@ set(ecs_public_header_model include/alibabacloud/ecs/model/GetInstanceConsoleOutputResult.h include/alibabacloud/ecs/model/CreateSimulatedSystemEventsRequest.h include/alibabacloud/ecs/model/CreateSimulatedSystemEventsResult.h + include/alibabacloud/ecs/model/RedeployInstanceRequest.h + include/alibabacloud/ecs/model/RedeployInstanceResult.h include/alibabacloud/ecs/model/CancelTaskRequest.h include/alibabacloud/ecs/model/CancelTaskResult.h include/alibabacloud/ecs/model/ModifyPhysicalConnectionAttributeRequest.h @@ -598,6 +600,8 @@ set(ecs_src src/model/GetInstanceConsoleOutputResult.cc src/model/CreateSimulatedSystemEventsRequest.cc src/model/CreateSimulatedSystemEventsResult.cc + src/model/RedeployInstanceRequest.cc + src/model/RedeployInstanceResult.cc src/model/CancelTaskRequest.cc src/model/CancelTaskResult.cc src/model/ModifyPhysicalConnectionAttributeRequest.cc diff --git a/ecs/include/alibabacloud/ecs/EcsClient.h b/ecs/include/alibabacloud/ecs/EcsClient.h index d07ac628c..446a3ea05 100644 --- a/ecs/include/alibabacloud/ecs/EcsClient.h +++ b/ecs/include/alibabacloud/ecs/EcsClient.h @@ -116,6 +116,8 @@ #include "model/GetInstanceConsoleOutputResult.h" #include "model/CreateSimulatedSystemEventsRequest.h" #include "model/CreateSimulatedSystemEventsResult.h" +#include "model/RedeployInstanceRequest.h" +#include "model/RedeployInstanceResult.h" #include "model/CancelTaskRequest.h" #include "model/CancelTaskResult.h" #include "model/ModifyPhysicalConnectionAttributeRequest.h" @@ -652,6 +654,9 @@ namespace AlibabaCloud typedef Outcome CreateSimulatedSystemEventsOutcome; typedef std::future CreateSimulatedSystemEventsOutcomeCallable; typedef std::function&)> CreateSimulatedSystemEventsAsyncHandler; + typedef Outcome RedeployInstanceOutcome; + typedef std::future RedeployInstanceOutcomeCallable; + typedef std::function&)> RedeployInstanceAsyncHandler; typedef Outcome CancelTaskOutcome; typedef std::future CancelTaskOutcomeCallable; typedef std::function&)> CancelTaskAsyncHandler; @@ -1377,6 +1382,9 @@ namespace AlibabaCloud CreateSimulatedSystemEventsOutcome createSimulatedSystemEvents(const Model::CreateSimulatedSystemEventsRequest &request)const; void createSimulatedSystemEventsAsync(const Model::CreateSimulatedSystemEventsRequest& request, const CreateSimulatedSystemEventsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; CreateSimulatedSystemEventsOutcomeCallable createSimulatedSystemEventsCallable(const Model::CreateSimulatedSystemEventsRequest& request) const; + RedeployInstanceOutcome redeployInstance(const Model::RedeployInstanceRequest &request)const; + void redeployInstanceAsync(const Model::RedeployInstanceRequest& request, const RedeployInstanceAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + RedeployInstanceOutcomeCallable redeployInstanceCallable(const Model::RedeployInstanceRequest& request) const; CancelTaskOutcome cancelTask(const Model::CancelTaskRequest &request)const; void cancelTaskAsync(const Model::CancelTaskRequest& request, const CancelTaskAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; CancelTaskOutcomeCallable cancelTaskCallable(const Model::CancelTaskRequest& request) const; diff --git a/ecs/include/alibabacloud/ecs/model/DescribeRouteTablesResult.h b/ecs/include/alibabacloud/ecs/model/DescribeRouteTablesResult.h index 651ec026d..67983ce6e 100644 --- a/ecs/include/alibabacloud/ecs/model/DescribeRouteTablesResult.h +++ b/ecs/include/alibabacloud/ecs/model/DescribeRouteTablesResult.h @@ -53,6 +53,7 @@ namespace AlibabaCloud }; std::string vRouterId; std::string routeTableId; + std::string resourceGroupId; std::string creationTime; std::vector routeEntrys; std::string routeTableType; diff --git a/ecs/include/alibabacloud/ecs/model/RedeployInstanceRequest.h b/ecs/include/alibabacloud/ecs/model/RedeployInstanceRequest.h new file mode 100644 index 000000000..18a85c8e8 --- /dev/null +++ b/ecs/include/alibabacloud/ecs/model/RedeployInstanceRequest.h @@ -0,0 +1,117 @@ +/* + * 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_ECS_MODEL_REDEPLOYINSTANCEREQUEST_H_ +#define ALIBABACLOUD_ECS_MODEL_REDEPLOYINSTANCEREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ecs + { + namespace Model + { + class ALIBABACLOUD_ECS_EXPORT RedeployInstanceRequest : public RpcServiceRequest + { + + public: + RedeployInstanceRequest(); + ~RedeployInstanceRequest(); + + long getResourceOwnerId()const; + void setResourceOwnerId(long resourceOwnerId); + long getCallerParentId()const; + void setCallerParentId(long callerParentId); + bool getProxy_original_security_transport()const; + void setProxy_original_security_transport(bool proxy_original_security_transport); + std::string getProxy_original_source_ip()const; + void setProxy_original_source_ip(const std::string& proxy_original_source_ip); + std::string getOwnerIdLoginEmail()const; + void setOwnerIdLoginEmail(const std::string& ownerIdLoginEmail); + std::string getCallerType()const; + void setCallerType(const std::string& callerType); + std::string getAccessKeyId()const; + void setAccessKeyId(const std::string& accessKeyId); + bool getForceStop()const; + void setForceStop(bool forceStop); + std::string getSecurityToken()const; + void setSecurityToken(const std::string& securityToken); + bool getEnable()const; + void setEnable(bool enable); + std::string getRequestContent()const; + void setRequestContent(const std::string& requestContent); + std::string getCallerBidEmail()const; + void setCallerBidEmail(const std::string& callerBidEmail); + std::string getCallerUidEmail()const; + void setCallerUidEmail(const std::string& callerUidEmail); + long getCallerUid()const; + void setCallerUid(long callerUid); + std::string getApp_ip()const; + void setApp_ip(const std::string& app_ip); + std::string getResourceOwnerAccount()const; + void setResourceOwnerAccount(const std::string& resourceOwnerAccount); + std::string getOwnerAccount()const; + void setOwnerAccount(const std::string& ownerAccount); + std::string getCallerBid()const; + void setCallerBid(const std::string& callerBid); + long getOwnerId()const; + void setOwnerId(long ownerId); + bool getProxy_trust_transport_info()const; + void setProxy_trust_transport_info(bool proxy_trust_transport_info); + bool getAk_mfa_present()const; + void setAk_mfa_present(bool ak_mfa_present); + bool getSecurity_transport()const; + void setSecurity_transport(bool security_transport); + std::string getInstanceId()const; + void setInstanceId(const std::string& instanceId); + std::string getRequestId()const; + void setRequestId(const std::string& requestId); + + private: + long resourceOwnerId_; + long callerParentId_; + bool proxy_original_security_transport_; + std::string proxy_original_source_ip_; + std::string ownerIdLoginEmail_; + std::string callerType_; + std::string accessKeyId_; + bool forceStop_; + std::string securityToken_; + bool enable_; + std::string requestContent_; + std::string callerBidEmail_; + std::string callerUidEmail_; + long callerUid_; + std::string app_ip_; + std::string resourceOwnerAccount_; + std::string ownerAccount_; + std::string callerBid_; + long ownerId_; + bool proxy_trust_transport_info_; + bool ak_mfa_present_; + bool security_transport_; + std::string instanceId_; + std::string requestId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_ECS_MODEL_REDEPLOYINSTANCEREQUEST_H_ \ No newline at end of file diff --git a/ecs/include/alibabacloud/ecs/model/RedeployInstanceResult.h b/ecs/include/alibabacloud/ecs/model/RedeployInstanceResult.h new file mode 100644 index 000000000..47ded69b0 --- /dev/null +++ b/ecs/include/alibabacloud/ecs/model/RedeployInstanceResult.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_ECS_MODEL_REDEPLOYINSTANCERESULT_H_ +#define ALIBABACLOUD_ECS_MODEL_REDEPLOYINSTANCERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Ecs + { + namespace Model + { + class ALIBABACLOUD_ECS_EXPORT RedeployInstanceResult : public ServiceResult + { + public: + + + RedeployInstanceResult(); + explicit RedeployInstanceResult(const std::string &payload); + ~RedeployInstanceResult(); + + protected: + void parse(const std::string &payload); + private: + + }; + } + } +} +#endif // !ALIBABACLOUD_ECS_MODEL_REDEPLOYINSTANCERESULT_H_ \ No newline at end of file diff --git a/ecs/src/EcsClient.cc b/ecs/src/EcsClient.cc index 6e94d5c36..5f89a5509 100644 --- a/ecs/src/EcsClient.cc +++ b/ecs/src/EcsClient.cc @@ -1743,6 +1743,42 @@ EcsClient::CreateSimulatedSystemEventsOutcomeCallable EcsClient::createSimulated return task->get_future(); } +EcsClient::RedeployInstanceOutcome EcsClient::redeployInstance(const RedeployInstanceRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return RedeployInstanceOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return RedeployInstanceOutcome(RedeployInstanceResult(outcome.result())); + else + return RedeployInstanceOutcome(outcome.error()); +} + +void EcsClient::redeployInstanceAsync(const RedeployInstanceRequest& request, const RedeployInstanceAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, redeployInstance(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +EcsClient::RedeployInstanceOutcomeCallable EcsClient::redeployInstanceCallable(const RedeployInstanceRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->redeployInstance(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + EcsClient::CancelTaskOutcome EcsClient::cancelTask(const CancelTaskRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/ecs/src/model/DescribeRouteTablesResult.cc b/ecs/src/model/DescribeRouteTablesResult.cc index 0b2a1c4ca..a258d12f1 100644 --- a/ecs/src/model/DescribeRouteTablesResult.cc +++ b/ecs/src/model/DescribeRouteTablesResult.cc @@ -52,6 +52,8 @@ void DescribeRouteTablesResult::parse(const std::string &payload) routeTablesObject.routeTableType = value["RouteTableType"].asString(); if(!value["CreationTime"].isNull()) routeTablesObject.creationTime = value["CreationTime"].asString(); + if(!value["ResourceGroupId"].isNull()) + routeTablesObject.resourceGroupId = value["ResourceGroupId"].asString(); auto allRouteEntrys = value["RouteEntrys"]["RouteEntry"]; for (auto value : allRouteEntrys) { diff --git a/ecs/src/model/RedeployInstanceRequest.cc b/ecs/src/model/RedeployInstanceRequest.cc new file mode 100644 index 000000000..3625f2f47 --- /dev/null +++ b/ecs/src/model/RedeployInstanceRequest.cc @@ -0,0 +1,291 @@ +/* + * 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::Ecs::Model::RedeployInstanceRequest; + +RedeployInstanceRequest::RedeployInstanceRequest() : + RpcServiceRequest("ecs", "2014-05-26", "RedeployInstance") +{} + +RedeployInstanceRequest::~RedeployInstanceRequest() +{} + +long RedeployInstanceRequest::getResourceOwnerId()const +{ + return resourceOwnerId_; +} + +void RedeployInstanceRequest::setResourceOwnerId(long resourceOwnerId) +{ + resourceOwnerId_ = resourceOwnerId; + setParameter("ResourceOwnerId", std::to_string(resourceOwnerId)); +} + +long RedeployInstanceRequest::getCallerParentId()const +{ + return callerParentId_; +} + +void RedeployInstanceRequest::setCallerParentId(long callerParentId) +{ + callerParentId_ = callerParentId; + setParameter("CallerParentId", std::to_string(callerParentId)); +} + +bool RedeployInstanceRequest::getProxy_original_security_transport()const +{ + return proxy_original_security_transport_; +} + +void RedeployInstanceRequest::setProxy_original_security_transport(bool proxy_original_security_transport) +{ + proxy_original_security_transport_ = proxy_original_security_transport; + setParameter("Proxy_original_security_transport", std::to_string(proxy_original_security_transport)); +} + +std::string RedeployInstanceRequest::getProxy_original_source_ip()const +{ + return proxy_original_source_ip_; +} + +void RedeployInstanceRequest::setProxy_original_source_ip(const std::string& proxy_original_source_ip) +{ + proxy_original_source_ip_ = proxy_original_source_ip; + setParameter("Proxy_original_source_ip", proxy_original_source_ip); +} + +std::string RedeployInstanceRequest::getOwnerIdLoginEmail()const +{ + return ownerIdLoginEmail_; +} + +void RedeployInstanceRequest::setOwnerIdLoginEmail(const std::string& ownerIdLoginEmail) +{ + ownerIdLoginEmail_ = ownerIdLoginEmail; + setParameter("OwnerIdLoginEmail", ownerIdLoginEmail); +} + +std::string RedeployInstanceRequest::getCallerType()const +{ + return callerType_; +} + +void RedeployInstanceRequest::setCallerType(const std::string& callerType) +{ + callerType_ = callerType; + setParameter("CallerType", callerType); +} + +std::string RedeployInstanceRequest::getAccessKeyId()const +{ + return accessKeyId_; +} + +void RedeployInstanceRequest::setAccessKeyId(const std::string& accessKeyId) +{ + accessKeyId_ = accessKeyId; + setParameter("AccessKeyId", accessKeyId); +} + +bool RedeployInstanceRequest::getForceStop()const +{ + return forceStop_; +} + +void RedeployInstanceRequest::setForceStop(bool forceStop) +{ + forceStop_ = forceStop; + setParameter("ForceStop", std::to_string(forceStop)); +} + +std::string RedeployInstanceRequest::getSecurityToken()const +{ + return securityToken_; +} + +void RedeployInstanceRequest::setSecurityToken(const std::string& securityToken) +{ + securityToken_ = securityToken; + setParameter("SecurityToken", securityToken); +} + +bool RedeployInstanceRequest::getEnable()const +{ + return enable_; +} + +void RedeployInstanceRequest::setEnable(bool enable) +{ + enable_ = enable; + setParameter("Enable", std::to_string(enable)); +} + +std::string RedeployInstanceRequest::getRequestContent()const +{ + return requestContent_; +} + +void RedeployInstanceRequest::setRequestContent(const std::string& requestContent) +{ + requestContent_ = requestContent; + setParameter("RequestContent", requestContent); +} + +std::string RedeployInstanceRequest::getCallerBidEmail()const +{ + return callerBidEmail_; +} + +void RedeployInstanceRequest::setCallerBidEmail(const std::string& callerBidEmail) +{ + callerBidEmail_ = callerBidEmail; + setParameter("CallerBidEmail", callerBidEmail); +} + +std::string RedeployInstanceRequest::getCallerUidEmail()const +{ + return callerUidEmail_; +} + +void RedeployInstanceRequest::setCallerUidEmail(const std::string& callerUidEmail) +{ + callerUidEmail_ = callerUidEmail; + setParameter("CallerUidEmail", callerUidEmail); +} + +long RedeployInstanceRequest::getCallerUid()const +{ + return callerUid_; +} + +void RedeployInstanceRequest::setCallerUid(long callerUid) +{ + callerUid_ = callerUid; + setParameter("CallerUid", std::to_string(callerUid)); +} + +std::string RedeployInstanceRequest::getApp_ip()const +{ + return app_ip_; +} + +void RedeployInstanceRequest::setApp_ip(const std::string& app_ip) +{ + app_ip_ = app_ip; + setParameter("App_ip", app_ip); +} + +std::string RedeployInstanceRequest::getResourceOwnerAccount()const +{ + return resourceOwnerAccount_; +} + +void RedeployInstanceRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount) +{ + resourceOwnerAccount_ = resourceOwnerAccount; + setParameter("ResourceOwnerAccount", resourceOwnerAccount); +} + +std::string RedeployInstanceRequest::getOwnerAccount()const +{ + return ownerAccount_; +} + +void RedeployInstanceRequest::setOwnerAccount(const std::string& ownerAccount) +{ + ownerAccount_ = ownerAccount; + setParameter("OwnerAccount", ownerAccount); +} + +std::string RedeployInstanceRequest::getCallerBid()const +{ + return callerBid_; +} + +void RedeployInstanceRequest::setCallerBid(const std::string& callerBid) +{ + callerBid_ = callerBid; + setParameter("CallerBid", callerBid); +} + +long RedeployInstanceRequest::getOwnerId()const +{ + return ownerId_; +} + +void RedeployInstanceRequest::setOwnerId(long ownerId) +{ + ownerId_ = ownerId; + setParameter("OwnerId", std::to_string(ownerId)); +} + +bool RedeployInstanceRequest::getProxy_trust_transport_info()const +{ + return proxy_trust_transport_info_; +} + +void RedeployInstanceRequest::setProxy_trust_transport_info(bool proxy_trust_transport_info) +{ + proxy_trust_transport_info_ = proxy_trust_transport_info; + setParameter("Proxy_trust_transport_info", std::to_string(proxy_trust_transport_info)); +} + +bool RedeployInstanceRequest::getAk_mfa_present()const +{ + return ak_mfa_present_; +} + +void RedeployInstanceRequest::setAk_mfa_present(bool ak_mfa_present) +{ + ak_mfa_present_ = ak_mfa_present; + setParameter("Ak_mfa_present", std::to_string(ak_mfa_present)); +} + +bool RedeployInstanceRequest::getSecurity_transport()const +{ + return security_transport_; +} + +void RedeployInstanceRequest::setSecurity_transport(bool security_transport) +{ + security_transport_ = security_transport; + setParameter("Security_transport", std::to_string(security_transport)); +} + +std::string RedeployInstanceRequest::getInstanceId()const +{ + return instanceId_; +} + +void RedeployInstanceRequest::setInstanceId(const std::string& instanceId) +{ + instanceId_ = instanceId; + setParameter("InstanceId", instanceId); +} + +std::string RedeployInstanceRequest::getRequestId()const +{ + return requestId_; +} + +void RedeployInstanceRequest::setRequestId(const std::string& requestId) +{ + requestId_ = requestId; + setParameter("RequestId", requestId); +} + diff --git a/ecs/src/model/RedeployInstanceResult.cc b/ecs/src/model/RedeployInstanceResult.cc new file mode 100644 index 000000000..29b89e5a5 --- /dev/null +++ b/ecs/src/model/RedeployInstanceResult.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 +#include + +using namespace AlibabaCloud::Ecs; +using namespace AlibabaCloud::Ecs::Model; + +RedeployInstanceResult::RedeployInstanceResult() : + ServiceResult() +{} + +RedeployInstanceResult::RedeployInstanceResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +RedeployInstanceResult::~RedeployInstanceResult() +{} + +void RedeployInstanceResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + + setRequestId(value["RequestId"].asString()); + +} +