azure_mgmt_sql 0.15.2 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2014-04-01/generated/azure_mgmt_sql.rb +77 -63
  3. data/lib/2014-04-01/generated/azure_mgmt_sql/backup_long_term_retention_policies.rb +118 -16
  4. data/lib/2014-04-01/generated/azure_mgmt_sql/backup_long_term_retention_vaults.rb +114 -16
  5. data/lib/2014-04-01/generated/azure_mgmt_sql/capabilities.rb +6 -5
  6. data/lib/2014-04-01/generated/azure_mgmt_sql/data_masking_policies.rb +12 -12
  7. data/lib/2014-04-01/generated/azure_mgmt_sql/data_masking_rules.rb +12 -12
  8. data/lib/2014-04-01/generated/azure_mgmt_sql/database_advisors.rb +18 -17
  9. data/lib/2014-04-01/generated/azure_mgmt_sql/database_connection_policies.rb +12 -12
  10. data/lib/2014-04-01/generated/azure_mgmt_sql/database_table_auditing_policies.rb +18 -17
  11. data/lib/2014-04-01/generated/azure_mgmt_sql/database_threat_detection_policies.rb +12 -12
  12. data/lib/2014-04-01/generated/azure_mgmt_sql/database_usages.rb +6 -5
  13. data/lib/2014-04-01/generated/azure_mgmt_sql/databases.rb +649 -643
  14. data/lib/2014-04-01/generated/azure_mgmt_sql/disaster_recovery_configurations.rb +830 -0
  15. data/lib/2014-04-01/generated/azure_mgmt_sql/elastic_pool_activities.rb +6 -5
  16. data/lib/2014-04-01/generated/azure_mgmt_sql/elastic_pool_database_activities.rb +6 -5
  17. data/lib/2014-04-01/generated/azure_mgmt_sql/elastic_pools.rb +216 -213
  18. data/lib/2014-04-01/generated/azure_mgmt_sql/extensions.rb +130 -0
  19. data/lib/2014-04-01/generated/azure_mgmt_sql/firewall_rules.rb +24 -22
  20. data/lib/2014-04-01/generated/azure_mgmt_sql/geo_backup_policies.rb +18 -17
  21. data/lib/2014-04-01/generated/azure_mgmt_sql/models/backup_long_term_retention_policy_list_result.rb +56 -0
  22. data/lib/2014-04-01/generated/azure_mgmt_sql/models/backup_long_term_retention_vault_list_result.rb +56 -0
  23. data/lib/2014-04-01/generated/azure_mgmt_sql/models/database.rb +43 -10
  24. data/lib/2014-04-01/generated/azure_mgmt_sql/models/database_edition.rb +1 -0
  25. data/lib/2014-04-01/generated/azure_mgmt_sql/models/database_update.rb +43 -10
  26. data/lib/2014-04-01/generated/azure_mgmt_sql/models/disaster_recovery_configuration.rb +164 -0
  27. data/lib/2014-04-01/generated/azure_mgmt_sql/models/disaster_recovery_configuration_auto_failover.rb +16 -0
  28. data/lib/2014-04-01/generated/azure_mgmt_sql/models/disaster_recovery_configuration_failover_policy.rb +16 -0
  29. data/lib/2014-04-01/generated/azure_mgmt_sql/models/disaster_recovery_configuration_list_result.rb +57 -0
  30. data/lib/2014-04-01/generated/azure_mgmt_sql/models/disaster_recovery_configuration_role.rb +17 -0
  31. data/lib/2014-04-01/generated/azure_mgmt_sql/models/disaster_recovery_configuration_status.rb +18 -0
  32. data/lib/2014-04-01/generated/azure_mgmt_sql/models/edition_capability.rb +13 -0
  33. data/lib/2014-04-01/generated/azure_mgmt_sql/models/elastic_pool.rb +13 -0
  34. data/lib/2014-04-01/generated/azure_mgmt_sql/models/elastic_pool_edition_capability.rb +13 -0
  35. data/lib/2014-04-01/generated/azure_mgmt_sql/models/elastic_pool_update.rb +13 -0
  36. data/lib/2014-04-01/generated/azure_mgmt_sql/models/extension_list_result.rb +54 -0
  37. data/lib/2014-04-01/generated/azure_mgmt_sql/models/import_request.rb +12 -4
  38. data/lib/2014-04-01/generated/azure_mgmt_sql/models/query_text.rb +72 -0
  39. data/lib/2014-04-01/generated/azure_mgmt_sql/models/query_text_list_result.rb +55 -0
  40. data/lib/2014-04-01/generated/azure_mgmt_sql/models/service_objective_name.rb +52 -2
  41. data/lib/2014-04-01/generated/azure_mgmt_sql/models/slo_usage_metric.rb +10 -3
  42. data/lib/2014-04-01/generated/azure_mgmt_sql/operations.rb +6 -5
  43. data/lib/2014-04-01/generated/azure_mgmt_sql/queries.rb +6 -5
  44. data/lib/2014-04-01/generated/azure_mgmt_sql/query_statistics.rb +6 -5
  45. data/lib/2014-04-01/generated/azure_mgmt_sql/query_texts.rb +134 -0
  46. data/lib/2014-04-01/generated/azure_mgmt_sql/recommended_elastic_pools.rb +18 -15
  47. data/lib/2014-04-01/generated/azure_mgmt_sql/recoverable_databases.rb +12 -10
  48. data/lib/2014-04-01/generated/azure_mgmt_sql/replication_links.rb +38 -33
  49. data/lib/2014-04-01/generated/azure_mgmt_sql/restorable_dropped_databases.rb +12 -10
  50. data/lib/2014-04-01/generated/azure_mgmt_sql/restore_points.rb +6 -5
  51. data/lib/2014-04-01/generated/azure_mgmt_sql/server_azure_adadministrators.rb +32 -30
  52. data/lib/2014-04-01/generated/azure_mgmt_sql/server_communication_links.rb +28 -26
  53. data/lib/2014-04-01/generated/azure_mgmt_sql/server_connection_policies.rb +12 -12
  54. data/lib/2014-04-01/generated/azure_mgmt_sql/server_table_auditing_policies.rb +18 -17
  55. data/lib/2014-04-01/generated/azure_mgmt_sql/server_usages.rb +6 -5
  56. data/lib/2014-04-01/generated/azure_mgmt_sql/servers.rb +134 -133
  57. data/lib/2014-04-01/generated/azure_mgmt_sql/service_objectives.rb +12 -10
  58. data/lib/2014-04-01/generated/azure_mgmt_sql/service_tier_advisors.rb +12 -10
  59. data/lib/2014-04-01/generated/azure_mgmt_sql/sql_management_client.rb +32 -17
  60. data/lib/2014-04-01/generated/azure_mgmt_sql/transparent_data_encryption_activities.rb +6 -5
  61. data/lib/2014-04-01/generated/azure_mgmt_sql/transparent_data_encryption_configurations.rb +6 -5
  62. data/lib/2014-04-01/generated/azure_mgmt_sql/transparent_data_encryptions.rb +12 -12
  63. data/lib/2015-05-01-preview/generated/azure_mgmt_sql.rb +22 -19
  64. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/database_advisors.rb +18 -17
  65. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/database_blob_auditing_policies.rb +12 -12
  66. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/database_recommended_actions.rb +18 -17
  67. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/encryption_protectors.rb +31 -29
  68. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/failover_groups.rb +71 -67
  69. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/subscription_usage.rb +110 -0
  70. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/subscription_usage_list_result.rb +100 -0
  71. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/operations.rb +15 -13
  72. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/server_advisors.rb +18 -17
  73. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/server_keys.rb +41 -38
  74. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/servers.rb +66 -62
  75. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb +8 -1
  76. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/subscription_usages.rb +324 -0
  77. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_agents.rb +62 -56
  78. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb +118 -107
  79. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_members.rb +76 -71
  80. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/virtual_network_rules.rb +41 -38
  81. data/lib/2017-03-01-preview/generated/azure_mgmt_sql.rb +30 -1
  82. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/database_operations.rb +21 -18
  83. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/database_restore_points.rb +527 -0
  84. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/databases.rb +1599 -0
  85. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/arm_sku.rb +92 -0
  86. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/automatic_tuning_option_mode_actual.rb +16 -0
  87. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/automatic_tuning_option_mode_desired.rb +17 -0
  88. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/automatic_tuning_server_mode.rb +17 -0
  89. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/automatic_tuning_server_options.rb +90 -0
  90. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/automatic_tuning_server_reason.rb +17 -0
  91. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/catalog_collation_type.rb +16 -0
  92. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/create_database_restore_point_definition.rb +47 -0
  93. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/create_mode.rb +23 -0
  94. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/database.rb +393 -0
  95. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/database_list_result.rb +100 -0
  96. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/database_restore_point.rb +124 -0
  97. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/database_restore_point_list_result.rb +100 -0
  98. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/database_update.rb +348 -0
  99. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/import_export_database_definition.rb +145 -0
  100. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/import_export_operation_result.rb +170 -0
  101. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/resource_move_definition.rb +46 -0
  102. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/restore_point_type.rb +16 -0
  103. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/sample_name.rb +17 -0
  104. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/server_automatic_tuning.rb +110 -0
  105. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/server_dns_alias.rb +74 -0
  106. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/server_dns_alias_acquisition.rb +47 -0
  107. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/server_dns_alias_list_result.rb +100 -0
  108. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/status.rb +32 -0
  109. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/tracked_resource.rb +92 -0
  110. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/server_automatic_tuning_operations.rb +238 -0
  111. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/server_dns_aliases.rb +805 -0
  112. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/sql_management_client.rb +21 -1
  113. data/lib/profiles/latest/modules/sql_profile_module.rb +912 -749
  114. data/lib/profiles/latest/sql_latest_profile_client.rb +28 -9
  115. data/lib/profiles/latest/sql_module_definition.rb +0 -1
  116. data/lib/version.rb +1 -1
  117. metadata +49 -3
@@ -38,8 +38,8 @@ module Azure::SQL::Mgmt::V2014_04_01
38
38
  #
39
39
  # @return [ElasticPoolActivityListResult] operation results.
40
40
  #
41
- def list_by_elastic_pool(resource_group_name, server_name, elastic_pool_name, custom_headers = nil)
42
- response = list_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, custom_headers).value!
41
+ def list_by_elastic_pool(resource_group_name, server_name, elastic_pool_name, custom_headers:nil)
42
+ response = list_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, custom_headers:custom_headers).value!
43
43
  response.body unless response.nil?
44
44
  end
45
45
 
@@ -57,8 +57,8 @@ module Azure::SQL::Mgmt::V2014_04_01
57
57
  #
58
58
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
59
59
  #
60
- def list_by_elastic_pool_with_http_info(resource_group_name, server_name, elastic_pool_name, custom_headers = nil)
61
- list_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, custom_headers).value!
60
+ def list_by_elastic_pool_with_http_info(resource_group_name, server_name, elastic_pool_name, custom_headers:nil)
61
+ list_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, custom_headers:custom_headers).value!
62
62
  end
63
63
 
64
64
  #
@@ -75,7 +75,7 @@ module Azure::SQL::Mgmt::V2014_04_01
75
75
  #
76
76
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
77
77
  #
78
- def list_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, custom_headers = nil)
78
+ def list_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, custom_headers:nil)
79
79
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
80
80
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
81
81
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
@@ -84,6 +84,7 @@ module Azure::SQL::Mgmt::V2014_04_01
84
84
 
85
85
 
86
86
  request_headers = {}
87
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
87
88
 
88
89
  # Set Headers
89
90
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -37,8 +37,8 @@ module Azure::SQL::Mgmt::V2014_04_01
37
37
  #
38
38
  # @return [ElasticPoolDatabaseActivityListResult] operation results.
39
39
  #
40
- def list_by_elastic_pool(resource_group_name, server_name, elastic_pool_name, custom_headers = nil)
41
- response = list_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, custom_headers).value!
40
+ def list_by_elastic_pool(resource_group_name, server_name, elastic_pool_name, custom_headers:nil)
41
+ response = list_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, custom_headers:custom_headers).value!
42
42
  response.body unless response.nil?
43
43
  end
44
44
 
@@ -55,8 +55,8 @@ module Azure::SQL::Mgmt::V2014_04_01
55
55
  #
56
56
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
57
57
  #
58
- def list_by_elastic_pool_with_http_info(resource_group_name, server_name, elastic_pool_name, custom_headers = nil)
59
- list_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, custom_headers).value!
58
+ def list_by_elastic_pool_with_http_info(resource_group_name, server_name, elastic_pool_name, custom_headers:nil)
59
+ list_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, custom_headers:custom_headers).value!
60
60
  end
61
61
 
62
62
  #
@@ -72,7 +72,7 @@ module Azure::SQL::Mgmt::V2014_04_01
72
72
  #
73
73
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
74
74
  #
75
- def list_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, custom_headers = nil)
75
+ def list_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, custom_headers:nil)
76
76
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
77
77
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
78
78
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
@@ -81,6 +81,7 @@ module Azure::SQL::Mgmt::V2014_04_01
81
81
 
82
82
 
83
83
  request_headers = {}
84
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
84
85
 
85
86
  # Set Headers
86
87
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -25,106 +25,195 @@ module Azure::SQL::Mgmt::V2014_04_01
25
25
  attr_reader :client
26
26
 
27
27
  #
28
- # Returns elastic pool metrics.
28
+ # Creates a new elastic pool or updates an existing elastic pool.
29
29
  #
30
30
  # @param resource_group_name [String] The name of the resource group that
31
31
  # contains the resource. You can obtain this value from the Azure Resource
32
32
  # Manager API or the portal.
33
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.
34
+ # @param elastic_pool_name [String] The name of the elastic pool to be operated
35
+ # on (updated or created).
36
+ # @param parameters [ElasticPool] The required parameters for creating or
37
+ # updating an elastic pool.
37
38
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
38
39
  # will be added to the HTTP request.
39
40
  #
40
- # @return [MetricListResult] operation results.
41
+ # @return [ElasticPool] operation results.
41
42
  #
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!
43
+ def create_or_update(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers:nil)
44
+ response = create_or_update_async(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers:custom_headers).value!
44
45
  response.body unless response.nil?
45
46
  end
46
47
 
47
48
  #
48
- # Returns elastic pool metrics.
49
+ # @param resource_group_name [String] The name of the resource group that
50
+ # contains the resource. You can obtain this value from the Azure Resource
51
+ # Manager API or the portal.
52
+ # @param server_name [String] The name of the server.
53
+ # @param elastic_pool_name [String] The name of the elastic pool to be operated
54
+ # on (updated or created).
55
+ # @param parameters [ElasticPool] The required parameters for creating or
56
+ # updating an elastic pool.
57
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
58
+ # will be added to the HTTP request.
59
+ #
60
+ # @return [Concurrent::Promise] promise which provides async access to http
61
+ # response.
62
+ #
63
+ def create_or_update_async(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers:nil)
64
+ # Send request
65
+ promise = begin_create_or_update_async(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers:custom_headers)
66
+
67
+ promise = promise.then do |response|
68
+ # Defining deserialization method.
69
+ deserialize_method = lambda do |parsed_response|
70
+ result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::ElasticPool.mapper()
71
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
72
+ end
73
+
74
+ # Waiting for response.
75
+ @client.get_long_running_operation_result(response, deserialize_method)
76
+ end
77
+
78
+ promise
79
+ end
80
+
81
+ #
82
+ # Updates an existing elastic pool.
49
83
  #
50
84
  # @param resource_group_name [String] The name of the resource group that
51
85
  # contains the resource. You can obtain this value from the Azure Resource
52
86
  # Manager API or the portal.
53
87
  # @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.
88
+ # @param elastic_pool_name [String] The name of the elastic pool to be updated.
89
+ # @param parameters [ElasticPoolUpdate] The required parameters for updating an
90
+ # elastic pool.
91
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
92
+ # will be added to the HTTP request.
93
+ #
94
+ # @return [ElasticPool] operation results.
95
+ #
96
+ def update(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers:nil)
97
+ response = update_async(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers:custom_headers).value!
98
+ response.body unless response.nil?
99
+ end
100
+
101
+ #
102
+ # @param resource_group_name [String] The name of the resource group that
103
+ # contains the resource. You can obtain this value from the Azure Resource
104
+ # Manager API or the portal.
105
+ # @param server_name [String] The name of the server.
106
+ # @param elastic_pool_name [String] The name of the elastic pool to be updated.
107
+ # @param parameters [ElasticPoolUpdate] The required parameters for updating an
108
+ # elastic pool.
109
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
110
+ # will be added to the HTTP request.
111
+ #
112
+ # @return [Concurrent::Promise] promise which provides async access to http
113
+ # response.
114
+ #
115
+ def update_async(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers:nil)
116
+ # Send request
117
+ promise = begin_update_async(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers:custom_headers)
118
+
119
+ promise = promise.then do |response|
120
+ # Defining deserialization method.
121
+ deserialize_method = lambda do |parsed_response|
122
+ result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::ElasticPool.mapper()
123
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
124
+ end
125
+
126
+ # Waiting for response.
127
+ @client.get_long_running_operation_result(response, deserialize_method)
128
+ end
129
+
130
+ promise
131
+ end
132
+
133
+ #
134
+ # Deletes the 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 server.
140
+ # @param elastic_pool_name [String] The name of the elastic pool to be deleted.
141
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
142
+ # will be added to the HTTP request.
143
+ #
144
+ #
145
+ def delete(resource_group_name, server_name, elastic_pool_name, custom_headers:nil)
146
+ response = delete_async(resource_group_name, server_name, elastic_pool_name, custom_headers:custom_headers).value!
147
+ nil
148
+ end
149
+
150
+ #
151
+ # Deletes the elastic pool.
152
+ #
153
+ # @param resource_group_name [String] The name of the resource group that
154
+ # contains the resource. You can obtain this value from the Azure Resource
155
+ # Manager API or the portal.
156
+ # @param server_name [String] The name of the server.
157
+ # @param elastic_pool_name [String] The name of the elastic pool to be deleted.
57
158
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
58
159
  # will be added to the HTTP request.
59
160
  #
60
161
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
61
162
  #
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!
163
+ def delete_with_http_info(resource_group_name, server_name, elastic_pool_name, custom_headers:nil)
164
+ delete_async(resource_group_name, server_name, elastic_pool_name, custom_headers:custom_headers).value!
64
165
  end
65
166
 
66
167
  #
67
- # Returns elastic pool metrics.
168
+ # Deletes the elastic pool.
68
169
  #
69
170
  # @param resource_group_name [String] The name of the resource group that
70
171
  # contains the resource. You can obtain this value from the Azure Resource
71
172
  # Manager API or the portal.
72
173
  # @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.
174
+ # @param elastic_pool_name [String] The name of the elastic pool to be deleted.
76
175
  # @param [Hash{String => String}] A hash of custom headers that will be added
77
176
  # to the HTTP request.
78
177
  #
79
178
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
80
179
  #
81
- def list_metrics_async(resource_group_name, server_name, elastic_pool_name, filter, custom_headers = nil)
180
+ def delete_async(resource_group_name, server_name, elastic_pool_name, custom_headers:nil)
82
181
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
83
182
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
84
183
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
85
184
  fail ArgumentError, 'server_name is nil' if server_name.nil?
86
185
  fail ArgumentError, 'elastic_pool_name is nil' if elastic_pool_name.nil?
87
- fail ArgumentError, 'filter is nil' if filter.nil?
88
186
 
89
187
 
90
188
  request_headers = {}
189
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
91
190
 
92
191
  # Set Headers
93
192
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
94
193
  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'
194
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}'
96
195
 
97
196
  request_url = @base_url || @client.base_url
98
197
 
99
198
  options = {
100
199
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
101
200
  path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'elasticPoolName' => elastic_pool_name},
102
- query_params: {'api-version' => @client.api_version,'$filter' => filter},
201
+ query_params: {'api-version' => @client.api_version},
103
202
  headers: request_headers.merge(custom_headers || {}),
104
203
  base_url: request_url
105
204
  }
106
- promise = @client.make_request_async(:get, path_template, options)
205
+ promise = @client.make_request_async(:delete, path_template, options)
107
206
 
108
207
  promise = promise.then do |result|
109
208
  http_response = result.response
110
209
  status_code = http_response.status
111
210
  response_content = http_response.body
112
- unless status_code == 200
211
+ unless status_code == 200 || status_code == 204
113
212
  error_model = JSON.load(response_content)
114
213
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
115
214
  end
116
215
 
117
216
  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::SQL::Mgmt::V2014_04_01::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
217
 
129
218
  result
130
219
  end
@@ -133,54 +222,57 @@ module Azure::SQL::Mgmt::V2014_04_01
133
222
  end
134
223
 
135
224
  #
136
- # Returns elastic pool metric definitions.
225
+ # Gets an elastic pool.
137
226
  #
138
227
  # @param resource_group_name [String] The name of the resource group that
139
228
  # contains the resource. You can obtain this value from the Azure Resource
140
229
  # Manager API or the portal.
141
230
  # @param server_name [String] The name of the server.
142
- # @param elastic_pool_name [String] The name of the elastic pool.
231
+ # @param elastic_pool_name [String] The name of the elastic pool to be
232
+ # retrieved.
143
233
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
144
234
  # will be added to the HTTP request.
145
235
  #
146
- # @return [MetricDefinitionListResult] operation results.
236
+ # @return [ElasticPool] operation results.
147
237
  #
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!
238
+ def get(resource_group_name, server_name, elastic_pool_name, custom_headers:nil)
239
+ response = get_async(resource_group_name, server_name, elastic_pool_name, custom_headers:custom_headers).value!
150
240
  response.body unless response.nil?
151
241
  end
152
242
 
153
243
  #
154
- # Returns elastic pool metric definitions.
244
+ # Gets an elastic pool.
155
245
  #
156
246
  # @param resource_group_name [String] The name of the resource group that
157
247
  # contains the resource. You can obtain this value from the Azure Resource
158
248
  # Manager API or the portal.
159
249
  # @param server_name [String] The name of the server.
160
- # @param elastic_pool_name [String] The name of the elastic pool.
250
+ # @param elastic_pool_name [String] The name of the elastic pool to be
251
+ # retrieved.
161
252
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
162
253
  # will be added to the HTTP request.
163
254
  #
164
255
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
165
256
  #
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!
257
+ def get_with_http_info(resource_group_name, server_name, elastic_pool_name, custom_headers:nil)
258
+ get_async(resource_group_name, server_name, elastic_pool_name, custom_headers:custom_headers).value!
168
259
  end
169
260
 
170
261
  #
171
- # Returns elastic pool metric definitions.
262
+ # Gets an elastic pool.
172
263
  #
173
264
  # @param resource_group_name [String] The name of the resource group that
174
265
  # contains the resource. You can obtain this value from the Azure Resource
175
266
  # Manager API or the portal.
176
267
  # @param server_name [String] The name of the server.
177
- # @param elastic_pool_name [String] The name of the elastic pool.
268
+ # @param elastic_pool_name [String] The name of the elastic pool to be
269
+ # retrieved.
178
270
  # @param [Hash{String => String}] A hash of custom headers that will be added
179
271
  # to the HTTP request.
180
272
  #
181
273
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
182
274
  #
183
- def list_metric_definitions_async(resource_group_name, server_name, elastic_pool_name, custom_headers = nil)
275
+ def get_async(resource_group_name, server_name, elastic_pool_name, custom_headers:nil)
184
276
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
185
277
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
186
278
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
@@ -189,11 +281,12 @@ module Azure::SQL::Mgmt::V2014_04_01
189
281
 
190
282
 
191
283
  request_headers = {}
284
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
192
285
 
193
286
  # Set Headers
194
287
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
195
288
  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'
289
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}'
197
290
 
198
291
  request_url = @base_url || @client.base_url
199
292
 
@@ -220,7 +313,7 @@ module Azure::SQL::Mgmt::V2014_04_01
220
313
  if status_code == 200
221
314
  begin
222
315
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
223
- result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::MetricDefinitionListResult.mapper()
316
+ result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::ElasticPool.mapper()
224
317
  result.body = @client.deserialize(result_mapper, parsed_response)
225
318
  rescue Exception => e
226
319
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -234,194 +327,96 @@ module Azure::SQL::Mgmt::V2014_04_01
234
327
  end
235
328
 
236
329
  #
237
- # Creates a new elastic pool or updates an existing elastic pool.
238
- #
239
- # @param resource_group_name [String] The name of the resource group that
240
- # contains the resource. You can obtain this value from the Azure Resource
241
- # Manager API or the portal.
242
- # @param server_name [String] The name of the server.
243
- # @param elastic_pool_name [String] The name of the elastic pool to be operated
244
- # on (updated or created).
245
- # @param parameters [ElasticPool] The required parameters for creating or
246
- # updating an elastic pool.
247
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
248
- # will be added to the HTTP request.
249
- #
250
- # @return [ElasticPool] operation results.
251
- #
252
- def create_or_update(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers = nil)
253
- response = create_or_update_async(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers).value!
254
- response.body unless response.nil?
255
- end
256
-
257
- #
258
- # @param resource_group_name [String] The name of the resource group that
259
- # contains the resource. You can obtain this value from the Azure Resource
260
- # Manager API or the portal.
261
- # @param server_name [String] The name of the server.
262
- # @param elastic_pool_name [String] The name of the elastic pool to be operated
263
- # on (updated or created).
264
- # @param parameters [ElasticPool] The required parameters for creating or
265
- # updating an elastic pool.
266
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
267
- # will be added to the HTTP request.
268
- #
269
- # @return [Concurrent::Promise] promise which provides async access to http
270
- # response.
271
- #
272
- def create_or_update_async(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers = nil)
273
- # Send request
274
- promise = begin_create_or_update_async(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers)
275
-
276
- promise = promise.then do |response|
277
- # Defining deserialization method.
278
- deserialize_method = lambda do |parsed_response|
279
- result_mapper = Azure::SQL::Mgmt::V2014_04_01::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.
330
+ # Returns a list of elastic pools in a server.
292
331
  #
293
332
  # @param resource_group_name [String] The name of the resource group that
294
333
  # contains the resource. You can obtain this value from the Azure Resource
295
334
  # Manager API or the portal.
296
335
  # @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
336
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
301
337
  # will be added to the HTTP request.
302
338
  #
303
- # @return [ElasticPool] operation results.
339
+ # @return [ElasticPoolListResult] operation results.
304
340
  #
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!
341
+ def list_by_server(resource_group_name, server_name, custom_headers:nil)
342
+ response = list_by_server_async(resource_group_name, server_name, custom_headers:custom_headers).value!
307
343
  response.body unless response.nil?
308
344
  end
309
345
 
310
346
  #
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::SQL::Mgmt::V2014_04_01::Models::ElasticPool.mapper()
332
- parsed_response = @client.deserialize(result_mapper, parsed_response)
333
- end
334
-
335
- # Waiting for response.
336
- @client.get_long_running_operation_result(response, deserialize_method)
337
- end
338
-
339
- promise
340
- end
341
-
342
- #
343
- # Deletes the elastic pool.
344
- #
345
- # @param resource_group_name [String] The name of the resource group that
346
- # contains the resource. You can obtain this value from the Azure Resource
347
- # Manager API or the portal.
348
- # @param server_name [String] The name of the server.
349
- # @param elastic_pool_name [String] The name of the elastic pool to be deleted.
350
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
351
- # will be added to the HTTP request.
352
- #
353
- #
354
- def delete(resource_group_name, server_name, elastic_pool_name, custom_headers = nil)
355
- response = delete_async(resource_group_name, server_name, elastic_pool_name, custom_headers).value!
356
- nil
357
- end
358
-
359
- #
360
- # Deletes the elastic pool.
347
+ # Returns a list of elastic pools in a server.
361
348
  #
362
349
  # @param resource_group_name [String] The name of the resource group that
363
350
  # contains the resource. You can obtain this value from the Azure Resource
364
351
  # Manager API or the portal.
365
352
  # @param server_name [String] The name of the server.
366
- # @param elastic_pool_name [String] The name of the elastic pool to be deleted.
367
353
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
368
354
  # will be added to the HTTP request.
369
355
  #
370
356
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
371
357
  #
372
- def delete_with_http_info(resource_group_name, server_name, elastic_pool_name, custom_headers = nil)
373
- delete_async(resource_group_name, server_name, elastic_pool_name, custom_headers).value!
358
+ def list_by_server_with_http_info(resource_group_name, server_name, custom_headers:nil)
359
+ list_by_server_async(resource_group_name, server_name, custom_headers:custom_headers).value!
374
360
  end
375
361
 
376
362
  #
377
- # Deletes the elastic pool.
363
+ # Returns a list of elastic pools in a server.
378
364
  #
379
365
  # @param resource_group_name [String] The name of the resource group that
380
366
  # contains the resource. You can obtain this value from the Azure Resource
381
367
  # Manager API or the portal.
382
368
  # @param server_name [String] The name of the server.
383
- # @param elastic_pool_name [String] The name of the elastic pool to be deleted.
384
369
  # @param [Hash{String => String}] A hash of custom headers that will be added
385
370
  # to the HTTP request.
386
371
  #
387
372
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
388
373
  #
389
- def delete_async(resource_group_name, server_name, elastic_pool_name, custom_headers = nil)
374
+ def list_by_server_async(resource_group_name, server_name, custom_headers:nil)
390
375
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
391
376
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
392
377
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
393
378
  fail ArgumentError, 'server_name is nil' if server_name.nil?
394
- fail ArgumentError, 'elastic_pool_name is nil' if elastic_pool_name.nil?
395
379
 
396
380
 
397
381
  request_headers = {}
382
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
398
383
 
399
384
  # Set Headers
400
385
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
401
386
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
402
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}'
387
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools'
403
388
 
404
389
  request_url = @base_url || @client.base_url
405
390
 
406
391
  options = {
407
392
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
408
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'elasticPoolName' => elastic_pool_name},
393
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name},
409
394
  query_params: {'api-version' => @client.api_version},
410
395
  headers: request_headers.merge(custom_headers || {}),
411
396
  base_url: request_url
412
397
  }
413
- promise = @client.make_request_async(:delete, path_template, options)
398
+ promise = @client.make_request_async(:get, path_template, options)
414
399
 
415
400
  promise = promise.then do |result|
416
401
  http_response = result.response
417
402
  status_code = http_response.status
418
403
  response_content = http_response.body
419
- unless status_code == 200 || status_code == 204
404
+ unless status_code == 200
420
405
  error_model = JSON.load(response_content)
421
406
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
422
407
  end
423
408
 
424
409
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
410
+ # Deserialize Response
411
+ if status_code == 200
412
+ begin
413
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
414
+ result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::ElasticPoolListResult.mapper()
415
+ result.body = @client.deserialize(result_mapper, parsed_response)
416
+ rescue Exception => e
417
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
418
+ end
419
+ end
425
420
 
426
421
  result
427
422
  end
@@ -430,77 +425,82 @@ module Azure::SQL::Mgmt::V2014_04_01
430
425
  end
431
426
 
432
427
  #
433
- # Gets an elastic pool.
428
+ # Returns elastic pool metrics.
434
429
  #
435
430
  # @param resource_group_name [String] The name of the resource group that
436
431
  # contains the resource. You can obtain this value from the Azure Resource
437
432
  # Manager API or the portal.
438
433
  # @param server_name [String] The name of the server.
439
- # @param elastic_pool_name [String] The name of the elastic pool to be
440
- # retrieved.
434
+ # @param elastic_pool_name [String] The name of the elastic pool.
435
+ # @param filter [String] An OData filter expression that describes a subset of
436
+ # metrics to return.
441
437
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
442
438
  # will be added to the HTTP request.
443
439
  #
444
- # @return [ElasticPool] operation results.
440
+ # @return [MetricListResult] operation results.
445
441
  #
446
- def get(resource_group_name, server_name, elastic_pool_name, custom_headers = nil)
447
- response = get_async(resource_group_name, server_name, elastic_pool_name, custom_headers).value!
442
+ def list_metrics(resource_group_name, server_name, elastic_pool_name, filter, custom_headers:nil)
443
+ response = list_metrics_async(resource_group_name, server_name, elastic_pool_name, filter, custom_headers:custom_headers).value!
448
444
  response.body unless response.nil?
449
445
  end
450
446
 
451
447
  #
452
- # Gets an elastic pool.
448
+ # Returns elastic pool metrics.
453
449
  #
454
450
  # @param resource_group_name [String] The name of the resource group that
455
451
  # contains the resource. You can obtain this value from the Azure Resource
456
452
  # Manager API or the portal.
457
453
  # @param server_name [String] The name of the server.
458
- # @param elastic_pool_name [String] The name of the elastic pool to be
459
- # retrieved.
454
+ # @param elastic_pool_name [String] The name of the elastic pool.
455
+ # @param filter [String] An OData filter expression that describes a subset of
456
+ # metrics to return.
460
457
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
461
458
  # will be added to the HTTP request.
462
459
  #
463
460
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
464
461
  #
465
- def get_with_http_info(resource_group_name, server_name, elastic_pool_name, custom_headers = nil)
466
- get_async(resource_group_name, server_name, elastic_pool_name, custom_headers).value!
462
+ def list_metrics_with_http_info(resource_group_name, server_name, elastic_pool_name, filter, custom_headers:nil)
463
+ list_metrics_async(resource_group_name, server_name, elastic_pool_name, filter, custom_headers:custom_headers).value!
467
464
  end
468
465
 
469
466
  #
470
- # Gets an elastic pool.
467
+ # Returns elastic pool metrics.
471
468
  #
472
469
  # @param resource_group_name [String] The name of the resource group that
473
470
  # contains the resource. You can obtain this value from the Azure Resource
474
471
  # Manager API or the portal.
475
472
  # @param server_name [String] The name of the server.
476
- # @param elastic_pool_name [String] The name of the elastic pool to be
477
- # retrieved.
473
+ # @param elastic_pool_name [String] The name of the elastic pool.
474
+ # @param filter [String] An OData filter expression that describes a subset of
475
+ # metrics to return.
478
476
  # @param [Hash{String => String}] A hash of custom headers that will be added
479
477
  # to the HTTP request.
480
478
  #
481
479
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
482
480
  #
483
- def get_async(resource_group_name, server_name, elastic_pool_name, custom_headers = nil)
481
+ def list_metrics_async(resource_group_name, server_name, elastic_pool_name, filter, custom_headers:nil)
484
482
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
485
483
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
486
484
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
487
485
  fail ArgumentError, 'server_name is nil' if server_name.nil?
488
486
  fail ArgumentError, 'elastic_pool_name is nil' if elastic_pool_name.nil?
487
+ fail ArgumentError, 'filter is nil' if filter.nil?
489
488
 
490
489
 
491
490
  request_headers = {}
491
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
492
492
 
493
493
  # Set Headers
494
494
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
495
495
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
496
- 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}/metrics'
497
497
 
498
498
  request_url = @base_url || @client.base_url
499
499
 
500
500
  options = {
501
501
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
502
502
  path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'elasticPoolName' => elastic_pool_name},
503
- query_params: {'api-version' => @client.api_version},
503
+ query_params: {'api-version' => @client.api_version,'$filter' => filter},
504
504
  headers: request_headers.merge(custom_headers || {}),
505
505
  base_url: request_url
506
506
  }
@@ -520,7 +520,7 @@ module Azure::SQL::Mgmt::V2014_04_01
520
520
  if status_code == 200
521
521
  begin
522
522
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
523
- result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::ElasticPool.mapper()
523
+ result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::MetricListResult.mapper()
524
524
  result.body = @client.deserialize(result_mapper, parsed_response)
525
525
  rescue Exception => e
526
526
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -534,69 +534,74 @@ module Azure::SQL::Mgmt::V2014_04_01
534
534
  end
535
535
 
536
536
  #
537
- # Returns a list of elastic pools in a server.
537
+ # Returns elastic pool metric definitions.
538
538
  #
539
539
  # @param resource_group_name [String] The name of the resource group that
540
540
  # contains the resource. You can obtain this value from the Azure Resource
541
541
  # Manager API or the portal.
542
542
  # @param server_name [String] The name of the server.
543
+ # @param elastic_pool_name [String] The name of the elastic pool.
543
544
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
544
545
  # will be added to the HTTP request.
545
546
  #
546
- # @return [ElasticPoolListResult] operation results.
547
+ # @return [MetricDefinitionListResult] operation results.
547
548
  #
548
- def list_by_server(resource_group_name, server_name, custom_headers = nil)
549
- response = list_by_server_async(resource_group_name, server_name, custom_headers).value!
549
+ def list_metric_definitions(resource_group_name, server_name, elastic_pool_name, custom_headers:nil)
550
+ response = list_metric_definitions_async(resource_group_name, server_name, elastic_pool_name, custom_headers:custom_headers).value!
550
551
  response.body unless response.nil?
551
552
  end
552
553
 
553
554
  #
554
- # Returns a list of elastic pools in a server.
555
+ # Returns elastic pool metric definitions.
555
556
  #
556
557
  # @param resource_group_name [String] The name of the resource group that
557
558
  # contains the resource. You can obtain this value from the Azure Resource
558
559
  # Manager API or the portal.
559
560
  # @param server_name [String] The name of the server.
561
+ # @param elastic_pool_name [String] The name of the elastic pool.
560
562
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
561
563
  # will be added to the HTTP request.
562
564
  #
563
565
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
564
566
  #
565
- def list_by_server_with_http_info(resource_group_name, server_name, custom_headers = nil)
566
- list_by_server_async(resource_group_name, server_name, custom_headers).value!
567
+ def list_metric_definitions_with_http_info(resource_group_name, server_name, elastic_pool_name, custom_headers:nil)
568
+ list_metric_definitions_async(resource_group_name, server_name, elastic_pool_name, custom_headers:custom_headers).value!
567
569
  end
568
570
 
569
571
  #
570
- # Returns a list of elastic pools in a server.
572
+ # Returns elastic pool metric definitions.
571
573
  #
572
574
  # @param resource_group_name [String] The name of the resource group that
573
575
  # contains the resource. You can obtain this value from the Azure Resource
574
576
  # Manager API or the portal.
575
577
  # @param server_name [String] The name of the server.
578
+ # @param elastic_pool_name [String] The name of the elastic pool.
576
579
  # @param [Hash{String => String}] A hash of custom headers that will be added
577
580
  # to the HTTP request.
578
581
  #
579
582
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
580
583
  #
581
- def list_by_server_async(resource_group_name, server_name, custom_headers = nil)
584
+ def list_metric_definitions_async(resource_group_name, server_name, elastic_pool_name, custom_headers:nil)
582
585
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
583
586
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
584
587
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
585
588
  fail ArgumentError, 'server_name is nil' if server_name.nil?
589
+ fail ArgumentError, 'elastic_pool_name is nil' if elastic_pool_name.nil?
586
590
 
587
591
 
588
592
  request_headers = {}
593
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
589
594
 
590
595
  # Set Headers
591
596
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
592
597
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
593
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools'
598
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metricDefinitions'
594
599
 
595
600
  request_url = @base_url || @client.base_url
596
601
 
597
602
  options = {
598
603
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
599
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name},
604
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'elasticPoolName' => elastic_pool_name},
600
605
  query_params: {'api-version' => @client.api_version},
601
606
  headers: request_headers.merge(custom_headers || {}),
602
607
  base_url: request_url
@@ -617,7 +622,7 @@ module Azure::SQL::Mgmt::V2014_04_01
617
622
  if status_code == 200
618
623
  begin
619
624
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
620
- result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::ElasticPoolListResult.mapper()
625
+ result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::MetricDefinitionListResult.mapper()
621
626
  result.body = @client.deserialize(result_mapper, parsed_response)
622
627
  rescue Exception => e
623
628
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -646,8 +651,8 @@ module Azure::SQL::Mgmt::V2014_04_01
646
651
  #
647
652
  # @return [ElasticPool] operation results.
648
653
  #
649
- def begin_create_or_update(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers = nil)
650
- response = begin_create_or_update_async(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers).value!
654
+ def begin_create_or_update(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers:nil)
655
+ response = begin_create_or_update_async(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers:custom_headers).value!
651
656
  response.body unless response.nil?
652
657
  end
653
658
 
@@ -667,8 +672,8 @@ module Azure::SQL::Mgmt::V2014_04_01
667
672
  #
668
673
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
669
674
  #
670
- def begin_create_or_update_with_http_info(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers = nil)
671
- begin_create_or_update_async(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers).value!
675
+ def begin_create_or_update_with_http_info(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers:nil)
676
+ begin_create_or_update_async(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers:custom_headers).value!
672
677
  end
673
678
 
674
679
  #
@@ -687,7 +692,7 @@ module Azure::SQL::Mgmt::V2014_04_01
687
692
  #
688
693
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
689
694
  #
690
- def begin_create_or_update_async(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers = nil)
695
+ def begin_create_or_update_async(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers:nil)
691
696
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
692
697
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
693
698
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
@@ -697,13 +702,12 @@ module Azure::SQL::Mgmt::V2014_04_01
697
702
 
698
703
 
699
704
  request_headers = {}
705
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
700
706
 
701
707
  # Set Headers
702
708
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
703
709
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
704
710
 
705
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
706
-
707
711
  # Serialize Request
708
712
  request_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::ElasticPool.mapper()
709
713
  request_content = @client.serialize(request_mapper, parameters)
@@ -775,8 +779,8 @@ module Azure::SQL::Mgmt::V2014_04_01
775
779
  #
776
780
  # @return [ElasticPool] operation results.
777
781
  #
778
- def begin_update(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers = nil)
779
- response = begin_update_async(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers).value!
782
+ def begin_update(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers:nil)
783
+ response = begin_update_async(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers:custom_headers).value!
780
784
  response.body unless response.nil?
781
785
  end
782
786
 
@@ -795,8 +799,8 @@ module Azure::SQL::Mgmt::V2014_04_01
795
799
  #
796
800
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
797
801
  #
798
- def begin_update_with_http_info(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers = nil)
799
- begin_update_async(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers).value!
802
+ def begin_update_with_http_info(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers:nil)
803
+ begin_update_async(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers:custom_headers).value!
800
804
  end
801
805
 
802
806
  #
@@ -814,7 +818,7 @@ module Azure::SQL::Mgmt::V2014_04_01
814
818
  #
815
819
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
816
820
  #
817
- def begin_update_async(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers = nil)
821
+ def begin_update_async(resource_group_name, server_name, elastic_pool_name, parameters, custom_headers:nil)
818
822
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
819
823
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
820
824
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
@@ -824,13 +828,12 @@ module Azure::SQL::Mgmt::V2014_04_01
824
828
 
825
829
 
826
830
  request_headers = {}
831
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
827
832
 
828
833
  # Set Headers
829
834
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
830
835
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
831
836
 
832
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
833
-
834
837
  # Serialize Request
835
838
  request_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::ElasticPoolUpdate.mapper()
836
839
  request_content = @client.serialize(request_mapper, parameters)