ResizeClusterV2Request.cc 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /*
  2. * Copyright 2009-2017 Alibaba Cloud All rights reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #include <alibabacloud/emr/model/ResizeClusterV2Request.h>
  17. using AlibabaCloud::Emr::Model::ResizeClusterV2Request;
  18. ResizeClusterV2Request::ResizeClusterV2Request() :
  19. RpcServiceRequest("emr", "2016-04-08", "ResizeClusterV2")
  20. {}
  21. ResizeClusterV2Request::~ResizeClusterV2Request()
  22. {}
  23. std::string ResizeClusterV2Request::getVswitchId()const
  24. {
  25. return vswitchId_;
  26. }
  27. void ResizeClusterV2Request::setVswitchId(const std::string& vswitchId)
  28. {
  29. vswitchId_ = vswitchId;
  30. setCoreParameter("VswitchId", vswitchId);
  31. }
  32. bool ResizeClusterV2Request::getIsOpenPublicIp()const
  33. {
  34. return isOpenPublicIp_;
  35. }
  36. void ResizeClusterV2Request::setIsOpenPublicIp(bool isOpenPublicIp)
  37. {
  38. isOpenPublicIp_ = isOpenPublicIp;
  39. setCoreParameter("IsOpenPublicIp", isOpenPublicIp ? "true" : "false");
  40. }
  41. bool ResizeClusterV2Request::getAutoPayOrder()const
  42. {
  43. return autoPayOrder_;
  44. }
  45. void ResizeClusterV2Request::setAutoPayOrder(bool autoPayOrder)
  46. {
  47. autoPayOrder_ = autoPayOrder;
  48. setCoreParameter("AutoPayOrder", autoPayOrder ? "true" : "false");
  49. }
  50. std::vector<ResizeClusterV2Request::HostComponentInfo> ResizeClusterV2Request::getHostComponentInfo()const
  51. {
  52. return hostComponentInfo_;
  53. }
  54. void ResizeClusterV2Request::setHostComponentInfo(const std::vector<HostComponentInfo>& hostComponentInfo)
  55. {
  56. hostComponentInfo_ = hostComponentInfo;
  57. int i = 0;
  58. for(int i = 0; i!= hostComponentInfo.size(); i++) {
  59. auto obj = hostComponentInfo.at(i);
  60. std::string str ="HostComponentInfo."+ std::to_string(i);
  61. setCoreParameter(str + ".HostName", obj.hostName);
  62. for(int i = 0; i!= obj.componentNameList.size(); i++) setCoreParameter(str + ".ComponentNameList."+ std::to_string(i), obj.componentNameList.at(i));
  63. setCoreParameter(str + ".ServiceName", obj.serviceName);
  64. }
  65. }
  66. std::string ResizeClusterV2Request::getRegionId()const
  67. {
  68. return regionId_;
  69. }
  70. void ResizeClusterV2Request::setRegionId(const std::string& regionId)
  71. {
  72. regionId_ = regionId;
  73. setCoreParameter("RegionId", regionId);
  74. }
  75. std::vector<ResizeClusterV2Request::HostGroup> ResizeClusterV2Request::getHostGroup()const
  76. {
  77. return hostGroup_;
  78. }
  79. void ResizeClusterV2Request::setHostGroup(const std::vector<HostGroup>& hostGroup)
  80. {
  81. hostGroup_ = hostGroup;
  82. int i = 0;
  83. for(int i = 0; i!= hostGroup.size(); i++) {
  84. auto obj = hostGroup.at(i);
  85. std::string str ="HostGroup."+ std::to_string(i);
  86. setCoreParameter(str + ".Period", std::to_string(obj.period));
  87. setCoreParameter(str + ".SysDiskCapacity", std::to_string(obj.sysDiskCapacity));
  88. setCoreParameter(str + ".HostKeyPairName", obj.hostKeyPairName);
  89. setCoreParameter(str + ".DiskCapacity", std::to_string(obj.diskCapacity));
  90. setCoreParameter(str + ".SysDiskType", obj.sysDiskType);
  91. setCoreParameter(str + ".ClusterId", obj.clusterId);
  92. setCoreParameter(str + ".DiskType", obj.diskType);
  93. setCoreParameter(str + ".HostGroupName", obj.hostGroupName);
  94. setCoreParameter(str + ".VswitchId", std::to_string(obj.vswitchId));
  95. setCoreParameter(str + ".DiskCount", std::to_string(obj.diskCount));
  96. setCoreParameter(str + ".AutoRenew", obj.autoRenew ? "true" : "false");
  97. setCoreParameter(str + ".HostGroupId", obj.hostGroupId);
  98. setCoreParameter(str + ".NodeCount", std::to_string(obj.nodeCount));
  99. setCoreParameter(str + ".InstanceType", obj.instanceType);
  100. setCoreParameter(str + ".Comment", obj.comment);
  101. setCoreParameter(str + ".ChargeType", obj.chargeType);
  102. setCoreParameter(str + ".CreateType", obj.createType);
  103. setCoreParameter(str + ".HostPassword", obj.hostPassword);
  104. setCoreParameter(str + ".HostGroupType", obj.hostGroupType);
  105. }
  106. }
  107. std::string ResizeClusterV2Request::getClusterId()const
  108. {
  109. return clusterId_;
  110. }
  111. void ResizeClusterV2Request::setClusterId(const std::string& clusterId)
  112. {
  113. clusterId_ = clusterId;
  114. setCoreParameter("ClusterId", clusterId);
  115. }
  116. std::string ResizeClusterV2Request::getAccessKeyId()const
  117. {
  118. return accessKeyId_;
  119. }
  120. void ResizeClusterV2Request::setAccessKeyId(const std::string& accessKeyId)
  121. {
  122. accessKeyId_ = accessKeyId;
  123. setCoreParameter("AccessKeyId", accessKeyId);
  124. }