azure_mgmt_sql 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/azure_mgmt_sql.rb +124 -41
  3. data/lib/generated/azure_mgmt_sql/capabilities.rb +115 -0
  4. data/lib/generated/azure_mgmt_sql/databases.rb +2877 -443
  5. data/lib/generated/azure_mgmt_sql/elastic_pools.rb +407 -30
  6. data/lib/generated/azure_mgmt_sql/failover_groups.rb +1143 -0
  7. data/lib/generated/azure_mgmt_sql/firewall_rules.rb +443 -0
  8. data/lib/generated/azure_mgmt_sql/models/authentication_type.rb +16 -0
  9. data/lib/generated/azure_mgmt_sql/models/backup_long_term_retention_policy.rb +94 -0
  10. data/lib/generated/azure_mgmt_sql/models/backup_long_term_retention_policy_state.rb +16 -0
  11. data/lib/generated/azure_mgmt_sql/models/backup_long_term_retention_vault.rb +80 -0
  12. data/lib/generated/azure_mgmt_sql/models/{transparent_data_encryption_states.rb → blob_auditing_policy_state.rb} +3 -3
  13. data/lib/generated/azure_mgmt_sql/models/capability_status.rb +18 -0
  14. data/lib/generated/azure_mgmt_sql/models/check_name_availability_reason.rb +16 -0
  15. data/lib/generated/azure_mgmt_sql/models/check_name_availability_request.rb +59 -0
  16. data/lib/generated/azure_mgmt_sql/models/check_name_availability_response.rb +84 -0
  17. data/lib/generated/azure_mgmt_sql/models/create_mode.rb +2 -1
  18. data/lib/generated/azure_mgmt_sql/models/data_masking_function.rb +20 -0
  19. data/lib/generated/azure_mgmt_sql/models/data_masking_policy.rb +131 -0
  20. data/lib/generated/azure_mgmt_sql/models/data_masking_rule.rb +226 -0
  21. data/lib/generated/azure_mgmt_sql/models/data_masking_rule_list_result.rb +54 -0
  22. data/lib/generated/azure_mgmt_sql/models/data_masking_rule_state.rb +16 -0
  23. data/lib/generated/azure_mgmt_sql/models/{server_state.rb → data_masking_state.rb} +4 -4
  24. data/lib/generated/azure_mgmt_sql/models/database.rb +115 -63
  25. data/lib/generated/azure_mgmt_sql/models/database_blob_auditing_policy.rb +156 -0
  26. data/lib/generated/azure_mgmt_sql/models/{database_editions.rb → database_edition.rb} +4 -3
  27. data/lib/generated/azure_mgmt_sql/models/database_list_result.rb +2 -1
  28. data/lib/generated/azure_mgmt_sql/models/database_security_alert_policy.rb +179 -0
  29. data/lib/generated/azure_mgmt_sql/models/database_update.rb +464 -0
  30. data/lib/generated/azure_mgmt_sql/models/{database_metric.rb → database_usage.rb} +13 -11
  31. data/lib/generated/azure_mgmt_sql/models/{database_metric_list_result.rb → database_usage_list_result.rb} +10 -9
  32. data/lib/generated/azure_mgmt_sql/models/edition_capability.rb +79 -0
  33. data/lib/generated/azure_mgmt_sql/models/elastic_pool.rb +15 -14
  34. data/lib/generated/azure_mgmt_sql/models/elastic_pool_activity.rb +12 -22
  35. data/lib/generated/azure_mgmt_sql/models/elastic_pool_activity_list_result.rb +2 -1
  36. data/lib/generated/azure_mgmt_sql/models/elastic_pool_database_activity.rb +12 -22
  37. data/lib/generated/azure_mgmt_sql/models/elastic_pool_database_activity_list_result.rb +2 -1
  38. data/lib/generated/azure_mgmt_sql/models/elastic_pool_dtu_capability.rb +143 -0
  39. data/lib/generated/azure_mgmt_sql/models/{elastic_pool_editions.rb → elastic_pool_edition.rb} +3 -3
  40. data/lib/generated/azure_mgmt_sql/models/elastic_pool_edition_capability.rb +79 -0
  41. data/lib/generated/azure_mgmt_sql/models/elastic_pool_list_result.rb +2 -1
  42. data/lib/generated/azure_mgmt_sql/models/elastic_pool_per_database_max_dtu_capability.rb +79 -0
  43. data/lib/generated/azure_mgmt_sql/models/elastic_pool_per_database_min_dtu_capability.rb +59 -0
  44. data/lib/generated/azure_mgmt_sql/models/elastic_pool_state.rb +1 -1
  45. data/lib/generated/azure_mgmt_sql/models/elastic_pool_update.rb +152 -0
  46. data/lib/generated/azure_mgmt_sql/models/encryption_protector.rb +137 -0
  47. data/lib/generated/azure_mgmt_sql/models/encryption_protector_list_result.rb +96 -0
  48. data/lib/generated/azure_mgmt_sql/models/export_request.rb +101 -0
  49. data/lib/generated/azure_mgmt_sql/models/failover_group.rb +171 -0
  50. data/lib/generated/azure_mgmt_sql/models/failover_group_list_result.rb +96 -0
  51. data/lib/generated/azure_mgmt_sql/models/failover_group_read_only_endpoint.rb +47 -0
  52. data/lib/generated/azure_mgmt_sql/models/failover_group_read_write_endpoint.rb +58 -0
  53. data/lib/generated/azure_mgmt_sql/models/failover_group_replication_role.rb +16 -0
  54. data/lib/generated/azure_mgmt_sql/models/{server_firewall_rule.rb → firewall_rule.rb} +6 -5
  55. data/lib/generated/azure_mgmt_sql/models/{server_firewall_rule_list_result.rb → firewall_rule_list_result.rb} +9 -8
  56. data/lib/generated/azure_mgmt_sql/models/geo_backup_policy.rb +105 -0
  57. data/lib/generated/azure_mgmt_sql/models/geo_backup_policy_list_result.rb +53 -0
  58. data/lib/generated/azure_mgmt_sql/models/geo_backup_policy_state.rb +16 -0
  59. data/lib/generated/azure_mgmt_sql/models/{table_type.rb → identity_type.rb} +4 -5
  60. data/lib/generated/azure_mgmt_sql/models/import_export_response.rb +158 -0
  61. data/lib/generated/azure_mgmt_sql/models/import_extension_request.rb +134 -0
  62. data/lib/generated/azure_mgmt_sql/models/import_request.rb +125 -0
  63. data/lib/generated/azure_mgmt_sql/models/location_capabilities.rb +80 -0
  64. data/lib/generated/azure_mgmt_sql/models/max_size_capability.rb +74 -0
  65. data/lib/generated/azure_mgmt_sql/models/max_size_units.rb +18 -0
  66. data/lib/generated/azure_mgmt_sql/models/metric.rb +114 -0
  67. data/lib/generated/azure_mgmt_sql/models/metric_availability.rb +57 -0
  68. data/lib/generated/azure_mgmt_sql/models/metric_definition.rb +104 -0
  69. data/lib/generated/azure_mgmt_sql/models/metric_definition_list_result.rb +54 -0
  70. data/lib/generated/azure_mgmt_sql/models/metric_list_result.rb +53 -0
  71. data/lib/generated/azure_mgmt_sql/models/metric_name.rb +57 -0
  72. data/lib/generated/azure_mgmt_sql/models/metric_value.rb +117 -0
  73. data/lib/generated/azure_mgmt_sql/models/operation.rb +2 -1
  74. data/lib/generated/azure_mgmt_sql/models/operation_display.rb +2 -1
  75. data/lib/generated/azure_mgmt_sql/models/operation_impact.rb +3 -2
  76. data/lib/generated/azure_mgmt_sql/models/operation_list_result.rb +2 -1
  77. data/lib/generated/azure_mgmt_sql/models/partner_info.rb +68 -0
  78. data/lib/generated/azure_mgmt_sql/models/performance_level_unit.rb +15 -0
  79. data/lib/generated/azure_mgmt_sql/models/primary_aggregation_type.rb +20 -0
  80. data/lib/generated/azure_mgmt_sql/models/proxy_resource.rb +59 -0
  81. data/lib/generated/azure_mgmt_sql/models/read_only_endpoint_failover_policy.rb +16 -0
  82. data/lib/generated/azure_mgmt_sql/models/read_scale.rb +1 -1
  83. data/lib/generated/azure_mgmt_sql/models/read_write_endpoint_failover_policy.rb +16 -0
  84. data/lib/generated/azure_mgmt_sql/models/recommended_elastic_pool.rb +9 -29
  85. data/lib/generated/azure_mgmt_sql/models/recommended_elastic_pool_list_metrics_result.rb +2 -1
  86. data/lib/generated/azure_mgmt_sql/models/recommended_elastic_pool_list_result.rb +2 -1
  87. data/lib/generated/azure_mgmt_sql/models/recommended_elastic_pool_metric.rb +2 -1
  88. data/lib/generated/azure_mgmt_sql/models/recommended_index.rb +13 -33
  89. data/lib/generated/azure_mgmt_sql/models/{recommended_index_actions.rb → recommended_index_action.rb} +3 -3
  90. data/lib/generated/azure_mgmt_sql/models/{recommended_index_states.rb → recommended_index_state.rb} +3 -3
  91. data/lib/generated/azure_mgmt_sql/models/{recommended_index_types.rb → recommended_index_type.rb} +3 -3
  92. data/lib/generated/azure_mgmt_sql/models/recoverable_database.rb +104 -0
  93. data/lib/generated/azure_mgmt_sql/models/recoverable_database_list_result.rb +53 -0
  94. data/lib/generated/azure_mgmt_sql/models/replication_link.rb +3 -2
  95. data/lib/generated/azure_mgmt_sql/models/replication_link_list_result.rb +2 -1
  96. data/lib/generated/azure_mgmt_sql/models/replication_role.rb +1 -1
  97. data/lib/generated/azure_mgmt_sql/models/replication_state.rb +1 -1
  98. data/lib/generated/azure_mgmt_sql/models/resource_identity.rb +69 -0
  99. data/lib/generated/azure_mgmt_sql/models/restorable_dropped_database.rb +159 -0
  100. data/lib/generated/azure_mgmt_sql/models/restorable_dropped_database_list_result.rb +54 -0
  101. data/lib/generated/azure_mgmt_sql/models/restore_point.rb +10 -30
  102. data/lib/generated/azure_mgmt_sql/models/restore_point_list_result.rb +4 -4
  103. data/lib/generated/azure_mgmt_sql/models/{restore_point_types.rb → restore_point_type.rb} +3 -3
  104. data/lib/generated/azure_mgmt_sql/models/sample_name.rb +1 -1
  105. data/lib/generated/azure_mgmt_sql/models/security_alert_policy_email_account_admins.rb +16 -0
  106. data/lib/generated/azure_mgmt_sql/models/security_alert_policy_state.rb +17 -0
  107. data/lib/generated/azure_mgmt_sql/models/security_alert_policy_use_server_default.rb +16 -0
  108. data/lib/generated/azure_mgmt_sql/models/server.rb +38 -56
  109. data/lib/generated/azure_mgmt_sql/models/server_administrator_list_result.rb +54 -0
  110. data/lib/generated/azure_mgmt_sql/models/server_azure_adadministrator.rb +94 -0
  111. data/lib/generated/azure_mgmt_sql/models/server_communication_link.rb +103 -0
  112. data/lib/generated/azure_mgmt_sql/models/server_communication_link_list_result.rb +54 -0
  113. data/lib/generated/azure_mgmt_sql/models/{schema.rb → server_connection_policy.rb} +33 -38
  114. data/lib/generated/azure_mgmt_sql/models/server_connection_type.rb +17 -0
  115. data/lib/generated/azure_mgmt_sql/models/server_key.rb +135 -0
  116. data/lib/generated/azure_mgmt_sql/models/server_key_list_result.rb +96 -0
  117. data/lib/generated/azure_mgmt_sql/models/server_key_type.rb +16 -0
  118. data/lib/generated/azure_mgmt_sql/models/server_list_result.rb +48 -4
  119. data/lib/generated/azure_mgmt_sql/models/server_update.rb +106 -0
  120. data/lib/generated/azure_mgmt_sql/models/{server_metric.rb → server_usage.rb} +6 -5
  121. data/lib/generated/azure_mgmt_sql/models/{server_metric_list_result.rb → server_usage_list_result.rb} +9 -9
  122. data/lib/generated/azure_mgmt_sql/models/server_version_capability.rb +99 -0
  123. data/lib/generated/azure_mgmt_sql/models/service_objective.rb +3 -2
  124. data/lib/generated/azure_mgmt_sql/models/service_objective_capability.rb +127 -0
  125. data/lib/generated/azure_mgmt_sql/models/service_objective_list_result.rb +2 -1
  126. data/lib/generated/azure_mgmt_sql/models/service_objective_name.rb +2 -1
  127. data/lib/generated/azure_mgmt_sql/models/service_tier_advisor.rb +3 -2
  128. data/lib/generated/azure_mgmt_sql/models/service_tier_advisor_list_result.rb +2 -1
  129. data/lib/generated/azure_mgmt_sql/models/slo_usage_metric.rb +8 -3
  130. data/lib/generated/azure_mgmt_sql/models/sql_sub_resource.rb +3 -2
  131. data/lib/generated/azure_mgmt_sql/models/storage_key_type.rb +16 -0
  132. data/lib/generated/azure_mgmt_sql/models/sub_resource.rb +54 -0
  133. data/lib/generated/azure_mgmt_sql/models/{column.rb → tracked_resource.rb} +19 -23
  134. data/lib/generated/azure_mgmt_sql/models/transparent_data_encryption.rb +6 -5
  135. data/lib/generated/azure_mgmt_sql/models/transparent_data_encryption_activity.rb +4 -3
  136. data/lib/generated/azure_mgmt_sql/models/transparent_data_encryption_activity_list_result.rb +2 -1
  137. data/lib/generated/azure_mgmt_sql/models/{transparent_data_encryption_activity_states.rb → transparent_data_encryption_activity_status.rb} +3 -3
  138. data/lib/generated/azure_mgmt_sql/models/transparent_data_encryption_status.rb +16 -0
  139. data/lib/generated/azure_mgmt_sql/models/unit_definition_type.rb +20 -0
  140. data/lib/generated/azure_mgmt_sql/models/unit_type.rb +20 -0
  141. data/lib/generated/azure_mgmt_sql/models/virtual_network_rule.rb +69 -0
  142. data/lib/generated/azure_mgmt_sql/models/virtual_network_rule_list_result.rb +96 -0
  143. data/lib/generated/azure_mgmt_sql/module_definition.rb +1 -1
  144. data/lib/generated/azure_mgmt_sql/operations.rb +109 -0
  145. data/lib/generated/azure_mgmt_sql/recommended_elastic_pools.rb +21 -22
  146. data/lib/generated/azure_mgmt_sql/recoverable_databases.rb +229 -0
  147. data/lib/generated/azure_mgmt_sql/restorable_dropped_databases.rb +229 -0
  148. data/lib/generated/azure_mgmt_sql/server_azure_adadministrators.rb +575 -0
  149. data/lib/generated/azure_mgmt_sql/server_communication_links.rb +496 -0
  150. data/lib/generated/azure_mgmt_sql/server_keys.rb +670 -0
  151. data/lib/generated/azure_mgmt_sql/servers.rb +1366 -257
  152. data/lib/generated/azure_mgmt_sql/sql_management_client.rb +44 -85
  153. data/lib/generated/azure_mgmt_sql/version.rb +2 -2
  154. data/lib/generated/azure_mgmt_sql/virtual_network_rules.rb +663 -0
  155. metadata +110 -27
  156. data/lib/generated/azure_mgmt_sql/models/server_version.rb +0 -16
  157. data/lib/generated/azure_mgmt_sql/models/table.rb +0 -131
  158. data/lib/generated/azure_mgmt_sql/models/target_elastic_pool_editions.rb +0 -17
  159. data/lib/generated/azure_mgmt_sql/models/upgrade_hint.rb +0 -54
  160. data/lib/generated/azure_mgmt_sql/models/upgrade_recommended_elastic_pool_properties.rb +0 -131
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -11,7 +11,6 @@ module Azure::ARM::SQL
11
11
  # databases.
12
12
  #
13
13
  class ElasticPools
14
- include Azure::ARM::SQL::Models
15
14
  include MsRestAzure
16
15
 
17
16
  #
@@ -25,6 +24,215 @@ module Azure::ARM::SQL
25
24
  # @return [SqlManagementClient] reference to the SqlManagementClient
26
25
  attr_reader :client
27
26
 
27
+ #
28
+ # Returns elastic pool metrics.
29
+ #
30
+ # @param resource_group_name [String] The name of the resource group that
31
+ # contains the resource. You can obtain this value from the Azure Resource
32
+ # Manager API or the portal.
33
+ # @param server_name [String] The name of the server.
34
+ # @param elastic_pool_name [String] The name of the elastic pool.
35
+ # @param filter [String] An OData filter expression that describes a subset of
36
+ # metrics to return.
37
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
38
+ # will be added to the HTTP request.
39
+ #
40
+ # @return [MetricListResult] operation results.
41
+ #
42
+ def list_metrics(resource_group_name, server_name, elastic_pool_name, filter, custom_headers = nil)
43
+ response = list_metrics_async(resource_group_name, server_name, elastic_pool_name, filter, custom_headers).value!
44
+ response.body unless response.nil?
45
+ end
46
+
47
+ #
48
+ # Returns elastic pool metrics.
49
+ #
50
+ # @param resource_group_name [String] The name of the resource group that
51
+ # contains the resource. You can obtain this value from the Azure Resource
52
+ # Manager API or the portal.
53
+ # @param server_name [String] The name of the server.
54
+ # @param elastic_pool_name [String] The name of the elastic pool.
55
+ # @param filter [String] An OData filter expression that describes a subset of
56
+ # metrics to return.
57
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
58
+ # will be added to the HTTP request.
59
+ #
60
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
61
+ #
62
+ def list_metrics_with_http_info(resource_group_name, server_name, elastic_pool_name, filter, custom_headers = nil)
63
+ list_metrics_async(resource_group_name, server_name, elastic_pool_name, filter, custom_headers).value!
64
+ end
65
+
66
+ #
67
+ # Returns elastic pool metrics.
68
+ #
69
+ # @param resource_group_name [String] The name of the resource group that
70
+ # contains the resource. You can obtain this value from the Azure Resource
71
+ # Manager API or the portal.
72
+ # @param server_name [String] The name of the server.
73
+ # @param elastic_pool_name [String] The name of the elastic pool.
74
+ # @param filter [String] An OData filter expression that describes a subset of
75
+ # metrics to return.
76
+ # @param [Hash{String => String}] A hash of custom headers that will be added
77
+ # to the HTTP request.
78
+ #
79
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
80
+ #
81
+ def list_metrics_async(resource_group_name, server_name, elastic_pool_name, filter, custom_headers = nil)
82
+ api_version = '2014-04-01'
83
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
84
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
85
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
86
+ fail ArgumentError, 'elastic_pool_name is nil' if elastic_pool_name.nil?
87
+ fail ArgumentError, 'filter is nil' if filter.nil?
88
+
89
+
90
+ request_headers = {}
91
+
92
+ # Set Headers
93
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
94
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
95
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metrics'
96
+
97
+ request_url = @base_url || @client.base_url
98
+
99
+ options = {
100
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
101
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'elasticPoolName' => elastic_pool_name},
102
+ query_params: {'api-version' => api_version,'$filter' => filter},
103
+ headers: request_headers.merge(custom_headers || {}),
104
+ base_url: request_url
105
+ }
106
+ promise = @client.make_request_async(:get, path_template, options)
107
+
108
+ promise = promise.then do |result|
109
+ http_response = result.response
110
+ status_code = http_response.status
111
+ response_content = http_response.body
112
+ unless status_code == 200
113
+ error_model = JSON.load(response_content)
114
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
115
+ end
116
+
117
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
118
+ # Deserialize Response
119
+ if status_code == 200
120
+ begin
121
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
122
+ result_mapper = Azure::ARM::SQL::Models::MetricListResult.mapper()
123
+ result.body = @client.deserialize(result_mapper, parsed_response)
124
+ rescue Exception => e
125
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
126
+ end
127
+ end
128
+
129
+ result
130
+ end
131
+
132
+ promise.execute
133
+ end
134
+
135
+ #
136
+ # Returns elastic pool metric definitions.
137
+ #
138
+ # @param resource_group_name [String] The name of the resource group that
139
+ # contains the resource. You can obtain this value from the Azure Resource
140
+ # Manager API or the portal.
141
+ # @param server_name [String] The name of the server.
142
+ # @param elastic_pool_name [String] The name of the elastic pool.
143
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
144
+ # will be added to the HTTP request.
145
+ #
146
+ # @return [MetricDefinitionListResult] operation results.
147
+ #
148
+ def list_metric_definitions(resource_group_name, server_name, elastic_pool_name, custom_headers = nil)
149
+ response = list_metric_definitions_async(resource_group_name, server_name, elastic_pool_name, custom_headers).value!
150
+ response.body unless response.nil?
151
+ end
152
+
153
+ #
154
+ # Returns elastic pool metric definitions.
155
+ #
156
+ # @param resource_group_name [String] The name of the resource group that
157
+ # contains the resource. You can obtain this value from the Azure Resource
158
+ # Manager API or the portal.
159
+ # @param server_name [String] The name of the server.
160
+ # @param elastic_pool_name [String] The name of the elastic pool.
161
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
162
+ # will be added to the HTTP request.
163
+ #
164
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
165
+ #
166
+ def list_metric_definitions_with_http_info(resource_group_name, server_name, elastic_pool_name, custom_headers = nil)
167
+ list_metric_definitions_async(resource_group_name, server_name, elastic_pool_name, custom_headers).value!
168
+ end
169
+
170
+ #
171
+ # Returns elastic pool metric definitions.
172
+ #
173
+ # @param resource_group_name [String] The name of the resource group that
174
+ # contains the resource. You can obtain this value from the Azure Resource
175
+ # Manager API or the portal.
176
+ # @param server_name [String] The name of the server.
177
+ # @param elastic_pool_name [String] The name of the elastic pool.
178
+ # @param [Hash{String => String}] A hash of custom headers that will be added
179
+ # to the HTTP request.
180
+ #
181
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
182
+ #
183
+ def list_metric_definitions_async(resource_group_name, server_name, elastic_pool_name, custom_headers = nil)
184
+ api_version = '2014-04-01'
185
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
186
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
187
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
188
+ fail ArgumentError, 'elastic_pool_name is nil' if elastic_pool_name.nil?
189
+
190
+
191
+ request_headers = {}
192
+
193
+ # Set Headers
194
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
195
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
196
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metricDefinitions'
197
+
198
+ request_url = @base_url || @client.base_url
199
+
200
+ options = {
201
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
202
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'elasticPoolName' => elastic_pool_name},
203
+ query_params: {'api-version' => api_version},
204
+ headers: request_headers.merge(custom_headers || {}),
205
+ base_url: request_url
206
+ }
207
+ promise = @client.make_request_async(:get, path_template, options)
208
+
209
+ promise = promise.then do |result|
210
+ http_response = result.response
211
+ status_code = http_response.status
212
+ response_content = http_response.body
213
+ unless status_code == 200
214
+ error_model = JSON.load(response_content)
215
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
216
+ end
217
+
218
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
219
+ # Deserialize Response
220
+ if status_code == 200
221
+ begin
222
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
223
+ result_mapper = Azure::ARM::SQL::Models::MetricDefinitionListResult.mapper()
224
+ result.body = @client.deserialize(result_mapper, parsed_response)
225
+ rescue Exception => e
226
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
227
+ end
228
+ end
229
+
230
+ result
231
+ end
232
+
233
+ promise.execute
234
+ end
235
+
28
236
  #
29
237
  # Creates a new elastic pool or updates an existing elastic pool.
30
238
  #
@@ -68,8 +276,60 @@ module Azure::ARM::SQL
68
276
  promise = promise.then do |response|
69
277
  # Defining deserialization method.
70
278
  deserialize_method = lambda do |parsed_response|
71
- result_mapper = ElasticPool.mapper()
72
- parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
279
+ result_mapper = Azure::ARM::SQL::Models::ElasticPool.mapper()
280
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
281
+ end
282
+
283
+ # Waiting for response.
284
+ @client.get_long_running_operation_result(response, deserialize_method)
285
+ end
286
+
287
+ promise
288
+ end
289
+
290
+ #
291
+ # Updates an existing elastic pool.
292
+ #
293
+ # @param resource_group_name [String] The name of the resource group that
294
+ # contains the resource. You can obtain this value from the Azure Resource
295
+ # Manager API or the portal.
296
+ # @param server_name [String] The name of the server.
297
+ # @param elastic_pool_name [String] The name of the elastic pool to be updated.
298
+ # @param parameters [ElasticPoolUpdate] The required parameters for updating an
299
+ # elastic pool.
300
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
301
+ # will be added to the HTTP request.
302
+ #
303
+ # @return [ElasticPool] operation results.
304
+ #
305
+ def update(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers = nil)
306
+ response = update_async(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers).value!
307
+ response.body unless response.nil?
308
+ end
309
+
310
+ #
311
+ # @param resource_group_name [String] The name of the resource group that
312
+ # contains the resource. You can obtain this value from the Azure Resource
313
+ # Manager API or the portal.
314
+ # @param server_name [String] The name of the server.
315
+ # @param elastic_pool_name [String] The name of the elastic pool to be updated.
316
+ # @param parameters [ElasticPoolUpdate] The required parameters for updating an
317
+ # elastic pool.
318
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
319
+ # will be added to the HTTP request.
320
+ #
321
+ # @return [Concurrent::Promise] promise which provides async access to http
322
+ # response.
323
+ #
324
+ def update_async(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers = nil)
325
+ # Send request
326
+ promise = begin_update_async(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers)
327
+
328
+ promise = promise.then do |response|
329
+ # Defining deserialization method.
330
+ deserialize_method = lambda do |parsed_response|
331
+ result_mapper = Azure::ARM::SQL::Models::ElasticPool.mapper()
332
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
73
333
  end
74
334
 
75
335
  # Waiting for response.
@@ -139,7 +399,7 @@ module Azure::ARM::SQL
139
399
  # Set Headers
140
400
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
141
401
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
142
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}'
402
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}'
143
403
 
144
404
  request_url = @base_url || @client.base_url
145
405
 
@@ -233,7 +493,7 @@ module Azure::ARM::SQL
233
493
  # Set Headers
234
494
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
235
495
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
236
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}'
496
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}'
237
497
 
238
498
  request_url = @base_url || @client.base_url
239
499
 
@@ -260,8 +520,8 @@ module Azure::ARM::SQL
260
520
  if status_code == 200
261
521
  begin
262
522
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
263
- result_mapper = ElasticPool.mapper()
264
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
523
+ result_mapper = Azure::ARM::SQL::Models::ElasticPool.mapper()
524
+ result.body = @client.deserialize(result_mapper, parsed_response)
265
525
  rescue Exception => e
266
526
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
267
527
  end
@@ -330,7 +590,7 @@ module Azure::ARM::SQL
330
590
  # Set Headers
331
591
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
332
592
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
333
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools'
593
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools'
334
594
 
335
595
  request_url = @base_url || @client.base_url
336
596
 
@@ -357,8 +617,8 @@ module Azure::ARM::SQL
357
617
  if status_code == 200
358
618
  begin
359
619
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
360
- result_mapper = ElasticPoolListResult.mapper()
361
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
620
+ result_mapper = Azure::ARM::SQL::Models::ElasticPoolListResult.mapper()
621
+ result.body = @client.deserialize(result_mapper, parsed_response)
362
622
  rescue Exception => e
363
623
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
364
624
  end
@@ -434,7 +694,7 @@ module Azure::ARM::SQL
434
694
  # Set Headers
435
695
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
436
696
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
437
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolActivity'
697
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolActivity'
438
698
 
439
699
  request_url = @base_url || @client.base_url
440
700
 
@@ -461,8 +721,8 @@ module Azure::ARM::SQL
461
721
  if status_code == 200
462
722
  begin
463
723
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
464
- result_mapper = ElasticPoolActivityListResult.mapper()
465
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
724
+ result_mapper = Azure::ARM::SQL::Models::ElasticPoolActivityListResult.mapper()
725
+ result.body = @client.deserialize(result_mapper, parsed_response)
466
726
  rescue Exception => e
467
727
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
468
728
  end
@@ -535,7 +795,7 @@ module Azure::ARM::SQL
535
795
  # Set Headers
536
796
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
537
797
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
538
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolDatabaseActivity'
798
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolDatabaseActivity'
539
799
 
540
800
  request_url = @base_url || @client.base_url
541
801
 
@@ -562,8 +822,8 @@ module Azure::ARM::SQL
562
822
  if status_code == 200
563
823
  begin
564
824
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
565
- result_mapper = ElasticPoolDatabaseActivityListResult.mapper()
566
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
825
+ result_mapper = Azure::ARM::SQL::Models::ElasticPoolDatabaseActivityListResult.mapper()
826
+ result.body = @client.deserialize(result_mapper, parsed_response)
567
827
  rescue Exception => e
568
828
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
569
829
  end
@@ -643,7 +903,7 @@ module Azure::ARM::SQL
643
903
  # Set Headers
644
904
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
645
905
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
646
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases/{databaseName}'
906
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases/{databaseName}'
647
907
 
648
908
  request_url = @base_url || @client.base_url
649
909
 
@@ -670,8 +930,8 @@ module Azure::ARM::SQL
670
930
  if status_code == 200
671
931
  begin
672
932
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
673
- result_mapper = Database.mapper()
674
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
933
+ result_mapper = Azure::ARM::SQL::Models::Database.mapper()
934
+ result.body = @client.deserialize(result_mapper, parsed_response)
675
935
  rescue Exception => e
676
936
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
677
937
  end
@@ -747,7 +1007,7 @@ module Azure::ARM::SQL
747
1007
  # Set Headers
748
1008
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
749
1009
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
750
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases'
1010
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases'
751
1011
 
752
1012
  request_url = @base_url || @client.base_url
753
1013
 
@@ -774,8 +1034,8 @@ module Azure::ARM::SQL
774
1034
  if status_code == 200
775
1035
  begin
776
1036
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
777
- result_mapper = DatabaseListResult.mapper()
778
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
1037
+ result_mapper = Azure::ARM::SQL::Models::DatabaseListResult.mapper()
1038
+ result.body = @client.deserialize(result_mapper, parsed_response)
779
1039
  rescue Exception => e
780
1040
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
781
1041
  end
@@ -862,11 +1122,11 @@ module Azure::ARM::SQL
862
1122
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
863
1123
 
864
1124
  # Serialize Request
865
- request_mapper = ElasticPool.mapper()
866
- request_content = @client.serialize(request_mapper, parameters, 'parameters')
1125
+ request_mapper = Azure::ARM::SQL::Models::ElasticPool.mapper()
1126
+ request_content = @client.serialize(request_mapper, parameters)
867
1127
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
868
1128
 
869
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}'
1129
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}'
870
1130
 
871
1131
  request_url = @base_url || @client.base_url
872
1132
 
@@ -894,8 +1154,8 @@ module Azure::ARM::SQL
894
1154
  if status_code == 200
895
1155
  begin
896
1156
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
897
- result_mapper = ElasticPool.mapper()
898
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
1157
+ result_mapper = Azure::ARM::SQL::Models::ElasticPool.mapper()
1158
+ result.body = @client.deserialize(result_mapper, parsed_response)
899
1159
  rescue Exception => e
900
1160
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
901
1161
  end
@@ -904,8 +1164,125 @@ module Azure::ARM::SQL
904
1164
  if status_code == 201
905
1165
  begin
906
1166
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
907
- result_mapper = ElasticPool.mapper()
908
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
1167
+ result_mapper = Azure::ARM::SQL::Models::ElasticPool.mapper()
1168
+ result.body = @client.deserialize(result_mapper, parsed_response)
1169
+ rescue Exception => e
1170
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1171
+ end
1172
+ end
1173
+
1174
+ result
1175
+ end
1176
+
1177
+ promise.execute
1178
+ end
1179
+
1180
+ #
1181
+ # Updates an existing elastic pool.
1182
+ #
1183
+ # @param resource_group_name [String] The name of the resource group that
1184
+ # contains the resource. You can obtain this value from the Azure Resource
1185
+ # Manager API or the portal.
1186
+ # @param server_name [String] The name of the server.
1187
+ # @param elastic_pool_name [String] The name of the elastic pool to be updated.
1188
+ # @param parameters [ElasticPoolUpdate] The required parameters for updating an
1189
+ # elastic pool.
1190
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1191
+ # will be added to the HTTP request.
1192
+ #
1193
+ # @return [ElasticPool] operation results.
1194
+ #
1195
+ def begin_update(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers = nil)
1196
+ response = begin_update_async(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers).value!
1197
+ response.body unless response.nil?
1198
+ end
1199
+
1200
+ #
1201
+ # Updates an existing elastic pool.
1202
+ #
1203
+ # @param resource_group_name [String] The name of the resource group that
1204
+ # contains the resource. You can obtain this value from the Azure Resource
1205
+ # Manager API or the portal.
1206
+ # @param server_name [String] The name of the server.
1207
+ # @param elastic_pool_name [String] The name of the elastic pool to be updated.
1208
+ # @param parameters [ElasticPoolUpdate] The required parameters for updating an
1209
+ # elastic pool.
1210
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1211
+ # will be added to the HTTP request.
1212
+ #
1213
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1214
+ #
1215
+ def begin_update_with_http_info(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers = nil)
1216
+ begin_update_async(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers).value!
1217
+ end
1218
+
1219
+ #
1220
+ # Updates an existing elastic pool.
1221
+ #
1222
+ # @param resource_group_name [String] The name of the resource group that
1223
+ # contains the resource. You can obtain this value from the Azure Resource
1224
+ # Manager API or the portal.
1225
+ # @param server_name [String] The name of the server.
1226
+ # @param elastic_pool_name [String] The name of the elastic pool to be updated.
1227
+ # @param parameters [ElasticPoolUpdate] The required parameters for updating an
1228
+ # elastic pool.
1229
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1230
+ # to the HTTP request.
1231
+ #
1232
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1233
+ #
1234
+ def begin_update_async(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers = nil)
1235
+ api_version = '2014-04-01'
1236
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1237
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1238
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
1239
+ fail ArgumentError, 'elastic_pool_name is nil' if elastic_pool_name.nil?
1240
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1241
+
1242
+
1243
+ request_headers = {}
1244
+
1245
+ # Set Headers
1246
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1247
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1248
+
1249
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1250
+
1251
+ # Serialize Request
1252
+ request_mapper = Azure::ARM::SQL::Models::ElasticPoolUpdate.mapper()
1253
+ request_content = @client.serialize(request_mapper, parameters)
1254
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1255
+
1256
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}'
1257
+
1258
+ request_url = @base_url || @client.base_url
1259
+
1260
+ options = {
1261
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1262
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'elasticPoolName' => elastic_pool_name},
1263
+ query_params: {'api-version' => api_version},
1264
+ body: request_content,
1265
+ headers: request_headers.merge(custom_headers || {}),
1266
+ base_url: request_url
1267
+ }
1268
+ promise = @client.make_request_async(:patch, path_template, options)
1269
+
1270
+ promise = promise.then do |result|
1271
+ http_response = result.response
1272
+ status_code = http_response.status
1273
+ response_content = http_response.body
1274
+ unless status_code == 200 || status_code == 202
1275
+ error_model = JSON.load(response_content)
1276
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1277
+ end
1278
+
1279
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1280
+ # Deserialize Response
1281
+ if status_code == 200
1282
+ begin
1283
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1284
+ result_mapper = Azure::ARM::SQL::Models::ElasticPool.mapper()
1285
+ result.body = @client.deserialize(result_mapper, parsed_response)
909
1286
  rescue Exception => e
910
1287
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
911
1288
  end