azure_mgmt_storage 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 (204) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -2
  3. data/lib/2015-05-01-preview/generated/azure_mgmt_storage.rb +50 -0
  4. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/account_status.rb +16 -0
  5. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/account_type.rb +19 -0
  6. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/check_name_availability_result.rb +70 -0
  7. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/custom_domain.rb +57 -0
  8. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/endpoints.rb +65 -0
  9. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/key_name.rb +16 -0
  10. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/provisioning_state.rb +17 -0
  11. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/reason.rb +16 -0
  12. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/resource.rb +95 -0
  13. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/storage_account.rb +219 -0
  14. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/storage_account_check_name_availability_parameters.rb +56 -0
  15. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/storage_account_create_parameters.rb +92 -0
  16. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/storage_account_keys.rb +54 -0
  17. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/storage_account_list_result.rb +96 -0
  18. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/storage_account_regenerate_key_parameters.rb +46 -0
  19. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/storage_account_update_parameters.rb +108 -0
  20. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/sub_resource.rb +45 -0
  21. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/usage.rb +80 -0
  22. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/usage_list_result.rb +52 -0
  23. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/usage_name.rb +54 -0
  24. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/models/usage_unit.rb +20 -0
  25. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/module_definition.rb +9 -0
  26. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_accounts.rb +1262 -0
  27. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_management_client.rb +135 -0
  28. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/usage_operations.rb +111 -0
  29. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/version.rb +8 -0
  30. data/lib/2015-06-15/generated/azure_mgmt_storage.rb +48 -0
  31. data/lib/2015-06-15/generated/azure_mgmt_storage/models/account_status.rb +16 -0
  32. data/lib/2015-06-15/generated/azure_mgmt_storage/models/account_type.rb +19 -0
  33. data/lib/2015-06-15/generated/azure_mgmt_storage/models/check_name_availability_result.rb +70 -0
  34. data/lib/2015-06-15/generated/azure_mgmt_storage/models/custom_domain.rb +56 -0
  35. data/lib/2015-06-15/generated/azure_mgmt_storage/models/endpoints.rb +75 -0
  36. data/lib/{generated → 2015-06-15/generated}/azure_mgmt_storage/models/provisioning_state.rb +1 -1
  37. data/lib/{generated → 2015-06-15/generated}/azure_mgmt_storage/models/reason.rb +1 -1
  38. data/lib/2015-06-15/generated/azure_mgmt_storage/models/resource.rb +94 -0
  39. data/lib/2015-06-15/generated/azure_mgmt_storage/models/storage_account.rb +218 -0
  40. data/lib/2015-06-15/generated/azure_mgmt_storage/models/storage_account_check_name_availability_parameters.rb +56 -0
  41. data/lib/2015-06-15/generated/azure_mgmt_storage/models/storage_account_create_parameters.rb +84 -0
  42. data/lib/2015-06-15/generated/azure_mgmt_storage/models/storage_account_keys.rb +54 -0
  43. data/lib/2015-06-15/generated/azure_mgmt_storage/models/storage_account_list_result.rb +53 -0
  44. data/lib/2015-06-15/generated/azure_mgmt_storage/models/storage_account_regenerate_key_parameters.rb +44 -0
  45. data/lib/2015-06-15/generated/azure_mgmt_storage/models/storage_account_update_parameters.rb +80 -0
  46. data/lib/2015-06-15/generated/azure_mgmt_storage/models/usage.rb +80 -0
  47. data/lib/2015-06-15/generated/azure_mgmt_storage/models/usage_list_result.rb +52 -0
  48. data/lib/2015-06-15/generated/azure_mgmt_storage/models/usage_name.rb +54 -0
  49. data/lib/{generated → 2015-06-15/generated}/azure_mgmt_storage/models/usage_unit.rb +1 -1
  50. data/lib/2015-06-15/generated/azure_mgmt_storage/module_definition.rb +9 -0
  51. data/lib/2015-06-15/generated/azure_mgmt_storage/storage_accounts.rb +1044 -0
  52. data/lib/2015-06-15/generated/azure_mgmt_storage/storage_management_client.rb +135 -0
  53. data/lib/2015-06-15/generated/azure_mgmt_storage/usage_operations.rb +111 -0
  54. data/lib/{generated → 2015-06-15/generated}/azure_mgmt_storage/version.rb +2 -2
  55. data/lib/2016-01-01/generated/azure_mgmt_storage.rb +57 -0
  56. data/lib/{generated → 2016-01-01/generated}/azure_mgmt_storage/models/access_tier.rb +1 -1
  57. data/lib/2016-01-01/generated/azure_mgmt_storage/models/account_status.rb +16 -0
  58. data/lib/{generated → 2016-01-01/generated}/azure_mgmt_storage/models/check_name_availability_result.rb +1 -1
  59. data/lib/{generated → 2016-01-01/generated}/azure_mgmt_storage/models/custom_domain.rb +1 -1
  60. data/lib/2016-01-01/generated/azure_mgmt_storage/models/encryption.rb +59 -0
  61. data/lib/{generated → 2016-01-01/generated}/azure_mgmt_storage/models/encryption_service.rb +1 -1
  62. data/lib/2016-01-01/generated/azure_mgmt_storage/models/encryption_services.rb +46 -0
  63. data/lib/{generated → 2016-01-01/generated}/azure_mgmt_storage/models/endpoints.rb +1 -1
  64. data/lib/2016-01-01/generated/azure_mgmt_storage/models/key_permission.rb +16 -0
  65. data/lib/{generated → 2016-01-01/generated}/azure_mgmt_storage/models/kind.rb +1 -1
  66. data/lib/2016-01-01/generated/azure_mgmt_storage/models/provisioning_state.rb +17 -0
  67. data/lib/2016-01-01/generated/azure_mgmt_storage/models/reason.rb +16 -0
  68. data/lib/2016-01-01/generated/azure_mgmt_storage/models/resource.rb +96 -0
  69. data/lib/2016-01-01/generated/azure_mgmt_storage/models/sku.rb +61 -0
  70. data/lib/{generated → 2016-01-01/generated}/azure_mgmt_storage/models/sku_name.rb +1 -1
  71. data/lib/{generated → 2016-01-01/generated}/azure_mgmt_storage/models/sku_tier.rb +1 -1
  72. data/lib/2016-01-01/generated/azure_mgmt_storage/models/storage_account.rb +267 -0
  73. data/lib/2016-01-01/generated/azure_mgmt_storage/models/storage_account_check_name_availability_parameters.rb +58 -0
  74. data/lib/2016-01-01/generated/azure_mgmt_storage/models/storage_account_create_parameters.rb +133 -0
  75. data/lib/2016-01-01/generated/azure_mgmt_storage/models/storage_account_key.rb +69 -0
  76. data/lib/{generated → 2016-01-01/generated}/azure_mgmt_storage/models/storage_account_list_keys_result.rb +1 -1
  77. data/lib/{generated → 2016-01-01/generated}/azure_mgmt_storage/models/storage_account_list_result.rb +1 -1
  78. data/lib/2016-01-01/generated/azure_mgmt_storage/models/storage_account_regenerate_key_parameters.rb +45 -0
  79. data/lib/2016-01-01/generated/azure_mgmt_storage/models/storage_account_update_parameters.rb +109 -0
  80. data/lib/{generated → 2016-01-01/generated}/azure_mgmt_storage/models/usage.rb +1 -1
  81. data/lib/{generated → 2016-01-01/generated}/azure_mgmt_storage/models/usage_list_result.rb +1 -1
  82. data/lib/{generated → 2016-01-01/generated}/azure_mgmt_storage/models/usage_name.rb +1 -1
  83. data/lib/2016-01-01/generated/azure_mgmt_storage/models/usage_unit.rb +20 -0
  84. data/lib/2016-01-01/generated/azure_mgmt_storage/module_definition.rb +9 -0
  85. data/lib/2016-01-01/generated/azure_mgmt_storage/storage_accounts.rb +1044 -0
  86. data/lib/2016-01-01/generated/azure_mgmt_storage/storage_management_client.rb +135 -0
  87. data/lib/2016-01-01/generated/azure_mgmt_storage/usage_operations.rb +111 -0
  88. data/lib/{generated/azure_mgmt_storage/module_definition.rb → 2016-01-01/generated/azure_mgmt_storage/version.rb} +3 -3
  89. data/lib/2016-12-01/generated/azure_mgmt_storage.rb +62 -0
  90. data/lib/2016-12-01/generated/azure_mgmt_storage/models/access_tier.rb +16 -0
  91. data/lib/2016-12-01/generated/azure_mgmt_storage/models/account_sas_parameters.rb +127 -0
  92. data/lib/{generated → 2016-12-01/generated}/azure_mgmt_storage/models/account_status.rb +1 -1
  93. data/lib/2016-12-01/generated/azure_mgmt_storage/models/check_name_availability_result.rb +73 -0
  94. data/lib/2016-12-01/generated/azure_mgmt_storage/models/custom_domain.rb +57 -0
  95. data/lib/2016-12-01/generated/azure_mgmt_storage/models/encryption.rb +59 -0
  96. data/lib/2016-12-01/generated/azure_mgmt_storage/models/encryption_service.rb +59 -0
  97. data/lib/{generated → 2016-12-01/generated}/azure_mgmt_storage/models/encryption_services.rb +1 -1
  98. data/lib/2016-12-01/generated/azure_mgmt_storage/models/endpoints.rb +79 -0
  99. data/lib/{generated → 2016-12-01/generated}/azure_mgmt_storage/models/http_protocol.rb +1 -1
  100. data/lib/{generated → 2016-12-01/generated}/azure_mgmt_storage/models/key_permission.rb +1 -1
  101. data/lib/2016-12-01/generated/azure_mgmt_storage/models/kind.rb +16 -0
  102. data/lib/{generated → 2016-12-01/generated}/azure_mgmt_storage/models/list_account_sas_response.rb +1 -1
  103. data/lib/{generated → 2016-12-01/generated}/azure_mgmt_storage/models/list_service_sas_response.rb +1 -1
  104. data/lib/2016-12-01/generated/azure_mgmt_storage/models/provisioning_state.rb +17 -0
  105. data/lib/2016-12-01/generated/azure_mgmt_storage/models/reason.rb +16 -0
  106. data/lib/{generated → 2016-12-01/generated}/azure_mgmt_storage/models/resource.rb +1 -1
  107. data/lib/2016-12-01/generated/azure_mgmt_storage/models/service_sas_parameters.rb +228 -0
  108. data/lib/2016-12-01/generated/azure_mgmt_storage/models/sku.rb +61 -0
  109. data/lib/2016-12-01/generated/azure_mgmt_storage/models/sku_name.rb +19 -0
  110. data/lib/2016-12-01/generated/azure_mgmt_storage/models/sku_tier.rb +16 -0
  111. data/lib/2016-12-01/generated/azure_mgmt_storage/models/storage_account.rb +279 -0
  112. data/lib/2016-12-01/generated/azure_mgmt_storage/models/storage_account_check_name_availability_parameters.rb +57 -0
  113. data/lib/2016-12-01/generated/azure_mgmt_storage/models/storage_account_create_parameters.rb +145 -0
  114. data/lib/{generated → 2016-12-01/generated}/azure_mgmt_storage/models/storage_account_key.rb +1 -1
  115. data/lib/2016-12-01/generated/azure_mgmt_storage/models/storage_account_list_keys_result.rb +54 -0
  116. data/lib/2016-12-01/generated/azure_mgmt_storage/models/storage_account_list_result.rb +54 -0
  117. data/lib/2016-12-01/generated/azure_mgmt_storage/models/storage_account_regenerate_key_parameters.rb +44 -0
  118. data/lib/2016-12-01/generated/azure_mgmt_storage/models/storage_account_update_parameters.rb +121 -0
  119. data/lib/2016-12-01/generated/azure_mgmt_storage/models/usage.rb +84 -0
  120. data/lib/2016-12-01/generated/azure_mgmt_storage/models/usage_list_result.rb +53 -0
  121. data/lib/2016-12-01/generated/azure_mgmt_storage/models/usage_name.rb +56 -0
  122. data/lib/2016-12-01/generated/azure_mgmt_storage/models/usage_unit.rb +20 -0
  123. data/lib/2016-12-01/generated/azure_mgmt_storage/module_definition.rb +9 -0
  124. data/lib/{generated → 2016-12-01/generated}/azure_mgmt_storage/storage_accounts.rb +18 -18
  125. data/lib/2016-12-01/generated/azure_mgmt_storage/storage_management_client.rb +135 -0
  126. data/lib/{generated → 2016-12-01/generated}/azure_mgmt_storage/usage_operations.rb +2 -2
  127. data/lib/2016-12-01/generated/azure_mgmt_storage/version.rb +8 -0
  128. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage.rb +64 -64
  129. data/lib/2017-06-01/generated/azure_mgmt_storage/models/access_tier.rb +16 -0
  130. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/account_sas_parameters.rb +1 -1
  131. data/lib/2017-06-01/generated/azure_mgmt_storage/models/account_status.rb +16 -0
  132. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/action.rb +1 -1
  133. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/bypass.rb +1 -1
  134. data/lib/2017-06-01/generated/azure_mgmt_storage/models/check_name_availability_result.rb +73 -0
  135. data/lib/2017-06-01/generated/azure_mgmt_storage/models/custom_domain.rb +57 -0
  136. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/default_action.rb +1 -1
  137. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/dimension.rb +1 -1
  138. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/encryption.rb +1 -1
  139. data/lib/2017-06-01/generated/azure_mgmt_storage/models/encryption_service.rb +59 -0
  140. data/lib/2017-06-01/generated/azure_mgmt_storage/models/encryption_services.rb +84 -0
  141. data/lib/2017-06-01/generated/azure_mgmt_storage/models/endpoints.rb +79 -0
  142. data/lib/2017-06-01/generated/azure_mgmt_storage/models/http_protocol.rb +16 -0
  143. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/identity.rb +1 -1
  144. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/iprule.rb +1 -1
  145. data/lib/2017-06-01/generated/azure_mgmt_storage/models/key_permission.rb +16 -0
  146. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/key_source.rb +1 -1
  147. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/key_vault_properties.rb +1 -1
  148. data/lib/2017-06-01/generated/azure_mgmt_storage/models/kind.rb +16 -0
  149. data/lib/2017-06-01/generated/azure_mgmt_storage/models/list_account_sas_response.rb +45 -0
  150. data/lib/2017-06-01/generated/azure_mgmt_storage/models/list_service_sas_response.rb +45 -0
  151. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/metric_specification.rb +1 -1
  152. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/network_rule_set.rb +1 -1
  153. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/operation.rb +1 -1
  154. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/operation_display.rb +1 -1
  155. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/operation_list_result.rb +1 -1
  156. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/permissions.rb +1 -1
  157. data/lib/2017-06-01/generated/azure_mgmt_storage/models/provisioning_state.rb +17 -0
  158. data/lib/2017-06-01/generated/azure_mgmt_storage/models/reason.rb +16 -0
  159. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/reason_code.rb +1 -1
  160. data/lib/2017-06-01/generated/azure_mgmt_storage/models/resource.rb +95 -0
  161. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/restriction.rb +1 -1
  162. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/service_sas_parameters.rb +1 -1
  163. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/service_specification.rb +1 -1
  164. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/services.rb +1 -1
  165. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/signed_resource.rb +1 -1
  166. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/signed_resource_types.rb +1 -1
  167. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/sku.rb +1 -1
  168. data/lib/2017-06-01/generated/azure_mgmt_storage/models/sku_name.rb +19 -0
  169. data/lib/2017-06-01/generated/azure_mgmt_storage/models/sku_tier.rb +16 -0
  170. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/skucapability.rb +1 -1
  171. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/state.rb +1 -1
  172. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/storage_account.rb +1 -1
  173. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/storage_account_check_name_availability_parameters.rb +1 -1
  174. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/storage_account_create_parameters.rb +1 -1
  175. data/lib/2017-06-01/generated/azure_mgmt_storage/models/storage_account_key.rb +69 -0
  176. data/lib/2017-06-01/generated/azure_mgmt_storage/models/storage_account_list_keys_result.rb +54 -0
  177. data/lib/2017-06-01/generated/azure_mgmt_storage/models/storage_account_list_result.rb +54 -0
  178. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/storage_account_regenerate_key_parameters.rb +1 -1
  179. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/storage_account_update_parameters.rb +1 -1
  180. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/storage_sku_list_result.rb +1 -1
  181. data/lib/2017-06-01/generated/azure_mgmt_storage/models/usage.rb +84 -0
  182. data/lib/2017-06-01/generated/azure_mgmt_storage/models/usage_list_result.rb +53 -0
  183. data/lib/2017-06-01/generated/azure_mgmt_storage/models/usage_name.rb +56 -0
  184. data/lib/2017-06-01/generated/azure_mgmt_storage/models/usage_unit.rb +20 -0
  185. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/models/virtual_network_rule.rb +1 -1
  186. data/lib/2017-06-01/generated/azure_mgmt_storage/module_definition.rb +9 -0
  187. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/operations.rb +2 -2
  188. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/skus.rb +2 -2
  189. data/lib/2017-06-01/generated/azure_mgmt_storage/storage_accounts.rb +1276 -0
  190. data/lib/{generated → 2017-06-01/generated}/azure_mgmt_storage/storage_management_client.rb +3 -3
  191. data/lib/2017-06-01/generated/azure_mgmt_storage/usage_operations.rb +111 -0
  192. data/lib/2017-06-01/generated/azure_mgmt_storage/version.rb +8 -0
  193. data/lib/azure_mgmt_storage.rb +7 -1
  194. data/lib/module_definition.rb +8 -0
  195. data/lib/profiles/common/configurable.rb +73 -0
  196. data/lib/profiles/common/default.rb +68 -0
  197. data/lib/profiles/latest/modules/storage_profile_module.rb +276 -0
  198. data/lib/profiles/latest/storage_latest_profile_client.rb +33 -0
  199. data/lib/profiles/latest/storage_module_definition.rb +9 -0
  200. data/lib/profiles/v2017_03_09/modules/storage_profile_module.rb +120 -0
  201. data/lib/profiles/v2017_03_09/storage_module_definition.rb +9 -0
  202. data/lib/profiles/v2017_03_09/storage_v2017_03_09_profile_client.rb +33 -0
  203. data/lib/version.rb +7 -0
  204. metadata +202 -67
@@ -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::Storage
6
+ module Azure::Storage::Mgmt::V2016_01_01
7
7
  module Models
8
8
  #
9
9
  # The response from the List Usages operation.
@@ -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::Storage
6
+ module Azure::Storage::Mgmt::V2016_01_01
7
7
  module Models
8
8
  #
9
9
  # The usage names that can be used; currently limited to StorageAccount.
@@ -0,0 +1,20 @@
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::Storage::Mgmt::V2016_01_01
7
+ module Models
8
+ #
9
+ # Defines values for UsageUnit
10
+ #
11
+ module UsageUnit
12
+ Count = "Count"
13
+ Bytes = "Bytes"
14
+ Seconds = "Seconds"
15
+ Percent = "Percent"
16
+ CountsPerSecond = "CountsPerSecond"
17
+ BytesPerSecond = "BytesPerSecond"
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,9 @@
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 end
7
+ module Azure::Storage end
8
+ module Azure::Storage::Mgmt end
9
+ module Azure::Storage::Mgmt::V2016_01_01 end
@@ -0,0 +1,1044 @@
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::Storage::Mgmt::V2016_01_01
7
+ #
8
+ # The Storage Management Client.
9
+ #
10
+ class StorageAccounts
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the StorageAccounts class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [StorageManagementClient] reference to the StorageManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Checks that the storage account name is valid and is not already in use.
26
+ #
27
+ # @param account_name [StorageAccountCheckNameAvailabilityParameters] The name
28
+ # of the storage account within the specified resource group. Storage account
29
+ # names must be between 3 and 24 characters in length and use numbers and
30
+ # lower-case letters only.
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [CheckNameAvailabilityResult] operation results.
35
+ #
36
+ def check_name_availability(account_name, custom_headers = nil)
37
+ response = check_name_availability_async(account_name, custom_headers).value!
38
+ response.body unless response.nil?
39
+ end
40
+
41
+ #
42
+ # Checks that the storage account name is valid and is not already in use.
43
+ #
44
+ # @param account_name [StorageAccountCheckNameAvailabilityParameters] The name
45
+ # of the storage account within the specified resource group. Storage account
46
+ # names must be between 3 and 24 characters in length and use numbers and
47
+ # lower-case letters only.
48
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
49
+ # will be added to the HTTP request.
50
+ #
51
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
52
+ #
53
+ def check_name_availability_with_http_info(account_name, custom_headers = nil)
54
+ check_name_availability_async(account_name, custom_headers).value!
55
+ end
56
+
57
+ #
58
+ # Checks that the storage account name is valid and is not already in use.
59
+ #
60
+ # @param account_name [StorageAccountCheckNameAvailabilityParameters] The name
61
+ # of the storage account within the specified resource group. Storage account
62
+ # names must be between 3 and 24 characters in length and use numbers and
63
+ # lower-case letters only.
64
+ # @param [Hash{String => String}] A hash of custom headers that will be added
65
+ # to the HTTP request.
66
+ #
67
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
68
+ #
69
+ def check_name_availability_async(account_name, custom_headers = nil)
70
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
71
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
72
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
73
+
74
+
75
+ request_headers = {}
76
+
77
+ # Set Headers
78
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
79
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
80
+
81
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
82
+
83
+ # Serialize Request
84
+ request_mapper = Azure::Storage::Mgmt::V2016_01_01::Models::StorageAccountCheckNameAvailabilityParameters.mapper()
85
+ request_content = @client.serialize(request_mapper, account_name)
86
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
87
+
88
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'
89
+
90
+ request_url = @base_url || @client.base_url
91
+
92
+ options = {
93
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
94
+ path_params: {'subscriptionId' => @client.subscription_id},
95
+ query_params: {'api-version' => @client.api_version},
96
+ body: request_content,
97
+ headers: request_headers.merge(custom_headers || {}),
98
+ base_url: request_url
99
+ }
100
+ promise = @client.make_request_async(:post, path_template, options)
101
+
102
+ promise = promise.then do |result|
103
+ http_response = result.response
104
+ status_code = http_response.status
105
+ response_content = http_response.body
106
+ unless status_code == 200
107
+ error_model = JSON.load(response_content)
108
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
109
+ end
110
+
111
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
112
+ # Deserialize Response
113
+ if status_code == 200
114
+ begin
115
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
116
+ result_mapper = Azure::Storage::Mgmt::V2016_01_01::Models::CheckNameAvailabilityResult.mapper()
117
+ result.body = @client.deserialize(result_mapper, parsed_response)
118
+ rescue Exception => e
119
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
120
+ end
121
+ end
122
+
123
+ result
124
+ end
125
+
126
+ promise.execute
127
+ end
128
+
129
+ #
130
+ # Asynchronously creates a new storage account with the specified parameters.
131
+ # If an account is already created and a subsequent create request is issued
132
+ # with different properties, the account properties will be updated. If an
133
+ # account is already created and a subsequent create or update request is
134
+ # issued with the exact same set of properties, the request will succeed.
135
+ #
136
+ # @param resource_group_name [String] The name of the resource group within the
137
+ # user's subscription.
138
+ # @param account_name [String] The name of the storage account within the
139
+ # specified resource group. Storage account names must be between 3 and 24
140
+ # characters in length and use numbers and lower-case letters only.
141
+ # @param parameters [StorageAccountCreateParameters] The parameters to provide
142
+ # for the created account.
143
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
144
+ # will be added to the HTTP request.
145
+ #
146
+ # @return [StorageAccount] operation results.
147
+ #
148
+ def create(resource_group_name, account_name, parameters, custom_headers = nil)
149
+ response = create_async(resource_group_name, account_name, parameters, custom_headers).value!
150
+ response.body unless response.nil?
151
+ end
152
+
153
+ #
154
+ # @param resource_group_name [String] The name of the resource group within the
155
+ # user's subscription.
156
+ # @param account_name [String] The name of the storage account within the
157
+ # specified resource group. Storage account names must be between 3 and 24
158
+ # characters in length and use numbers and lower-case letters only.
159
+ # @param parameters [StorageAccountCreateParameters] The parameters to provide
160
+ # for the created account.
161
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
162
+ # will be added to the HTTP request.
163
+ #
164
+ # @return [Concurrent::Promise] promise which provides async access to http
165
+ # response.
166
+ #
167
+ def create_async(resource_group_name, account_name, parameters, custom_headers = nil)
168
+ # Send request
169
+ promise = begin_create_async(resource_group_name, account_name, parameters, custom_headers)
170
+
171
+ promise = promise.then do |response|
172
+ # Defining deserialization method.
173
+ deserialize_method = lambda do |parsed_response|
174
+ result_mapper = Azure::Storage::Mgmt::V2016_01_01::Models::StorageAccount.mapper()
175
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
176
+ end
177
+
178
+ # Waiting for response.
179
+ @client.get_long_running_operation_result(response, deserialize_method)
180
+ end
181
+
182
+ promise
183
+ end
184
+
185
+ #
186
+ # Deletes a storage account in Microsoft Azure.
187
+ #
188
+ # @param resource_group_name [String] The name of the resource group within the
189
+ # user's subscription.
190
+ # @param account_name [String] The name of the storage account within the
191
+ # specified resource group. Storage account names must be between 3 and 24
192
+ # characters in length and use numbers and lower-case letters only.
193
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
194
+ # will be added to the HTTP request.
195
+ #
196
+ #
197
+ def delete(resource_group_name, account_name, custom_headers = nil)
198
+ response = delete_async(resource_group_name, account_name, custom_headers).value!
199
+ nil
200
+ end
201
+
202
+ #
203
+ # Deletes a storage account in Microsoft Azure.
204
+ #
205
+ # @param resource_group_name [String] The name of the resource group within the
206
+ # user's subscription.
207
+ # @param account_name [String] The name of the storage account within the
208
+ # specified resource group. Storage account names must be between 3 and 24
209
+ # characters in length and use numbers and lower-case letters only.
210
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
211
+ # will be added to the HTTP request.
212
+ #
213
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
214
+ #
215
+ def delete_with_http_info(resource_group_name, account_name, custom_headers = nil)
216
+ delete_async(resource_group_name, account_name, custom_headers).value!
217
+ end
218
+
219
+ #
220
+ # Deletes a storage account in Microsoft Azure.
221
+ #
222
+ # @param resource_group_name [String] The name of the resource group within the
223
+ # user's subscription.
224
+ # @param account_name [String] The name of the storage account within the
225
+ # specified resource group. Storage account names must be between 3 and 24
226
+ # characters in length and use numbers and lower-case letters only.
227
+ # @param [Hash{String => String}] A hash of custom headers that will be added
228
+ # to the HTTP request.
229
+ #
230
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
231
+ #
232
+ def delete_async(resource_group_name, account_name, custom_headers = nil)
233
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
234
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
235
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
236
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
237
+
238
+
239
+ request_headers = {}
240
+
241
+ # Set Headers
242
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
243
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
244
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'
245
+
246
+ request_url = @base_url || @client.base_url
247
+
248
+ options = {
249
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
250
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
251
+ query_params: {'api-version' => @client.api_version},
252
+ headers: request_headers.merge(custom_headers || {}),
253
+ base_url: request_url
254
+ }
255
+ promise = @client.make_request_async(:delete, path_template, options)
256
+
257
+ promise = promise.then do |result|
258
+ http_response = result.response
259
+ status_code = http_response.status
260
+ response_content = http_response.body
261
+ unless status_code == 200 || status_code == 204
262
+ error_model = JSON.load(response_content)
263
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
264
+ end
265
+
266
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
267
+
268
+ result
269
+ end
270
+
271
+ promise.execute
272
+ end
273
+
274
+ #
275
+ # Returns the properties for the specified storage account including but not
276
+ # limited to name, SKU name, location, and account status. The ListKeys
277
+ # operation should be used to retrieve storage keys.
278
+ #
279
+ # @param resource_group_name [String] The name of the resource group within the
280
+ # user's subscription.
281
+ # @param account_name [String] The name of the storage account within the
282
+ # specified resource group. Storage account names must be between 3 and 24
283
+ # characters in length and use numbers and lower-case letters only.
284
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
285
+ # will be added to the HTTP request.
286
+ #
287
+ # @return [StorageAccount] operation results.
288
+ #
289
+ def get_properties(resource_group_name, account_name, custom_headers = nil)
290
+ response = get_properties_async(resource_group_name, account_name, custom_headers).value!
291
+ response.body unless response.nil?
292
+ end
293
+
294
+ #
295
+ # Returns the properties for the specified storage account including but not
296
+ # limited to name, SKU name, location, and account status. The ListKeys
297
+ # operation should be used to retrieve storage keys.
298
+ #
299
+ # @param resource_group_name [String] The name of the resource group within the
300
+ # user's subscription.
301
+ # @param account_name [String] The name of the storage account within the
302
+ # specified resource group. Storage account names must be between 3 and 24
303
+ # characters in length and use numbers and lower-case letters only.
304
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
305
+ # will be added to the HTTP request.
306
+ #
307
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
308
+ #
309
+ def get_properties_with_http_info(resource_group_name, account_name, custom_headers = nil)
310
+ get_properties_async(resource_group_name, account_name, custom_headers).value!
311
+ end
312
+
313
+ #
314
+ # Returns the properties for the specified storage account including but not
315
+ # limited to name, SKU name, location, and account status. The ListKeys
316
+ # operation should be used to retrieve storage keys.
317
+ #
318
+ # @param resource_group_name [String] The name of the resource group within the
319
+ # user's subscription.
320
+ # @param account_name [String] The name of the storage account within the
321
+ # specified resource group. Storage account names must be between 3 and 24
322
+ # characters in length and use numbers and lower-case letters only.
323
+ # @param [Hash{String => String}] A hash of custom headers that will be added
324
+ # to the HTTP request.
325
+ #
326
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
327
+ #
328
+ def get_properties_async(resource_group_name, account_name, custom_headers = nil)
329
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
330
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
331
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
332
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
333
+
334
+
335
+ request_headers = {}
336
+
337
+ # Set Headers
338
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
339
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
340
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'
341
+
342
+ request_url = @base_url || @client.base_url
343
+
344
+ options = {
345
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
346
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
347
+ query_params: {'api-version' => @client.api_version},
348
+ headers: request_headers.merge(custom_headers || {}),
349
+ base_url: request_url
350
+ }
351
+ promise = @client.make_request_async(:get, path_template, options)
352
+
353
+ promise = promise.then do |result|
354
+ http_response = result.response
355
+ status_code = http_response.status
356
+ response_content = http_response.body
357
+ unless status_code == 200
358
+ error_model = JSON.load(response_content)
359
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
360
+ end
361
+
362
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
363
+ # Deserialize Response
364
+ if status_code == 200
365
+ begin
366
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
367
+ result_mapper = Azure::Storage::Mgmt::V2016_01_01::Models::StorageAccount.mapper()
368
+ result.body = @client.deserialize(result_mapper, parsed_response)
369
+ rescue Exception => e
370
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
371
+ end
372
+ end
373
+
374
+ result
375
+ end
376
+
377
+ promise.execute
378
+ end
379
+
380
+ #
381
+ # The update operation can be used to update the SKU, encryption, access tier,
382
+ # or tags for a storage account. It can also be used to map the account to a
383
+ # custom domain. Only one custom domain is supported per storage account; the
384
+ # replacement/change of custom domain is not supported. In order to replace an
385
+ # old custom domain, the old value must be cleared/unregistered before a new
386
+ # value can be set. The update of multiple properties is supported. This call
387
+ # does not change the storage keys for the account. If you want to change the
388
+ # storage account keys, use the regenerate keys operation. The location and
389
+ # name of the storage account cannot be changed after creation.
390
+ #
391
+ # @param resource_group_name [String] The name of the resource group within the
392
+ # user's subscription.
393
+ # @param account_name [String] The name of the storage account within the
394
+ # specified resource group. Storage account names must be between 3 and 24
395
+ # characters in length and use numbers and lower-case letters only.
396
+ # @param parameters [StorageAccountUpdateParameters] The parameters to provide
397
+ # for the updated account.
398
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
399
+ # will be added to the HTTP request.
400
+ #
401
+ # @return [StorageAccount] operation results.
402
+ #
403
+ def update(resource_group_name, account_name, parameters, custom_headers = nil)
404
+ response = update_async(resource_group_name, account_name, parameters, custom_headers).value!
405
+ response.body unless response.nil?
406
+ end
407
+
408
+ #
409
+ # The update operation can be used to update the SKU, encryption, access tier,
410
+ # or tags for a storage account. It can also be used to map the account to a
411
+ # custom domain. Only one custom domain is supported per storage account; the
412
+ # replacement/change of custom domain is not supported. In order to replace an
413
+ # old custom domain, the old value must be cleared/unregistered before a new
414
+ # value can be set. The update of multiple properties is supported. This call
415
+ # does not change the storage keys for the account. If you want to change the
416
+ # storage account keys, use the regenerate keys operation. The location and
417
+ # name of the storage account cannot be changed after creation.
418
+ #
419
+ # @param resource_group_name [String] The name of the resource group within the
420
+ # user's subscription.
421
+ # @param account_name [String] The name of the storage account within the
422
+ # specified resource group. Storage account names must be between 3 and 24
423
+ # characters in length and use numbers and lower-case letters only.
424
+ # @param parameters [StorageAccountUpdateParameters] The parameters to provide
425
+ # for the updated account.
426
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
427
+ # will be added to the HTTP request.
428
+ #
429
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
430
+ #
431
+ def update_with_http_info(resource_group_name, account_name, parameters, custom_headers = nil)
432
+ update_async(resource_group_name, account_name, parameters, custom_headers).value!
433
+ end
434
+
435
+ #
436
+ # The update operation can be used to update the SKU, encryption, access tier,
437
+ # or tags for a storage account. It can also be used to map the account to a
438
+ # custom domain. Only one custom domain is supported per storage account; the
439
+ # replacement/change of custom domain is not supported. In order to replace an
440
+ # old custom domain, the old value must be cleared/unregistered before a new
441
+ # value can be set. The update of multiple properties is supported. This call
442
+ # does not change the storage keys for the account. If you want to change the
443
+ # storage account keys, use the regenerate keys operation. The location and
444
+ # name of the storage account cannot be changed after creation.
445
+ #
446
+ # @param resource_group_name [String] The name of the resource group within the
447
+ # user's subscription.
448
+ # @param account_name [String] The name of the storage account within the
449
+ # specified resource group. Storage account names must be between 3 and 24
450
+ # characters in length and use numbers and lower-case letters only.
451
+ # @param parameters [StorageAccountUpdateParameters] The parameters to provide
452
+ # for the updated account.
453
+ # @param [Hash{String => String}] A hash of custom headers that will be added
454
+ # to the HTTP request.
455
+ #
456
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
457
+ #
458
+ def update_async(resource_group_name, account_name, parameters, custom_headers = nil)
459
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
460
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
461
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
462
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
463
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
464
+
465
+
466
+ request_headers = {}
467
+
468
+ # Set Headers
469
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
470
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
471
+
472
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
473
+
474
+ # Serialize Request
475
+ request_mapper = Azure::Storage::Mgmt::V2016_01_01::Models::StorageAccountUpdateParameters.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 = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'
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: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
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(:patch, 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
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
+ # Deserialize Response
504
+ if status_code == 200
505
+ begin
506
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
507
+ result_mapper = Azure::Storage::Mgmt::V2016_01_01::Models::StorageAccount.mapper()
508
+ result.body = @client.deserialize(result_mapper, parsed_response)
509
+ rescue Exception => e
510
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
511
+ end
512
+ end
513
+
514
+ result
515
+ end
516
+
517
+ promise.execute
518
+ end
519
+
520
+ #
521
+ # Lists all the storage accounts available under the subscription. Note that
522
+ # storage keys are not returned; use the ListKeys operation for this.
523
+ #
524
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
525
+ # will be added to the HTTP request.
526
+ #
527
+ # @return [StorageAccountListResult] operation results.
528
+ #
529
+ def list(custom_headers = nil)
530
+ response = list_async(custom_headers).value!
531
+ response.body unless response.nil?
532
+ end
533
+
534
+ #
535
+ # Lists all the storage accounts available under the subscription. Note that
536
+ # storage keys are not returned; use the ListKeys operation for this.
537
+ #
538
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
539
+ # will be added to the HTTP request.
540
+ #
541
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
542
+ #
543
+ def list_with_http_info(custom_headers = nil)
544
+ list_async(custom_headers).value!
545
+ end
546
+
547
+ #
548
+ # Lists all the storage accounts available under the subscription. Note that
549
+ # storage keys are not returned; use the ListKeys operation for this.
550
+ #
551
+ # @param [Hash{String => String}] A hash of custom headers that will be added
552
+ # to the HTTP request.
553
+ #
554
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
555
+ #
556
+ def list_async(custom_headers = nil)
557
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
558
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
559
+
560
+
561
+ request_headers = {}
562
+
563
+ # Set Headers
564
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
565
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
566
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'
567
+
568
+ request_url = @base_url || @client.base_url
569
+
570
+ options = {
571
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
572
+ path_params: {'subscriptionId' => @client.subscription_id},
573
+ query_params: {'api-version' => @client.api_version},
574
+ headers: request_headers.merge(custom_headers || {}),
575
+ base_url: request_url
576
+ }
577
+ promise = @client.make_request_async(:get, path_template, options)
578
+
579
+ promise = promise.then do |result|
580
+ http_response = result.response
581
+ status_code = http_response.status
582
+ response_content = http_response.body
583
+ unless status_code == 200
584
+ error_model = JSON.load(response_content)
585
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
586
+ end
587
+
588
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
589
+ # Deserialize Response
590
+ if status_code == 200
591
+ begin
592
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
593
+ result_mapper = Azure::Storage::Mgmt::V2016_01_01::Models::StorageAccountListResult.mapper()
594
+ result.body = @client.deserialize(result_mapper, parsed_response)
595
+ rescue Exception => e
596
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
597
+ end
598
+ end
599
+
600
+ result
601
+ end
602
+
603
+ promise.execute
604
+ end
605
+
606
+ #
607
+ # Lists all the storage accounts available under the given resource group. Note
608
+ # that storage keys are not returned; use the ListKeys operation for this.
609
+ #
610
+ # @param resource_group_name [String] The name of the resource group within the
611
+ # user's subscription.
612
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
613
+ # will be added to the HTTP request.
614
+ #
615
+ # @return [StorageAccountListResult] operation results.
616
+ #
617
+ def list_by_resource_group(resource_group_name, custom_headers = nil)
618
+ response = list_by_resource_group_async(resource_group_name, custom_headers).value!
619
+ response.body unless response.nil?
620
+ end
621
+
622
+ #
623
+ # Lists all the storage accounts available under the given resource group. Note
624
+ # that storage keys are not returned; use the ListKeys operation for this.
625
+ #
626
+ # @param resource_group_name [String] The name of the resource group within the
627
+ # user's subscription.
628
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
629
+ # will be added to the HTTP request.
630
+ #
631
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
632
+ #
633
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers = nil)
634
+ list_by_resource_group_async(resource_group_name, custom_headers).value!
635
+ end
636
+
637
+ #
638
+ # Lists all the storage accounts available under the given resource group. Note
639
+ # that storage keys are not returned; use the ListKeys operation for this.
640
+ #
641
+ # @param resource_group_name [String] The name of the resource group within the
642
+ # user's subscription.
643
+ # @param [Hash{String => String}] A hash of custom headers that will be added
644
+ # to the HTTP request.
645
+ #
646
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
647
+ #
648
+ def list_by_resource_group_async(resource_group_name, custom_headers = nil)
649
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
650
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
651
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
652
+
653
+
654
+ request_headers = {}
655
+
656
+ # Set Headers
657
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
658
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
659
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'
660
+
661
+ request_url = @base_url || @client.base_url
662
+
663
+ options = {
664
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
665
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
666
+ query_params: {'api-version' => @client.api_version},
667
+ headers: request_headers.merge(custom_headers || {}),
668
+ base_url: request_url
669
+ }
670
+ promise = @client.make_request_async(:get, path_template, options)
671
+
672
+ promise = promise.then do |result|
673
+ http_response = result.response
674
+ status_code = http_response.status
675
+ response_content = http_response.body
676
+ unless status_code == 200
677
+ error_model = JSON.load(response_content)
678
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
679
+ end
680
+
681
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
682
+ # Deserialize Response
683
+ if status_code == 200
684
+ begin
685
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
686
+ result_mapper = Azure::Storage::Mgmt::V2016_01_01::Models::StorageAccountListResult.mapper()
687
+ result.body = @client.deserialize(result_mapper, parsed_response)
688
+ rescue Exception => e
689
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
690
+ end
691
+ end
692
+
693
+ result
694
+ end
695
+
696
+ promise.execute
697
+ end
698
+
699
+ #
700
+ # Lists the access keys for the specified storage account.
701
+ #
702
+ # @param resource_group_name [String] The name of the resource group within the
703
+ # user's subscription.
704
+ # @param account_name [String] The name of the storage account within the
705
+ # specified resource group. Storage account names must be between 3 and 24
706
+ # characters in length and use numbers and lower-case letters only.
707
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
708
+ # will be added to the HTTP request.
709
+ #
710
+ # @return [StorageAccountListKeysResult] operation results.
711
+ #
712
+ def list_keys(resource_group_name, account_name, custom_headers = nil)
713
+ response = list_keys_async(resource_group_name, account_name, custom_headers).value!
714
+ response.body unless response.nil?
715
+ end
716
+
717
+ #
718
+ # Lists the access keys for the specified storage account.
719
+ #
720
+ # @param resource_group_name [String] The name of the resource group within the
721
+ # user's subscription.
722
+ # @param account_name [String] The name of the storage account within the
723
+ # specified resource group. Storage account names must be between 3 and 24
724
+ # characters in length and use numbers and lower-case letters only.
725
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
726
+ # will be added to the HTTP request.
727
+ #
728
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
729
+ #
730
+ def list_keys_with_http_info(resource_group_name, account_name, custom_headers = nil)
731
+ list_keys_async(resource_group_name, account_name, custom_headers).value!
732
+ end
733
+
734
+ #
735
+ # Lists the access keys for the specified storage account.
736
+ #
737
+ # @param resource_group_name [String] The name of the resource group within the
738
+ # user's subscription.
739
+ # @param account_name [String] The name of the storage account within the
740
+ # specified resource group. Storage account names must be between 3 and 24
741
+ # characters in length and use numbers and lower-case letters only.
742
+ # @param [Hash{String => String}] A hash of custom headers that will be added
743
+ # to the HTTP request.
744
+ #
745
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
746
+ #
747
+ def list_keys_async(resource_group_name, account_name, custom_headers = nil)
748
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
749
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
750
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
751
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
752
+
753
+
754
+ request_headers = {}
755
+
756
+ # Set Headers
757
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
758
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
759
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'
760
+
761
+ request_url = @base_url || @client.base_url
762
+
763
+ options = {
764
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
765
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
766
+ query_params: {'api-version' => @client.api_version},
767
+ headers: request_headers.merge(custom_headers || {}),
768
+ base_url: request_url
769
+ }
770
+ promise = @client.make_request_async(:post, path_template, options)
771
+
772
+ promise = promise.then do |result|
773
+ http_response = result.response
774
+ status_code = http_response.status
775
+ response_content = http_response.body
776
+ unless status_code == 200
777
+ error_model = JSON.load(response_content)
778
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
779
+ end
780
+
781
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
782
+ # Deserialize Response
783
+ if status_code == 200
784
+ begin
785
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
786
+ result_mapper = Azure::Storage::Mgmt::V2016_01_01::Models::StorageAccountListKeysResult.mapper()
787
+ result.body = @client.deserialize(result_mapper, parsed_response)
788
+ rescue Exception => e
789
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
790
+ end
791
+ end
792
+
793
+ result
794
+ end
795
+
796
+ promise.execute
797
+ end
798
+
799
+ #
800
+ # Regenerates one of the access keys for the specified storage account.
801
+ #
802
+ # @param resource_group_name [String] The name of the resource group within the
803
+ # user's subscription.
804
+ # @param account_name [String] The name of the storage account within the
805
+ # specified resource group. Storage account names must be between 3 and 24
806
+ # characters in length and use numbers and lower-case letters only.
807
+ # @param regenerate_key [StorageAccountRegenerateKeyParameters] Specifies name
808
+ # of the key which should be regenerated -- key1 or key2.
809
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
810
+ # will be added to the HTTP request.
811
+ #
812
+ # @return [StorageAccountListKeysResult] operation results.
813
+ #
814
+ def regenerate_key(resource_group_name, account_name, regenerate_key, custom_headers = nil)
815
+ response = regenerate_key_async(resource_group_name, account_name, regenerate_key, custom_headers).value!
816
+ response.body unless response.nil?
817
+ end
818
+
819
+ #
820
+ # Regenerates one of the access keys for the specified storage account.
821
+ #
822
+ # @param resource_group_name [String] The name of the resource group within the
823
+ # user's subscription.
824
+ # @param account_name [String] The name of the storage account within the
825
+ # specified resource group. Storage account names must be between 3 and 24
826
+ # characters in length and use numbers and lower-case letters only.
827
+ # @param regenerate_key [StorageAccountRegenerateKeyParameters] Specifies name
828
+ # of the key which should be regenerated -- key1 or key2.
829
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
830
+ # will be added to the HTTP request.
831
+ #
832
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
833
+ #
834
+ def regenerate_key_with_http_info(resource_group_name, account_name, regenerate_key, custom_headers = nil)
835
+ regenerate_key_async(resource_group_name, account_name, regenerate_key, custom_headers).value!
836
+ end
837
+
838
+ #
839
+ # Regenerates one of the access keys for the specified storage account.
840
+ #
841
+ # @param resource_group_name [String] The name of the resource group within the
842
+ # user's subscription.
843
+ # @param account_name [String] The name of the storage account within the
844
+ # specified resource group. Storage account names must be between 3 and 24
845
+ # characters in length and use numbers and lower-case letters only.
846
+ # @param regenerate_key [StorageAccountRegenerateKeyParameters] Specifies name
847
+ # of the key which should be regenerated -- key1 or key2.
848
+ # @param [Hash{String => String}] A hash of custom headers that will be added
849
+ # to the HTTP request.
850
+ #
851
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
852
+ #
853
+ def regenerate_key_async(resource_group_name, account_name, regenerate_key, custom_headers = nil)
854
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
855
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
856
+ fail ArgumentError, 'regenerate_key is nil' if regenerate_key.nil?
857
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
858
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
859
+
860
+
861
+ request_headers = {}
862
+
863
+ # Set Headers
864
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
865
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
866
+
867
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
868
+
869
+ # Serialize Request
870
+ request_mapper = Azure::Storage::Mgmt::V2016_01_01::Models::StorageAccountRegenerateKeyParameters.mapper()
871
+ request_content = @client.serialize(request_mapper, regenerate_key)
872
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
873
+
874
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'
875
+
876
+ request_url = @base_url || @client.base_url
877
+
878
+ options = {
879
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
880
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
881
+ query_params: {'api-version' => @client.api_version},
882
+ body: request_content,
883
+ headers: request_headers.merge(custom_headers || {}),
884
+ base_url: request_url
885
+ }
886
+ promise = @client.make_request_async(:post, path_template, options)
887
+
888
+ promise = promise.then do |result|
889
+ http_response = result.response
890
+ status_code = http_response.status
891
+ response_content = http_response.body
892
+ unless status_code == 200
893
+ error_model = JSON.load(response_content)
894
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
895
+ end
896
+
897
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
898
+ # Deserialize Response
899
+ if status_code == 200
900
+ begin
901
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
902
+ result_mapper = Azure::Storage::Mgmt::V2016_01_01::Models::StorageAccountListKeysResult.mapper()
903
+ result.body = @client.deserialize(result_mapper, parsed_response)
904
+ rescue Exception => e
905
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
906
+ end
907
+ end
908
+
909
+ result
910
+ end
911
+
912
+ promise.execute
913
+ end
914
+
915
+ #
916
+ # Asynchronously creates a new storage account with the specified parameters.
917
+ # If an account is already created and a subsequent create request is issued
918
+ # with different properties, the account properties will be updated. If an
919
+ # account is already created and a subsequent create or update request is
920
+ # issued with the exact same set of properties, the request will succeed.
921
+ #
922
+ # @param resource_group_name [String] The name of the resource group within the
923
+ # user's subscription.
924
+ # @param account_name [String] The name of the storage account within the
925
+ # specified resource group. Storage account names must be between 3 and 24
926
+ # characters in length and use numbers and lower-case letters only.
927
+ # @param parameters [StorageAccountCreateParameters] The parameters to provide
928
+ # for the created account.
929
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
930
+ # will be added to the HTTP request.
931
+ #
932
+ # @return [StorageAccount] operation results.
933
+ #
934
+ def begin_create(resource_group_name, account_name, parameters, custom_headers = nil)
935
+ response = begin_create_async(resource_group_name, account_name, parameters, custom_headers).value!
936
+ response.body unless response.nil?
937
+ end
938
+
939
+ #
940
+ # Asynchronously creates a new storage account with the specified parameters.
941
+ # If an account is already created and a subsequent create request is issued
942
+ # with different properties, the account properties will be updated. If an
943
+ # account is already created and a subsequent create or update request is
944
+ # issued with the exact same set of properties, the request will succeed.
945
+ #
946
+ # @param resource_group_name [String] The name of the resource group within the
947
+ # user's subscription.
948
+ # @param account_name [String] The name of the storage account within the
949
+ # specified resource group. Storage account names must be between 3 and 24
950
+ # characters in length and use numbers and lower-case letters only.
951
+ # @param parameters [StorageAccountCreateParameters] The parameters to provide
952
+ # for the created account.
953
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
954
+ # will be added to the HTTP request.
955
+ #
956
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
957
+ #
958
+ def begin_create_with_http_info(resource_group_name, account_name, parameters, custom_headers = nil)
959
+ begin_create_async(resource_group_name, account_name, parameters, custom_headers).value!
960
+ end
961
+
962
+ #
963
+ # Asynchronously creates a new storage account with the specified parameters.
964
+ # If an account is already created and a subsequent create request is issued
965
+ # with different properties, the account properties will be updated. If an
966
+ # account is already created and a subsequent create or update request is
967
+ # issued with the exact same set of properties, the request will succeed.
968
+ #
969
+ # @param resource_group_name [String] The name of the resource group within the
970
+ # user's subscription.
971
+ # @param account_name [String] The name of the storage account within the
972
+ # specified resource group. Storage account names must be between 3 and 24
973
+ # characters in length and use numbers and lower-case letters only.
974
+ # @param parameters [StorageAccountCreateParameters] The parameters to provide
975
+ # for the created account.
976
+ # @param [Hash{String => String}] A hash of custom headers that will be added
977
+ # to the HTTP request.
978
+ #
979
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
980
+ #
981
+ def begin_create_async(resource_group_name, account_name, parameters, custom_headers = nil)
982
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
983
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
984
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
985
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
986
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
987
+
988
+
989
+ request_headers = {}
990
+
991
+ # Set Headers
992
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
993
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
994
+
995
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
996
+
997
+ # Serialize Request
998
+ request_mapper = Azure::Storage::Mgmt::V2016_01_01::Models::StorageAccountCreateParameters.mapper()
999
+ request_content = @client.serialize(request_mapper, parameters)
1000
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1001
+
1002
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'
1003
+
1004
+ request_url = @base_url || @client.base_url
1005
+
1006
+ options = {
1007
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1008
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
1009
+ query_params: {'api-version' => @client.api_version},
1010
+ body: request_content,
1011
+ headers: request_headers.merge(custom_headers || {}),
1012
+ base_url: request_url
1013
+ }
1014
+ promise = @client.make_request_async(:put, path_template, options)
1015
+
1016
+ promise = promise.then do |result|
1017
+ http_response = result.response
1018
+ status_code = http_response.status
1019
+ response_content = http_response.body
1020
+ unless status_code == 200 || status_code == 202
1021
+ error_model = JSON.load(response_content)
1022
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1023
+ end
1024
+
1025
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1026
+ # Deserialize Response
1027
+ if status_code == 200
1028
+ begin
1029
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1030
+ result_mapper = Azure::Storage::Mgmt::V2016_01_01::Models::StorageAccount.mapper()
1031
+ result.body = @client.deserialize(result_mapper, parsed_response)
1032
+ rescue Exception => e
1033
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1034
+ end
1035
+ end
1036
+
1037
+ result
1038
+ end
1039
+
1040
+ promise.execute
1041
+ end
1042
+
1043
+ end
1044
+ end