azure_mgmt_sql 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/azure_mgmt_sql.rb +63 -6
  3. data/lib/generated/azure_mgmt_sql/databases.rb +2170 -0
  4. data/lib/generated/azure_mgmt_sql/elastic_pools.rb +950 -0
  5. data/lib/generated/azure_mgmt_sql/models/column.rb +90 -0
  6. data/lib/generated/azure_mgmt_sql/models/create_mode.rb +21 -0
  7. data/lib/generated/azure_mgmt_sql/models/database.rb +366 -0
  8. data/lib/generated/azure_mgmt_sql/models/database_editions.rb +22 -0
  9. data/lib/generated/azure_mgmt_sql/models/database_list_result.rb +53 -0
  10. data/lib/generated/azure_mgmt_sql/models/database_metric.rb +100 -0
  11. data/lib/generated/azure_mgmt_sql/models/database_metric_list_result.rb +53 -0
  12. data/lib/generated/azure_mgmt_sql/models/elastic_pool.rb +158 -0
  13. data/lib/generated/azure_mgmt_sql/models/elastic_pool_activity.rb +257 -0
  14. data/lib/generated/azure_mgmt_sql/models/elastic_pool_activity_list_result.rb +54 -0
  15. data/lib/generated/azure_mgmt_sql/models/elastic_pool_database_activity.rb +249 -0
  16. data/lib/generated/azure_mgmt_sql/models/elastic_pool_database_activity_list_result.rb +54 -0
  17. data/lib/generated/azure_mgmt_sql/models/elastic_pool_editions.rb +17 -0
  18. data/lib/generated/azure_mgmt_sql/models/elastic_pool_list_result.rb +53 -0
  19. data/lib/generated/azure_mgmt_sql/models/{state.rb → elastic_pool_state.rb} +5 -5
  20. data/lib/generated/azure_mgmt_sql/models/operation_impact.rb +80 -0
  21. data/lib/generated/azure_mgmt_sql/models/recommended_database_properties.rb +68 -0
  22. data/lib/generated/azure_mgmt_sql/models/recommended_elastic_pool.rb +216 -0
  23. data/lib/generated/azure_mgmt_sql/models/recommended_elastic_pool_list_metrics_result.rb +54 -0
  24. data/lib/generated/azure_mgmt_sql/models/recommended_elastic_pool_list_result.rb +54 -0
  25. data/lib/generated/azure_mgmt_sql/models/recommended_elastic_pool_metric.rb +65 -0
  26. data/lib/generated/azure_mgmt_sql/models/recommended_index.rb +260 -0
  27. data/lib/generated/azure_mgmt_sql/models/recommended_index_actions.rb +17 -0
  28. data/lib/generated/azure_mgmt_sql/models/recommended_index_states.rb +25 -0
  29. data/lib/generated/azure_mgmt_sql/models/recommended_index_types.rb +18 -0
  30. data/lib/generated/azure_mgmt_sql/models/replication_link.rb +149 -0
  31. data/lib/generated/azure_mgmt_sql/models/replication_link_list_result.rb +54 -0
  32. data/lib/generated/azure_mgmt_sql/models/replication_role.rb +19 -0
  33. data/lib/generated/azure_mgmt_sql/models/replication_state.rb +18 -0
  34. data/lib/generated/azure_mgmt_sql/models/restore_point.rb +117 -0
  35. data/lib/generated/azure_mgmt_sql/models/restore_point_list_result.rb +54 -0
  36. data/lib/generated/azure_mgmt_sql/models/restore_point_types.rb +16 -0
  37. data/lib/generated/azure_mgmt_sql/models/schema.rb +98 -0
  38. data/lib/generated/azure_mgmt_sql/models/{server_security_alert_policy.rb → server.rb} +32 -37
  39. data/lib/generated/azure_mgmt_sql/models/server_firewall_rule.rb +95 -0
  40. data/lib/generated/azure_mgmt_sql/models/server_firewall_rule_list_result.rb +53 -0
  41. data/lib/generated/azure_mgmt_sql/models/server_list_result.rb +52 -0
  42. data/lib/generated/azure_mgmt_sql/models/server_metric.rb +100 -0
  43. data/lib/generated/azure_mgmt_sql/models/server_metric_list_result.rb +53 -0
  44. data/lib/generated/azure_mgmt_sql/models/server_version.rb +16 -0
  45. data/lib/generated/azure_mgmt_sql/models/service_objective.rb +107 -0
  46. data/lib/generated/azure_mgmt_sql/models/service_objective_list_result.rb +54 -0
  47. data/lib/generated/azure_mgmt_sql/models/service_objective_name.rb +22 -0
  48. data/lib/generated/azure_mgmt_sql/models/service_tier_advisor.rb +282 -0
  49. data/lib/generated/azure_mgmt_sql/models/service_tier_advisor_list_result.rb +53 -0
  50. data/lib/generated/azure_mgmt_sql/models/slo_usage_metric.rb +111 -0
  51. data/lib/generated/azure_mgmt_sql/models/sql_sub_resource.rb +56 -0
  52. data/lib/generated/azure_mgmt_sql/models/table.rb +131 -0
  53. data/lib/generated/azure_mgmt_sql/models/table_type.rb +16 -0
  54. data/lib/generated/azure_mgmt_sql/models/target_database_editions.rb +20 -0
  55. data/lib/generated/azure_mgmt_sql/models/target_elastic_pool_editions.rb +17 -0
  56. data/lib/generated/azure_mgmt_sql/models/transparent_data_encryption.rb +63 -0
  57. data/lib/generated/azure_mgmt_sql/models/transparent_data_encryption_activity.rb +74 -0
  58. data/lib/generated/azure_mgmt_sql/models/transparent_data_encryption_activity_list_result.rb +55 -0
  59. data/lib/generated/azure_mgmt_sql/models/transparent_data_encryption_activity_states.rb +16 -0
  60. data/lib/generated/azure_mgmt_sql/models/{email_account_admins.rb → transparent_data_encryption_states.rb} +3 -3
  61. data/lib/generated/azure_mgmt_sql/models/upgrade_hint.rb +99 -0
  62. data/lib/generated/azure_mgmt_sql/models/upgrade_recommended_elastic_pool_properties.rb +132 -0
  63. data/lib/generated/azure_mgmt_sql/module_definition.rb +1 -1
  64. data/lib/generated/azure_mgmt_sql/recommended_elastic_pools.rb +555 -0
  65. data/lib/generated/azure_mgmt_sql/servers.rb +1233 -0
  66. data/lib/generated/azure_mgmt_sql/sql_management_client.rb +31 -10
  67. data/lib/generated/azure_mgmt_sql/version.rb +2 -2
  68. metadata +66 -9
  69. data/lib/generated/azure_mgmt_sql/models/server_security_alert_policy_create_or_update_parameters.rb +0 -85
  70. data/lib/generated/azure_mgmt_sql/security_alert_policy.rb +0 -296
@@ -1,14 +1,14 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
6
6
  module Azure::ARM::SQL
7
7
  module Models
8
8
  #
9
- # Defines values for EmailAccountAdmins
9
+ # Defines values for TransparentDataEncryptionStates
10
10
  #
11
- module EmailAccountAdmins
11
+ module TransparentDataEncryptionStates
12
12
  Enabled = "Enabled"
13
13
  Disabled = "Disabled"
14
14
  end
@@ -0,0 +1,99 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::SQL
7
+ module Models
8
+ #
9
+ # Represents a Upgrade Hint.
10
+ #
11
+ class UpgradeHint < MsRestAzure::Resource
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] TargetServiceLevelObjective for upgrade hint.
16
+ attr_accessor :target_service_level_objective
17
+
18
+ # @return TargetServiceLevelObjectiveId for upgrade hint.
19
+ attr_accessor :target_service_level_objective_id
20
+
21
+
22
+ #
23
+ # Mapper for UpgradeHint class as Ruby Hash.
24
+ # This will be used for serialization/deserialization.
25
+ #
26
+ def self.mapper()
27
+ {
28
+ required: false,
29
+ serialized_name: 'UpgradeHint',
30
+ type: {
31
+ name: 'Composite',
32
+ class_name: 'UpgradeHint',
33
+ model_properties: {
34
+ name: {
35
+ required: false,
36
+ read_only: true,
37
+ serialized_name: 'name',
38
+ type: {
39
+ name: 'String'
40
+ }
41
+ },
42
+ id: {
43
+ required: false,
44
+ read_only: true,
45
+ serialized_name: 'id',
46
+ type: {
47
+ name: 'String'
48
+ }
49
+ },
50
+ type: {
51
+ required: false,
52
+ read_only: true,
53
+ serialized_name: 'type',
54
+ type: {
55
+ name: 'String'
56
+ }
57
+ },
58
+ location: {
59
+ required: true,
60
+ serialized_name: 'location',
61
+ type: {
62
+ name: 'String'
63
+ }
64
+ },
65
+ tags: {
66
+ required: false,
67
+ serialized_name: 'tags',
68
+ type: {
69
+ name: 'Dictionary',
70
+ value: {
71
+ required: false,
72
+ serialized_name: 'StringElementType',
73
+ type: {
74
+ name: 'String'
75
+ }
76
+ }
77
+ }
78
+ },
79
+ target_service_level_objective: {
80
+ required: false,
81
+ serialized_name: 'targetServiceLevelObjective',
82
+ type: {
83
+ name: 'String'
84
+ }
85
+ },
86
+ target_service_level_objective_id: {
87
+ required: false,
88
+ serialized_name: 'targetServiceLevelObjectiveId',
89
+ type: {
90
+ name: 'String'
91
+ }
92
+ }
93
+ }
94
+ }
95
+ }
96
+ end
97
+ end
98
+ end
99
+ end
@@ -0,0 +1,132 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::SQL
7
+ module Models
8
+ #
9
+ # Represents the properties of a Azure SQL Recommended Elastic Pool being
10
+ # upgraded.
11
+ #
12
+ class UpgradeRecommendedElasticPoolProperties
13
+
14
+ include MsRestAzure
15
+
16
+ # @return [String] The name of the Azure SQL Recommended Elastic Pool
17
+ # being upgraded.
18
+ attr_accessor :name
19
+
20
+ # @return [TargetElasticPoolEditions] The target edition for the Azure
21
+ # SQL Recommended Elastic Pool being upgraded. Possible values include:
22
+ # 'Basic', 'Standard', 'Premium'
23
+ attr_accessor :edition
24
+
25
+ # @return [Integer] The DTU guarantee for the Azure SQL Recommended
26
+ # Elastic Pool being upgraded.
27
+ attr_accessor :dtu
28
+
29
+ # @return [Integer] The storage limit in MB for the Azure SQL Recommended
30
+ # Elastic Pool being upgraded.
31
+ attr_accessor :storage_mb
32
+
33
+ # @return [Integer] The DTU guarantee for database for the Azure SQL
34
+ # Recommended Elastic Pool being upgraded.
35
+ attr_accessor :database_dtu_min
36
+
37
+ # @return [Integer] The DTU cap for database for the Azure SQL
38
+ # Recommended Elastic Pool being upgraded.
39
+ attr_accessor :database_dtu_max
40
+
41
+ # @return [Array<String>] The list of database names to be put in the
42
+ # Azure SQL Recommended Elastic Pool being upgraded.
43
+ attr_accessor :database_collection
44
+
45
+ # @return [Boolean] Gets or sets whether all databases to be put in the
46
+ # Azure SQL Recommended Elastic Pool being upgraded.
47
+ attr_accessor :include_all_databases
48
+
49
+
50
+ #
51
+ # Mapper for UpgradeRecommendedElasticPoolProperties class as Ruby Hash.
52
+ # This will be used for serialization/deserialization.
53
+ #
54
+ def self.mapper()
55
+ {
56
+ required: false,
57
+ serialized_name: 'UpgradeRecommendedElasticPoolProperties',
58
+ type: {
59
+ name: 'Composite',
60
+ class_name: 'UpgradeRecommendedElasticPoolProperties',
61
+ model_properties: {
62
+ name: {
63
+ required: true,
64
+ serialized_name: 'Name',
65
+ type: {
66
+ name: 'String'
67
+ }
68
+ },
69
+ edition: {
70
+ required: true,
71
+ serialized_name: 'Edition',
72
+ type: {
73
+ name: 'Enum',
74
+ module: 'TargetElasticPoolEditions'
75
+ }
76
+ },
77
+ dtu: {
78
+ required: false,
79
+ serialized_name: 'Dtu',
80
+ type: {
81
+ name: 'Number'
82
+ }
83
+ },
84
+ storage_mb: {
85
+ required: false,
86
+ serialized_name: 'StorageMb',
87
+ type: {
88
+ name: 'Number'
89
+ }
90
+ },
91
+ database_dtu_min: {
92
+ required: false,
93
+ serialized_name: 'DatabaseDtuMin',
94
+ type: {
95
+ name: 'Number'
96
+ }
97
+ },
98
+ database_dtu_max: {
99
+ required: false,
100
+ serialized_name: 'DatabaseDtuMax',
101
+ type: {
102
+ name: 'Number'
103
+ }
104
+ },
105
+ database_collection: {
106
+ required: false,
107
+ serialized_name: 'DatabaseCollection',
108
+ type: {
109
+ name: 'Sequence',
110
+ element: {
111
+ required: false,
112
+ serialized_name: 'StringElementType',
113
+ type: {
114
+ name: 'String'
115
+ }
116
+ }
117
+ }
118
+ },
119
+ include_all_databases: {
120
+ required: false,
121
+ serialized_name: 'IncludeAllDatabases',
122
+ type: {
123
+ name: 'Boolean'
124
+ }
125
+ }
126
+ }
127
+ }
128
+ }
129
+ end
130
+ end
131
+ end
132
+ end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -0,0 +1,555 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::SQL
7
+ #
8
+ # The Azure SQL Database management API provides a RESTful set of web
9
+ # services that interact with Azure SQL Database services to manage your
10
+ # databases. The API enables you to create, retrieve, update, and delete
11
+ # databases.
12
+ #
13
+ class RecommendedElasticPools
14
+ include Azure::ARM::SQL::Models
15
+ include MsRestAzure
16
+
17
+ #
18
+ # Creates and initializes a new instance of the RecommendedElasticPools class.
19
+ # @param client service class for accessing basic functionality.
20
+ #
21
+ def initialize(client)
22
+ @client = client
23
+ end
24
+
25
+ # @return [SqlManagementClient] reference to the SqlManagementClient
26
+ attr_reader :client
27
+
28
+ #
29
+ # Gets information about an Azure SQL Recommended Elastic Pool.
30
+ #
31
+ # @param resource_group_name [String] The name of the resource group that
32
+ # contains the resource. You can obtain this value from the Azure Resource
33
+ # Manager API or the portal.
34
+ # @param server_name [String] The name of the Azure SQL server.
35
+ # @param recommended_elastic_pool_name [String] The name of the Azure SQL
36
+ # Recommended Elastic Pool to be retrieved.
37
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
38
+ # will be added to the HTTP request.
39
+ #
40
+ # @return [RecommendedElasticPool] operation results.
41
+ #
42
+ def get(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers = nil)
43
+ response = get_async(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers).value!
44
+ response.body unless response.nil?
45
+ end
46
+
47
+ #
48
+ # Gets information about an Azure SQL Recommended Elastic Pool.
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 Azure SQL server.
54
+ # @param recommended_elastic_pool_name [String] The name of the Azure SQL
55
+ # Recommended Elastic Pool to be retrieved.
56
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
57
+ # will be added to the HTTP request.
58
+ #
59
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
60
+ #
61
+ def get_with_http_info(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers = nil)
62
+ get_async(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers).value!
63
+ end
64
+
65
+ #
66
+ # Gets information about an Azure SQL Recommended Elastic Pool.
67
+ #
68
+ # @param resource_group_name [String] The name of the resource group that
69
+ # contains the resource. You can obtain this value from the Azure Resource
70
+ # Manager API or the portal.
71
+ # @param server_name [String] The name of the Azure SQL server.
72
+ # @param recommended_elastic_pool_name [String] The name of the Azure SQL
73
+ # Recommended Elastic Pool to be retrieved.
74
+ # @param [Hash{String => String}] A hash of custom headers that will be added
75
+ # to the HTTP request.
76
+ #
77
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
78
+ #
79
+ def get_async(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers = nil)
80
+ api_version = '2014-04-01'
81
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
82
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
83
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
84
+ fail ArgumentError, 'recommended_elastic_pool_name is nil' if recommended_elastic_pool_name.nil?
85
+
86
+
87
+ request_headers = {}
88
+
89
+ # Set Headers
90
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
91
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
92
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}'
93
+
94
+ request_url = @base_url || @client.base_url
95
+
96
+ options = {
97
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
98
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'recommendedElasticPoolName' => recommended_elastic_pool_name},
99
+ query_params: {'api-version' => api_version},
100
+ headers: request_headers.merge(custom_headers || {}),
101
+ base_url: request_url
102
+ }
103
+ promise = @client.make_request_async(:get, path_template, options)
104
+
105
+ promise = promise.then do |result|
106
+ http_response = result.response
107
+ status_code = http_response.status
108
+ response_content = http_response.body
109
+ unless status_code == 200
110
+ error_model = JSON.load(response_content)
111
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
112
+ end
113
+
114
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
115
+ # Deserialize Response
116
+ if status_code == 200
117
+ begin
118
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
119
+ result_mapper = RecommendedElasticPool.mapper()
120
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
121
+ rescue Exception => e
122
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
123
+ end
124
+ end
125
+
126
+ result
127
+ end
128
+
129
+ promise.execute
130
+ end
131
+
132
+ #
133
+ # Gets information about an Azure SQL database inside of an Azure SQL
134
+ # Recommended Elastic Pool.
135
+ #
136
+ # @param resource_group_name [String] The name of the resource group that
137
+ # contains the resource. You can obtain this value from the Azure Resource
138
+ # Manager API or the portal.
139
+ # @param server_name [String] The name of the Azure SQL server.
140
+ # @param recommended_elastic_pool_name [String] The name of the Azure SQL
141
+ # Elastic Pool to be retrieved.
142
+ # @param database_name [String] The name of the Azure SQL database to be
143
+ # retrieved.
144
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
145
+ # will be added to the HTTP request.
146
+ #
147
+ # @return [Database] operation results.
148
+ #
149
+ def get_databases(resource_group_name, server_name, recommended_elastic_pool_name, database_name, custom_headers = nil)
150
+ response = get_databases_async(resource_group_name, server_name, recommended_elastic_pool_name, database_name, custom_headers).value!
151
+ response.body unless response.nil?
152
+ end
153
+
154
+ #
155
+ # Gets information about an Azure SQL database inside of an Azure SQL
156
+ # Recommended Elastic Pool.
157
+ #
158
+ # @param resource_group_name [String] The name of the resource group that
159
+ # contains the resource. You can obtain this value from the Azure Resource
160
+ # Manager API or the portal.
161
+ # @param server_name [String] The name of the Azure SQL server.
162
+ # @param recommended_elastic_pool_name [String] The name of the Azure SQL
163
+ # Elastic Pool to be retrieved.
164
+ # @param database_name [String] The name of the Azure SQL database to be
165
+ # retrieved.
166
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
167
+ # will be added to the HTTP request.
168
+ #
169
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
170
+ #
171
+ def get_databases_with_http_info(resource_group_name, server_name, recommended_elastic_pool_name, database_name, custom_headers = nil)
172
+ get_databases_async(resource_group_name, server_name, recommended_elastic_pool_name, database_name, custom_headers).value!
173
+ end
174
+
175
+ #
176
+ # Gets information about an Azure SQL database inside of an Azure SQL
177
+ # Recommended Elastic Pool.
178
+ #
179
+ # @param resource_group_name [String] The name of the resource group that
180
+ # contains the resource. You can obtain this value from the Azure Resource
181
+ # Manager API or the portal.
182
+ # @param server_name [String] The name of the Azure SQL server.
183
+ # @param recommended_elastic_pool_name [String] The name of the Azure SQL
184
+ # Elastic Pool to be retrieved.
185
+ # @param database_name [String] The name of the Azure SQL database to be
186
+ # retrieved.
187
+ # @param [Hash{String => String}] A hash of custom headers that will be added
188
+ # to the HTTP request.
189
+ #
190
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
191
+ #
192
+ def get_databases_async(resource_group_name, server_name, recommended_elastic_pool_name, database_name, custom_headers = nil)
193
+ api_version = '2014-04-01'
194
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
195
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
196
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
197
+ fail ArgumentError, 'recommended_elastic_pool_name is nil' if recommended_elastic_pool_name.nil?
198
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
199
+
200
+
201
+ request_headers = {}
202
+
203
+ # Set Headers
204
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
205
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
206
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}/databases/{databaseName}'
207
+
208
+ request_url = @base_url || @client.base_url
209
+
210
+ options = {
211
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
212
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'recommendedElasticPoolName' => recommended_elastic_pool_name,'databaseName' => database_name},
213
+ query_params: {'api-version' => api_version},
214
+ headers: request_headers.merge(custom_headers || {}),
215
+ base_url: request_url
216
+ }
217
+ promise = @client.make_request_async(:get, path_template, options)
218
+
219
+ promise = promise.then do |result|
220
+ http_response = result.response
221
+ status_code = http_response.status
222
+ response_content = http_response.body
223
+ unless status_code == 200
224
+ error_model = JSON.load(response_content)
225
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
226
+ end
227
+
228
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
229
+ # Deserialize Response
230
+ if status_code == 200
231
+ begin
232
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
233
+ result_mapper = Database.mapper()
234
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
235
+ rescue Exception => e
236
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
237
+ end
238
+ end
239
+
240
+ result
241
+ end
242
+
243
+ promise.execute
244
+ end
245
+
246
+ #
247
+ # Returns information about Azure SQL Recommended Elastic Pools.
248
+ #
249
+ # @param resource_group_name [String] The name of the resource group that
250
+ # contains the resource. You can obtain this value from the Azure Resource
251
+ # Manager API or the portal.
252
+ # @param server_name [String] The name of the Azure SQL server.
253
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
254
+ # will be added to the HTTP request.
255
+ #
256
+ # @return [RecommendedElasticPoolListResult] operation results.
257
+ #
258
+ def list(resource_group_name, server_name, custom_headers = nil)
259
+ response = list_async(resource_group_name, server_name, custom_headers).value!
260
+ response.body unless response.nil?
261
+ end
262
+
263
+ #
264
+ # Returns information about Azure SQL Recommended Elastic Pools.
265
+ #
266
+ # @param resource_group_name [String] The name of the resource group that
267
+ # contains the resource. You can obtain this value from the Azure Resource
268
+ # Manager API or the portal.
269
+ # @param server_name [String] The name of the Azure SQL server.
270
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
271
+ # will be added to the HTTP request.
272
+ #
273
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
274
+ #
275
+ def list_with_http_info(resource_group_name, server_name, custom_headers = nil)
276
+ list_async(resource_group_name, server_name, custom_headers).value!
277
+ end
278
+
279
+ #
280
+ # Returns information about Azure SQL Recommended Elastic Pools.
281
+ #
282
+ # @param resource_group_name [String] The name of the resource group that
283
+ # contains the resource. You can obtain this value from the Azure Resource
284
+ # Manager API or the portal.
285
+ # @param server_name [String] The name of the Azure SQL server.
286
+ # @param [Hash{String => String}] A hash of custom headers that will be added
287
+ # to the HTTP request.
288
+ #
289
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
290
+ #
291
+ def list_async(resource_group_name, server_name, custom_headers = nil)
292
+ api_version = '2014-04-01'
293
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
294
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
295
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
296
+
297
+
298
+ request_headers = {}
299
+
300
+ # Set Headers
301
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
302
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
303
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools'
304
+
305
+ request_url = @base_url || @client.base_url
306
+
307
+ options = {
308
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
309
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name},
310
+ query_params: {'api-version' => api_version},
311
+ headers: request_headers.merge(custom_headers || {}),
312
+ base_url: request_url
313
+ }
314
+ promise = @client.make_request_async(:get, path_template, options)
315
+
316
+ promise = promise.then do |result|
317
+ http_response = result.response
318
+ status_code = http_response.status
319
+ response_content = http_response.body
320
+ unless status_code == 200
321
+ error_model = JSON.load(response_content)
322
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
323
+ end
324
+
325
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
326
+ # Deserialize Response
327
+ if status_code == 200
328
+ begin
329
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
330
+ result_mapper = RecommendedElasticPoolListResult.mapper()
331
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
332
+ rescue Exception => e
333
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
334
+ end
335
+ end
336
+
337
+ result
338
+ end
339
+
340
+ promise.execute
341
+ end
342
+
343
+ #
344
+ # Returns information about an Azure SQL database inside of an Azure SQL
345
+ # Recommended Elastic Pool.
346
+ #
347
+ # @param resource_group_name [String] The name of the resource group that
348
+ # contains the resource. You can obtain this value from the Azure Resource
349
+ # Manager API or the portal.
350
+ # @param server_name [String] The name of the Azure SQL server.
351
+ # @param recommended_elastic_pool_name [String] The name of the Azure SQL
352
+ # Recommended Elastic Pool to be retrieved.
353
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
354
+ # will be added to the HTTP request.
355
+ #
356
+ # @return [DatabaseListResult] operation results.
357
+ #
358
+ def list_databases(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers = nil)
359
+ response = list_databases_async(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers).value!
360
+ response.body unless response.nil?
361
+ end
362
+
363
+ #
364
+ # Returns information about an Azure SQL database inside of an Azure SQL
365
+ # Recommended Elastic Pool.
366
+ #
367
+ # @param resource_group_name [String] The name of the resource group that
368
+ # contains the resource. You can obtain this value from the Azure Resource
369
+ # Manager API or the portal.
370
+ # @param server_name [String] The name of the Azure SQL server.
371
+ # @param recommended_elastic_pool_name [String] The name of the Azure SQL
372
+ # Recommended Elastic Pool to be retrieved.
373
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
374
+ # will be added to the HTTP request.
375
+ #
376
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
377
+ #
378
+ def list_databases_with_http_info(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers = nil)
379
+ list_databases_async(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers).value!
380
+ end
381
+
382
+ #
383
+ # Returns information about an Azure SQL database inside of an Azure SQL
384
+ # Recommended Elastic Pool.
385
+ #
386
+ # @param resource_group_name [String] The name of the resource group that
387
+ # contains the resource. You can obtain this value from the Azure Resource
388
+ # Manager API or the portal.
389
+ # @param server_name [String] The name of the Azure SQL server.
390
+ # @param recommended_elastic_pool_name [String] The name of the Azure SQL
391
+ # Recommended Elastic Pool to be retrieved.
392
+ # @param [Hash{String => String}] A hash of custom headers that will be added
393
+ # to the HTTP request.
394
+ #
395
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
396
+ #
397
+ def list_databases_async(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers = nil)
398
+ api_version = '2014-04-01'
399
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
400
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
401
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
402
+ fail ArgumentError, 'recommended_elastic_pool_name is nil' if recommended_elastic_pool_name.nil?
403
+
404
+
405
+ request_headers = {}
406
+
407
+ # Set Headers
408
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
409
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
410
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}/databases'
411
+
412
+ request_url = @base_url || @client.base_url
413
+
414
+ options = {
415
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
416
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'recommendedElasticPoolName' => recommended_elastic_pool_name},
417
+ query_params: {'api-version' => api_version},
418
+ headers: request_headers.merge(custom_headers || {}),
419
+ base_url: request_url
420
+ }
421
+ promise = @client.make_request_async(:get, path_template, options)
422
+
423
+ promise = promise.then do |result|
424
+ http_response = result.response
425
+ status_code = http_response.status
426
+ response_content = http_response.body
427
+ unless status_code == 200
428
+ error_model = JSON.load(response_content)
429
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
430
+ end
431
+
432
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
433
+ # Deserialize Response
434
+ if status_code == 200
435
+ begin
436
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
437
+ result_mapper = DatabaseListResult.mapper()
438
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
439
+ rescue Exception => e
440
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
441
+ end
442
+ end
443
+
444
+ result
445
+ end
446
+
447
+ promise.execute
448
+ end
449
+
450
+ #
451
+ # Returns information about an recommended elastic pool metrics.
452
+ #
453
+ # @param resource_group_name [String] The name of the resource group that
454
+ # contains the resource. You can obtain this value from the Azure Resource
455
+ # Manager API or the portal.
456
+ # @param server_name [String] The name of the Azure SQL server.
457
+ # @param recommended_elastic_pool_name [String] The name of the Azure SQL
458
+ # Recommended Elastic Pool to be retrieved.
459
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
460
+ # will be added to the HTTP request.
461
+ #
462
+ # @return [RecommendedElasticPoolListMetricsResult] operation results.
463
+ #
464
+ def list_metrics(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers = nil)
465
+ response = list_metrics_async(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers).value!
466
+ response.body unless response.nil?
467
+ end
468
+
469
+ #
470
+ # Returns information about an recommended elastic pool metrics.
471
+ #
472
+ # @param resource_group_name [String] The name of the resource group that
473
+ # contains the resource. You can obtain this value from the Azure Resource
474
+ # Manager API or the portal.
475
+ # @param server_name [String] The name of the Azure SQL server.
476
+ # @param recommended_elastic_pool_name [String] The name of the Azure SQL
477
+ # Recommended Elastic Pool to be retrieved.
478
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
479
+ # will be added to the HTTP request.
480
+ #
481
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
482
+ #
483
+ def list_metrics_with_http_info(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers = nil)
484
+ list_metrics_async(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers).value!
485
+ end
486
+
487
+ #
488
+ # Returns information about an recommended elastic pool metrics.
489
+ #
490
+ # @param resource_group_name [String] The name of the resource group that
491
+ # contains the resource. You can obtain this value from the Azure Resource
492
+ # Manager API or the portal.
493
+ # @param server_name [String] The name of the Azure SQL server.
494
+ # @param recommended_elastic_pool_name [String] The name of the Azure SQL
495
+ # Recommended Elastic Pool to be retrieved.
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 list_metrics_async(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers = nil)
502
+ api_version = '2014-04-01'
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, 'server_name is nil' if server_name.nil?
506
+ fail ArgumentError, 'recommended_elastic_pool_name is nil' if recommended_elastic_pool_name.nil?
507
+
508
+
509
+ request_headers = {}
510
+
511
+ # Set Headers
512
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
513
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
514
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}/metrics'
515
+
516
+ request_url = @base_url || @client.base_url
517
+
518
+ options = {
519
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
520
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'recommendedElasticPoolName' => recommended_elastic_pool_name},
521
+ query_params: {'api-version' => api_version},
522
+ headers: request_headers.merge(custom_headers || {}),
523
+ base_url: request_url
524
+ }
525
+ promise = @client.make_request_async(:get, path_template, options)
526
+
527
+ promise = promise.then do |result|
528
+ http_response = result.response
529
+ status_code = http_response.status
530
+ response_content = http_response.body
531
+ unless status_code == 200
532
+ error_model = JSON.load(response_content)
533
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
534
+ end
535
+
536
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
537
+ # Deserialize Response
538
+ if status_code == 200
539
+ begin
540
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
541
+ result_mapper = RecommendedElasticPoolListMetricsResult.mapper()
542
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
543
+ rescue Exception => e
544
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
545
+ end
546
+ end
547
+
548
+ result
549
+ end
550
+
551
+ promise.execute
552
+ end
553
+
554
+ end
555
+ end