UpdateServerGroupAttributeRequest.cc 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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/alb/model/UpdateServerGroupAttributeRequest.h>
  17. using AlibabaCloud::Alb::Model::UpdateServerGroupAttributeRequest;
  18. UpdateServerGroupAttributeRequest::UpdateServerGroupAttributeRequest()
  19. : RpcServiceRequest("alb", "2020-06-16", "UpdateServerGroupAttribute") {
  20. setMethod(HttpRequest::Method::Post);
  21. }
  22. UpdateServerGroupAttributeRequest::~UpdateServerGroupAttributeRequest() {}
  23. std::string UpdateServerGroupAttributeRequest::getServerGroupName() const {
  24. return serverGroupName_;
  25. }
  26. void UpdateServerGroupAttributeRequest::setServerGroupName(const std::string &serverGroupName) {
  27. serverGroupName_ = serverGroupName;
  28. setParameter(std::string("ServerGroupName"), serverGroupName);
  29. }
  30. std::string UpdateServerGroupAttributeRequest::getClientToken() const {
  31. return clientToken_;
  32. }
  33. void UpdateServerGroupAttributeRequest::setClientToken(const std::string &clientToken) {
  34. clientToken_ = clientToken;
  35. setParameter(std::string("ClientToken"), clientToken);
  36. }
  37. UpdateServerGroupAttributeRequest::HealthCheckConfig UpdateServerGroupAttributeRequest::getHealthCheckConfig() const {
  38. return healthCheckConfig_;
  39. }
  40. void UpdateServerGroupAttributeRequest::setHealthCheckConfig(const UpdateServerGroupAttributeRequest::HealthCheckConfig &healthCheckConfig) {
  41. healthCheckConfig_ = healthCheckConfig;
  42. for(int dep1 = 0; dep1 != healthCheckConfig.healthCheckCodes.size(); dep1++) {
  43. setParameter(std::string("HealthCheckConfig") + ".HealthCheckCodes." + std::to_string(dep1 + 1), healthCheckConfig.healthCheckCodes[dep1]);
  44. }
  45. setParameter(std::string("HealthCheckConfig") + ".HealthCheckEnabled", healthCheckConfig.healthCheckEnabled ? "true" : "false");
  46. setParameter(std::string("HealthCheckConfig") + ".HealthCheckTimeout", std::to_string(healthCheckConfig.healthCheckTimeout));
  47. setParameter(std::string("HealthCheckConfig") + ".HealthCheckMethod", healthCheckConfig.healthCheckMethod);
  48. setParameter(std::string("HealthCheckConfig") + ".HealthCheckHost", healthCheckConfig.healthCheckHost);
  49. setParameter(std::string("HealthCheckConfig") + ".HealthCheckProtocol", healthCheckConfig.healthCheckProtocol);
  50. setParameter(std::string("HealthCheckConfig") + ".UnhealthyThreshold", std::to_string(healthCheckConfig.unhealthyThreshold));
  51. setParameter(std::string("HealthCheckConfig") + ".HealthyThreshold", std::to_string(healthCheckConfig.healthyThreshold));
  52. setParameter(std::string("HealthCheckConfig") + ".HealthCheckTcpFastCloseEnabled", healthCheckConfig.healthCheckTcpFastCloseEnabled ? "true" : "false");
  53. setParameter(std::string("HealthCheckConfig") + ".HealthCheckPath", healthCheckConfig.healthCheckPath);
  54. setParameter(std::string("HealthCheckConfig") + ".HealthCheckInterval", std::to_string(healthCheckConfig.healthCheckInterval));
  55. for(int dep1 = 0; dep1 != healthCheckConfig.healthCheckHttpCodes.size(); dep1++) {
  56. setParameter(std::string("HealthCheckConfig") + ".HealthCheckHttpCodes." + std::to_string(dep1 + 1), healthCheckConfig.healthCheckHttpCodes[dep1]);
  57. }
  58. setParameter(std::string("HealthCheckConfig") + ".HealthCheckHttpVersion", healthCheckConfig.healthCheckHttpVersion);
  59. setParameter(std::string("HealthCheckConfig") + ".HealthCheckConnectPort", std::to_string(healthCheckConfig.healthCheckConnectPort));
  60. }
  61. UpdateServerGroupAttributeRequest::SlowStartConfig UpdateServerGroupAttributeRequest::getSlowStartConfig() const {
  62. return slowStartConfig_;
  63. }
  64. void UpdateServerGroupAttributeRequest::setSlowStartConfig(const UpdateServerGroupAttributeRequest::SlowStartConfig &slowStartConfig) {
  65. slowStartConfig_ = slowStartConfig;
  66. setParameter(std::string("SlowStartConfig") + ".SlowStartDuration", std::to_string(slowStartConfig.slowStartDuration));
  67. setParameter(std::string("SlowStartConfig") + ".SlowStartEnabled", slowStartConfig.slowStartEnabled ? "true" : "false");
  68. }
  69. std::string UpdateServerGroupAttributeRequest::getScheduler() const {
  70. return scheduler_;
  71. }
  72. void UpdateServerGroupAttributeRequest::setScheduler(const std::string &scheduler) {
  73. scheduler_ = scheduler;
  74. setParameter(std::string("Scheduler"), scheduler);
  75. }
  76. std::string UpdateServerGroupAttributeRequest::getServerGroupId() const {
  77. return serverGroupId_;
  78. }
  79. void UpdateServerGroupAttributeRequest::setServerGroupId(const std::string &serverGroupId) {
  80. serverGroupId_ = serverGroupId;
  81. setParameter(std::string("ServerGroupId"), serverGroupId);
  82. }
  83. bool UpdateServerGroupAttributeRequest::getUpstreamKeepaliveEnabled() const {
  84. return upstreamKeepaliveEnabled_;
  85. }
  86. void UpdateServerGroupAttributeRequest::setUpstreamKeepaliveEnabled(bool upstreamKeepaliveEnabled) {
  87. upstreamKeepaliveEnabled_ = upstreamKeepaliveEnabled;
  88. setParameter(std::string("UpstreamKeepaliveEnabled"), upstreamKeepaliveEnabled ? "true" : "false");
  89. }
  90. std::string UpdateServerGroupAttributeRequest::getServiceName() const {
  91. return serviceName_;
  92. }
  93. void UpdateServerGroupAttributeRequest::setServiceName(const std::string &serviceName) {
  94. serviceName_ = serviceName;
  95. setParameter(std::string("ServiceName"), serviceName);
  96. }
  97. UpdateServerGroupAttributeRequest::StickySessionConfig UpdateServerGroupAttributeRequest::getStickySessionConfig() const {
  98. return stickySessionConfig_;
  99. }
  100. void UpdateServerGroupAttributeRequest::setStickySessionConfig(const UpdateServerGroupAttributeRequest::StickySessionConfig &stickySessionConfig) {
  101. stickySessionConfig_ = stickySessionConfig;
  102. setParameter(std::string("StickySessionConfig") + ".StickySessionEnabled", stickySessionConfig.stickySessionEnabled ? "true" : "false");
  103. setParameter(std::string("StickySessionConfig") + ".Cookie", stickySessionConfig.cookie);
  104. setParameter(std::string("StickySessionConfig") + ".CookieTimeout", std::to_string(stickySessionConfig.cookieTimeout));
  105. setParameter(std::string("StickySessionConfig") + ".StickySessionType", stickySessionConfig.stickySessionType);
  106. }
  107. bool UpdateServerGroupAttributeRequest::getDryRun() const {
  108. return dryRun_;
  109. }
  110. void UpdateServerGroupAttributeRequest::setDryRun(bool dryRun) {
  111. dryRun_ = dryRun;
  112. setParameter(std::string("DryRun"), dryRun ? "true" : "false");
  113. }
  114. UpdateServerGroupAttributeRequest::ConnectionDrainConfig UpdateServerGroupAttributeRequest::getConnectionDrainConfig() const {
  115. return connectionDrainConfig_;
  116. }
  117. void UpdateServerGroupAttributeRequest::setConnectionDrainConfig(const UpdateServerGroupAttributeRequest::ConnectionDrainConfig &connectionDrainConfig) {
  118. connectionDrainConfig_ = connectionDrainConfig;
  119. setParameter(std::string("ConnectionDrainConfig") + ".ConnectionDrainEnabled", connectionDrainConfig.connectionDrainEnabled ? "true" : "false");
  120. setParameter(std::string("ConnectionDrainConfig") + ".ConnectionDrainTimeout", std::to_string(connectionDrainConfig.connectionDrainTimeout));
  121. }
  122. UpdateServerGroupAttributeRequest::UchConfig UpdateServerGroupAttributeRequest::getUchConfig() const {
  123. return uchConfig_;
  124. }
  125. void UpdateServerGroupAttributeRequest::setUchConfig(const UpdateServerGroupAttributeRequest::UchConfig &uchConfig) {
  126. uchConfig_ = uchConfig;
  127. setParameter(std::string("UchConfig") + ".Type", uchConfig.type);
  128. setParameter(std::string("UchConfig") + ".Value", uchConfig.value);
  129. }