azure_mgmt_netapp 0.18.2 → 0.20.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  3. data/lib/2019-05-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  4. data/lib/2019-06-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  5. data/lib/2019-07-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  6. data/lib/2019-08-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  7. data/lib/2019-10-01/generated/azure_mgmt_netapp.rb +71 -0
  8. data/lib/2019-10-01/generated/azure_mgmt_netapp/accounts.rb +651 -0
  9. data/lib/2019-10-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +157 -0
  10. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/active_directory.rb +127 -0
  11. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/authorize_request.rb +46 -0
  12. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/capacity_pool.rb +161 -0
  13. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/capacity_pool_list.rb +55 -0
  14. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/capacity_pool_patch.rb +133 -0
  15. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/check_name_resource_types.rb +18 -0
  16. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/dimension.rb +57 -0
  17. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/endpoint_type.rb +16 -0
  18. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/export_policy_rule.rb +113 -0
  19. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/in_availability_reason_type.rb +16 -0
  20. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/metric_specification.rb +145 -0
  21. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/mirror_state.rb +17 -0
  22. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/mount_target.rb +230 -0
  23. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/mount_target_list.rb +55 -0
  24. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/net_app_account.rb +133 -0
  25. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/net_app_account_list.rb +55 -0
  26. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/net_app_account_patch.rb +133 -0
  27. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/operation.rb +83 -0
  28. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/operation_display.rb +79 -0
  29. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/operation_list_result.rb +57 -0
  30. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/relationship_status.rb +16 -0
  31. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/replication_object.rb +94 -0
  32. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/replication_schedule.rb +19 -0
  33. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/replication_status.rb +93 -0
  34. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/resource_name_availability.rb +78 -0
  35. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/resource_name_availability_request.rb +72 -0
  36. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/service_level.rb +17 -0
  37. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/service_specification.rb +56 -0
  38. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/snapshot.rb +158 -0
  39. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/snapshot_patch.rb +54 -0
  40. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/snapshots_list.rb +55 -0
  41. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/volume.rb +300 -0
  42. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/volume_list.rb +55 -0
  43. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/volume_patch.rb +147 -0
  44. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/volume_patch_properties_export_policy.rb +58 -0
  45. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/volume_properties_data_protection.rb +50 -0
  46. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/volume_properties_export_policy.rb +58 -0
  47. data/lib/2019-10-01/generated/azure_mgmt_netapp/module_definition.rb +9 -0
  48. data/lib/2019-10-01/generated/azure_mgmt_netapp/mount_targets.rb +136 -0
  49. data/lib/2019-10-01/generated/azure_mgmt_netapp/net_app_resource.rb +291 -0
  50. data/lib/2019-10-01/generated/azure_mgmt_netapp/operations.rb +115 -0
  51. data/lib/2019-10-01/generated/azure_mgmt_netapp/pools.rb +675 -0
  52. data/lib/2019-10-01/generated/azure_mgmt_netapp/snapshots.rb +708 -0
  53. data/lib/2019-10-01/generated/azure_mgmt_netapp/volumes.rb +1228 -0
  54. data/lib/2019-11-01/generated/azure_mgmt_netapp.rb +70 -0
  55. data/lib/2019-11-01/generated/azure_mgmt_netapp/accounts.rb +651 -0
  56. data/lib/2019-11-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +153 -0
  57. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/active_directory.rb +139 -0
  58. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/authorize_request.rb +46 -0
  59. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/capacity_pool.rb +161 -0
  60. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/capacity_pool_list.rb +55 -0
  61. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/capacity_pool_patch.rb +133 -0
  62. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/check_name_resource_types.rb +18 -0
  63. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/dimension.rb +57 -0
  64. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/endpoint_type.rb +16 -0
  65. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/export_policy_rule.rb +113 -0
  66. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/in_availability_reason_type.rb +16 -0
  67. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/metric_specification.rb +145 -0
  68. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/mirror_state.rb +17 -0
  69. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/mount_target.rb +218 -0
  70. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/mount_target_properties.rb +152 -0
  71. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/net_app_account.rb +133 -0
  72. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/net_app_account_list.rb +55 -0
  73. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/net_app_account_patch.rb +133 -0
  74. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/operation.rb +83 -0
  75. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/operation_display.rb +79 -0
  76. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/operation_list_result.rb +57 -0
  77. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/relationship_status.rb +16 -0
  78. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/replication_object.rb +94 -0
  79. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/replication_schedule.rb +19 -0
  80. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/replication_status.rb +93 -0
  81. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/resource_name_availability.rb +78 -0
  82. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/resource_name_availability_request.rb +72 -0
  83. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/service_level.rb +17 -0
  84. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/service_specification.rb +56 -0
  85. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/snapshot.rb +139 -0
  86. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/snapshots_list.rb +55 -0
  87. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/volume.rb +315 -0
  88. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/volume_list.rb +55 -0
  89. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/volume_patch.rb +147 -0
  90. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/volume_patch_properties_export_policy.rb +58 -0
  91. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/volume_properties_data_protection.rb +50 -0
  92. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/volume_properties_export_policy.rb +58 -0
  93. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/volume_revert.rb +46 -0
  94. data/lib/2019-11-01/generated/azure_mgmt_netapp/module_definition.rb +9 -0
  95. data/lib/2019-11-01/generated/azure_mgmt_netapp/net_app_resource.rb +291 -0
  96. data/lib/2019-11-01/generated/azure_mgmt_netapp/operations.rb +115 -0
  97. data/lib/2019-11-01/generated/azure_mgmt_netapp/pools.rb +737 -0
  98. data/lib/2019-11-01/generated/azure_mgmt_netapp/snapshots.rb +794 -0
  99. data/lib/2019-11-01/generated/azure_mgmt_netapp/volumes.rb +1688 -0
  100. data/lib/2020-02-01/generated/azure_mgmt_netapp.rb +71 -0
  101. data/lib/2020-02-01/generated/azure_mgmt_netapp/accounts.rb +709 -0
  102. data/lib/2020-02-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +153 -0
  103. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/active_directory.rb +160 -0
  104. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/authorize_request.rb +46 -0
  105. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/capacity_pool.rb +161 -0
  106. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/capacity_pool_list.rb +55 -0
  107. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/capacity_pool_patch.rb +133 -0
  108. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/check_name_resource_types.rb +18 -0
  109. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/dimension.rb +57 -0
  110. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/endpoint_type.rb +16 -0
  111. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/export_policy_rule.rb +115 -0
  112. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/in_availability_reason_type.rb +16 -0
  113. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/metric_specification.rb +145 -0
  114. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/mirror_state.rb +17 -0
  115. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/mount_target.rb +218 -0
  116. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/mount_target_properties.rb +152 -0
  117. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/net_app_account.rb +133 -0
  118. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/net_app_account_list.rb +55 -0
  119. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/net_app_account_patch.rb +133 -0
  120. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/operation.rb +83 -0
  121. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/operation_display.rb +79 -0
  122. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/operation_list_result.rb +57 -0
  123. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/relationship_status.rb +16 -0
  124. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/replication_object.rb +94 -0
  125. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/replication_schedule.rb +19 -0
  126. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/replication_status.rb +93 -0
  127. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/resource_name_availability.rb +78 -0
  128. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/resource_name_availability_request.rb +72 -0
  129. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/service_level.rb +17 -0
  130. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/service_specification.rb +56 -0
  131. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/snapshot.rb +123 -0
  132. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/snapshots_list.rb +55 -0
  133. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/volume.rb +328 -0
  134. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/volume_list.rb +55 -0
  135. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/volume_patch.rb +147 -0
  136. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/volume_patch_properties_export_policy.rb +58 -0
  137. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/volume_properties_data_protection.rb +62 -0
  138. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/volume_properties_export_policy.rb +58 -0
  139. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/volume_revert.rb +46 -0
  140. data/lib/2020-02-01/generated/azure_mgmt_netapp/models/volume_snapshot_properties.rb +46 -0
  141. data/lib/2020-02-01/generated/azure_mgmt_netapp/module_definition.rb +9 -0
  142. data/lib/2020-02-01/generated/azure_mgmt_netapp/net_app_resource.rb +291 -0
  143. data/lib/2020-02-01/generated/azure_mgmt_netapp/operations.rb +115 -0
  144. data/lib/2020-02-01/generated/azure_mgmt_netapp/pools.rb +737 -0
  145. data/lib/2020-02-01/generated/azure_mgmt_netapp/snapshots.rb +794 -0
  146. data/lib/2020-02-01/generated/azure_mgmt_netapp/volumes.rb +1688 -0
  147. data/lib/azure_mgmt_netapp.rb +3 -0
  148. data/lib/profiles/latest/modules/netapp_profile_module.rb +120 -94
  149. data/lib/version.rb +1 -1
  150. metadata +144 -4
@@ -0,0 +1,291 @@
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::NetApp::Mgmt::V2019_10_01
7
+ #
8
+ # Microsoft NetApp Azure Resource Provider specification
9
+ #
10
+ class NetAppResource
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the NetAppResource class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [AzureNetAppFilesManagementClient] reference to the AzureNetAppFilesManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Check resource name availability
26
+ #
27
+ # Check if a resource name is available.
28
+ #
29
+ # @param location [String] The location
30
+ # @param name [String] Resource name to verify.
31
+ # @param type [CheckNameResourceTypes] Resource type used for verification.
32
+ # Possible values include: 'Microsoft.NetApp/netAppAccounts',
33
+ # 'Microsoft.NetApp/netAppAccounts/capacityPools',
34
+ # 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes',
35
+ # 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots'
36
+ # @param resource_group [String] Resource group name.
37
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
38
+ # will be added to the HTTP request.
39
+ #
40
+ # @return [ResourceNameAvailability] operation results.
41
+ #
42
+ def check_name_availability(location, name, type, resource_group, custom_headers:nil)
43
+ response = check_name_availability_async(location, name, type, resource_group, custom_headers:custom_headers).value!
44
+ response.body unless response.nil?
45
+ end
46
+
47
+ #
48
+ # Check resource name availability
49
+ #
50
+ # Check if a resource name is available.
51
+ #
52
+ # @param location [String] The location
53
+ # @param name [String] Resource name to verify.
54
+ # @param type [CheckNameResourceTypes] Resource type used for verification.
55
+ # Possible values include: 'Microsoft.NetApp/netAppAccounts',
56
+ # 'Microsoft.NetApp/netAppAccounts/capacityPools',
57
+ # 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes',
58
+ # 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots'
59
+ # @param resource_group [String] Resource group name.
60
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
61
+ # will be added to the HTTP request.
62
+ #
63
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
64
+ #
65
+ def check_name_availability_with_http_info(location, name, type, resource_group, custom_headers:nil)
66
+ check_name_availability_async(location, name, type, resource_group, custom_headers:custom_headers).value!
67
+ end
68
+
69
+ #
70
+ # Check resource name availability
71
+ #
72
+ # Check if a resource name is available.
73
+ #
74
+ # @param location [String] The location
75
+ # @param name [String] Resource name to verify.
76
+ # @param type [CheckNameResourceTypes] Resource type used for verification.
77
+ # Possible values include: 'Microsoft.NetApp/netAppAccounts',
78
+ # 'Microsoft.NetApp/netAppAccounts/capacityPools',
79
+ # 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes',
80
+ # 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots'
81
+ # @param resource_group [String] Resource group name.
82
+ # @param [Hash{String => String}] A hash of custom headers that will be added
83
+ # to the HTTP request.
84
+ #
85
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
86
+ #
87
+ def check_name_availability_async(location, name, type, resource_group, custom_headers:nil)
88
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
89
+ fail ArgumentError, 'location is nil' if location.nil?
90
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
91
+ fail ArgumentError, 'name is nil' if name.nil?
92
+ fail ArgumentError, 'type is nil' if type.nil?
93
+ fail ArgumentError, 'resource_group is nil' if resource_group.nil?
94
+
95
+ body = ResourceNameAvailabilityRequest.new
96
+ unless name.nil? && type.nil? && resource_group.nil?
97
+ body.name = name
98
+ body.type = type
99
+ body.resource_group = resource_group
100
+ end
101
+
102
+ request_headers = {}
103
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
104
+
105
+ # Set Headers
106
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
107
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
108
+
109
+ # Serialize Request
110
+ request_mapper = Azure::NetApp::Mgmt::V2019_10_01::Models::ResourceNameAvailabilityRequest.mapper()
111
+ request_content = @client.serialize(request_mapper, body)
112
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
113
+
114
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkNameAvailability'
115
+
116
+ request_url = @base_url || @client.base_url
117
+
118
+ options = {
119
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
120
+ path_params: {'subscriptionId' => @client.subscription_id,'location' => location},
121
+ query_params: {'api-version' => @client.api_version},
122
+ body: request_content,
123
+ headers: request_headers.merge(custom_headers || {}),
124
+ base_url: request_url
125
+ }
126
+ promise = @client.make_request_async(:post, path_template, options)
127
+
128
+ promise = promise.then do |result|
129
+ http_response = result.response
130
+ status_code = http_response.status
131
+ response_content = http_response.body
132
+ unless status_code == 200
133
+ error_model = JSON.load(response_content)
134
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
135
+ end
136
+
137
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
138
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
139
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
140
+ # Deserialize Response
141
+ if status_code == 200
142
+ begin
143
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
144
+ result_mapper = Azure::NetApp::Mgmt::V2019_10_01::Models::ResourceNameAvailability.mapper()
145
+ result.body = @client.deserialize(result_mapper, parsed_response)
146
+ rescue Exception => e
147
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
148
+ end
149
+ end
150
+
151
+ result
152
+ end
153
+
154
+ promise.execute
155
+ end
156
+
157
+ #
158
+ # Check file path availability
159
+ #
160
+ # Check if a file path is available.
161
+ #
162
+ # @param location [String] The location
163
+ # @param name [String] Resource name to verify.
164
+ # @param type [CheckNameResourceTypes] Resource type used for verification.
165
+ # Possible values include: 'Microsoft.NetApp/netAppAccounts',
166
+ # 'Microsoft.NetApp/netAppAccounts/capacityPools',
167
+ # 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes',
168
+ # 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots'
169
+ # @param resource_group [String] Resource group name.
170
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
171
+ # will be added to the HTTP request.
172
+ #
173
+ # @return [ResourceNameAvailability] operation results.
174
+ #
175
+ def check_file_path_availability(location, name, type, resource_group, custom_headers:nil)
176
+ response = check_file_path_availability_async(location, name, type, resource_group, custom_headers:custom_headers).value!
177
+ response.body unless response.nil?
178
+ end
179
+
180
+ #
181
+ # Check file path availability
182
+ #
183
+ # Check if a file path is available.
184
+ #
185
+ # @param location [String] The location
186
+ # @param name [String] Resource name to verify.
187
+ # @param type [CheckNameResourceTypes] Resource type used for verification.
188
+ # Possible values include: 'Microsoft.NetApp/netAppAccounts',
189
+ # 'Microsoft.NetApp/netAppAccounts/capacityPools',
190
+ # 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes',
191
+ # 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots'
192
+ # @param resource_group [String] Resource group name.
193
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
194
+ # will be added to the HTTP request.
195
+ #
196
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
197
+ #
198
+ def check_file_path_availability_with_http_info(location, name, type, resource_group, custom_headers:nil)
199
+ check_file_path_availability_async(location, name, type, resource_group, custom_headers:custom_headers).value!
200
+ end
201
+
202
+ #
203
+ # Check file path availability
204
+ #
205
+ # Check if a file path is available.
206
+ #
207
+ # @param location [String] The location
208
+ # @param name [String] Resource name to verify.
209
+ # @param type [CheckNameResourceTypes] Resource type used for verification.
210
+ # Possible values include: 'Microsoft.NetApp/netAppAccounts',
211
+ # 'Microsoft.NetApp/netAppAccounts/capacityPools',
212
+ # 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes',
213
+ # 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots'
214
+ # @param resource_group [String] Resource group name.
215
+ # @param [Hash{String => String}] A hash of custom headers that will be added
216
+ # to the HTTP request.
217
+ #
218
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
219
+ #
220
+ def check_file_path_availability_async(location, name, type, resource_group, custom_headers:nil)
221
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
222
+ fail ArgumentError, 'location is nil' if location.nil?
223
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
224
+ fail ArgumentError, 'name is nil' if name.nil?
225
+ fail ArgumentError, 'type is nil' if type.nil?
226
+ fail ArgumentError, 'resource_group is nil' if resource_group.nil?
227
+
228
+ body = ResourceNameAvailabilityRequest.new
229
+ unless name.nil? && type.nil? && resource_group.nil?
230
+ body.name = name
231
+ body.type = type
232
+ body.resource_group = resource_group
233
+ end
234
+
235
+ request_headers = {}
236
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
237
+
238
+ # Set Headers
239
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
240
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
241
+
242
+ # Serialize Request
243
+ request_mapper = Azure::NetApp::Mgmt::V2019_10_01::Models::ResourceNameAvailabilityRequest.mapper()
244
+ request_content = @client.serialize(request_mapper, body)
245
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
246
+
247
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkFilePathAvailability'
248
+
249
+ request_url = @base_url || @client.base_url
250
+
251
+ options = {
252
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
253
+ path_params: {'subscriptionId' => @client.subscription_id,'location' => location},
254
+ query_params: {'api-version' => @client.api_version},
255
+ body: request_content,
256
+ headers: request_headers.merge(custom_headers || {}),
257
+ base_url: request_url
258
+ }
259
+ promise = @client.make_request_async(:post, path_template, options)
260
+
261
+ promise = promise.then do |result|
262
+ http_response = result.response
263
+ status_code = http_response.status
264
+ response_content = http_response.body
265
+ unless status_code == 200
266
+ error_model = JSON.load(response_content)
267
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
268
+ end
269
+
270
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
271
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
272
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
273
+ # Deserialize Response
274
+ if status_code == 200
275
+ begin
276
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
277
+ result_mapper = Azure::NetApp::Mgmt::V2019_10_01::Models::ResourceNameAvailability.mapper()
278
+ result.body = @client.deserialize(result_mapper, parsed_response)
279
+ rescue Exception => e
280
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
281
+ end
282
+ end
283
+
284
+ result
285
+ end
286
+
287
+ promise.execute
288
+ end
289
+
290
+ end
291
+ end
@@ -0,0 +1,115 @@
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::NetApp::Mgmt::V2019_10_01
7
+ #
8
+ # Microsoft NetApp Azure Resource Provider specification
9
+ #
10
+ class Operations
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Operations class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [AzureNetAppFilesManagementClient] reference to the AzureNetAppFilesManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Describes the Resource Provider
26
+ #
27
+ # Lists all of the available Microsoft.NetApp Rest API operations
28
+ #
29
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
30
+ # will be added to the HTTP request.
31
+ #
32
+ # @return [OperationListResult] operation results.
33
+ #
34
+ def list(custom_headers:nil)
35
+ response = list_async(custom_headers:custom_headers).value!
36
+ response.body unless response.nil?
37
+ end
38
+
39
+ #
40
+ # Describes the Resource Provider
41
+ #
42
+ # Lists all of the available Microsoft.NetApp Rest API operations
43
+ #
44
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
45
+ # will be added to the HTTP request.
46
+ #
47
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
48
+ #
49
+ def list_with_http_info(custom_headers:nil)
50
+ list_async(custom_headers:custom_headers).value!
51
+ end
52
+
53
+ #
54
+ # Describes the Resource Provider
55
+ #
56
+ # Lists all of the available Microsoft.NetApp Rest API operations
57
+ #
58
+ # @param [Hash{String => String}] A hash of custom headers that will be added
59
+ # to the HTTP request.
60
+ #
61
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
62
+ #
63
+ def list_async(custom_headers:nil)
64
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
65
+
66
+
67
+ request_headers = {}
68
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
69
+
70
+ # Set Headers
71
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
72
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
73
+ path_template = 'providers/Microsoft.NetApp/operations'
74
+
75
+ request_url = @base_url || @client.base_url
76
+
77
+ options = {
78
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
79
+ query_params: {'api-version' => @client.api_version},
80
+ headers: request_headers.merge(custom_headers || {}),
81
+ base_url: request_url
82
+ }
83
+ promise = @client.make_request_async(:get, path_template, options)
84
+
85
+ promise = promise.then do |result|
86
+ http_response = result.response
87
+ status_code = http_response.status
88
+ response_content = http_response.body
89
+ unless status_code == 200
90
+ error_model = JSON.load(response_content)
91
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
92
+ end
93
+
94
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
95
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
96
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
97
+ # Deserialize Response
98
+ if status_code == 200
99
+ begin
100
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
101
+ result_mapper = Azure::NetApp::Mgmt::V2019_10_01::Models::OperationListResult.mapper()
102
+ result.body = @client.deserialize(result_mapper, parsed_response)
103
+ rescue Exception => e
104
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
105
+ end
106
+ end
107
+
108
+ result
109
+ end
110
+
111
+ promise.execute
112
+ end
113
+
114
+ end
115
+ end
@@ -0,0 +1,675 @@
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::NetApp::Mgmt::V2019_10_01
7
+ #
8
+ # Microsoft NetApp Azure Resource Provider specification
9
+ #
10
+ class Pools
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Pools class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [AzureNetAppFilesManagementClient] reference to the AzureNetAppFilesManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Describe all Capacity Pools
26
+ #
27
+ # List all capacity pools in the NetApp Account
28
+ #
29
+ # @param resource_group_name [String] The name of the resource group.
30
+ # @param account_name [String] The name of the NetApp account
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [CapacityPoolList] operation results.
35
+ #
36
+ def list(resource_group_name, account_name, custom_headers:nil)
37
+ response = list_async(resource_group_name, account_name, custom_headers:custom_headers).value!
38
+ response.body unless response.nil?
39
+ end
40
+
41
+ #
42
+ # Describe all Capacity Pools
43
+ #
44
+ # List all capacity pools in the NetApp Account
45
+ #
46
+ # @param resource_group_name [String] The name of the resource group.
47
+ # @param account_name [String] The name of the NetApp account
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 list_with_http_info(resource_group_name, account_name, custom_headers:nil)
54
+ list_async(resource_group_name, account_name, custom_headers:custom_headers).value!
55
+ end
56
+
57
+ #
58
+ # Describe all Capacity Pools
59
+ #
60
+ # List all capacity pools in the NetApp Account
61
+ #
62
+ # @param resource_group_name [String] The name of the resource group.
63
+ # @param account_name [String] The name of the NetApp account
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 list_async(resource_group_name, account_name, custom_headers:nil)
70
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
71
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
72
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
73
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
74
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
75
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
76
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
77
+
78
+
79
+ request_headers = {}
80
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
81
+
82
+ # Set Headers
83
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
84
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
85
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools'
86
+
87
+ request_url = @base_url || @client.base_url
88
+
89
+ options = {
90
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
91
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
92
+ query_params: {'api-version' => @client.api_version},
93
+ headers: request_headers.merge(custom_headers || {}),
94
+ base_url: request_url
95
+ }
96
+ promise = @client.make_request_async(:get, path_template, options)
97
+
98
+ promise = promise.then do |result|
99
+ http_response = result.response
100
+ status_code = http_response.status
101
+ response_content = http_response.body
102
+ unless status_code == 200
103
+ error_model = JSON.load(response_content)
104
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
105
+ end
106
+
107
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
108
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
109
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
110
+ # Deserialize Response
111
+ if status_code == 200
112
+ begin
113
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
114
+ result_mapper = Azure::NetApp::Mgmt::V2019_10_01::Models::CapacityPoolList.mapper()
115
+ result.body = @client.deserialize(result_mapper, parsed_response)
116
+ rescue Exception => e
117
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
118
+ end
119
+ end
120
+
121
+ result
122
+ end
123
+
124
+ promise.execute
125
+ end
126
+
127
+ #
128
+ # Describe a Capacity Pool
129
+ #
130
+ # Get details of the specified capacity pool
131
+ #
132
+ # @param resource_group_name [String] The name of the resource group.
133
+ # @param account_name [String] The name of the NetApp account
134
+ # @param pool_name [String] The name of the capacity pool
135
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
136
+ # will be added to the HTTP request.
137
+ #
138
+ # @return [CapacityPool] operation results.
139
+ #
140
+ def get(resource_group_name, account_name, pool_name, custom_headers:nil)
141
+ response = get_async(resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
142
+ response.body unless response.nil?
143
+ end
144
+
145
+ #
146
+ # Describe a Capacity Pool
147
+ #
148
+ # Get details of the specified capacity pool
149
+ #
150
+ # @param resource_group_name [String] The name of the resource group.
151
+ # @param account_name [String] The name of the NetApp account
152
+ # @param pool_name [String] The name of the capacity pool
153
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
154
+ # will be added to the HTTP request.
155
+ #
156
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
157
+ #
158
+ def get_with_http_info(resource_group_name, account_name, pool_name, custom_headers:nil)
159
+ get_async(resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
160
+ end
161
+
162
+ #
163
+ # Describe a Capacity Pool
164
+ #
165
+ # Get details of the specified capacity pool
166
+ #
167
+ # @param resource_group_name [String] The name of the resource group.
168
+ # @param account_name [String] The name of the NetApp account
169
+ # @param pool_name [String] The name of the capacity pool
170
+ # @param [Hash{String => String}] A hash of custom headers that will be added
171
+ # to the HTTP request.
172
+ #
173
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
174
+ #
175
+ def get_async(resource_group_name, account_name, pool_name, custom_headers:nil)
176
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
177
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
178
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
179
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
180
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
181
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
182
+ fail ArgumentError, 'pool_name is nil' if pool_name.nil?
183
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
184
+
185
+
186
+ request_headers = {}
187
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
188
+
189
+ # Set Headers
190
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
191
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
192
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}'
193
+
194
+ request_url = @base_url || @client.base_url
195
+
196
+ options = {
197
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
198
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'poolName' => pool_name},
199
+ query_params: {'api-version' => @client.api_version},
200
+ headers: request_headers.merge(custom_headers || {}),
201
+ base_url: request_url
202
+ }
203
+ promise = @client.make_request_async(:get, path_template, options)
204
+
205
+ promise = promise.then do |result|
206
+ http_response = result.response
207
+ status_code = http_response.status
208
+ response_content = http_response.body
209
+ unless status_code == 200
210
+ error_model = JSON.load(response_content)
211
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
212
+ end
213
+
214
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
215
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
216
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
217
+ # Deserialize Response
218
+ if status_code == 200
219
+ begin
220
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
221
+ result_mapper = Azure::NetApp::Mgmt::V2019_10_01::Models::CapacityPool.mapper()
222
+ result.body = @client.deserialize(result_mapper, parsed_response)
223
+ rescue Exception => e
224
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
225
+ end
226
+ end
227
+
228
+ result
229
+ end
230
+
231
+ promise.execute
232
+ end
233
+
234
+ #
235
+ # Create or Update the specified capacity pool within the resource group
236
+ #
237
+ # Create or Update a capacity pool
238
+ #
239
+ # @param body [CapacityPool] Capacity pool object supplied in the body of the
240
+ # operation.
241
+ # @param resource_group_name [String] The name of the resource group.
242
+ # @param account_name [String] The name of the NetApp account
243
+ # @param pool_name [String] The name of the capacity pool
244
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
245
+ # will be added to the HTTP request.
246
+ #
247
+ # @return [CapacityPool] operation results.
248
+ #
249
+ def create_or_update(body, resource_group_name, account_name, pool_name, custom_headers:nil)
250
+ response = create_or_update_async(body, resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
251
+ response.body unless response.nil?
252
+ end
253
+
254
+ #
255
+ # @param body [CapacityPool] Capacity pool object supplied in the body of the
256
+ # operation.
257
+ # @param resource_group_name [String] The name of the resource group.
258
+ # @param account_name [String] The name of the NetApp account
259
+ # @param pool_name [String] The name of the capacity pool
260
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
261
+ # will be added to the HTTP request.
262
+ #
263
+ # @return [Concurrent::Promise] promise which provides async access to http
264
+ # response.
265
+ #
266
+ def create_or_update_async(body, resource_group_name, account_name, pool_name, custom_headers:nil)
267
+ # Send request
268
+ promise = begin_create_or_update_async(body, resource_group_name, account_name, pool_name, custom_headers:custom_headers)
269
+
270
+ promise = promise.then do |response|
271
+ # Defining deserialization method.
272
+ deserialize_method = lambda do |parsed_response|
273
+ result_mapper = Azure::NetApp::Mgmt::V2019_10_01::Models::CapacityPool.mapper()
274
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
275
+ end
276
+
277
+ # Waiting for response.
278
+ @client.get_long_running_operation_result(response, deserialize_method)
279
+ end
280
+
281
+ promise
282
+ end
283
+
284
+ #
285
+ # Update a capacity pool
286
+ #
287
+ # Patch the specified capacity pool
288
+ #
289
+ # @param body [CapacityPoolPatch] Capacity pool object supplied in the body of
290
+ # the operation.
291
+ # @param resource_group_name [String] The name of the resource group.
292
+ # @param account_name [String] The name of the NetApp account
293
+ # @param pool_name [String] The name of the capacity pool
294
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
295
+ # will be added to the HTTP request.
296
+ #
297
+ # @return [CapacityPool] operation results.
298
+ #
299
+ def update(body, resource_group_name, account_name, pool_name, custom_headers:nil)
300
+ response = update_async(body, resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
301
+ response.body unless response.nil?
302
+ end
303
+
304
+ #
305
+ # Update a capacity pool
306
+ #
307
+ # Patch the specified capacity pool
308
+ #
309
+ # @param body [CapacityPoolPatch] Capacity pool object supplied in the body of
310
+ # the operation.
311
+ # @param resource_group_name [String] The name of the resource group.
312
+ # @param account_name [String] The name of the NetApp account
313
+ # @param pool_name [String] The name of the capacity pool
314
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
315
+ # will be added to the HTTP request.
316
+ #
317
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
318
+ #
319
+ def update_with_http_info(body, resource_group_name, account_name, pool_name, custom_headers:nil)
320
+ update_async(body, resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
321
+ end
322
+
323
+ #
324
+ # Update a capacity pool
325
+ #
326
+ # Patch the specified capacity pool
327
+ #
328
+ # @param body [CapacityPoolPatch] Capacity pool object supplied in the body of
329
+ # the operation.
330
+ # @param resource_group_name [String] The name of the resource group.
331
+ # @param account_name [String] The name of the NetApp account
332
+ # @param pool_name [String] The name of the capacity pool
333
+ # @param [Hash{String => String}] A hash of custom headers that will be added
334
+ # to the HTTP request.
335
+ #
336
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
337
+ #
338
+ def update_async(body, resource_group_name, account_name, pool_name, custom_headers:nil)
339
+ fail ArgumentError, 'body is nil' if body.nil?
340
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
341
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
342
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
343
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
344
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
345
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
346
+ fail ArgumentError, 'pool_name is nil' if pool_name.nil?
347
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
348
+
349
+
350
+ request_headers = {}
351
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
352
+
353
+ # Set Headers
354
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
355
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
356
+
357
+ # Serialize Request
358
+ request_mapper = Azure::NetApp::Mgmt::V2019_10_01::Models::CapacityPoolPatch.mapper()
359
+ request_content = @client.serialize(request_mapper, body)
360
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
361
+
362
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}'
363
+
364
+ request_url = @base_url || @client.base_url
365
+
366
+ options = {
367
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
368
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'poolName' => pool_name},
369
+ query_params: {'api-version' => @client.api_version},
370
+ body: request_content,
371
+ headers: request_headers.merge(custom_headers || {}),
372
+ base_url: request_url
373
+ }
374
+ promise = @client.make_request_async(:patch, path_template, options)
375
+
376
+ promise = promise.then do |result|
377
+ http_response = result.response
378
+ status_code = http_response.status
379
+ response_content = http_response.body
380
+ unless status_code == 200 || status_code == 202
381
+ error_model = JSON.load(response_content)
382
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
383
+ end
384
+
385
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
386
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
387
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
388
+ # Deserialize Response
389
+ if status_code == 200
390
+ begin
391
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
392
+ result_mapper = Azure::NetApp::Mgmt::V2019_10_01::Models::CapacityPool.mapper()
393
+ result.body = @client.deserialize(result_mapper, parsed_response)
394
+ rescue Exception => e
395
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
396
+ end
397
+ end
398
+
399
+ result
400
+ end
401
+
402
+ promise.execute
403
+ end
404
+
405
+ #
406
+ # Delete a capacity pool
407
+ #
408
+ # Delete the specified capacity pool
409
+ #
410
+ # @param resource_group_name [String] The name of the resource group.
411
+ # @param account_name [String] The name of the NetApp account
412
+ # @param pool_name [String] The name of the capacity pool
413
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
414
+ # will be added to the HTTP request.
415
+ #
416
+ def delete(resource_group_name, account_name, pool_name, custom_headers:nil)
417
+ response = delete_async(resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
418
+ nil
419
+ end
420
+
421
+ #
422
+ # @param resource_group_name [String] The name of the resource group.
423
+ # @param account_name [String] The name of the NetApp account
424
+ # @param pool_name [String] The name of the capacity pool
425
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
426
+ # will be added to the HTTP request.
427
+ #
428
+ # @return [Concurrent::Promise] promise which provides async access to http
429
+ # response.
430
+ #
431
+ def delete_async(resource_group_name, account_name, pool_name, custom_headers:nil)
432
+ # Send request
433
+ promise = begin_delete_async(resource_group_name, account_name, pool_name, custom_headers:custom_headers)
434
+
435
+ promise = promise.then do |response|
436
+ # Defining deserialization method.
437
+ deserialize_method = lambda do |parsed_response|
438
+ end
439
+
440
+ # Waiting for response.
441
+ @client.get_long_running_operation_result(response, deserialize_method)
442
+ end
443
+
444
+ promise
445
+ end
446
+
447
+ #
448
+ # Create or Update the specified capacity pool within the resource group
449
+ #
450
+ # Create or Update a capacity pool
451
+ #
452
+ # @param body [CapacityPool] Capacity pool object supplied in the body of the
453
+ # operation.
454
+ # @param resource_group_name [String] The name of the resource group.
455
+ # @param account_name [String] The name of the NetApp account
456
+ # @param pool_name [String] The name of the capacity pool
457
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
458
+ # will be added to the HTTP request.
459
+ #
460
+ # @return [CapacityPool] operation results.
461
+ #
462
+ def begin_create_or_update(body, resource_group_name, account_name, pool_name, custom_headers:nil)
463
+ response = begin_create_or_update_async(body, resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
464
+ response.body unless response.nil?
465
+ end
466
+
467
+ #
468
+ # Create or Update the specified capacity pool within the resource group
469
+ #
470
+ # Create or Update a capacity pool
471
+ #
472
+ # @param body [CapacityPool] Capacity pool object supplied in the body of the
473
+ # operation.
474
+ # @param resource_group_name [String] The name of the resource group.
475
+ # @param account_name [String] The name of the NetApp account
476
+ # @param pool_name [String] The name of the capacity pool
477
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
478
+ # will be added to the HTTP request.
479
+ #
480
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
481
+ #
482
+ def begin_create_or_update_with_http_info(body, resource_group_name, account_name, pool_name, custom_headers:nil)
483
+ begin_create_or_update_async(body, resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
484
+ end
485
+
486
+ #
487
+ # Create or Update the specified capacity pool within the resource group
488
+ #
489
+ # Create or Update a capacity pool
490
+ #
491
+ # @param body [CapacityPool] Capacity pool object supplied in the body of the
492
+ # operation.
493
+ # @param resource_group_name [String] The name of the resource group.
494
+ # @param account_name [String] The name of the NetApp account
495
+ # @param pool_name [String] The name of the capacity pool
496
+ # @param [Hash{String => String}] A hash of custom headers that will be added
497
+ # to the HTTP request.
498
+ #
499
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
500
+ #
501
+ def begin_create_or_update_async(body, resource_group_name, account_name, pool_name, custom_headers:nil)
502
+ fail ArgumentError, 'body is nil' if body.nil?
503
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
504
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
505
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
506
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
507
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
508
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
509
+ fail ArgumentError, 'pool_name is nil' if pool_name.nil?
510
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
511
+
512
+
513
+ request_headers = {}
514
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
515
+
516
+ # Set Headers
517
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
518
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
519
+
520
+ # Serialize Request
521
+ request_mapper = Azure::NetApp::Mgmt::V2019_10_01::Models::CapacityPool.mapper()
522
+ request_content = @client.serialize(request_mapper, body)
523
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
524
+
525
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}'
526
+
527
+ request_url = @base_url || @client.base_url
528
+
529
+ options = {
530
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
531
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'poolName' => pool_name},
532
+ query_params: {'api-version' => @client.api_version},
533
+ body: request_content,
534
+ headers: request_headers.merge(custom_headers || {}),
535
+ base_url: request_url
536
+ }
537
+ promise = @client.make_request_async(:put, path_template, options)
538
+
539
+ promise = promise.then do |result|
540
+ http_response = result.response
541
+ status_code = http_response.status
542
+ response_content = http_response.body
543
+ unless status_code == 200 || status_code == 201 || status_code == 202
544
+ error_model = JSON.load(response_content)
545
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
546
+ end
547
+
548
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
549
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
550
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
551
+ # Deserialize Response
552
+ if status_code == 200
553
+ begin
554
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
555
+ result_mapper = Azure::NetApp::Mgmt::V2019_10_01::Models::CapacityPool.mapper()
556
+ result.body = @client.deserialize(result_mapper, parsed_response)
557
+ rescue Exception => e
558
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
559
+ end
560
+ end
561
+ # Deserialize Response
562
+ if status_code == 201
563
+ begin
564
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
565
+ result_mapper = Azure::NetApp::Mgmt::V2019_10_01::Models::CapacityPool.mapper()
566
+ result.body = @client.deserialize(result_mapper, parsed_response)
567
+ rescue Exception => e
568
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
569
+ end
570
+ end
571
+
572
+ result
573
+ end
574
+
575
+ promise.execute
576
+ end
577
+
578
+ #
579
+ # Delete a capacity pool
580
+ #
581
+ # Delete the specified capacity pool
582
+ #
583
+ # @param resource_group_name [String] The name of the resource group.
584
+ # @param account_name [String] The name of the NetApp account
585
+ # @param pool_name [String] The name of the capacity pool
586
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
587
+ # will be added to the HTTP request.
588
+ #
589
+ #
590
+ def begin_delete(resource_group_name, account_name, pool_name, custom_headers:nil)
591
+ response = begin_delete_async(resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
592
+ nil
593
+ end
594
+
595
+ #
596
+ # Delete a capacity pool
597
+ #
598
+ # Delete the specified capacity pool
599
+ #
600
+ # @param resource_group_name [String] The name of the resource group.
601
+ # @param account_name [String] The name of the NetApp account
602
+ # @param pool_name [String] The name of the capacity pool
603
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
604
+ # will be added to the HTTP request.
605
+ #
606
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
607
+ #
608
+ def begin_delete_with_http_info(resource_group_name, account_name, pool_name, custom_headers:nil)
609
+ begin_delete_async(resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
610
+ end
611
+
612
+ #
613
+ # Delete a capacity pool
614
+ #
615
+ # Delete the specified capacity pool
616
+ #
617
+ # @param resource_group_name [String] The name of the resource group.
618
+ # @param account_name [String] The name of the NetApp account
619
+ # @param pool_name [String] The name of the capacity pool
620
+ # @param [Hash{String => String}] A hash of custom headers that will be added
621
+ # to the HTTP request.
622
+ #
623
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
624
+ #
625
+ def begin_delete_async(resource_group_name, account_name, pool_name, custom_headers:nil)
626
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
627
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
628
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
629
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
630
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
631
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
632
+ fail ArgumentError, 'pool_name is nil' if pool_name.nil?
633
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
634
+
635
+
636
+ request_headers = {}
637
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
638
+
639
+ # Set Headers
640
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
641
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
642
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}'
643
+
644
+ request_url = @base_url || @client.base_url
645
+
646
+ options = {
647
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
648
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'poolName' => pool_name},
649
+ query_params: {'api-version' => @client.api_version},
650
+ headers: request_headers.merge(custom_headers || {}),
651
+ base_url: request_url
652
+ }
653
+ promise = @client.make_request_async(:delete, path_template, options)
654
+
655
+ promise = promise.then do |result|
656
+ http_response = result.response
657
+ status_code = http_response.status
658
+ response_content = http_response.body
659
+ unless status_code == 202 || status_code == 204
660
+ error_model = JSON.load(response_content)
661
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
662
+ end
663
+
664
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
665
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
666
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
667
+
668
+ result
669
+ end
670
+
671
+ promise.execute
672
+ end
673
+
674
+ end
675
+ end