azure_mgmt_resources 0.14.0 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (240) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -3
  3. data/lib/2016-02-01/generated/azure_mgmt_resources.rb +79 -0
  4. data/lib/2016-02-01/generated/azure_mgmt_resources/deployment_operations.rb +331 -0
  5. data/lib/2016-02-01/generated/azure_mgmt_resources/deployments.rb +1000 -0
  6. data/lib/2016-02-01/generated/azure_mgmt_resources/models/alias_path_type.rb +62 -0
  7. data/lib/2016-02-01/generated/azure_mgmt_resources/models/alias_type.rb +63 -0
  8. data/lib/{generated → 2016-02-01/generated}/azure_mgmt_resources/models/basic_dependency.rb +1 -1
  9. data/lib/2016-02-01/generated/azure_mgmt_resources/models/debug_setting.rb +45 -0
  10. data/lib/{generated → 2016-02-01/generated}/azure_mgmt_resources/models/dependency.rb +1 -1
  11. data/lib/2016-02-01/generated/azure_mgmt_resources/models/deployment.rb +45 -0
  12. data/lib/2016-02-01/generated/azure_mgmt_resources/models/deployment_export_result.rb +45 -0
  13. data/lib/{generated → 2016-02-01/generated}/azure_mgmt_resources/models/deployment_extended.rb +1 -1
  14. data/lib/{generated → 2016-02-01/generated}/azure_mgmt_resources/models/deployment_extended_filter.rb +1 -1
  15. data/lib/2016-02-01/generated/azure_mgmt_resources/models/deployment_list_result.rb +94 -0
  16. data/lib/{generated → 2016-02-01/generated}/azure_mgmt_resources/models/deployment_mode.rb +1 -1
  17. data/lib/2016-02-01/generated/azure_mgmt_resources/models/deployment_operation.rb +65 -0
  18. data/lib/2016-02-01/generated/azure_mgmt_resources/models/deployment_operation_properties.rb +117 -0
  19. data/lib/2016-02-01/generated/azure_mgmt_resources/models/deployment_operations_list_result.rb +94 -0
  20. data/lib/2016-02-01/generated/azure_mgmt_resources/models/deployment_properties.rb +103 -0
  21. data/lib/2016-02-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +179 -0
  22. data/lib/{generated → 2016-02-01/generated}/azure_mgmt_resources/models/deployment_validate_result.rb +1 -1
  23. data/lib/2016-02-01/generated/azure_mgmt_resources/models/export_template_request.rb +65 -0
  24. data/lib/2016-02-01/generated/azure_mgmt_resources/models/generic_resource.rb +142 -0
  25. data/lib/{generated → 2016-02-01/generated}/azure_mgmt_resources/models/generic_resource_filter.rb +1 -1
  26. data/lib/2016-02-01/generated/azure_mgmt_resources/models/http_message.rb +45 -0
  27. data/lib/2016-02-01/generated/azure_mgmt_resources/models/identity.rb +68 -0
  28. data/lib/2016-02-01/generated/azure_mgmt_resources/models/parameters_link.rb +55 -0
  29. data/lib/{generated → 2016-02-01/generated}/azure_mgmt_resources/models/plan.rb +1 -1
  30. data/lib/2016-02-01/generated/azure_mgmt_resources/models/provider.rb +83 -0
  31. data/lib/2016-02-01/generated/azure_mgmt_resources/models/provider_list_result.rb +94 -0
  32. data/lib/2016-02-01/generated/azure_mgmt_resources/models/provider_resource_type.rb +115 -0
  33. data/lib/2016-02-01/generated/azure_mgmt_resources/models/resource.rb +95 -0
  34. data/lib/2016-02-01/generated/azure_mgmt_resources/models/resource_group.rb +97 -0
  35. data/lib/2016-02-01/generated/azure_mgmt_resources/models/resource_group_export_result.rb +56 -0
  36. data/lib/{generated → 2016-02-01/generated}/azure_mgmt_resources/models/resource_group_filter.rb +1 -1
  37. data/lib/2016-02-01/generated/azure_mgmt_resources/models/resource_group_list_result.rb +94 -0
  38. data/lib/{generated → 2016-02-01/generated}/azure_mgmt_resources/models/resource_group_properties.rb +1 -1
  39. data/lib/{generated → 2016-02-01/generated}/azure_mgmt_resources/models/resource_identity_type.rb +1 -1
  40. data/lib/2016-02-01/generated/azure_mgmt_resources/models/resource_list_result.rb +94 -0
  41. data/lib/2016-02-01/generated/azure_mgmt_resources/models/resource_management_error_with_details.rb +83 -0
  42. data/lib/{generated → 2016-02-01/generated}/azure_mgmt_resources/models/resource_provider_operation_display_properties.rb +1 -1
  43. data/lib/2016-02-01/generated/azure_mgmt_resources/models/resources_move_info.rb +61 -0
  44. data/lib/2016-02-01/generated/azure_mgmt_resources/models/sku.rb +94 -0
  45. data/lib/2016-02-01/generated/azure_mgmt_resources/models/sub_resource.rb +45 -0
  46. data/lib/2016-02-01/generated/azure_mgmt_resources/models/tag_count.rb +54 -0
  47. data/lib/2016-02-01/generated/azure_mgmt_resources/models/tag_details.rb +83 -0
  48. data/lib/{generated → 2016-02-01/generated}/azure_mgmt_resources/models/tag_value.rb +1 -1
  49. data/lib/2016-02-01/generated/azure_mgmt_resources/models/tags_list_result.rb +94 -0
  50. data/lib/{generated → 2016-02-01/generated}/azure_mgmt_resources/models/target_resource.rb +1 -1
  51. data/lib/2016-02-01/generated/azure_mgmt_resources/models/template_link.rb +55 -0
  52. data/lib/2016-02-01/generated/azure_mgmt_resources/module_definition.rb +9 -0
  53. data/lib/2016-02-01/generated/azure_mgmt_resources/providers.rb +507 -0
  54. data/lib/2016-02-01/generated/azure_mgmt_resources/resource_groups.rb +1067 -0
  55. data/lib/2016-02-01/generated/azure_mgmt_resources/resource_management_client.rb +151 -0
  56. data/lib/2016-02-01/generated/azure_mgmt_resources/resources.rb +805 -0
  57. data/lib/2016-02-01/generated/azure_mgmt_resources/tags.rb +568 -0
  58. data/lib/{generated → 2016-02-01/generated}/azure_mgmt_resources/version.rb +2 -2
  59. data/lib/2016-07-01/generated/azure_mgmt_resources.rb +79 -0
  60. data/lib/2016-07-01/generated/azure_mgmt_resources/deployment_operations.rb +331 -0
  61. data/lib/2016-07-01/generated/azure_mgmt_resources/deployments.rb +1000 -0
  62. data/lib/2016-07-01/generated/azure_mgmt_resources/models/alias_path_type.rb +61 -0
  63. data/lib/{generated → 2016-07-01/generated}/azure_mgmt_resources/models/alias_type.rb +1 -1
  64. data/lib/2016-07-01/generated/azure_mgmt_resources/models/basic_dependency.rb +64 -0
  65. data/lib/2016-07-01/generated/azure_mgmt_resources/models/debug_setting.rb +45 -0
  66. data/lib/2016-07-01/generated/azure_mgmt_resources/models/dependency.rb +82 -0
  67. data/lib/2016-07-01/generated/azure_mgmt_resources/models/deployment.rb +45 -0
  68. data/lib/{generated → 2016-07-01/generated}/azure_mgmt_resources/models/deployment_export_result.rb +1 -1
  69. data/lib/2016-07-01/generated/azure_mgmt_resources/models/deployment_extended.rb +65 -0
  70. data/lib/2016-07-01/generated/azure_mgmt_resources/models/deployment_extended_filter.rb +44 -0
  71. data/lib/2016-07-01/generated/azure_mgmt_resources/models/deployment_list_result.rb +94 -0
  72. data/lib/2016-07-01/generated/azure_mgmt_resources/models/deployment_mode.rb +16 -0
  73. data/lib/2016-07-01/generated/azure_mgmt_resources/models/deployment_operation.rb +65 -0
  74. data/lib/2016-07-01/generated/azure_mgmt_resources/models/deployment_operation_properties.rb +117 -0
  75. data/lib/2016-07-01/generated/azure_mgmt_resources/models/deployment_operations_list_result.rb +94 -0
  76. data/lib/2016-07-01/generated/azure_mgmt_resources/models/deployment_properties.rb +103 -0
  77. data/lib/2016-07-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +179 -0
  78. data/lib/2016-07-01/generated/azure_mgmt_resources/models/deployment_validate_result.rb +57 -0
  79. data/lib/2016-07-01/generated/azure_mgmt_resources/models/export_template_request.rb +65 -0
  80. data/lib/2016-07-01/generated/azure_mgmt_resources/models/generic_resource.rb +142 -0
  81. data/lib/2016-07-01/generated/azure_mgmt_resources/models/generic_resource_filter.rb +64 -0
  82. data/lib/2016-07-01/generated/azure_mgmt_resources/models/http_message.rb +45 -0
  83. data/lib/2016-07-01/generated/azure_mgmt_resources/models/identity.rb +68 -0
  84. data/lib/2016-07-01/generated/azure_mgmt_resources/models/parameters_link.rb +55 -0
  85. data/lib/2016-07-01/generated/azure_mgmt_resources/models/plan.rb +74 -0
  86. data/lib/2016-07-01/generated/azure_mgmt_resources/models/provider.rb +83 -0
  87. data/lib/2016-07-01/generated/azure_mgmt_resources/models/provider_list_result.rb +94 -0
  88. data/lib/2016-07-01/generated/azure_mgmt_resources/models/provider_resource_type.rb +115 -0
  89. data/lib/2016-07-01/generated/azure_mgmt_resources/models/resource.rb +95 -0
  90. data/lib/2016-07-01/generated/azure_mgmt_resources/models/resource_group.rb +97 -0
  91. data/lib/2016-07-01/generated/azure_mgmt_resources/models/resource_group_export_result.rb +56 -0
  92. data/lib/2016-07-01/generated/azure_mgmt_resources/models/resource_group_filter.rb +54 -0
  93. data/lib/2016-07-01/generated/azure_mgmt_resources/models/resource_group_list_result.rb +94 -0
  94. data/lib/2016-07-01/generated/azure_mgmt_resources/models/resource_group_properties.rb +45 -0
  95. data/lib/2016-07-01/generated/azure_mgmt_resources/models/resource_identity_type.rb +15 -0
  96. data/lib/2016-07-01/generated/azure_mgmt_resources/models/resource_list_result.rb +94 -0
  97. data/lib/2016-07-01/generated/azure_mgmt_resources/models/resource_management_error_with_details.rb +83 -0
  98. data/lib/2016-07-01/generated/azure_mgmt_resources/models/resource_provider_operation_display_properties.rb +85 -0
  99. data/lib/2016-07-01/generated/azure_mgmt_resources/models/resources_move_info.rb +61 -0
  100. data/lib/2016-07-01/generated/azure_mgmt_resources/models/sku.rb +94 -0
  101. data/lib/2016-07-01/generated/azure_mgmt_resources/models/sub_resource.rb +45 -0
  102. data/lib/2016-07-01/generated/azure_mgmt_resources/models/tag_count.rb +54 -0
  103. data/lib/2016-07-01/generated/azure_mgmt_resources/models/tag_details.rb +83 -0
  104. data/lib/2016-07-01/generated/azure_mgmt_resources/models/tag_value.rb +65 -0
  105. data/lib/2016-07-01/generated/azure_mgmt_resources/models/tags_list_result.rb +94 -0
  106. data/lib/2016-07-01/generated/azure_mgmt_resources/models/target_resource.rb +64 -0
  107. data/lib/2016-07-01/generated/azure_mgmt_resources/models/template_link.rb +55 -0
  108. data/lib/2016-07-01/generated/azure_mgmt_resources/module_definition.rb +9 -0
  109. data/lib/2016-07-01/generated/azure_mgmt_resources/providers.rb +507 -0
  110. data/lib/2016-07-01/generated/azure_mgmt_resources/resource_groups.rb +1067 -0
  111. data/lib/2016-07-01/generated/azure_mgmt_resources/resource_management_client.rb +151 -0
  112. data/lib/2016-07-01/generated/azure_mgmt_resources/resources.rb +805 -0
  113. data/lib/2016-07-01/generated/azure_mgmt_resources/tags.rb +568 -0
  114. data/lib/{generated/azure_mgmt_resources/module_definition.rb → 2016-07-01/generated/azure_mgmt_resources/version.rb} +3 -3
  115. data/lib/2016-09-01/generated/azure_mgmt_resources.rb +79 -0
  116. data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/deployment_operations.rb +4 -4
  117. data/lib/2016-09-01/generated/azure_mgmt_resources/deployments.rb +1086 -0
  118. data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/alias_path_type.rb +1 -1
  119. data/lib/2016-09-01/generated/azure_mgmt_resources/models/alias_type.rb +62 -0
  120. data/lib/2016-09-01/generated/azure_mgmt_resources/models/basic_dependency.rb +64 -0
  121. data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/debug_setting.rb +1 -1
  122. data/lib/2016-09-01/generated/azure_mgmt_resources/models/dependency.rb +82 -0
  123. data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/deployment.rb +1 -1
  124. data/lib/2016-09-01/generated/azure_mgmt_resources/models/deployment_export_result.rb +44 -0
  125. data/lib/2016-09-01/generated/azure_mgmt_resources/models/deployment_extended.rb +65 -0
  126. data/lib/2016-09-01/generated/azure_mgmt_resources/models/deployment_extended_filter.rb +44 -0
  127. data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/deployment_list_result.rb +1 -1
  128. data/lib/2016-09-01/generated/azure_mgmt_resources/models/deployment_mode.rb +16 -0
  129. data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/deployment_operation.rb +1 -1
  130. data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/deployment_operation_properties.rb +1 -1
  131. data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/deployment_operations_list_result.rb +1 -1
  132. data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/deployment_properties.rb +1 -1
  133. data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/deployment_properties_extended.rb +1 -1
  134. data/lib/2016-09-01/generated/azure_mgmt_resources/models/deployment_validate_result.rb +57 -0
  135. data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/export_template_request.rb +1 -1
  136. data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/generic_resource.rb +1 -1
  137. data/lib/2016-09-01/generated/azure_mgmt_resources/models/generic_resource_filter.rb +64 -0
  138. data/lib/2016-09-01/generated/azure_mgmt_resources/models/http_message.rb +45 -0
  139. data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/identity.rb +1 -1
  140. data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/parameters_link.rb +1 -1
  141. data/lib/2016-09-01/generated/azure_mgmt_resources/models/plan.rb +74 -0
  142. data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/provider.rb +1 -1
  143. data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/provider_list_result.rb +1 -1
  144. data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/provider_resource_type.rb +1 -1
  145. data/lib/2016-09-01/generated/azure_mgmt_resources/models/resource.rb +95 -0
  146. data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/resource_group.rb +1 -1
  147. data/lib/2016-09-01/generated/azure_mgmt_resources/models/resource_group_export_result.rb +56 -0
  148. data/lib/2016-09-01/generated/azure_mgmt_resources/models/resource_group_filter.rb +54 -0
  149. data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/resource_group_list_result.rb +1 -1
  150. data/lib/2016-09-01/generated/azure_mgmt_resources/models/resource_group_properties.rb +45 -0
  151. data/lib/2016-09-01/generated/azure_mgmt_resources/models/resource_identity_type.rb +15 -0
  152. data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/resource_list_result.rb +1 -1
  153. data/lib/2016-09-01/generated/azure_mgmt_resources/models/resource_management_error_with_details.rb +87 -0
  154. data/lib/2016-09-01/generated/azure_mgmt_resources/models/resource_provider_operation_display_properties.rb +85 -0
  155. data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/resources_move_info.rb +1 -1
  156. data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/sku.rb +1 -1
  157. data/lib/2016-09-01/generated/azure_mgmt_resources/models/sub_resource.rb +45 -0
  158. data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/tag_count.rb +1 -1
  159. data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/tag_details.rb +1 -1
  160. data/lib/2016-09-01/generated/azure_mgmt_resources/models/tag_value.rb +65 -0
  161. data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/tags_list_result.rb +1 -1
  162. data/lib/2016-09-01/generated/azure_mgmt_resources/models/target_resource.rb +64 -0
  163. data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/template_link.rb +1 -1
  164. data/lib/2016-09-01/generated/azure_mgmt_resources/module_definition.rb +9 -0
  165. data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/providers.rb +6 -6
  166. data/lib/2016-09-01/generated/azure_mgmt_resources/resource_groups.rb +1086 -0
  167. data/lib/2016-09-01/generated/azure_mgmt_resources/resource_management_client.rb +149 -0
  168. data/lib/2016-09-01/generated/azure_mgmt_resources/resources.rb +1429 -0
  169. data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/tags.rb +7 -7
  170. data/lib/2016-09-01/generated/azure_mgmt_resources/version.rb +8 -0
  171. data/lib/2017-05-10/generated/azure_mgmt_resources.rb +80 -0
  172. data/lib/2017-05-10/generated/azure_mgmt_resources/deployment_operations.rb +335 -0
  173. data/lib/{generated → 2017-05-10/generated}/azure_mgmt_resources/deployments.rb +12 -12
  174. data/lib/2017-05-10/generated/azure_mgmt_resources/models/alias_path_type.rb +61 -0
  175. data/lib/2017-05-10/generated/azure_mgmt_resources/models/alias_type.rb +62 -0
  176. data/lib/2017-05-10/generated/azure_mgmt_resources/models/basic_dependency.rb +64 -0
  177. data/lib/2017-05-10/generated/azure_mgmt_resources/models/debug_setting.rb +52 -0
  178. data/lib/2017-05-10/generated/azure_mgmt_resources/models/dependency.rb +82 -0
  179. data/lib/2017-05-10/generated/azure_mgmt_resources/models/deployment.rb +45 -0
  180. data/lib/2017-05-10/generated/azure_mgmt_resources/models/deployment_export_result.rb +44 -0
  181. data/lib/2017-05-10/generated/azure_mgmt_resources/models/deployment_extended.rb +65 -0
  182. data/lib/2017-05-10/generated/azure_mgmt_resources/models/deployment_extended_filter.rb +44 -0
  183. data/lib/2017-05-10/generated/azure_mgmt_resources/models/deployment_list_result.rb +95 -0
  184. data/lib/2017-05-10/generated/azure_mgmt_resources/models/deployment_mode.rb +16 -0
  185. data/lib/2017-05-10/generated/azure_mgmt_resources/models/deployment_operation.rb +67 -0
  186. data/lib/2017-05-10/generated/azure_mgmt_resources/models/deployment_operation_properties.rb +125 -0
  187. data/lib/2017-05-10/generated/azure_mgmt_resources/models/deployment_operations_list_result.rb +95 -0
  188. data/lib/2017-05-10/generated/azure_mgmt_resources/models/deployment_properties.rb +117 -0
  189. data/lib/2017-05-10/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +183 -0
  190. data/lib/2017-05-10/generated/azure_mgmt_resources/models/deployment_validate_result.rb +57 -0
  191. data/lib/2017-05-10/generated/azure_mgmt_resources/models/export_template_request.rb +65 -0
  192. data/lib/2017-05-10/generated/azure_mgmt_resources/models/generic_resource.rb +145 -0
  193. data/lib/2017-05-10/generated/azure_mgmt_resources/models/generic_resource_filter.rb +64 -0
  194. data/lib/{generated → 2017-05-10/generated}/azure_mgmt_resources/models/http_message.rb +1 -1
  195. data/lib/2017-05-10/generated/azure_mgmt_resources/models/identity.rb +68 -0
  196. data/lib/2017-05-10/generated/azure_mgmt_resources/models/parameters_link.rb +55 -0
  197. data/lib/2017-05-10/generated/azure_mgmt_resources/models/plan.rb +74 -0
  198. data/lib/2017-05-10/generated/azure_mgmt_resources/models/provider.rb +86 -0
  199. data/lib/2017-05-10/generated/azure_mgmt_resources/models/provider_list_result.rb +95 -0
  200. data/lib/2017-05-10/generated/azure_mgmt_resources/models/provider_resource_type.rb +115 -0
  201. data/lib/{generated → 2017-05-10/generated}/azure_mgmt_resources/models/resource.rb +1 -1
  202. data/lib/2017-05-10/generated/azure_mgmt_resources/models/resource_group.rb +107 -0
  203. data/lib/{generated → 2017-05-10/generated}/azure_mgmt_resources/models/resource_group_export_result.rb +1 -1
  204. data/lib/2017-05-10/generated/azure_mgmt_resources/models/resource_group_filter.rb +54 -0
  205. data/lib/2017-05-10/generated/azure_mgmt_resources/models/resource_group_list_result.rb +95 -0
  206. data/lib/{generated → 2017-05-10/generated}/azure_mgmt_resources/models/resource_group_patchable.rb +1 -1
  207. data/lib/2017-05-10/generated/azure_mgmt_resources/models/resource_group_properties.rb +45 -0
  208. data/lib/2017-05-10/generated/azure_mgmt_resources/models/resource_identity_type.rb +15 -0
  209. data/lib/2017-05-10/generated/azure_mgmt_resources/models/resource_list_result.rb +95 -0
  210. data/lib/{generated → 2017-05-10/generated}/azure_mgmt_resources/models/resource_management_error_with_details.rb +1 -1
  211. data/lib/2017-05-10/generated/azure_mgmt_resources/models/resource_provider_operation_display_properties.rb +85 -0
  212. data/lib/2017-05-10/generated/azure_mgmt_resources/models/resources_move_info.rb +61 -0
  213. data/lib/2017-05-10/generated/azure_mgmt_resources/models/sku.rb +94 -0
  214. data/lib/{generated → 2017-05-10/generated}/azure_mgmt_resources/models/sub_resource.rb +1 -1
  215. data/lib/2017-05-10/generated/azure_mgmt_resources/models/tag_count.rb +54 -0
  216. data/lib/2017-05-10/generated/azure_mgmt_resources/models/tag_details.rb +85 -0
  217. data/lib/2017-05-10/generated/azure_mgmt_resources/models/tag_value.rb +65 -0
  218. data/lib/2017-05-10/generated/azure_mgmt_resources/models/tags_list_result.rb +95 -0
  219. data/lib/2017-05-10/generated/azure_mgmt_resources/models/target_resource.rb +64 -0
  220. data/lib/2017-05-10/generated/azure_mgmt_resources/models/template_link.rb +55 -0
  221. data/lib/2017-05-10/generated/azure_mgmt_resources/module_definition.rb +9 -0
  222. data/lib/2017-05-10/generated/azure_mgmt_resources/providers.rb +515 -0
  223. data/lib/{generated → 2017-05-10/generated}/azure_mgmt_resources/resource_groups.rb +11 -11
  224. data/lib/{generated → 2017-05-10/generated}/azure_mgmt_resources/resource_management_client.rb +3 -3
  225. data/lib/{generated → 2017-05-10/generated}/azure_mgmt_resources/resources.rb +17 -17
  226. data/lib/2017-05-10/generated/azure_mgmt_resources/tags.rb +593 -0
  227. data/lib/2017-05-10/generated/azure_mgmt_resources/version.rb +8 -0
  228. data/lib/azure_mgmt_resources.rb +6 -1
  229. data/lib/module_definition.rb +7 -0
  230. data/lib/profiles/common/configurable.rb +73 -0
  231. data/lib/profiles/common/default.rb +68 -0
  232. data/lib/profiles/latest/modules/resources_profile_module.rb +240 -0
  233. data/lib/profiles/latest/resources_latest_profile_client.rb +33 -0
  234. data/lib/profiles/latest/resources_module_definition.rb +9 -0
  235. data/lib/profiles/v2017_03_09/modules/resources_profile_module.rb +236 -0
  236. data/lib/profiles/v2017_03_09/resources_module_definition.rb +9 -0
  237. data/lib/profiles/v2017_03_09/resources_v2017_03_09_profile_client.rb +33 -0
  238. data/lib/version.rb +7 -0
  239. metadata +237 -59
  240. data/lib/generated/azure_mgmt_resources.rb +0 -80
@@ -3,6 +3,6 @@
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
6
- module Azure end
7
- module Azure::ARM end
8
- module Azure::ARM::Resources end
6
+ module Azure::Resources::Mgmt::V2016_07_01
7
+ VERSION = '0.15.0'
8
+ end
@@ -0,0 +1,79 @@
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
+ require 'uri'
7
+ require 'cgi'
8
+ require 'date'
9
+ require 'json'
10
+ require 'base64'
11
+ require 'erb'
12
+ require 'securerandom'
13
+ require 'time'
14
+ require 'timeliness'
15
+ require 'faraday'
16
+ require 'faraday-cookie_jar'
17
+ require 'concurrent'
18
+ require 'ms_rest'
19
+ require '2016-09-01/generated/azure_mgmt_resources/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::Resources::Mgmt::V2016_09_01
23
+ autoload :Deployments, '2016-09-01/generated/azure_mgmt_resources/deployments.rb'
24
+ autoload :Providers, '2016-09-01/generated/azure_mgmt_resources/providers.rb'
25
+ autoload :ResourceGroups, '2016-09-01/generated/azure_mgmt_resources/resource_groups.rb'
26
+ autoload :Resources, '2016-09-01/generated/azure_mgmt_resources/resources.rb'
27
+ autoload :Tags, '2016-09-01/generated/azure_mgmt_resources/tags.rb'
28
+ autoload :DeploymentOperations, '2016-09-01/generated/azure_mgmt_resources/deployment_operations.rb'
29
+ autoload :ResourceManagementClient, '2016-09-01/generated/azure_mgmt_resources/resource_management_client.rb'
30
+
31
+ module Models
32
+ autoload :Sku, '2016-09-01/generated/azure_mgmt_resources/models/sku.rb'
33
+ autoload :DeploymentExtendedFilter, '2016-09-01/generated/azure_mgmt_resources/models/deployment_extended_filter.rb'
34
+ autoload :Identity, '2016-09-01/generated/azure_mgmt_resources/models/identity.rb'
35
+ autoload :ResourceGroupFilter, '2016-09-01/generated/azure_mgmt_resources/models/resource_group_filter.rb'
36
+ autoload :TemplateLink, '2016-09-01/generated/azure_mgmt_resources/models/template_link.rb'
37
+ autoload :DebugSetting, '2016-09-01/generated/azure_mgmt_resources/models/debug_setting.rb'
38
+ autoload :ResourceListResult, '2016-09-01/generated/azure_mgmt_resources/models/resource_list_result.rb'
39
+ autoload :Deployment, '2016-09-01/generated/azure_mgmt_resources/models/deployment.rb'
40
+ autoload :ResourceGroupProperties, '2016-09-01/generated/azure_mgmt_resources/models/resource_group_properties.rb'
41
+ autoload :ResourceManagementErrorWithDetails, '2016-09-01/generated/azure_mgmt_resources/models/resource_management_error_with_details.rb'
42
+ autoload :ResourceGroup, '2016-09-01/generated/azure_mgmt_resources/models/resource_group.rb'
43
+ autoload :AliasType, '2016-09-01/generated/azure_mgmt_resources/models/alias_type.rb'
44
+ autoload :ResourceGroupListResult, '2016-09-01/generated/azure_mgmt_resources/models/resource_group_list_result.rb'
45
+ autoload :Provider, '2016-09-01/generated/azure_mgmt_resources/models/provider.rb'
46
+ autoload :ResourcesMoveInfo, '2016-09-01/generated/azure_mgmt_resources/models/resources_move_info.rb'
47
+ autoload :Dependency, '2016-09-01/generated/azure_mgmt_resources/models/dependency.rb'
48
+ autoload :ExportTemplateRequest, '2016-09-01/generated/azure_mgmt_resources/models/export_template_request.rb'
49
+ autoload :DeploymentValidateResult, '2016-09-01/generated/azure_mgmt_resources/models/deployment_validate_result.rb'
50
+ autoload :TagCount, '2016-09-01/generated/azure_mgmt_resources/models/tag_count.rb'
51
+ autoload :DeploymentListResult, '2016-09-01/generated/azure_mgmt_resources/models/deployment_list_result.rb'
52
+ autoload :TagValue, '2016-09-01/generated/azure_mgmt_resources/models/tag_value.rb'
53
+ autoload :Plan, '2016-09-01/generated/azure_mgmt_resources/models/plan.rb'
54
+ autoload :TagDetails, '2016-09-01/generated/azure_mgmt_resources/models/tag_details.rb'
55
+ autoload :ParametersLink, '2016-09-01/generated/azure_mgmt_resources/models/parameters_link.rb'
56
+ autoload :TagsListResult, '2016-09-01/generated/azure_mgmt_resources/models/tags_list_result.rb'
57
+ autoload :DeploymentExportResult, '2016-09-01/generated/azure_mgmt_resources/models/deployment_export_result.rb'
58
+ autoload :TargetResource, '2016-09-01/generated/azure_mgmt_resources/models/target_resource.rb'
59
+ autoload :ProviderResourceType, '2016-09-01/generated/azure_mgmt_resources/models/provider_resource_type.rb'
60
+ autoload :HttpMessage, '2016-09-01/generated/azure_mgmt_resources/models/http_message.rb'
61
+ autoload :DeploymentPropertiesExtended, '2016-09-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb'
62
+ autoload :DeploymentOperationProperties, '2016-09-01/generated/azure_mgmt_resources/models/deployment_operation_properties.rb'
63
+ autoload :ProviderListResult, '2016-09-01/generated/azure_mgmt_resources/models/provider_list_result.rb'
64
+ autoload :DeploymentOperation, '2016-09-01/generated/azure_mgmt_resources/models/deployment_operation.rb'
65
+ autoload :DeploymentProperties, '2016-09-01/generated/azure_mgmt_resources/models/deployment_properties.rb'
66
+ autoload :DeploymentOperationsListResult, '2016-09-01/generated/azure_mgmt_resources/models/deployment_operations_list_result.rb'
67
+ autoload :BasicDependency, '2016-09-01/generated/azure_mgmt_resources/models/basic_dependency.rb'
68
+ autoload :ResourceProviderOperationDisplayProperties, '2016-09-01/generated/azure_mgmt_resources/models/resource_provider_operation_display_properties.rb'
69
+ autoload :GenericResourceFilter, '2016-09-01/generated/azure_mgmt_resources/models/generic_resource_filter.rb'
70
+ autoload :Resource, '2016-09-01/generated/azure_mgmt_resources/models/resource.rb'
71
+ autoload :DeploymentExtended, '2016-09-01/generated/azure_mgmt_resources/models/deployment_extended.rb'
72
+ autoload :SubResource, '2016-09-01/generated/azure_mgmt_resources/models/sub_resource.rb'
73
+ autoload :AliasPathType, '2016-09-01/generated/azure_mgmt_resources/models/alias_path_type.rb'
74
+ autoload :ResourceGroupExportResult, '2016-09-01/generated/azure_mgmt_resources/models/resource_group_export_result.rb'
75
+ autoload :GenericResource, '2016-09-01/generated/azure_mgmt_resources/models/generic_resource.rb'
76
+ autoload :DeploymentMode, '2016-09-01/generated/azure_mgmt_resources/models/deployment_mode.rb'
77
+ autoload :ResourceIdentityType, '2016-09-01/generated/azure_mgmt_resources/models/resource_identity_type.rb'
78
+ end
79
+ end
@@ -3,7 +3,7 @@
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
6
- module Azure::ARM::Resources
6
+ module Azure::Resources::Mgmt::V2016_09_01
7
7
  #
8
8
  # Provides operations for working with resources and resource groups.
9
9
  #
@@ -106,7 +106,7 @@ module Azure::ARM::Resources
106
106
  if status_code == 200
107
107
  begin
108
108
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
109
- result_mapper = Azure::ARM::Resources::Models::DeploymentOperation.mapper()
109
+ result_mapper = Azure::Resources::Mgmt::V2016_09_01::Models::DeploymentOperation.mapper()
110
110
  result.body = @client.deserialize(result_mapper, parsed_response)
111
111
  rescue Exception => e
112
112
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -206,7 +206,7 @@ module Azure::ARM::Resources
206
206
  if status_code == 200
207
207
  begin
208
208
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
209
- result_mapper = Azure::ARM::Resources::Models::DeploymentOperationsListResult.mapper()
209
+ result_mapper = Azure::Resources::Mgmt::V2016_09_01::Models::DeploymentOperationsListResult.mapper()
210
210
  result.body = @client.deserialize(result_mapper, parsed_response)
211
211
  rescue Exception => e
212
212
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -293,7 +293,7 @@ module Azure::ARM::Resources
293
293
  if status_code == 200
294
294
  begin
295
295
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
296
- result_mapper = Azure::ARM::Resources::Models::DeploymentOperationsListResult.mapper()
296
+ result_mapper = Azure::Resources::Mgmt::V2016_09_01::Models::DeploymentOperationsListResult.mapper()
297
297
  result.body = @client.deserialize(result_mapper, parsed_response)
298
298
  rescue Exception => e
299
299
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -0,0 +1,1086 @@
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::V2016_09_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. Deleting a
29
+ # template deployment does not affect the state of the resource group. This is
30
+ # an asynchronous operation that returns a status of 202 until the template
31
+ # deployment is successfully deleted. The Location response header contains the
32
+ # URI that is used to obtain the status of the process. While the process is
33
+ # running, a call to the URI in the Location header returns a status of 202.
34
+ # When the process finishes, the URI in the Location header returns a status of
35
+ # 204 on success. If the asynchronous request failed, the URI in the Location
36
+ # header returns an error-level status code.
37
+ #
38
+ # @param resource_group_name [String] The name of the resource group with the
39
+ # deployment to delete. The name is case insensitive.
40
+ # @param deployment_name [String] The name of the deployment to delete.
41
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
42
+ # will be added to the HTTP request.
43
+ #
44
+ def delete(resource_group_name, deployment_name, custom_headers = nil)
45
+ response = delete_async(resource_group_name, deployment_name, custom_headers).value!
46
+ nil
47
+ end
48
+
49
+ #
50
+ # @param resource_group_name [String] The name of the resource group with the
51
+ # deployment to delete. The name is case insensitive.
52
+ # @param deployment_name [String] The name of the deployment to delete.
53
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
54
+ # will be added to the HTTP request.
55
+ #
56
+ # @return [Concurrent::Promise] promise which provides async access to http
57
+ # response.
58
+ #
59
+ def delete_async(resource_group_name, deployment_name, custom_headers = nil)
60
+ # Send request
61
+ promise = begin_delete_async(resource_group_name, deployment_name, custom_headers)
62
+
63
+ promise = promise.then do |response|
64
+ # Defining deserialization method.
65
+ deserialize_method = lambda do |parsed_response|
66
+ end
67
+
68
+ # Waiting for response.
69
+ @client.get_long_running_operation_result(response, deserialize_method)
70
+ end
71
+
72
+ promise
73
+ end
74
+
75
+ #
76
+ # Checks whether the deployment exists.
77
+ #
78
+ # @param resource_group_name [String] The name of the resource group with the
79
+ # deployment to check. The name is case insensitive.
80
+ # @param deployment_name [String] The name of the deployment to check.
81
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
82
+ # will be added to the HTTP request.
83
+ #
84
+ # @return [Boolean] operation results.
85
+ #
86
+ def check_existence(resource_group_name, deployment_name, custom_headers = nil)
87
+ response = check_existence_async(resource_group_name, deployment_name, custom_headers).value!
88
+ response.body unless response.nil?
89
+ end
90
+
91
+ #
92
+ # Checks whether the deployment exists.
93
+ #
94
+ # @param resource_group_name [String] The name of the resource group with the
95
+ # deployment to check. The name is case insensitive.
96
+ # @param deployment_name [String] The name of the deployment to check.
97
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
98
+ # will be added to the HTTP request.
99
+ #
100
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
101
+ #
102
+ def check_existence_with_http_info(resource_group_name, deployment_name, custom_headers = nil)
103
+ check_existence_async(resource_group_name, deployment_name, custom_headers).value!
104
+ end
105
+
106
+ #
107
+ # Checks whether the deployment exists.
108
+ #
109
+ # @param resource_group_name [String] The name of the resource group with the
110
+ # deployment to check. The name is case insensitive.
111
+ # @param deployment_name [String] The name of the deployment to check.
112
+ # @param [Hash{String => String}] A hash of custom headers that will be added
113
+ # to the HTTP request.
114
+ #
115
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
116
+ #
117
+ def check_existence_async(resource_group_name, deployment_name, custom_headers = nil)
118
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
119
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
120
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
121
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
122
+
123
+
124
+ request_headers = {}
125
+
126
+ # Set Headers
127
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
128
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
129
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'
130
+
131
+ request_url = @base_url || @client.base_url
132
+
133
+ options = {
134
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
135
+ path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
136
+ query_params: {'api-version' => @client.api_version},
137
+ headers: request_headers.merge(custom_headers || {}),
138
+ base_url: request_url
139
+ }
140
+ promise = @client.make_request_async(:head, path_template, options)
141
+
142
+ promise = promise.then do |result|
143
+ http_response = result.response
144
+ status_code = http_response.status
145
+ response_content = http_response.body
146
+ unless status_code == 204 || status_code == 404
147
+ error_model = JSON.load(response_content)
148
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
149
+ end
150
+
151
+ result.body = (status_code == 204)
152
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
153
+
154
+ result
155
+ end
156
+
157
+ promise.execute
158
+ end
159
+
160
+ #
161
+ # Deploys resources to a resource group.
162
+ #
163
+ # You can provide the template and parameters directly in the request or link
164
+ # to JSON files.
165
+ #
166
+ # @param resource_group_name [String] The name of the resource group to deploy
167
+ # the resources to. The name is case insensitive. The resource group must
168
+ # already exist.
169
+ # @param deployment_name [String] The name of the deployment.
170
+ # @param parameters [Deployment] Additional parameters supplied to the
171
+ # operation.
172
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
173
+ # will be added to the HTTP request.
174
+ #
175
+ # @return [DeploymentExtended] operation results.
176
+ #
177
+ def create_or_update(resource_group_name, deployment_name, parameters, custom_headers = nil)
178
+ response = create_or_update_async(resource_group_name, deployment_name, parameters, custom_headers).value!
179
+ response.body unless response.nil?
180
+ end
181
+
182
+ #
183
+ # @param resource_group_name [String] The name of the resource group to deploy
184
+ # the resources to. The name is case insensitive. The resource group must
185
+ # already exist.
186
+ # @param deployment_name [String] The name of the deployment.
187
+ # @param parameters [Deployment] Additional parameters supplied to the
188
+ # operation.
189
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
190
+ # will be added to the HTTP request.
191
+ #
192
+ # @return [Concurrent::Promise] promise which provides async access to http
193
+ # response.
194
+ #
195
+ def create_or_update_async(resource_group_name, deployment_name, parameters, custom_headers = nil)
196
+ # Send request
197
+ promise = begin_create_or_update_async(resource_group_name, deployment_name, parameters, custom_headers)
198
+
199
+ promise = promise.then do |response|
200
+ # Defining deserialization method.
201
+ deserialize_method = lambda do |parsed_response|
202
+ result_mapper = Azure::Resources::Mgmt::V2016_09_01::Models::DeploymentExtended.mapper()
203
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
204
+ end
205
+
206
+ # Waiting for response.
207
+ @client.get_long_running_operation_result(response, deserialize_method)
208
+ end
209
+
210
+ promise
211
+ end
212
+
213
+ #
214
+ # Gets a deployment.
215
+ #
216
+ # @param resource_group_name [String] The name of the resource group. The name
217
+ # is case insensitive.
218
+ # @param deployment_name [String] The name of the deployment to get.
219
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
220
+ # will be added to the HTTP request.
221
+ #
222
+ # @return [DeploymentExtended] operation results.
223
+ #
224
+ def get(resource_group_name, deployment_name, custom_headers = nil)
225
+ response = get_async(resource_group_name, deployment_name, custom_headers).value!
226
+ response.body unless response.nil?
227
+ end
228
+
229
+ #
230
+ # Gets a deployment.
231
+ #
232
+ # @param resource_group_name [String] The name of the resource group. The name
233
+ # is case insensitive.
234
+ # @param deployment_name [String] The name of the deployment to get.
235
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
236
+ # will be added to the HTTP request.
237
+ #
238
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
239
+ #
240
+ def get_with_http_info(resource_group_name, deployment_name, custom_headers = nil)
241
+ get_async(resource_group_name, deployment_name, custom_headers).value!
242
+ end
243
+
244
+ #
245
+ # Gets a deployment.
246
+ #
247
+ # @param resource_group_name [String] The name of the resource group. The name
248
+ # is case insensitive.
249
+ # @param deployment_name [String] The name of the deployment to get.
250
+ # @param [Hash{String => String}] A hash of custom headers that will be added
251
+ # to the HTTP request.
252
+ #
253
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
254
+ #
255
+ def get_async(resource_group_name, deployment_name, custom_headers = nil)
256
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
257
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
258
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
259
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
260
+
261
+
262
+ request_headers = {}
263
+
264
+ # Set Headers
265
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
266
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
267
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'
268
+
269
+ request_url = @base_url || @client.base_url
270
+
271
+ options = {
272
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
273
+ path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
274
+ query_params: {'api-version' => @client.api_version},
275
+ headers: request_headers.merge(custom_headers || {}),
276
+ base_url: request_url
277
+ }
278
+ promise = @client.make_request_async(:get, path_template, options)
279
+
280
+ promise = promise.then do |result|
281
+ http_response = result.response
282
+ status_code = http_response.status
283
+ response_content = http_response.body
284
+ unless status_code == 200
285
+ error_model = JSON.load(response_content)
286
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
287
+ end
288
+
289
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
290
+ # Deserialize Response
291
+ if status_code == 200
292
+ begin
293
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
294
+ result_mapper = Azure::Resources::Mgmt::V2016_09_01::Models::DeploymentExtended.mapper()
295
+ result.body = @client.deserialize(result_mapper, parsed_response)
296
+ rescue Exception => e
297
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
298
+ end
299
+ end
300
+
301
+ result
302
+ end
303
+
304
+ promise.execute
305
+ end
306
+
307
+ #
308
+ # Cancels a currently running template deployment.
309
+ #
310
+ # You can cancel a deployment only if the provisioningState is Accepted or
311
+ # Running. After the deployment is canceled, the provisioningState is set to
312
+ # Canceled. Canceling a template deployment stops the currently running
313
+ # template deployment and leaves the resource group partially deployed.
314
+ #
315
+ # @param resource_group_name [String] The name of the resource group. The name
316
+ # is case insensitive.
317
+ # @param deployment_name [String] The name of the deployment to cancel.
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(resource_group_name, deployment_name, custom_headers = nil)
323
+ response = cancel_async(resource_group_name, deployment_name, 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 resource group partially deployed.
334
+ #
335
+ # @param resource_group_name [String] The name of the resource group. The name
336
+ # is case insensitive.
337
+ # @param deployment_name [String] The name of the deployment to cancel.
338
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
339
+ # will be added to the HTTP request.
340
+ #
341
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
342
+ #
343
+ def cancel_with_http_info(resource_group_name, deployment_name, custom_headers = nil)
344
+ cancel_async(resource_group_name, deployment_name, custom_headers).value!
345
+ end
346
+
347
+ #
348
+ # Cancels a currently running template deployment.
349
+ #
350
+ # You can cancel a deployment only if the provisioningState is Accepted or
351
+ # Running. After the deployment is canceled, the provisioningState is set to
352
+ # Canceled. Canceling a template deployment stops the currently running
353
+ # template deployment and leaves the resource group partially deployed.
354
+ #
355
+ # @param resource_group_name [String] The name of the resource group. The name
356
+ # is case insensitive.
357
+ # @param deployment_name [String] The name of the deployment to cancel.
358
+ # @param [Hash{String => String}] A hash of custom headers that will be added
359
+ # to the HTTP request.
360
+ #
361
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
362
+ #
363
+ def cancel_async(resource_group_name, deployment_name, custom_headers = nil)
364
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
365
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
366
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
367
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
368
+
369
+
370
+ request_headers = {}
371
+
372
+ # Set Headers
373
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
374
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
375
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel'
376
+
377
+ request_url = @base_url || @client.base_url
378
+
379
+ options = {
380
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
381
+ path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
382
+ query_params: {'api-version' => @client.api_version},
383
+ headers: request_headers.merge(custom_headers || {}),
384
+ base_url: request_url
385
+ }
386
+ promise = @client.make_request_async(:post, path_template, options)
387
+
388
+ promise = promise.then do |result|
389
+ http_response = result.response
390
+ status_code = http_response.status
391
+ response_content = http_response.body
392
+ unless status_code == 204
393
+ error_model = JSON.load(response_content)
394
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
395
+ end
396
+
397
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
398
+
399
+ result
400
+ end
401
+
402
+ promise.execute
403
+ end
404
+
405
+ #
406
+ # Validates whether the specified template is syntactically correct and will be
407
+ # accepted by Azure Resource Manager..
408
+ #
409
+ # @param resource_group_name [String] The name of the resource group the
410
+ # template will be deployed to. The name is case insensitive.
411
+ # @param deployment_name [String] The name of the deployment.
412
+ # @param parameters [Deployment] Parameters to validate.
413
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
414
+ # will be added to the HTTP request.
415
+ #
416
+ # @return [DeploymentValidateResult] operation results.
417
+ #
418
+ def validate(resource_group_name, deployment_name, parameters, custom_headers = nil)
419
+ response = validate_async(resource_group_name, deployment_name, parameters, custom_headers).value!
420
+ response.body unless response.nil?
421
+ end
422
+
423
+ #
424
+ # Validates whether the specified template is syntactically correct and will be
425
+ # accepted by Azure Resource Manager..
426
+ #
427
+ # @param resource_group_name [String] The name of the resource group the
428
+ # template will be deployed to. The name is case insensitive.
429
+ # @param deployment_name [String] The name of the deployment.
430
+ # @param parameters [Deployment] Parameters to validate.
431
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
432
+ # will be added to the HTTP request.
433
+ #
434
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
435
+ #
436
+ def validate_with_http_info(resource_group_name, deployment_name, parameters, custom_headers = nil)
437
+ validate_async(resource_group_name, deployment_name, parameters, custom_headers).value!
438
+ end
439
+
440
+ #
441
+ # Validates whether the specified template is syntactically correct and will be
442
+ # accepted by Azure Resource Manager..
443
+ #
444
+ # @param resource_group_name [String] The name of the resource group the
445
+ # template will be deployed to. The name is case insensitive.
446
+ # @param deployment_name [String] The name of the deployment.
447
+ # @param parameters [Deployment] Parameters to validate.
448
+ # @param [Hash{String => String}] A hash of custom headers that will be added
449
+ # to the HTTP request.
450
+ #
451
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
452
+ #
453
+ def validate_async(resource_group_name, deployment_name, parameters, custom_headers = nil)
454
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
455
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
456
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
457
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
458
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
459
+
460
+
461
+ request_headers = {}
462
+
463
+ # Set Headers
464
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
465
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
466
+
467
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
468
+
469
+ # Serialize Request
470
+ request_mapper = Azure::Resources::Mgmt::V2016_09_01::Models::Deployment.mapper()
471
+ request_content = @client.serialize(request_mapper, parameters)
472
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
473
+
474
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/validate'
475
+
476
+ request_url = @base_url || @client.base_url
477
+
478
+ options = {
479
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
480
+ path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
481
+ query_params: {'api-version' => @client.api_version},
482
+ body: request_content,
483
+ headers: request_headers.merge(custom_headers || {}),
484
+ base_url: request_url
485
+ }
486
+ promise = @client.make_request_async(:post, path_template, options)
487
+
488
+ promise = promise.then do |result|
489
+ http_response = result.response
490
+ status_code = http_response.status
491
+ response_content = http_response.body
492
+ unless status_code == 200 || status_code == 400
493
+ error_model = JSON.load(response_content)
494
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
495
+ end
496
+
497
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
498
+ # Deserialize Response
499
+ if status_code == 200
500
+ begin
501
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
502
+ result_mapper = Azure::Resources::Mgmt::V2016_09_01::Models::DeploymentValidateResult.mapper()
503
+ result.body = @client.deserialize(result_mapper, parsed_response)
504
+ rescue Exception => e
505
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
506
+ end
507
+ end
508
+ # Deserialize Response
509
+ if status_code == 400
510
+ begin
511
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
512
+ result_mapper = Azure::Resources::Mgmt::V2016_09_01::Models::DeploymentValidateResult.mapper()
513
+ result.body = @client.deserialize(result_mapper, parsed_response)
514
+ rescue Exception => e
515
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
516
+ end
517
+ end
518
+
519
+ result
520
+ end
521
+
522
+ promise.execute
523
+ end
524
+
525
+ #
526
+ # Exports the template used for specified deployment.
527
+ #
528
+ # @param resource_group_name [String] The name of the resource group. The name
529
+ # is case insensitive.
530
+ # @param deployment_name [String] The name of the deployment from which to get
531
+ # the template.
532
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
533
+ # will be added to the HTTP request.
534
+ #
535
+ # @return [DeploymentExportResult] operation results.
536
+ #
537
+ def export_template(resource_group_name, deployment_name, custom_headers = nil)
538
+ response = export_template_async(resource_group_name, deployment_name, custom_headers).value!
539
+ response.body unless response.nil?
540
+ end
541
+
542
+ #
543
+ # Exports the template used for specified deployment.
544
+ #
545
+ # @param resource_group_name [String] The name of the resource group. The name
546
+ # is case insensitive.
547
+ # @param deployment_name [String] The name of the deployment from which to get
548
+ # the template.
549
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
550
+ # will be added to the HTTP request.
551
+ #
552
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
553
+ #
554
+ def export_template_with_http_info(resource_group_name, deployment_name, custom_headers = nil)
555
+ export_template_async(resource_group_name, deployment_name, custom_headers).value!
556
+ end
557
+
558
+ #
559
+ # Exports the template used for specified deployment.
560
+ #
561
+ # @param resource_group_name [String] The name of the resource group. The name
562
+ # is case insensitive.
563
+ # @param deployment_name [String] The name of the deployment from which to get
564
+ # the template.
565
+ # @param [Hash{String => String}] A hash of custom headers that will be added
566
+ # to the HTTP request.
567
+ #
568
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
569
+ #
570
+ def export_template_async(resource_group_name, deployment_name, custom_headers = nil)
571
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
572
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
573
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
574
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
575
+
576
+
577
+ request_headers = {}
578
+
579
+ # Set Headers
580
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
581
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
582
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate'
583
+
584
+ request_url = @base_url || @client.base_url
585
+
586
+ options = {
587
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
588
+ path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
589
+ query_params: {'api-version' => @client.api_version},
590
+ headers: request_headers.merge(custom_headers || {}),
591
+ base_url: request_url
592
+ }
593
+ promise = @client.make_request_async(:post, path_template, options)
594
+
595
+ promise = promise.then do |result|
596
+ http_response = result.response
597
+ status_code = http_response.status
598
+ response_content = http_response.body
599
+ unless status_code == 200
600
+ error_model = JSON.load(response_content)
601
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
602
+ end
603
+
604
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
605
+ # Deserialize Response
606
+ if status_code == 200
607
+ begin
608
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
609
+ result_mapper = Azure::Resources::Mgmt::V2016_09_01::Models::DeploymentExportResult.mapper()
610
+ result.body = @client.deserialize(result_mapper, parsed_response)
611
+ rescue Exception => e
612
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
613
+ end
614
+ end
615
+
616
+ result
617
+ end
618
+
619
+ promise.execute
620
+ end
621
+
622
+ #
623
+ # Get all the deployments for a resource group.
624
+ #
625
+ # @param resource_group_name [String] The name of the resource group with the
626
+ # deployments to get. The name is case insensitive.
627
+ # @param filter [String] The filter to apply on the operation. For example, you
628
+ # can use $filter=provisioningState eq '{state}'.
629
+ # @param top [Integer] The number of results to get. If null is passed, returns
630
+ # all deployments.
631
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
632
+ # will be added to the HTTP request.
633
+ #
634
+ # @return [Array<DeploymentExtended>] operation results.
635
+ #
636
+ def list(resource_group_name, filter = nil, top = nil, custom_headers = nil)
637
+ first_page = list_as_lazy(resource_group_name, filter, top, custom_headers)
638
+ first_page.get_all_items
639
+ end
640
+
641
+ #
642
+ # Get all the deployments for a resource group.
643
+ #
644
+ # @param resource_group_name [String] The name of the resource group with the
645
+ # deployments to get. The name is case insensitive.
646
+ # @param filter [String] The filter to apply on the operation. For example, you
647
+ # can use $filter=provisioningState eq '{state}'.
648
+ # @param top [Integer] The number of results to get. If null is passed, returns
649
+ # all deployments.
650
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
651
+ # will be added to the HTTP request.
652
+ #
653
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
654
+ #
655
+ def list_with_http_info(resource_group_name, filter = nil, top = nil, custom_headers = nil)
656
+ list_async(resource_group_name, filter, top, custom_headers).value!
657
+ end
658
+
659
+ #
660
+ # Get all the deployments for a resource group.
661
+ #
662
+ # @param resource_group_name [String] The name of the resource group with the
663
+ # deployments to get. The name is case insensitive.
664
+ # @param filter [String] The filter to apply on the operation. For example, you
665
+ # can use $filter=provisioningState eq '{state}'.
666
+ # @param top [Integer] The number of results to get. If null is passed, returns
667
+ # all deployments.
668
+ # @param [Hash{String => String}] A hash of custom headers that will be added
669
+ # to the HTTP request.
670
+ #
671
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
672
+ #
673
+ def list_async(resource_group_name, filter = nil, top = nil, custom_headers = nil)
674
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
675
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
676
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
677
+
678
+
679
+ request_headers = {}
680
+
681
+ # Set Headers
682
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
683
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
684
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/'
685
+
686
+ request_url = @base_url || @client.base_url
687
+
688
+ options = {
689
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
690
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
691
+ query_params: {'$filter' => filter,'$top' => top,'api-version' => @client.api_version},
692
+ headers: request_headers.merge(custom_headers || {}),
693
+ base_url: request_url
694
+ }
695
+ promise = @client.make_request_async(:get, path_template, options)
696
+
697
+ promise = promise.then do |result|
698
+ http_response = result.response
699
+ status_code = http_response.status
700
+ response_content = http_response.body
701
+ unless status_code == 200
702
+ error_model = JSON.load(response_content)
703
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
704
+ end
705
+
706
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
707
+ # Deserialize Response
708
+ if status_code == 200
709
+ begin
710
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
711
+ result_mapper = Azure::Resources::Mgmt::V2016_09_01::Models::DeploymentListResult.mapper()
712
+ result.body = @client.deserialize(result_mapper, parsed_response)
713
+ rescue Exception => e
714
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
715
+ end
716
+ end
717
+
718
+ result
719
+ end
720
+
721
+ promise.execute
722
+ end
723
+
724
+ #
725
+ # Deletes a deployment from the deployment history.
726
+ #
727
+ # A template deployment that is currently running cannot be deleted. Deleting a
728
+ # template deployment removes the associated deployment operations. Deleting a
729
+ # template deployment does not affect the state of the resource group. This is
730
+ # an asynchronous operation that returns a status of 202 until the template
731
+ # deployment is successfully deleted. The Location response header contains the
732
+ # URI that is used to obtain the status of the process. While the process is
733
+ # running, a call to the URI in the Location header returns a status of 202.
734
+ # When the process finishes, the URI in the Location header returns a status of
735
+ # 204 on success. If the asynchronous request failed, the URI in the Location
736
+ # header returns an error-level status code.
737
+ #
738
+ # @param resource_group_name [String] The name of the resource group with the
739
+ # deployment to delete. The name is case insensitive.
740
+ # @param deployment_name [String] The name of the deployment to delete.
741
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
742
+ # will be added to the HTTP request.
743
+ #
744
+ #
745
+ def begin_delete(resource_group_name, deployment_name, custom_headers = nil)
746
+ response = begin_delete_async(resource_group_name, deployment_name, custom_headers).value!
747
+ nil
748
+ end
749
+
750
+ #
751
+ # Deletes a deployment from the deployment history.
752
+ #
753
+ # A template deployment that is currently running cannot be deleted. Deleting a
754
+ # template deployment removes the associated deployment operations. Deleting a
755
+ # template deployment does not affect the state of the resource group. This is
756
+ # an asynchronous operation that returns a status of 202 until the template
757
+ # deployment is successfully deleted. The Location response header contains the
758
+ # URI that is used to obtain the status of the process. While the process is
759
+ # running, a call to the URI in the Location header returns a status of 202.
760
+ # When the process finishes, the URI in the Location header returns a status of
761
+ # 204 on success. If the asynchronous request failed, the URI in the Location
762
+ # header returns an error-level status code.
763
+ #
764
+ # @param resource_group_name [String] The name of the resource group with the
765
+ # deployment to delete. The name is case insensitive.
766
+ # @param deployment_name [String] The name of the deployment to delete.
767
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
768
+ # will be added to the HTTP request.
769
+ #
770
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
771
+ #
772
+ def begin_delete_with_http_info(resource_group_name, deployment_name, custom_headers = nil)
773
+ begin_delete_async(resource_group_name, deployment_name, custom_headers).value!
774
+ end
775
+
776
+ #
777
+ # Deletes a deployment from the deployment history.
778
+ #
779
+ # A template deployment that is currently running cannot be deleted. Deleting a
780
+ # template deployment removes the associated deployment operations. Deleting a
781
+ # template deployment does not affect the state of the resource group. This is
782
+ # an asynchronous operation that returns a status of 202 until the template
783
+ # deployment is successfully deleted. The Location response header contains the
784
+ # URI that is used to obtain the status of the process. While the process is
785
+ # running, a call to the URI in the Location header returns a status of 202.
786
+ # When the process finishes, the URI in the Location header returns a status of
787
+ # 204 on success. If the asynchronous request failed, the URI in the Location
788
+ # header returns an error-level status code.
789
+ #
790
+ # @param resource_group_name [String] The name of the resource group with the
791
+ # deployment to delete. The name is case insensitive.
792
+ # @param deployment_name [String] The name of the deployment to delete.
793
+ # @param [Hash{String => String}] A hash of custom headers that will be added
794
+ # to the HTTP request.
795
+ #
796
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
797
+ #
798
+ def begin_delete_async(resource_group_name, deployment_name, custom_headers = nil)
799
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
800
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
801
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
802
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
803
+
804
+
805
+ request_headers = {}
806
+
807
+ # Set Headers
808
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
809
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
810
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'
811
+
812
+ request_url = @base_url || @client.base_url
813
+
814
+ options = {
815
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
816
+ path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
817
+ query_params: {'api-version' => @client.api_version},
818
+ headers: request_headers.merge(custom_headers || {}),
819
+ base_url: request_url
820
+ }
821
+ promise = @client.make_request_async(:delete, path_template, options)
822
+
823
+ promise = promise.then do |result|
824
+ http_response = result.response
825
+ status_code = http_response.status
826
+ response_content = http_response.body
827
+ unless status_code == 202 || status_code == 204
828
+ error_model = JSON.load(response_content)
829
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
830
+ end
831
+
832
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
833
+
834
+ result
835
+ end
836
+
837
+ promise.execute
838
+ end
839
+
840
+ #
841
+ # Deploys resources to a resource group.
842
+ #
843
+ # You can provide the template and parameters directly in the request or link
844
+ # to JSON files.
845
+ #
846
+ # @param resource_group_name [String] The name of the resource group to deploy
847
+ # the resources to. The name is case insensitive. The resource group must
848
+ # already exist.
849
+ # @param deployment_name [String] The name of the deployment.
850
+ # @param parameters [Deployment] Additional parameters supplied to the
851
+ # operation.
852
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
853
+ # will be added to the HTTP request.
854
+ #
855
+ # @return [DeploymentExtended] operation results.
856
+ #
857
+ def begin_create_or_update(resource_group_name, deployment_name, parameters, custom_headers = nil)
858
+ response = begin_create_or_update_async(resource_group_name, deployment_name, parameters, custom_headers).value!
859
+ response.body unless response.nil?
860
+ end
861
+
862
+ #
863
+ # Deploys resources to a resource group.
864
+ #
865
+ # You can provide the template and parameters directly in the request or link
866
+ # to JSON files.
867
+ #
868
+ # @param resource_group_name [String] The name of the resource group to deploy
869
+ # the resources to. The name is case insensitive. The resource group must
870
+ # already exist.
871
+ # @param deployment_name [String] The name of the deployment.
872
+ # @param parameters [Deployment] Additional parameters supplied to the
873
+ # operation.
874
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
875
+ # will be added to the HTTP request.
876
+ #
877
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
878
+ #
879
+ def begin_create_or_update_with_http_info(resource_group_name, deployment_name, parameters, custom_headers = nil)
880
+ begin_create_or_update_async(resource_group_name, deployment_name, parameters, custom_headers).value!
881
+ end
882
+
883
+ #
884
+ # Deploys resources to a resource group.
885
+ #
886
+ # You can provide the template and parameters directly in the request or link
887
+ # to JSON files.
888
+ #
889
+ # @param resource_group_name [String] The name of the resource group to deploy
890
+ # the resources to. The name is case insensitive. The resource group must
891
+ # already exist.
892
+ # @param deployment_name [String] The name of the deployment.
893
+ # @param parameters [Deployment] Additional parameters supplied to the
894
+ # operation.
895
+ # @param [Hash{String => String}] A hash of custom headers that will be added
896
+ # to the HTTP request.
897
+ #
898
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
899
+ #
900
+ def begin_create_or_update_async(resource_group_name, deployment_name, parameters, custom_headers = nil)
901
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
902
+ fail ArgumentError, 'deployment_name is nil' if deployment_name.nil?
903
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
904
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
905
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
906
+
907
+
908
+ request_headers = {}
909
+
910
+ # Set Headers
911
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
912
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
913
+
914
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
915
+
916
+ # Serialize Request
917
+ request_mapper = Azure::Resources::Mgmt::V2016_09_01::Models::Deployment.mapper()
918
+ request_content = @client.serialize(request_mapper, parameters)
919
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
920
+
921
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}'
922
+
923
+ request_url = @base_url || @client.base_url
924
+
925
+ options = {
926
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
927
+ path_params: {'resourceGroupName' => resource_group_name,'deploymentName' => deployment_name,'subscriptionId' => @client.subscription_id},
928
+ query_params: {'api-version' => @client.api_version},
929
+ body: request_content,
930
+ headers: request_headers.merge(custom_headers || {}),
931
+ base_url: request_url
932
+ }
933
+ promise = @client.make_request_async(:put, path_template, options)
934
+
935
+ promise = promise.then do |result|
936
+ http_response = result.response
937
+ status_code = http_response.status
938
+ response_content = http_response.body
939
+ unless status_code == 200 || status_code == 201
940
+ error_model = JSON.load(response_content)
941
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
942
+ end
943
+
944
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
945
+ # Deserialize Response
946
+ if status_code == 200
947
+ begin
948
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
949
+ result_mapper = Azure::Resources::Mgmt::V2016_09_01::Models::DeploymentExtended.mapper()
950
+ result.body = @client.deserialize(result_mapper, parsed_response)
951
+ rescue Exception => e
952
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
953
+ end
954
+ end
955
+ # Deserialize Response
956
+ if status_code == 201
957
+ begin
958
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
959
+ result_mapper = Azure::Resources::Mgmt::V2016_09_01::Models::DeploymentExtended.mapper()
960
+ result.body = @client.deserialize(result_mapper, parsed_response)
961
+ rescue Exception => e
962
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
963
+ end
964
+ end
965
+
966
+ result
967
+ end
968
+
969
+ promise.execute
970
+ end
971
+
972
+ #
973
+ # Get all the deployments for a resource group.
974
+ #
975
+ # @param next_page_link [String] The NextLink from the previous successful call
976
+ # to List operation.
977
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
978
+ # will be added to the HTTP request.
979
+ #
980
+ # @return [DeploymentListResult] operation results.
981
+ #
982
+ def list_next(next_page_link, custom_headers = nil)
983
+ response = list_next_async(next_page_link, custom_headers).value!
984
+ response.body unless response.nil?
985
+ end
986
+
987
+ #
988
+ # Get all the deployments for a resource group.
989
+ #
990
+ # @param next_page_link [String] The NextLink from the previous successful call
991
+ # to List operation.
992
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
993
+ # will be added to the HTTP request.
994
+ #
995
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
996
+ #
997
+ def list_next_with_http_info(next_page_link, custom_headers = nil)
998
+ list_next_async(next_page_link, custom_headers).value!
999
+ end
1000
+
1001
+ #
1002
+ # Get all the deployments for a resource group.
1003
+ #
1004
+ # @param next_page_link [String] The NextLink from the previous successful call
1005
+ # to List operation.
1006
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1007
+ # to the HTTP request.
1008
+ #
1009
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1010
+ #
1011
+ def list_next_async(next_page_link, custom_headers = nil)
1012
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1013
+
1014
+
1015
+ request_headers = {}
1016
+
1017
+ # Set Headers
1018
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1019
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1020
+ path_template = '{nextLink}'
1021
+
1022
+ request_url = @base_url || @client.base_url
1023
+
1024
+ options = {
1025
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1026
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1027
+ headers: request_headers.merge(custom_headers || {}),
1028
+ base_url: request_url
1029
+ }
1030
+ promise = @client.make_request_async(:get, path_template, options)
1031
+
1032
+ promise = promise.then do |result|
1033
+ http_response = result.response
1034
+ status_code = http_response.status
1035
+ response_content = http_response.body
1036
+ unless status_code == 200
1037
+ error_model = JSON.load(response_content)
1038
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1039
+ end
1040
+
1041
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1042
+ # Deserialize Response
1043
+ if status_code == 200
1044
+ begin
1045
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1046
+ result_mapper = Azure::Resources::Mgmt::V2016_09_01::Models::DeploymentListResult.mapper()
1047
+ result.body = @client.deserialize(result_mapper, parsed_response)
1048
+ rescue Exception => e
1049
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1050
+ end
1051
+ end
1052
+
1053
+ result
1054
+ end
1055
+
1056
+ promise.execute
1057
+ end
1058
+
1059
+ #
1060
+ # Get all the deployments for a resource group.
1061
+ #
1062
+ # @param resource_group_name [String] The name of the resource group with the
1063
+ # deployments to get. The name is case insensitive.
1064
+ # @param filter [String] The filter to apply on the operation. For example, you
1065
+ # can use $filter=provisioningState eq '{state}'.
1066
+ # @param top [Integer] The number of results to get. If null is passed, returns
1067
+ # all deployments.
1068
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1069
+ # will be added to the HTTP request.
1070
+ #
1071
+ # @return [DeploymentListResult] which provide lazy access to pages of the
1072
+ # response.
1073
+ #
1074
+ def list_as_lazy(resource_group_name, filter = nil, top = nil, custom_headers = nil)
1075
+ response = list_async(resource_group_name, filter, top, custom_headers).value!
1076
+ unless response.nil?
1077
+ page = response.body
1078
+ page.next_method = Proc.new do |next_page_link|
1079
+ list_next_async(next_page_link, custom_headers)
1080
+ end
1081
+ page
1082
+ end
1083
+ end
1084
+
1085
+ end
1086
+ end