CreateServerGroupRequest.cc 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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/gwlb/model/CreateServerGroupRequest.h>
  17. using AlibabaCloud::Gwlb::Model::CreateServerGroupRequest;
  18. CreateServerGroupRequest::CreateServerGroupRequest()
  19. : RpcServiceRequest("gwlb", "2024-04-15", "CreateServerGroup") {
  20. setMethod(HttpRequest::Method::Post);
  21. }
  22. CreateServerGroupRequest::~CreateServerGroupRequest() {}
  23. std::string CreateServerGroupRequest::getServerGroupName() const {
  24. return serverGroupName_;
  25. }
  26. void CreateServerGroupRequest::setServerGroupName(const std::string &serverGroupName) {
  27. serverGroupName_ = serverGroupName;
  28. setBodyParameter(std::string("ServerGroupName"), serverGroupName);
  29. }
  30. std::string CreateServerGroupRequest::getClientToken() const {
  31. return clientToken_;
  32. }
  33. void CreateServerGroupRequest::setClientToken(const std::string &clientToken) {
  34. clientToken_ = clientToken;
  35. setBodyParameter(std::string("ClientToken"), clientToken);
  36. }
  37. CreateServerGroupRequest::HealthCheckConfig CreateServerGroupRequest::getHealthCheckConfig() const {
  38. return healthCheckConfig_;
  39. }
  40. void CreateServerGroupRequest::setHealthCheckConfig(const CreateServerGroupRequest::HealthCheckConfig &healthCheckConfig) {
  41. healthCheckConfig_ = healthCheckConfig;
  42. setBodyParameter(std::string("HealthCheckConfig") + ".HealthCheckConnectPort", std::to_string(healthCheckConfig.healthCheckConnectPort));
  43. setBodyParameter(std::string("HealthCheckConfig") + ".HealthCheckConnectTimeout", std::to_string(healthCheckConfig.healthCheckConnectTimeout));
  44. setBodyParameter(std::string("HealthCheckConfig") + ".HealthCheckDomain", healthCheckConfig.healthCheckDomain);
  45. setBodyParameter(std::string("HealthCheckConfig") + ".HealthCheckEnabled", healthCheckConfig.healthCheckEnabled ? "true" : "false");
  46. for(int dep1 = 0; dep1 != healthCheckConfig.healthCheckHttpCode.size(); dep1++) {
  47. setBodyParameter(std::string("HealthCheckConfig") + ".HealthCheckHttpCode." + std::to_string(dep1 + 1), healthCheckConfig.healthCheckHttpCode[dep1]);
  48. }
  49. setBodyParameter(std::string("HealthCheckConfig") + ".HealthCheckInterval", std::to_string(healthCheckConfig.healthCheckInterval));
  50. setBodyParameter(std::string("HealthCheckConfig") + ".HealthCheckPath", healthCheckConfig.healthCheckPath);
  51. setBodyParameter(std::string("HealthCheckConfig") + ".HealthCheckProtocol", healthCheckConfig.healthCheckProtocol);
  52. setBodyParameter(std::string("HealthCheckConfig") + ".HealthyThreshold", std::to_string(healthCheckConfig.healthyThreshold));
  53. setBodyParameter(std::string("HealthCheckConfig") + ".UnhealthyThreshold", std::to_string(healthCheckConfig.unhealthyThreshold));
  54. }
  55. std::string CreateServerGroupRequest::getScheduler() const {
  56. return scheduler_;
  57. }
  58. void CreateServerGroupRequest::setScheduler(const std::string &scheduler) {
  59. scheduler_ = scheduler;
  60. setBodyParameter(std::string("Scheduler"), scheduler);
  61. }
  62. std::string CreateServerGroupRequest::getResourceGroupId() const {
  63. return resourceGroupId_;
  64. }
  65. void CreateServerGroupRequest::setResourceGroupId(const std::string &resourceGroupId) {
  66. resourceGroupId_ = resourceGroupId;
  67. setBodyParameter(std::string("ResourceGroupId"), resourceGroupId);
  68. }
  69. std::string CreateServerGroupRequest::getProtocol() const {
  70. return protocol_;
  71. }
  72. void CreateServerGroupRequest::setProtocol(const std::string &protocol) {
  73. protocol_ = protocol;
  74. setBodyParameter(std::string("Protocol"), protocol);
  75. }
  76. std::vector<CreateServerGroupRequest::Tag> CreateServerGroupRequest::getTag() const {
  77. return tag_;
  78. }
  79. void CreateServerGroupRequest::setTag(const std::vector<CreateServerGroupRequest::Tag> &tag) {
  80. tag_ = tag;
  81. for(int dep1 = 0; dep1 != tag.size(); dep1++) {
  82. setBodyParameter(std::string("Tag") + "." + std::to_string(dep1 + 1) + ".Key", tag[dep1].key);
  83. setBodyParameter(std::string("Tag") + "." + std::to_string(dep1 + 1) + ".Value", tag[dep1].value);
  84. }
  85. }
  86. bool CreateServerGroupRequest::getDryRun() const {
  87. return dryRun_;
  88. }
  89. void CreateServerGroupRequest::setDryRun(bool dryRun) {
  90. dryRun_ = dryRun;
  91. setBodyParameter(std::string("DryRun"), dryRun ? "true" : "false");
  92. }
  93. CreateServerGroupRequest::ConnectionDrainConfig CreateServerGroupRequest::getConnectionDrainConfig() const {
  94. return connectionDrainConfig_;
  95. }
  96. void CreateServerGroupRequest::setConnectionDrainConfig(const CreateServerGroupRequest::ConnectionDrainConfig &connectionDrainConfig) {
  97. connectionDrainConfig_ = connectionDrainConfig;
  98. setBodyParameter(std::string("ConnectionDrainConfig") + ".ConnectionDrainEnabled", connectionDrainConfig.connectionDrainEnabled ? "true" : "false");
  99. setBodyParameter(std::string("ConnectionDrainConfig") + ".ConnectionDrainTimeout", std::to_string(connectionDrainConfig.connectionDrainTimeout));
  100. }
  101. std::string CreateServerGroupRequest::getServerGroupType() const {
  102. return serverGroupType_;
  103. }
  104. void CreateServerGroupRequest::setServerGroupType(const std::string &serverGroupType) {
  105. serverGroupType_ = serverGroupType;
  106. setBodyParameter(std::string("ServerGroupType"), serverGroupType);
  107. }
  108. std::string CreateServerGroupRequest::getVpcId() const {
  109. return vpcId_;
  110. }
  111. void CreateServerGroupRequest::setVpcId(const std::string &vpcId) {
  112. vpcId_ = vpcId;
  113. setBodyParameter(std::string("VpcId"), vpcId);
  114. }