From ab7e92063b342453d774b99fb9113d09dacb8931 Mon Sep 17 00:00:00 2001 From: sdk-team Date: Mon, 11 May 2020 18:08:58 +0800 Subject: [PATCH] Add new openapi ApplyNodes. --- CHANGELOG | 3 + VERSION | 2 +- ehpc/CMakeLists.txt | 4 + ehpc/include/alibabacloud/ehpc/EHPCClient.h | 8 + .../ehpc/model/ApplyNodesRequest.h | 122 +++++++ .../ehpc/model/ApplyNodesResult.h | 53 +++ .../ehpc/model/CreateHybridClusterRequest.h | 90 +++-- .../ehpc/model/DescribeClusterResult.h | 1 + .../ehpc/model/GetAutoScaleConfigResult.h | 1 + .../ehpc/model/ListClustersResult.h | 3 + .../model/ModifyClusterAttributesRequest.h | 6 + .../ehpc/model/SetAutoScaleConfigRequest.h | 1 + ehpc/src/EHPCClient.cc | 42 ++- ehpc/src/model/ApplyNodesRequest.cc | 281 +++++++++++++++ ehpc/src/model/ApplyNodesResult.cc | 59 +++ ehpc/src/model/CreateHybridClusterRequest.cc | 340 ++++++++++-------- ehpc/src/model/DescribeClusterResult.cc | 2 + ehpc/src/model/GetAutoScaleConfigResult.cc | 2 + ehpc/src/model/ListClustersResult.cc | 6 + .../model/ModifyClusterAttributesRequest.cc | 22 ++ ehpc/src/model/SetAutoScaleConfigRequest.cc | 1 + 21 files changed, 858 insertions(+), 191 deletions(-) create mode 100644 ehpc/include/alibabacloud/ehpc/model/ApplyNodesRequest.h create mode 100644 ehpc/include/alibabacloud/ehpc/model/ApplyNodesResult.h create mode 100644 ehpc/src/model/ApplyNodesRequest.cc create mode 100644 ehpc/src/model/ApplyNodesResult.cc diff --git a/CHANGELOG b/CHANGELOG index e28fd63e8..d972da9a3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2020-05-11 Version: 1.36.403 +- Add new openapi ApplyNodes. + 2020-05-11 Version: 1.36.402 - Support CreationCategory for CreateDBCluster. diff --git a/VERSION b/VERSION index 1ce848238..afb4f6fd8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.402 \ No newline at end of file +1.36.403 \ No newline at end of file diff --git a/ehpc/CMakeLists.txt b/ehpc/CMakeLists.txt index c85642f52..90ebf7a00 100644 --- a/ehpc/CMakeLists.txt +++ b/ehpc/CMakeLists.txt @@ -31,6 +31,8 @@ set(ehpc_public_header_model include/alibabacloud/ehpc/model/AddQueueResult.h include/alibabacloud/ehpc/model/AddUsersRequest.h include/alibabacloud/ehpc/model/AddUsersResult.h + include/alibabacloud/ehpc/model/ApplyNodesRequest.h + include/alibabacloud/ehpc/model/ApplyNodesResult.h include/alibabacloud/ehpc/model/BindAccountToClusterUserRequest.h include/alibabacloud/ehpc/model/BindAccountToClusterUserResult.h include/alibabacloud/ehpc/model/CreateClusterRequest.h @@ -258,6 +260,8 @@ set(ehpc_src src/model/AddQueueResult.cc src/model/AddUsersRequest.cc src/model/AddUsersResult.cc + src/model/ApplyNodesRequest.cc + src/model/ApplyNodesResult.cc src/model/BindAccountToClusterUserRequest.cc src/model/BindAccountToClusterUserResult.cc src/model/CreateClusterRequest.cc diff --git a/ehpc/include/alibabacloud/ehpc/EHPCClient.h b/ehpc/include/alibabacloud/ehpc/EHPCClient.h index 4fb639383..7003636b2 100644 --- a/ehpc/include/alibabacloud/ehpc/EHPCClient.h +++ b/ehpc/include/alibabacloud/ehpc/EHPCClient.h @@ -32,6 +32,8 @@ #include "model/AddQueueResult.h" #include "model/AddUsersRequest.h" #include "model/AddUsersResult.h" +#include "model/ApplyNodesRequest.h" +#include "model/ApplyNodesResult.h" #include "model/BindAccountToClusterUserRequest.h" #include "model/BindAccountToClusterUserResult.h" #include "model/CreateClusterRequest.h" @@ -270,6 +272,9 @@ namespace AlibabaCloud typedef Outcome AddUsersOutcome; typedef std::future AddUsersOutcomeCallable; typedef std::function&)> AddUsersAsyncHandler; + typedef Outcome ApplyNodesOutcome; + typedef std::future ApplyNodesOutcomeCallable; + typedef std::function&)> ApplyNodesAsyncHandler; typedef Outcome BindAccountToClusterUserOutcome; typedef std::future BindAccountToClusterUserOutcomeCallable; typedef std::function&)> BindAccountToClusterUserAsyncHandler; @@ -611,6 +616,9 @@ namespace AlibabaCloud AddUsersOutcome addUsers(const Model::AddUsersRequest &request)const; void addUsersAsync(const Model::AddUsersRequest& request, const AddUsersAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; AddUsersOutcomeCallable addUsersCallable(const Model::AddUsersRequest& request) const; + ApplyNodesOutcome applyNodes(const Model::ApplyNodesRequest &request)const; + void applyNodesAsync(const Model::ApplyNodesRequest& request, const ApplyNodesAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ApplyNodesOutcomeCallable applyNodesCallable(const Model::ApplyNodesRequest& request) const; BindAccountToClusterUserOutcome bindAccountToClusterUser(const Model::BindAccountToClusterUserRequest &request)const; void bindAccountToClusterUserAsync(const Model::BindAccountToClusterUserRequest& request, const BindAccountToClusterUserAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; BindAccountToClusterUserOutcomeCallable bindAccountToClusterUserCallable(const Model::BindAccountToClusterUserRequest& request) const; diff --git a/ehpc/include/alibabacloud/ehpc/model/ApplyNodesRequest.h b/ehpc/include/alibabacloud/ehpc/model/ApplyNodesRequest.h new file mode 100644 index 000000000..8ed539564 --- /dev/null +++ b/ehpc/include/alibabacloud/ehpc/model/ApplyNodesRequest.h @@ -0,0 +1,122 @@ +/* + * 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_EHPC_MODEL_APPLYNODESREQUEST_H_ +#define ALIBABACLOUD_EHPC_MODEL_APPLYNODESREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace EHPC + { + namespace Model + { + class ALIBABACLOUD_EHPC_EXPORT ApplyNodesRequest : public RpcServiceRequest + { + public: + struct ZoneInfos + { + std::string vSwitchId; + std::string zoneId; + }; + struct InstanceTypeModel + { + float maxPrice; + std::string instanceType; + }; + + public: + ApplyNodesRequest(); + ~ApplyNodesRequest(); + + std::string getImageId()const; + void setImageId(const std::string& imageId); + int getMemory()const; + void setMemory(int memory); + bool getAllocatePublicAddress()const; + void setAllocatePublicAddress(bool allocatePublicAddress); + int getInternetMaxBandWidthOut()const; + void setInternetMaxBandWidthOut(int internetMaxBandWidthOut); + std::string getResourceAmountType()const; + void setResourceAmountType(const std::string& resourceAmountType); + std::string getAccessKeyId()const; + void setAccessKeyId(const std::string& accessKeyId); + std::string getSystemDiskType()const; + void setSystemDiskType(const std::string& systemDiskType); + int getCores()const; + void setCores(int cores); + int getSystemDiskSize()const; + void setSystemDiskSize(int systemDiskSize); + std::vector getZoneInfos()const; + void setZoneInfos(const std::vector& zoneInfos); + std::string getHostNamePrefix()const; + void setHostNamePrefix(const std::string& hostNamePrefix); + std::string getComputeSpotPriceLimit()const; + void setComputeSpotPriceLimit(const std::string& computeSpotPriceLimit); + std::string getClusterId()const; + void setClusterId(const std::string& clusterId); + std::string getComputeSpotStrategy()const; + void setComputeSpotStrategy(const std::string& computeSpotStrategy); + std::string getHostNameSuffix()const; + void setHostNameSuffix(const std::string& hostNameSuffix); + std::string getPriorityStrategy()const; + void setPriorityStrategy(const std::string& priorityStrategy); + std::string getInstanceFamilyLevel()const; + void setInstanceFamilyLevel(const std::string& instanceFamilyLevel); + std::string getEcsChargeType()const; + void setEcsChargeType(const std::string& ecsChargeType); + std::string getInternetChargeType()const; + void setInternetChargeType(const std::string& internetChargeType); + std::vector getInstanceTypeModel()const; + void setInstanceTypeModel(const std::vector& instanceTypeModel); + int getInternetMaxBandWidthIn()const; + void setInternetMaxBandWidthIn(int internetMaxBandWidthIn); + int getTargetCapacity()const; + void setTargetCapacity(int targetCapacity); + + private: + std::string imageId_; + int memory_; + bool allocatePublicAddress_; + int internetMaxBandWidthOut_; + std::string resourceAmountType_; + std::string accessKeyId_; + std::string systemDiskType_; + int cores_; + int systemDiskSize_; + std::vector zoneInfos_; + std::string hostNamePrefix_; + std::string computeSpotPriceLimit_; + std::string clusterId_; + std::string computeSpotStrategy_; + std::string hostNameSuffix_; + std::string priorityStrategy_; + std::string instanceFamilyLevel_; + std::string ecsChargeType_; + std::string internetChargeType_; + std::vector instanceTypeModel_; + int internetMaxBandWidthIn_; + int targetCapacity_; + + }; + } + } +} +#endif // !ALIBABACLOUD_EHPC_MODEL_APPLYNODESREQUEST_H_ \ No newline at end of file diff --git a/ehpc/include/alibabacloud/ehpc/model/ApplyNodesResult.h b/ehpc/include/alibabacloud/ehpc/model/ApplyNodesResult.h new file mode 100644 index 000000000..75e13d61c --- /dev/null +++ b/ehpc/include/alibabacloud/ehpc/model/ApplyNodesResult.h @@ -0,0 +1,53 @@ +/* + * 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_EHPC_MODEL_APPLYNODESRESULT_H_ +#define ALIBABACLOUD_EHPC_MODEL_APPLYNODESRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace EHPC + { + namespace Model + { + class ALIBABACLOUD_EHPC_EXPORT ApplyNodesResult : public ServiceResult + { + public: + + + ApplyNodesResult(); + explicit ApplyNodesResult(const std::string &payload); + ~ApplyNodesResult(); + std::vector getInstanceIds()const; + std::string getDetail()const; + + protected: + void parse(const std::string &payload); + private: + std::vector instanceIds_; + std::string detail_; + + }; + } + } +} +#endif // !ALIBABACLOUD_EHPC_MODEL_APPLYNODESRESULT_H_ \ No newline at end of file diff --git a/ehpc/include/alibabacloud/ehpc/model/CreateHybridClusterRequest.h b/ehpc/include/alibabacloud/ehpc/model/CreateHybridClusterRequest.h index 02fd51f51..8f4d0aef6 100644 --- a/ehpc/include/alibabacloud/ehpc/model/CreateHybridClusterRequest.h +++ b/ehpc/include/alibabacloud/ehpc/model/CreateHybridClusterRequest.h @@ -53,99 +53,111 @@ namespace AlibabaCloud CreateHybridClusterRequest(); ~CreateHybridClusterRequest(); + std::string getKeyPairName()const; + void setKeyPairName(const std::string& keyPairName); + std::string getSecurityGroupName()const; + void setSecurityGroupName(const std::string& securityGroupName); + std::string getOnPremiseVolumeRemotePath()const; + void setOnPremiseVolumeRemotePath(const std::string& onPremiseVolumeRemotePath); + std::string getImageOwnerAlias()const; + void setImageOwnerAlias(const std::string& imageOwnerAlias); + std::string getResourceGroupId()const; + void setResourceGroupId(const std::string& resourceGroupId); + std::string getPassword()const; + void setPassword(const std::string& password); + float getComputeSpotPriceLimit()const; + void setComputeSpotPriceLimit(float computeSpotPriceLimit); + std::string getOnPremiseVolumeLocalPath()const; + void setOnPremiseVolumeLocalPath(const std::string& onPremiseVolumeLocalPath); + std::string getRemoteDirectory()const; + void setRemoteDirectory(const std::string& remoteDirectory); + std::string getComputeSpotStrategy()const; + void setComputeSpotStrategy(const std::string& computeSpotStrategy); + std::vector getPostInstallScript()const; + void setPostInstallScript(const std::vector& postInstallScript); + std::string getVSwitchId()const; + void setVSwitchId(const std::string& vSwitchId); + std::string getDomain()const; + void setDomain(const std::string& domain); + std::string getName()const; + void setName(const std::string& name); + std::string getVolumeId()const; + void setVolumeId(const std::string& volumeId); + std::string getZoneId()const; + void setZoneId(const std::string& zoneId); + std::string getImageId()const; + void setImageId(const std::string& imageId); std::string getEhpcVersion()const; void setEhpcVersion(const std::string& ehpcVersion); std::string getSecurityGroupId()const; void setSecurityGroupId(const std::string& securityGroupId); std::string getDescription()const; void setDescription(const std::string& description); - std::string getKeyPairName()const; - void setKeyPairName(const std::string& keyPairName); - std::string getSecurityGroupName()const; - void setSecurityGroupName(const std::string& securityGroupName); std::string getEcsOrderComputeInstanceType()const; void setEcsOrderComputeInstanceType(const std::string& ecsOrderComputeInstanceType); - std::string getOnPremiseVolumeRemotePath()const; - void setOnPremiseVolumeRemotePath(const std::string& onPremiseVolumeRemotePath); std::string getJobQueue()const; void setJobQueue(const std::string& jobQueue); std::string getAccessKeyId()const; void setAccessKeyId(const std::string& accessKeyId); std::string getVolumeType()const; void setVolumeType(const std::string& volumeType); - std::string getResourceGroupId()const; - void setResourceGroupId(const std::string& resourceGroupId); - std::string getPassword()const; - void setPassword(const std::string& password); std::string getOnPremiseVolumeMountPoint()const; void setOnPremiseVolumeMountPoint(const std::string& onPremiseVolumeMountPoint); std::string getOnPremiseVolumeProtocol()const; void setOnPremiseVolumeProtocol(const std::string& onPremiseVolumeProtocol); std::string getVolumeProtocol()const; void setVolumeProtocol(const std::string& volumeProtocol); - std::string getOnPremiseVolumeLocalPath()const; - void setOnPremiseVolumeLocalPath(const std::string& onPremiseVolumeLocalPath); std::string getClientVersion()const; void setClientVersion(const std::string& clientVersion); std::string getOsTag()const; void setOsTag(const std::string& osTag); - std::string getRemoteDirectory()const; - void setRemoteDirectory(const std::string& remoteDirectory); - std::vector getPostInstallScript()const; - void setPostInstallScript(const std::vector& postInstallScript); - std::string getVSwitchId()const; - void setVSwitchId(const std::string& vSwitchId); std::vector getNodes()const; void setNodes(const std::vector& nodes); std::vector getApplication()const; void setApplication(const std::vector& application); - std::string getDomain()const; - void setDomain(const std::string& domain); std::string getVpcId()const; void setVpcId(const std::string& vpcId); - std::string getName()const; - void setName(const std::string& name); - std::string getVolumeId()const; - void setVolumeId(const std::string& volumeId); std::string getVolumeMountpoint()const; void setVolumeMountpoint(const std::string& volumeMountpoint); - std::string getZoneId()const; - void setZoneId(const std::string& zoneId); bool getSchedulerPreInstall()const; void setSchedulerPreInstall(bool schedulerPreInstall); std::string getLocation()const; void setLocation(const std::string& location); private: + std::string keyPairName_; + std::string securityGroupName_; + std::string onPremiseVolumeRemotePath_; + std::string imageOwnerAlias_; + std::string resourceGroupId_; + std::string password_; + float computeSpotPriceLimit_; + std::string onPremiseVolumeLocalPath_; + std::string remoteDirectory_; + std::string computeSpotStrategy_; + std::vector postInstallScript_; + std::string vSwitchId_; + std::string domain_; + std::string name_; + std::string volumeId_; + std::string zoneId_; + std::string imageId_; std::string ehpcVersion_; std::string securityGroupId_; std::string description_; - std::string keyPairName_; - std::string securityGroupName_; std::string ecsOrderComputeInstanceType_; - std::string onPremiseVolumeRemotePath_; std::string jobQueue_; std::string accessKeyId_; std::string volumeType_; - std::string resourceGroupId_; - std::string password_; std::string onPremiseVolumeMountPoint_; std::string onPremiseVolumeProtocol_; std::string volumeProtocol_; - std::string onPremiseVolumeLocalPath_; std::string clientVersion_; std::string osTag_; - std::string remoteDirectory_; - std::vector postInstallScript_; - std::string vSwitchId_; std::vector nodes_; std::vector application_; - std::string domain_; std::string vpcId_; - std::string name_; - std::string volumeId_; std::string volumeMountpoint_; - std::string zoneId_; bool schedulerPreInstall_; std::string location_; diff --git a/ehpc/include/alibabacloud/ehpc/model/DescribeClusterResult.h b/ehpc/include/alibabacloud/ehpc/model/DescribeClusterResult.h index 7f28ab2e2..7478f6537 100644 --- a/ehpc/include/alibabacloud/ehpc/model/DescribeClusterResult.h +++ b/ehpc/include/alibabacloud/ehpc/model/DescribeClusterResult.h @@ -88,6 +88,7 @@ namespace AlibabaCloud std::string accountType; std::string volumeMountpoint; std::string baseOsTag; + std::string imageName; std::string vpcId; EcsInfo ecsInfo; bool haEnable; diff --git a/ehpc/include/alibabacloud/ehpc/model/GetAutoScaleConfigResult.h b/ehpc/include/alibabacloud/ehpc/model/GetAutoScaleConfigResult.h index 18a7136cc..0958f960b 100644 --- a/ehpc/include/alibabacloud/ehpc/model/GetAutoScaleConfigResult.h +++ b/ehpc/include/alibabacloud/ehpc/model/GetAutoScaleConfigResult.h @@ -43,6 +43,7 @@ namespace AlibabaCloud std::string instanceType; std::string spotStrategy; }; + int minNodesInQueue; int maxNodesInQueue; std::string resourceGroupId; bool enableAutoGrow; diff --git a/ehpc/include/alibabacloud/ehpc/model/ListClustersResult.h b/ehpc/include/alibabacloud/ehpc/model/ListClustersResult.h index 92b152f0d..61d34dc8d 100644 --- a/ehpc/include/alibabacloud/ehpc/model/ListClustersResult.h +++ b/ehpc/include/alibabacloud/ehpc/model/ListClustersResult.h @@ -65,6 +65,8 @@ namespace AlibabaCloud std::string imageOwnerAlias; std::string description; std::string nodePrefix; + std::string instanceChargeType; + float computeSpotPriceLimit; std::string nodeSuffix; int count; std::string name; @@ -79,6 +81,7 @@ namespace AlibabaCloud std::string vSwitchId; std::string createTime; std::string schedulerType; + std::string computeSpotStrategy; std::string accountType; std::string ehpcVersion; std::string baseOsTag; diff --git a/ehpc/include/alibabacloud/ehpc/model/ModifyClusterAttributesRequest.h b/ehpc/include/alibabacloud/ehpc/model/ModifyClusterAttributesRequest.h index 8747cf931..01b904e8c 100644 --- a/ehpc/include/alibabacloud/ehpc/model/ModifyClusterAttributesRequest.h +++ b/ehpc/include/alibabacloud/ehpc/model/ModifyClusterAttributesRequest.h @@ -35,19 +35,25 @@ namespace AlibabaCloud ModifyClusterAttributesRequest(); ~ModifyClusterAttributesRequest(); + std::string getImageId()const; + void setImageId(const std::string& imageId); std::string getDescription()const; void setDescription(const std::string& description); std::string getClusterId()const; void setClusterId(const std::string& clusterId); std::string getAccessKeyId()const; void setAccessKeyId(const std::string& accessKeyId); + std::string getImageOwnerAlias()const; + void setImageOwnerAlias(const std::string& imageOwnerAlias); std::string getName()const; void setName(const std::string& name); private: + std::string imageId_; std::string description_; std::string clusterId_; std::string accessKeyId_; + std::string imageOwnerAlias_; std::string name_; }; diff --git a/ehpc/include/alibabacloud/ehpc/model/SetAutoScaleConfigRequest.h b/ehpc/include/alibabacloud/ehpc/model/SetAutoScaleConfigRequest.h index a00013871..3cb288275 100644 --- a/ehpc/include/alibabacloud/ehpc/model/SetAutoScaleConfigRequest.h +++ b/ehpc/include/alibabacloud/ehpc/model/SetAutoScaleConfigRequest.h @@ -35,6 +35,7 @@ namespace AlibabaCloud { std::string spotStrategy; std::string queueName; + int minNodesInQueue; struct InstanceTypes { std::string spotStrategy; diff --git a/ehpc/src/EHPCClient.cc b/ehpc/src/EHPCClient.cc index 583e91919..7253f5f56 100644 --- a/ehpc/src/EHPCClient.cc +++ b/ehpc/src/EHPCClient.cc @@ -31,21 +31,21 @@ EHPCClient::EHPCClient(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, "ehs"); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); } EHPCClient::EHPCClient(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, "ehs"); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); } EHPCClient::EHPCClient(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, "ehs"); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); } EHPCClient::~EHPCClient() @@ -231,6 +231,42 @@ EHPCClient::AddUsersOutcomeCallable EHPCClient::addUsersCallable(const AddUsersR return task->get_future(); } +EHPCClient::ApplyNodesOutcome EHPCClient::applyNodes(const ApplyNodesRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ApplyNodesOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ApplyNodesOutcome(ApplyNodesResult(outcome.result())); + else + return ApplyNodesOutcome(outcome.error()); +} + +void EHPCClient::applyNodesAsync(const ApplyNodesRequest& request, const ApplyNodesAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, applyNodes(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +EHPCClient::ApplyNodesOutcomeCallable EHPCClient::applyNodesCallable(const ApplyNodesRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->applyNodes(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + EHPCClient::BindAccountToClusterUserOutcome EHPCClient::bindAccountToClusterUser(const BindAccountToClusterUserRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/ehpc/src/model/ApplyNodesRequest.cc b/ehpc/src/model/ApplyNodesRequest.cc new file mode 100644 index 000000000..5de4e6191 --- /dev/null +++ b/ehpc/src/model/ApplyNodesRequest.cc @@ -0,0 +1,281 @@ +/* + * 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::EHPC::Model::ApplyNodesRequest; + +ApplyNodesRequest::ApplyNodesRequest() : + RpcServiceRequest("ehpc", "2018-04-12", "ApplyNodes") +{ + setMethod(HttpRequest::Method::Get); +} + +ApplyNodesRequest::~ApplyNodesRequest() +{} + +std::string ApplyNodesRequest::getImageId()const +{ + return imageId_; +} + +void ApplyNodesRequest::setImageId(const std::string& imageId) +{ + imageId_ = imageId; + setParameter("ImageId", imageId); +} + +int ApplyNodesRequest::getMemory()const +{ + return memory_; +} + +void ApplyNodesRequest::setMemory(int memory) +{ + memory_ = memory; + setParameter("Memory", std::to_string(memory)); +} + +bool ApplyNodesRequest::getAllocatePublicAddress()const +{ + return allocatePublicAddress_; +} + +void ApplyNodesRequest::setAllocatePublicAddress(bool allocatePublicAddress) +{ + allocatePublicAddress_ = allocatePublicAddress; + setParameter("AllocatePublicAddress", allocatePublicAddress ? "true" : "false"); +} + +int ApplyNodesRequest::getInternetMaxBandWidthOut()const +{ + return internetMaxBandWidthOut_; +} + +void ApplyNodesRequest::setInternetMaxBandWidthOut(int internetMaxBandWidthOut) +{ + internetMaxBandWidthOut_ = internetMaxBandWidthOut; + setParameter("InternetMaxBandWidthOut", std::to_string(internetMaxBandWidthOut)); +} + +std::string ApplyNodesRequest::getResourceAmountType()const +{ + return resourceAmountType_; +} + +void ApplyNodesRequest::setResourceAmountType(const std::string& resourceAmountType) +{ + resourceAmountType_ = resourceAmountType; + setParameter("ResourceAmountType", resourceAmountType); +} + +std::string ApplyNodesRequest::getAccessKeyId()const +{ + return accessKeyId_; +} + +void ApplyNodesRequest::setAccessKeyId(const std::string& accessKeyId) +{ + accessKeyId_ = accessKeyId; + setParameter("AccessKeyId", accessKeyId); +} + +std::string ApplyNodesRequest::getSystemDiskType()const +{ + return systemDiskType_; +} + +void ApplyNodesRequest::setSystemDiskType(const std::string& systemDiskType) +{ + systemDiskType_ = systemDiskType; + setParameter("SystemDiskType", systemDiskType); +} + +int ApplyNodesRequest::getCores()const +{ + return cores_; +} + +void ApplyNodesRequest::setCores(int cores) +{ + cores_ = cores; + setParameter("Cores", std::to_string(cores)); +} + +int ApplyNodesRequest::getSystemDiskSize()const +{ + return systemDiskSize_; +} + +void ApplyNodesRequest::setSystemDiskSize(int systemDiskSize) +{ + systemDiskSize_ = systemDiskSize; + setParameter("SystemDiskSize", std::to_string(systemDiskSize)); +} + +std::vector ApplyNodesRequest::getZoneInfos()const +{ + return zoneInfos_; +} + +void ApplyNodesRequest::setZoneInfos(const std::vector& zoneInfos) +{ + zoneInfos_ = zoneInfos; + for(int dep1 = 0; dep1!= zoneInfos.size(); dep1++) { + auto zoneInfosObj = zoneInfos.at(dep1); + std::string zoneInfosObjStr = "ZoneInfos." + std::to_string(dep1 + 1); + setParameter(zoneInfosObjStr + ".VSwitchId", zoneInfosObj.vSwitchId); + setParameter(zoneInfosObjStr + ".ZoneId", zoneInfosObj.zoneId); + } +} + +std::string ApplyNodesRequest::getHostNamePrefix()const +{ + return hostNamePrefix_; +} + +void ApplyNodesRequest::setHostNamePrefix(const std::string& hostNamePrefix) +{ + hostNamePrefix_ = hostNamePrefix; + setParameter("HostNamePrefix", hostNamePrefix); +} + +std::string ApplyNodesRequest::getComputeSpotPriceLimit()const +{ + return computeSpotPriceLimit_; +} + +void ApplyNodesRequest::setComputeSpotPriceLimit(const std::string& computeSpotPriceLimit) +{ + computeSpotPriceLimit_ = computeSpotPriceLimit; + setParameter("ComputeSpotPriceLimit", computeSpotPriceLimit); +} + +std::string ApplyNodesRequest::getClusterId()const +{ + return clusterId_; +} + +void ApplyNodesRequest::setClusterId(const std::string& clusterId) +{ + clusterId_ = clusterId; + setParameter("ClusterId", clusterId); +} + +std::string ApplyNodesRequest::getComputeSpotStrategy()const +{ + return computeSpotStrategy_; +} + +void ApplyNodesRequest::setComputeSpotStrategy(const std::string& computeSpotStrategy) +{ + computeSpotStrategy_ = computeSpotStrategy; + setParameter("ComputeSpotStrategy", computeSpotStrategy); +} + +std::string ApplyNodesRequest::getHostNameSuffix()const +{ + return hostNameSuffix_; +} + +void ApplyNodesRequest::setHostNameSuffix(const std::string& hostNameSuffix) +{ + hostNameSuffix_ = hostNameSuffix; + setParameter("HostNameSuffix", hostNameSuffix); +} + +std::string ApplyNodesRequest::getPriorityStrategy()const +{ + return priorityStrategy_; +} + +void ApplyNodesRequest::setPriorityStrategy(const std::string& priorityStrategy) +{ + priorityStrategy_ = priorityStrategy; + setParameter("PriorityStrategy", priorityStrategy); +} + +std::string ApplyNodesRequest::getInstanceFamilyLevel()const +{ + return instanceFamilyLevel_; +} + +void ApplyNodesRequest::setInstanceFamilyLevel(const std::string& instanceFamilyLevel) +{ + instanceFamilyLevel_ = instanceFamilyLevel; + setParameter("InstanceFamilyLevel", instanceFamilyLevel); +} + +std::string ApplyNodesRequest::getEcsChargeType()const +{ + return ecsChargeType_; +} + +void ApplyNodesRequest::setEcsChargeType(const std::string& ecsChargeType) +{ + ecsChargeType_ = ecsChargeType; + setParameter("EcsChargeType", ecsChargeType); +} + +std::string ApplyNodesRequest::getInternetChargeType()const +{ + return internetChargeType_; +} + +void ApplyNodesRequest::setInternetChargeType(const std::string& internetChargeType) +{ + internetChargeType_ = internetChargeType; + setParameter("InternetChargeType", internetChargeType); +} + +std::vector ApplyNodesRequest::getInstanceTypeModel()const +{ + return instanceTypeModel_; +} + +void ApplyNodesRequest::setInstanceTypeModel(const std::vector& instanceTypeModel) +{ + instanceTypeModel_ = instanceTypeModel; + for(int dep1 = 0; dep1!= instanceTypeModel.size(); dep1++) { + auto instanceTypeModelObj = instanceTypeModel.at(dep1); + std::string instanceTypeModelObjStr = "InstanceTypeModel." + std::to_string(dep1 + 1); + setParameter(instanceTypeModelObjStr + ".MaxPrice", std::to_string(instanceTypeModelObj.maxPrice)); + setParameter(instanceTypeModelObjStr + ".InstanceType", instanceTypeModelObj.instanceType); + } +} + +int ApplyNodesRequest::getInternetMaxBandWidthIn()const +{ + return internetMaxBandWidthIn_; +} + +void ApplyNodesRequest::setInternetMaxBandWidthIn(int internetMaxBandWidthIn) +{ + internetMaxBandWidthIn_ = internetMaxBandWidthIn; + setParameter("InternetMaxBandWidthIn", std::to_string(internetMaxBandWidthIn)); +} + +int ApplyNodesRequest::getTargetCapacity()const +{ + return targetCapacity_; +} + +void ApplyNodesRequest::setTargetCapacity(int targetCapacity) +{ + targetCapacity_ = targetCapacity; + setParameter("TargetCapacity", std::to_string(targetCapacity)); +} + diff --git a/ehpc/src/model/ApplyNodesResult.cc b/ehpc/src/model/ApplyNodesResult.cc new file mode 100644 index 000000000..785770b61 --- /dev/null +++ b/ehpc/src/model/ApplyNodesResult.cc @@ -0,0 +1,59 @@ +/* + * 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::EHPC; +using namespace AlibabaCloud::EHPC::Model; + +ApplyNodesResult::ApplyNodesResult() : + ServiceResult() +{} + +ApplyNodesResult::ApplyNodesResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ApplyNodesResult::~ApplyNodesResult() +{} + +void ApplyNodesResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto allInstanceIds = value["InstanceIds"]["InstanceId"]; + for (const auto &item : allInstanceIds) + instanceIds_.push_back(item.asString()); + if(!value["Detail"].isNull()) + detail_ = value["Detail"].asString(); + +} + +std::vector ApplyNodesResult::getInstanceIds()const +{ + return instanceIds_; +} + +std::string ApplyNodesResult::getDetail()const +{ + return detail_; +} + diff --git a/ehpc/src/model/CreateHybridClusterRequest.cc b/ehpc/src/model/CreateHybridClusterRequest.cc index 8199bd4b7..0964035a4 100644 --- a/ehpc/src/model/CreateHybridClusterRequest.cc +++ b/ehpc/src/model/CreateHybridClusterRequest.cc @@ -27,6 +27,198 @@ CreateHybridClusterRequest::CreateHybridClusterRequest() : CreateHybridClusterRequest::~CreateHybridClusterRequest() {} +std::string CreateHybridClusterRequest::getKeyPairName()const +{ + return keyPairName_; +} + +void CreateHybridClusterRequest::setKeyPairName(const std::string& keyPairName) +{ + keyPairName_ = keyPairName; + setParameter("KeyPairName", keyPairName); +} + +std::string CreateHybridClusterRequest::getSecurityGroupName()const +{ + return securityGroupName_; +} + +void CreateHybridClusterRequest::setSecurityGroupName(const std::string& securityGroupName) +{ + securityGroupName_ = securityGroupName; + setParameter("SecurityGroupName", securityGroupName); +} + +std::string CreateHybridClusterRequest::getOnPremiseVolumeRemotePath()const +{ + return onPremiseVolumeRemotePath_; +} + +void CreateHybridClusterRequest::setOnPremiseVolumeRemotePath(const std::string& onPremiseVolumeRemotePath) +{ + onPremiseVolumeRemotePath_ = onPremiseVolumeRemotePath; + setParameter("OnPremiseVolumeRemotePath", onPremiseVolumeRemotePath); +} + +std::string CreateHybridClusterRequest::getImageOwnerAlias()const +{ + return imageOwnerAlias_; +} + +void CreateHybridClusterRequest::setImageOwnerAlias(const std::string& imageOwnerAlias) +{ + imageOwnerAlias_ = imageOwnerAlias; + setParameter("ImageOwnerAlias", imageOwnerAlias); +} + +std::string CreateHybridClusterRequest::getResourceGroupId()const +{ + return resourceGroupId_; +} + +void CreateHybridClusterRequest::setResourceGroupId(const std::string& resourceGroupId) +{ + resourceGroupId_ = resourceGroupId; + setParameter("ResourceGroupId", resourceGroupId); +} + +std::string CreateHybridClusterRequest::getPassword()const +{ + return password_; +} + +void CreateHybridClusterRequest::setPassword(const std::string& password) +{ + password_ = password; + setParameter("Password", password); +} + +float CreateHybridClusterRequest::getComputeSpotPriceLimit()const +{ + return computeSpotPriceLimit_; +} + +void CreateHybridClusterRequest::setComputeSpotPriceLimit(float computeSpotPriceLimit) +{ + computeSpotPriceLimit_ = computeSpotPriceLimit; + setParameter("ComputeSpotPriceLimit", std::to_string(computeSpotPriceLimit)); +} + +std::string CreateHybridClusterRequest::getOnPremiseVolumeLocalPath()const +{ + return onPremiseVolumeLocalPath_; +} + +void CreateHybridClusterRequest::setOnPremiseVolumeLocalPath(const std::string& onPremiseVolumeLocalPath) +{ + onPremiseVolumeLocalPath_ = onPremiseVolumeLocalPath; + setParameter("OnPremiseVolumeLocalPath", onPremiseVolumeLocalPath); +} + +std::string CreateHybridClusterRequest::getRemoteDirectory()const +{ + return remoteDirectory_; +} + +void CreateHybridClusterRequest::setRemoteDirectory(const std::string& remoteDirectory) +{ + remoteDirectory_ = remoteDirectory; + setParameter("RemoteDirectory", remoteDirectory); +} + +std::string CreateHybridClusterRequest::getComputeSpotStrategy()const +{ + return computeSpotStrategy_; +} + +void CreateHybridClusterRequest::setComputeSpotStrategy(const std::string& computeSpotStrategy) +{ + computeSpotStrategy_ = computeSpotStrategy; + setParameter("ComputeSpotStrategy", computeSpotStrategy); +} + +std::vector CreateHybridClusterRequest::getPostInstallScript()const +{ + return postInstallScript_; +} + +void CreateHybridClusterRequest::setPostInstallScript(const std::vector& postInstallScript) +{ + postInstallScript_ = postInstallScript; + for(int dep1 = 0; dep1!= postInstallScript.size(); dep1++) { + auto postInstallScriptObj = postInstallScript.at(dep1); + std::string postInstallScriptObjStr = "PostInstallScript." + std::to_string(dep1 + 1); + setParameter(postInstallScriptObjStr + ".Args", postInstallScriptObj.args); + setParameter(postInstallScriptObjStr + ".Url", postInstallScriptObj.url); + } +} + +std::string CreateHybridClusterRequest::getVSwitchId()const +{ + return vSwitchId_; +} + +void CreateHybridClusterRequest::setVSwitchId(const std::string& vSwitchId) +{ + vSwitchId_ = vSwitchId; + setParameter("VSwitchId", vSwitchId); +} + +std::string CreateHybridClusterRequest::getDomain()const +{ + return domain_; +} + +void CreateHybridClusterRequest::setDomain(const std::string& domain) +{ + domain_ = domain; + setParameter("Domain", domain); +} + +std::string CreateHybridClusterRequest::getName()const +{ + return name_; +} + +void CreateHybridClusterRequest::setName(const std::string& name) +{ + name_ = name; + setParameter("Name", name); +} + +std::string CreateHybridClusterRequest::getVolumeId()const +{ + return volumeId_; +} + +void CreateHybridClusterRequest::setVolumeId(const std::string& volumeId) +{ + volumeId_ = volumeId; + setParameter("VolumeId", volumeId); +} + +std::string CreateHybridClusterRequest::getZoneId()const +{ + return zoneId_; +} + +void CreateHybridClusterRequest::setZoneId(const std::string& zoneId) +{ + zoneId_ = zoneId; + setParameter("ZoneId", zoneId); +} + +std::string CreateHybridClusterRequest::getImageId()const +{ + return imageId_; +} + +void CreateHybridClusterRequest::setImageId(const std::string& imageId) +{ + imageId_ = imageId; + setParameter("ImageId", imageId); +} + std::string CreateHybridClusterRequest::getEhpcVersion()const { return ehpcVersion_; @@ -60,28 +252,6 @@ void CreateHybridClusterRequest::setDescription(const std::string& description) setParameter("Description", description); } -std::string CreateHybridClusterRequest::getKeyPairName()const -{ - return keyPairName_; -} - -void CreateHybridClusterRequest::setKeyPairName(const std::string& keyPairName) -{ - keyPairName_ = keyPairName; - setParameter("KeyPairName", keyPairName); -} - -std::string CreateHybridClusterRequest::getSecurityGroupName()const -{ - return securityGroupName_; -} - -void CreateHybridClusterRequest::setSecurityGroupName(const std::string& securityGroupName) -{ - securityGroupName_ = securityGroupName; - setParameter("SecurityGroupName", securityGroupName); -} - std::string CreateHybridClusterRequest::getEcsOrderComputeInstanceType()const { return ecsOrderComputeInstanceType_; @@ -93,17 +263,6 @@ void CreateHybridClusterRequest::setEcsOrderComputeInstanceType(const std::strin setParameter("EcsOrderComputeInstanceType", ecsOrderComputeInstanceType); } -std::string CreateHybridClusterRequest::getOnPremiseVolumeRemotePath()const -{ - return onPremiseVolumeRemotePath_; -} - -void CreateHybridClusterRequest::setOnPremiseVolumeRemotePath(const std::string& onPremiseVolumeRemotePath) -{ - onPremiseVolumeRemotePath_ = onPremiseVolumeRemotePath; - setParameter("OnPremiseVolumeRemotePath", onPremiseVolumeRemotePath); -} - std::string CreateHybridClusterRequest::getJobQueue()const { return jobQueue_; @@ -137,28 +296,6 @@ void CreateHybridClusterRequest::setVolumeType(const std::string& volumeType) setParameter("VolumeType", volumeType); } -std::string CreateHybridClusterRequest::getResourceGroupId()const -{ - return resourceGroupId_; -} - -void CreateHybridClusterRequest::setResourceGroupId(const std::string& resourceGroupId) -{ - resourceGroupId_ = resourceGroupId; - setParameter("ResourceGroupId", resourceGroupId); -} - -std::string CreateHybridClusterRequest::getPassword()const -{ - return password_; -} - -void CreateHybridClusterRequest::setPassword(const std::string& password) -{ - password_ = password; - setParameter("Password", password); -} - std::string CreateHybridClusterRequest::getOnPremiseVolumeMountPoint()const { return onPremiseVolumeMountPoint_; @@ -192,17 +329,6 @@ void CreateHybridClusterRequest::setVolumeProtocol(const std::string& volumeProt setParameter("VolumeProtocol", volumeProtocol); } -std::string CreateHybridClusterRequest::getOnPremiseVolumeLocalPath()const -{ - return onPremiseVolumeLocalPath_; -} - -void CreateHybridClusterRequest::setOnPremiseVolumeLocalPath(const std::string& onPremiseVolumeLocalPath) -{ - onPremiseVolumeLocalPath_ = onPremiseVolumeLocalPath; - setParameter("OnPremiseVolumeLocalPath", onPremiseVolumeLocalPath); -} - std::string CreateHybridClusterRequest::getClientVersion()const { return clientVersion_; @@ -225,44 +351,6 @@ void CreateHybridClusterRequest::setOsTag(const std::string& osTag) setParameter("OsTag", osTag); } -std::string CreateHybridClusterRequest::getRemoteDirectory()const -{ - return remoteDirectory_; -} - -void CreateHybridClusterRequest::setRemoteDirectory(const std::string& remoteDirectory) -{ - remoteDirectory_ = remoteDirectory; - setParameter("RemoteDirectory", remoteDirectory); -} - -std::vector CreateHybridClusterRequest::getPostInstallScript()const -{ - return postInstallScript_; -} - -void CreateHybridClusterRequest::setPostInstallScript(const std::vector& postInstallScript) -{ - postInstallScript_ = postInstallScript; - for(int dep1 = 0; dep1!= postInstallScript.size(); dep1++) { - auto postInstallScriptObj = postInstallScript.at(dep1); - std::string postInstallScriptObjStr = "PostInstallScript." + std::to_string(dep1 + 1); - setParameter(postInstallScriptObjStr + ".Args", postInstallScriptObj.args); - setParameter(postInstallScriptObjStr + ".Url", postInstallScriptObj.url); - } -} - -std::string CreateHybridClusterRequest::getVSwitchId()const -{ - return vSwitchId_; -} - -void CreateHybridClusterRequest::setVSwitchId(const std::string& vSwitchId) -{ - vSwitchId_ = vSwitchId; - setParameter("VSwitchId", vSwitchId); -} - std::vector CreateHybridClusterRequest::getNodes()const { return nodes_; @@ -297,17 +385,6 @@ void CreateHybridClusterRequest::setApplication(const std::vector& } } -std::string CreateHybridClusterRequest::getDomain()const -{ - return domain_; -} - -void CreateHybridClusterRequest::setDomain(const std::string& domain) -{ - domain_ = domain; - setParameter("Domain", domain); -} - std::string CreateHybridClusterRequest::getVpcId()const { return vpcId_; @@ -319,28 +396,6 @@ void CreateHybridClusterRequest::setVpcId(const std::string& vpcId) setParameter("VpcId", vpcId); } -std::string CreateHybridClusterRequest::getName()const -{ - return name_; -} - -void CreateHybridClusterRequest::setName(const std::string& name) -{ - name_ = name; - setParameter("Name", name); -} - -std::string CreateHybridClusterRequest::getVolumeId()const -{ - return volumeId_; -} - -void CreateHybridClusterRequest::setVolumeId(const std::string& volumeId) -{ - volumeId_ = volumeId; - setParameter("VolumeId", volumeId); -} - std::string CreateHybridClusterRequest::getVolumeMountpoint()const { return volumeMountpoint_; @@ -352,17 +407,6 @@ void CreateHybridClusterRequest::setVolumeMountpoint(const std::string& volumeMo setParameter("VolumeMountpoint", volumeMountpoint); } -std::string CreateHybridClusterRequest::getZoneId()const -{ - return zoneId_; -} - -void CreateHybridClusterRequest::setZoneId(const std::string& zoneId) -{ - zoneId_ = zoneId; - setParameter("ZoneId", zoneId); -} - bool CreateHybridClusterRequest::getSchedulerPreInstall()const { return schedulerPreInstall_; diff --git a/ehpc/src/model/DescribeClusterResult.cc b/ehpc/src/model/DescribeClusterResult.cc index c369431ef..8370b44b7 100644 --- a/ehpc/src/model/DescribeClusterResult.cc +++ b/ehpc/src/model/DescribeClusterResult.cc @@ -94,6 +94,8 @@ void DescribeClusterResult::parse(const std::string &payload) clusterInfo_.location = clusterInfoNode["Location"].asString(); if(!clusterInfoNode["BaseOsTag"].isNull()) clusterInfo_.baseOsTag = clusterInfoNode["BaseOsTag"].asString(); + if(!clusterInfoNode["ImageName"].isNull()) + clusterInfo_.imageName = clusterInfoNode["ImageName"].asString(); auto allApplicationsNode = clusterInfoNode["Applications"]["ApplicationInfo"]; for (auto clusterInfoNodeApplicationsApplicationInfo : allApplicationsNode) { diff --git a/ehpc/src/model/GetAutoScaleConfigResult.cc b/ehpc/src/model/GetAutoScaleConfigResult.cc index 8a0ab20a6..8a358172b 100644 --- a/ehpc/src/model/GetAutoScaleConfigResult.cc +++ b/ehpc/src/model/GetAutoScaleConfigResult.cc @@ -59,6 +59,8 @@ void GetAutoScaleConfigResult::parse(const std::string &payload) queuesObject.enableAutoShrink = valueQueuesQueueInfo["EnableAutoShrink"].asString() == "true"; if(!valueQueuesQueueInfo["MaxNodesInQueue"].isNull()) queuesObject.maxNodesInQueue = std::stoi(valueQueuesQueueInfo["MaxNodesInQueue"].asString()); + if(!valueQueuesQueueInfo["MinNodesInQueue"].isNull()) + queuesObject.minNodesInQueue = std::stoi(valueQueuesQueueInfo["MinNodesInQueue"].asString()); auto allInstanceTypesNode = allQueuesNode["InstanceTypes"]["InstanceTypeInfo"]; for (auto allQueuesNodeInstanceTypesInstanceTypeInfo : allInstanceTypesNode) { diff --git a/ehpc/src/model/ListClustersResult.cc b/ehpc/src/model/ListClustersResult.cc index fcdf3ff7b..00cece95e 100644 --- a/ehpc/src/model/ListClustersResult.cc +++ b/ehpc/src/model/ListClustersResult.cc @@ -89,6 +89,12 @@ void ListClustersResult::parse(const std::string &payload) clustersObject.nodeSuffix = valueClustersClusterInfoSimple["NodeSuffix"].asString(); if(!valueClustersClusterInfoSimple["BaseOsTag"].isNull()) clustersObject.baseOsTag = valueClustersClusterInfoSimple["BaseOsTag"].asString(); + if(!valueClustersClusterInfoSimple["InstanceChargeType"].isNull()) + clustersObject.instanceChargeType = valueClustersClusterInfoSimple["InstanceChargeType"].asString(); + if(!valueClustersClusterInfoSimple["ComputeSpotStrategy"].isNull()) + clustersObject.computeSpotStrategy = valueClustersClusterInfoSimple["ComputeSpotStrategy"].asString(); + if(!valueClustersClusterInfoSimple["ComputeSpotPriceLimit"].isNull()) + clustersObject.computeSpotPriceLimit = std::stof(valueClustersClusterInfoSimple["ComputeSpotPriceLimit"].asString()); auto managersNode = value["Managers"]; if(!managersNode["Total"].isNull()) clustersObject.managers.total = std::stoi(managersNode["Total"].asString()); diff --git a/ehpc/src/model/ModifyClusterAttributesRequest.cc b/ehpc/src/model/ModifyClusterAttributesRequest.cc index cd5d648b3..39ff451aa 100644 --- a/ehpc/src/model/ModifyClusterAttributesRequest.cc +++ b/ehpc/src/model/ModifyClusterAttributesRequest.cc @@ -27,6 +27,17 @@ ModifyClusterAttributesRequest::ModifyClusterAttributesRequest() : ModifyClusterAttributesRequest::~ModifyClusterAttributesRequest() {} +std::string ModifyClusterAttributesRequest::getImageId()const +{ + return imageId_; +} + +void ModifyClusterAttributesRequest::setImageId(const std::string& imageId) +{ + imageId_ = imageId; + setParameter("ImageId", imageId); +} + std::string ModifyClusterAttributesRequest::getDescription()const { return description_; @@ -60,6 +71,17 @@ void ModifyClusterAttributesRequest::setAccessKeyId(const std::string& accessKey setParameter("AccessKeyId", accessKeyId); } +std::string ModifyClusterAttributesRequest::getImageOwnerAlias()const +{ + return imageOwnerAlias_; +} + +void ModifyClusterAttributesRequest::setImageOwnerAlias(const std::string& imageOwnerAlias) +{ + imageOwnerAlias_ = imageOwnerAlias; + setParameter("ImageOwnerAlias", imageOwnerAlias); +} + std::string ModifyClusterAttributesRequest::getName()const { return name_; diff --git a/ehpc/src/model/SetAutoScaleConfigRequest.cc b/ehpc/src/model/SetAutoScaleConfigRequest.cc index 60c9c1331..6fd55b082 100644 --- a/ehpc/src/model/SetAutoScaleConfigRequest.cc +++ b/ehpc/src/model/SetAutoScaleConfigRequest.cc @@ -183,6 +183,7 @@ void SetAutoScaleConfigRequest::setQueues(const std::vector& queues) std::string queuesObjStr = "Queues." + std::to_string(dep1 + 1); setParameter(queuesObjStr + ".SpotStrategy", queuesObj.spotStrategy); setParameter(queuesObjStr + ".QueueName", queuesObj.queueName); + setParameter(queuesObjStr + ".MinNodesInQueue", std::to_string(queuesObj.minNodesInQueue)); for(int dep2 = 0; dep2!= queuesObj.instanceTypes.size(); dep2++) { auto instanceTypesObj = queuesObj.instanceTypes.at(dep2); std::string instanceTypesObjStr = queuesObjStr + "InstanceTypes." + std::to_string(dep2 + 1);