CreateInstanceRequest.py 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  1. # Licensed to the Apache Software Foundation (ASF) under one
  2. # or more contributor license agreements. See the NOTICE file
  3. # distributed with this work for additional information
  4. # regarding copyright ownership. The ASF licenses this file
  5. # to you under the Apache License, Version 2.0 (the
  6. # "License"); you may not use this file except in compliance
  7. # with the License. You may obtain a copy of the License at
  8. #
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. #
  13. # Unless required by applicable law or agreed to in writing,
  14. # software distributed under the License is distributed on an
  15. # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16. # KIND, either express or implied. See the License for the
  17. # specific language governing permissions and limitations
  18. # under the License.
  19. from aliyunsdkcore.request import RpcRequest
  20. from aliyunsdkecs.endpoint import endpoint_data
  21. class CreateInstanceRequest(RpcRequest):
  22. def __init__(self):
  23. RpcRequest.__init__(self, 'Ecs', '2014-05-26', 'CreateInstance','ecs')
  24. self.set_method('POST')
  25. if hasattr(self, "endpoint_map"):
  26. setattr(self, "endpoint_map", endpoint_data.getEndpointMap())
  27. if hasattr(self, "endpoint_regional"):
  28. setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional())
  29. def get_ResourceOwnerId(self):
  30. return self.get_query_params().get('ResourceOwnerId')
  31. def set_ResourceOwnerId(self,ResourceOwnerId):
  32. self.add_query_param('ResourceOwnerId',ResourceOwnerId)
  33. def get_HpcClusterId(self):
  34. return self.get_query_params().get('HpcClusterId')
  35. def set_HpcClusterId(self,HpcClusterId):
  36. self.add_query_param('HpcClusterId',HpcClusterId)
  37. def get_HttpPutResponseHopLimit(self):
  38. return self.get_query_params().get('HttpPutResponseHopLimit')
  39. def set_HttpPutResponseHopLimit(self,HttpPutResponseHopLimit):
  40. self.add_query_param('HttpPutResponseHopLimit',HttpPutResponseHopLimit)
  41. def get_SecurityEnhancementStrategy(self):
  42. return self.get_query_params().get('SecurityEnhancementStrategy')
  43. def set_SecurityEnhancementStrategy(self,SecurityEnhancementStrategy):
  44. self.add_query_param('SecurityEnhancementStrategy',SecurityEnhancementStrategy)
  45. def get_KeyPairName(self):
  46. return self.get_query_params().get('KeyPairName')
  47. def set_KeyPairName(self,KeyPairName):
  48. self.add_query_param('KeyPairName',KeyPairName)
  49. def get_SpotPriceLimit(self):
  50. return self.get_query_params().get('SpotPriceLimit')
  51. def set_SpotPriceLimit(self,SpotPriceLimit):
  52. self.add_query_param('SpotPriceLimit',SpotPriceLimit)
  53. def get_DeletionProtection(self):
  54. return self.get_query_params().get('DeletionProtection')
  55. def set_DeletionProtection(self,DeletionProtection):
  56. self.add_query_param('DeletionProtection',DeletionProtection)
  57. def get_ResourceGroupId(self):
  58. return self.get_query_params().get('ResourceGroupId')
  59. def set_ResourceGroupId(self,ResourceGroupId):
  60. self.add_query_param('ResourceGroupId',ResourceGroupId)
  61. def get_HostName(self):
  62. return self.get_query_params().get('HostName')
  63. def set_HostName(self,HostName):
  64. self.add_query_param('HostName',HostName)
  65. def get_Password(self):
  66. return self.get_query_params().get('Password')
  67. def set_Password(self,Password):
  68. self.add_query_param('Password',Password)
  69. def get_DeploymentSetGroupNo(self):
  70. return self.get_query_params().get('DeploymentSetGroupNo')
  71. def set_DeploymentSetGroupNo(self,DeploymentSetGroupNo):
  72. self.add_query_param('DeploymentSetGroupNo',DeploymentSetGroupNo)
  73. def get_StorageSetPartitionNumber(self):
  74. return self.get_query_params().get('StorageSetPartitionNumber')
  75. def set_StorageSetPartitionNumber(self,StorageSetPartitionNumber):
  76. self.add_query_param('StorageSetPartitionNumber',StorageSetPartitionNumber)
  77. def get_Tags(self):
  78. return self.get_query_params().get('Tags')
  79. def set_Tags(self, Tags):
  80. for depth1 in range(len(Tags)):
  81. if Tags[depth1].get('Value') is not None:
  82. self.add_query_param('Tag.' + str(depth1 + 1) + '.Value', Tags[depth1].get('Value'))
  83. if Tags[depth1].get('Key') is not None:
  84. self.add_query_param('Tag.' + str(depth1 + 1) + '.Key', Tags[depth1].get('Key'))
  85. def get_AutoRenewPeriod(self):
  86. return self.get_query_params().get('AutoRenewPeriod')
  87. def set_AutoRenewPeriod(self,AutoRenewPeriod):
  88. self.add_query_param('AutoRenewPeriod',AutoRenewPeriod)
  89. def get_NodeControllerId(self):
  90. return self.get_query_params().get('NodeControllerId')
  91. def set_NodeControllerId(self,NodeControllerId):
  92. self.add_query_param('NodeControllerId',NodeControllerId)
  93. def get_Period(self):
  94. return self.get_query_params().get('Period')
  95. def set_Period(self,Period):
  96. self.add_query_param('Period',Period)
  97. def get_DryRun(self):
  98. return self.get_query_params().get('DryRun')
  99. def set_DryRun(self,DryRun):
  100. self.add_query_param('DryRun',DryRun)
  101. def get_OwnerId(self):
  102. return self.get_query_params().get('OwnerId')
  103. def set_OwnerId(self,OwnerId):
  104. self.add_query_param('OwnerId',OwnerId)
  105. def get_VSwitchId(self):
  106. return self.get_query_params().get('VSwitchId')
  107. def set_VSwitchId(self,VSwitchId):
  108. self.add_query_param('VSwitchId',VSwitchId)
  109. def get_PrivateIpAddress(self):
  110. return self.get_query_params().get('PrivateIpAddress')
  111. def set_PrivateIpAddress(self,PrivateIpAddress):
  112. self.add_query_param('PrivateIpAddress',PrivateIpAddress)
  113. def get_SpotStrategy(self):
  114. return self.get_query_params().get('SpotStrategy')
  115. def set_SpotStrategy(self,SpotStrategy):
  116. self.add_query_param('SpotStrategy',SpotStrategy)
  117. def get_PeriodUnit(self):
  118. return self.get_query_params().get('PeriodUnit')
  119. def set_PeriodUnit(self,PeriodUnit):
  120. self.add_query_param('PeriodUnit',PeriodUnit)
  121. def get_InstanceName(self):
  122. return self.get_query_params().get('InstanceName')
  123. def set_InstanceName(self,InstanceName):
  124. self.add_query_param('InstanceName',InstanceName)
  125. def get_AutoRenew(self):
  126. return self.get_query_params().get('AutoRenew')
  127. def set_AutoRenew(self,AutoRenew):
  128. self.add_query_param('AutoRenew',AutoRenew)
  129. def get_InternetChargeType(self):
  130. return self.get_query_params().get('InternetChargeType')
  131. def set_InternetChargeType(self,InternetChargeType):
  132. self.add_query_param('InternetChargeType',InternetChargeType)
  133. def get_ZoneId(self):
  134. return self.get_query_params().get('ZoneId')
  135. def set_ZoneId(self,ZoneId):
  136. self.add_query_param('ZoneId',ZoneId)
  137. def get_InternetMaxBandwidthIn(self):
  138. return self.get_query_params().get('InternetMaxBandwidthIn')
  139. def set_InternetMaxBandwidthIn(self,InternetMaxBandwidthIn):
  140. self.add_query_param('InternetMaxBandwidthIn',InternetMaxBandwidthIn)
  141. def get_UseAdditionalService(self):
  142. return self.get_query_params().get('UseAdditionalService')
  143. def set_UseAdditionalService(self,UseAdditionalService):
  144. self.add_query_param('UseAdditionalService',UseAdditionalService)
  145. def get_Affinity(self):
  146. return self.get_query_params().get('Affinity')
  147. def set_Affinity(self,Affinity):
  148. self.add_query_param('Affinity',Affinity)
  149. def get_ImageId(self):
  150. return self.get_query_params().get('ImageId')
  151. def set_ImageId(self,ImageId):
  152. self.add_query_param('ImageId',ImageId)
  153. def get_ClientToken(self):
  154. return self.get_query_params().get('ClientToken')
  155. def set_ClientToken(self,ClientToken):
  156. self.add_query_param('ClientToken',ClientToken)
  157. def get_VlanId(self):
  158. return self.get_query_params().get('VlanId')
  159. def set_VlanId(self,VlanId):
  160. self.add_query_param('VlanId',VlanId)
  161. def get_SpotInterruptionBehavior(self):
  162. return self.get_query_params().get('SpotInterruptionBehavior')
  163. def set_SpotInterruptionBehavior(self,SpotInterruptionBehavior):
  164. self.add_query_param('SpotInterruptionBehavior',SpotInterruptionBehavior)
  165. def get_IoOptimized(self):
  166. return self.get_query_params().get('IoOptimized')
  167. def set_IoOptimized(self,IoOptimized):
  168. self.add_query_param('IoOptimized',IoOptimized)
  169. def get_SecurityGroupId(self):
  170. return self.get_query_params().get('SecurityGroupId')
  171. def set_SecurityGroupId(self,SecurityGroupId):
  172. self.add_query_param('SecurityGroupId',SecurityGroupId)
  173. def get_InternetMaxBandwidthOut(self):
  174. return self.get_query_params().get('InternetMaxBandwidthOut')
  175. def set_InternetMaxBandwidthOut(self,InternetMaxBandwidthOut):
  176. self.add_query_param('InternetMaxBandwidthOut',InternetMaxBandwidthOut)
  177. def get_Description(self):
  178. return self.get_query_params().get('Description')
  179. def set_Description(self,Description):
  180. self.add_query_param('Description',Description)
  181. def get_SystemDiskCategory(self):
  182. return self.get_query_params().get('SystemDisk.Category')
  183. def set_SystemDiskCategory(self,SystemDiskCategory):
  184. self.add_query_param('SystemDisk.Category',SystemDiskCategory)
  185. def get_SystemDiskPerformanceLevel(self):
  186. return self.get_query_params().get('SystemDisk.PerformanceLevel')
  187. def set_SystemDiskPerformanceLevel(self,SystemDiskPerformanceLevel):
  188. self.add_query_param('SystemDisk.PerformanceLevel',SystemDiskPerformanceLevel)
  189. def get_UserData(self):
  190. return self.get_query_params().get('UserData')
  191. def set_UserData(self,UserData):
  192. self.add_query_param('UserData',UserData)
  193. def get_PasswordInherit(self):
  194. return self.get_query_params().get('PasswordInherit')
  195. def set_PasswordInherit(self,PasswordInherit):
  196. self.add_query_param('PasswordInherit',PasswordInherit)
  197. def get_HttpEndpoint(self):
  198. return self.get_query_params().get('HttpEndpoint')
  199. def set_HttpEndpoint(self,HttpEndpoint):
  200. self.add_query_param('HttpEndpoint',HttpEndpoint)
  201. def get_InstanceType(self):
  202. return self.get_query_params().get('InstanceType')
  203. def set_InstanceType(self,InstanceType):
  204. self.add_query_param('InstanceType',InstanceType)
  205. def get_Arns(self):
  206. return self.get_query_params().get('Arns')
  207. def set_Arns(self, Arns):
  208. for depth1 in range(len(Arns)):
  209. if Arns[depth1].get('Rolearn') is not None:
  210. self.add_query_param('Arn.' + str(depth1 + 1) + '.Rolearn', Arns[depth1].get('Rolearn'))
  211. if Arns[depth1].get('RoleType') is not None:
  212. self.add_query_param('Arn.' + str(depth1 + 1) + '.RoleType', Arns[depth1].get('RoleType'))
  213. if Arns[depth1].get('AssumeRoleFor') is not None:
  214. self.add_query_param('Arn.' + str(depth1 + 1) + '.AssumeRoleFor', Arns[depth1].get('AssumeRoleFor'))
  215. def get_InstanceChargeType(self):
  216. return self.get_query_params().get('InstanceChargeType')
  217. def set_InstanceChargeType(self,InstanceChargeType):
  218. self.add_query_param('InstanceChargeType',InstanceChargeType)
  219. def get_DeploymentSetId(self):
  220. return self.get_query_params().get('DeploymentSetId')
  221. def set_DeploymentSetId(self,DeploymentSetId):
  222. self.add_query_param('DeploymentSetId',DeploymentSetId)
  223. def get_InnerIpAddress(self):
  224. return self.get_query_params().get('InnerIpAddress')
  225. def set_InnerIpAddress(self,InnerIpAddress):
  226. self.add_query_param('InnerIpAddress',InnerIpAddress)
  227. def get_ResourceOwnerAccount(self):
  228. return self.get_query_params().get('ResourceOwnerAccount')
  229. def set_ResourceOwnerAccount(self,ResourceOwnerAccount):
  230. self.add_query_param('ResourceOwnerAccount',ResourceOwnerAccount)
  231. def get_OwnerAccount(self):
  232. return self.get_query_params().get('OwnerAccount')
  233. def set_OwnerAccount(self,OwnerAccount):
  234. self.add_query_param('OwnerAccount',OwnerAccount)
  235. def get_Tenancy(self):
  236. return self.get_query_params().get('Tenancy')
  237. def set_Tenancy(self,Tenancy):
  238. self.add_query_param('Tenancy',Tenancy)
  239. def get_SystemDiskDiskName(self):
  240. return self.get_query_params().get('SystemDisk.DiskName')
  241. def set_SystemDiskDiskName(self,SystemDiskDiskName):
  242. self.add_query_param('SystemDisk.DiskName',SystemDiskDiskName)
  243. def get_RamRoleName(self):
  244. return self.get_query_params().get('RamRoleName')
  245. def set_RamRoleName(self,RamRoleName):
  246. self.add_query_param('RamRoleName',RamRoleName)
  247. def get_DedicatedHostId(self):
  248. return self.get_query_params().get('DedicatedHostId')
  249. def set_DedicatedHostId(self,DedicatedHostId):
  250. self.add_query_param('DedicatedHostId',DedicatedHostId)
  251. def get_ClusterId(self):
  252. return self.get_query_params().get('ClusterId')
  253. def set_ClusterId(self,ClusterId):
  254. self.add_query_param('ClusterId',ClusterId)
  255. def get_CreditSpecification(self):
  256. return self.get_query_params().get('CreditSpecification')
  257. def set_CreditSpecification(self,CreditSpecification):
  258. self.add_query_param('CreditSpecification',CreditSpecification)
  259. def get_SpotDuration(self):
  260. return self.get_query_params().get('SpotDuration')
  261. def set_SpotDuration(self,SpotDuration):
  262. self.add_query_param('SpotDuration',SpotDuration)
  263. def get_DataDisks(self):
  264. return self.get_query_params().get('DataDisks')
  265. def set_DataDisks(self, DataDisks):
  266. for depth1 in range(len(DataDisks)):
  267. if DataDisks[depth1].get('DiskName') is not None:
  268. self.add_query_param('DataDisk.' + str(depth1 + 1) + '.DiskName', DataDisks[depth1].get('DiskName'))
  269. if DataDisks[depth1].get('SnapshotId') is not None:
  270. self.add_query_param('DataDisk.' + str(depth1 + 1) + '.SnapshotId', DataDisks[depth1].get('SnapshotId'))
  271. if DataDisks[depth1].get('Size') is not None:
  272. self.add_query_param('DataDisk.' + str(depth1 + 1) + '.Size', DataDisks[depth1].get('Size'))
  273. if DataDisks[depth1].get('Encrypted') is not None:
  274. self.add_query_param('DataDisk.' + str(depth1 + 1) + '.Encrypted', DataDisks[depth1].get('Encrypted'))
  275. if DataDisks[depth1].get('PerformanceLevel') is not None:
  276. self.add_query_param('DataDisk.' + str(depth1 + 1) + '.PerformanceLevel', DataDisks[depth1].get('PerformanceLevel'))
  277. if DataDisks[depth1].get('EncryptAlgorithm') is not None:
  278. self.add_query_param('DataDisk.' + str(depth1 + 1) + '.EncryptAlgorithm', DataDisks[depth1].get('EncryptAlgorithm'))
  279. if DataDisks[depth1].get('Description') is not None:
  280. self.add_query_param('DataDisk.' + str(depth1 + 1) + '.Description', DataDisks[depth1].get('Description'))
  281. if DataDisks[depth1].get('Category') is not None:
  282. self.add_query_param('DataDisk.' + str(depth1 + 1) + '.Category', DataDisks[depth1].get('Category'))
  283. if DataDisks[depth1].get('KMSKeyId') is not None:
  284. self.add_query_param('DataDisk.' + str(depth1 + 1) + '.KMSKeyId', DataDisks[depth1].get('KMSKeyId'))
  285. if DataDisks[depth1].get('Device') is not None:
  286. self.add_query_param('DataDisk.' + str(depth1 + 1) + '.Device', DataDisks[depth1].get('Device'))
  287. if DataDisks[depth1].get('DeleteWithInstance') is not None:
  288. self.add_query_param('DataDisk.' + str(depth1 + 1) + '.DeleteWithInstance', DataDisks[depth1].get('DeleteWithInstance'))
  289. def get_StorageSetId(self):
  290. return self.get_query_params().get('StorageSetId')
  291. def set_StorageSetId(self,StorageSetId):
  292. self.add_query_param('StorageSetId',StorageSetId)
  293. def get_SystemDiskSize(self):
  294. return self.get_query_params().get('SystemDisk.Size')
  295. def set_SystemDiskSize(self,SystemDiskSize):
  296. self.add_query_param('SystemDisk.Size',SystemDiskSize)
  297. def get_ImageFamily(self):
  298. return self.get_query_params().get('ImageFamily')
  299. def set_ImageFamily(self,ImageFamily):
  300. self.add_query_param('ImageFamily',ImageFamily)
  301. def get_HttpTokens(self):
  302. return self.get_query_params().get('HttpTokens')
  303. def set_HttpTokens(self,HttpTokens):
  304. self.add_query_param('HttpTokens',HttpTokens)
  305. def get_SystemDiskDescription(self):
  306. return self.get_query_params().get('SystemDisk.Description')
  307. def set_SystemDiskDescription(self,SystemDiskDescription):
  308. self.add_query_param('SystemDisk.Description',SystemDiskDescription)