azure_mgmt_resources 0.17.5 → 0.17.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (227) hide show
  1. checksums.yaml +5 -5
  2. data/lib/2016-02-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +1 -1
  3. data/lib/2016-02-01/generated/azure_mgmt_resources/models/export_template_request.rb +6 -6
  4. data/lib/2016-02-01/generated/azure_mgmt_resources/models/parameters_link.rb +1 -1
  5. data/lib/2016-02-01/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  6. data/lib/2016-07-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +1 -1
  7. data/lib/2016-07-01/generated/azure_mgmt_resources/models/export_template_request.rb +6 -6
  8. data/lib/2016-07-01/generated/azure_mgmt_resources/models/parameters_link.rb +1 -1
  9. data/lib/2016-07-01/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  10. data/lib/2016-09-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +1 -1
  11. data/lib/2016-09-01/generated/azure_mgmt_resources/models/export_template_request.rb +6 -6
  12. data/lib/2016-09-01/generated/azure_mgmt_resources/models/parameters_link.rb +1 -1
  13. data/lib/2016-09-01/generated/azure_mgmt_resources/models/resource_group.rb +1 -1
  14. data/lib/2016-09-01/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  15. data/lib/2016-09-01/generated/azure_mgmt_resources/resources.rb +5 -5
  16. data/lib/2017-05-10/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +1 -1
  17. data/lib/2017-05-10/generated/azure_mgmt_resources/models/export_template_request.rb +6 -6
  18. data/lib/2017-05-10/generated/azure_mgmt_resources/models/parameters_link.rb +1 -1
  19. data/lib/2017-05-10/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  20. data/lib/2018-02-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +1 -1
  21. data/lib/2018-02-01/generated/azure_mgmt_resources/models/export_template_request.rb +6 -6
  22. data/lib/2018-02-01/generated/azure_mgmt_resources/models/parameters_link.rb +1 -1
  23. data/lib/2018-02-01/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  24. data/lib/2018-05-01/generated/azure_mgmt_resources/models/deployment_extended.rb +12 -0
  25. data/lib/2018-05-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +1 -1
  26. data/lib/2018-05-01/generated/azure_mgmt_resources/models/export_template_request.rb +6 -6
  27. data/lib/2018-05-01/generated/azure_mgmt_resources/models/parameters_link.rb +1 -1
  28. data/lib/2018-05-01/generated/azure_mgmt_resources/models/resource_group.rb +12 -0
  29. data/lib/2018-05-01/generated/azure_mgmt_resources/resource_groups.rb +18 -7
  30. data/lib/2018-05-01/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  31. data/lib/2018-05-01/generated/azure_mgmt_resources/resources.rb +144 -16
  32. data/lib/2019-03-01/generated/azure_mgmt_resources.rb +88 -0
  33. data/lib/2019-03-01/generated/azure_mgmt_resources/deployment_operations.rb +665 -0
  34. data/lib/2019-03-01/generated/azure_mgmt_resources/deployments.rb +2184 -0
  35. data/lib/2019-03-01/generated/azure_mgmt_resources/models/alias_path_type.rb +65 -0
  36. data/lib/2019-03-01/generated/azure_mgmt_resources/models/alias_type.rb +66 -0
  37. data/lib/2019-03-01/generated/azure_mgmt_resources/models/basic_dependency.rb +68 -0
  38. data/lib/2019-03-01/generated/azure_mgmt_resources/models/debug_setting.rb +54 -0
  39. data/lib/2019-03-01/generated/azure_mgmt_resources/models/dependency.rb +88 -0
  40. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment.rb +58 -0
  41. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_export_result.rb +46 -0
  42. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_extended.rb +94 -0
  43. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_extended_filter.rb +46 -0
  44. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_list_result.rb +99 -0
  45. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_mode.rb +16 -0
  46. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_operation.rb +71 -0
  47. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_operation_properties.rb +134 -0
  48. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_operations_list_result.rb +99 -0
  49. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_properties.rb +136 -0
  50. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +210 -0
  51. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_validate_result.rb +60 -0
  52. data/lib/2019-03-01/generated/azure_mgmt_resources/models/export_template_request.rb +69 -0
  53. data/lib/2019-03-01/generated/azure_mgmt_resources/models/generic_resource.rb +158 -0
  54. data/lib/2019-03-01/generated/azure_mgmt_resources/models/generic_resource_filter.rb +68 -0
  55. data/lib/2019-03-01/generated/azure_mgmt_resources/models/http_message.rb +46 -0
  56. data/lib/2019-03-01/generated/azure_mgmt_resources/models/identity.rb +96 -0
  57. data/lib/2019-03-01/generated/azure_mgmt_resources/models/identity_user_assigned_identities_value.rb +60 -0
  58. data/lib/2019-03-01/generated/azure_mgmt_resources/models/on_error_deployment.rb +60 -0
  59. data/lib/2019-03-01/generated/azure_mgmt_resources/models/on_error_deployment_extended.rb +73 -0
  60. data/lib/2019-03-01/generated/azure_mgmt_resources/models/on_error_deployment_type.rb +16 -0
  61. data/lib/2019-03-01/generated/azure_mgmt_resources/models/operation.rb +58 -0
  62. data/lib/2019-03-01/generated/azure_mgmt_resources/models/operation_display.rb +80 -0
  63. data/lib/2019-03-01/generated/azure_mgmt_resources/models/operation_list_result.rb +100 -0
  64. data/lib/2019-03-01/generated/azure_mgmt_resources/models/parameters_link.rb +58 -0
  65. data/lib/2019-03-01/generated/azure_mgmt_resources/models/plan.rb +90 -0
  66. data/lib/2019-03-01/generated/azure_mgmt_resources/models/provider.rb +104 -0
  67. data/lib/2019-03-01/generated/azure_mgmt_resources/models/provider_list_result.rb +99 -0
  68. data/lib/2019-03-01/generated/azure_mgmt_resources/models/provider_resource_type.rb +137 -0
  69. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource.rb +110 -0
  70. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource_group.rb +128 -0
  71. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource_group_export_result.rb +58 -0
  72. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource_group_filter.rb +57 -0
  73. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource_group_list_result.rb +99 -0
  74. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource_group_patchable.rb +90 -0
  75. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource_group_properties.rb +47 -0
  76. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource_identity_type.rb +18 -0
  77. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource_list_result.rb +99 -0
  78. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource_management_error_with_details.rb +92 -0
  79. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource_provider_operation_display_properties.rb +91 -0
  80. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resources_move_info.rb +65 -0
  81. data/lib/2019-03-01/generated/azure_mgmt_resources/models/sku.rb +101 -0
  82. data/lib/2019-03-01/generated/azure_mgmt_resources/models/sub_resource.rb +46 -0
  83. data/lib/2019-03-01/generated/azure_mgmt_resources/models/tag_count.rb +57 -0
  84. data/lib/2019-03-01/generated/azure_mgmt_resources/models/tag_details.rb +92 -0
  85. data/lib/2019-03-01/generated/azure_mgmt_resources/models/tag_value.rb +70 -0
  86. data/lib/2019-03-01/generated/azure_mgmt_resources/models/tags_list_result.rb +99 -0
  87. data/lib/2019-03-01/generated/azure_mgmt_resources/models/target_resource.rb +68 -0
  88. data/lib/2019-03-01/generated/azure_mgmt_resources/models/template_link.rb +58 -0
  89. data/lib/2019-03-01/generated/azure_mgmt_resources/module_definition.rb +9 -0
  90. data/lib/2019-03-01/generated/azure_mgmt_resources/operations.rb +219 -0
  91. data/lib/2019-03-01/generated/azure_mgmt_resources/providers.rb +530 -0
  92. data/lib/2019-03-01/generated/azure_mgmt_resources/resource_groups.rb +918 -0
  93. data/lib/2019-03-01/generated/azure_mgmt_resources/resource_management_client.rb +155 -0
  94. data/lib/2019-03-01/generated/azure_mgmt_resources/resources.rb +2338 -0
  95. data/lib/2019-03-01/generated/azure_mgmt_resources/tags.rb +611 -0
  96. data/lib/2019-05-01/generated/azure_mgmt_resources.rb +88 -0
  97. data/lib/2019-05-01/generated/azure_mgmt_resources/deployment_operations.rb +973 -0
  98. data/lib/2019-05-01/generated/azure_mgmt_resources/deployments.rb +3250 -0
  99. data/lib/2019-05-01/generated/azure_mgmt_resources/models/alias_path_type.rb +65 -0
  100. data/lib/2019-05-01/generated/azure_mgmt_resources/models/alias_type.rb +66 -0
  101. data/lib/2019-05-01/generated/azure_mgmt_resources/models/basic_dependency.rb +68 -0
  102. data/lib/2019-05-01/generated/azure_mgmt_resources/models/debug_setting.rb +53 -0
  103. data/lib/2019-05-01/generated/azure_mgmt_resources/models/dependency.rb +88 -0
  104. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment.rb +58 -0
  105. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_export_result.rb +46 -0
  106. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_extended.rb +94 -0
  107. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_extended_filter.rb +46 -0
  108. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_list_result.rb +99 -0
  109. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_mode.rb +16 -0
  110. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_operation.rb +71 -0
  111. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_operation_properties.rb +146 -0
  112. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_operations_list_result.rb +99 -0
  113. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_properties.rb +136 -0
  114. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +222 -0
  115. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_validate_result.rb +60 -0
  116. data/lib/2019-05-01/generated/azure_mgmt_resources/models/export_template_request.rb +69 -0
  117. data/lib/2019-05-01/generated/azure_mgmt_resources/models/generic_resource.rb +158 -0
  118. data/lib/2019-05-01/generated/azure_mgmt_resources/models/generic_resource_filter.rb +68 -0
  119. data/lib/2019-05-01/generated/azure_mgmt_resources/models/http_message.rb +46 -0
  120. data/lib/2019-05-01/generated/azure_mgmt_resources/models/identity.rb +96 -0
  121. data/lib/2019-05-01/generated/azure_mgmt_resources/models/identity_user_assigned_identities_value.rb +60 -0
  122. data/lib/2019-05-01/generated/azure_mgmt_resources/models/on_error_deployment.rb +60 -0
  123. data/lib/2019-05-01/generated/azure_mgmt_resources/models/on_error_deployment_extended.rb +73 -0
  124. data/lib/2019-05-01/generated/azure_mgmt_resources/models/on_error_deployment_type.rb +16 -0
  125. data/lib/2019-05-01/generated/azure_mgmt_resources/models/operation.rb +58 -0
  126. data/lib/2019-05-01/generated/azure_mgmt_resources/models/operation_display.rb +80 -0
  127. data/lib/2019-05-01/generated/azure_mgmt_resources/models/operation_list_result.rb +100 -0
  128. data/lib/2019-05-01/generated/azure_mgmt_resources/models/parameters_link.rb +58 -0
  129. data/lib/2019-05-01/generated/azure_mgmt_resources/models/plan.rb +90 -0
  130. data/lib/2019-05-01/generated/azure_mgmt_resources/models/provider.rb +104 -0
  131. data/lib/2019-05-01/generated/azure_mgmt_resources/models/provider_list_result.rb +99 -0
  132. data/lib/2019-05-01/generated/azure_mgmt_resources/models/provider_resource_type.rb +137 -0
  133. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource.rb +110 -0
  134. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource_group.rb +128 -0
  135. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource_group_export_result.rb +58 -0
  136. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource_group_filter.rb +57 -0
  137. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource_group_list_result.rb +99 -0
  138. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource_group_patchable.rb +90 -0
  139. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource_group_properties.rb +47 -0
  140. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource_identity_type.rb +18 -0
  141. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource_list_result.rb +99 -0
  142. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource_management_error_with_details.rb +92 -0
  143. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource_provider_operation_display_properties.rb +91 -0
  144. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resources_move_info.rb +65 -0
  145. data/lib/2019-05-01/generated/azure_mgmt_resources/models/sku.rb +101 -0
  146. data/lib/2019-05-01/generated/azure_mgmt_resources/models/sub_resource.rb +46 -0
  147. data/lib/2019-05-01/generated/azure_mgmt_resources/models/tag_count.rb +57 -0
  148. data/lib/2019-05-01/generated/azure_mgmt_resources/models/tag_details.rb +92 -0
  149. data/lib/2019-05-01/generated/azure_mgmt_resources/models/tag_value.rb +70 -0
  150. data/lib/2019-05-01/generated/azure_mgmt_resources/models/tags_list_result.rb +99 -0
  151. data/lib/2019-05-01/generated/azure_mgmt_resources/models/target_resource.rb +68 -0
  152. data/lib/2019-05-01/generated/azure_mgmt_resources/models/template_link.rb +58 -0
  153. data/lib/2019-05-01/generated/azure_mgmt_resources/module_definition.rb +9 -0
  154. data/lib/2019-05-01/generated/azure_mgmt_resources/operations.rb +219 -0
  155. data/lib/2019-05-01/generated/azure_mgmt_resources/providers.rb +530 -0
  156. data/lib/2019-05-01/generated/azure_mgmt_resources/resource_groups.rb +918 -0
  157. data/lib/2019-05-01/generated/azure_mgmt_resources/resource_management_client.rb +155 -0
  158. data/lib/2019-05-01/generated/azure_mgmt_resources/resources.rb +2338 -0
  159. data/lib/2019-05-01/generated/azure_mgmt_resources/tags.rb +611 -0
  160. data/lib/2019-05-10/generated/azure_mgmt_resources.rb +88 -0
  161. data/lib/2019-05-10/generated/azure_mgmt_resources/deployment_operations.rb +973 -0
  162. data/lib/2019-05-10/generated/azure_mgmt_resources/deployments.rb +3250 -0
  163. data/lib/2019-05-10/generated/azure_mgmt_resources/models/alias_path_type.rb +65 -0
  164. data/lib/2019-05-10/generated/azure_mgmt_resources/models/alias_type.rb +66 -0
  165. data/lib/2019-05-10/generated/azure_mgmt_resources/models/basic_dependency.rb +68 -0
  166. data/lib/2019-05-10/generated/azure_mgmt_resources/models/debug_setting.rb +53 -0
  167. data/lib/2019-05-10/generated/azure_mgmt_resources/models/dependency.rb +88 -0
  168. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment.rb +58 -0
  169. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_export_result.rb +46 -0
  170. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_extended.rb +94 -0
  171. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_extended_filter.rb +46 -0
  172. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_list_result.rb +99 -0
  173. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_mode.rb +16 -0
  174. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_operation.rb +71 -0
  175. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_operation_properties.rb +146 -0
  176. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_operations_list_result.rb +99 -0
  177. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_properties.rb +136 -0
  178. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +222 -0
  179. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_validate_result.rb +60 -0
  180. data/lib/2019-05-10/generated/azure_mgmt_resources/models/export_template_request.rb +69 -0
  181. data/lib/2019-05-10/generated/azure_mgmt_resources/models/generic_resource.rb +158 -0
  182. data/lib/2019-05-10/generated/azure_mgmt_resources/models/generic_resource_filter.rb +68 -0
  183. data/lib/2019-05-10/generated/azure_mgmt_resources/models/http_message.rb +46 -0
  184. data/lib/2019-05-10/generated/azure_mgmt_resources/models/identity.rb +96 -0
  185. data/lib/2019-05-10/generated/azure_mgmt_resources/models/identity_user_assigned_identities_value.rb +60 -0
  186. data/lib/2019-05-10/generated/azure_mgmt_resources/models/on_error_deployment.rb +60 -0
  187. data/lib/2019-05-10/generated/azure_mgmt_resources/models/on_error_deployment_extended.rb +73 -0
  188. data/lib/2019-05-10/generated/azure_mgmt_resources/models/on_error_deployment_type.rb +16 -0
  189. data/lib/2019-05-10/generated/azure_mgmt_resources/models/operation.rb +58 -0
  190. data/lib/2019-05-10/generated/azure_mgmt_resources/models/operation_display.rb +80 -0
  191. data/lib/2019-05-10/generated/azure_mgmt_resources/models/operation_list_result.rb +100 -0
  192. data/lib/2019-05-10/generated/azure_mgmt_resources/models/parameters_link.rb +58 -0
  193. data/lib/2019-05-10/generated/azure_mgmt_resources/models/plan.rb +90 -0
  194. data/lib/2019-05-10/generated/azure_mgmt_resources/models/provider.rb +104 -0
  195. data/lib/2019-05-10/generated/azure_mgmt_resources/models/provider_list_result.rb +99 -0
  196. data/lib/2019-05-10/generated/azure_mgmt_resources/models/provider_resource_type.rb +137 -0
  197. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource.rb +110 -0
  198. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource_group.rb +128 -0
  199. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource_group_export_result.rb +58 -0
  200. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource_group_filter.rb +57 -0
  201. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource_group_list_result.rb +99 -0
  202. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource_group_patchable.rb +90 -0
  203. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource_group_properties.rb +47 -0
  204. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource_identity_type.rb +18 -0
  205. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource_list_result.rb +99 -0
  206. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource_management_error_with_details.rb +92 -0
  207. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource_provider_operation_display_properties.rb +91 -0
  208. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resources_move_info.rb +65 -0
  209. data/lib/2019-05-10/generated/azure_mgmt_resources/models/sku.rb +101 -0
  210. data/lib/2019-05-10/generated/azure_mgmt_resources/models/sub_resource.rb +46 -0
  211. data/lib/2019-05-10/generated/azure_mgmt_resources/models/tag_count.rb +57 -0
  212. data/lib/2019-05-10/generated/azure_mgmt_resources/models/tag_details.rb +92 -0
  213. data/lib/2019-05-10/generated/azure_mgmt_resources/models/tag_value.rb +70 -0
  214. data/lib/2019-05-10/generated/azure_mgmt_resources/models/tags_list_result.rb +99 -0
  215. data/lib/2019-05-10/generated/azure_mgmt_resources/models/target_resource.rb +68 -0
  216. data/lib/2019-05-10/generated/azure_mgmt_resources/models/template_link.rb +58 -0
  217. data/lib/2019-05-10/generated/azure_mgmt_resources/module_definition.rb +9 -0
  218. data/lib/2019-05-10/generated/azure_mgmt_resources/operations.rb +219 -0
  219. data/lib/2019-05-10/generated/azure_mgmt_resources/providers.rb +530 -0
  220. data/lib/2019-05-10/generated/azure_mgmt_resources/resource_groups.rb +918 -0
  221. data/lib/2019-05-10/generated/azure_mgmt_resources/resource_management_client.rb +155 -0
  222. data/lib/2019-05-10/generated/azure_mgmt_resources/resources.rb +2338 -0
  223. data/lib/2019-05-10/generated/azure_mgmt_resources/tags.rb +611 -0
  224. data/lib/azure_mgmt_resources.rb +3 -0
  225. data/lib/profiles/latest/modules/resources_profile_module.rb +116 -116
  226. data/lib/version.rb +1 -1
  227. metadata +195 -3
@@ -0,0 +1,2184 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::Resources::Mgmt::V2019_03_01
7
+ #
8
+ # Provides operations for working with resources and resource groups.
9
+ #
10
+ class Deployments
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Deployments class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [ResourceManagementClient] reference to the ResourceManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Deletes a deployment from the deployment history.
26
+ #
27
+ # A template deployment that is currently running cannot be deleted. Deleting a
28
+ # template deployment removes the associated deployment operations. This is an
29
+ # asynchronous operation that returns a status of 202 until the template
30
+ # deployment is successfully deleted. The Location response header contains the
31
+ # URI that is used to obtain the status of the process. While the process is
32
+ # running, a call to the URI in the Location header returns a status of 202.
33
+ # When the process finishes, the URI in the Location header returns a status of
34
+ # 204 on success. If the asynchronous request failed, the URI in the Location
35
+ # header returns an error-level status code.
36
+ #
37
+ # @param deployment_name [String] The name of the deployment to delete.
38
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
39
+ # will be added to the HTTP request.
40
+ #
41
+ def delete_at_subscription_scope(deployment_name, custom_headers:nil)
42
+ response = delete_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
43
+ nil
44
+ end
45
+
46
+ #
47
+ # @param deployment_name [String] The name of the deployment to delete.
48
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
49
+ # will be added to the HTTP request.
50
+ #
51
+ # @return [Concurrent::Promise] promise which provides async access to http
52
+ # response.
53
+ #
54
+ def delete_at_subscription_scope_async(deployment_name, custom_headers:nil)
55
+ # Send request
56
+ promise = begin_delete_at_subscription_scope_async(deployment_name, custom_headers:custom_headers)
57
+
58
+ promise = promise.then do |response|
59
+ # Defining deserialization method.
60
+ deserialize_method = lambda do |parsed_response|
61
+ end
62
+
63
+ # Waiting for response.
64
+ @client.get_long_running_operation_result(response, deserialize_method)
65
+ end
66
+
67
+ promise
68
+ end
69
+
70
+ #
71
+ # Checks whether the deployment exists.
72
+ #
73
+ # @param deployment_name [String] The name of the deployment to check.
74
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
75
+ # will be added to the HTTP request.
76
+ #
77
+ # @return [Boolean] operation results.
78
+ #
79
+ def check_existence_at_subscription_scope(deployment_name, custom_headers:nil)
80
+ response = check_existence_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
81
+ response.body unless response.nil?
82
+ end
83
+
84
+ #
85
+ # Checks whether the deployment exists.
86
+ #
87
+ # @param deployment_name [String] The name of the deployment to check.
88
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
89
+ # will be added to the HTTP request.
90
+ #
91
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
92
+ #
93
+ def check_existence_at_subscription_scope_with_http_info(deployment_name, custom_headers:nil)
94
+ check_existence_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
95
+ end
96
+
97
+ #
98
+ # Checks whether the deployment exists.
99
+ #
100
+ # @param deployment_name [String] The name of the deployment to check.
101
+ # @param [Hash{String => String}] A hash of custom headers that will be added
102
+ # to the HTTP request.
103
+ #
104
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
105
+ #
106
+ def check_existence_at_subscription_scope_async(deployment_name, custom_headers:nil)
107
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
108
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
109
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
110
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
111
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
112
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
113
+
114
+
115
+ request_headers = {}
116
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
117
+
118
+ # Set Headers
119
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
120
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
121
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}'
122
+
123
+ request_url = @base_url || @client.base_url
124
+
125
+ options = {
126
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
127
+ path_params: {'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
128
+ query_params: {'api-version' => @client.api_version},
129
+ headers: request_headers.merge(custom_headers || {}),
130
+ base_url: request_url
131
+ }
132
+ promise = @client.make_request_async(:head, path_template, options)
133
+
134
+ promise = promise.then do |result|
135
+ http_response = result.response
136
+ status_code = http_response.status
137
+ response_content = http_response.body
138
+ unless status_code == 204 || status_code == 404
139
+ error_model = JSON.load(response_content)
140
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
141
+ end
142
+
143
+ result.body = (status_code == 204)
144
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
145
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
146
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
147
+
148
+ result
149
+ end
150
+
151
+ promise.execute
152
+ end
153
+
154
+ #
155
+ # Deploys resources at subscription scope.
156
+ #
157
+ # You can provide the template and parameters directly in the request or link
158
+ # to JSON files.
159
+ #
160
+ # @param deployment_name [String] The name of the deployment.
161
+ # @param parameters [Deployment] Additional parameters supplied to the
162
+ # operation.
163
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
164
+ # will be added to the HTTP request.
165
+ #
166
+ # @return [DeploymentExtended] operation results.
167
+ #
168
+ def create_or_update_at_subscription_scope(deployment_name, parameters, custom_headers:nil)
169
+ response = create_or_update_at_subscription_scope_async(deployment_name, parameters, custom_headers:custom_headers).value!
170
+ response.body unless response.nil?
171
+ end
172
+
173
+ #
174
+ # @param deployment_name [String] The name of the deployment.
175
+ # @param parameters [Deployment] Additional parameters supplied to the
176
+ # operation.
177
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
178
+ # will be added to the HTTP request.
179
+ #
180
+ # @return [Concurrent::Promise] promise which provides async access to http
181
+ # response.
182
+ #
183
+ def create_or_update_at_subscription_scope_async(deployment_name, parameters, custom_headers:nil)
184
+ # Send request
185
+ promise = begin_create_or_update_at_subscription_scope_async(deployment_name, parameters, custom_headers:custom_headers)
186
+
187
+ promise = promise.then do |response|
188
+ # Defining deserialization method.
189
+ deserialize_method = lambda do |parsed_response|
190
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::DeploymentExtended.mapper()
191
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
192
+ end
193
+
194
+ # Waiting for response.
195
+ @client.get_long_running_operation_result(response, deserialize_method)
196
+ end
197
+
198
+ promise
199
+ end
200
+
201
+ #
202
+ # Gets a deployment.
203
+ #
204
+ # @param deployment_name [String] The name of the deployment to get.
205
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
206
+ # will be added to the HTTP request.
207
+ #
208
+ # @return [DeploymentExtended] operation results.
209
+ #
210
+ def get_at_subscription_scope(deployment_name, custom_headers:nil)
211
+ response = get_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
212
+ response.body unless response.nil?
213
+ end
214
+
215
+ #
216
+ # Gets a deployment.
217
+ #
218
+ # @param deployment_name [String] The name of the deployment to get.
219
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
220
+ # will be added to the HTTP request.
221
+ #
222
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
223
+ #
224
+ def get_at_subscription_scope_with_http_info(deployment_name, custom_headers:nil)
225
+ get_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
226
+ end
227
+
228
+ #
229
+ # Gets a deployment.
230
+ #
231
+ # @param deployment_name [String] The name of the deployment to get.
232
+ # @param [Hash{String => String}] A hash of custom headers that will be added
233
+ # to the HTTP request.
234
+ #
235
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
236
+ #
237
+ def get_at_subscription_scope_async(deployment_name, custom_headers:nil)
238
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
239
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
240
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
241
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
242
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
243
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
244
+
245
+
246
+ request_headers = {}
247
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
248
+
249
+ # Set Headers
250
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
251
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
252
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}'
253
+
254
+ request_url = @base_url || @client.base_url
255
+
256
+ options = {
257
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
258
+ path_params: {'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
259
+ query_params: {'api-version' => @client.api_version},
260
+ headers: request_headers.merge(custom_headers || {}),
261
+ base_url: request_url
262
+ }
263
+ promise = @client.make_request_async(:get, path_template, options)
264
+
265
+ promise = promise.then do |result|
266
+ http_response = result.response
267
+ status_code = http_response.status
268
+ response_content = http_response.body
269
+ unless status_code == 200
270
+ error_model = JSON.load(response_content)
271
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
272
+ end
273
+
274
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
275
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
276
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
277
+ # Deserialize Response
278
+ if status_code == 200
279
+ begin
280
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
281
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::DeploymentExtended.mapper()
282
+ result.body = @client.deserialize(result_mapper, parsed_response)
283
+ rescue Exception => e
284
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
285
+ end
286
+ end
287
+
288
+ result
289
+ end
290
+
291
+ promise.execute
292
+ end
293
+
294
+ #
295
+ # Cancels a currently running template deployment.
296
+ #
297
+ # You can cancel a deployment only if the provisioningState is Accepted or
298
+ # Running. After the deployment is canceled, the provisioningState is set to
299
+ # Canceled. Canceling a template deployment stops the currently running
300
+ # template deployment and leaves the resources partially deployed.
301
+ #
302
+ # @param deployment_name [String] The name of the deployment to cancel.
303
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
304
+ # will be added to the HTTP request.
305
+ #
306
+ #
307
+ def cancel_at_subscription_scope(deployment_name, custom_headers:nil)
308
+ response = cancel_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
309
+ nil
310
+ end
311
+
312
+ #
313
+ # Cancels a currently running template deployment.
314
+ #
315
+ # You can cancel a deployment only if the provisioningState is Accepted or
316
+ # Running. After the deployment is canceled, the provisioningState is set to
317
+ # Canceled. Canceling a template deployment stops the currently running
318
+ # template deployment and leaves the resources partially deployed.
319
+ #
320
+ # @param deployment_name [String] The name of the deployment to cancel.
321
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
322
+ # will be added to the HTTP request.
323
+ #
324
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
325
+ #
326
+ def cancel_at_subscription_scope_with_http_info(deployment_name, custom_headers:nil)
327
+ cancel_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
328
+ end
329
+
330
+ #
331
+ # Cancels a currently running template deployment.
332
+ #
333
+ # You can cancel a deployment only if the provisioningState is Accepted or
334
+ # Running. After the deployment is canceled, the provisioningState is set to
335
+ # Canceled. Canceling a template deployment stops the currently running
336
+ # template deployment and leaves the resources partially deployed.
337
+ #
338
+ # @param deployment_name [String] The name of the deployment to cancel.
339
+ # @param [Hash{String => String}] A hash of custom headers that will be added
340
+ # to the HTTP request.
341
+ #
342
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
343
+ #
344
+ def cancel_at_subscription_scope_async(deployment_name, custom_headers:nil)
345
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
346
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
347
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
348
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
349
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
350
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
351
+
352
+
353
+ request_headers = {}
354
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
355
+
356
+ # Set Headers
357
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
358
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
359
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'
360
+
361
+ request_url = @base_url || @client.base_url
362
+
363
+ options = {
364
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
365
+ path_params: {'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
366
+ query_params: {'api-version' => @client.api_version},
367
+ headers: request_headers.merge(custom_headers || {}),
368
+ base_url: request_url
369
+ }
370
+ promise = @client.make_request_async(:post, path_template, options)
371
+
372
+ promise = promise.then do |result|
373
+ http_response = result.response
374
+ status_code = http_response.status
375
+ response_content = http_response.body
376
+ unless status_code == 204
377
+ error_model = JSON.load(response_content)
378
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
379
+ end
380
+
381
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
382
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
383
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
384
+
385
+ result
386
+ end
387
+
388
+ promise.execute
389
+ end
390
+
391
+ #
392
+ # Validates whether the specified template is syntactically correct and will be
393
+ # accepted by Azure Resource Manager..
394
+ #
395
+ # @param deployment_name [String] The name of the deployment.
396
+ # @param parameters [Deployment] Parameters to validate.
397
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
398
+ # will be added to the HTTP request.
399
+ #
400
+ # @return [DeploymentValidateResult] operation results.
401
+ #
402
+ def validate_at_subscription_scope(deployment_name, parameters, custom_headers:nil)
403
+ response = validate_at_subscription_scope_async(deployment_name, parameters, custom_headers:custom_headers).value!
404
+ response.body unless response.nil?
405
+ end
406
+
407
+ #
408
+ # Validates whether the specified template is syntactically correct and will be
409
+ # accepted by Azure Resource Manager..
410
+ #
411
+ # @param deployment_name [String] The name of the deployment.
412
+ # @param parameters [Deployment] Parameters to validate.
413
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
414
+ # will be added to the HTTP request.
415
+ #
416
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
417
+ #
418
+ def validate_at_subscription_scope_with_http_info(deployment_name, parameters, custom_headers:nil)
419
+ validate_at_subscription_scope_async(deployment_name, parameters, custom_headers:custom_headers).value!
420
+ end
421
+
422
+ #
423
+ # Validates whether the specified template is syntactically correct and will be
424
+ # accepted by Azure Resource Manager..
425
+ #
426
+ # @param deployment_name [String] The name of the deployment.
427
+ # @param parameters [Deployment] Parameters to validate.
428
+ # @param [Hash{String => String}] A hash of custom headers that will be added
429
+ # to the HTTP request.
430
+ #
431
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
432
+ #
433
+ def validate_at_subscription_scope_async(deployment_name, parameters, custom_headers:nil)
434
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
435
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
436
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
437
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
438
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
439
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
440
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
441
+
442
+
443
+ request_headers = {}
444
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
445
+
446
+ # Set Headers
447
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
448
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
449
+
450
+ # Serialize Request
451
+ request_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::Deployment.mapper()
452
+ request_content = @client.serialize(request_mapper, parameters)
453
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
454
+
455
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate'
456
+
457
+ request_url = @base_url || @client.base_url
458
+
459
+ options = {
460
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
461
+ path_params: {'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
462
+ query_params: {'api-version' => @client.api_version},
463
+ body: request_content,
464
+ headers: request_headers.merge(custom_headers || {}),
465
+ base_url: request_url
466
+ }
467
+ promise = @client.make_request_async(:post, path_template, options)
468
+
469
+ promise = promise.then do |result|
470
+ http_response = result.response
471
+ status_code = http_response.status
472
+ response_content = http_response.body
473
+ unless status_code == 200 || status_code == 400
474
+ error_model = JSON.load(response_content)
475
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
476
+ end
477
+
478
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
479
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
480
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
481
+ # Deserialize Response
482
+ if status_code == 200
483
+ begin
484
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
485
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::DeploymentValidateResult.mapper()
486
+ result.body = @client.deserialize(result_mapper, parsed_response)
487
+ rescue Exception => e
488
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
489
+ end
490
+ end
491
+ # Deserialize Response
492
+ if status_code == 400
493
+ begin
494
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
495
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::DeploymentValidateResult.mapper()
496
+ result.body = @client.deserialize(result_mapper, parsed_response)
497
+ rescue Exception => e
498
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
499
+ end
500
+ end
501
+
502
+ result
503
+ end
504
+
505
+ promise.execute
506
+ end
507
+
508
+ #
509
+ # Exports the template used for specified deployment.
510
+ #
511
+ # @param deployment_name [String] The name of the deployment from which to get
512
+ # the template.
513
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
514
+ # will be added to the HTTP request.
515
+ #
516
+ # @return [DeploymentExportResult] operation results.
517
+ #
518
+ def export_template_at_subscription_scope(deployment_name, custom_headers:nil)
519
+ response = export_template_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
520
+ response.body unless response.nil?
521
+ end
522
+
523
+ #
524
+ # Exports the template used for specified deployment.
525
+ #
526
+ # @param deployment_name [String] The name of the deployment from which to get
527
+ # the template.
528
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
529
+ # will be added to the HTTP request.
530
+ #
531
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
532
+ #
533
+ def export_template_at_subscription_scope_with_http_info(deployment_name, custom_headers:nil)
534
+ export_template_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
535
+ end
536
+
537
+ #
538
+ # Exports the template used for specified deployment.
539
+ #
540
+ # @param deployment_name [String] The name of the deployment from which to get
541
+ # the template.
542
+ # @param [Hash{String => String}] A hash of custom headers that will be added
543
+ # to the HTTP request.
544
+ #
545
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
546
+ #
547
+ def export_template_at_subscription_scope_async(deployment_name, custom_headers:nil)
548
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
549
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
550
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
551
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
552
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
553
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
554
+
555
+
556
+ request_headers = {}
557
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
558
+
559
+ # Set Headers
560
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
561
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
562
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate'
563
+
564
+ request_url = @base_url || @client.base_url
565
+
566
+ options = {
567
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
568
+ path_params: {'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
569
+ query_params: {'api-version' => @client.api_version},
570
+ headers: request_headers.merge(custom_headers || {}),
571
+ base_url: request_url
572
+ }
573
+ promise = @client.make_request_async(:post, path_template, options)
574
+
575
+ promise = promise.then do |result|
576
+ http_response = result.response
577
+ status_code = http_response.status
578
+ response_content = http_response.body
579
+ unless status_code == 200
580
+ error_model = JSON.load(response_content)
581
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
582
+ end
583
+
584
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
585
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
586
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
587
+ # Deserialize Response
588
+ if status_code == 200
589
+ begin
590
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
591
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::DeploymentExportResult.mapper()
592
+ result.body = @client.deserialize(result_mapper, parsed_response)
593
+ rescue Exception => e
594
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
595
+ end
596
+ end
597
+
598
+ result
599
+ end
600
+
601
+ promise.execute
602
+ end
603
+
604
+ #
605
+ # Get all the deployments for a subscription.
606
+ #
607
+ # @param filter [String] The filter to apply on the operation. For example, you
608
+ # can use $filter=provisioningState eq '{state}'.
609
+ # @param top [Integer] The number of results to get. If null is passed, returns
610
+ # all deployments.
611
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
612
+ # will be added to the HTTP request.
613
+ #
614
+ # @return [Array<DeploymentExtended>] operation results.
615
+ #
616
+ def list_at_subscription_scope(filter:nil, top:nil, custom_headers:nil)
617
+ first_page = list_at_subscription_scope_as_lazy(filter:filter, top:top, custom_headers:custom_headers)
618
+ first_page.get_all_items
619
+ end
620
+
621
+ #
622
+ # Get all the deployments for a subscription.
623
+ #
624
+ # @param filter [String] The filter to apply on the operation. For example, you
625
+ # can use $filter=provisioningState eq '{state}'.
626
+ # @param top [Integer] The number of results to get. If null is passed, returns
627
+ # all deployments.
628
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
629
+ # will be added to the HTTP request.
630
+ #
631
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
632
+ #
633
+ def list_at_subscription_scope_with_http_info(filter:nil, top:nil, custom_headers:nil)
634
+ list_at_subscription_scope_async(filter:filter, top:top, custom_headers:custom_headers).value!
635
+ end
636
+
637
+ #
638
+ # Get all the deployments for a subscription.
639
+ #
640
+ # @param filter [String] The filter to apply on the operation. For example, you
641
+ # can use $filter=provisioningState eq '{state}'.
642
+ # @param top [Integer] The number of results to get. If null is passed, returns
643
+ # all deployments.
644
+ # @param [Hash{String => String}] A hash of custom headers that will be added
645
+ # to the HTTP request.
646
+ #
647
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
648
+ #
649
+ def list_at_subscription_scope_async(filter:nil, top:nil, custom_headers:nil)
650
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
651
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
652
+
653
+
654
+ request_headers = {}
655
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
656
+
657
+ # Set Headers
658
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
659
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
660
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/'
661
+
662
+ request_url = @base_url || @client.base_url
663
+
664
+ options = {
665
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
666
+ path_params: {'subscriptionId' => @client.subscription_id},
667
+ query_params: {'$filter' => filter,'$top' => top,'api-version' => @client.api_version},
668
+ headers: request_headers.merge(custom_headers || {}),
669
+ base_url: request_url
670
+ }
671
+ promise = @client.make_request_async(:get, path_template, options)
672
+
673
+ promise = promise.then do |result|
674
+ http_response = result.response
675
+ status_code = http_response.status
676
+ response_content = http_response.body
677
+ unless status_code == 200
678
+ error_model = JSON.load(response_content)
679
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
680
+ end
681
+
682
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
683
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
684
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
685
+ # Deserialize Response
686
+ if status_code == 200
687
+ begin
688
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
689
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::DeploymentListResult.mapper()
690
+ result.body = @client.deserialize(result_mapper, parsed_response)
691
+ rescue Exception => e
692
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
693
+ end
694
+ end
695
+
696
+ result
697
+ end
698
+
699
+ promise.execute
700
+ end
701
+
702
+ #
703
+ # Deletes a deployment from the deployment history.
704
+ #
705
+ # A template deployment that is currently running cannot be deleted. Deleting a
706
+ # template deployment removes the associated deployment operations. Deleting a
707
+ # template deployment does not affect the state of the resource group. This is
708
+ # an asynchronous operation that returns a status of 202 until the template
709
+ # deployment is successfully deleted. The Location response header contains the
710
+ # URI that is used to obtain the status of the process. While the process is
711
+ # running, a call to the URI in the Location header returns a status of 202.
712
+ # When the process finishes, the URI in the Location header returns a status of
713
+ # 204 on success. If the asynchronous request failed, the URI in the Location
714
+ # header returns an error-level status code.
715
+ #
716
+ # @param resource_group_name [String] The name of the resource group with the
717
+ # deployment to delete. The name is case insensitive.
718
+ # @param deployment_name [String] The name of the deployment to delete.
719
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
720
+ # will be added to the HTTP request.
721
+ #
722
+ def delete(resource_group_name, deployment_name, custom_headers:nil)
723
+ response = delete_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
724
+ nil
725
+ end
726
+
727
+ #
728
+ # @param resource_group_name [String] The name of the resource group with the
729
+ # deployment to delete. The name is case insensitive.
730
+ # @param deployment_name [String] The name of the deployment to delete.
731
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
732
+ # will be added to the HTTP request.
733
+ #
734
+ # @return [Concurrent::Promise] promise which provides async access to http
735
+ # response.
736
+ #
737
+ def delete_async(resource_group_name, deployment_name, custom_headers:nil)
738
+ # Send request
739
+ promise = begin_delete_async(resource_group_name, deployment_name, custom_headers:custom_headers)
740
+
741
+ promise = promise.then do |response|
742
+ # Defining deserialization method.
743
+ deserialize_method = lambda do |parsed_response|
744
+ end
745
+
746
+ # Waiting for response.
747
+ @client.get_long_running_operation_result(response, deserialize_method)
748
+ end
749
+
750
+ promise
751
+ end
752
+
753
+ #
754
+ # Checks whether the deployment exists.
755
+ #
756
+ # @param resource_group_name [String] The name of the resource group with the
757
+ # deployment to check. The name is case insensitive.
758
+ # @param deployment_name [String] The name of the deployment to check.
759
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
760
+ # will be added to the HTTP request.
761
+ #
762
+ # @return [Boolean] operation results.
763
+ #
764
+ def check_existence(resource_group_name, deployment_name, custom_headers:nil)
765
+ response = check_existence_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
766
+ response.body unless response.nil?
767
+ end
768
+
769
+ #
770
+ # Checks whether the deployment exists.
771
+ #
772
+ # @param resource_group_name [String] The name of the resource group with the
773
+ # deployment to check. The name is case insensitive.
774
+ # @param deployment_name [String] The name of the deployment to check.
775
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
776
+ # will be added to the HTTP request.
777
+ #
778
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
779
+ #
780
+ def check_existence_with_http_info(resource_group_name, deployment_name, custom_headers:nil)
781
+ check_existence_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
782
+ end
783
+
784
+ #
785
+ # Checks whether the deployment exists.
786
+ #
787
+ # @param resource_group_name [String] The name of the resource group with the
788
+ # deployment to check. The name is case insensitive.
789
+ # @param deployment_name [String] The name of the deployment to check.
790
+ # @param [Hash{String => String}] A hash of custom headers that will be added
791
+ # to the HTTP request.
792
+ #
793
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
794
+ #
795
+ def check_existence_async(resource_group_name, deployment_name, custom_headers:nil)
796
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
797
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
798
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
799
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
800
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
801
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
802
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
803
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
804
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
805
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
806
+
807
+
808
+ request_headers = {}
809
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
810
+
811
+ # Set Headers
812
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
813
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
814
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'
815
+
816
+ request_url = @base_url || @client.base_url
817
+
818
+ options = {
819
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
820
+ path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
821
+ query_params: {'api-version' => @client.api_version},
822
+ headers: request_headers.merge(custom_headers || {}),
823
+ base_url: request_url
824
+ }
825
+ promise = @client.make_request_async(:head, path_template, options)
826
+
827
+ promise = promise.then do |result|
828
+ http_response = result.response
829
+ status_code = http_response.status
830
+ response_content = http_response.body
831
+ unless status_code == 204 || status_code == 404
832
+ error_model = JSON.load(response_content)
833
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
834
+ end
835
+
836
+ result.body = (status_code == 204)
837
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
838
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
839
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
840
+
841
+ result
842
+ end
843
+
844
+ promise.execute
845
+ end
846
+
847
+ #
848
+ # Deploys resources to a resource group.
849
+ #
850
+ # You can provide the template and parameters directly in the request or link
851
+ # to JSON files.
852
+ #
853
+ # @param resource_group_name [String] The name of the resource group to deploy
854
+ # the resources to. The name is case insensitive. The resource group must
855
+ # already exist.
856
+ # @param deployment_name [String] The name of the deployment.
857
+ # @param parameters [Deployment] Additional parameters supplied to the
858
+ # operation.
859
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
860
+ # will be added to the HTTP request.
861
+ #
862
+ # @return [DeploymentExtended] operation results.
863
+ #
864
+ def create_or_update(resource_group_name, deployment_name, parameters, custom_headers:nil)
865
+ response = create_or_update_async(resource_group_name, deployment_name, parameters, custom_headers:custom_headers).value!
866
+ response.body unless response.nil?
867
+ end
868
+
869
+ #
870
+ # @param resource_group_name [String] The name of the resource group to deploy
871
+ # the resources to. The name is case insensitive. The resource group must
872
+ # already exist.
873
+ # @param deployment_name [String] The name of the deployment.
874
+ # @param parameters [Deployment] Additional parameters supplied to the
875
+ # operation.
876
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
877
+ # will be added to the HTTP request.
878
+ #
879
+ # @return [Concurrent::Promise] promise which provides async access to http
880
+ # response.
881
+ #
882
+ def create_or_update_async(resource_group_name, deployment_name, parameters, custom_headers:nil)
883
+ # Send request
884
+ promise = begin_create_or_update_async(resource_group_name, deployment_name, parameters, custom_headers:custom_headers)
885
+
886
+ promise = promise.then do |response|
887
+ # Defining deserialization method.
888
+ deserialize_method = lambda do |parsed_response|
889
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::DeploymentExtended.mapper()
890
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
891
+ end
892
+
893
+ # Waiting for response.
894
+ @client.get_long_running_operation_result(response, deserialize_method)
895
+ end
896
+
897
+ promise
898
+ end
899
+
900
+ #
901
+ # Gets a deployment.
902
+ #
903
+ # @param resource_group_name [String] The name of the resource group. The name
904
+ # is case insensitive.
905
+ # @param deployment_name [String] The name of the deployment to get.
906
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
907
+ # will be added to the HTTP request.
908
+ #
909
+ # @return [DeploymentExtended] operation results.
910
+ #
911
+ def get(resource_group_name, deployment_name, custom_headers:nil)
912
+ response = get_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
913
+ response.body unless response.nil?
914
+ end
915
+
916
+ #
917
+ # Gets a deployment.
918
+ #
919
+ # @param resource_group_name [String] The name of the resource group. The name
920
+ # is case insensitive.
921
+ # @param deployment_name [String] The name of the deployment to get.
922
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
923
+ # will be added to the HTTP request.
924
+ #
925
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
926
+ #
927
+ def get_with_http_info(resource_group_name, deployment_name, custom_headers:nil)
928
+ get_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
929
+ end
930
+
931
+ #
932
+ # Gets a deployment.
933
+ #
934
+ # @param resource_group_name [String] The name of the resource group. The name
935
+ # is case insensitive.
936
+ # @param deployment_name [String] The name of the deployment to get.
937
+ # @param [Hash{String => String}] A hash of custom headers that will be added
938
+ # to the HTTP request.
939
+ #
940
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
941
+ #
942
+ def get_async(resource_group_name, deployment_name, custom_headers:nil)
943
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
944
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
945
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
946
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
947
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
948
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
949
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
950
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
951
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
952
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
953
+
954
+
955
+ request_headers = {}
956
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
957
+
958
+ # Set Headers
959
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
960
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
961
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'
962
+
963
+ request_url = @base_url || @client.base_url
964
+
965
+ options = {
966
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
967
+ path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
968
+ query_params: {'api-version' => @client.api_version},
969
+ headers: request_headers.merge(custom_headers || {}),
970
+ base_url: request_url
971
+ }
972
+ promise = @client.make_request_async(:get, path_template, options)
973
+
974
+ promise = promise.then do |result|
975
+ http_response = result.response
976
+ status_code = http_response.status
977
+ response_content = http_response.body
978
+ unless status_code == 200
979
+ error_model = JSON.load(response_content)
980
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
981
+ end
982
+
983
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
984
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
985
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
986
+ # Deserialize Response
987
+ if status_code == 200
988
+ begin
989
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
990
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::DeploymentExtended.mapper()
991
+ result.body = @client.deserialize(result_mapper, parsed_response)
992
+ rescue Exception => e
993
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
994
+ end
995
+ end
996
+
997
+ result
998
+ end
999
+
1000
+ promise.execute
1001
+ end
1002
+
1003
+ #
1004
+ # Cancels a currently running template deployment.
1005
+ #
1006
+ # You can cancel a deployment only if the provisioningState is Accepted or
1007
+ # Running. After the deployment is canceled, the provisioningState is set to
1008
+ # Canceled. Canceling a template deployment stops the currently running
1009
+ # template deployment and leaves the resource group partially deployed.
1010
+ #
1011
+ # @param resource_group_name [String] The name of the resource group. The name
1012
+ # is case insensitive.
1013
+ # @param deployment_name [String] The name of the deployment to cancel.
1014
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1015
+ # will be added to the HTTP request.
1016
+ #
1017
+ #
1018
+ def cancel(resource_group_name, deployment_name, custom_headers:nil)
1019
+ response = cancel_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
1020
+ nil
1021
+ end
1022
+
1023
+ #
1024
+ # Cancels a currently running template deployment.
1025
+ #
1026
+ # You can cancel a deployment only if the provisioningState is Accepted or
1027
+ # Running. After the deployment is canceled, the provisioningState is set to
1028
+ # Canceled. Canceling a template deployment stops the currently running
1029
+ # template deployment and leaves the resource group partially deployed.
1030
+ #
1031
+ # @param resource_group_name [String] The name of the resource group. The name
1032
+ # is case insensitive.
1033
+ # @param deployment_name [String] The name of the deployment to cancel.
1034
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1035
+ # will be added to the HTTP request.
1036
+ #
1037
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1038
+ #
1039
+ def cancel_with_http_info(resource_group_name, deployment_name, custom_headers:nil)
1040
+ cancel_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
1041
+ end
1042
+
1043
+ #
1044
+ # Cancels a currently running template deployment.
1045
+ #
1046
+ # You can cancel a deployment only if the provisioningState is Accepted or
1047
+ # Running. After the deployment is canceled, the provisioningState is set to
1048
+ # Canceled. Canceling a template deployment stops the currently running
1049
+ # template deployment and leaves the resource group partially deployed.
1050
+ #
1051
+ # @param resource_group_name [String] The name of the resource group. The name
1052
+ # is case insensitive.
1053
+ # @param deployment_name [String] The name of the deployment to cancel.
1054
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1055
+ # to the HTTP request.
1056
+ #
1057
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1058
+ #
1059
+ def cancel_async(resource_group_name, deployment_name, custom_headers:nil)
1060
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1061
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1062
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1063
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1064
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
1065
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
1066
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
1067
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1068
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1069
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1070
+
1071
+
1072
+ request_headers = {}
1073
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1074
+
1075
+ # Set Headers
1076
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1077
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1078
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'
1079
+
1080
+ request_url = @base_url || @client.base_url
1081
+
1082
+ options = {
1083
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1084
+ path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
1085
+ query_params: {'api-version' => @client.api_version},
1086
+ headers: request_headers.merge(custom_headers || {}),
1087
+ base_url: request_url
1088
+ }
1089
+ promise = @client.make_request_async(:post, path_template, options)
1090
+
1091
+ promise = promise.then do |result|
1092
+ http_response = result.response
1093
+ status_code = http_response.status
1094
+ response_content = http_response.body
1095
+ unless status_code == 204
1096
+ error_model = JSON.load(response_content)
1097
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1098
+ end
1099
+
1100
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1101
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1102
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1103
+
1104
+ result
1105
+ end
1106
+
1107
+ promise.execute
1108
+ end
1109
+
1110
+ #
1111
+ # Validates whether the specified template is syntactically correct and will be
1112
+ # accepted by Azure Resource Manager..
1113
+ #
1114
+ # @param resource_group_name [String] The name of the resource group the
1115
+ # template will be deployed to. The name is case insensitive.
1116
+ # @param deployment_name [String] The name of the deployment.
1117
+ # @param parameters [Deployment] Parameters to validate.
1118
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1119
+ # will be added to the HTTP request.
1120
+ #
1121
+ # @return [DeploymentValidateResult] operation results.
1122
+ #
1123
+ def validate(resource_group_name, deployment_name, parameters, custom_headers:nil)
1124
+ response = validate_async(resource_group_name, deployment_name, parameters, custom_headers:custom_headers).value!
1125
+ response.body unless response.nil?
1126
+ end
1127
+
1128
+ #
1129
+ # Validates whether the specified template is syntactically correct and will be
1130
+ # accepted by Azure Resource Manager..
1131
+ #
1132
+ # @param resource_group_name [String] The name of the resource group the
1133
+ # template will be deployed to. The name is case insensitive.
1134
+ # @param deployment_name [String] The name of the deployment.
1135
+ # @param parameters [Deployment] Parameters to validate.
1136
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1137
+ # will be added to the HTTP request.
1138
+ #
1139
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1140
+ #
1141
+ def validate_with_http_info(resource_group_name, deployment_name, parameters, custom_headers:nil)
1142
+ validate_async(resource_group_name, deployment_name, parameters, custom_headers:custom_headers).value!
1143
+ end
1144
+
1145
+ #
1146
+ # Validates whether the specified template is syntactically correct and will be
1147
+ # accepted by Azure Resource Manager..
1148
+ #
1149
+ # @param resource_group_name [String] The name of the resource group the
1150
+ # template will be deployed to. The name is case insensitive.
1151
+ # @param deployment_name [String] The name of the deployment.
1152
+ # @param parameters [Deployment] Parameters to validate.
1153
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1154
+ # to the HTTP request.
1155
+ #
1156
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1157
+ #
1158
+ def validate_async(resource_group_name, deployment_name, parameters, custom_headers:nil)
1159
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1160
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1161
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1162
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1163
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
1164
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
1165
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
1166
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1167
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1168
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1169
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1170
+
1171
+
1172
+ request_headers = {}
1173
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1174
+
1175
+ # Set Headers
1176
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1177
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1178
+
1179
+ # Serialize Request
1180
+ request_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::Deployment.mapper()
1181
+ request_content = @client.serialize(request_mapper, parameters)
1182
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1183
+
1184
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/validate'
1185
+
1186
+ request_url = @base_url || @client.base_url
1187
+
1188
+ options = {
1189
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1190
+ path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
1191
+ query_params: {'api-version' => @client.api_version},
1192
+ body: request_content,
1193
+ headers: request_headers.merge(custom_headers || {}),
1194
+ base_url: request_url
1195
+ }
1196
+ promise = @client.make_request_async(:post, path_template, options)
1197
+
1198
+ promise = promise.then do |result|
1199
+ http_response = result.response
1200
+ status_code = http_response.status
1201
+ response_content = http_response.body
1202
+ unless status_code == 200 || status_code == 400
1203
+ error_model = JSON.load(response_content)
1204
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1205
+ end
1206
+
1207
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1208
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1209
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1210
+ # Deserialize Response
1211
+ if status_code == 200
1212
+ begin
1213
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1214
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::DeploymentValidateResult.mapper()
1215
+ result.body = @client.deserialize(result_mapper, parsed_response)
1216
+ rescue Exception => e
1217
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1218
+ end
1219
+ end
1220
+ # Deserialize Response
1221
+ if status_code == 400
1222
+ begin
1223
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1224
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::DeploymentValidateResult.mapper()
1225
+ result.body = @client.deserialize(result_mapper, parsed_response)
1226
+ rescue Exception => e
1227
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1228
+ end
1229
+ end
1230
+
1231
+ result
1232
+ end
1233
+
1234
+ promise.execute
1235
+ end
1236
+
1237
+ #
1238
+ # Exports the template used for specified deployment.
1239
+ #
1240
+ # @param resource_group_name [String] The name of the resource group. The name
1241
+ # is case insensitive.
1242
+ # @param deployment_name [String] The name of the deployment from which to get
1243
+ # the template.
1244
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1245
+ # will be added to the HTTP request.
1246
+ #
1247
+ # @return [DeploymentExportResult] operation results.
1248
+ #
1249
+ def export_template(resource_group_name, deployment_name, custom_headers:nil)
1250
+ response = export_template_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
1251
+ response.body unless response.nil?
1252
+ end
1253
+
1254
+ #
1255
+ # Exports the template used for specified deployment.
1256
+ #
1257
+ # @param resource_group_name [String] The name of the resource group. The name
1258
+ # is case insensitive.
1259
+ # @param deployment_name [String] The name of the deployment from which to get
1260
+ # the template.
1261
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1262
+ # will be added to the HTTP request.
1263
+ #
1264
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1265
+ #
1266
+ def export_template_with_http_info(resource_group_name, deployment_name, custom_headers:nil)
1267
+ export_template_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
1268
+ end
1269
+
1270
+ #
1271
+ # Exports the template used for specified deployment.
1272
+ #
1273
+ # @param resource_group_name [String] The name of the resource group. The name
1274
+ # is case insensitive.
1275
+ # @param deployment_name [String] The name of the deployment from which to get
1276
+ # the template.
1277
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1278
+ # to the HTTP request.
1279
+ #
1280
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1281
+ #
1282
+ def export_template_async(resource_group_name, deployment_name, custom_headers:nil)
1283
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1284
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1285
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1286
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1287
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
1288
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
1289
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
1290
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1291
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1292
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1293
+
1294
+
1295
+ request_headers = {}
1296
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1297
+
1298
+ # Set Headers
1299
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1300
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1301
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate'
1302
+
1303
+ request_url = @base_url || @client.base_url
1304
+
1305
+ options = {
1306
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1307
+ path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
1308
+ query_params: {'api-version' => @client.api_version},
1309
+ headers: request_headers.merge(custom_headers || {}),
1310
+ base_url: request_url
1311
+ }
1312
+ promise = @client.make_request_async(:post, path_template, options)
1313
+
1314
+ promise = promise.then do |result|
1315
+ http_response = result.response
1316
+ status_code = http_response.status
1317
+ response_content = http_response.body
1318
+ unless status_code == 200
1319
+ error_model = JSON.load(response_content)
1320
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1321
+ end
1322
+
1323
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1324
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1325
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1326
+ # Deserialize Response
1327
+ if status_code == 200
1328
+ begin
1329
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1330
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::DeploymentExportResult.mapper()
1331
+ result.body = @client.deserialize(result_mapper, parsed_response)
1332
+ rescue Exception => e
1333
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1334
+ end
1335
+ end
1336
+
1337
+ result
1338
+ end
1339
+
1340
+ promise.execute
1341
+ end
1342
+
1343
+ #
1344
+ # Get all the deployments for a resource group.
1345
+ #
1346
+ # @param resource_group_name [String] The name of the resource group with the
1347
+ # deployments to get. The name is case insensitive.
1348
+ # @param filter [String] The filter to apply on the operation. For example, you
1349
+ # can use $filter=provisioningState eq '{state}'.
1350
+ # @param top [Integer] The number of results to get. If null is passed, returns
1351
+ # all deployments.
1352
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1353
+ # will be added to the HTTP request.
1354
+ #
1355
+ # @return [Array<DeploymentExtended>] operation results.
1356
+ #
1357
+ def list_by_resource_group(resource_group_name, filter:nil, top:nil, custom_headers:nil)
1358
+ first_page = list_by_resource_group_as_lazy(resource_group_name, filter:filter, top:top, custom_headers:custom_headers)
1359
+ first_page.get_all_items
1360
+ end
1361
+
1362
+ #
1363
+ # Get all the deployments for a resource group.
1364
+ #
1365
+ # @param resource_group_name [String] The name of the resource group with the
1366
+ # deployments to get. The name is case insensitive.
1367
+ # @param filter [String] The filter to apply on the operation. For example, you
1368
+ # can use $filter=provisioningState eq '{state}'.
1369
+ # @param top [Integer] The number of results to get. If null is passed, returns
1370
+ # all deployments.
1371
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1372
+ # will be added to the HTTP request.
1373
+ #
1374
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1375
+ #
1376
+ def list_by_resource_group_with_http_info(resource_group_name, filter:nil, top:nil, custom_headers:nil)
1377
+ list_by_resource_group_async(resource_group_name, filter:filter, top:top, custom_headers:custom_headers).value!
1378
+ end
1379
+
1380
+ #
1381
+ # Get all the deployments for a resource group.
1382
+ #
1383
+ # @param resource_group_name [String] The name of the resource group with the
1384
+ # deployments to get. The name is case insensitive.
1385
+ # @param filter [String] The filter to apply on the operation. For example, you
1386
+ # can use $filter=provisioningState eq '{state}'.
1387
+ # @param top [Integer] The number of results to get. If null is passed, returns
1388
+ # all deployments.
1389
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1390
+ # to the HTTP request.
1391
+ #
1392
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1393
+ #
1394
+ def list_by_resource_group_async(resource_group_name, filter:nil, top:nil, custom_headers:nil)
1395
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1396
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1397
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1398
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1399
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1400
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1401
+
1402
+
1403
+ request_headers = {}
1404
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1405
+
1406
+ # Set Headers
1407
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1408
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1409
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/'
1410
+
1411
+ request_url = @base_url || @client.base_url
1412
+
1413
+ options = {
1414
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1415
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
1416
+ query_params: {'$filter' => filter,'$top' => top,'api-version' => @client.api_version},
1417
+ headers: request_headers.merge(custom_headers || {}),
1418
+ base_url: request_url
1419
+ }
1420
+ promise = @client.make_request_async(:get, path_template, options)
1421
+
1422
+ promise = promise.then do |result|
1423
+ http_response = result.response
1424
+ status_code = http_response.status
1425
+ response_content = http_response.body
1426
+ unless status_code == 200
1427
+ error_model = JSON.load(response_content)
1428
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1429
+ end
1430
+
1431
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1432
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1433
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1434
+ # Deserialize Response
1435
+ if status_code == 200
1436
+ begin
1437
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1438
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::DeploymentListResult.mapper()
1439
+ result.body = @client.deserialize(result_mapper, parsed_response)
1440
+ rescue Exception => e
1441
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1442
+ end
1443
+ end
1444
+
1445
+ result
1446
+ end
1447
+
1448
+ promise.execute
1449
+ end
1450
+
1451
+ #
1452
+ # Deletes a deployment from the deployment history.
1453
+ #
1454
+ # A template deployment that is currently running cannot be deleted. Deleting a
1455
+ # template deployment removes the associated deployment operations. This is an
1456
+ # asynchronous operation that returns a status of 202 until the template
1457
+ # deployment is successfully deleted. The Location response header contains the
1458
+ # URI that is used to obtain the status of the process. While the process is
1459
+ # running, a call to the URI in the Location header returns a status of 202.
1460
+ # When the process finishes, the URI in the Location header returns a status of
1461
+ # 204 on success. If the asynchronous request failed, the URI in the Location
1462
+ # header returns an error-level status code.
1463
+ #
1464
+ # @param deployment_name [String] The name of the deployment to delete.
1465
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1466
+ # will be added to the HTTP request.
1467
+ #
1468
+ #
1469
+ def begin_delete_at_subscription_scope(deployment_name, custom_headers:nil)
1470
+ response = begin_delete_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
1471
+ nil
1472
+ end
1473
+
1474
+ #
1475
+ # Deletes a deployment from the deployment history.
1476
+ #
1477
+ # A template deployment that is currently running cannot be deleted. Deleting a
1478
+ # template deployment removes the associated deployment operations. This is an
1479
+ # asynchronous operation that returns a status of 202 until the template
1480
+ # deployment is successfully deleted. The Location response header contains the
1481
+ # URI that is used to obtain the status of the process. While the process is
1482
+ # running, a call to the URI in the Location header returns a status of 202.
1483
+ # When the process finishes, the URI in the Location header returns a status of
1484
+ # 204 on success. If the asynchronous request failed, the URI in the Location
1485
+ # header returns an error-level status code.
1486
+ #
1487
+ # @param deployment_name [String] The name of the deployment to delete.
1488
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1489
+ # will be added to the HTTP request.
1490
+ #
1491
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1492
+ #
1493
+ def begin_delete_at_subscription_scope_with_http_info(deployment_name, custom_headers:nil)
1494
+ begin_delete_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
1495
+ end
1496
+
1497
+ #
1498
+ # Deletes a deployment from the deployment history.
1499
+ #
1500
+ # A template deployment that is currently running cannot be deleted. Deleting a
1501
+ # template deployment removes the associated deployment operations. This is an
1502
+ # asynchronous operation that returns a status of 202 until the template
1503
+ # deployment is successfully deleted. The Location response header contains the
1504
+ # URI that is used to obtain the status of the process. While the process is
1505
+ # running, a call to the URI in the Location header returns a status of 202.
1506
+ # When the process finishes, the URI in the Location header returns a status of
1507
+ # 204 on success. If the asynchronous request failed, the URI in the Location
1508
+ # header returns an error-level status code.
1509
+ #
1510
+ # @param deployment_name [String] The name of the deployment to delete.
1511
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1512
+ # to the HTTP request.
1513
+ #
1514
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1515
+ #
1516
+ def begin_delete_at_subscription_scope_async(deployment_name, custom_headers:nil)
1517
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
1518
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
1519
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
1520
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1521
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1522
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1523
+
1524
+
1525
+ request_headers = {}
1526
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1527
+
1528
+ # Set Headers
1529
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1530
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1531
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}'
1532
+
1533
+ request_url = @base_url || @client.base_url
1534
+
1535
+ options = {
1536
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1537
+ path_params: {'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
1538
+ query_params: {'api-version' => @client.api_version},
1539
+ headers: request_headers.merge(custom_headers || {}),
1540
+ base_url: request_url
1541
+ }
1542
+ promise = @client.make_request_async(:delete, path_template, options)
1543
+
1544
+ promise = promise.then do |result|
1545
+ http_response = result.response
1546
+ status_code = http_response.status
1547
+ response_content = http_response.body
1548
+ unless status_code == 202 || status_code == 204
1549
+ error_model = JSON.load(response_content)
1550
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1551
+ end
1552
+
1553
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1554
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1555
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1556
+
1557
+ result
1558
+ end
1559
+
1560
+ promise.execute
1561
+ end
1562
+
1563
+ #
1564
+ # Deploys resources at subscription scope.
1565
+ #
1566
+ # You can provide the template and parameters directly in the request or link
1567
+ # to JSON files.
1568
+ #
1569
+ # @param deployment_name [String] The name of the deployment.
1570
+ # @param parameters [Deployment] Additional parameters supplied to the
1571
+ # operation.
1572
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1573
+ # will be added to the HTTP request.
1574
+ #
1575
+ # @return [DeploymentExtended] operation results.
1576
+ #
1577
+ def begin_create_or_update_at_subscription_scope(deployment_name, parameters, custom_headers:nil)
1578
+ response = begin_create_or_update_at_subscription_scope_async(deployment_name, parameters, custom_headers:custom_headers).value!
1579
+ response.body unless response.nil?
1580
+ end
1581
+
1582
+ #
1583
+ # Deploys resources at subscription scope.
1584
+ #
1585
+ # You can provide the template and parameters directly in the request or link
1586
+ # to JSON files.
1587
+ #
1588
+ # @param deployment_name [String] The name of the deployment.
1589
+ # @param parameters [Deployment] Additional parameters supplied to the
1590
+ # operation.
1591
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1592
+ # will be added to the HTTP request.
1593
+ #
1594
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1595
+ #
1596
+ def begin_create_or_update_at_subscription_scope_with_http_info(deployment_name, parameters, custom_headers:nil)
1597
+ begin_create_or_update_at_subscription_scope_async(deployment_name, parameters, custom_headers:custom_headers).value!
1598
+ end
1599
+
1600
+ #
1601
+ # Deploys resources at subscription scope.
1602
+ #
1603
+ # You can provide the template and parameters directly in the request or link
1604
+ # to JSON files.
1605
+ #
1606
+ # @param deployment_name [String] The name of the deployment.
1607
+ # @param parameters [Deployment] Additional parameters supplied to the
1608
+ # operation.
1609
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1610
+ # to the HTTP request.
1611
+ #
1612
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1613
+ #
1614
+ def begin_create_or_update_at_subscription_scope_async(deployment_name, parameters, custom_headers:nil)
1615
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
1616
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
1617
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
1618
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1619
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1620
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1621
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1622
+
1623
+
1624
+ request_headers = {}
1625
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1626
+
1627
+ # Set Headers
1628
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1629
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1630
+
1631
+ # Serialize Request
1632
+ request_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::Deployment.mapper()
1633
+ request_content = @client.serialize(request_mapper, parameters)
1634
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1635
+
1636
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}'
1637
+
1638
+ request_url = @base_url || @client.base_url
1639
+
1640
+ options = {
1641
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1642
+ path_params: {'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
1643
+ query_params: {'api-version' => @client.api_version},
1644
+ body: request_content,
1645
+ headers: request_headers.merge(custom_headers || {}),
1646
+ base_url: request_url
1647
+ }
1648
+ promise = @client.make_request_async(:put, path_template, options)
1649
+
1650
+ promise = promise.then do |result|
1651
+ http_response = result.response
1652
+ status_code = http_response.status
1653
+ response_content = http_response.body
1654
+ unless status_code == 200 || status_code == 201
1655
+ error_model = JSON.load(response_content)
1656
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1657
+ end
1658
+
1659
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1660
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1661
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1662
+ # Deserialize Response
1663
+ if status_code == 200
1664
+ begin
1665
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1666
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::DeploymentExtended.mapper()
1667
+ result.body = @client.deserialize(result_mapper, parsed_response)
1668
+ rescue Exception => e
1669
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1670
+ end
1671
+ end
1672
+ # Deserialize Response
1673
+ if status_code == 201
1674
+ begin
1675
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1676
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::DeploymentExtended.mapper()
1677
+ result.body = @client.deserialize(result_mapper, parsed_response)
1678
+ rescue Exception => e
1679
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1680
+ end
1681
+ end
1682
+
1683
+ result
1684
+ end
1685
+
1686
+ promise.execute
1687
+ end
1688
+
1689
+ #
1690
+ # Deletes a deployment from the deployment history.
1691
+ #
1692
+ # A template deployment that is currently running cannot be deleted. Deleting a
1693
+ # template deployment removes the associated deployment operations. Deleting a
1694
+ # template deployment does not affect the state of the resource group. This is
1695
+ # an asynchronous operation that returns a status of 202 until the template
1696
+ # deployment is successfully deleted. The Location response header contains the
1697
+ # URI that is used to obtain the status of the process. While the process is
1698
+ # running, a call to the URI in the Location header returns a status of 202.
1699
+ # When the process finishes, the URI in the Location header returns a status of
1700
+ # 204 on success. If the asynchronous request failed, the URI in the Location
1701
+ # header returns an error-level status code.
1702
+ #
1703
+ # @param resource_group_name [String] The name of the resource group with the
1704
+ # deployment to delete. The name is case insensitive.
1705
+ # @param deployment_name [String] The name of the deployment to delete.
1706
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1707
+ # will be added to the HTTP request.
1708
+ #
1709
+ #
1710
+ def begin_delete(resource_group_name, deployment_name, custom_headers:nil)
1711
+ response = begin_delete_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
1712
+ nil
1713
+ end
1714
+
1715
+ #
1716
+ # Deletes a deployment from the deployment history.
1717
+ #
1718
+ # A template deployment that is currently running cannot be deleted. Deleting a
1719
+ # template deployment removes the associated deployment operations. Deleting a
1720
+ # template deployment does not affect the state of the resource group. This is
1721
+ # an asynchronous operation that returns a status of 202 until the template
1722
+ # deployment is successfully deleted. The Location response header contains the
1723
+ # URI that is used to obtain the status of the process. While the process is
1724
+ # running, a call to the URI in the Location header returns a status of 202.
1725
+ # When the process finishes, the URI in the Location header returns a status of
1726
+ # 204 on success. If the asynchronous request failed, the URI in the Location
1727
+ # header returns an error-level status code.
1728
+ #
1729
+ # @param resource_group_name [String] The name of the resource group with the
1730
+ # deployment to delete. The name is case insensitive.
1731
+ # @param deployment_name [String] The name of the deployment to delete.
1732
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1733
+ # will be added to the HTTP request.
1734
+ #
1735
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1736
+ #
1737
+ def begin_delete_with_http_info(resource_group_name, deployment_name, custom_headers:nil)
1738
+ begin_delete_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
1739
+ end
1740
+
1741
+ #
1742
+ # Deletes a deployment from the deployment history.
1743
+ #
1744
+ # A template deployment that is currently running cannot be deleted. Deleting a
1745
+ # template deployment removes the associated deployment operations. Deleting a
1746
+ # template deployment does not affect the state of the resource group. This is
1747
+ # an asynchronous operation that returns a status of 202 until the template
1748
+ # deployment is successfully deleted. The Location response header contains the
1749
+ # URI that is used to obtain the status of the process. While the process is
1750
+ # running, a call to the URI in the Location header returns a status of 202.
1751
+ # When the process finishes, the URI in the Location header returns a status of
1752
+ # 204 on success. If the asynchronous request failed, the URI in the Location
1753
+ # header returns an error-level status code.
1754
+ #
1755
+ # @param resource_group_name [String] The name of the resource group with the
1756
+ # deployment to delete. The name is case insensitive.
1757
+ # @param deployment_name [String] The name of the deployment to delete.
1758
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1759
+ # to the HTTP request.
1760
+ #
1761
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1762
+ #
1763
+ def begin_delete_async(resource_group_name, deployment_name, custom_headers:nil)
1764
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1765
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1766
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1767
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1768
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
1769
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
1770
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
1771
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1772
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1773
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1774
+
1775
+
1776
+ request_headers = {}
1777
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1778
+
1779
+ # Set Headers
1780
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1781
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1782
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'
1783
+
1784
+ request_url = @base_url || @client.base_url
1785
+
1786
+ options = {
1787
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1788
+ path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
1789
+ query_params: {'api-version' => @client.api_version},
1790
+ headers: request_headers.merge(custom_headers || {}),
1791
+ base_url: request_url
1792
+ }
1793
+ promise = @client.make_request_async(:delete, path_template, options)
1794
+
1795
+ promise = promise.then do |result|
1796
+ http_response = result.response
1797
+ status_code = http_response.status
1798
+ response_content = http_response.body
1799
+ unless status_code == 202 || status_code == 204
1800
+ error_model = JSON.load(response_content)
1801
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1802
+ end
1803
+
1804
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1805
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1806
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1807
+
1808
+ result
1809
+ end
1810
+
1811
+ promise.execute
1812
+ end
1813
+
1814
+ #
1815
+ # Deploys resources to a resource group.
1816
+ #
1817
+ # You can provide the template and parameters directly in the request or link
1818
+ # to JSON files.
1819
+ #
1820
+ # @param resource_group_name [String] The name of the resource group to deploy
1821
+ # the resources to. The name is case insensitive. The resource group must
1822
+ # already exist.
1823
+ # @param deployment_name [String] The name of the deployment.
1824
+ # @param parameters [Deployment] Additional parameters supplied to the
1825
+ # operation.
1826
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1827
+ # will be added to the HTTP request.
1828
+ #
1829
+ # @return [DeploymentExtended] operation results.
1830
+ #
1831
+ def begin_create_or_update(resource_group_name, deployment_name, parameters, custom_headers:nil)
1832
+ response = begin_create_or_update_async(resource_group_name, deployment_name, parameters, custom_headers:custom_headers).value!
1833
+ response.body unless response.nil?
1834
+ end
1835
+
1836
+ #
1837
+ # Deploys resources to a resource group.
1838
+ #
1839
+ # You can provide the template and parameters directly in the request or link
1840
+ # to JSON files.
1841
+ #
1842
+ # @param resource_group_name [String] The name of the resource group to deploy
1843
+ # the resources to. The name is case insensitive. The resource group must
1844
+ # already exist.
1845
+ # @param deployment_name [String] The name of the deployment.
1846
+ # @param parameters [Deployment] Additional parameters supplied to the
1847
+ # operation.
1848
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1849
+ # will be added to the HTTP request.
1850
+ #
1851
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1852
+ #
1853
+ def begin_create_or_update_with_http_info(resource_group_name, deployment_name, parameters, custom_headers:nil)
1854
+ begin_create_or_update_async(resource_group_name, deployment_name, parameters, custom_headers:custom_headers).value!
1855
+ end
1856
+
1857
+ #
1858
+ # Deploys resources to a resource group.
1859
+ #
1860
+ # You can provide the template and parameters directly in the request or link
1861
+ # to JSON files.
1862
+ #
1863
+ # @param resource_group_name [String] The name of the resource group to deploy
1864
+ # the resources to. The name is case insensitive. The resource group must
1865
+ # already exist.
1866
+ # @param deployment_name [String] The name of the deployment.
1867
+ # @param parameters [Deployment] Additional parameters supplied to the
1868
+ # operation.
1869
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1870
+ # to the HTTP request.
1871
+ #
1872
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1873
+ #
1874
+ def begin_create_or_update_async(resource_group_name, deployment_name, parameters, custom_headers:nil)
1875
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1876
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1877
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1878
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1879
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
1880
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
1881
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
1882
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1883
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1884
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1885
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1886
+
1887
+
1888
+ request_headers = {}
1889
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1890
+
1891
+ # Set Headers
1892
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1893
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1894
+
1895
+ # Serialize Request
1896
+ request_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::Deployment.mapper()
1897
+ request_content = @client.serialize(request_mapper, parameters)
1898
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1899
+
1900
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'
1901
+
1902
+ request_url = @base_url || @client.base_url
1903
+
1904
+ options = {
1905
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1906
+ path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
1907
+ query_params: {'api-version' => @client.api_version},
1908
+ body: request_content,
1909
+ headers: request_headers.merge(custom_headers || {}),
1910
+ base_url: request_url
1911
+ }
1912
+ promise = @client.make_request_async(:put, path_template, options)
1913
+
1914
+ promise = promise.then do |result|
1915
+ http_response = result.response
1916
+ status_code = http_response.status
1917
+ response_content = http_response.body
1918
+ unless status_code == 200 || status_code == 201
1919
+ error_model = JSON.load(response_content)
1920
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1921
+ end
1922
+
1923
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1924
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1925
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1926
+ # Deserialize Response
1927
+ if status_code == 200
1928
+ begin
1929
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1930
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::DeploymentExtended.mapper()
1931
+ result.body = @client.deserialize(result_mapper, parsed_response)
1932
+ rescue Exception => e
1933
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1934
+ end
1935
+ end
1936
+ # Deserialize Response
1937
+ if status_code == 201
1938
+ begin
1939
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1940
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::DeploymentExtended.mapper()
1941
+ result.body = @client.deserialize(result_mapper, parsed_response)
1942
+ rescue Exception => e
1943
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1944
+ end
1945
+ end
1946
+
1947
+ result
1948
+ end
1949
+
1950
+ promise.execute
1951
+ end
1952
+
1953
+ #
1954
+ # Get all the deployments for a subscription.
1955
+ #
1956
+ # @param next_page_link [String] The NextLink from the previous successful call
1957
+ # to List operation.
1958
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1959
+ # will be added to the HTTP request.
1960
+ #
1961
+ # @return [DeploymentListResult] operation results.
1962
+ #
1963
+ def list_at_subscription_scope_next(next_page_link, custom_headers:nil)
1964
+ response = list_at_subscription_scope_next_async(next_page_link, custom_headers:custom_headers).value!
1965
+ response.body unless response.nil?
1966
+ end
1967
+
1968
+ #
1969
+ # Get all the deployments for a subscription.
1970
+ #
1971
+ # @param next_page_link [String] The NextLink from the previous successful call
1972
+ # to List operation.
1973
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1974
+ # will be added to the HTTP request.
1975
+ #
1976
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1977
+ #
1978
+ def list_at_subscription_scope_next_with_http_info(next_page_link, custom_headers:nil)
1979
+ list_at_subscription_scope_next_async(next_page_link, custom_headers:custom_headers).value!
1980
+ end
1981
+
1982
+ #
1983
+ # Get all the deployments for a subscription.
1984
+ #
1985
+ # @param next_page_link [String] The NextLink from the previous successful call
1986
+ # to List operation.
1987
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1988
+ # to the HTTP request.
1989
+ #
1990
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1991
+ #
1992
+ def list_at_subscription_scope_next_async(next_page_link, custom_headers:nil)
1993
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1994
+
1995
+
1996
+ request_headers = {}
1997
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1998
+
1999
+ # Set Headers
2000
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2001
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2002
+ path_template = '{nextLink}'
2003
+
2004
+ request_url = @base_url || @client.base_url
2005
+
2006
+ options = {
2007
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2008
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2009
+ headers: request_headers.merge(custom_headers || {}),
2010
+ base_url: request_url
2011
+ }
2012
+ promise = @client.make_request_async(:get, path_template, options)
2013
+
2014
+ promise = promise.then do |result|
2015
+ http_response = result.response
2016
+ status_code = http_response.status
2017
+ response_content = http_response.body
2018
+ unless status_code == 200
2019
+ error_model = JSON.load(response_content)
2020
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2021
+ end
2022
+
2023
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2024
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2025
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2026
+ # Deserialize Response
2027
+ if status_code == 200
2028
+ begin
2029
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2030
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::DeploymentListResult.mapper()
2031
+ result.body = @client.deserialize(result_mapper, parsed_response)
2032
+ rescue Exception => e
2033
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2034
+ end
2035
+ end
2036
+
2037
+ result
2038
+ end
2039
+
2040
+ promise.execute
2041
+ end
2042
+
2043
+ #
2044
+ # Get all the deployments for a resource group.
2045
+ #
2046
+ # @param next_page_link [String] The NextLink from the previous successful call
2047
+ # to List operation.
2048
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2049
+ # will be added to the HTTP request.
2050
+ #
2051
+ # @return [DeploymentListResult] operation results.
2052
+ #
2053
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
2054
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
2055
+ response.body unless response.nil?
2056
+ end
2057
+
2058
+ #
2059
+ # Get all the deployments for a resource group.
2060
+ #
2061
+ # @param next_page_link [String] The NextLink from the previous successful call
2062
+ # to List operation.
2063
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2064
+ # will be added to the HTTP request.
2065
+ #
2066
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2067
+ #
2068
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
2069
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
2070
+ end
2071
+
2072
+ #
2073
+ # Get all the deployments for a resource group.
2074
+ #
2075
+ # @param next_page_link [String] The NextLink from the previous successful call
2076
+ # to List operation.
2077
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2078
+ # to the HTTP request.
2079
+ #
2080
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2081
+ #
2082
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
2083
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2084
+
2085
+
2086
+ request_headers = {}
2087
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2088
+
2089
+ # Set Headers
2090
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2091
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2092
+ path_template = '{nextLink}'
2093
+
2094
+ request_url = @base_url || @client.base_url
2095
+
2096
+ options = {
2097
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2098
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2099
+ headers: request_headers.merge(custom_headers || {}),
2100
+ base_url: request_url
2101
+ }
2102
+ promise = @client.make_request_async(:get, path_template, options)
2103
+
2104
+ promise = promise.then do |result|
2105
+ http_response = result.response
2106
+ status_code = http_response.status
2107
+ response_content = http_response.body
2108
+ unless status_code == 200
2109
+ error_model = JSON.load(response_content)
2110
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2111
+ end
2112
+
2113
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2114
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2115
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2116
+ # Deserialize Response
2117
+ if status_code == 200
2118
+ begin
2119
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2120
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::DeploymentListResult.mapper()
2121
+ result.body = @client.deserialize(result_mapper, parsed_response)
2122
+ rescue Exception => e
2123
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2124
+ end
2125
+ end
2126
+
2127
+ result
2128
+ end
2129
+
2130
+ promise.execute
2131
+ end
2132
+
2133
+ #
2134
+ # Get all the deployments for a subscription.
2135
+ #
2136
+ # @param filter [String] The filter to apply on the operation. For example, you
2137
+ # can use $filter=provisioningState eq '{state}'.
2138
+ # @param top [Integer] The number of results to get. If null is passed, returns
2139
+ # all deployments.
2140
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2141
+ # will be added to the HTTP request.
2142
+ #
2143
+ # @return [DeploymentListResult] which provide lazy access to pages of the
2144
+ # response.
2145
+ #
2146
+ def list_at_subscription_scope_as_lazy(filter:nil, top:nil, custom_headers:nil)
2147
+ response = list_at_subscription_scope_async(filter:filter, top:top, custom_headers:custom_headers).value!
2148
+ unless response.nil?
2149
+ page = response.body
2150
+ page.next_method = Proc.new do |next_page_link|
2151
+ list_at_subscription_scope_next_async(next_page_link, custom_headers:custom_headers)
2152
+ end
2153
+ page
2154
+ end
2155
+ end
2156
+
2157
+ #
2158
+ # Get all the deployments for a resource group.
2159
+ #
2160
+ # @param resource_group_name [String] The name of the resource group with the
2161
+ # deployments to get. The name is case insensitive.
2162
+ # @param filter [String] The filter to apply on the operation. For example, you
2163
+ # can use $filter=provisioningState eq '{state}'.
2164
+ # @param top [Integer] The number of results to get. If null is passed, returns
2165
+ # all deployments.
2166
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2167
+ # will be added to the HTTP request.
2168
+ #
2169
+ # @return [DeploymentListResult] which provide lazy access to pages of the
2170
+ # response.
2171
+ #
2172
+ def list_by_resource_group_as_lazy(resource_group_name, filter:nil, top:nil, custom_headers:nil)
2173
+ response = list_by_resource_group_async(resource_group_name, filter:filter, top:top, custom_headers:custom_headers).value!
2174
+ unless response.nil?
2175
+ page = response.body
2176
+ page.next_method = Proc.new do |next_page_link|
2177
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
2178
+ end
2179
+ page
2180
+ end
2181
+ end
2182
+
2183
+ end
2184
+ end