CreateSyntheticTaskRequest.cc 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  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/arms/model/CreateSyntheticTaskRequest.h>
  17. using AlibabaCloud::ARMS::Model::CreateSyntheticTaskRequest;
  18. CreateSyntheticTaskRequest::CreateSyntheticTaskRequest()
  19. : RpcServiceRequest("arms", "2019-08-08", "CreateSyntheticTask") {
  20. setMethod(HttpRequest::Method::Post);
  21. }
  22. CreateSyntheticTaskRequest::~CreateSyntheticTaskRequest() {}
  23. long CreateSyntheticTaskRequest::getTaskType() const {
  24. return taskType_;
  25. }
  26. void CreateSyntheticTaskRequest::setTaskType(long taskType) {
  27. taskType_ = taskType;
  28. setParameter(std::string("TaskType"), std::to_string(taskType));
  29. }
  30. std::string CreateSyntheticTaskRequest::getIntervalType() const {
  31. return intervalType_;
  32. }
  33. void CreateSyntheticTaskRequest::setIntervalType(const std::string &intervalType) {
  34. intervalType_ = intervalType;
  35. setParameter(std::string("IntervalType"), intervalType);
  36. }
  37. bool CreateSyntheticTaskRequest::getUpdateTask() const {
  38. return updateTask_;
  39. }
  40. void CreateSyntheticTaskRequest::setUpdateTask(bool updateTask) {
  41. updateTask_ = updateTask;
  42. setParameter(std::string("UpdateTask"), updateTask ? "true" : "false");
  43. }
  44. std::string CreateSyntheticTaskRequest::getTaskName() const {
  45. return taskName_;
  46. }
  47. void CreateSyntheticTaskRequest::setTaskName(const std::string &taskName) {
  48. taskName_ = taskName;
  49. setParameter(std::string("TaskName"), taskName);
  50. }
  51. std::vector<CreateSyntheticTaskRequest::MonitorList> CreateSyntheticTaskRequest::getMonitorList() const {
  52. return monitorList_;
  53. }
  54. void CreateSyntheticTaskRequest::setMonitorList(const std::vector<CreateSyntheticTaskRequest::MonitorList> &monitorList) {
  55. monitorList_ = monitorList;
  56. for(int dep1 = 0; dep1 != monitorList.size(); dep1++) {
  57. setParameter(std::string("MonitorList") + "." + std::to_string(dep1 + 1) + ".NetServiceId", std::to_string(monitorList[dep1].netServiceId));
  58. setParameter(std::string("MonitorList") + "." + std::to_string(dep1 + 1) + ".MonitorType", std::to_string(monitorList[dep1].monitorType));
  59. setParameter(std::string("MonitorList") + "." + std::to_string(dep1 + 1) + ".CityCode", std::to_string(monitorList[dep1].cityCode));
  60. }
  61. }
  62. long CreateSyntheticTaskRequest::getIpType() const {
  63. return ipType_;
  64. }
  65. void CreateSyntheticTaskRequest::setIpType(long ipType) {
  66. ipType_ = ipType;
  67. setParameter(std::string("IpType"), std::to_string(ipType));
  68. }
  69. std::string CreateSyntheticTaskRequest::getUrl() const {
  70. return url_;
  71. }
  72. void CreateSyntheticTaskRequest::setUrl(const std::string &url) {
  73. url_ = url;
  74. setParameter(std::string("Url"), url);
  75. }
  76. std::string CreateSyntheticTaskRequest::getIntervalTime() const {
  77. return intervalTime_;
  78. }
  79. void CreateSyntheticTaskRequest::setIntervalTime(const std::string &intervalTime) {
  80. intervalTime_ = intervalTime;
  81. setParameter(std::string("IntervalTime"), intervalTime);
  82. }
  83. CreateSyntheticTaskRequest::CommonParam CreateSyntheticTaskRequest::getCommonParam() const {
  84. return commonParam_;
  85. }
  86. void CreateSyntheticTaskRequest::setCommonParam(const CreateSyntheticTaskRequest::CommonParam &commonParam) {
  87. commonParam_ = commonParam;
  88. setParameter(std::string("CommonParam") + ".AlertNotifierId", commonParam.alertNotifierId);
  89. setParameter(std::string("CommonParam") + ".AlertPolicyId", commonParam.alertPolicyId);
  90. for(int dep1 = 0; dep1 != commonParam.alertList.size(); dep1++) {
  91. setParameter(std::string("CommonParam") + ".AlertList." + std::to_string(dep1 + 1) + ".IsCritical", std::to_string(commonParam.alertList[dep1].isCritical));
  92. setParameter(std::string("CommonParam") + ".AlertList." + std::to_string(dep1 + 1) + ".Name", commonParam.alertList[dep1].name);
  93. setParameter(std::string("CommonParam") + ".AlertList." + std::to_string(dep1 + 1) + ".SeriousAlert", commonParam.alertList[dep1].seriousAlert);
  94. setParameter(std::string("CommonParam") + ".AlertList." + std::to_string(dep1 + 1) + ".GeneralAlert", commonParam.alertList[dep1].generalAlert);
  95. setParameter(std::string("CommonParam") + ".AlertList." + std::to_string(dep1 + 1) + ".Symbols", std::to_string(commonParam.alertList[dep1].symbols));
  96. }
  97. setParameter(std::string("CommonParam") + ".AlarmFlag", commonParam.alarmFlag);
  98. setParameter(std::string("CommonParam") + ".StartExecutionTime", std::to_string(commonParam.startExecutionTime));
  99. setParameter(std::string("CommonParam") + ".MonitorSamples", std::to_string(commonParam.monitorSamples));
  100. }
  101. CreateSyntheticTaskRequest::ExtendInterval CreateSyntheticTaskRequest::getExtendInterval() const {
  102. return extendInterval_;
  103. }
  104. void CreateSyntheticTaskRequest::setExtendInterval(const CreateSyntheticTaskRequest::ExtendInterval &extendInterval) {
  105. extendInterval_ = extendInterval;
  106. setParameter(std::string("ExtendInterval") + ".StartMinute", std::to_string(extendInterval.startMinute));
  107. setParameter(std::string("ExtendInterval") + ".EndHour", std::to_string(extendInterval.endHour));
  108. setParameter(std::string("ExtendInterval") + ".EndMinute", std::to_string(extendInterval.endMinute));
  109. setParameter(std::string("ExtendInterval") + ".StartHour", std::to_string(extendInterval.startHour));
  110. setParameter(std::string("ExtendInterval") + ".EndTime", extendInterval.endTime);
  111. for(int dep1 = 0; dep1 != extendInterval.days.size(); dep1++) {
  112. setParameter(std::string("ExtendInterval") + ".Days." + std::to_string(dep1 + 1), std::to_string(extendInterval.days[dep1]));
  113. }
  114. setParameter(std::string("ExtendInterval") + ".StartTime", extendInterval.startTime);
  115. }
  116. CreateSyntheticTaskRequest::Navigation CreateSyntheticTaskRequest::getNavigation() const {
  117. return navigation_;
  118. }
  119. void CreateSyntheticTaskRequest::setNavigation(const CreateSyntheticTaskRequest::Navigation &navigation) {
  120. navigation_ = navigation;
  121. setParameter(std::string("Navigation") + ".ExecuteActiveX", std::to_string(navigation.executeActiveX));
  122. setParameter(std::string("Navigation") + ".NavCustomHostIp", navigation.navCustomHostIp);
  123. setParameter(std::string("Navigation") + ".NavReturnElement", std::to_string(navigation.navReturnElement));
  124. setParameter(std::string("Navigation") + ".QUICVersion", std::to_string(navigation.qUICVersion));
  125. setParameter(std::string("Navigation") + ".SlowElementThreshold", std::to_string(navigation.slowElementThreshold));
  126. setParameter(std::string("Navigation") + ".WaitCompletionTime", std::to_string(navigation.waitCompletionTime));
  127. setParameter(std::string("Navigation") + ".QUICDomain", navigation.qUICDomain);
  128. setParameter(std::string("Navigation") + ".NavCustomHeaderContent", navigation.navCustomHeaderContent);
  129. setParameter(std::string("Navigation") + ".ResponseHeader", std::to_string(navigation.responseHeader));
  130. setParameter(std::string("Navigation") + ".VerifyStringWhiteList", navigation.verifyStringWhiteList);
  131. setParameter(std::string("Navigation") + ".MonitorTimeout", navigation.monitorTimeout);
  132. setParameter(std::string("Navigation") + ".FilterInvalidIP", std::to_string(navigation.filterInvalidIP));
  133. setParameter(std::string("Navigation") + ".FlowHijackLogo", navigation.flowHijackLogo);
  134. setParameter(std::string("Navigation") + ".NavDisableCache", std::to_string(navigation.navDisableCache));
  135. setParameter(std::string("Navigation") + ".ElementBlacklist", navigation.elementBlacklist);
  136. setParameter(std::string("Navigation") + ".FlowHijackJumpTimes", std::to_string(navigation.flowHijackJumpTimes));
  137. setParameter(std::string("Navigation") + ".ExecuteScript", std::to_string(navigation.executeScript));
  138. setParameter(std::string("Navigation") + ".NavDisableCompression", navigation.navDisableCompression);
  139. setParameter(std::string("Navigation") + ".DNSHijackWhiteList", navigation.dNSHijackWhiteList);
  140. setParameter(std::string("Navigation") + ".ProcessName", navigation.processName);
  141. setParameter(std::string("Navigation") + ".VerifyStringBlacklist", navigation.verifyStringBlacklist);
  142. setParameter(std::string("Navigation") + ".NavAutomaticScrolling", navigation.navAutomaticScrolling);
  143. setParameter(std::string("Navigation") + ".NavRedirection", std::to_string(navigation.navRedirection));
  144. setParameter(std::string("Navigation") + ".NavCustomHeader", navigation.navCustomHeader);
  145. setParameter(std::string("Navigation") + ".ExecuteApplication", std::to_string(navigation.executeApplication));
  146. setParameter(std::string("Navigation") + ".NavCustomHost", std::to_string(navigation.navCustomHost));
  147. setParameter(std::string("Navigation") + ".NavIgnoreCertificateError", std::to_string(navigation.navIgnoreCertificateError));
  148. setParameter(std::string("Navigation") + ".PageTamper", navigation.pageTamper);
  149. setParameter(std::string("Navigation") + ".RequestHeader", std::to_string(navigation.requestHeader));
  150. }
  151. CreateSyntheticTaskRequest::Download CreateSyntheticTaskRequest::getDownload() const {
  152. return download_;
  153. }
  154. void CreateSyntheticTaskRequest::setDownload(const CreateSyntheticTaskRequest::Download &download) {
  155. download_ = download;
  156. setParameter(std::string("Download") + ".DownloadIgnoreCertificateError", download.downloadIgnoreCertificateError);
  157. setParameter(std::string("Download") + ".DownloadCustomHost", std::to_string(download.downloadCustomHost));
  158. setParameter(std::string("Download") + ".ConnectionTimeout", std::to_string(download.connectionTimeout));
  159. setParameter(std::string("Download") + ".DownloadKernel", std::to_string(download.downloadKernel));
  160. setParameter(std::string("Download") + ".WhiteList", download.whiteList);
  161. setParameter(std::string("Download") + ".DownloadRedirection", std::to_string(download.downloadRedirection));
  162. setParameter(std::string("Download") + ".MonitorTimeout", std::to_string(download.monitorTimeout));
  163. setParameter(std::string("Download") + ".ValidateKeywords", download.validateKeywords);
  164. setParameter(std::string("Download") + ".DownloadTransmissionSize", std::to_string(download.downloadTransmissionSize));
  165. setParameter(std::string("Download") + ".QuickProtocol", download.quickProtocol);
  166. setParameter(std::string("Download") + ".DownloadCustomHeaderContent", download.downloadCustomHeaderContent);
  167. setParameter(std::string("Download") + ".VerifyWay", std::to_string(download.verifyWay));
  168. setParameter(std::string("Download") + ".DownloadCustomHostIp", download.downloadCustomHostIp);
  169. }
  170. CreateSyntheticTaskRequest::Protocol CreateSyntheticTaskRequest::getProtocol() const {
  171. return protocol_;
  172. }
  173. void CreateSyntheticTaskRequest::setProtocol(const CreateSyntheticTaskRequest::Protocol &protocol) {
  174. protocol_ = protocol;
  175. setParameter(std::string("Protocol") + ".ReceivedDataSize", std::to_string(protocol.receivedDataSize));
  176. setParameter(std::string("Protocol") + ".ProtocolMonitorTimeout", protocol.protocolMonitorTimeout);
  177. setParameter(std::string("Protocol") + ".RequestContent.Method", protocol.requestContent.method);
  178. for(int dep1 = 0; dep1 != protocol.requestContent.header.size(); dep1++) {
  179. setParameter(std::string("Protocol") + ".RequestContent.Header." + std::to_string(dep1 + 1) + ".Value", protocol.requestContent.header[dep1].value);
  180. setParameter(std::string("Protocol") + ".RequestContent.Header." + std::to_string(dep1 + 1) + ".Key", protocol.requestContent.header[dep1].key);
  181. }
  182. setParameter(std::string("Protocol") + ".RequestContent.Body.Mode", protocol.requestContent.body.mode);
  183. setParameter(std::string("Protocol") + ".RequestContent.Body.Raw", protocol.requestContent.body.raw);
  184. for(int dep1 = 0; dep1 != protocol.requestContent.body.urlEncoding.size(); dep1++) {
  185. setParameter(std::string("Protocol") + ".RequestContent.Body.UrlEncoding." + std::to_string(dep1 + 1) + ".Value", protocol.requestContent.body.urlEncoding[dep1].value);
  186. setParameter(std::string("Protocol") + ".RequestContent.Body.UrlEncoding." + std::to_string(dep1 + 1) + ".Key", protocol.requestContent.body.urlEncoding[dep1].key);
  187. }
  188. setParameter(std::string("Protocol") + ".RequestContent.Body.Language", protocol.requestContent.body.language);
  189. for(int dep1 = 0; dep1 != protocol.requestContent.body.formData.size(); dep1++) {
  190. setParameter(std::string("Protocol") + ".RequestContent.Body.FormData." + std::to_string(dep1 + 1) + ".Value", protocol.requestContent.body.formData[dep1].value);
  191. setParameter(std::string("Protocol") + ".RequestContent.Body.FormData." + std::to_string(dep1 + 1) + ".Key", protocol.requestContent.body.formData[dep1].key);
  192. }
  193. setParameter(std::string("Protocol") + ".ProtocolConnectionTime", std::to_string(protocol.protocolConnectionTime));
  194. setParameter(std::string("Protocol") + ".CharacterEncoding", std::to_string(protocol.characterEncoding));
  195. setParameter(std::string("Protocol") + ".VerifyContent", protocol.verifyContent);
  196. setParameter(std::string("Protocol") + ".CustomHost", std::to_string(protocol.customHost));
  197. setParameter(std::string("Protocol") + ".ProtocolConnectionTimeout", std::to_string(protocol.protocolConnectionTimeout));
  198. setParameter(std::string("Protocol") + ".CustomHostIp", protocol.customHostIp);
  199. setParameter(std::string("Protocol") + ".VerifyWay", std::to_string(protocol.verifyWay));
  200. }
  201. std::string CreateSyntheticTaskRequest::getRegionId() const {
  202. return regionId_;
  203. }
  204. void CreateSyntheticTaskRequest::setRegionId(const std::string &regionId) {
  205. regionId_ = regionId;
  206. setParameter(std::string("RegionId"), regionId);
  207. }
  208. CreateSyntheticTaskRequest::Net CreateSyntheticTaskRequest::getNet() const {
  209. return net_;
  210. }
  211. void CreateSyntheticTaskRequest::setNet(const CreateSyntheticTaskRequest::Net &net) {
  212. net_ = net;
  213. setParameter(std::string("Net") + ".NetICMPTimeout", std::to_string(net.netICMPTimeout));
  214. setParameter(std::string("Net") + ".NetTraceRouteTimeout", std::to_string(net.netTraceRouteTimeout));
  215. setParameter(std::string("Net") + ".NetICMPActive", std::to_string(net.netICMPActive));
  216. setParameter(std::string("Net") + ".NetICMPDataCut", std::to_string(net.netICMPDataCut));
  217. setParameter(std::string("Net") + ".NetICMPNum", std::to_string(net.netICMPNum));
  218. setParameter(std::string("Net") + ".NetDNSTimeout", std::to_string(net.netDNSTimeout));
  219. setParameter(std::string("Net") + ".NetDNSQueryMethod", std::to_string(net.netDNSQueryMethod));
  220. setParameter(std::string("Net") + ".WhiteList", net.whiteList);
  221. setParameter(std::string("Net") + ".NetDNSNs", net.netDNSNs);
  222. setParameter(std::string("Net") + ".NetDNSServer", std::to_string(net.netDNSServer));
  223. setParameter(std::string("Net") + ".NetTraceRouteSwitch", std::to_string(net.netTraceRouteSwitch));
  224. setParameter(std::string("Net") + ".NetDigSwitch", std::to_string(net.netDigSwitch));
  225. setParameter(std::string("Net") + ".NetICMPInterval", std::to_string(net.netICMPInterval));
  226. setParameter(std::string("Net") + ".NetDNSSwitch", std::to_string(net.netDNSSwitch));
  227. setParameter(std::string("Net") + ".NetTraceRouteNum", std::to_string(net.netTraceRouteNum));
  228. setParameter(std::string("Net") + ".NetICMPSwitch", std::to_string(net.netICMPSwitch));
  229. setParameter(std::string("Net") + ".NetICMPSize", std::to_string(net.netICMPSize));
  230. }