azure_mgmt_resources 0.17.5 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (478) hide show
  1. checksums.yaml +5 -5
  2. data/lib/2016-02-01/generated/azure_mgmt_resources.rb +13 -10
  3. data/lib/2016-02-01/generated/azure_mgmt_resources/deployments.rb +102 -0
  4. data/lib/2016-02-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +1 -1
  5. data/lib/2016-02-01/generated/azure_mgmt_resources/models/error_additional_info.rb +59 -0
  6. data/lib/2016-02-01/generated/azure_mgmt_resources/models/error_response.rb +113 -0
  7. data/lib/2016-02-01/generated/azure_mgmt_resources/models/export_template_request.rb +6 -6
  8. data/lib/2016-02-01/generated/azure_mgmt_resources/models/parameters_link.rb +1 -1
  9. data/lib/2016-02-01/generated/azure_mgmt_resources/models/template_hash_result.rb +58 -0
  10. data/lib/2016-02-01/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  11. data/lib/2016-06-01/generated/azure_mgmt_resources.rb +42 -0
  12. data/lib/2016-06-01/generated/azure_mgmt_resources/models/location.rb +108 -0
  13. data/lib/2016-06-01/generated/azure_mgmt_resources/models/location_list_result.rb +55 -0
  14. data/lib/2016-06-01/generated/azure_mgmt_resources/models/operation.rb +58 -0
  15. data/lib/2016-06-01/generated/azure_mgmt_resources/models/operation_display.rb +80 -0
  16. data/lib/2016-06-01/generated/azure_mgmt_resources/models/operation_list_result.rb +100 -0
  17. data/lib/2016-06-01/generated/azure_mgmt_resources/models/spending_limit.rb +17 -0
  18. data/lib/2016-06-01/generated/azure_mgmt_resources/models/subscription.rb +112 -0
  19. data/lib/2016-06-01/generated/azure_mgmt_resources/models/subscription_list_result.rb +98 -0
  20. data/lib/2016-06-01/generated/azure_mgmt_resources/models/subscription_policies.rb +76 -0
  21. data/lib/2016-06-01/generated/azure_mgmt_resources/models/subscription_state.rb +19 -0
  22. data/lib/2016-06-01/generated/azure_mgmt_resources/models/tenant_id_description.rb +61 -0
  23. data/lib/2016-06-01/generated/azure_mgmt_resources/models/tenant_list_result.rb +98 -0
  24. data/lib/2016-06-01/generated/azure_mgmt_resources/module_definition.rb +9 -0
  25. data/lib/2016-06-01/generated/azure_mgmt_resources/operations.rb +222 -0
  26. data/lib/2016-06-01/generated/azure_mgmt_resources/subscription_client.rb +136 -0
  27. data/lib/2016-06-01/generated/azure_mgmt_resources/subscriptions.rb +409 -0
  28. data/lib/2016-06-01/generated/azure_mgmt_resources/tenants.rb +222 -0
  29. data/lib/2016-07-01/generated/azure_mgmt_resources.rb +13 -10
  30. data/lib/2016-07-01/generated/azure_mgmt_resources/deployments.rb +102 -0
  31. data/lib/2016-07-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +1 -1
  32. data/lib/2016-07-01/generated/azure_mgmt_resources/models/error_additional_info.rb +59 -0
  33. data/lib/2016-07-01/generated/azure_mgmt_resources/models/error_response.rb +113 -0
  34. data/lib/2016-07-01/generated/azure_mgmt_resources/models/export_template_request.rb +6 -6
  35. data/lib/2016-07-01/generated/azure_mgmt_resources/models/parameters_link.rb +1 -1
  36. data/lib/2016-07-01/generated/azure_mgmt_resources/models/template_hash_result.rb +58 -0
  37. data/lib/2016-07-01/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  38. data/lib/2016-09-01/generated/azure_mgmt_resources.rb +13 -10
  39. data/lib/2016-09-01/generated/azure_mgmt_resources/deployments.rb +102 -0
  40. data/lib/2016-09-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +1 -1
  41. data/lib/2016-09-01/generated/azure_mgmt_resources/models/error_additional_info.rb +59 -0
  42. data/lib/2016-09-01/generated/azure_mgmt_resources/models/error_response.rb +113 -0
  43. data/lib/2016-09-01/generated/azure_mgmt_resources/models/export_template_request.rb +6 -6
  44. data/lib/2016-09-01/generated/azure_mgmt_resources/models/parameters_link.rb +1 -1
  45. data/lib/2016-09-01/generated/azure_mgmt_resources/models/resource_group.rb +1 -1
  46. data/lib/2016-09-01/generated/azure_mgmt_resources/models/template_hash_result.rb +58 -0
  47. data/lib/2016-09-01/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  48. data/lib/2016-09-01/generated/azure_mgmt_resources/resources.rb +5 -5
  49. data/lib/2017-05-10/generated/azure_mgmt_resources.rb +12 -9
  50. data/lib/2017-05-10/generated/azure_mgmt_resources/deployments.rb +102 -0
  51. data/lib/2017-05-10/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +1 -1
  52. data/lib/2017-05-10/generated/azure_mgmt_resources/models/error_additional_info.rb +59 -0
  53. data/lib/2017-05-10/generated/azure_mgmt_resources/models/error_response.rb +113 -0
  54. data/lib/2017-05-10/generated/azure_mgmt_resources/models/export_template_request.rb +6 -6
  55. data/lib/2017-05-10/generated/azure_mgmt_resources/models/parameters_link.rb +1 -1
  56. data/lib/2017-05-10/generated/azure_mgmt_resources/models/template_hash_result.rb +58 -0
  57. data/lib/2017-05-10/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  58. data/lib/2018-02-01/generated/azure_mgmt_resources.rb +13 -10
  59. data/lib/2018-02-01/generated/azure_mgmt_resources/deployments.rb +102 -0
  60. data/lib/2018-02-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +1 -1
  61. data/lib/2018-02-01/generated/azure_mgmt_resources/models/error_additional_info.rb +59 -0
  62. data/lib/2018-02-01/generated/azure_mgmt_resources/models/error_response.rb +113 -0
  63. data/lib/2018-02-01/generated/azure_mgmt_resources/models/export_template_request.rb +6 -6
  64. data/lib/2018-02-01/generated/azure_mgmt_resources/models/parameters_link.rb +1 -1
  65. data/lib/2018-02-01/generated/azure_mgmt_resources/models/template_hash_result.rb +58 -0
  66. data/lib/2018-02-01/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  67. data/lib/2018-05-01/generated/azure_mgmt_resources.rb +13 -10
  68. data/lib/2018-05-01/generated/azure_mgmt_resources/deployments.rb +102 -0
  69. data/lib/2018-05-01/generated/azure_mgmt_resources/models/deployment_extended.rb +12 -0
  70. data/lib/2018-05-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +1 -1
  71. data/lib/2018-05-01/generated/azure_mgmt_resources/models/error_additional_info.rb +59 -0
  72. data/lib/2018-05-01/generated/azure_mgmt_resources/models/error_response.rb +113 -0
  73. data/lib/2018-05-01/generated/azure_mgmt_resources/models/export_template_request.rb +6 -6
  74. data/lib/2018-05-01/generated/azure_mgmt_resources/models/parameters_link.rb +1 -1
  75. data/lib/2018-05-01/generated/azure_mgmt_resources/models/resource_group.rb +12 -0
  76. data/lib/2018-05-01/generated/azure_mgmt_resources/models/template_hash_result.rb +58 -0
  77. data/lib/2018-05-01/generated/azure_mgmt_resources/resource_groups.rb +18 -7
  78. data/lib/2018-05-01/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  79. data/lib/2018-05-01/generated/azure_mgmt_resources/resources.rb +144 -16
  80. data/lib/2018-06-01/generated/azure_mgmt_resources.rb +47 -0
  81. data/lib/2018-06-01/generated/azure_mgmt_resources/application_client.rb +135 -0
  82. data/lib/2018-06-01/generated/azure_mgmt_resources/application_definitions.rb +1052 -0
  83. data/lib/2018-06-01/generated/azure_mgmt_resources/applications.rb +1467 -0
  84. data/lib/2018-06-01/generated/azure_mgmt_resources/models/application.rb +202 -0
  85. data/lib/2018-06-01/generated/azure_mgmt_resources/models/application_artifact.rb +70 -0
  86. data/lib/2018-06-01/generated/azure_mgmt_resources/models/application_artifact_type.rb +16 -0
  87. data/lib/2018-06-01/generated/azure_mgmt_resources/models/application_definition.rb +240 -0
  88. data/lib/2018-06-01/generated/azure_mgmt_resources/models/application_definition_list_result.rb +99 -0
  89. data/lib/2018-06-01/generated/azure_mgmt_resources/models/application_list_result.rb +98 -0
  90. data/lib/2018-06-01/generated/azure_mgmt_resources/models/application_lock_level.rb +17 -0
  91. data/lib/2018-06-01/generated/azure_mgmt_resources/models/application_patchable.rb +202 -0
  92. data/lib/2018-06-01/generated/azure_mgmt_resources/models/application_provider_authorization.rb +62 -0
  93. data/lib/2018-06-01/generated/azure_mgmt_resources/models/error_response.rb +69 -0
  94. data/lib/2018-06-01/generated/azure_mgmt_resources/models/generic_resource.rb +121 -0
  95. data/lib/2018-06-01/generated/azure_mgmt_resources/models/identity.rb +72 -0
  96. data/lib/2018-06-01/generated/azure_mgmt_resources/models/plan.rb +90 -0
  97. data/lib/2018-06-01/generated/azure_mgmt_resources/models/plan_patchable.rb +90 -0
  98. data/lib/2018-06-01/generated/azure_mgmt_resources/models/provisioning_state.rb +25 -0
  99. data/lib/2018-06-01/generated/azure_mgmt_resources/models/resource.rb +110 -0
  100. data/lib/2018-06-01/generated/azure_mgmt_resources/models/resource_identity_type.rb +15 -0
  101. data/lib/2018-06-01/generated/azure_mgmt_resources/models/sku.rb +101 -0
  102. data/lib/2018-06-01/generated/azure_mgmt_resources/module_definition.rb +9 -0
  103. data/lib/2019-03-01/generated/azure_mgmt_resources.rb +91 -0
  104. data/lib/2019-03-01/generated/azure_mgmt_resources/deployment_operations.rb +665 -0
  105. data/lib/2019-03-01/generated/azure_mgmt_resources/deployments.rb +2286 -0
  106. data/lib/2019-03-01/generated/azure_mgmt_resources/models/alias_path_type.rb +65 -0
  107. data/lib/2019-03-01/generated/azure_mgmt_resources/models/alias_type.rb +66 -0
  108. data/lib/2019-03-01/generated/azure_mgmt_resources/models/basic_dependency.rb +68 -0
  109. data/lib/2019-03-01/generated/azure_mgmt_resources/models/debug_setting.rb +54 -0
  110. data/lib/2019-03-01/generated/azure_mgmt_resources/models/dependency.rb +88 -0
  111. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment.rb +58 -0
  112. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_export_result.rb +46 -0
  113. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_extended.rb +94 -0
  114. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_extended_filter.rb +46 -0
  115. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_list_result.rb +99 -0
  116. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_mode.rb +16 -0
  117. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_operation.rb +71 -0
  118. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_operation_properties.rb +134 -0
  119. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_operations_list_result.rb +99 -0
  120. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_properties.rb +136 -0
  121. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +210 -0
  122. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_validate_result.rb +60 -0
  123. data/lib/2019-03-01/generated/azure_mgmt_resources/models/error_additional_info.rb +59 -0
  124. data/lib/2019-03-01/generated/azure_mgmt_resources/models/error_response.rb +113 -0
  125. data/lib/2019-03-01/generated/azure_mgmt_resources/models/export_template_request.rb +69 -0
  126. data/lib/2019-03-01/generated/azure_mgmt_resources/models/generic_resource.rb +158 -0
  127. data/lib/2019-03-01/generated/azure_mgmt_resources/models/generic_resource_filter.rb +68 -0
  128. data/lib/2019-03-01/generated/azure_mgmt_resources/models/http_message.rb +46 -0
  129. data/lib/2019-03-01/generated/azure_mgmt_resources/models/identity.rb +96 -0
  130. data/lib/2019-03-01/generated/azure_mgmt_resources/models/identity_user_assigned_identities_value.rb +60 -0
  131. data/lib/2019-03-01/generated/azure_mgmt_resources/models/on_error_deployment.rb +60 -0
  132. data/lib/2019-03-01/generated/azure_mgmt_resources/models/on_error_deployment_extended.rb +73 -0
  133. data/lib/2019-03-01/generated/azure_mgmt_resources/models/on_error_deployment_type.rb +16 -0
  134. data/lib/2019-03-01/generated/azure_mgmt_resources/models/operation.rb +58 -0
  135. data/lib/2019-03-01/generated/azure_mgmt_resources/models/operation_display.rb +80 -0
  136. data/lib/2019-03-01/generated/azure_mgmt_resources/models/operation_list_result.rb +100 -0
  137. data/lib/2019-03-01/generated/azure_mgmt_resources/models/parameters_link.rb +58 -0
  138. data/lib/2019-03-01/generated/azure_mgmt_resources/models/plan.rb +90 -0
  139. data/lib/2019-03-01/generated/azure_mgmt_resources/models/provider.rb +104 -0
  140. data/lib/2019-03-01/generated/azure_mgmt_resources/models/provider_list_result.rb +99 -0
  141. data/lib/2019-03-01/generated/azure_mgmt_resources/models/provider_resource_type.rb +137 -0
  142. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource.rb +110 -0
  143. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource_group.rb +128 -0
  144. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource_group_export_result.rb +58 -0
  145. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource_group_filter.rb +57 -0
  146. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource_group_list_result.rb +99 -0
  147. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource_group_patchable.rb +90 -0
  148. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource_group_properties.rb +47 -0
  149. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource_identity_type.rb +18 -0
  150. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource_list_result.rb +99 -0
  151. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource_management_error_with_details.rb +92 -0
  152. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource_provider_operation_display_properties.rb +91 -0
  153. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resources_move_info.rb +65 -0
  154. data/lib/2019-03-01/generated/azure_mgmt_resources/models/sku.rb +101 -0
  155. data/lib/2019-03-01/generated/azure_mgmt_resources/models/sub_resource.rb +46 -0
  156. data/lib/2019-03-01/generated/azure_mgmt_resources/models/tag_count.rb +57 -0
  157. data/lib/2019-03-01/generated/azure_mgmt_resources/models/tag_details.rb +92 -0
  158. data/lib/2019-03-01/generated/azure_mgmt_resources/models/tag_value.rb +70 -0
  159. data/lib/2019-03-01/generated/azure_mgmt_resources/models/tags_list_result.rb +99 -0
  160. data/lib/2019-03-01/generated/azure_mgmt_resources/models/target_resource.rb +68 -0
  161. data/lib/2019-03-01/generated/azure_mgmt_resources/models/template_hash_result.rb +58 -0
  162. data/lib/2019-03-01/generated/azure_mgmt_resources/models/template_link.rb +58 -0
  163. data/lib/2019-03-01/generated/azure_mgmt_resources/module_definition.rb +9 -0
  164. data/lib/2019-03-01/generated/azure_mgmt_resources/operations.rb +219 -0
  165. data/lib/2019-03-01/generated/azure_mgmt_resources/providers.rb +530 -0
  166. data/lib/2019-03-01/generated/azure_mgmt_resources/resource_groups.rb +918 -0
  167. data/lib/2019-03-01/generated/azure_mgmt_resources/resource_management_client.rb +155 -0
  168. data/lib/2019-03-01/generated/azure_mgmt_resources/resources.rb +2338 -0
  169. data/lib/2019-03-01/generated/azure_mgmt_resources/tags.rb +611 -0
  170. data/lib/2019-05-01/generated/azure_mgmt_resources.rb +91 -0
  171. data/lib/2019-05-01/generated/azure_mgmt_resources/deployment_operations.rb +973 -0
  172. data/lib/2019-05-01/generated/azure_mgmt_resources/deployments.rb +3352 -0
  173. data/lib/2019-05-01/generated/azure_mgmt_resources/models/alias_path_type.rb +65 -0
  174. data/lib/2019-05-01/generated/azure_mgmt_resources/models/alias_type.rb +66 -0
  175. data/lib/2019-05-01/generated/azure_mgmt_resources/models/basic_dependency.rb +68 -0
  176. data/lib/2019-05-01/generated/azure_mgmt_resources/models/debug_setting.rb +53 -0
  177. data/lib/2019-05-01/generated/azure_mgmt_resources/models/dependency.rb +88 -0
  178. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment.rb +58 -0
  179. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_export_result.rb +46 -0
  180. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_extended.rb +94 -0
  181. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_extended_filter.rb +46 -0
  182. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_list_result.rb +99 -0
  183. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_mode.rb +16 -0
  184. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_operation.rb +71 -0
  185. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_operation_properties.rb +146 -0
  186. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_operations_list_result.rb +99 -0
  187. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_properties.rb +136 -0
  188. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +222 -0
  189. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_validate_result.rb +60 -0
  190. data/lib/2019-05-01/generated/azure_mgmt_resources/models/error_additional_info.rb +59 -0
  191. data/lib/2019-05-01/generated/azure_mgmt_resources/models/error_response.rb +113 -0
  192. data/lib/2019-05-01/generated/azure_mgmt_resources/models/export_template_request.rb +69 -0
  193. data/lib/2019-05-01/generated/azure_mgmt_resources/models/generic_resource.rb +158 -0
  194. data/lib/2019-05-01/generated/azure_mgmt_resources/models/generic_resource_filter.rb +68 -0
  195. data/lib/2019-05-01/generated/azure_mgmt_resources/models/http_message.rb +46 -0
  196. data/lib/2019-05-01/generated/azure_mgmt_resources/models/identity.rb +96 -0
  197. data/lib/2019-05-01/generated/azure_mgmt_resources/models/identity_user_assigned_identities_value.rb +60 -0
  198. data/lib/2019-05-01/generated/azure_mgmt_resources/models/on_error_deployment.rb +60 -0
  199. data/lib/2019-05-01/generated/azure_mgmt_resources/models/on_error_deployment_extended.rb +73 -0
  200. data/lib/2019-05-01/generated/azure_mgmt_resources/models/on_error_deployment_type.rb +16 -0
  201. data/lib/2019-05-01/generated/azure_mgmt_resources/models/operation.rb +58 -0
  202. data/lib/2019-05-01/generated/azure_mgmt_resources/models/operation_display.rb +80 -0
  203. data/lib/2019-05-01/generated/azure_mgmt_resources/models/operation_list_result.rb +100 -0
  204. data/lib/2019-05-01/generated/azure_mgmt_resources/models/parameters_link.rb +58 -0
  205. data/lib/2019-05-01/generated/azure_mgmt_resources/models/plan.rb +90 -0
  206. data/lib/2019-05-01/generated/azure_mgmt_resources/models/provider.rb +104 -0
  207. data/lib/2019-05-01/generated/azure_mgmt_resources/models/provider_list_result.rb +99 -0
  208. data/lib/2019-05-01/generated/azure_mgmt_resources/models/provider_resource_type.rb +137 -0
  209. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource.rb +110 -0
  210. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource_group.rb +128 -0
  211. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource_group_export_result.rb +58 -0
  212. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource_group_filter.rb +57 -0
  213. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource_group_list_result.rb +99 -0
  214. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource_group_patchable.rb +90 -0
  215. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource_group_properties.rb +47 -0
  216. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource_identity_type.rb +18 -0
  217. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource_list_result.rb +99 -0
  218. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource_management_error_with_details.rb +92 -0
  219. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource_provider_operation_display_properties.rb +91 -0
  220. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resources_move_info.rb +65 -0
  221. data/lib/2019-05-01/generated/azure_mgmt_resources/models/sku.rb +101 -0
  222. data/lib/2019-05-01/generated/azure_mgmt_resources/models/sub_resource.rb +46 -0
  223. data/lib/2019-05-01/generated/azure_mgmt_resources/models/tag_count.rb +57 -0
  224. data/lib/2019-05-01/generated/azure_mgmt_resources/models/tag_details.rb +92 -0
  225. data/lib/2019-05-01/generated/azure_mgmt_resources/models/tag_value.rb +70 -0
  226. data/lib/2019-05-01/generated/azure_mgmt_resources/models/tags_list_result.rb +99 -0
  227. data/lib/2019-05-01/generated/azure_mgmt_resources/models/target_resource.rb +68 -0
  228. data/lib/2019-05-01/generated/azure_mgmt_resources/models/template_hash_result.rb +58 -0
  229. data/lib/2019-05-01/generated/azure_mgmt_resources/models/template_link.rb +58 -0
  230. data/lib/2019-05-01/generated/azure_mgmt_resources/module_definition.rb +9 -0
  231. data/lib/2019-05-01/generated/azure_mgmt_resources/operations.rb +219 -0
  232. data/lib/2019-05-01/generated/azure_mgmt_resources/providers.rb +530 -0
  233. data/lib/2019-05-01/generated/azure_mgmt_resources/resource_groups.rb +918 -0
  234. data/lib/2019-05-01/generated/azure_mgmt_resources/resource_management_client.rb +155 -0
  235. data/lib/2019-05-01/generated/azure_mgmt_resources/resources.rb +2338 -0
  236. data/lib/2019-05-01/generated/azure_mgmt_resources/tags.rb +611 -0
  237. data/lib/2019-05-10/generated/azure_mgmt_resources.rb +91 -0
  238. data/lib/2019-05-10/generated/azure_mgmt_resources/deployment_operations.rb +973 -0
  239. data/lib/2019-05-10/generated/azure_mgmt_resources/deployments.rb +3352 -0
  240. data/lib/2019-05-10/generated/azure_mgmt_resources/models/alias_path_type.rb +65 -0
  241. data/lib/2019-05-10/generated/azure_mgmt_resources/models/alias_type.rb +66 -0
  242. data/lib/2019-05-10/generated/azure_mgmt_resources/models/basic_dependency.rb +68 -0
  243. data/lib/2019-05-10/generated/azure_mgmt_resources/models/debug_setting.rb +53 -0
  244. data/lib/2019-05-10/generated/azure_mgmt_resources/models/dependency.rb +88 -0
  245. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment.rb +58 -0
  246. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_export_result.rb +46 -0
  247. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_extended.rb +94 -0
  248. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_extended_filter.rb +46 -0
  249. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_list_result.rb +99 -0
  250. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_mode.rb +16 -0
  251. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_operation.rb +71 -0
  252. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_operation_properties.rb +146 -0
  253. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_operations_list_result.rb +99 -0
  254. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_properties.rb +136 -0
  255. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +222 -0
  256. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_validate_result.rb +60 -0
  257. data/lib/2019-05-10/generated/azure_mgmt_resources/models/error_additional_info.rb +59 -0
  258. data/lib/2019-05-10/generated/azure_mgmt_resources/models/error_response.rb +113 -0
  259. data/lib/2019-05-10/generated/azure_mgmt_resources/models/export_template_request.rb +69 -0
  260. data/lib/2019-05-10/generated/azure_mgmt_resources/models/generic_resource.rb +158 -0
  261. data/lib/2019-05-10/generated/azure_mgmt_resources/models/generic_resource_filter.rb +68 -0
  262. data/lib/2019-05-10/generated/azure_mgmt_resources/models/http_message.rb +46 -0
  263. data/lib/2019-05-10/generated/azure_mgmt_resources/models/identity.rb +96 -0
  264. data/lib/2019-05-10/generated/azure_mgmt_resources/models/identity_user_assigned_identities_value.rb +60 -0
  265. data/lib/2019-05-10/generated/azure_mgmt_resources/models/on_error_deployment.rb +60 -0
  266. data/lib/2019-05-10/generated/azure_mgmt_resources/models/on_error_deployment_extended.rb +73 -0
  267. data/lib/2019-05-10/generated/azure_mgmt_resources/models/on_error_deployment_type.rb +16 -0
  268. data/lib/2019-05-10/generated/azure_mgmt_resources/models/operation.rb +58 -0
  269. data/lib/2019-05-10/generated/azure_mgmt_resources/models/operation_display.rb +80 -0
  270. data/lib/2019-05-10/generated/azure_mgmt_resources/models/operation_list_result.rb +100 -0
  271. data/lib/2019-05-10/generated/azure_mgmt_resources/models/parameters_link.rb +58 -0
  272. data/lib/2019-05-10/generated/azure_mgmt_resources/models/plan.rb +90 -0
  273. data/lib/2019-05-10/generated/azure_mgmt_resources/models/provider.rb +104 -0
  274. data/lib/2019-05-10/generated/azure_mgmt_resources/models/provider_list_result.rb +99 -0
  275. data/lib/2019-05-10/generated/azure_mgmt_resources/models/provider_resource_type.rb +137 -0
  276. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource.rb +110 -0
  277. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource_group.rb +128 -0
  278. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource_group_export_result.rb +58 -0
  279. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource_group_filter.rb +57 -0
  280. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource_group_list_result.rb +99 -0
  281. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource_group_patchable.rb +90 -0
  282. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource_group_properties.rb +47 -0
  283. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource_identity_type.rb +18 -0
  284. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource_list_result.rb +99 -0
  285. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource_management_error_with_details.rb +92 -0
  286. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource_provider_operation_display_properties.rb +91 -0
  287. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resources_move_info.rb +65 -0
  288. data/lib/2019-05-10/generated/azure_mgmt_resources/models/sku.rb +101 -0
  289. data/lib/2019-05-10/generated/azure_mgmt_resources/models/sub_resource.rb +46 -0
  290. data/lib/2019-05-10/generated/azure_mgmt_resources/models/tag_count.rb +57 -0
  291. data/lib/2019-05-10/generated/azure_mgmt_resources/models/tag_details.rb +92 -0
  292. data/lib/2019-05-10/generated/azure_mgmt_resources/models/tag_value.rb +70 -0
  293. data/lib/2019-05-10/generated/azure_mgmt_resources/models/tags_list_result.rb +99 -0
  294. data/lib/2019-05-10/generated/azure_mgmt_resources/models/target_resource.rb +68 -0
  295. data/lib/2019-05-10/generated/azure_mgmt_resources/models/template_hash_result.rb +58 -0
  296. data/lib/2019-05-10/generated/azure_mgmt_resources/models/template_link.rb +58 -0
  297. data/lib/2019-05-10/generated/azure_mgmt_resources/module_definition.rb +9 -0
  298. data/lib/2019-05-10/generated/azure_mgmt_resources/operations.rb +219 -0
  299. data/lib/2019-05-10/generated/azure_mgmt_resources/providers.rb +846 -0
  300. data/lib/2019-05-10/generated/azure_mgmt_resources/resource_groups.rb +918 -0
  301. data/lib/2019-05-10/generated/azure_mgmt_resources/resource_management_client.rb +155 -0
  302. data/lib/2019-05-10/generated/azure_mgmt_resources/resources.rb +2338 -0
  303. data/lib/2019-05-10/generated/azure_mgmt_resources/tags.rb +611 -0
  304. data/lib/2019-07-01/generated/azure_mgmt_resources.rb +99 -0
  305. data/lib/2019-07-01/generated/azure_mgmt_resources/deployment_operations.rb +1588 -0
  306. data/lib/2019-07-01/generated/azure_mgmt_resources/deployments.rb +5740 -0
  307. data/lib/2019-07-01/generated/azure_mgmt_resources/models/alias_path_type.rb +65 -0
  308. data/lib/2019-07-01/generated/azure_mgmt_resources/models/alias_type.rb +66 -0
  309. data/lib/2019-07-01/generated/azure_mgmt_resources/models/basic_dependency.rb +68 -0
  310. data/lib/2019-07-01/generated/azure_mgmt_resources/models/change_type.rb +20 -0
  311. data/lib/2019-07-01/generated/azure_mgmt_resources/models/debug_setting.rb +53 -0
  312. data/lib/2019-07-01/generated/azure_mgmt_resources/models/dependency.rb +88 -0
  313. data/lib/2019-07-01/generated/azure_mgmt_resources/models/deployment.rb +58 -0
  314. data/lib/2019-07-01/generated/azure_mgmt_resources/models/deployment_export_result.rb +46 -0
  315. data/lib/2019-07-01/generated/azure_mgmt_resources/models/deployment_extended.rb +94 -0
  316. data/lib/2019-07-01/generated/azure_mgmt_resources/models/deployment_extended_filter.rb +46 -0
  317. data/lib/2019-07-01/generated/azure_mgmt_resources/models/deployment_list_result.rb +99 -0
  318. data/lib/2019-07-01/generated/azure_mgmt_resources/models/deployment_mode.rb +16 -0
  319. data/lib/2019-07-01/generated/azure_mgmt_resources/models/deployment_operation.rb +71 -0
  320. data/lib/2019-07-01/generated/azure_mgmt_resources/models/deployment_operation_properties.rb +146 -0
  321. data/lib/2019-07-01/generated/azure_mgmt_resources/models/deployment_operations_list_result.rb +99 -0
  322. data/lib/2019-07-01/generated/azure_mgmt_resources/models/deployment_properties.rb +136 -0
  323. data/lib/2019-07-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +222 -0
  324. data/lib/2019-07-01/generated/azure_mgmt_resources/models/deployment_validate_result.rb +60 -0
  325. data/lib/2019-07-01/generated/azure_mgmt_resources/models/deployment_what_if.rb +58 -0
  326. data/lib/2019-07-01/generated/azure_mgmt_resources/models/deployment_what_if_properties.rb +108 -0
  327. data/lib/2019-07-01/generated/azure_mgmt_resources/models/deployment_what_if_settings.rb +48 -0
  328. data/lib/2019-07-01/generated/azure_mgmt_resources/models/error_additional_info.rb +59 -0
  329. data/lib/2019-07-01/generated/azure_mgmt_resources/models/error_response.rb +113 -0
  330. data/lib/2019-07-01/generated/azure_mgmt_resources/models/export_template_request.rb +69 -0
  331. data/lib/2019-07-01/generated/azure_mgmt_resources/models/generic_resource.rb +158 -0
  332. data/lib/2019-07-01/generated/azure_mgmt_resources/models/generic_resource_filter.rb +68 -0
  333. data/lib/2019-07-01/generated/azure_mgmt_resources/models/http_message.rb +46 -0
  334. data/lib/2019-07-01/generated/azure_mgmt_resources/models/identity.rb +96 -0
  335. data/lib/2019-07-01/generated/azure_mgmt_resources/models/identity_user_assigned_identities_value.rb +60 -0
  336. data/lib/2019-07-01/generated/azure_mgmt_resources/models/on_error_deployment.rb +60 -0
  337. data/lib/2019-07-01/generated/azure_mgmt_resources/models/on_error_deployment_extended.rb +73 -0
  338. data/lib/2019-07-01/generated/azure_mgmt_resources/models/on_error_deployment_type.rb +16 -0
  339. data/lib/2019-07-01/generated/azure_mgmt_resources/models/operation.rb +58 -0
  340. data/lib/2019-07-01/generated/azure_mgmt_resources/models/operation_display.rb +80 -0
  341. data/lib/2019-07-01/generated/azure_mgmt_resources/models/operation_list_result.rb +100 -0
  342. data/lib/2019-07-01/generated/azure_mgmt_resources/models/parameters_link.rb +58 -0
  343. data/lib/2019-07-01/generated/azure_mgmt_resources/models/plan.rb +90 -0
  344. data/lib/2019-07-01/generated/azure_mgmt_resources/models/property_change_type.rb +18 -0
  345. data/lib/2019-07-01/generated/azure_mgmt_resources/models/provider.rb +104 -0
  346. data/lib/2019-07-01/generated/azure_mgmt_resources/models/provider_list_result.rb +99 -0
  347. data/lib/2019-07-01/generated/azure_mgmt_resources/models/provider_resource_type.rb +137 -0
  348. data/lib/2019-07-01/generated/azure_mgmt_resources/models/resource.rb +110 -0
  349. data/lib/2019-07-01/generated/azure_mgmt_resources/models/resource_group.rb +128 -0
  350. data/lib/2019-07-01/generated/azure_mgmt_resources/models/resource_group_export_result.rb +58 -0
  351. data/lib/2019-07-01/generated/azure_mgmt_resources/models/resource_group_filter.rb +57 -0
  352. data/lib/2019-07-01/generated/azure_mgmt_resources/models/resource_group_list_result.rb +99 -0
  353. data/lib/2019-07-01/generated/azure_mgmt_resources/models/resource_group_patchable.rb +90 -0
  354. data/lib/2019-07-01/generated/azure_mgmt_resources/models/resource_group_properties.rb +47 -0
  355. data/lib/2019-07-01/generated/azure_mgmt_resources/models/resource_identity_type.rb +18 -0
  356. data/lib/2019-07-01/generated/azure_mgmt_resources/models/resource_list_result.rb +99 -0
  357. data/lib/2019-07-01/generated/azure_mgmt_resources/models/resource_provider_operation_display_properties.rb +91 -0
  358. data/lib/2019-07-01/generated/azure_mgmt_resources/models/resources_move_info.rb +65 -0
  359. data/lib/2019-07-01/generated/azure_mgmt_resources/models/sku.rb +101 -0
  360. data/lib/2019-07-01/generated/azure_mgmt_resources/models/sub_resource.rb +46 -0
  361. data/lib/2019-07-01/generated/azure_mgmt_resources/models/tag_count.rb +57 -0
  362. data/lib/2019-07-01/generated/azure_mgmt_resources/models/tag_details.rb +92 -0
  363. data/lib/2019-07-01/generated/azure_mgmt_resources/models/tag_value.rb +70 -0
  364. data/lib/2019-07-01/generated/azure_mgmt_resources/models/tags_list_result.rb +99 -0
  365. data/lib/2019-07-01/generated/azure_mgmt_resources/models/target_resource.rb +68 -0
  366. data/lib/2019-07-01/generated/azure_mgmt_resources/models/template_hash_result.rb +58 -0
  367. data/lib/2019-07-01/generated/azure_mgmt_resources/models/template_link.rb +58 -0
  368. data/lib/2019-07-01/generated/azure_mgmt_resources/models/what_if_change.rb +105 -0
  369. data/lib/2019-07-01/generated/azure_mgmt_resources/models/what_if_operation_result.rb +80 -0
  370. data/lib/2019-07-01/generated/azure_mgmt_resources/models/what_if_property_change.rb +101 -0
  371. data/lib/2019-07-01/generated/azure_mgmt_resources/models/what_if_result_format.rb +16 -0
  372. data/lib/2019-07-01/generated/azure_mgmt_resources/module_definition.rb +9 -0
  373. data/lib/2019-07-01/generated/azure_mgmt_resources/operations.rb +219 -0
  374. data/lib/2019-07-01/generated/azure_mgmt_resources/providers.rb +846 -0
  375. data/lib/2019-07-01/generated/azure_mgmt_resources/resource_groups.rb +918 -0
  376. data/lib/2019-07-01/generated/azure_mgmt_resources/resource_management_client.rb +155 -0
  377. data/lib/2019-07-01/generated/azure_mgmt_resources/resources.rb +2338 -0
  378. data/lib/2019-07-01/generated/azure_mgmt_resources/tags.rb +611 -0
  379. data/lib/2020-06-01/generated/azure_mgmt_resources.rb +117 -0
  380. data/lib/2020-06-01/generated/azure_mgmt_resources/deployment_operations.rb +1590 -0
  381. data/lib/2020-06-01/generated/azure_mgmt_resources/deployments.rb +6276 -0
  382. data/lib/2020-06-01/generated/azure_mgmt_resources/models/alias_model.rb +116 -0
  383. data/lib/2020-06-01/generated/azure_mgmt_resources/models/alias_path.rb +91 -0
  384. data/lib/2020-06-01/generated/azure_mgmt_resources/models/alias_path_attributes.rb +16 -0
  385. data/lib/2020-06-01/generated/azure_mgmt_resources/models/alias_path_metadata.rb +64 -0
  386. data/lib/2020-06-01/generated/azure_mgmt_resources/models/alias_path_token_type.rb +22 -0
  387. data/lib/2020-06-01/generated/azure_mgmt_resources/models/alias_pattern.rb +70 -0
  388. data/lib/2020-06-01/generated/azure_mgmt_resources/models/alias_pattern_type.rb +16 -0
  389. data/lib/2020-06-01/generated/azure_mgmt_resources/models/alias_type.rb +17 -0
  390. data/lib/2020-06-01/generated/azure_mgmt_resources/models/api_profile.rb +60 -0
  391. data/lib/2020-06-01/generated/azure_mgmt_resources/models/basic_dependency.rb +68 -0
  392. data/lib/2020-06-01/generated/azure_mgmt_resources/models/change_type.rb +20 -0
  393. data/lib/2020-06-01/generated/azure_mgmt_resources/models/debug_setting.rb +53 -0
  394. data/lib/2020-06-01/generated/azure_mgmt_resources/models/dependency.rb +88 -0
  395. data/lib/2020-06-01/generated/azure_mgmt_resources/models/deployment.rb +77 -0
  396. data/lib/2020-06-01/generated/azure_mgmt_resources/models/deployment_export_result.rb +46 -0
  397. data/lib/2020-06-01/generated/azure_mgmt_resources/models/deployment_extended.rb +113 -0
  398. data/lib/2020-06-01/generated/azure_mgmt_resources/models/deployment_extended_filter.rb +46 -0
  399. data/lib/2020-06-01/generated/azure_mgmt_resources/models/deployment_list_result.rb +99 -0
  400. data/lib/2020-06-01/generated/azure_mgmt_resources/models/deployment_mode.rb +16 -0
  401. data/lib/2020-06-01/generated/azure_mgmt_resources/models/deployment_operation.rb +71 -0
  402. data/lib/2020-06-01/generated/azure_mgmt_resources/models/deployment_operation_properties.rb +166 -0
  403. data/lib/2020-06-01/generated/azure_mgmt_resources/models/deployment_operations_list_result.rb +99 -0
  404. data/lib/2020-06-01/generated/azure_mgmt_resources/models/deployment_properties.rb +136 -0
  405. data/lib/2020-06-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +287 -0
  406. data/lib/2020-06-01/generated/azure_mgmt_resources/models/deployment_validate_result.rb +61 -0
  407. data/lib/2020-06-01/generated/azure_mgmt_resources/models/deployment_what_if.rb +58 -0
  408. data/lib/2020-06-01/generated/azure_mgmt_resources/models/deployment_what_if_properties.rb +108 -0
  409. data/lib/2020-06-01/generated/azure_mgmt_resources/models/deployment_what_if_settings.rb +48 -0
  410. data/lib/2020-06-01/generated/azure_mgmt_resources/models/error_additional_info.rb +59 -0
  411. data/lib/2020-06-01/generated/azure_mgmt_resources/models/error_response.rb +113 -0
  412. data/lib/2020-06-01/generated/azure_mgmt_resources/models/export_template_request.rb +69 -0
  413. data/lib/2020-06-01/generated/azure_mgmt_resources/models/generic_resource.rb +158 -0
  414. data/lib/2020-06-01/generated/azure_mgmt_resources/models/generic_resource_expanded.rb +179 -0
  415. data/lib/2020-06-01/generated/azure_mgmt_resources/models/generic_resource_filter.rb +68 -0
  416. data/lib/2020-06-01/generated/azure_mgmt_resources/models/http_message.rb +46 -0
  417. data/lib/2020-06-01/generated/azure_mgmt_resources/models/identity.rb +96 -0
  418. data/lib/2020-06-01/generated/azure_mgmt_resources/models/identity_user_assigned_identities_value.rb +60 -0
  419. data/lib/2020-06-01/generated/azure_mgmt_resources/models/on_error_deployment.rb +60 -0
  420. data/lib/2020-06-01/generated/azure_mgmt_resources/models/on_error_deployment_extended.rb +73 -0
  421. data/lib/2020-06-01/generated/azure_mgmt_resources/models/on_error_deployment_type.rb +16 -0
  422. data/lib/2020-06-01/generated/azure_mgmt_resources/models/operation.rb +58 -0
  423. data/lib/2020-06-01/generated/azure_mgmt_resources/models/operation_display.rb +80 -0
  424. data/lib/2020-06-01/generated/azure_mgmt_resources/models/operation_list_result.rb +100 -0
  425. data/lib/2020-06-01/generated/azure_mgmt_resources/models/parameters_link.rb +58 -0
  426. data/lib/2020-06-01/generated/azure_mgmt_resources/models/plan.rb +90 -0
  427. data/lib/2020-06-01/generated/azure_mgmt_resources/models/property_change_type.rb +18 -0
  428. data/lib/2020-06-01/generated/azure_mgmt_resources/models/provider.rb +104 -0
  429. data/lib/2020-06-01/generated/azure_mgmt_resources/models/provider_list_result.rb +99 -0
  430. data/lib/2020-06-01/generated/azure_mgmt_resources/models/provider_resource_type.rb +170 -0
  431. data/lib/2020-06-01/generated/azure_mgmt_resources/models/provisioning_operation.rb +24 -0
  432. data/lib/2020-06-01/generated/azure_mgmt_resources/models/provisioning_state.rb +26 -0
  433. data/lib/2020-06-01/generated/azure_mgmt_resources/models/resource.rb +110 -0
  434. data/lib/2020-06-01/generated/azure_mgmt_resources/models/resource_group.rb +128 -0
  435. data/lib/2020-06-01/generated/azure_mgmt_resources/models/resource_group_export_result.rb +58 -0
  436. data/lib/2020-06-01/generated/azure_mgmt_resources/models/resource_group_filter.rb +57 -0
  437. data/lib/2020-06-01/generated/azure_mgmt_resources/models/resource_group_list_result.rb +99 -0
  438. data/lib/2020-06-01/generated/azure_mgmt_resources/models/resource_group_patchable.rb +90 -0
  439. data/lib/2020-06-01/generated/azure_mgmt_resources/models/resource_group_properties.rb +47 -0
  440. data/lib/2020-06-01/generated/azure_mgmt_resources/models/resource_identity_type.rb +18 -0
  441. data/lib/2020-06-01/generated/azure_mgmt_resources/models/resource_list_result.rb +99 -0
  442. data/lib/2020-06-01/generated/azure_mgmt_resources/models/resource_provider_operation_display_properties.rb +91 -0
  443. data/lib/2020-06-01/generated/azure_mgmt_resources/models/resource_reference.rb +47 -0
  444. data/lib/2020-06-01/generated/azure_mgmt_resources/models/resources_move_info.rb +65 -0
  445. data/lib/2020-06-01/generated/azure_mgmt_resources/models/scoped_deployment.rb +77 -0
  446. data/lib/2020-06-01/generated/azure_mgmt_resources/models/scoped_deployment_what_if.rb +58 -0
  447. data/lib/2020-06-01/generated/azure_mgmt_resources/models/sku.rb +101 -0
  448. data/lib/2020-06-01/generated/azure_mgmt_resources/models/status_message.rb +58 -0
  449. data/lib/2020-06-01/generated/azure_mgmt_resources/models/sub_resource.rb +46 -0
  450. data/lib/2020-06-01/generated/azure_mgmt_resources/models/tag_count.rb +57 -0
  451. data/lib/2020-06-01/generated/azure_mgmt_resources/models/tag_details.rb +92 -0
  452. data/lib/2020-06-01/generated/azure_mgmt_resources/models/tag_value.rb +70 -0
  453. data/lib/2020-06-01/generated/azure_mgmt_resources/models/tags.rb +54 -0
  454. data/lib/2020-06-01/generated/azure_mgmt_resources/models/tags_list_result.rb +99 -0
  455. data/lib/2020-06-01/generated/azure_mgmt_resources/models/tags_patch_operation.rb +17 -0
  456. data/lib/2020-06-01/generated/azure_mgmt_resources/models/tags_patch_resource.rb +59 -0
  457. data/lib/2020-06-01/generated/azure_mgmt_resources/models/tags_resource.rb +83 -0
  458. data/lib/2020-06-01/generated/azure_mgmt_resources/models/target_resource.rb +68 -0
  459. data/lib/2020-06-01/generated/azure_mgmt_resources/models/template_hash_result.rb +58 -0
  460. data/lib/2020-06-01/generated/azure_mgmt_resources/models/template_link.rb +84 -0
  461. data/lib/2020-06-01/generated/azure_mgmt_resources/models/what_if_change.rb +105 -0
  462. data/lib/2020-06-01/generated/azure_mgmt_resources/models/what_if_operation_result.rb +80 -0
  463. data/lib/2020-06-01/generated/azure_mgmt_resources/models/what_if_property_change.rb +101 -0
  464. data/lib/2020-06-01/generated/azure_mgmt_resources/models/what_if_result_format.rb +16 -0
  465. data/lib/2020-06-01/generated/azure_mgmt_resources/module_definition.rb +9 -0
  466. data/lib/2020-06-01/generated/azure_mgmt_resources/operations.rb +219 -0
  467. data/lib/2020-06-01/generated/azure_mgmt_resources/providers.rb +846 -0
  468. data/lib/2020-06-01/generated/azure_mgmt_resources/resource_groups.rb +964 -0
  469. data/lib/2020-06-01/generated/azure_mgmt_resources/resource_management_client.rb +155 -0
  470. data/lib/2020-06-01/generated/azure_mgmt_resources/resources.rb +2354 -0
  471. data/lib/2020-06-01/generated/azure_mgmt_resources/tags_operations.rb +1078 -0
  472. data/lib/azure_mgmt_resources.rb +11 -4
  473. data/lib/profiles/latest/modules/resources_profile_module.rb +186 -142
  474. data/lib/profiles/v2017_03_09/modules/resources_profile_module.rb +45 -33
  475. data/lib/profiles/v2018_03_01/modules/resources_profile_module.rb +45 -33
  476. data/lib/profiles/v2019_03_01_hybrid/modules/resources_profile_module.rb +45 -33
  477. data/lib/version.rb +1 -1
  478. metadata +433 -5
@@ -0,0 +1,3352 @@
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_05_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 group_id [String] The management group ID.
38
+ # @param deployment_name [String] The name of the deployment.
39
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
40
+ # will be added to the HTTP request.
41
+ #
42
+ def delete_at_management_group_scope(group_id, deployment_name, custom_headers:nil)
43
+ response = delete_at_management_group_scope_async(group_id, deployment_name, custom_headers:custom_headers).value!
44
+ nil
45
+ end
46
+
47
+ #
48
+ # @param group_id [String] The management group ID.
49
+ # @param deployment_name [String] The name of the deployment.
50
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
51
+ # will be added to the HTTP request.
52
+ #
53
+ # @return [Concurrent::Promise] promise which provides async access to http
54
+ # response.
55
+ #
56
+ def delete_at_management_group_scope_async(group_id, deployment_name, custom_headers:nil)
57
+ # Send request
58
+ promise = begin_delete_at_management_group_scope_async(group_id, deployment_name, custom_headers:custom_headers)
59
+
60
+ promise = promise.then do |response|
61
+ # Defining deserialization method.
62
+ deserialize_method = lambda do |parsed_response|
63
+ end
64
+
65
+ # Waiting for response.
66
+ @client.get_long_running_operation_result(response, deserialize_method)
67
+ end
68
+
69
+ promise
70
+ end
71
+
72
+ #
73
+ # Checks whether the deployment exists.
74
+ #
75
+ # @param group_id [String] The management group ID.
76
+ # @param deployment_name [String] The name of the deployment.
77
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
78
+ # will be added to the HTTP request.
79
+ #
80
+ # @return [Boolean] operation results.
81
+ #
82
+ def check_existence_at_management_group_scope(group_id, deployment_name, custom_headers:nil)
83
+ response = check_existence_at_management_group_scope_async(group_id, deployment_name, custom_headers:custom_headers).value!
84
+ response.body unless response.nil?
85
+ end
86
+
87
+ #
88
+ # Checks whether the deployment exists.
89
+ #
90
+ # @param group_id [String] The management group ID.
91
+ # @param deployment_name [String] The name of the deployment.
92
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
93
+ # will be added to the HTTP request.
94
+ #
95
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
96
+ #
97
+ def check_existence_at_management_group_scope_with_http_info(group_id, deployment_name, custom_headers:nil)
98
+ check_existence_at_management_group_scope_async(group_id, deployment_name, custom_headers:custom_headers).value!
99
+ end
100
+
101
+ #
102
+ # Checks whether the deployment exists.
103
+ #
104
+ # @param group_id [String] The management group ID.
105
+ # @param deployment_name [String] The name of the deployment.
106
+ # @param [Hash{String => String}] A hash of custom headers that will be added
107
+ # to the HTTP request.
108
+ #
109
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
110
+ #
111
+ def check_existence_at_management_group_scope_async(group_id, deployment_name, custom_headers:nil)
112
+ fail ArgumentError, 'group_id is nil' if group_id.nil?
113
+ fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '90'" if !group_id.nil? && group_id.length > 90
114
+ fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1
115
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
116
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
117
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
118
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
119
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
120
+
121
+
122
+ request_headers = {}
123
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
124
+
125
+ # Set Headers
126
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
127
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
128
+ path_template = 'providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}'
129
+
130
+ request_url = @base_url || @client.base_url
131
+
132
+ options = {
133
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
134
+ path_params: {'groupId' => group_id,'deploymentName' => deployment_name},
135
+ query_params: {'api-version' => @client.api_version},
136
+ headers: request_headers.merge(custom_headers || {}),
137
+ base_url: request_url
138
+ }
139
+ promise = @client.make_request_async(:head, path_template, options)
140
+
141
+ promise = promise.then do |result|
142
+ http_response = result.response
143
+ status_code = http_response.status
144
+ response_content = http_response.body
145
+ unless status_code == 204 || status_code == 404
146
+ error_model = JSON.load(response_content)
147
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
148
+ end
149
+
150
+ result.body = (status_code == 204)
151
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
152
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
153
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
154
+
155
+ result
156
+ end
157
+
158
+ promise.execute
159
+ end
160
+
161
+ #
162
+ # Deploys resources at management group scope.
163
+ #
164
+ # You can provide the template and parameters directly in the request or link
165
+ # to JSON files.
166
+ #
167
+ # @param group_id [String] The management group ID.
168
+ # @param deployment_name [String] The name of the deployment.
169
+ # @param parameters [Deployment] Additional parameters supplied to the
170
+ # operation.
171
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
172
+ # will be added to the HTTP request.
173
+ #
174
+ # @return [DeploymentExtended] operation results.
175
+ #
176
+ def create_or_update_at_management_group_scope(group_id, deployment_name, parameters, custom_headers:nil)
177
+ response = create_or_update_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers:custom_headers).value!
178
+ response.body unless response.nil?
179
+ end
180
+
181
+ #
182
+ # @param group_id [String] The management group ID.
183
+ # @param deployment_name [String] The name of the deployment.
184
+ # @param parameters [Deployment] Additional parameters supplied to the
185
+ # operation.
186
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
187
+ # will be added to the HTTP request.
188
+ #
189
+ # @return [Concurrent::Promise] promise which provides async access to http
190
+ # response.
191
+ #
192
+ def create_or_update_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers:nil)
193
+ # Send request
194
+ promise = begin_create_or_update_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers:custom_headers)
195
+
196
+ promise = promise.then do |response|
197
+ # Defining deserialization method.
198
+ deserialize_method = lambda do |parsed_response|
199
+ result_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::DeploymentExtended.mapper()
200
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
201
+ end
202
+
203
+ # Waiting for response.
204
+ @client.get_long_running_operation_result(response, deserialize_method)
205
+ end
206
+
207
+ promise
208
+ end
209
+
210
+ #
211
+ # Gets a deployment.
212
+ #
213
+ # @param group_id [String] The management group ID.
214
+ # @param deployment_name [String] The name of the deployment.
215
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
216
+ # will be added to the HTTP request.
217
+ #
218
+ # @return [DeploymentExtended] operation results.
219
+ #
220
+ def get_at_management_group_scope(group_id, deployment_name, custom_headers:nil)
221
+ response = get_at_management_group_scope_async(group_id, deployment_name, custom_headers:custom_headers).value!
222
+ response.body unless response.nil?
223
+ end
224
+
225
+ #
226
+ # Gets a deployment.
227
+ #
228
+ # @param group_id [String] The management group ID.
229
+ # @param deployment_name [String] The name of the deployment.
230
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
231
+ # will be added to the HTTP request.
232
+ #
233
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
234
+ #
235
+ def get_at_management_group_scope_with_http_info(group_id, deployment_name, custom_headers:nil)
236
+ get_at_management_group_scope_async(group_id, deployment_name, custom_headers:custom_headers).value!
237
+ end
238
+
239
+ #
240
+ # Gets a deployment.
241
+ #
242
+ # @param group_id [String] The management group ID.
243
+ # @param deployment_name [String] The name of the deployment.
244
+ # @param [Hash{String => String}] A hash of custom headers that will be added
245
+ # to the HTTP request.
246
+ #
247
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
248
+ #
249
+ def get_at_management_group_scope_async(group_id, deployment_name, custom_headers:nil)
250
+ fail ArgumentError, 'group_id is nil' if group_id.nil?
251
+ fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '90'" if !group_id.nil? && group_id.length > 90
252
+ fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1
253
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
254
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
255
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
256
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
257
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
258
+
259
+
260
+ request_headers = {}
261
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
262
+
263
+ # Set Headers
264
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
265
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
266
+ path_template = 'providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}'
267
+
268
+ request_url = @base_url || @client.base_url
269
+
270
+ options = {
271
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
272
+ path_params: {'groupId' => group_id,'deploymentName' => deployment_name},
273
+ query_params: {'api-version' => @client.api_version},
274
+ headers: request_headers.merge(custom_headers || {}),
275
+ base_url: request_url
276
+ }
277
+ promise = @client.make_request_async(:get, path_template, options)
278
+
279
+ promise = promise.then do |result|
280
+ http_response = result.response
281
+ status_code = http_response.status
282
+ response_content = http_response.body
283
+ unless status_code == 200
284
+ error_model = JSON.load(response_content)
285
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
286
+ end
287
+
288
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
289
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
290
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
291
+ # Deserialize Response
292
+ if status_code == 200
293
+ begin
294
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
295
+ result_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::DeploymentExtended.mapper()
296
+ result.body = @client.deserialize(result_mapper, parsed_response)
297
+ rescue Exception => e
298
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
299
+ end
300
+ end
301
+
302
+ result
303
+ end
304
+
305
+ promise.execute
306
+ end
307
+
308
+ #
309
+ # Cancels a currently running template deployment.
310
+ #
311
+ # You can cancel a deployment only if the provisioningState is Accepted or
312
+ # Running. After the deployment is canceled, the provisioningState is set to
313
+ # Canceled. Canceling a template deployment stops the currently running
314
+ # template deployment and leaves the resources partially deployed.
315
+ #
316
+ # @param group_id [String] The management group ID.
317
+ # @param deployment_name [String] The name of the deployment.
318
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
319
+ # will be added to the HTTP request.
320
+ #
321
+ #
322
+ def cancel_at_management_group_scope(group_id, deployment_name, custom_headers:nil)
323
+ response = cancel_at_management_group_scope_async(group_id, deployment_name, custom_headers:custom_headers).value!
324
+ nil
325
+ end
326
+
327
+ #
328
+ # Cancels a currently running template deployment.
329
+ #
330
+ # You can cancel a deployment only if the provisioningState is Accepted or
331
+ # Running. After the deployment is canceled, the provisioningState is set to
332
+ # Canceled. Canceling a template deployment stops the currently running
333
+ # template deployment and leaves the resources partially deployed.
334
+ #
335
+ # @param group_id [String] The management group ID.
336
+ # @param deployment_name [String] The name of the deployment.
337
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
338
+ # will be added to the HTTP request.
339
+ #
340
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
341
+ #
342
+ def cancel_at_management_group_scope_with_http_info(group_id, deployment_name, custom_headers:nil)
343
+ cancel_at_management_group_scope_async(group_id, deployment_name, custom_headers:custom_headers).value!
344
+ end
345
+
346
+ #
347
+ # Cancels a currently running template deployment.
348
+ #
349
+ # You can cancel a deployment only if the provisioningState is Accepted or
350
+ # Running. After the deployment is canceled, the provisioningState is set to
351
+ # Canceled. Canceling a template deployment stops the currently running
352
+ # template deployment and leaves the resources partially deployed.
353
+ #
354
+ # @param group_id [String] The management group ID.
355
+ # @param deployment_name [String] The name of the deployment.
356
+ # @param [Hash{String => String}] A hash of custom headers that will be added
357
+ # to the HTTP request.
358
+ #
359
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
360
+ #
361
+ def cancel_at_management_group_scope_async(group_id, deployment_name, custom_headers:nil)
362
+ fail ArgumentError, 'group_id is nil' if group_id.nil?
363
+ fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '90'" if !group_id.nil? && group_id.length > 90
364
+ fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1
365
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
366
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
367
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
368
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
369
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
370
+
371
+
372
+ request_headers = {}
373
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
374
+
375
+ # Set Headers
376
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
377
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
378
+ path_template = 'providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'
379
+
380
+ request_url = @base_url || @client.base_url
381
+
382
+ options = {
383
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
384
+ path_params: {'groupId' => group_id,'deploymentName' => deployment_name},
385
+ query_params: {'api-version' => @client.api_version},
386
+ headers: request_headers.merge(custom_headers || {}),
387
+ base_url: request_url
388
+ }
389
+ promise = @client.make_request_async(:post, path_template, options)
390
+
391
+ promise = promise.then do |result|
392
+ http_response = result.response
393
+ status_code = http_response.status
394
+ response_content = http_response.body
395
+ unless status_code == 204
396
+ error_model = JSON.load(response_content)
397
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
398
+ end
399
+
400
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
401
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
402
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
403
+
404
+ result
405
+ end
406
+
407
+ promise.execute
408
+ end
409
+
410
+ #
411
+ # Validates whether the specified template is syntactically correct and will be
412
+ # accepted by Azure Resource Manager..
413
+ #
414
+ # @param group_id [String] The management group ID.
415
+ # @param deployment_name [String] The name of the deployment.
416
+ # @param parameters [Deployment] Parameters to validate.
417
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
418
+ # will be added to the HTTP request.
419
+ #
420
+ # @return [DeploymentValidateResult] operation results.
421
+ #
422
+ def validate_at_management_group_scope(group_id, deployment_name, parameters, custom_headers:nil)
423
+ response = validate_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers:custom_headers).value!
424
+ response.body unless response.nil?
425
+ end
426
+
427
+ #
428
+ # Validates whether the specified template is syntactically correct and will be
429
+ # accepted by Azure Resource Manager..
430
+ #
431
+ # @param group_id [String] The management group ID.
432
+ # @param deployment_name [String] The name of the deployment.
433
+ # @param parameters [Deployment] Parameters to validate.
434
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
435
+ # will be added to the HTTP request.
436
+ #
437
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
438
+ #
439
+ def validate_at_management_group_scope_with_http_info(group_id, deployment_name, parameters, custom_headers:nil)
440
+ validate_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers:custom_headers).value!
441
+ end
442
+
443
+ #
444
+ # Validates whether the specified template is syntactically correct and will be
445
+ # accepted by Azure Resource Manager..
446
+ #
447
+ # @param group_id [String] The management group ID.
448
+ # @param deployment_name [String] The name of the deployment.
449
+ # @param parameters [Deployment] Parameters to validate.
450
+ # @param [Hash{String => String}] A hash of custom headers that will be added
451
+ # to the HTTP request.
452
+ #
453
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
454
+ #
455
+ def validate_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers:nil)
456
+ fail ArgumentError, 'group_id is nil' if group_id.nil?
457
+ fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '90'" if !group_id.nil? && group_id.length > 90
458
+ fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1
459
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
460
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
461
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
462
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
463
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
464
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
465
+
466
+
467
+ request_headers = {}
468
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
469
+
470
+ # Set Headers
471
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
472
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
473
+
474
+ # Serialize Request
475
+ request_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::Deployment.mapper()
476
+ request_content = @client.serialize(request_mapper, parameters)
477
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
478
+
479
+ path_template = 'providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate'
480
+
481
+ request_url = @base_url || @client.base_url
482
+
483
+ options = {
484
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
485
+ path_params: {'groupId' => group_id,'deploymentName' => deployment_name},
486
+ query_params: {'api-version' => @client.api_version},
487
+ body: request_content,
488
+ headers: request_headers.merge(custom_headers || {}),
489
+ base_url: request_url
490
+ }
491
+ promise = @client.make_request_async(:post, path_template, options)
492
+
493
+ promise = promise.then do |result|
494
+ http_response = result.response
495
+ status_code = http_response.status
496
+ response_content = http_response.body
497
+ unless status_code == 200 || status_code == 400
498
+ error_model = JSON.load(response_content)
499
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
500
+ end
501
+
502
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
503
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
504
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
505
+ # Deserialize Response
506
+ if status_code == 200
507
+ begin
508
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
509
+ result_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::DeploymentValidateResult.mapper()
510
+ result.body = @client.deserialize(result_mapper, parsed_response)
511
+ rescue Exception => e
512
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
513
+ end
514
+ end
515
+ # Deserialize Response
516
+ if status_code == 400
517
+ begin
518
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
519
+ result_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::DeploymentValidateResult.mapper()
520
+ result.body = @client.deserialize(result_mapper, parsed_response)
521
+ rescue Exception => e
522
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
523
+ end
524
+ end
525
+
526
+ result
527
+ end
528
+
529
+ promise.execute
530
+ end
531
+
532
+ #
533
+ # Exports the template used for specified deployment.
534
+ #
535
+ # @param group_id [String] The management group ID.
536
+ # @param deployment_name [String] The name of the deployment.
537
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
538
+ # will be added to the HTTP request.
539
+ #
540
+ # @return [DeploymentExportResult] operation results.
541
+ #
542
+ def export_template_at_management_group_scope(group_id, deployment_name, custom_headers:nil)
543
+ response = export_template_at_management_group_scope_async(group_id, deployment_name, custom_headers:custom_headers).value!
544
+ response.body unless response.nil?
545
+ end
546
+
547
+ #
548
+ # Exports the template used for specified deployment.
549
+ #
550
+ # @param group_id [String] The management group ID.
551
+ # @param deployment_name [String] The name of the deployment.
552
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
553
+ # will be added to the HTTP request.
554
+ #
555
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
556
+ #
557
+ def export_template_at_management_group_scope_with_http_info(group_id, deployment_name, custom_headers:nil)
558
+ export_template_at_management_group_scope_async(group_id, deployment_name, custom_headers:custom_headers).value!
559
+ end
560
+
561
+ #
562
+ # Exports the template used for specified deployment.
563
+ #
564
+ # @param group_id [String] The management group ID.
565
+ # @param deployment_name [String] The name of the deployment.
566
+ # @param [Hash{String => String}] A hash of custom headers that will be added
567
+ # to the HTTP request.
568
+ #
569
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
570
+ #
571
+ def export_template_at_management_group_scope_async(group_id, deployment_name, custom_headers:nil)
572
+ fail ArgumentError, 'group_id is nil' if group_id.nil?
573
+ fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '90'" if !group_id.nil? && group_id.length > 90
574
+ fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1
575
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
576
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
577
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
578
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
579
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
580
+
581
+
582
+ request_headers = {}
583
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
584
+
585
+ # Set Headers
586
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
587
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
588
+ path_template = 'providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate'
589
+
590
+ request_url = @base_url || @client.base_url
591
+
592
+ options = {
593
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
594
+ path_params: {'groupId' => group_id,'deploymentName' => deployment_name},
595
+ query_params: {'api-version' => @client.api_version},
596
+ headers: request_headers.merge(custom_headers || {}),
597
+ base_url: request_url
598
+ }
599
+ promise = @client.make_request_async(:post, path_template, options)
600
+
601
+ promise = promise.then do |result|
602
+ http_response = result.response
603
+ status_code = http_response.status
604
+ response_content = http_response.body
605
+ unless status_code == 200
606
+ error_model = JSON.load(response_content)
607
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
608
+ end
609
+
610
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
611
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
612
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
613
+ # Deserialize Response
614
+ if status_code == 200
615
+ begin
616
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
617
+ result_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::DeploymentExportResult.mapper()
618
+ result.body = @client.deserialize(result_mapper, parsed_response)
619
+ rescue Exception => e
620
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
621
+ end
622
+ end
623
+
624
+ result
625
+ end
626
+
627
+ promise.execute
628
+ end
629
+
630
+ #
631
+ # Get all the deployments for a management group.
632
+ #
633
+ # @param group_id [String] The management group ID.
634
+ # @param filter [String] The filter to apply on the operation. For example, you
635
+ # can use $filter=provisioningState eq '{state}'.
636
+ # @param top [Integer] The number of results to get. If null is passed, returns
637
+ # all deployments.
638
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
639
+ # will be added to the HTTP request.
640
+ #
641
+ # @return [Array<DeploymentExtended>] operation results.
642
+ #
643
+ def list_at_management_group_scope(group_id, filter:nil, top:nil, custom_headers:nil)
644
+ first_page = list_at_management_group_scope_as_lazy(group_id, filter:filter, top:top, custom_headers:custom_headers)
645
+ first_page.get_all_items
646
+ end
647
+
648
+ #
649
+ # Get all the deployments for a management group.
650
+ #
651
+ # @param group_id [String] The management group ID.
652
+ # @param filter [String] The filter to apply on the operation. For example, you
653
+ # can use $filter=provisioningState eq '{state}'.
654
+ # @param top [Integer] The number of results to get. If null is passed, returns
655
+ # all deployments.
656
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
657
+ # will be added to the HTTP request.
658
+ #
659
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
660
+ #
661
+ def list_at_management_group_scope_with_http_info(group_id, filter:nil, top:nil, custom_headers:nil)
662
+ list_at_management_group_scope_async(group_id, filter:filter, top:top, custom_headers:custom_headers).value!
663
+ end
664
+
665
+ #
666
+ # Get all the deployments for a management group.
667
+ #
668
+ # @param group_id [String] The management group ID.
669
+ # @param filter [String] The filter to apply on the operation. For example, you
670
+ # can use $filter=provisioningState eq '{state}'.
671
+ # @param top [Integer] The number of results to get. If null is passed, returns
672
+ # all deployments.
673
+ # @param [Hash{String => String}] A hash of custom headers that will be added
674
+ # to the HTTP request.
675
+ #
676
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
677
+ #
678
+ def list_at_management_group_scope_async(group_id, filter:nil, top:nil, custom_headers:nil)
679
+ fail ArgumentError, 'group_id is nil' if group_id.nil?
680
+ fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '90'" if !group_id.nil? && group_id.length > 90
681
+ fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1
682
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
683
+
684
+
685
+ request_headers = {}
686
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
687
+
688
+ # Set Headers
689
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
690
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
691
+ path_template = 'providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/'
692
+
693
+ request_url = @base_url || @client.base_url
694
+
695
+ options = {
696
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
697
+ path_params: {'groupId' => group_id},
698
+ query_params: {'$filter' => filter,'$top' => top,'api-version' => @client.api_version},
699
+ headers: request_headers.merge(custom_headers || {}),
700
+ base_url: request_url
701
+ }
702
+ promise = @client.make_request_async(:get, path_template, options)
703
+
704
+ promise = promise.then do |result|
705
+ http_response = result.response
706
+ status_code = http_response.status
707
+ response_content = http_response.body
708
+ unless status_code == 200
709
+ error_model = JSON.load(response_content)
710
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
711
+ end
712
+
713
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
714
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
715
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
716
+ # Deserialize Response
717
+ if status_code == 200
718
+ begin
719
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
720
+ result_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::DeploymentListResult.mapper()
721
+ result.body = @client.deserialize(result_mapper, parsed_response)
722
+ rescue Exception => e
723
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
724
+ end
725
+ end
726
+
727
+ result
728
+ end
729
+
730
+ promise.execute
731
+ end
732
+
733
+ #
734
+ # Deletes a deployment from the deployment history.
735
+ #
736
+ # A template deployment that is currently running cannot be deleted. Deleting a
737
+ # template deployment removes the associated deployment operations. This is an
738
+ # asynchronous operation that returns a status of 202 until the template
739
+ # deployment is successfully deleted. The Location response header contains the
740
+ # URI that is used to obtain the status of the process. While the process is
741
+ # running, a call to the URI in the Location header returns a status of 202.
742
+ # When the process finishes, the URI in the Location header returns a status of
743
+ # 204 on success. If the asynchronous request failed, the URI in the Location
744
+ # header returns an error-level status code.
745
+ #
746
+ # @param deployment_name [String] The name of the deployment.
747
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
748
+ # will be added to the HTTP request.
749
+ #
750
+ def delete_at_subscription_scope(deployment_name, custom_headers:nil)
751
+ response = delete_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
752
+ nil
753
+ end
754
+
755
+ #
756
+ # @param deployment_name [String] The name of the deployment.
757
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
758
+ # will be added to the HTTP request.
759
+ #
760
+ # @return [Concurrent::Promise] promise which provides async access to http
761
+ # response.
762
+ #
763
+ def delete_at_subscription_scope_async(deployment_name, custom_headers:nil)
764
+ # Send request
765
+ promise = begin_delete_at_subscription_scope_async(deployment_name, custom_headers:custom_headers)
766
+
767
+ promise = promise.then do |response|
768
+ # Defining deserialization method.
769
+ deserialize_method = lambda do |parsed_response|
770
+ end
771
+
772
+ # Waiting for response.
773
+ @client.get_long_running_operation_result(response, deserialize_method)
774
+ end
775
+
776
+ promise
777
+ end
778
+
779
+ #
780
+ # Checks whether the deployment exists.
781
+ #
782
+ # @param deployment_name [String] The name of the deployment.
783
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
784
+ # will be added to the HTTP request.
785
+ #
786
+ # @return [Boolean] operation results.
787
+ #
788
+ def check_existence_at_subscription_scope(deployment_name, custom_headers:nil)
789
+ response = check_existence_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
790
+ response.body unless response.nil?
791
+ end
792
+
793
+ #
794
+ # Checks whether the deployment exists.
795
+ #
796
+ # @param deployment_name [String] The name of the deployment.
797
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
798
+ # will be added to the HTTP request.
799
+ #
800
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
801
+ #
802
+ def check_existence_at_subscription_scope_with_http_info(deployment_name, custom_headers:nil)
803
+ check_existence_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
804
+ end
805
+
806
+ #
807
+ # Checks whether the deployment exists.
808
+ #
809
+ # @param deployment_name [String] The name of the deployment.
810
+ # @param [Hash{String => String}] A hash of custom headers that will be added
811
+ # to the HTTP request.
812
+ #
813
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
814
+ #
815
+ def check_existence_at_subscription_scope_async(deployment_name, custom_headers:nil)
816
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
817
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
818
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
819
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
820
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
821
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
822
+
823
+
824
+ request_headers = {}
825
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
826
+
827
+ # Set Headers
828
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
829
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
830
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}'
831
+
832
+ request_url = @base_url || @client.base_url
833
+
834
+ options = {
835
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
836
+ path_params: {'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
837
+ query_params: {'api-version' => @client.api_version},
838
+ headers: request_headers.merge(custom_headers || {}),
839
+ base_url: request_url
840
+ }
841
+ promise = @client.make_request_async(:head, path_template, options)
842
+
843
+ promise = promise.then do |result|
844
+ http_response = result.response
845
+ status_code = http_response.status
846
+ response_content = http_response.body
847
+ unless status_code == 204 || status_code == 404
848
+ error_model = JSON.load(response_content)
849
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
850
+ end
851
+
852
+ result.body = (status_code == 204)
853
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
854
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
855
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
856
+
857
+ result
858
+ end
859
+
860
+ promise.execute
861
+ end
862
+
863
+ #
864
+ # Deploys resources at subscription scope.
865
+ #
866
+ # You can provide the template and parameters directly in the request or link
867
+ # to JSON files.
868
+ #
869
+ # @param deployment_name [String] The name of the deployment.
870
+ # @param parameters [Deployment] Additional parameters supplied to the
871
+ # operation.
872
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
873
+ # will be added to the HTTP request.
874
+ #
875
+ # @return [DeploymentExtended] operation results.
876
+ #
877
+ def create_or_update_at_subscription_scope(deployment_name, parameters, custom_headers:nil)
878
+ response = create_or_update_at_subscription_scope_async(deployment_name, parameters, custom_headers:custom_headers).value!
879
+ response.body unless response.nil?
880
+ end
881
+
882
+ #
883
+ # @param deployment_name [String] The name of the deployment.
884
+ # @param parameters [Deployment] Additional parameters supplied to the
885
+ # operation.
886
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
887
+ # will be added to the HTTP request.
888
+ #
889
+ # @return [Concurrent::Promise] promise which provides async access to http
890
+ # response.
891
+ #
892
+ def create_or_update_at_subscription_scope_async(deployment_name, parameters, custom_headers:nil)
893
+ # Send request
894
+ promise = begin_create_or_update_at_subscription_scope_async(deployment_name, parameters, custom_headers:custom_headers)
895
+
896
+ promise = promise.then do |response|
897
+ # Defining deserialization method.
898
+ deserialize_method = lambda do |parsed_response|
899
+ result_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::DeploymentExtended.mapper()
900
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
901
+ end
902
+
903
+ # Waiting for response.
904
+ @client.get_long_running_operation_result(response, deserialize_method)
905
+ end
906
+
907
+ promise
908
+ end
909
+
910
+ #
911
+ # Gets a deployment.
912
+ #
913
+ # @param deployment_name [String] The name of the deployment.
914
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
915
+ # will be added to the HTTP request.
916
+ #
917
+ # @return [DeploymentExtended] operation results.
918
+ #
919
+ def get_at_subscription_scope(deployment_name, custom_headers:nil)
920
+ response = get_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
921
+ response.body unless response.nil?
922
+ end
923
+
924
+ #
925
+ # Gets a deployment.
926
+ #
927
+ # @param deployment_name [String] The name of the deployment.
928
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
929
+ # will be added to the HTTP request.
930
+ #
931
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
932
+ #
933
+ def get_at_subscription_scope_with_http_info(deployment_name, custom_headers:nil)
934
+ get_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
935
+ end
936
+
937
+ #
938
+ # Gets a deployment.
939
+ #
940
+ # @param deployment_name [String] The name of the deployment.
941
+ # @param [Hash{String => String}] A hash of custom headers that will be added
942
+ # to the HTTP request.
943
+ #
944
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
945
+ #
946
+ def get_at_subscription_scope_async(deployment_name, custom_headers: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}/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: {'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_05_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 resources partially deployed.
1010
+ #
1011
+ # @param deployment_name [String] The name of the deployment.
1012
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1013
+ # will be added to the HTTP request.
1014
+ #
1015
+ #
1016
+ def cancel_at_subscription_scope(deployment_name, custom_headers:nil)
1017
+ response = cancel_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
1018
+ nil
1019
+ end
1020
+
1021
+ #
1022
+ # Cancels a currently running template deployment.
1023
+ #
1024
+ # You can cancel a deployment only if the provisioningState is Accepted or
1025
+ # Running. After the deployment is canceled, the provisioningState is set to
1026
+ # Canceled. Canceling a template deployment stops the currently running
1027
+ # template deployment and leaves the resources partially deployed.
1028
+ #
1029
+ # @param deployment_name [String] The name of the deployment.
1030
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1031
+ # will be added to the HTTP request.
1032
+ #
1033
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1034
+ #
1035
+ def cancel_at_subscription_scope_with_http_info(deployment_name, custom_headers:nil)
1036
+ cancel_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
1037
+ end
1038
+
1039
+ #
1040
+ # Cancels a currently running template deployment.
1041
+ #
1042
+ # You can cancel a deployment only if the provisioningState is Accepted or
1043
+ # Running. After the deployment is canceled, the provisioningState is set to
1044
+ # Canceled. Canceling a template deployment stops the currently running
1045
+ # template deployment and leaves the resources partially deployed.
1046
+ #
1047
+ # @param deployment_name [String] The name of the deployment.
1048
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1049
+ # to the HTTP request.
1050
+ #
1051
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1052
+ #
1053
+ def cancel_at_subscription_scope_async(deployment_name, custom_headers:nil)
1054
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
1055
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
1056
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
1057
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1058
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1059
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1060
+
1061
+
1062
+ request_headers = {}
1063
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1064
+
1065
+ # Set Headers
1066
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1067
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1068
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'
1069
+
1070
+ request_url = @base_url || @client.base_url
1071
+
1072
+ options = {
1073
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1074
+ path_params: {'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
1075
+ query_params: {'api-version' => @client.api_version},
1076
+ headers: request_headers.merge(custom_headers || {}),
1077
+ base_url: request_url
1078
+ }
1079
+ promise = @client.make_request_async(:post, path_template, options)
1080
+
1081
+ promise = promise.then do |result|
1082
+ http_response = result.response
1083
+ status_code = http_response.status
1084
+ response_content = http_response.body
1085
+ unless status_code == 204
1086
+ error_model = JSON.load(response_content)
1087
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1088
+ end
1089
+
1090
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1091
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1092
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1093
+
1094
+ result
1095
+ end
1096
+
1097
+ promise.execute
1098
+ end
1099
+
1100
+ #
1101
+ # Validates whether the specified template is syntactically correct and will be
1102
+ # accepted by Azure Resource Manager..
1103
+ #
1104
+ # @param deployment_name [String] The name of the deployment.
1105
+ # @param parameters [Deployment] Parameters to validate.
1106
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1107
+ # will be added to the HTTP request.
1108
+ #
1109
+ # @return [DeploymentValidateResult] operation results.
1110
+ #
1111
+ def validate_at_subscription_scope(deployment_name, parameters, custom_headers:nil)
1112
+ response = validate_at_subscription_scope_async(deployment_name, parameters, custom_headers:custom_headers).value!
1113
+ response.body unless response.nil?
1114
+ end
1115
+
1116
+ #
1117
+ # Validates whether the specified template is syntactically correct and will be
1118
+ # accepted by Azure Resource Manager..
1119
+ #
1120
+ # @param deployment_name [String] The name of the deployment.
1121
+ # @param parameters [Deployment] Parameters to validate.
1122
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1123
+ # will be added to the HTTP request.
1124
+ #
1125
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1126
+ #
1127
+ def validate_at_subscription_scope_with_http_info(deployment_name, parameters, custom_headers:nil)
1128
+ validate_at_subscription_scope_async(deployment_name, parameters, custom_headers:custom_headers).value!
1129
+ end
1130
+
1131
+ #
1132
+ # Validates whether the specified template is syntactically correct and will be
1133
+ # accepted by Azure Resource Manager..
1134
+ #
1135
+ # @param deployment_name [String] The name of the deployment.
1136
+ # @param parameters [Deployment] Parameters to validate.
1137
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1138
+ # to the HTTP request.
1139
+ #
1140
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1141
+ #
1142
+ def validate_at_subscription_scope_async(deployment_name, parameters, custom_headers:nil)
1143
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
1144
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
1145
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
1146
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1147
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1148
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1149
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1150
+
1151
+
1152
+ request_headers = {}
1153
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1154
+
1155
+ # Set Headers
1156
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1157
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1158
+
1159
+ # Serialize Request
1160
+ request_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::Deployment.mapper()
1161
+ request_content = @client.serialize(request_mapper, parameters)
1162
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1163
+
1164
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate'
1165
+
1166
+ request_url = @base_url || @client.base_url
1167
+
1168
+ options = {
1169
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1170
+ path_params: {'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
1171
+ query_params: {'api-version' => @client.api_version},
1172
+ body: request_content,
1173
+ headers: request_headers.merge(custom_headers || {}),
1174
+ base_url: request_url
1175
+ }
1176
+ promise = @client.make_request_async(:post, path_template, options)
1177
+
1178
+ promise = promise.then do |result|
1179
+ http_response = result.response
1180
+ status_code = http_response.status
1181
+ response_content = http_response.body
1182
+ unless status_code == 200 || status_code == 400
1183
+ error_model = JSON.load(response_content)
1184
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1185
+ end
1186
+
1187
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1188
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1189
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1190
+ # Deserialize Response
1191
+ if status_code == 200
1192
+ begin
1193
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1194
+ result_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::DeploymentValidateResult.mapper()
1195
+ result.body = @client.deserialize(result_mapper, parsed_response)
1196
+ rescue Exception => e
1197
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1198
+ end
1199
+ end
1200
+ # Deserialize Response
1201
+ if status_code == 400
1202
+ begin
1203
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1204
+ result_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::DeploymentValidateResult.mapper()
1205
+ result.body = @client.deserialize(result_mapper, parsed_response)
1206
+ rescue Exception => e
1207
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1208
+ end
1209
+ end
1210
+
1211
+ result
1212
+ end
1213
+
1214
+ promise.execute
1215
+ end
1216
+
1217
+ #
1218
+ # Exports the template used for specified deployment.
1219
+ #
1220
+ # @param deployment_name [String] The name of the deployment.
1221
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1222
+ # will be added to the HTTP request.
1223
+ #
1224
+ # @return [DeploymentExportResult] operation results.
1225
+ #
1226
+ def export_template_at_subscription_scope(deployment_name, custom_headers:nil)
1227
+ response = export_template_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
1228
+ response.body unless response.nil?
1229
+ end
1230
+
1231
+ #
1232
+ # Exports the template used for specified deployment.
1233
+ #
1234
+ # @param deployment_name [String] The name of the deployment.
1235
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1236
+ # will be added to the HTTP request.
1237
+ #
1238
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1239
+ #
1240
+ def export_template_at_subscription_scope_with_http_info(deployment_name, custom_headers:nil)
1241
+ export_template_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
1242
+ end
1243
+
1244
+ #
1245
+ # Exports the template used for specified deployment.
1246
+ #
1247
+ # @param deployment_name [String] The name of the deployment.
1248
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1249
+ # to the HTTP request.
1250
+ #
1251
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1252
+ #
1253
+ def export_template_at_subscription_scope_async(deployment_name, custom_headers:nil)
1254
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
1255
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
1256
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
1257
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1258
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1259
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1260
+
1261
+
1262
+ request_headers = {}
1263
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1264
+
1265
+ # Set Headers
1266
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1267
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1268
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate'
1269
+
1270
+ request_url = @base_url || @client.base_url
1271
+
1272
+ options = {
1273
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1274
+ path_params: {'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
1275
+ query_params: {'api-version' => @client.api_version},
1276
+ headers: request_headers.merge(custom_headers || {}),
1277
+ base_url: request_url
1278
+ }
1279
+ promise = @client.make_request_async(:post, path_template, options)
1280
+
1281
+ promise = promise.then do |result|
1282
+ http_response = result.response
1283
+ status_code = http_response.status
1284
+ response_content = http_response.body
1285
+ unless status_code == 200
1286
+ error_model = JSON.load(response_content)
1287
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1288
+ end
1289
+
1290
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1291
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1292
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1293
+ # Deserialize Response
1294
+ if status_code == 200
1295
+ begin
1296
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1297
+ result_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::DeploymentExportResult.mapper()
1298
+ result.body = @client.deserialize(result_mapper, parsed_response)
1299
+ rescue Exception => e
1300
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1301
+ end
1302
+ end
1303
+
1304
+ result
1305
+ end
1306
+
1307
+ promise.execute
1308
+ end
1309
+
1310
+ #
1311
+ # Get all the deployments for a subscription.
1312
+ #
1313
+ # @param filter [String] The filter to apply on the operation. For example, you
1314
+ # can use $filter=provisioningState eq '{state}'.
1315
+ # @param top [Integer] The number of results to get. If null is passed, returns
1316
+ # all deployments.
1317
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1318
+ # will be added to the HTTP request.
1319
+ #
1320
+ # @return [Array<DeploymentExtended>] operation results.
1321
+ #
1322
+ def list_at_subscription_scope(filter:nil, top:nil, custom_headers:nil)
1323
+ first_page = list_at_subscription_scope_as_lazy(filter:filter, top:top, custom_headers:custom_headers)
1324
+ first_page.get_all_items
1325
+ end
1326
+
1327
+ #
1328
+ # Get all the deployments for a subscription.
1329
+ #
1330
+ # @param filter [String] The filter to apply on the operation. For example, you
1331
+ # can use $filter=provisioningState eq '{state}'.
1332
+ # @param top [Integer] The number of results to get. If null is passed, returns
1333
+ # all deployments.
1334
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1335
+ # will be added to the HTTP request.
1336
+ #
1337
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1338
+ #
1339
+ def list_at_subscription_scope_with_http_info(filter:nil, top:nil, custom_headers:nil)
1340
+ list_at_subscription_scope_async(filter:filter, top:top, custom_headers:custom_headers).value!
1341
+ end
1342
+
1343
+ #
1344
+ # Get all the deployments for a subscription.
1345
+ #
1346
+ # @param filter [String] The filter to apply on the operation. For example, you
1347
+ # can use $filter=provisioningState eq '{state}'.
1348
+ # @param top [Integer] The number of results to get. If null is passed, returns
1349
+ # all deployments.
1350
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1351
+ # to the HTTP request.
1352
+ #
1353
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1354
+ #
1355
+ def list_at_subscription_scope_async(filter:nil, top:nil, custom_headers:nil)
1356
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1357
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1358
+
1359
+
1360
+ request_headers = {}
1361
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1362
+
1363
+ # Set Headers
1364
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1365
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1366
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/'
1367
+
1368
+ request_url = @base_url || @client.base_url
1369
+
1370
+ options = {
1371
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1372
+ path_params: {'subscriptionId' => @client.subscription_id},
1373
+ query_params: {'$filter' => filter,'$top' => top,'api-version' => @client.api_version},
1374
+ headers: request_headers.merge(custom_headers || {}),
1375
+ base_url: request_url
1376
+ }
1377
+ promise = @client.make_request_async(:get, path_template, options)
1378
+
1379
+ promise = promise.then do |result|
1380
+ http_response = result.response
1381
+ status_code = http_response.status
1382
+ response_content = http_response.body
1383
+ unless status_code == 200
1384
+ error_model = JSON.load(response_content)
1385
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1386
+ end
1387
+
1388
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1389
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1390
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1391
+ # Deserialize Response
1392
+ if status_code == 200
1393
+ begin
1394
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1395
+ result_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::DeploymentListResult.mapper()
1396
+ result.body = @client.deserialize(result_mapper, parsed_response)
1397
+ rescue Exception => e
1398
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1399
+ end
1400
+ end
1401
+
1402
+ result
1403
+ end
1404
+
1405
+ promise.execute
1406
+ end
1407
+
1408
+ #
1409
+ # Deletes a deployment from the deployment history.
1410
+ #
1411
+ # A template deployment that is currently running cannot be deleted. Deleting a
1412
+ # template deployment removes the associated deployment operations. Deleting a
1413
+ # template deployment does not affect the state of the resource group. This is
1414
+ # an asynchronous operation that returns a status of 202 until the template
1415
+ # deployment is successfully deleted. The Location response header contains the
1416
+ # URI that is used to obtain the status of the process. While the process is
1417
+ # running, a call to the URI in the Location header returns a status of 202.
1418
+ # When the process finishes, the URI in the Location header returns a status of
1419
+ # 204 on success. If the asynchronous request failed, the URI in the Location
1420
+ # header returns an error-level status code.
1421
+ #
1422
+ # @param resource_group_name [String] The name of the resource group with the
1423
+ # deployment to delete. The name is case insensitive.
1424
+ # @param deployment_name [String] The name of the deployment.
1425
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1426
+ # will be added to the HTTP request.
1427
+ #
1428
+ def delete(resource_group_name, deployment_name, custom_headers:nil)
1429
+ response = delete_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
1430
+ nil
1431
+ end
1432
+
1433
+ #
1434
+ # @param resource_group_name [String] The name of the resource group with the
1435
+ # deployment to delete. The name is case insensitive.
1436
+ # @param deployment_name [String] The name of the deployment.
1437
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1438
+ # will be added to the HTTP request.
1439
+ #
1440
+ # @return [Concurrent::Promise] promise which provides async access to http
1441
+ # response.
1442
+ #
1443
+ def delete_async(resource_group_name, deployment_name, custom_headers:nil)
1444
+ # Send request
1445
+ promise = begin_delete_async(resource_group_name, deployment_name, custom_headers:custom_headers)
1446
+
1447
+ promise = promise.then do |response|
1448
+ # Defining deserialization method.
1449
+ deserialize_method = lambda do |parsed_response|
1450
+ end
1451
+
1452
+ # Waiting for response.
1453
+ @client.get_long_running_operation_result(response, deserialize_method)
1454
+ end
1455
+
1456
+ promise
1457
+ end
1458
+
1459
+ #
1460
+ # Checks whether the deployment exists.
1461
+ #
1462
+ # @param resource_group_name [String] The name of the resource group with the
1463
+ # deployment to check. The name is case insensitive.
1464
+ # @param deployment_name [String] The name of the deployment.
1465
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1466
+ # will be added to the HTTP request.
1467
+ #
1468
+ # @return [Boolean] operation results.
1469
+ #
1470
+ def check_existence(resource_group_name, deployment_name, custom_headers:nil)
1471
+ response = check_existence_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
1472
+ response.body unless response.nil?
1473
+ end
1474
+
1475
+ #
1476
+ # Checks whether the deployment exists.
1477
+ #
1478
+ # @param resource_group_name [String] The name of the resource group with the
1479
+ # deployment to check. The name is case insensitive.
1480
+ # @param deployment_name [String] The name of the deployment.
1481
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1482
+ # will be added to the HTTP request.
1483
+ #
1484
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1485
+ #
1486
+ def check_existence_with_http_info(resource_group_name, deployment_name, custom_headers:nil)
1487
+ check_existence_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
1488
+ end
1489
+
1490
+ #
1491
+ # Checks whether the deployment exists.
1492
+ #
1493
+ # @param resource_group_name [String] The name of the resource group with the
1494
+ # deployment to check. The name is case insensitive.
1495
+ # @param deployment_name [String] The name of the deployment.
1496
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1497
+ # to the HTTP request.
1498
+ #
1499
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1500
+ #
1501
+ def check_existence_async(resource_group_name, deployment_name, custom_headers:nil)
1502
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1503
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1504
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1505
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1506
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
1507
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
1508
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
1509
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1510
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1511
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1512
+
1513
+
1514
+ request_headers = {}
1515
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1516
+
1517
+ # Set Headers
1518
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1519
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1520
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'
1521
+
1522
+ request_url = @base_url || @client.base_url
1523
+
1524
+ options = {
1525
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1526
+ path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
1527
+ query_params: {'api-version' => @client.api_version},
1528
+ headers: request_headers.merge(custom_headers || {}),
1529
+ base_url: request_url
1530
+ }
1531
+ promise = @client.make_request_async(:head, path_template, options)
1532
+
1533
+ promise = promise.then do |result|
1534
+ http_response = result.response
1535
+ status_code = http_response.status
1536
+ response_content = http_response.body
1537
+ unless status_code == 204 || status_code == 404
1538
+ error_model = JSON.load(response_content)
1539
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1540
+ end
1541
+
1542
+ result.body = (status_code == 204)
1543
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1544
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1545
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1546
+
1547
+ result
1548
+ end
1549
+
1550
+ promise.execute
1551
+ end
1552
+
1553
+ #
1554
+ # Deploys resources to a resource group.
1555
+ #
1556
+ # You can provide the template and parameters directly in the request or link
1557
+ # to JSON files.
1558
+ #
1559
+ # @param resource_group_name [String] The name of the resource group to deploy
1560
+ # the resources to. The name is case insensitive. The resource group must
1561
+ # already exist.
1562
+ # @param deployment_name [String] The name of the deployment.
1563
+ # @param parameters [Deployment] Additional parameters supplied to the
1564
+ # operation.
1565
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1566
+ # will be added to the HTTP request.
1567
+ #
1568
+ # @return [DeploymentExtended] operation results.
1569
+ #
1570
+ def create_or_update(resource_group_name, deployment_name, parameters, custom_headers:nil)
1571
+ response = create_or_update_async(resource_group_name, deployment_name, parameters, custom_headers:custom_headers).value!
1572
+ response.body unless response.nil?
1573
+ end
1574
+
1575
+ #
1576
+ # @param resource_group_name [String] The name of the resource group to deploy
1577
+ # the resources to. The name is case insensitive. The resource group must
1578
+ # already exist.
1579
+ # @param deployment_name [String] The name of the deployment.
1580
+ # @param parameters [Deployment] Additional parameters supplied to the
1581
+ # operation.
1582
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1583
+ # will be added to the HTTP request.
1584
+ #
1585
+ # @return [Concurrent::Promise] promise which provides async access to http
1586
+ # response.
1587
+ #
1588
+ def create_or_update_async(resource_group_name, deployment_name, parameters, custom_headers:nil)
1589
+ # Send request
1590
+ promise = begin_create_or_update_async(resource_group_name, deployment_name, parameters, custom_headers:custom_headers)
1591
+
1592
+ promise = promise.then do |response|
1593
+ # Defining deserialization method.
1594
+ deserialize_method = lambda do |parsed_response|
1595
+ result_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::DeploymentExtended.mapper()
1596
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
1597
+ end
1598
+
1599
+ # Waiting for response.
1600
+ @client.get_long_running_operation_result(response, deserialize_method)
1601
+ end
1602
+
1603
+ promise
1604
+ end
1605
+
1606
+ #
1607
+ # Gets a deployment.
1608
+ #
1609
+ # @param resource_group_name [String] The name of the resource group. The name
1610
+ # is case insensitive.
1611
+ # @param deployment_name [String] The name of the deployment.
1612
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1613
+ # will be added to the HTTP request.
1614
+ #
1615
+ # @return [DeploymentExtended] operation results.
1616
+ #
1617
+ def get(resource_group_name, deployment_name, custom_headers:nil)
1618
+ response = get_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
1619
+ response.body unless response.nil?
1620
+ end
1621
+
1622
+ #
1623
+ # Gets a deployment.
1624
+ #
1625
+ # @param resource_group_name [String] The name of the resource group. The name
1626
+ # is case insensitive.
1627
+ # @param deployment_name [String] The name of the deployment.
1628
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1629
+ # will be added to the HTTP request.
1630
+ #
1631
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1632
+ #
1633
+ def get_with_http_info(resource_group_name, deployment_name, custom_headers:nil)
1634
+ get_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
1635
+ end
1636
+
1637
+ #
1638
+ # Gets a deployment.
1639
+ #
1640
+ # @param resource_group_name [String] The name of the resource group. The name
1641
+ # is case insensitive.
1642
+ # @param deployment_name [String] The name of the deployment.
1643
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1644
+ # to the HTTP request.
1645
+ #
1646
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1647
+ #
1648
+ def get_async(resource_group_name, deployment_name, custom_headers:nil)
1649
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1650
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1651
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1652
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1653
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
1654
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
1655
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
1656
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1657
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1658
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1659
+
1660
+
1661
+ request_headers = {}
1662
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1663
+
1664
+ # Set Headers
1665
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1666
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1667
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'
1668
+
1669
+ request_url = @base_url || @client.base_url
1670
+
1671
+ options = {
1672
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1673
+ path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
1674
+ query_params: {'api-version' => @client.api_version},
1675
+ headers: request_headers.merge(custom_headers || {}),
1676
+ base_url: request_url
1677
+ }
1678
+ promise = @client.make_request_async(:get, path_template, options)
1679
+
1680
+ promise = promise.then do |result|
1681
+ http_response = result.response
1682
+ status_code = http_response.status
1683
+ response_content = http_response.body
1684
+ unless status_code == 200
1685
+ error_model = JSON.load(response_content)
1686
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1687
+ end
1688
+
1689
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1690
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1691
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1692
+ # Deserialize Response
1693
+ if status_code == 200
1694
+ begin
1695
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1696
+ result_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::DeploymentExtended.mapper()
1697
+ result.body = @client.deserialize(result_mapper, parsed_response)
1698
+ rescue Exception => e
1699
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1700
+ end
1701
+ end
1702
+
1703
+ result
1704
+ end
1705
+
1706
+ promise.execute
1707
+ end
1708
+
1709
+ #
1710
+ # Cancels a currently running template deployment.
1711
+ #
1712
+ # You can cancel a deployment only if the provisioningState is Accepted or
1713
+ # Running. After the deployment is canceled, the provisioningState is set to
1714
+ # Canceled. Canceling a template deployment stops the currently running
1715
+ # template deployment and leaves the resource group partially deployed.
1716
+ #
1717
+ # @param resource_group_name [String] The name of the resource group. The name
1718
+ # is case insensitive.
1719
+ # @param deployment_name [String] The name of the deployment.
1720
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1721
+ # will be added to the HTTP request.
1722
+ #
1723
+ #
1724
+ def cancel(resource_group_name, deployment_name, custom_headers:nil)
1725
+ response = cancel_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
1726
+ nil
1727
+ end
1728
+
1729
+ #
1730
+ # Cancels a currently running template deployment.
1731
+ #
1732
+ # You can cancel a deployment only if the provisioningState is Accepted or
1733
+ # Running. After the deployment is canceled, the provisioningState is set to
1734
+ # Canceled. Canceling a template deployment stops the currently running
1735
+ # template deployment and leaves the resource group partially deployed.
1736
+ #
1737
+ # @param resource_group_name [String] The name of the resource group. The name
1738
+ # is case insensitive.
1739
+ # @param deployment_name [String] The name of the deployment.
1740
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1741
+ # will be added to the HTTP request.
1742
+ #
1743
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1744
+ #
1745
+ def cancel_with_http_info(resource_group_name, deployment_name, custom_headers:nil)
1746
+ cancel_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
1747
+ end
1748
+
1749
+ #
1750
+ # Cancels a currently running template deployment.
1751
+ #
1752
+ # You can cancel a deployment only if the provisioningState is Accepted or
1753
+ # Running. After the deployment is canceled, the provisioningState is set to
1754
+ # Canceled. Canceling a template deployment stops the currently running
1755
+ # template deployment and leaves the resource group partially deployed.
1756
+ #
1757
+ # @param resource_group_name [String] The name of the resource group. The name
1758
+ # is case insensitive.
1759
+ # @param deployment_name [String] The name of the deployment.
1760
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1761
+ # to the HTTP request.
1762
+ #
1763
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1764
+ #
1765
+ def cancel_async(resource_group_name, deployment_name, custom_headers:nil)
1766
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1767
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1768
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1769
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1770
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
1771
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
1772
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
1773
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1774
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1775
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1776
+
1777
+
1778
+ request_headers = {}
1779
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1780
+
1781
+ # Set Headers
1782
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1783
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1784
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'
1785
+
1786
+ request_url = @base_url || @client.base_url
1787
+
1788
+ options = {
1789
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1790
+ path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
1791
+ query_params: {'api-version' => @client.api_version},
1792
+ headers: request_headers.merge(custom_headers || {}),
1793
+ base_url: request_url
1794
+ }
1795
+ promise = @client.make_request_async(:post, path_template, options)
1796
+
1797
+ promise = promise.then do |result|
1798
+ http_response = result.response
1799
+ status_code = http_response.status
1800
+ response_content = http_response.body
1801
+ unless status_code == 204
1802
+ error_model = JSON.load(response_content)
1803
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1804
+ end
1805
+
1806
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1807
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1808
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1809
+
1810
+ result
1811
+ end
1812
+
1813
+ promise.execute
1814
+ end
1815
+
1816
+ #
1817
+ # Validates whether the specified template is syntactically correct and will be
1818
+ # accepted by Azure Resource Manager..
1819
+ #
1820
+ # @param resource_group_name [String] The name of the resource group the
1821
+ # template will be deployed to. The name is case insensitive.
1822
+ # @param deployment_name [String] The name of the deployment.
1823
+ # @param parameters [Deployment] Parameters to validate.
1824
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1825
+ # will be added to the HTTP request.
1826
+ #
1827
+ # @return [DeploymentValidateResult] operation results.
1828
+ #
1829
+ def validate(resource_group_name, deployment_name, parameters, custom_headers:nil)
1830
+ response = validate_async(resource_group_name, deployment_name, parameters, custom_headers:custom_headers).value!
1831
+ response.body unless response.nil?
1832
+ end
1833
+
1834
+ #
1835
+ # Validates whether the specified template is syntactically correct and will be
1836
+ # accepted by Azure Resource Manager..
1837
+ #
1838
+ # @param resource_group_name [String] The name of the resource group the
1839
+ # template will be deployed to. The name is case insensitive.
1840
+ # @param deployment_name [String] The name of the deployment.
1841
+ # @param parameters [Deployment] Parameters to validate.
1842
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1843
+ # will be added to the HTTP request.
1844
+ #
1845
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1846
+ #
1847
+ def validate_with_http_info(resource_group_name, deployment_name, parameters, custom_headers:nil)
1848
+ validate_async(resource_group_name, deployment_name, parameters, custom_headers:custom_headers).value!
1849
+ end
1850
+
1851
+ #
1852
+ # Validates whether the specified template is syntactically correct and will be
1853
+ # accepted by Azure Resource Manager..
1854
+ #
1855
+ # @param resource_group_name [String] The name of the resource group the
1856
+ # template will be deployed to. The name is case insensitive.
1857
+ # @param deployment_name [String] The name of the deployment.
1858
+ # @param parameters [Deployment] Parameters to validate.
1859
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1860
+ # to the HTTP request.
1861
+ #
1862
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1863
+ #
1864
+ def validate_async(resource_group_name, deployment_name, parameters, custom_headers:nil)
1865
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1866
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1867
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1868
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1869
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
1870
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
1871
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
1872
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1873
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1874
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1875
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1876
+
1877
+
1878
+ request_headers = {}
1879
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1880
+
1881
+ # Set Headers
1882
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1883
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1884
+
1885
+ # Serialize Request
1886
+ request_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::Deployment.mapper()
1887
+ request_content = @client.serialize(request_mapper, parameters)
1888
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1889
+
1890
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/validate'
1891
+
1892
+ request_url = @base_url || @client.base_url
1893
+
1894
+ options = {
1895
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1896
+ path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
1897
+ query_params: {'api-version' => @client.api_version},
1898
+ body: request_content,
1899
+ headers: request_headers.merge(custom_headers || {}),
1900
+ base_url: request_url
1901
+ }
1902
+ promise = @client.make_request_async(:post, path_template, options)
1903
+
1904
+ promise = promise.then do |result|
1905
+ http_response = result.response
1906
+ status_code = http_response.status
1907
+ response_content = http_response.body
1908
+ unless status_code == 200 || status_code == 400
1909
+ error_model = JSON.load(response_content)
1910
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1911
+ end
1912
+
1913
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1914
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1915
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1916
+ # Deserialize Response
1917
+ if status_code == 200
1918
+ begin
1919
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1920
+ result_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::DeploymentValidateResult.mapper()
1921
+ result.body = @client.deserialize(result_mapper, parsed_response)
1922
+ rescue Exception => e
1923
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1924
+ end
1925
+ end
1926
+ # Deserialize Response
1927
+ if status_code == 400
1928
+ begin
1929
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1930
+ result_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::DeploymentValidateResult.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
+
1937
+ result
1938
+ end
1939
+
1940
+ promise.execute
1941
+ end
1942
+
1943
+ #
1944
+ # Exports the template used for specified deployment.
1945
+ #
1946
+ # @param resource_group_name [String] The name of the resource group. The name
1947
+ # is case insensitive.
1948
+ # @param deployment_name [String] The name of the deployment.
1949
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1950
+ # will be added to the HTTP request.
1951
+ #
1952
+ # @return [DeploymentExportResult] operation results.
1953
+ #
1954
+ def export_template(resource_group_name, deployment_name, custom_headers:nil)
1955
+ response = export_template_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
1956
+ response.body unless response.nil?
1957
+ end
1958
+
1959
+ #
1960
+ # Exports the template used for specified deployment.
1961
+ #
1962
+ # @param resource_group_name [String] The name of the resource group. The name
1963
+ # is case insensitive.
1964
+ # @param deployment_name [String] The name of the deployment.
1965
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1966
+ # will be added to the HTTP request.
1967
+ #
1968
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1969
+ #
1970
+ def export_template_with_http_info(resource_group_name, deployment_name, custom_headers:nil)
1971
+ export_template_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
1972
+ end
1973
+
1974
+ #
1975
+ # Exports the template used for specified deployment.
1976
+ #
1977
+ # @param resource_group_name [String] The name of the resource group. The name
1978
+ # is case insensitive.
1979
+ # @param deployment_name [String] The name of the deployment.
1980
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1981
+ # to the HTTP request.
1982
+ #
1983
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1984
+ #
1985
+ def export_template_async(resource_group_name, deployment_name, custom_headers:nil)
1986
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1987
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1988
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1989
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1990
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
1991
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
1992
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
1993
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1994
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1995
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1996
+
1997
+
1998
+ request_headers = {}
1999
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2000
+
2001
+ # Set Headers
2002
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2003
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2004
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate'
2005
+
2006
+ request_url = @base_url || @client.base_url
2007
+
2008
+ options = {
2009
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2010
+ path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
2011
+ query_params: {'api-version' => @client.api_version},
2012
+ headers: request_headers.merge(custom_headers || {}),
2013
+ base_url: request_url
2014
+ }
2015
+ promise = @client.make_request_async(:post, path_template, options)
2016
+
2017
+ promise = promise.then do |result|
2018
+ http_response = result.response
2019
+ status_code = http_response.status
2020
+ response_content = http_response.body
2021
+ unless status_code == 200
2022
+ error_model = JSON.load(response_content)
2023
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2024
+ end
2025
+
2026
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2027
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2028
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2029
+ # Deserialize Response
2030
+ if status_code == 200
2031
+ begin
2032
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2033
+ result_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::DeploymentExportResult.mapper()
2034
+ result.body = @client.deserialize(result_mapper, parsed_response)
2035
+ rescue Exception => e
2036
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2037
+ end
2038
+ end
2039
+
2040
+ result
2041
+ end
2042
+
2043
+ promise.execute
2044
+ end
2045
+
2046
+ #
2047
+ # Get all the deployments for a resource group.
2048
+ #
2049
+ # @param resource_group_name [String] The name of the resource group with the
2050
+ # deployments to get. The name is case insensitive.
2051
+ # @param filter [String] The filter to apply on the operation. For example, you
2052
+ # can use $filter=provisioningState eq '{state}'.
2053
+ # @param top [Integer] The number of results to get. If null is passed, returns
2054
+ # all deployments.
2055
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2056
+ # will be added to the HTTP request.
2057
+ #
2058
+ # @return [Array<DeploymentExtended>] operation results.
2059
+ #
2060
+ def list_by_resource_group(resource_group_name, filter:nil, top:nil, custom_headers:nil)
2061
+ first_page = list_by_resource_group_as_lazy(resource_group_name, filter:filter, top:top, custom_headers:custom_headers)
2062
+ first_page.get_all_items
2063
+ end
2064
+
2065
+ #
2066
+ # Get all the deployments for a resource group.
2067
+ #
2068
+ # @param resource_group_name [String] The name of the resource group with the
2069
+ # deployments to get. The name is case insensitive.
2070
+ # @param filter [String] The filter to apply on the operation. For example, you
2071
+ # can use $filter=provisioningState eq '{state}'.
2072
+ # @param top [Integer] The number of results to get. If null is passed, returns
2073
+ # all deployments.
2074
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2075
+ # will be added to the HTTP request.
2076
+ #
2077
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2078
+ #
2079
+ def list_by_resource_group_with_http_info(resource_group_name, filter:nil, top:nil, custom_headers:nil)
2080
+ list_by_resource_group_async(resource_group_name, filter:filter, top:top, custom_headers:custom_headers).value!
2081
+ end
2082
+
2083
+ #
2084
+ # Get all the deployments for a resource group.
2085
+ #
2086
+ # @param resource_group_name [String] The name of the resource group with the
2087
+ # deployments to get. The name is case insensitive.
2088
+ # @param filter [String] The filter to apply on the operation. For example, you
2089
+ # can use $filter=provisioningState eq '{state}'.
2090
+ # @param top [Integer] The number of results to get. If null is passed, returns
2091
+ # all deployments.
2092
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2093
+ # to the HTTP request.
2094
+ #
2095
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2096
+ #
2097
+ def list_by_resource_group_async(resource_group_name, filter:nil, top:nil, custom_headers:nil)
2098
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2099
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
2100
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
2101
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
2102
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2103
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2104
+
2105
+
2106
+ request_headers = {}
2107
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2108
+
2109
+ # Set Headers
2110
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2111
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2112
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/'
2113
+
2114
+ request_url = @base_url || @client.base_url
2115
+
2116
+ options = {
2117
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2118
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
2119
+ query_params: {'$filter' => filter,'$top' => top,'api-version' => @client.api_version},
2120
+ headers: request_headers.merge(custom_headers || {}),
2121
+ base_url: request_url
2122
+ }
2123
+ promise = @client.make_request_async(:get, path_template, options)
2124
+
2125
+ promise = promise.then do |result|
2126
+ http_response = result.response
2127
+ status_code = http_response.status
2128
+ response_content = http_response.body
2129
+ unless status_code == 200
2130
+ error_model = JSON.load(response_content)
2131
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2132
+ end
2133
+
2134
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2135
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2136
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2137
+ # Deserialize Response
2138
+ if status_code == 200
2139
+ begin
2140
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2141
+ result_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::DeploymentListResult.mapper()
2142
+ result.body = @client.deserialize(result_mapper, parsed_response)
2143
+ rescue Exception => e
2144
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2145
+ end
2146
+ end
2147
+
2148
+ result
2149
+ end
2150
+
2151
+ promise.execute
2152
+ end
2153
+
2154
+ #
2155
+ # Calculate the hash of the given template.
2156
+ #
2157
+ # @param template The template provided to calculate hash.
2158
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2159
+ # will be added to the HTTP request.
2160
+ #
2161
+ # @return [TemplateHashResult] operation results.
2162
+ #
2163
+ def calculate_template_hash(template, custom_headers:nil)
2164
+ response = calculate_template_hash_async(template, custom_headers:custom_headers).value!
2165
+ response.body unless response.nil?
2166
+ end
2167
+
2168
+ #
2169
+ # Calculate the hash of the given template.
2170
+ #
2171
+ # @param template The template provided to calculate hash.
2172
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2173
+ # will be added to the HTTP request.
2174
+ #
2175
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2176
+ #
2177
+ def calculate_template_hash_with_http_info(template, custom_headers:nil)
2178
+ calculate_template_hash_async(template, custom_headers:custom_headers).value!
2179
+ end
2180
+
2181
+ #
2182
+ # Calculate the hash of the given template.
2183
+ #
2184
+ # @param template The template provided to calculate hash.
2185
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2186
+ # to the HTTP request.
2187
+ #
2188
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2189
+ #
2190
+ def calculate_template_hash_async(template, custom_headers:nil)
2191
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2192
+ fail ArgumentError, 'template is nil' if template.nil?
2193
+
2194
+
2195
+ request_headers = {}
2196
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2197
+
2198
+ # Set Headers
2199
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2200
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2201
+
2202
+ # Serialize Request
2203
+ request_mapper = {
2204
+ client_side_validation: true,
2205
+ required: true,
2206
+ serialized_name: 'template',
2207
+ type: {
2208
+ name: 'Object'
2209
+ }
2210
+ }
2211
+ request_content = @client.serialize(request_mapper, template)
2212
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2213
+
2214
+ path_template = 'providers/Microsoft.Resources/calculateTemplateHash'
2215
+
2216
+ request_url = @base_url || @client.base_url
2217
+
2218
+ options = {
2219
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2220
+ query_params: {'api-version' => @client.api_version},
2221
+ body: request_content,
2222
+ headers: request_headers.merge(custom_headers || {}),
2223
+ base_url: request_url
2224
+ }
2225
+ promise = @client.make_request_async(:post, path_template, options)
2226
+
2227
+ promise = promise.then do |result|
2228
+ http_response = result.response
2229
+ status_code = http_response.status
2230
+ response_content = http_response.body
2231
+ unless status_code == 200
2232
+ error_model = JSON.load(response_content)
2233
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2234
+ end
2235
+
2236
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2237
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2238
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2239
+ # Deserialize Response
2240
+ if status_code == 200
2241
+ begin
2242
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2243
+ result_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::TemplateHashResult.mapper()
2244
+ result.body = @client.deserialize(result_mapper, parsed_response)
2245
+ rescue Exception => e
2246
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2247
+ end
2248
+ end
2249
+
2250
+ result
2251
+ end
2252
+
2253
+ promise.execute
2254
+ end
2255
+
2256
+ #
2257
+ # Deletes a deployment from the deployment history.
2258
+ #
2259
+ # A template deployment that is currently running cannot be deleted. Deleting a
2260
+ # template deployment removes the associated deployment operations. This is an
2261
+ # asynchronous operation that returns a status of 202 until the template
2262
+ # deployment is successfully deleted. The Location response header contains the
2263
+ # URI that is used to obtain the status of the process. While the process is
2264
+ # running, a call to the URI in the Location header returns a status of 202.
2265
+ # When the process finishes, the URI in the Location header returns a status of
2266
+ # 204 on success. If the asynchronous request failed, the URI in the Location
2267
+ # header returns an error-level status code.
2268
+ #
2269
+ # @param group_id [String] The management group ID.
2270
+ # @param deployment_name [String] The name of the deployment.
2271
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2272
+ # will be added to the HTTP request.
2273
+ #
2274
+ #
2275
+ def begin_delete_at_management_group_scope(group_id, deployment_name, custom_headers:nil)
2276
+ response = begin_delete_at_management_group_scope_async(group_id, deployment_name, custom_headers:custom_headers).value!
2277
+ nil
2278
+ end
2279
+
2280
+ #
2281
+ # Deletes a deployment from the deployment history.
2282
+ #
2283
+ # A template deployment that is currently running cannot be deleted. Deleting a
2284
+ # template deployment removes the associated deployment operations. This is an
2285
+ # asynchronous operation that returns a status of 202 until the template
2286
+ # deployment is successfully deleted. The Location response header contains the
2287
+ # URI that is used to obtain the status of the process. While the process is
2288
+ # running, a call to the URI in the Location header returns a status of 202.
2289
+ # When the process finishes, the URI in the Location header returns a status of
2290
+ # 204 on success. If the asynchronous request failed, the URI in the Location
2291
+ # header returns an error-level status code.
2292
+ #
2293
+ # @param group_id [String] The management group ID.
2294
+ # @param deployment_name [String] The name of the deployment.
2295
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2296
+ # will be added to the HTTP request.
2297
+ #
2298
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2299
+ #
2300
+ def begin_delete_at_management_group_scope_with_http_info(group_id, deployment_name, custom_headers:nil)
2301
+ begin_delete_at_management_group_scope_async(group_id, deployment_name, custom_headers:custom_headers).value!
2302
+ end
2303
+
2304
+ #
2305
+ # Deletes a deployment from the deployment history.
2306
+ #
2307
+ # A template deployment that is currently running cannot be deleted. Deleting a
2308
+ # template deployment removes the associated deployment operations. This is an
2309
+ # asynchronous operation that returns a status of 202 until the template
2310
+ # deployment is successfully deleted. The Location response header contains the
2311
+ # URI that is used to obtain the status of the process. While the process is
2312
+ # running, a call to the URI in the Location header returns a status of 202.
2313
+ # When the process finishes, the URI in the Location header returns a status of
2314
+ # 204 on success. If the asynchronous request failed, the URI in the Location
2315
+ # header returns an error-level status code.
2316
+ #
2317
+ # @param group_id [String] The management group ID.
2318
+ # @param deployment_name [String] The name of the deployment.
2319
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2320
+ # to the HTTP request.
2321
+ #
2322
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2323
+ #
2324
+ def begin_delete_at_management_group_scope_async(group_id, deployment_name, custom_headers:nil)
2325
+ fail ArgumentError, 'group_id is nil' if group_id.nil?
2326
+ fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '90'" if !group_id.nil? && group_id.length > 90
2327
+ fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1
2328
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
2329
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
2330
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
2331
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
2332
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2333
+
2334
+
2335
+ request_headers = {}
2336
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2337
+
2338
+ # Set Headers
2339
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2340
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2341
+ path_template = 'providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}'
2342
+
2343
+ request_url = @base_url || @client.base_url
2344
+
2345
+ options = {
2346
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2347
+ path_params: {'groupId' => group_id,'deploymentName' => deployment_name},
2348
+ query_params: {'api-version' => @client.api_version},
2349
+ headers: request_headers.merge(custom_headers || {}),
2350
+ base_url: request_url
2351
+ }
2352
+ promise = @client.make_request_async(:delete, path_template, options)
2353
+
2354
+ promise = promise.then do |result|
2355
+ http_response = result.response
2356
+ status_code = http_response.status
2357
+ response_content = http_response.body
2358
+ unless status_code == 202 || status_code == 204
2359
+ error_model = JSON.load(response_content)
2360
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2361
+ end
2362
+
2363
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2364
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2365
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2366
+
2367
+ result
2368
+ end
2369
+
2370
+ promise.execute
2371
+ end
2372
+
2373
+ #
2374
+ # Deploys resources at management group scope.
2375
+ #
2376
+ # You can provide the template and parameters directly in the request or link
2377
+ # to JSON files.
2378
+ #
2379
+ # @param group_id [String] The management group ID.
2380
+ # @param deployment_name [String] The name of the deployment.
2381
+ # @param parameters [Deployment] Additional parameters supplied to the
2382
+ # operation.
2383
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2384
+ # will be added to the HTTP request.
2385
+ #
2386
+ # @return [DeploymentExtended] operation results.
2387
+ #
2388
+ def begin_create_or_update_at_management_group_scope(group_id, deployment_name, parameters, custom_headers:nil)
2389
+ response = begin_create_or_update_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers:custom_headers).value!
2390
+ response.body unless response.nil?
2391
+ end
2392
+
2393
+ #
2394
+ # Deploys resources at management group scope.
2395
+ #
2396
+ # You can provide the template and parameters directly in the request or link
2397
+ # to JSON files.
2398
+ #
2399
+ # @param group_id [String] The management group ID.
2400
+ # @param deployment_name [String] The name of the deployment.
2401
+ # @param parameters [Deployment] Additional parameters supplied to the
2402
+ # operation.
2403
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2404
+ # will be added to the HTTP request.
2405
+ #
2406
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2407
+ #
2408
+ def begin_create_or_update_at_management_group_scope_with_http_info(group_id, deployment_name, parameters, custom_headers:nil)
2409
+ begin_create_or_update_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers:custom_headers).value!
2410
+ end
2411
+
2412
+ #
2413
+ # Deploys resources at management group scope.
2414
+ #
2415
+ # You can provide the template and parameters directly in the request or link
2416
+ # to JSON files.
2417
+ #
2418
+ # @param group_id [String] The management group ID.
2419
+ # @param deployment_name [String] The name of the deployment.
2420
+ # @param parameters [Deployment] Additional parameters supplied to the
2421
+ # operation.
2422
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2423
+ # to the HTTP request.
2424
+ #
2425
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2426
+ #
2427
+ def begin_create_or_update_at_management_group_scope_async(group_id, deployment_name, parameters, custom_headers:nil)
2428
+ fail ArgumentError, 'group_id is nil' if group_id.nil?
2429
+ fail ArgumentError, "'group_id' should satisfy the constraint - 'MaxLength': '90'" if !group_id.nil? && group_id.length > 90
2430
+ fail ArgumentError, "'group_id' should satisfy the constraint - 'MinLength': '1'" if !group_id.nil? && group_id.length < 1
2431
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
2432
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
2433
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
2434
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
2435
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
2436
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2437
+
2438
+
2439
+ request_headers = {}
2440
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2441
+
2442
+ # Set Headers
2443
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2444
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2445
+
2446
+ # Serialize Request
2447
+ request_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::Deployment.mapper()
2448
+ request_content = @client.serialize(request_mapper, parameters)
2449
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2450
+
2451
+ path_template = 'providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}'
2452
+
2453
+ request_url = @base_url || @client.base_url
2454
+
2455
+ options = {
2456
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2457
+ path_params: {'groupId' => group_id,'deploymentName' => deployment_name},
2458
+ query_params: {'api-version' => @client.api_version},
2459
+ body: request_content,
2460
+ headers: request_headers.merge(custom_headers || {}),
2461
+ base_url: request_url
2462
+ }
2463
+ promise = @client.make_request_async(:put, path_template, options)
2464
+
2465
+ promise = promise.then do |result|
2466
+ http_response = result.response
2467
+ status_code = http_response.status
2468
+ response_content = http_response.body
2469
+ unless status_code == 200 || status_code == 201
2470
+ error_model = JSON.load(response_content)
2471
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2472
+ end
2473
+
2474
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2475
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2476
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2477
+ # Deserialize Response
2478
+ if status_code == 200
2479
+ begin
2480
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2481
+ result_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::DeploymentExtended.mapper()
2482
+ result.body = @client.deserialize(result_mapper, parsed_response)
2483
+ rescue Exception => e
2484
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2485
+ end
2486
+ end
2487
+ # Deserialize Response
2488
+ if status_code == 201
2489
+ begin
2490
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2491
+ result_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::DeploymentExtended.mapper()
2492
+ result.body = @client.deserialize(result_mapper, parsed_response)
2493
+ rescue Exception => e
2494
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2495
+ end
2496
+ end
2497
+
2498
+ result
2499
+ end
2500
+
2501
+ promise.execute
2502
+ end
2503
+
2504
+ #
2505
+ # Deletes a deployment from the deployment history.
2506
+ #
2507
+ # A template deployment that is currently running cannot be deleted. Deleting a
2508
+ # template deployment removes the associated deployment operations. This is an
2509
+ # asynchronous operation that returns a status of 202 until the template
2510
+ # deployment is successfully deleted. The Location response header contains the
2511
+ # URI that is used to obtain the status of the process. While the process is
2512
+ # running, a call to the URI in the Location header returns a status of 202.
2513
+ # When the process finishes, the URI in the Location header returns a status of
2514
+ # 204 on success. If the asynchronous request failed, the URI in the Location
2515
+ # header returns an error-level status code.
2516
+ #
2517
+ # @param deployment_name [String] The name of the deployment.
2518
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2519
+ # will be added to the HTTP request.
2520
+ #
2521
+ #
2522
+ def begin_delete_at_subscription_scope(deployment_name, custom_headers:nil)
2523
+ response = begin_delete_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
2524
+ nil
2525
+ end
2526
+
2527
+ #
2528
+ # Deletes a deployment from the deployment history.
2529
+ #
2530
+ # A template deployment that is currently running cannot be deleted. Deleting a
2531
+ # template deployment removes the associated deployment operations. This is an
2532
+ # asynchronous operation that returns a status of 202 until the template
2533
+ # deployment is successfully deleted. The Location response header contains the
2534
+ # URI that is used to obtain the status of the process. While the process is
2535
+ # running, a call to the URI in the Location header returns a status of 202.
2536
+ # When the process finishes, the URI in the Location header returns a status of
2537
+ # 204 on success. If the asynchronous request failed, the URI in the Location
2538
+ # header returns an error-level status code.
2539
+ #
2540
+ # @param deployment_name [String] The name of the deployment.
2541
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2542
+ # will be added to the HTTP request.
2543
+ #
2544
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2545
+ #
2546
+ def begin_delete_at_subscription_scope_with_http_info(deployment_name, custom_headers:nil)
2547
+ begin_delete_at_subscription_scope_async(deployment_name, custom_headers:custom_headers).value!
2548
+ end
2549
+
2550
+ #
2551
+ # Deletes a deployment from the deployment history.
2552
+ #
2553
+ # A template deployment that is currently running cannot be deleted. Deleting a
2554
+ # template deployment removes the associated deployment operations. This is an
2555
+ # asynchronous operation that returns a status of 202 until the template
2556
+ # deployment is successfully deleted. The Location response header contains the
2557
+ # URI that is used to obtain the status of the process. While the process is
2558
+ # running, a call to the URI in the Location header returns a status of 202.
2559
+ # When the process finishes, the URI in the Location header returns a status of
2560
+ # 204 on success. If the asynchronous request failed, the URI in the Location
2561
+ # header returns an error-level status code.
2562
+ #
2563
+ # @param deployment_name [String] The name of the deployment.
2564
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2565
+ # to the HTTP request.
2566
+ #
2567
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2568
+ #
2569
+ def begin_delete_at_subscription_scope_async(deployment_name, custom_headers:nil)
2570
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
2571
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
2572
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
2573
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
2574
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2575
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2576
+
2577
+
2578
+ request_headers = {}
2579
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2580
+
2581
+ # Set Headers
2582
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2583
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2584
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}'
2585
+
2586
+ request_url = @base_url || @client.base_url
2587
+
2588
+ options = {
2589
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2590
+ path_params: {'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
2591
+ query_params: {'api-version' => @client.api_version},
2592
+ headers: request_headers.merge(custom_headers || {}),
2593
+ base_url: request_url
2594
+ }
2595
+ promise = @client.make_request_async(:delete, path_template, options)
2596
+
2597
+ promise = promise.then do |result|
2598
+ http_response = result.response
2599
+ status_code = http_response.status
2600
+ response_content = http_response.body
2601
+ unless status_code == 202 || status_code == 204
2602
+ error_model = JSON.load(response_content)
2603
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2604
+ end
2605
+
2606
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2607
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2608
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2609
+
2610
+ result
2611
+ end
2612
+
2613
+ promise.execute
2614
+ end
2615
+
2616
+ #
2617
+ # Deploys resources at subscription scope.
2618
+ #
2619
+ # You can provide the template and parameters directly in the request or link
2620
+ # to JSON files.
2621
+ #
2622
+ # @param deployment_name [String] The name of the deployment.
2623
+ # @param parameters [Deployment] Additional parameters supplied to the
2624
+ # operation.
2625
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2626
+ # will be added to the HTTP request.
2627
+ #
2628
+ # @return [DeploymentExtended] operation results.
2629
+ #
2630
+ def begin_create_or_update_at_subscription_scope(deployment_name, parameters, custom_headers:nil)
2631
+ response = begin_create_or_update_at_subscription_scope_async(deployment_name, parameters, custom_headers:custom_headers).value!
2632
+ response.body unless response.nil?
2633
+ end
2634
+
2635
+ #
2636
+ # Deploys resources at subscription scope.
2637
+ #
2638
+ # You can provide the template and parameters directly in the request or link
2639
+ # to JSON files.
2640
+ #
2641
+ # @param deployment_name [String] The name of the deployment.
2642
+ # @param parameters [Deployment] Additional parameters supplied to the
2643
+ # operation.
2644
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2645
+ # will be added to the HTTP request.
2646
+ #
2647
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2648
+ #
2649
+ def begin_create_or_update_at_subscription_scope_with_http_info(deployment_name, parameters, custom_headers:nil)
2650
+ begin_create_or_update_at_subscription_scope_async(deployment_name, parameters, custom_headers:custom_headers).value!
2651
+ end
2652
+
2653
+ #
2654
+ # Deploys resources at subscription scope.
2655
+ #
2656
+ # You can provide the template and parameters directly in the request or link
2657
+ # to JSON files.
2658
+ #
2659
+ # @param deployment_name [String] The name of the deployment.
2660
+ # @param parameters [Deployment] Additional parameters supplied to the
2661
+ # operation.
2662
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2663
+ # to the HTTP request.
2664
+ #
2665
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2666
+ #
2667
+ def begin_create_or_update_at_subscription_scope_async(deployment_name, parameters, custom_headers:nil)
2668
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
2669
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
2670
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
2671
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
2672
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
2673
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2674
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2675
+
2676
+
2677
+ request_headers = {}
2678
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2679
+
2680
+ # Set Headers
2681
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2682
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2683
+
2684
+ # Serialize Request
2685
+ request_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::Deployment.mapper()
2686
+ request_content = @client.serialize(request_mapper, parameters)
2687
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2688
+
2689
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}'
2690
+
2691
+ request_url = @base_url || @client.base_url
2692
+
2693
+ options = {
2694
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2695
+ path_params: {'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
2696
+ query_params: {'api-version' => @client.api_version},
2697
+ body: request_content,
2698
+ headers: request_headers.merge(custom_headers || {}),
2699
+ base_url: request_url
2700
+ }
2701
+ promise = @client.make_request_async(:put, path_template, options)
2702
+
2703
+ promise = promise.then do |result|
2704
+ http_response = result.response
2705
+ status_code = http_response.status
2706
+ response_content = http_response.body
2707
+ unless status_code == 200 || status_code == 201
2708
+ error_model = JSON.load(response_content)
2709
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2710
+ end
2711
+
2712
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2713
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2714
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2715
+ # Deserialize Response
2716
+ if status_code == 200
2717
+ begin
2718
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2719
+ result_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::DeploymentExtended.mapper()
2720
+ result.body = @client.deserialize(result_mapper, parsed_response)
2721
+ rescue Exception => e
2722
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2723
+ end
2724
+ end
2725
+ # Deserialize Response
2726
+ if status_code == 201
2727
+ begin
2728
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2729
+ result_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::DeploymentExtended.mapper()
2730
+ result.body = @client.deserialize(result_mapper, parsed_response)
2731
+ rescue Exception => e
2732
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2733
+ end
2734
+ end
2735
+
2736
+ result
2737
+ end
2738
+
2739
+ promise.execute
2740
+ end
2741
+
2742
+ #
2743
+ # Deletes a deployment from the deployment history.
2744
+ #
2745
+ # A template deployment that is currently running cannot be deleted. Deleting a
2746
+ # template deployment removes the associated deployment operations. Deleting a
2747
+ # template deployment does not affect the state of the resource group. This is
2748
+ # an asynchronous operation that returns a status of 202 until the template
2749
+ # deployment is successfully deleted. The Location response header contains the
2750
+ # URI that is used to obtain the status of the process. While the process is
2751
+ # running, a call to the URI in the Location header returns a status of 202.
2752
+ # When the process finishes, the URI in the Location header returns a status of
2753
+ # 204 on success. If the asynchronous request failed, the URI in the Location
2754
+ # header returns an error-level status code.
2755
+ #
2756
+ # @param resource_group_name [String] The name of the resource group with the
2757
+ # deployment to delete. The name is case insensitive.
2758
+ # @param deployment_name [String] The name of the deployment.
2759
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2760
+ # will be added to the HTTP request.
2761
+ #
2762
+ #
2763
+ def begin_delete(resource_group_name, deployment_name, custom_headers:nil)
2764
+ response = begin_delete_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
2765
+ nil
2766
+ end
2767
+
2768
+ #
2769
+ # Deletes a deployment from the deployment history.
2770
+ #
2771
+ # A template deployment that is currently running cannot be deleted. Deleting a
2772
+ # template deployment removes the associated deployment operations. Deleting a
2773
+ # template deployment does not affect the state of the resource group. This is
2774
+ # an asynchronous operation that returns a status of 202 until the template
2775
+ # deployment is successfully deleted. The Location response header contains the
2776
+ # URI that is used to obtain the status of the process. While the process is
2777
+ # running, a call to the URI in the Location header returns a status of 202.
2778
+ # When the process finishes, the URI in the Location header returns a status of
2779
+ # 204 on success. If the asynchronous request failed, the URI in the Location
2780
+ # header returns an error-level status code.
2781
+ #
2782
+ # @param resource_group_name [String] The name of the resource group with the
2783
+ # deployment to delete. The name is case insensitive.
2784
+ # @param deployment_name [String] The name of the deployment.
2785
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2786
+ # will be added to the HTTP request.
2787
+ #
2788
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2789
+ #
2790
+ def begin_delete_with_http_info(resource_group_name, deployment_name, custom_headers:nil)
2791
+ begin_delete_async(resource_group_name, deployment_name, custom_headers:custom_headers).value!
2792
+ end
2793
+
2794
+ #
2795
+ # Deletes a deployment from the deployment history.
2796
+ #
2797
+ # A template deployment that is currently running cannot be deleted. Deleting a
2798
+ # template deployment removes the associated deployment operations. Deleting a
2799
+ # template deployment does not affect the state of the resource group. This is
2800
+ # an asynchronous operation that returns a status of 202 until the template
2801
+ # deployment is successfully deleted. The Location response header contains the
2802
+ # URI that is used to obtain the status of the process. While the process is
2803
+ # running, a call to the URI in the Location header returns a status of 202.
2804
+ # When the process finishes, the URI in the Location header returns a status of
2805
+ # 204 on success. If the asynchronous request failed, the URI in the Location
2806
+ # header returns an error-level status code.
2807
+ #
2808
+ # @param resource_group_name [String] The name of the resource group with the
2809
+ # deployment to delete. The name is case insensitive.
2810
+ # @param deployment_name [String] The name of the deployment.
2811
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2812
+ # to the HTTP request.
2813
+ #
2814
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2815
+ #
2816
+ def begin_delete_async(resource_group_name, deployment_name, custom_headers:nil)
2817
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2818
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
2819
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
2820
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
2821
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
2822
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
2823
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
2824
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
2825
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2826
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2827
+
2828
+
2829
+ request_headers = {}
2830
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2831
+
2832
+ # Set Headers
2833
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2834
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2835
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'
2836
+
2837
+ request_url = @base_url || @client.base_url
2838
+
2839
+ options = {
2840
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2841
+ path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
2842
+ query_params: {'api-version' => @client.api_version},
2843
+ headers: request_headers.merge(custom_headers || {}),
2844
+ base_url: request_url
2845
+ }
2846
+ promise = @client.make_request_async(:delete, path_template, options)
2847
+
2848
+ promise = promise.then do |result|
2849
+ http_response = result.response
2850
+ status_code = http_response.status
2851
+ response_content = http_response.body
2852
+ unless status_code == 202 || status_code == 204
2853
+ error_model = JSON.load(response_content)
2854
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2855
+ end
2856
+
2857
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2858
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2859
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2860
+
2861
+ result
2862
+ end
2863
+
2864
+ promise.execute
2865
+ end
2866
+
2867
+ #
2868
+ # Deploys resources to a resource group.
2869
+ #
2870
+ # You can provide the template and parameters directly in the request or link
2871
+ # to JSON files.
2872
+ #
2873
+ # @param resource_group_name [String] The name of the resource group to deploy
2874
+ # the resources to. The name is case insensitive. The resource group must
2875
+ # already exist.
2876
+ # @param deployment_name [String] The name of the deployment.
2877
+ # @param parameters [Deployment] Additional parameters supplied to the
2878
+ # operation.
2879
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2880
+ # will be added to the HTTP request.
2881
+ #
2882
+ # @return [DeploymentExtended] operation results.
2883
+ #
2884
+ def begin_create_or_update(resource_group_name, deployment_name, parameters, custom_headers:nil)
2885
+ response = begin_create_or_update_async(resource_group_name, deployment_name, parameters, custom_headers:custom_headers).value!
2886
+ response.body unless response.nil?
2887
+ end
2888
+
2889
+ #
2890
+ # Deploys resources to a resource group.
2891
+ #
2892
+ # You can provide the template and parameters directly in the request or link
2893
+ # to JSON files.
2894
+ #
2895
+ # @param resource_group_name [String] The name of the resource group to deploy
2896
+ # the resources to. The name is case insensitive. The resource group must
2897
+ # already exist.
2898
+ # @param deployment_name [String] The name of the deployment.
2899
+ # @param parameters [Deployment] Additional parameters supplied to the
2900
+ # operation.
2901
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2902
+ # will be added to the HTTP request.
2903
+ #
2904
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2905
+ #
2906
+ def begin_create_or_update_with_http_info(resource_group_name, deployment_name, parameters, custom_headers:nil)
2907
+ begin_create_or_update_async(resource_group_name, deployment_name, parameters, custom_headers:custom_headers).value!
2908
+ end
2909
+
2910
+ #
2911
+ # Deploys resources to a resource group.
2912
+ #
2913
+ # You can provide the template and parameters directly in the request or link
2914
+ # to JSON files.
2915
+ #
2916
+ # @param resource_group_name [String] The name of the resource group to deploy
2917
+ # the resources to. The name is case insensitive. The resource group must
2918
+ # already exist.
2919
+ # @param deployment_name [String] The name of the deployment.
2920
+ # @param parameters [Deployment] Additional parameters supplied to the
2921
+ # operation.
2922
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2923
+ # to the HTTP request.
2924
+ #
2925
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2926
+ #
2927
+ def begin_create_or_update_async(resource_group_name, deployment_name, parameters, custom_headers:nil)
2928
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2929
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
2930
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
2931
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
2932
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
2933
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MaxLength': '64'" if !deployment_name.nil? && deployment_name.length > 64
2934
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'MinLength': '1'" if !deployment_name.nil? && deployment_name.length < 1
2935
+ fail ArgumentError, "'deployment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !deployment_name.nil? && deployment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
2936
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
2937
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2938
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2939
+
2940
+
2941
+ request_headers = {}
2942
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2943
+
2944
+ # Set Headers
2945
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2946
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2947
+
2948
+ # Serialize Request
2949
+ request_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::Deployment.mapper()
2950
+ request_content = @client.serialize(request_mapper, parameters)
2951
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2952
+
2953
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'
2954
+
2955
+ request_url = @base_url || @client.base_url
2956
+
2957
+ options = {
2958
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2959
+ path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
2960
+ query_params: {'api-version' => @client.api_version},
2961
+ body: request_content,
2962
+ headers: request_headers.merge(custom_headers || {}),
2963
+ base_url: request_url
2964
+ }
2965
+ promise = @client.make_request_async(:put, path_template, options)
2966
+
2967
+ promise = promise.then do |result|
2968
+ http_response = result.response
2969
+ status_code = http_response.status
2970
+ response_content = http_response.body
2971
+ unless status_code == 200 || status_code == 201
2972
+ error_model = JSON.load(response_content)
2973
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2974
+ end
2975
+
2976
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2977
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2978
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2979
+ # Deserialize Response
2980
+ if status_code == 200
2981
+ begin
2982
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2983
+ result_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::DeploymentExtended.mapper()
2984
+ result.body = @client.deserialize(result_mapper, parsed_response)
2985
+ rescue Exception => e
2986
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2987
+ end
2988
+ end
2989
+ # Deserialize Response
2990
+ if status_code == 201
2991
+ begin
2992
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2993
+ result_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::DeploymentExtended.mapper()
2994
+ result.body = @client.deserialize(result_mapper, parsed_response)
2995
+ rescue Exception => e
2996
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2997
+ end
2998
+ end
2999
+
3000
+ result
3001
+ end
3002
+
3003
+ promise.execute
3004
+ end
3005
+
3006
+ #
3007
+ # Get all the deployments for a management group.
3008
+ #
3009
+ # @param next_page_link [String] The NextLink from the previous successful call
3010
+ # to List operation.
3011
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3012
+ # will be added to the HTTP request.
3013
+ #
3014
+ # @return [DeploymentListResult] operation results.
3015
+ #
3016
+ def list_at_management_group_scope_next(next_page_link, custom_headers:nil)
3017
+ response = list_at_management_group_scope_next_async(next_page_link, custom_headers:custom_headers).value!
3018
+ response.body unless response.nil?
3019
+ end
3020
+
3021
+ #
3022
+ # Get all the deployments for a management group.
3023
+ #
3024
+ # @param next_page_link [String] The NextLink from the previous successful call
3025
+ # to List operation.
3026
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3027
+ # will be added to the HTTP request.
3028
+ #
3029
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
3030
+ #
3031
+ def list_at_management_group_scope_next_with_http_info(next_page_link, custom_headers:nil)
3032
+ list_at_management_group_scope_next_async(next_page_link, custom_headers:custom_headers).value!
3033
+ end
3034
+
3035
+ #
3036
+ # Get all the deployments for a management group.
3037
+ #
3038
+ # @param next_page_link [String] The NextLink from the previous successful call
3039
+ # to List operation.
3040
+ # @param [Hash{String => String}] A hash of custom headers that will be added
3041
+ # to the HTTP request.
3042
+ #
3043
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
3044
+ #
3045
+ def list_at_management_group_scope_next_async(next_page_link, custom_headers:nil)
3046
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
3047
+
3048
+
3049
+ request_headers = {}
3050
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
3051
+
3052
+ # Set Headers
3053
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
3054
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
3055
+ path_template = '{nextLink}'
3056
+
3057
+ request_url = @base_url || @client.base_url
3058
+
3059
+ options = {
3060
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
3061
+ skip_encoding_path_params: {'nextLink' => next_page_link},
3062
+ headers: request_headers.merge(custom_headers || {}),
3063
+ base_url: request_url
3064
+ }
3065
+ promise = @client.make_request_async(:get, path_template, options)
3066
+
3067
+ promise = promise.then do |result|
3068
+ http_response = result.response
3069
+ status_code = http_response.status
3070
+ response_content = http_response.body
3071
+ unless status_code == 200
3072
+ error_model = JSON.load(response_content)
3073
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
3074
+ end
3075
+
3076
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
3077
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
3078
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
3079
+ # Deserialize Response
3080
+ if status_code == 200
3081
+ begin
3082
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3083
+ result_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::DeploymentListResult.mapper()
3084
+ result.body = @client.deserialize(result_mapper, parsed_response)
3085
+ rescue Exception => e
3086
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
3087
+ end
3088
+ end
3089
+
3090
+ result
3091
+ end
3092
+
3093
+ promise.execute
3094
+ end
3095
+
3096
+ #
3097
+ # Get all the deployments for a subscription.
3098
+ #
3099
+ # @param next_page_link [String] The NextLink from the previous successful call
3100
+ # to List operation.
3101
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3102
+ # will be added to the HTTP request.
3103
+ #
3104
+ # @return [DeploymentListResult] operation results.
3105
+ #
3106
+ def list_at_subscription_scope_next(next_page_link, custom_headers:nil)
3107
+ response = list_at_subscription_scope_next_async(next_page_link, custom_headers:custom_headers).value!
3108
+ response.body unless response.nil?
3109
+ end
3110
+
3111
+ #
3112
+ # Get all the deployments for a subscription.
3113
+ #
3114
+ # @param next_page_link [String] The NextLink from the previous successful call
3115
+ # to List operation.
3116
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3117
+ # will be added to the HTTP request.
3118
+ #
3119
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
3120
+ #
3121
+ def list_at_subscription_scope_next_with_http_info(next_page_link, custom_headers:nil)
3122
+ list_at_subscription_scope_next_async(next_page_link, custom_headers:custom_headers).value!
3123
+ end
3124
+
3125
+ #
3126
+ # Get all the deployments for a subscription.
3127
+ #
3128
+ # @param next_page_link [String] The NextLink from the previous successful call
3129
+ # to List operation.
3130
+ # @param [Hash{String => String}] A hash of custom headers that will be added
3131
+ # to the HTTP request.
3132
+ #
3133
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
3134
+ #
3135
+ def list_at_subscription_scope_next_async(next_page_link, custom_headers:nil)
3136
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
3137
+
3138
+
3139
+ request_headers = {}
3140
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
3141
+
3142
+ # Set Headers
3143
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
3144
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
3145
+ path_template = '{nextLink}'
3146
+
3147
+ request_url = @base_url || @client.base_url
3148
+
3149
+ options = {
3150
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
3151
+ skip_encoding_path_params: {'nextLink' => next_page_link},
3152
+ headers: request_headers.merge(custom_headers || {}),
3153
+ base_url: request_url
3154
+ }
3155
+ promise = @client.make_request_async(:get, path_template, options)
3156
+
3157
+ promise = promise.then do |result|
3158
+ http_response = result.response
3159
+ status_code = http_response.status
3160
+ response_content = http_response.body
3161
+ unless status_code == 200
3162
+ error_model = JSON.load(response_content)
3163
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
3164
+ end
3165
+
3166
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
3167
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
3168
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
3169
+ # Deserialize Response
3170
+ if status_code == 200
3171
+ begin
3172
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3173
+ result_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::DeploymentListResult.mapper()
3174
+ result.body = @client.deserialize(result_mapper, parsed_response)
3175
+ rescue Exception => e
3176
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
3177
+ end
3178
+ end
3179
+
3180
+ result
3181
+ end
3182
+
3183
+ promise.execute
3184
+ end
3185
+
3186
+ #
3187
+ # Get all the deployments for a resource group.
3188
+ #
3189
+ # @param next_page_link [String] The NextLink from the previous successful call
3190
+ # to List operation.
3191
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3192
+ # will be added to the HTTP request.
3193
+ #
3194
+ # @return [DeploymentListResult] operation results.
3195
+ #
3196
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
3197
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
3198
+ response.body unless response.nil?
3199
+ end
3200
+
3201
+ #
3202
+ # Get all the deployments for a resource group.
3203
+ #
3204
+ # @param next_page_link [String] The NextLink from the previous successful call
3205
+ # to List operation.
3206
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3207
+ # will be added to the HTTP request.
3208
+ #
3209
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
3210
+ #
3211
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
3212
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
3213
+ end
3214
+
3215
+ #
3216
+ # Get all the deployments for a resource group.
3217
+ #
3218
+ # @param next_page_link [String] The NextLink from the previous successful call
3219
+ # to List operation.
3220
+ # @param [Hash{String => String}] A hash of custom headers that will be added
3221
+ # to the HTTP request.
3222
+ #
3223
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
3224
+ #
3225
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
3226
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
3227
+
3228
+
3229
+ request_headers = {}
3230
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
3231
+
3232
+ # Set Headers
3233
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
3234
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
3235
+ path_template = '{nextLink}'
3236
+
3237
+ request_url = @base_url || @client.base_url
3238
+
3239
+ options = {
3240
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
3241
+ skip_encoding_path_params: {'nextLink' => next_page_link},
3242
+ headers: request_headers.merge(custom_headers || {}),
3243
+ base_url: request_url
3244
+ }
3245
+ promise = @client.make_request_async(:get, path_template, options)
3246
+
3247
+ promise = promise.then do |result|
3248
+ http_response = result.response
3249
+ status_code = http_response.status
3250
+ response_content = http_response.body
3251
+ unless status_code == 200
3252
+ error_model = JSON.load(response_content)
3253
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
3254
+ end
3255
+
3256
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
3257
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
3258
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
3259
+ # Deserialize Response
3260
+ if status_code == 200
3261
+ begin
3262
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3263
+ result_mapper = Azure::Resources::Mgmt::V2019_05_01::Models::DeploymentListResult.mapper()
3264
+ result.body = @client.deserialize(result_mapper, parsed_response)
3265
+ rescue Exception => e
3266
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
3267
+ end
3268
+ end
3269
+
3270
+ result
3271
+ end
3272
+
3273
+ promise.execute
3274
+ end
3275
+
3276
+ #
3277
+ # Get all the deployments for a management group.
3278
+ #
3279
+ # @param group_id [String] The management group ID.
3280
+ # @param filter [String] The filter to apply on the operation. For example, you
3281
+ # can use $filter=provisioningState eq '{state}'.
3282
+ # @param top [Integer] The number of results to get. If null is passed, returns
3283
+ # all deployments.
3284
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3285
+ # will be added to the HTTP request.
3286
+ #
3287
+ # @return [DeploymentListResult] which provide lazy access to pages of the
3288
+ # response.
3289
+ #
3290
+ def list_at_management_group_scope_as_lazy(group_id, filter:nil, top:nil, custom_headers:nil)
3291
+ response = list_at_management_group_scope_async(group_id, filter:filter, top:top, custom_headers:custom_headers).value!
3292
+ unless response.nil?
3293
+ page = response.body
3294
+ page.next_method = Proc.new do |next_page_link|
3295
+ list_at_management_group_scope_next_async(next_page_link, custom_headers:custom_headers)
3296
+ end
3297
+ page
3298
+ end
3299
+ end
3300
+
3301
+ #
3302
+ # Get all the deployments for a subscription.
3303
+ #
3304
+ # @param filter [String] The filter to apply on the operation. For example, you
3305
+ # can use $filter=provisioningState eq '{state}'.
3306
+ # @param top [Integer] The number of results to get. If null is passed, returns
3307
+ # all deployments.
3308
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3309
+ # will be added to the HTTP request.
3310
+ #
3311
+ # @return [DeploymentListResult] which provide lazy access to pages of the
3312
+ # response.
3313
+ #
3314
+ def list_at_subscription_scope_as_lazy(filter:nil, top:nil, custom_headers:nil)
3315
+ response = list_at_subscription_scope_async(filter:filter, top:top, custom_headers:custom_headers).value!
3316
+ unless response.nil?
3317
+ page = response.body
3318
+ page.next_method = Proc.new do |next_page_link|
3319
+ list_at_subscription_scope_next_async(next_page_link, custom_headers:custom_headers)
3320
+ end
3321
+ page
3322
+ end
3323
+ end
3324
+
3325
+ #
3326
+ # Get all the deployments for a resource group.
3327
+ #
3328
+ # @param resource_group_name [String] The name of the resource group with the
3329
+ # deployments to get. The name is case insensitive.
3330
+ # @param filter [String] The filter to apply on the operation. For example, you
3331
+ # can use $filter=provisioningState eq '{state}'.
3332
+ # @param top [Integer] The number of results to get. If null is passed, returns
3333
+ # all deployments.
3334
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3335
+ # will be added to the HTTP request.
3336
+ #
3337
+ # @return [DeploymentListResult] which provide lazy access to pages of the
3338
+ # response.
3339
+ #
3340
+ def list_by_resource_group_as_lazy(resource_group_name, filter:nil, top:nil, custom_headers:nil)
3341
+ response = list_by_resource_group_async(resource_group_name, filter:filter, top:top, custom_headers:custom_headers).value!
3342
+ unless response.nil?
3343
+ page = response.body
3344
+ page.next_method = Proc.new do |next_page_link|
3345
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
3346
+ end
3347
+ page
3348
+ end
3349
+ end
3350
+
3351
+ end
3352
+ end