UpdateBaselineRequest.cc 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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/dataworks-public/model/UpdateBaselineRequest.h>
  17. using AlibabaCloud::Dataworks_public::Model::UpdateBaselineRequest;
  18. UpdateBaselineRequest::UpdateBaselineRequest()
  19. : RpcServiceRequest("dataworks-public", "2020-05-18", "UpdateBaseline") {
  20. setMethod(HttpRequest::Method::Post);
  21. }
  22. UpdateBaselineRequest::~UpdateBaselineRequest() {}
  23. std::string UpdateBaselineRequest::getOwner() const {
  24. return owner_;
  25. }
  26. void UpdateBaselineRequest::setOwner(const std::string &owner) {
  27. owner_ = owner;
  28. setBodyParameter(std::string("Owner"), owner);
  29. }
  30. std::string UpdateBaselineRequest::getRemoveNodeIds() const {
  31. return removeNodeIds_;
  32. }
  33. void UpdateBaselineRequest::setRemoveNodeIds(const std::string &removeNodeIds) {
  34. removeNodeIds_ = removeNodeIds;
  35. setBodyParameter(std::string("RemoveNodeIds"), removeNodeIds);
  36. }
  37. int UpdateBaselineRequest::getAlertMarginThreshold() const {
  38. return alertMarginThreshold_;
  39. }
  40. void UpdateBaselineRequest::setAlertMarginThreshold(int alertMarginThreshold) {
  41. alertMarginThreshold_ = alertMarginThreshold;
  42. setBodyParameter(std::string("AlertMarginThreshold"), std::to_string(alertMarginThreshold));
  43. }
  44. std::vector<UpdateBaselineRequest::OvertimeSettings> UpdateBaselineRequest::getOvertimeSettings() const {
  45. return overtimeSettings_;
  46. }
  47. void UpdateBaselineRequest::setOvertimeSettings(const std::vector<UpdateBaselineRequest::OvertimeSettings> &overtimeSettings) {
  48. overtimeSettings_ = overtimeSettings;
  49. for(int dep1 = 0; dep1 != overtimeSettings.size(); dep1++) {
  50. setBodyParameter(std::string("OvertimeSettings") + "." + std::to_string(dep1 + 1) + ".Time", overtimeSettings[dep1].time);
  51. setBodyParameter(std::string("OvertimeSettings") + "." + std::to_string(dep1 + 1) + ".Cycle", std::to_string(overtimeSettings[dep1].cycle));
  52. }
  53. }
  54. int UpdateBaselineRequest::getPriority() const {
  55. return priority_;
  56. }
  57. void UpdateBaselineRequest::setPriority(int priority) {
  58. priority_ = priority;
  59. setBodyParameter(std::string("Priority"), std::to_string(priority));
  60. }
  61. long UpdateBaselineRequest::getBaselineId() const {
  62. return baselineId_;
  63. }
  64. void UpdateBaselineRequest::setBaselineId(long baselineId) {
  65. baselineId_ = baselineId;
  66. setBodyParameter(std::string("BaselineId"), std::to_string(baselineId));
  67. }
  68. bool UpdateBaselineRequest::getEnabled() const {
  69. return enabled_;
  70. }
  71. void UpdateBaselineRequest::setEnabled(bool enabled) {
  72. enabled_ = enabled;
  73. setBodyParameter(std::string("Enabled"), enabled ? "true" : "false");
  74. }
  75. std::string UpdateBaselineRequest::getBaselineType() const {
  76. return baselineType_;
  77. }
  78. void UpdateBaselineRequest::setBaselineType(const std::string &baselineType) {
  79. baselineType_ = baselineType;
  80. setBodyParameter(std::string("BaselineType"), baselineType);
  81. }
  82. bool UpdateBaselineRequest::getAlertEnabled() const {
  83. return alertEnabled_;
  84. }
  85. void UpdateBaselineRequest::setAlertEnabled(bool alertEnabled) {
  86. alertEnabled_ = alertEnabled;
  87. setBodyParameter(std::string("AlertEnabled"), alertEnabled ? "true" : "false");
  88. }
  89. std::vector<UpdateBaselineRequest::AlertSettings> UpdateBaselineRequest::getAlertSettings() const {
  90. return alertSettings_;
  91. }
  92. void UpdateBaselineRequest::setAlertSettings(const std::vector<UpdateBaselineRequest::AlertSettings> &alertSettings) {
  93. alertSettings_ = alertSettings;
  94. for(int dep1 = 0; dep1 != alertSettings.size(); dep1++) {
  95. for(int dep2 = 0; dep2 != alertSettings[dep1].dingRobots.size(); dep2++) {
  96. setBodyParameter(std::string("AlertSettings") + "." + std::to_string(dep1 + 1) + ".DingRobots." + std::to_string(dep2 + 1) + ".AtAll", alertSettings[dep1].dingRobots[dep2].atAll ? "true" : "false");
  97. setBodyParameter(std::string("AlertSettings") + "." + std::to_string(dep1 + 1) + ".DingRobots." + std::to_string(dep2 + 1) + ".WebUrl", alertSettings[dep1].dingRobots[dep2].webUrl);
  98. }
  99. setBodyParameter(std::string("AlertSettings") + "." + std::to_string(dep1 + 1) + ".AlertType", alertSettings[dep1].alertType);
  100. setBodyParameter(std::string("AlertSettings") + "." + std::to_string(dep1 + 1) + ".AlertMaximum", std::to_string(alertSettings[dep1].alertMaximum));
  101. setBodyParameter(std::string("AlertSettings") + "." + std::to_string(dep1 + 1) + ".SilenceStartTime", alertSettings[dep1].silenceStartTime);
  102. for(int dep2 = 0; dep2 != alertSettings[dep1].webhooks.size(); dep2++) {
  103. setBodyParameter(std::string("AlertSettings") + "." + std::to_string(dep1 + 1) + ".Webhooks." + std::to_string(dep2 + 1), alertSettings[dep1].webhooks[dep2]);
  104. }
  105. setBodyParameter(std::string("AlertSettings") + "." + std::to_string(dep1 + 1) + ".BaselineAlertEnabled", alertSettings[dep1].baselineAlertEnabled ? "true" : "false");
  106. setBodyParameter(std::string("AlertSettings") + "." + std::to_string(dep1 + 1) + ".AlertRecipientType", alertSettings[dep1].alertRecipientType);
  107. setBodyParameter(std::string("AlertSettings") + "." + std::to_string(dep1 + 1) + ".AlertInterval", std::to_string(alertSettings[dep1].alertInterval));
  108. for(int dep2 = 0; dep2 != alertSettings[dep1].topicTypes.size(); dep2++) {
  109. setBodyParameter(std::string("AlertSettings") + "." + std::to_string(dep1 + 1) + ".TopicTypes." + std::to_string(dep2 + 1), alertSettings[dep1].topicTypes[dep2]);
  110. }
  111. setBodyParameter(std::string("AlertSettings") + "." + std::to_string(dep1 + 1) + ".AlertRecipient", alertSettings[dep1].alertRecipient);
  112. for(int dep2 = 0; dep2 != alertSettings[dep1].alertMethods.size(); dep2++) {
  113. setBodyParameter(std::string("AlertSettings") + "." + std::to_string(dep1 + 1) + ".AlertMethods." + std::to_string(dep2 + 1), alertSettings[dep1].alertMethods[dep2]);
  114. }
  115. setBodyParameter(std::string("AlertSettings") + "." + std::to_string(dep1 + 1) + ".SilenceEndTime", alertSettings[dep1].silenceEndTime);
  116. }
  117. }
  118. std::string UpdateBaselineRequest::getBaselineName() const {
  119. return baselineName_;
  120. }
  121. void UpdateBaselineRequest::setBaselineName(const std::string &baselineName) {
  122. baselineName_ = baselineName;
  123. setBodyParameter(std::string("BaselineName"), baselineName);
  124. }
  125. long UpdateBaselineRequest::getProjectId() const {
  126. return projectId_;
  127. }
  128. void UpdateBaselineRequest::setProjectId(long projectId) {
  129. projectId_ = projectId;
  130. setBodyParameter(std::string("ProjectId"), std::to_string(projectId));
  131. }
  132. std::string UpdateBaselineRequest::getNodeIds() const {
  133. return nodeIds_;
  134. }
  135. void UpdateBaselineRequest::setNodeIds(const std::string &nodeIds) {
  136. nodeIds_ = nodeIds;
  137. setBodyParameter(std::string("NodeIds"), nodeIds);
  138. }