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::V2017_06_01
7
7
  module Models
8
8
  #
9
9
  # The parameters used to regenerate the storage account key.
@@ -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::V2017_06_01
7
7
  module Models
8
8
  #
9
9
  # The parameters that can be provided when updating the storage account
@@ -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::V2017_06_01
7
7
  module Models
8
8
  #
9
9
  # The response from the List Storage SKUs operation.
@@ -0,0 +1,84 @@
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::V2017_06_01
7
+ module Models
8
+ #
9
+ # Describes Storage Resource Usage.
10
+ #
11
+ class Usage
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [UsageUnit] Gets the unit of measurement. Possible values
16
+ # include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond',
17
+ # 'BytesPerSecond'
18
+ attr_accessor :unit
19
+
20
+ # @return [Integer] Gets the current count of the allocated resources in
21
+ # the subscription.
22
+ attr_accessor :current_value
23
+
24
+ # @return [Integer] Gets the maximum count of the resources that can be
25
+ # allocated in the subscription.
26
+ attr_accessor :limit
27
+
28
+ # @return [UsageName] Gets the name of the type of usage.
29
+ attr_accessor :name
30
+
31
+
32
+ #
33
+ # Mapper for Usage class as Ruby Hash.
34
+ # This will be used for serialization/deserialization.
35
+ #
36
+ def self.mapper()
37
+ {
38
+ required: false,
39
+ serialized_name: 'Usage',
40
+ type: {
41
+ name: 'Composite',
42
+ class_name: 'Usage',
43
+ model_properties: {
44
+ unit: {
45
+ required: false,
46
+ read_only: true,
47
+ serialized_name: 'unit',
48
+ type: {
49
+ name: 'Enum',
50
+ module: 'UsageUnit'
51
+ }
52
+ },
53
+ current_value: {
54
+ required: false,
55
+ read_only: true,
56
+ serialized_name: 'currentValue',
57
+ type: {
58
+ name: 'Number'
59
+ }
60
+ },
61
+ limit: {
62
+ required: false,
63
+ read_only: true,
64
+ serialized_name: 'limit',
65
+ type: {
66
+ name: 'Number'
67
+ }
68
+ },
69
+ name: {
70
+ required: false,
71
+ read_only: true,
72
+ serialized_name: 'name',
73
+ type: {
74
+ name: 'Composite',
75
+ class_name: 'UsageName'
76
+ }
77
+ }
78
+ }
79
+ }
80
+ }
81
+ end
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,53 @@
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::V2017_06_01
7
+ module Models
8
+ #
9
+ # The response from the List Usages operation.
10
+ #
11
+ class UsageListResult
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [Array<Usage>] Gets or sets the list of Storage Resource
16
+ # Usages.
17
+ attr_accessor :value
18
+
19
+
20
+ #
21
+ # Mapper for UsageListResult class as Ruby Hash.
22
+ # This will be used for serialization/deserialization.
23
+ #
24
+ def self.mapper()
25
+ {
26
+ required: false,
27
+ serialized_name: 'UsageListResult',
28
+ type: {
29
+ name: 'Composite',
30
+ class_name: 'UsageListResult',
31
+ model_properties: {
32
+ value: {
33
+ required: false,
34
+ serialized_name: 'value',
35
+ type: {
36
+ name: 'Sequence',
37
+ element: {
38
+ required: false,
39
+ serialized_name: 'UsageElementType',
40
+ type: {
41
+ name: 'Composite',
42
+ class_name: 'Usage'
43
+ }
44
+ }
45
+ }
46
+ }
47
+ }
48
+ }
49
+ }
50
+ end
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,56 @@
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::V2017_06_01
7
+ module Models
8
+ #
9
+ # The usage names that can be used; currently limited to StorageAccount.
10
+ #
11
+ class UsageName
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] Gets a string describing the resource name.
16
+ attr_accessor :value
17
+
18
+ # @return [String] Gets a localized string describing the resource name.
19
+ attr_accessor :localized_value
20
+
21
+
22
+ #
23
+ # Mapper for UsageName class as Ruby Hash.
24
+ # This will be used for serialization/deserialization.
25
+ #
26
+ def self.mapper()
27
+ {
28
+ required: false,
29
+ serialized_name: 'UsageName',
30
+ type: {
31
+ name: 'Composite',
32
+ class_name: 'UsageName',
33
+ model_properties: {
34
+ value: {
35
+ required: false,
36
+ read_only: true,
37
+ serialized_name: 'value',
38
+ type: {
39
+ name: 'String'
40
+ }
41
+ },
42
+ localized_value: {
43
+ required: false,
44
+ read_only: true,
45
+ serialized_name: 'localizedValue',
46
+ type: {
47
+ name: 'String'
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }
53
+ end
54
+ end
55
+ end
56
+ end
@@ -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::V2017_06_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
@@ -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::V2017_06_01
7
7
  module Models
8
8
  #
9
9
  # Virtual Network rule.
@@ -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::V2017_06_01 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::Storage
6
+ module Azure::Storage::Mgmt::V2017_06_01
7
7
  #
8
8
  # The Azure Storage Management API.
9
9
  #
@@ -89,7 +89,7 @@ module Azure::ARM::Storage
89
89
  if status_code == 200
90
90
  begin
91
91
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
92
- result_mapper = Azure::ARM::Storage::Models::OperationListResult.mapper()
92
+ result_mapper = Azure::Storage::Mgmt::V2017_06_01::Models::OperationListResult.mapper()
93
93
  result.body = @client.deserialize(result_mapper, parsed_response)
94
94
  rescue Exception => e
95
95
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -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::V2017_06_01
7
7
  #
8
8
  # The Azure Storage Management API.
9
9
  #
@@ -94,7 +94,7 @@ module Azure::ARM::Storage
94
94
  if status_code == 200
95
95
  begin
96
96
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
97
- result_mapper = Azure::ARM::Storage::Models::StorageSkuListResult.mapper()
97
+ result_mapper = Azure::Storage::Mgmt::V2017_06_01::Models::StorageSkuListResult.mapper()
98
98
  result.body = @client.deserialize(result_mapper, parsed_response)
99
99
  rescue Exception => e
100
100
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -0,0 +1,1276 @@
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::V2017_06_01
7
+ #
8
+ # The Azure Storage Management API.
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::V2017_06_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::V2017_06_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. The name is case insensitive.
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. The name is case insensitive.
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::V2017_06_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. The name is case insensitive.
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. The name is case insensitive.
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. The name is case insensitive.
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. The name is case insensitive.
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. The name is case insensitive.
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. The name is case insensitive.
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::V2017_06_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. The name is case insensitive.
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. The name is case insensitive.
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. The name is case insensitive.
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::V2017_06_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::V2017_06_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::V2017_06_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. The name is case insensitive.
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. The name is case insensitive.
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. The name is case insensitive.
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::V2017_06_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. The name is case insensitive.
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. The name is case insensitive.
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. The name is case insensitive.
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::V2017_06_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. The name is case insensitive.
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. The name is case insensitive.
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. The name is case insensitive.
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::V2017_06_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::V2017_06_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
+ # List SAS credentials of a storage account.
917
+ #
918
+ # @param resource_group_name [String] The name of the resource group within the
919
+ # user's subscription. The name is case insensitive.
920
+ # @param account_name [String] The name of the storage account within the
921
+ # specified resource group. Storage account names must be between 3 and 24
922
+ # characters in length and use numbers and lower-case letters only.
923
+ # @param parameters [AccountSasParameters] The parameters to provide to list
924
+ # SAS credentials for the storage account.
925
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
926
+ # will be added to the HTTP request.
927
+ #
928
+ # @return [ListAccountSasResponse] operation results.
929
+ #
930
+ def list_account_sas(resource_group_name, account_name, parameters, custom_headers = nil)
931
+ response = list_account_sas_async(resource_group_name, account_name, parameters, custom_headers).value!
932
+ response.body unless response.nil?
933
+ end
934
+
935
+ #
936
+ # List SAS credentials of a storage account.
937
+ #
938
+ # @param resource_group_name [String] The name of the resource group within the
939
+ # user's subscription. The name is case insensitive.
940
+ # @param account_name [String] The name of the storage account within the
941
+ # specified resource group. Storage account names must be between 3 and 24
942
+ # characters in length and use numbers and lower-case letters only.
943
+ # @param parameters [AccountSasParameters] The parameters to provide to list
944
+ # SAS credentials for the storage account.
945
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
946
+ # will be added to the HTTP request.
947
+ #
948
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
949
+ #
950
+ def list_account_sas_with_http_info(resource_group_name, account_name, parameters, custom_headers = nil)
951
+ list_account_sas_async(resource_group_name, account_name, parameters, custom_headers).value!
952
+ end
953
+
954
+ #
955
+ # List SAS credentials of a storage account.
956
+ #
957
+ # @param resource_group_name [String] The name of the resource group within the
958
+ # user's subscription. The name is case insensitive.
959
+ # @param account_name [String] The name of the storage account within the
960
+ # specified resource group. Storage account names must be between 3 and 24
961
+ # characters in length and use numbers and lower-case letters only.
962
+ # @param parameters [AccountSasParameters] The parameters to provide to list
963
+ # SAS credentials for the storage account.
964
+ # @param [Hash{String => String}] A hash of custom headers that will be added
965
+ # to the HTTP request.
966
+ #
967
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
968
+ #
969
+ def list_account_sas_async(resource_group_name, account_name, parameters, custom_headers = nil)
970
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
971
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
972
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
973
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
974
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
975
+
976
+
977
+ request_headers = {}
978
+
979
+ # Set Headers
980
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
981
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
982
+
983
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
984
+
985
+ # Serialize Request
986
+ request_mapper = Azure::Storage::Mgmt::V2017_06_01::Models::AccountSasParameters.mapper()
987
+ request_content = @client.serialize(request_mapper, parameters)
988
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
989
+
990
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'
991
+
992
+ request_url = @base_url || @client.base_url
993
+
994
+ options = {
995
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
996
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
997
+ query_params: {'api-version' => @client.api_version},
998
+ body: request_content,
999
+ headers: request_headers.merge(custom_headers || {}),
1000
+ base_url: request_url
1001
+ }
1002
+ promise = @client.make_request_async(:post, path_template, options)
1003
+
1004
+ promise = promise.then do |result|
1005
+ http_response = result.response
1006
+ status_code = http_response.status
1007
+ response_content = http_response.body
1008
+ unless status_code == 200
1009
+ error_model = JSON.load(response_content)
1010
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1011
+ end
1012
+
1013
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1014
+ # Deserialize Response
1015
+ if status_code == 200
1016
+ begin
1017
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1018
+ result_mapper = Azure::Storage::Mgmt::V2017_06_01::Models::ListAccountSasResponse.mapper()
1019
+ result.body = @client.deserialize(result_mapper, parsed_response)
1020
+ rescue Exception => e
1021
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1022
+ end
1023
+ end
1024
+
1025
+ result
1026
+ end
1027
+
1028
+ promise.execute
1029
+ end
1030
+
1031
+ #
1032
+ # List service SAS credentials of a specific resource.
1033
+ #
1034
+ # @param resource_group_name [String] The name of the resource group within the
1035
+ # user's subscription. The name is case insensitive.
1036
+ # @param account_name [String] The name of the storage account within the
1037
+ # specified resource group. Storage account names must be between 3 and 24
1038
+ # characters in length and use numbers and lower-case letters only.
1039
+ # @param parameters [ServiceSasParameters] The parameters to provide to list
1040
+ # service SAS credentials.
1041
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1042
+ # will be added to the HTTP request.
1043
+ #
1044
+ # @return [ListServiceSasResponse] operation results.
1045
+ #
1046
+ def list_service_sas(resource_group_name, account_name, parameters, custom_headers = nil)
1047
+ response = list_service_sas_async(resource_group_name, account_name, parameters, custom_headers).value!
1048
+ response.body unless response.nil?
1049
+ end
1050
+
1051
+ #
1052
+ # List service SAS credentials of a specific resource.
1053
+ #
1054
+ # @param resource_group_name [String] The name of the resource group within the
1055
+ # user's subscription. The name is case insensitive.
1056
+ # @param account_name [String] The name of the storage account within the
1057
+ # specified resource group. Storage account names must be between 3 and 24
1058
+ # characters in length and use numbers and lower-case letters only.
1059
+ # @param parameters [ServiceSasParameters] The parameters to provide to list
1060
+ # service SAS credentials.
1061
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1062
+ # will be added to the HTTP request.
1063
+ #
1064
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1065
+ #
1066
+ def list_service_sas_with_http_info(resource_group_name, account_name, parameters, custom_headers = nil)
1067
+ list_service_sas_async(resource_group_name, account_name, parameters, custom_headers).value!
1068
+ end
1069
+
1070
+ #
1071
+ # List service SAS credentials of a specific resource.
1072
+ #
1073
+ # @param resource_group_name [String] The name of the resource group within the
1074
+ # user's subscription. The name is case insensitive.
1075
+ # @param account_name [String] The name of the storage account within the
1076
+ # specified resource group. Storage account names must be between 3 and 24
1077
+ # characters in length and use numbers and lower-case letters only.
1078
+ # @param parameters [ServiceSasParameters] The parameters to provide to list
1079
+ # service SAS credentials.
1080
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1081
+ # to the HTTP request.
1082
+ #
1083
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1084
+ #
1085
+ def list_service_sas_async(resource_group_name, account_name, parameters, custom_headers = nil)
1086
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1087
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1088
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1089
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1090
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1091
+
1092
+
1093
+ request_headers = {}
1094
+
1095
+ # Set Headers
1096
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1097
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1098
+
1099
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1100
+
1101
+ # Serialize Request
1102
+ request_mapper = Azure::Storage::Mgmt::V2017_06_01::Models::ServiceSasParameters.mapper()
1103
+ request_content = @client.serialize(request_mapper, parameters)
1104
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1105
+
1106
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'
1107
+
1108
+ request_url = @base_url || @client.base_url
1109
+
1110
+ options = {
1111
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1112
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
1113
+ query_params: {'api-version' => @client.api_version},
1114
+ body: request_content,
1115
+ headers: request_headers.merge(custom_headers || {}),
1116
+ base_url: request_url
1117
+ }
1118
+ promise = @client.make_request_async(:post, path_template, options)
1119
+
1120
+ promise = promise.then do |result|
1121
+ http_response = result.response
1122
+ status_code = http_response.status
1123
+ response_content = http_response.body
1124
+ unless status_code == 200
1125
+ error_model = JSON.load(response_content)
1126
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1127
+ end
1128
+
1129
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1130
+ # Deserialize Response
1131
+ if status_code == 200
1132
+ begin
1133
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1134
+ result_mapper = Azure::Storage::Mgmt::V2017_06_01::Models::ListServiceSasResponse.mapper()
1135
+ result.body = @client.deserialize(result_mapper, parsed_response)
1136
+ rescue Exception => e
1137
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1138
+ end
1139
+ end
1140
+
1141
+ result
1142
+ end
1143
+
1144
+ promise.execute
1145
+ end
1146
+
1147
+ #
1148
+ # Asynchronously creates a new storage account with the specified parameters.
1149
+ # If an account is already created and a subsequent create request is issued
1150
+ # with different properties, the account properties will be updated. If an
1151
+ # account is already created and a subsequent create or update request is
1152
+ # issued with the exact same set of properties, the request will succeed.
1153
+ #
1154
+ # @param resource_group_name [String] The name of the resource group within the
1155
+ # user's subscription. The name is case insensitive.
1156
+ # @param account_name [String] The name of the storage account within the
1157
+ # specified resource group. Storage account names must be between 3 and 24
1158
+ # characters in length and use numbers and lower-case letters only.
1159
+ # @param parameters [StorageAccountCreateParameters] The parameters to provide
1160
+ # for the created account.
1161
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1162
+ # will be added to the HTTP request.
1163
+ #
1164
+ # @return [StorageAccount] operation results.
1165
+ #
1166
+ def begin_create(resource_group_name, account_name, parameters, custom_headers = nil)
1167
+ response = begin_create_async(resource_group_name, account_name, parameters, custom_headers).value!
1168
+ response.body unless response.nil?
1169
+ end
1170
+
1171
+ #
1172
+ # Asynchronously creates a new storage account with the specified parameters.
1173
+ # If an account is already created and a subsequent create request is issued
1174
+ # with different properties, the account properties will be updated. If an
1175
+ # account is already created and a subsequent create or update request is
1176
+ # issued with the exact same set of properties, the request will succeed.
1177
+ #
1178
+ # @param resource_group_name [String] The name of the resource group within the
1179
+ # user's subscription. The name is case insensitive.
1180
+ # @param account_name [String] The name of the storage account within the
1181
+ # specified resource group. Storage account names must be between 3 and 24
1182
+ # characters in length and use numbers and lower-case letters only.
1183
+ # @param parameters [StorageAccountCreateParameters] The parameters to provide
1184
+ # for the created account.
1185
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1186
+ # will be added to the HTTP request.
1187
+ #
1188
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1189
+ #
1190
+ def begin_create_with_http_info(resource_group_name, account_name, parameters, custom_headers = nil)
1191
+ begin_create_async(resource_group_name, account_name, parameters, custom_headers).value!
1192
+ end
1193
+
1194
+ #
1195
+ # Asynchronously creates a new storage account with the specified parameters.
1196
+ # If an account is already created and a subsequent create request is issued
1197
+ # with different properties, the account properties will be updated. If an
1198
+ # account is already created and a subsequent create or update request is
1199
+ # issued with the exact same set of properties, the request will succeed.
1200
+ #
1201
+ # @param resource_group_name [String] The name of the resource group within the
1202
+ # user's subscription. The name is case insensitive.
1203
+ # @param account_name [String] The name of the storage account within the
1204
+ # specified resource group. Storage account names must be between 3 and 24
1205
+ # characters in length and use numbers and lower-case letters only.
1206
+ # @param parameters [StorageAccountCreateParameters] The parameters to provide
1207
+ # for the created account.
1208
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1209
+ # to the HTTP request.
1210
+ #
1211
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1212
+ #
1213
+ def begin_create_async(resource_group_name, account_name, parameters, custom_headers = nil)
1214
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1215
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1216
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1217
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1218
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1219
+
1220
+
1221
+ request_headers = {}
1222
+
1223
+ # Set Headers
1224
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1225
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1226
+
1227
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1228
+
1229
+ # Serialize Request
1230
+ request_mapper = Azure::Storage::Mgmt::V2017_06_01::Models::StorageAccountCreateParameters.mapper()
1231
+ request_content = @client.serialize(request_mapper, parameters)
1232
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1233
+
1234
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'
1235
+
1236
+ request_url = @base_url || @client.base_url
1237
+
1238
+ options = {
1239
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1240
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
1241
+ query_params: {'api-version' => @client.api_version},
1242
+ body: request_content,
1243
+ headers: request_headers.merge(custom_headers || {}),
1244
+ base_url: request_url
1245
+ }
1246
+ promise = @client.make_request_async(:put, path_template, options)
1247
+
1248
+ promise = promise.then do |result|
1249
+ http_response = result.response
1250
+ status_code = http_response.status
1251
+ response_content = http_response.body
1252
+ unless status_code == 200 || status_code == 202
1253
+ error_model = JSON.load(response_content)
1254
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1255
+ end
1256
+
1257
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1258
+ # Deserialize Response
1259
+ if status_code == 200
1260
+ begin
1261
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1262
+ result_mapper = Azure::Storage::Mgmt::V2017_06_01::Models::StorageAccount.mapper()
1263
+ result.body = @client.deserialize(result_mapper, parsed_response)
1264
+ rescue Exception => e
1265
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1266
+ end
1267
+ end
1268
+
1269
+ result
1270
+ end
1271
+
1272
+ promise.execute
1273
+ end
1274
+
1275
+ end
1276
+ end