RunCommandRequest.cc 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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/ecs/model/RunCommandRequest.h>
  17. using AlibabaCloud::Ecs::Model::RunCommandRequest;
  18. RunCommandRequest::RunCommandRequest()
  19. : RpcServiceRequest("ecs", "2014-05-26", "RunCommand") {
  20. setMethod(HttpRequest::Method::Post);
  21. }
  22. RunCommandRequest::~RunCommandRequest() {}
  23. long RunCommandRequest::getResourceOwnerId() const {
  24. return resourceOwnerId_;
  25. }
  26. void RunCommandRequest::setResourceOwnerId(long resourceOwnerId) {
  27. resourceOwnerId_ = resourceOwnerId;
  28. setParameter(std::string("ResourceOwnerId"), std::to_string(resourceOwnerId));
  29. }
  30. std::string RunCommandRequest::getWorkingDir() const {
  31. return workingDir_;
  32. }
  33. void RunCommandRequest::setWorkingDir(const std::string &workingDir) {
  34. workingDir_ = workingDir;
  35. setParameter(std::string("WorkingDir"), workingDir);
  36. }
  37. std::string RunCommandRequest::getDescription() const {
  38. return description_;
  39. }
  40. void RunCommandRequest::setDescription(const std::string &description) {
  41. description_ = description;
  42. setParameter(std::string("Description"), description);
  43. }
  44. std::string RunCommandRequest::getType() const {
  45. return type_;
  46. }
  47. void RunCommandRequest::setType(const std::string &type) {
  48. type_ = type;
  49. setParameter(std::string("Type"), type);
  50. }
  51. std::string RunCommandRequest::getCommandContent() const {
  52. return commandContent_;
  53. }
  54. void RunCommandRequest::setCommandContent(const std::string &commandContent) {
  55. commandContent_ = commandContent;
  56. setParameter(std::string("CommandContent"), commandContent);
  57. }
  58. long RunCommandRequest::getTimeout() const {
  59. return timeout_;
  60. }
  61. void RunCommandRequest::setTimeout(long timeout) {
  62. timeout_ = timeout;
  63. setParameter(std::string("Timeout"), std::to_string(timeout));
  64. }
  65. std::string RunCommandRequest::getFrequency() const {
  66. return frequency_;
  67. }
  68. void RunCommandRequest::setFrequency(const std::string &frequency) {
  69. frequency_ = frequency;
  70. setParameter(std::string("Frequency"), frequency);
  71. }
  72. std::string RunCommandRequest::getRegionId() const {
  73. return regionId_;
  74. }
  75. void RunCommandRequest::setRegionId(const std::string &regionId) {
  76. regionId_ = regionId;
  77. setParameter(std::string("RegionId"), regionId);
  78. }
  79. std::string RunCommandRequest::getContentEncoding() const {
  80. return contentEncoding_;
  81. }
  82. void RunCommandRequest::setContentEncoding(const std::string &contentEncoding) {
  83. contentEncoding_ = contentEncoding;
  84. setParameter(std::string("ContentEncoding"), contentEncoding);
  85. }
  86. std::string RunCommandRequest::getRepeatMode() const {
  87. return repeatMode_;
  88. }
  89. void RunCommandRequest::setRepeatMode(const std::string &repeatMode) {
  90. repeatMode_ = repeatMode;
  91. setParameter(std::string("RepeatMode"), repeatMode);
  92. }
  93. std::string RunCommandRequest::getWindowsPasswordName() const {
  94. return windowsPasswordName_;
  95. }
  96. void RunCommandRequest::setWindowsPasswordName(const std::string &windowsPasswordName) {
  97. windowsPasswordName_ = windowsPasswordName;
  98. setParameter(std::string("WindowsPasswordName"), windowsPasswordName);
  99. }
  100. std::vector<RunCommandRequest::Tag> RunCommandRequest::getTag() const {
  101. return tag_;
  102. }
  103. void RunCommandRequest::setTag(const std::vector<RunCommandRequest::Tag> &tag) {
  104. tag_ = tag;
  105. for(int dep1 = 0; dep1 != tag.size(); dep1++) {
  106. auto tagObj = tag.at(dep1);
  107. std::string tagObjStr = std::string("Tag") + "." + std::to_string(dep1 + 1);
  108. setParameter(tagObjStr + ".Key", tagObj.key);
  109. setParameter(tagObjStr + ".Value", tagObj.value);
  110. }
  111. }
  112. bool RunCommandRequest::getKeepCommand() const {
  113. return keepCommand_;
  114. }
  115. void RunCommandRequest::setKeepCommand(bool keepCommand) {
  116. keepCommand_ = keepCommand;
  117. setParameter(std::string("KeepCommand"), keepCommand ? "true" : "false");
  118. }
  119. bool RunCommandRequest::getTimed() const {
  120. return timed_;
  121. }
  122. void RunCommandRequest::setTimed(bool timed) {
  123. timed_ = timed;
  124. setParameter(std::string("Timed"), timed ? "true" : "false");
  125. }
  126. std::string RunCommandRequest::getResourceOwnerAccount() const {
  127. return resourceOwnerAccount_;
  128. }
  129. void RunCommandRequest::setResourceOwnerAccount(const std::string &resourceOwnerAccount) {
  130. resourceOwnerAccount_ = resourceOwnerAccount;
  131. setParameter(std::string("ResourceOwnerAccount"), resourceOwnerAccount);
  132. }
  133. std::string RunCommandRequest::getOwnerAccount() const {
  134. return ownerAccount_;
  135. }
  136. void RunCommandRequest::setOwnerAccount(const std::string &ownerAccount) {
  137. ownerAccount_ = ownerAccount;
  138. setParameter(std::string("OwnerAccount"), ownerAccount);
  139. }
  140. long RunCommandRequest::getOwnerId() const {
  141. return ownerId_;
  142. }
  143. void RunCommandRequest::setOwnerId(long ownerId) {
  144. ownerId_ = ownerId;
  145. setParameter(std::string("OwnerId"), std::to_string(ownerId));
  146. }
  147. std::vector<std::string> RunCommandRequest::getInstanceId() const {
  148. return instanceId_;
  149. }
  150. void RunCommandRequest::setInstanceId(const std::vector<std::string> &instanceId) {
  151. instanceId_ = instanceId;
  152. }
  153. std::string RunCommandRequest::getName() const {
  154. return name_;
  155. }
  156. void RunCommandRequest::setName(const std::string &name) {
  157. name_ = name;
  158. setParameter(std::string("Name"), name);
  159. }
  160. std::string RunCommandRequest::getContainerId() const {
  161. return containerId_;
  162. }
  163. void RunCommandRequest::setContainerId(const std::string &containerId) {
  164. containerId_ = containerId;
  165. setParameter(std::string("ContainerId"), containerId);
  166. }
  167. std::map<std::string, std::string> RunCommandRequest::getParameters() const {
  168. return parameters_;
  169. }
  170. void RunCommandRequest::setParameters(std::map<std::string, std::string> parameters) {
  171. parameters_ = parameters;
  172. setParameter(std::string("Parameters"), parameters);
  173. }
  174. bool RunCommandRequest::getEnableParameter() const {
  175. return enableParameter_;
  176. }
  177. void RunCommandRequest::setEnableParameter(bool enableParameter) {
  178. enableParameter_ = enableParameter;
  179. setParameter(std::string("EnableParameter"), enableParameter ? "true" : "false");
  180. }
  181. std::string RunCommandRequest::getUsername() const {
  182. return username_;
  183. }
  184. void RunCommandRequest::setUsername(const std::string &username) {
  185. username_ = username;
  186. setParameter(std::string("Username"), username);
  187. }