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 [DatabaseSecurityAlertPolicy] operation results.
40
40
  #
41
- def get(resource_group_name, server_name, database_name, custom_headers = nil)
42
- response = get_async(resource_group_name, server_name, database_name, custom_headers).value!
41
+ def get(resource_group_name, server_name, database_name, custom_headers:nil)
42
+ response = get_async(resource_group_name, server_name, database_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 get_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil)
61
- get_async(resource_group_name, server_name, database_name, custom_headers).value!
60
+ def get_with_http_info(resource_group_name, server_name, database_name, custom_headers:nil)
61
+ get_async(resource_group_name, server_name, database_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 get_async(resource_group_name, server_name, database_name, custom_headers = nil)
78
+ def get_async(resource_group_name, server_name, database_name, custom_headers:nil)
79
79
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
80
80
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
81
81
  fail ArgumentError, 'server_name is nil' if server_name.nil?
@@ -85,6 +85,7 @@ module Azure::SQL::Mgmt::V2014_04_01
85
85
 
86
86
 
87
87
  request_headers = {}
88
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
88
89
 
89
90
  # Set Headers
90
91
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -145,8 +146,8 @@ module Azure::SQL::Mgmt::V2014_04_01
145
146
  #
146
147
  # @return [DatabaseSecurityAlertPolicy] operation results.
147
148
  #
148
- def create_or_update(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
149
- response = create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
149
+ def create_or_update(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
150
+ response = create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers).value!
150
151
  response.body unless response.nil?
151
152
  end
152
153
 
@@ -166,8 +167,8 @@ module Azure::SQL::Mgmt::V2014_04_01
166
167
  #
167
168
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
168
169
  #
169
- def create_or_update_with_http_info(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
170
- create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
170
+ def create_or_update_with_http_info(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
171
+ create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers).value!
171
172
  end
172
173
 
173
174
  #
@@ -186,7 +187,7 @@ module Azure::SQL::Mgmt::V2014_04_01
186
187
  #
187
188
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
188
189
  #
189
- def create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
190
+ def create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
190
191
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
191
192
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
192
193
  fail ArgumentError, 'server_name is nil' if server_name.nil?
@@ -197,13 +198,12 @@ module Azure::SQL::Mgmt::V2014_04_01
197
198
 
198
199
 
199
200
  request_headers = {}
201
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
200
202
 
201
203
  # Set Headers
202
204
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
203
205
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
204
206
 
205
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
206
-
207
207
  # Serialize Request
208
208
  request_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::DatabaseSecurityAlertPolicy.mapper()
209
209
  request_content = @client.serialize(request_mapper, parameters)
@@ -37,8 +37,8 @@ module Azure::SQL::Mgmt::V2014_04_01
37
37
  #
38
38
  # @return [DatabaseUsageListResult] operation results.
39
39
  #
40
- def list_by_database(resource_group_name, server_name, database_name, custom_headers = nil)
41
- response = list_by_database_async(resource_group_name, server_name, database_name, custom_headers).value!
40
+ def list_by_database(resource_group_name, server_name, database_name, custom_headers:nil)
41
+ response = list_by_database_async(resource_group_name, server_name, database_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_database_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil)
59
- list_by_database_async(resource_group_name, server_name, database_name, custom_headers).value!
58
+ def list_by_database_with_http_info(resource_group_name, server_name, database_name, custom_headers:nil)
59
+ list_by_database_async(resource_group_name, server_name, database_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_database_async(resource_group_name, server_name, database_name, custom_headers = nil)
75
+ def list_by_database_async(resource_group_name, server_name, database_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,46 +25,84 @@ module Azure::SQL::Mgmt::V2014_04_01
25
25
  attr_reader :client
26
26
 
27
27
  #
28
- # Imports a bacpac into a new database.
28
+ # Pauses a data warehouse.
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 parameters [ImportRequest] The required parameters for importing a
35
- # Bacpac into a database.
34
+ # @param database_name [String] The name of the data warehouse to pause.
36
35
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
37
36
  # will be added to the HTTP request.
38
37
  #
39
- # @return [ImportExportResponse] operation results.
38
+ def pause(resource_group_name, server_name, database_name, custom_headers:nil)
39
+ response = pause_async(resource_group_name, server_name, database_name, custom_headers:custom_headers).value!
40
+ nil
41
+ end
42
+
40
43
  #
41
- def import(resource_group_name, server_name, parameters, custom_headers = nil)
42
- response = import_async(resource_group_name, server_name, parameters, custom_headers).value!
43
- response.body unless response.nil?
44
+ # @param resource_group_name [String] The name of the resource group that
45
+ # contains the resource. You can obtain this value from the Azure Resource
46
+ # Manager API or the portal.
47
+ # @param server_name [String] The name of the server.
48
+ # @param database_name [String] The name of the data warehouse to pause.
49
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
50
+ # will be added to the HTTP request.
51
+ #
52
+ # @return [Concurrent::Promise] promise which provides async access to http
53
+ # response.
54
+ #
55
+ def pause_async(resource_group_name, server_name, database_name, custom_headers:nil)
56
+ # Send request
57
+ promise = begin_pause_async(resource_group_name, server_name, database_name, custom_headers:custom_headers)
58
+
59
+ promise = promise.then do |response|
60
+ # Defining deserialization method.
61
+ deserialize_method = lambda do |parsed_response|
62
+ end
63
+
64
+ # Waiting for response.
65
+ @client.get_long_running_operation_result(response, deserialize_method)
66
+ end
67
+
68
+ promise
44
69
  end
45
70
 
71
+ #
72
+ # Resumes a data warehouse.
46
73
  #
47
74
  # @param resource_group_name [String] The name of the resource group that
48
75
  # contains the resource. You can obtain this value from the Azure Resource
49
76
  # Manager API or the portal.
50
77
  # @param server_name [String] The name of the server.
51
- # @param parameters [ImportRequest] The required parameters for importing a
52
- # Bacpac into a database.
78
+ # @param database_name [String] The name of the data warehouse to resume.
79
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
80
+ # will be added to the HTTP request.
81
+ #
82
+ def resume(resource_group_name, server_name, database_name, custom_headers:nil)
83
+ response = resume_async(resource_group_name, server_name, database_name, custom_headers:custom_headers).value!
84
+ nil
85
+ end
86
+
87
+ #
88
+ # @param resource_group_name [String] The name of the resource group that
89
+ # contains the resource. You can obtain this value from the Azure Resource
90
+ # Manager API or the portal.
91
+ # @param server_name [String] The name of the server.
92
+ # @param database_name [String] The name of the data warehouse to resume.
53
93
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
54
94
  # will be added to the HTTP request.
55
95
  #
56
96
  # @return [Concurrent::Promise] promise which provides async access to http
57
97
  # response.
58
98
  #
59
- def import_async(resource_group_name, server_name, parameters, custom_headers = nil)
99
+ def resume_async(resource_group_name, server_name, database_name, custom_headers:nil)
60
100
  # Send request
61
- promise = begin_import_async(resource_group_name, server_name, parameters, custom_headers)
101
+ promise = begin_resume_async(resource_group_name, server_name, database_name, custom_headers:custom_headers)
62
102
 
63
103
  promise = promise.then do |response|
64
104
  # Defining deserialization method.
65
105
  deserialize_method = lambda do |parsed_response|
66
- result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::ImportExportResponse.mapper()
67
- parsed_response = @client.deserialize(result_mapper, parsed_response)
68
106
  end
69
107
 
70
108
  # Waiting for response.
@@ -75,23 +113,23 @@ module Azure::SQL::Mgmt::V2014_04_01
75
113
  end
76
114
 
77
115
  #
78
- # Creates an import operation that imports a bacpac into an existing database.
79
- # The existing database must be empty.
116
+ # Creates a new database or updates an existing database.
80
117
  #
81
118
  # @param resource_group_name [String] The name of the resource group that
82
119
  # contains the resource. You can obtain this value from the Azure Resource
83
120
  # Manager API or the portal.
84
121
  # @param server_name [String] The name of the server.
85
- # @param database_name [String] The name of the database to import into
86
- # @param parameters [ImportExtensionRequest] The required parameters for
87
- # importing a Bacpac into a database.
122
+ # @param database_name [String] The name of the database to be operated on
123
+ # (updated or created).
124
+ # @param parameters [Database] The required parameters for creating or updating
125
+ # a database.
88
126
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
89
127
  # will be added to the HTTP request.
90
128
  #
91
- # @return [ImportExportResponse] operation results.
129
+ # @return [Database] operation results.
92
130
  #
93
- def create_import_operation(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
94
- response = create_import_operation_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
131
+ def create_or_update(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
132
+ response = create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers).value!
95
133
  response.body unless response.nil?
96
134
  end
97
135
 
@@ -100,23 +138,24 @@ module Azure::SQL::Mgmt::V2014_04_01
100
138
  # contains the resource. You can obtain this value from the Azure Resource
101
139
  # Manager API or the portal.
102
140
  # @param server_name [String] The name of the server.
103
- # @param database_name [String] The name of the database to import into
104
- # @param parameters [ImportExtensionRequest] The required parameters for
105
- # importing a Bacpac into a database.
141
+ # @param database_name [String] The name of the database to be operated on
142
+ # (updated or created).
143
+ # @param parameters [Database] The required parameters for creating or updating
144
+ # a database.
106
145
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
107
146
  # will be added to the HTTP request.
108
147
  #
109
148
  # @return [Concurrent::Promise] promise which provides async access to http
110
149
  # response.
111
150
  #
112
- def create_import_operation_async(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
151
+ def create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
113
152
  # Send request
114
- promise = begin_create_import_operation_async(resource_group_name, server_name, database_name, parameters, custom_headers)
153
+ promise = begin_create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers)
115
154
 
116
155
  promise = promise.then do |response|
117
156
  # Defining deserialization method.
118
157
  deserialize_method = lambda do |parsed_response|
119
- result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::ImportExportResponse.mapper()
158
+ result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::Database.mapper()
120
159
  parsed_response = @client.deserialize(result_mapper, parsed_response)
121
160
  end
122
161
 
@@ -128,22 +167,22 @@ module Azure::SQL::Mgmt::V2014_04_01
128
167
  end
129
168
 
130
169
  #
131
- # Exports a database to a bacpac.
170
+ # Updates an existing database.
132
171
  #
133
172
  # @param resource_group_name [String] The name of the resource group that
134
173
  # contains the resource. You can obtain this value from the Azure Resource
135
174
  # Manager API or the portal.
136
175
  # @param server_name [String] The name of the server.
137
- # @param database_name [String] The name of the database to be exported.
138
- # @param parameters [ExportRequest] The required parameters for exporting a
176
+ # @param database_name [String] The name of the database to be updated.
177
+ # @param parameters [DatabaseUpdate] The required parameters for updating a
139
178
  # database.
140
179
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
141
180
  # will be added to the HTTP request.
142
181
  #
143
- # @return [ImportExportResponse] operation results.
182
+ # @return [Database] operation results.
144
183
  #
145
- def export(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
146
- response = export_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
184
+ def update(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
185
+ response = update_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers).value!
147
186
  response.body unless response.nil?
148
187
  end
149
188
 
@@ -152,8 +191,8 @@ module Azure::SQL::Mgmt::V2014_04_01
152
191
  # contains the resource. You can obtain this value from the Azure Resource
153
192
  # Manager API or the portal.
154
193
  # @param server_name [String] The name of the server.
155
- # @param database_name [String] The name of the database to be exported.
156
- # @param parameters [ExportRequest] The required parameters for exporting a
194
+ # @param database_name [String] The name of the database to be updated.
195
+ # @param parameters [DatabaseUpdate] The required parameters for updating a
157
196
  # database.
158
197
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
159
198
  # will be added to the HTTP request.
@@ -161,14 +200,14 @@ module Azure::SQL::Mgmt::V2014_04_01
161
200
  # @return [Concurrent::Promise] promise which provides async access to http
162
201
  # response.
163
202
  #
164
- def export_async(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
203
+ def update_async(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
165
204
  # Send request
166
- promise = begin_export_async(resource_group_name, server_name, database_name, parameters, custom_headers)
205
+ promise = begin_update_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers)
167
206
 
168
207
  promise = promise.then do |response|
169
208
  # Defining deserialization method.
170
209
  deserialize_method = lambda do |parsed_response|
171
- result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::ImportExportResponse.mapper()
210
+ result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::Database.mapper()
172
211
  parsed_response = @client.deserialize(result_mapper, parsed_response)
173
212
  end
174
213
 
@@ -180,106 +219,89 @@ module Azure::SQL::Mgmt::V2014_04_01
180
219
  end
181
220
 
182
221
  #
183
- # Returns database metrics.
222
+ # Deletes a database.
184
223
  #
185
224
  # @param resource_group_name [String] The name of the resource group that
186
225
  # contains the resource. You can obtain this value from the Azure Resource
187
226
  # Manager API or the portal.
188
227
  # @param server_name [String] The name of the server.
189
- # @param database_name [String] The name of the database.
190
- # @param filter [String] An OData filter expression that describes a subset of
191
- # metrics to return.
228
+ # @param database_name [String] The name of the database to be deleted.
192
229
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
193
230
  # will be added to the HTTP request.
194
231
  #
195
- # @return [MetricListResult] operation results.
196
232
  #
197
- def list_metrics(resource_group_name, server_name, database_name, filter, custom_headers = nil)
198
- response = list_metrics_async(resource_group_name, server_name, database_name, filter, custom_headers).value!
199
- response.body unless response.nil?
233
+ def delete(resource_group_name, server_name, database_name, custom_headers:nil)
234
+ response = delete_async(resource_group_name, server_name, database_name, custom_headers:custom_headers).value!
235
+ nil
200
236
  end
201
237
 
202
238
  #
203
- # Returns database metrics.
239
+ # Deletes a database.
204
240
  #
205
241
  # @param resource_group_name [String] The name of the resource group that
206
242
  # contains the resource. You can obtain this value from the Azure Resource
207
243
  # Manager API or the portal.
208
244
  # @param server_name [String] The name of the server.
209
- # @param database_name [String] The name of the database.
210
- # @param filter [String] An OData filter expression that describes a subset of
211
- # metrics to return.
245
+ # @param database_name [String] The name of the database to be deleted.
212
246
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
213
247
  # will be added to the HTTP request.
214
248
  #
215
249
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
216
250
  #
217
- def list_metrics_with_http_info(resource_group_name, server_name, database_name, filter, custom_headers = nil)
218
- list_metrics_async(resource_group_name, server_name, database_name, filter, custom_headers).value!
251
+ def delete_with_http_info(resource_group_name, server_name, database_name, custom_headers:nil)
252
+ delete_async(resource_group_name, server_name, database_name, custom_headers:custom_headers).value!
219
253
  end
220
254
 
221
255
  #
222
- # Returns database metrics.
256
+ # Deletes a database.
223
257
  #
224
258
  # @param resource_group_name [String] The name of the resource group that
225
259
  # contains the resource. You can obtain this value from the Azure Resource
226
260
  # Manager API or the portal.
227
261
  # @param server_name [String] The name of the server.
228
- # @param database_name [String] The name of the database.
229
- # @param filter [String] An OData filter expression that describes a subset of
230
- # metrics to return.
262
+ # @param database_name [String] The name of the database to be deleted.
231
263
  # @param [Hash{String => String}] A hash of custom headers that will be added
232
264
  # to the HTTP request.
233
265
  #
234
266
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
235
267
  #
236
- def list_metrics_async(resource_group_name, server_name, database_name, filter, custom_headers = nil)
268
+ def delete_async(resource_group_name, server_name, database_name, custom_headers:nil)
237
269
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
238
270
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
239
271
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
240
272
  fail ArgumentError, 'server_name is nil' if server_name.nil?
241
273
  fail ArgumentError, 'database_name is nil' if database_name.nil?
242
- fail ArgumentError, 'filter is nil' if filter.nil?
243
274
 
244
275
 
245
276
  request_headers = {}
277
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
246
278
 
247
279
  # Set Headers
248
280
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
249
281
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
250
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metrics'
282
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'
251
283
 
252
284
  request_url = @base_url || @client.base_url
253
285
 
254
286
  options = {
255
287
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
256
288
  path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name},
257
- query_params: {'api-version' => @client.api_version,'$filter' => filter},
289
+ query_params: {'api-version' => @client.api_version},
258
290
  headers: request_headers.merge(custom_headers || {}),
259
291
  base_url: request_url
260
292
  }
261
- promise = @client.make_request_async(:get, path_template, options)
293
+ promise = @client.make_request_async(:delete, path_template, options)
262
294
 
263
295
  promise = promise.then do |result|
264
296
  http_response = result.response
265
297
  status_code = http_response.status
266
298
  response_content = http_response.body
267
- unless status_code == 200
299
+ unless status_code == 200 || status_code == 204
268
300
  error_model = JSON.load(response_content)
269
301
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
270
302
  end
271
303
 
272
304
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
273
- # Deserialize Response
274
- if status_code == 200
275
- begin
276
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
277
- result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::MetricListResult.mapper()
278
- result.body = @client.deserialize(result_mapper, parsed_response)
279
- rescue Exception => e
280
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
281
- end
282
- end
283
305
 
284
306
  result
285
307
  end
@@ -288,54 +310,63 @@ module Azure::SQL::Mgmt::V2014_04_01
288
310
  end
289
311
 
290
312
  #
291
- # Returns database metric definitions.
313
+ # Gets a database.
292
314
  #
293
315
  # @param resource_group_name [String] The name of the resource group that
294
316
  # contains the resource. You can obtain this value from the Azure Resource
295
317
  # Manager API or the portal.
296
318
  # @param server_name [String] The name of the server.
297
- # @param database_name [String] The name of the database.
319
+ # @param database_name [String] The name of the database to be retrieved.
320
+ # @param expand [String] A comma separated list of child objects to expand in
321
+ # the response. Possible properties: serviceTierAdvisors,
322
+ # transparentDataEncryption.
298
323
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
299
324
  # will be added to the HTTP request.
300
325
  #
301
- # @return [MetricDefinitionListResult] operation results.
326
+ # @return [Database] operation results.
302
327
  #
303
- def list_metric_definitions(resource_group_name, server_name, database_name, custom_headers = nil)
304
- response = list_metric_definitions_async(resource_group_name, server_name, database_name, custom_headers).value!
328
+ def get(resource_group_name, server_name, database_name, expand:nil, custom_headers:nil)
329
+ response = get_async(resource_group_name, server_name, database_name, expand:expand, custom_headers:custom_headers).value!
305
330
  response.body unless response.nil?
306
331
  end
307
332
 
308
333
  #
309
- # Returns database metric definitions.
334
+ # Gets a database.
310
335
  #
311
336
  # @param resource_group_name [String] The name of the resource group that
312
337
  # contains the resource. You can obtain this value from the Azure Resource
313
338
  # Manager API or the portal.
314
339
  # @param server_name [String] The name of the server.
315
- # @param database_name [String] The name of the database.
340
+ # @param database_name [String] The name of the database to be retrieved.
341
+ # @param expand [String] A comma separated list of child objects to expand in
342
+ # the response. Possible properties: serviceTierAdvisors,
343
+ # transparentDataEncryption.
316
344
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
317
345
  # will be added to the HTTP request.
318
346
  #
319
347
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
320
348
  #
321
- def list_metric_definitions_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil)
322
- list_metric_definitions_async(resource_group_name, server_name, database_name, custom_headers).value!
349
+ def get_with_http_info(resource_group_name, server_name, database_name, expand:nil, custom_headers:nil)
350
+ get_async(resource_group_name, server_name, database_name, expand:expand, custom_headers:custom_headers).value!
323
351
  end
324
352
 
325
353
  #
326
- # Returns database metric definitions.
354
+ # Gets a database.
327
355
  #
328
356
  # @param resource_group_name [String] The name of the resource group that
329
357
  # contains the resource. You can obtain this value from the Azure Resource
330
358
  # Manager API or the portal.
331
359
  # @param server_name [String] The name of the server.
332
- # @param database_name [String] The name of the database.
360
+ # @param database_name [String] The name of the database to be retrieved.
361
+ # @param expand [String] A comma separated list of child objects to expand in
362
+ # the response. Possible properties: serviceTierAdvisors,
363
+ # transparentDataEncryption.
333
364
  # @param [Hash{String => String}] A hash of custom headers that will be added
334
365
  # to the HTTP request.
335
366
  #
336
367
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
337
368
  #
338
- def list_metric_definitions_async(resource_group_name, server_name, database_name, custom_headers = nil)
369
+ def get_async(resource_group_name, server_name, database_name, expand:nil, custom_headers:nil)
339
370
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
340
371
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
341
372
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
@@ -344,18 +375,19 @@ module Azure::SQL::Mgmt::V2014_04_01
344
375
 
345
376
 
346
377
  request_headers = {}
378
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
347
379
 
348
380
  # Set Headers
349
381
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
350
382
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
351
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metricDefinitions'
383
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'
352
384
 
353
385
  request_url = @base_url || @client.base_url
354
386
 
355
387
  options = {
356
388
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
357
389
  path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name},
358
- query_params: {'api-version' => @client.api_version},
390
+ query_params: {'api-version' => @client.api_version,'$expand' => expand},
359
391
  headers: request_headers.merge(custom_headers || {}),
360
392
  base_url: request_url
361
393
  }
@@ -375,7 +407,7 @@ module Azure::SQL::Mgmt::V2014_04_01
375
407
  if status_code == 200
376
408
  begin
377
409
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
378
- result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::MetricDefinitionListResult.mapper()
410
+ result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::Database.mapper()
379
411
  result.body = @client.deserialize(result_mapper, parsed_response)
380
412
  rescue Exception => e
381
413
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -389,282 +421,220 @@ module Azure::SQL::Mgmt::V2014_04_01
389
421
  end
390
422
 
391
423
  #
392
- # Pauses a data warehouse.
393
- #
394
- # @param resource_group_name [String] The name of the resource group that
395
- # contains the resource. You can obtain this value from the Azure Resource
396
- # Manager API or the portal.
397
- # @param server_name [String] The name of the server.
398
- # @param database_name [String] The name of the data warehouse to pause.
399
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
400
- # will be added to the HTTP request.
401
- #
402
- def pause(resource_group_name, server_name, database_name, custom_headers = nil)
403
- response = pause_async(resource_group_name, server_name, database_name, custom_headers).value!
404
- nil
405
- end
406
-
407
- #
408
- # @param resource_group_name [String] The name of the resource group that
409
- # contains the resource. You can obtain this value from the Azure Resource
410
- # Manager API or the portal.
411
- # @param server_name [String] The name of the server.
412
- # @param database_name [String] The name of the data warehouse to pause.
413
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
414
- # will be added to the HTTP request.
415
- #
416
- # @return [Concurrent::Promise] promise which provides async access to http
417
- # response.
418
- #
419
- def pause_async(resource_group_name, server_name, database_name, custom_headers = nil)
420
- # Send request
421
- promise = begin_pause_async(resource_group_name, server_name, database_name, custom_headers)
422
-
423
- promise = promise.then do |response|
424
- # Defining deserialization method.
425
- deserialize_method = lambda do |parsed_response|
426
- end
427
-
428
- # Waiting for response.
429
- @client.get_long_running_operation_result(response, deserialize_method)
430
- end
431
-
432
- promise
433
- end
434
-
435
- #
436
- # Resumes a data warehouse.
437
- #
438
- # @param resource_group_name [String] The name of the resource group that
439
- # contains the resource. You can obtain this value from the Azure Resource
440
- # Manager API or the portal.
441
- # @param server_name [String] The name of the server.
442
- # @param database_name [String] The name of the data warehouse to resume.
443
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
444
- # will be added to the HTTP request.
445
- #
446
- def resume(resource_group_name, server_name, database_name, custom_headers = nil)
447
- response = resume_async(resource_group_name, server_name, database_name, custom_headers).value!
448
- nil
449
- end
450
-
451
- #
452
- # @param resource_group_name [String] The name of the resource group that
453
- # contains the resource. You can obtain this value from the Azure Resource
454
- # Manager API or the portal.
455
- # @param server_name [String] The name of the server.
456
- # @param database_name [String] The name of the data warehouse to resume.
457
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
458
- # will be added to the HTTP request.
459
- #
460
- # @return [Concurrent::Promise] promise which provides async access to http
461
- # response.
462
- #
463
- def resume_async(resource_group_name, server_name, database_name, custom_headers = nil)
464
- # Send request
465
- promise = begin_resume_async(resource_group_name, server_name, database_name, custom_headers)
466
-
467
- promise = promise.then do |response|
468
- # Defining deserialization method.
469
- deserialize_method = lambda do |parsed_response|
470
- end
471
-
472
- # Waiting for response.
473
- @client.get_long_running_operation_result(response, deserialize_method)
474
- end
475
-
476
- promise
477
- end
478
-
479
- #
480
- # Creates a new database or updates an existing database.
424
+ # Returns a list of databases in a server.
481
425
  #
482
426
  # @param resource_group_name [String] The name of the resource group that
483
427
  # contains the resource. You can obtain this value from the Azure Resource
484
428
  # Manager API or the portal.
485
429
  # @param server_name [String] The name of the server.
486
- # @param database_name [String] The name of the database to be operated on
487
- # (updated or created).
488
- # @param parameters [Database] The required parameters for creating or updating
489
- # a database.
430
+ # @param expand [String] A comma separated list of child objects to expand in
431
+ # the response. Possible properties: serviceTierAdvisors,
432
+ # transparentDataEncryption.
433
+ # @param filter [String] An OData filter expression that describes a subset of
434
+ # databases to return.
490
435
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
491
436
  # will be added to the HTTP request.
492
437
  #
493
- # @return [Database] operation results.
438
+ # @return [DatabaseListResult] operation results.
494
439
  #
495
- def create_or_update(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
496
- response = create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
440
+ def list_by_server(resource_group_name, server_name, expand:nil, filter:nil, custom_headers:nil)
441
+ response = list_by_server_async(resource_group_name, server_name, expand:expand, filter:filter, custom_headers:custom_headers).value!
497
442
  response.body unless response.nil?
498
443
  end
499
444
 
500
445
  #
501
- # @param resource_group_name [String] The name of the resource group that
502
- # contains the resource. You can obtain this value from the Azure Resource
503
- # Manager API or the portal.
504
- # @param server_name [String] The name of the server.
505
- # @param database_name [String] The name of the database to be operated on
506
- # (updated or created).
507
- # @param parameters [Database] The required parameters for creating or updating
508
- # a database.
509
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
510
- # will be added to the HTTP request.
511
- #
512
- # @return [Concurrent::Promise] promise which provides async access to http
513
- # response.
514
- #
515
- def create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
516
- # Send request
517
- promise = begin_create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers)
518
-
519
- promise = promise.then do |response|
520
- # Defining deserialization method.
521
- deserialize_method = lambda do |parsed_response|
522
- result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::Database.mapper()
523
- parsed_response = @client.deserialize(result_mapper, parsed_response)
524
- end
525
-
526
- # Waiting for response.
527
- @client.get_long_running_operation_result(response, deserialize_method)
528
- end
529
-
530
- promise
531
- end
532
-
533
- #
534
- # Updates an existing database.
446
+ # Returns a list of databases in a server.
535
447
  #
536
448
  # @param resource_group_name [String] The name of the resource group that
537
449
  # contains the resource. You can obtain this value from the Azure Resource
538
450
  # Manager API or the portal.
539
451
  # @param server_name [String] The name of the server.
540
- # @param database_name [String] The name of the database to be updated.
541
- # @param parameters [DatabaseUpdate] The required parameters for updating a
542
- # database.
452
+ # @param expand [String] A comma separated list of child objects to expand in
453
+ # the response. Possible properties: serviceTierAdvisors,
454
+ # transparentDataEncryption.
455
+ # @param filter [String] An OData filter expression that describes a subset of
456
+ # databases to return.
543
457
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
544
458
  # will be added to the HTTP request.
545
459
  #
546
- # @return [Database] operation results.
460
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
547
461
  #
548
- def update(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
549
- response = update_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
550
- response.body unless response.nil?
462
+ def list_by_server_with_http_info(resource_group_name, server_name, expand:nil, filter:nil, custom_headers:nil)
463
+ list_by_server_async(resource_group_name, server_name, expand:expand, filter:filter, custom_headers:custom_headers).value!
551
464
  end
552
465
 
466
+ #
467
+ # Returns a list of databases in a server.
553
468
  #
554
469
  # @param resource_group_name [String] The name of the resource group that
555
470
  # contains the resource. You can obtain this value from the Azure Resource
556
471
  # Manager API or the portal.
557
472
  # @param server_name [String] The name of the server.
558
- # @param database_name [String] The name of the database to be updated.
559
- # @param parameters [DatabaseUpdate] The required parameters for updating a
560
- # database.
561
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
562
- # will be added to the HTTP request.
473
+ # @param expand [String] A comma separated list of child objects to expand in
474
+ # the response. Possible properties: serviceTierAdvisors,
475
+ # transparentDataEncryption.
476
+ # @param filter [String] An OData filter expression that describes a subset of
477
+ # databases to return.
478
+ # @param [Hash{String => String}] A hash of custom headers that will be added
479
+ # to the HTTP request.
563
480
  #
564
- # @return [Concurrent::Promise] promise which provides async access to http
565
- # response.
481
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
566
482
  #
567
- def update_async(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
568
- # Send request
569
- promise = begin_update_async(resource_group_name, server_name, database_name, parameters, custom_headers)
483
+ def list_by_server_async(resource_group_name, server_name, expand:nil, filter:nil, custom_headers:nil)
484
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
485
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
486
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
487
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
570
488
 
571
- promise = promise.then do |response|
572
- # Defining deserialization method.
573
- deserialize_method = lambda do |parsed_response|
574
- result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::Database.mapper()
575
- parsed_response = @client.deserialize(result_mapper, parsed_response)
489
+
490
+ request_headers = {}
491
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
492
+
493
+ # Set Headers
494
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
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}/databases'
497
+
498
+ request_url = @base_url || @client.base_url
499
+
500
+ options = {
501
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
502
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name},
503
+ query_params: {'api-version' => @client.api_version,'$expand' => expand,'$filter' => filter},
504
+ headers: request_headers.merge(custom_headers || {}),
505
+ base_url: request_url
506
+ }
507
+ promise = @client.make_request_async(:get, path_template, options)
508
+
509
+ promise = promise.then do |result|
510
+ http_response = result.response
511
+ status_code = http_response.status
512
+ response_content = http_response.body
513
+ unless status_code == 200
514
+ error_model = JSON.load(response_content)
515
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
576
516
  end
577
517
 
578
- # Waiting for response.
579
- @client.get_long_running_operation_result(response, deserialize_method)
518
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
519
+ # Deserialize Response
520
+ if status_code == 200
521
+ begin
522
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
523
+ result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::DatabaseListResult.mapper()
524
+ result.body = @client.deserialize(result_mapper, parsed_response)
525
+ rescue Exception => e
526
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
527
+ end
528
+ end
529
+
530
+ result
580
531
  end
581
532
 
582
- promise
533
+ promise.execute
583
534
  end
584
535
 
585
536
  #
586
- # Deletes a database.
537
+ # Gets a database inside of an elastic pool.
587
538
  #
588
539
  # @param resource_group_name [String] The name of the resource group that
589
540
  # contains the resource. You can obtain this value from the Azure Resource
590
541
  # Manager API or the portal.
591
542
  # @param server_name [String] The name of the server.
592
- # @param database_name [String] The name of the database to be deleted.
543
+ # @param elastic_pool_name [String] The name of the elastic pool to be
544
+ # retrieved.
545
+ # @param database_name [String] The name of the database to be retrieved.
593
546
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
594
547
  # will be added to the HTTP request.
595
548
  #
549
+ # @return [Database] operation results.
596
550
  #
597
- def delete(resource_group_name, server_name, database_name, custom_headers = nil)
598
- response = delete_async(resource_group_name, server_name, database_name, custom_headers).value!
599
- nil
551
+ def get_by_elastic_pool(resource_group_name, server_name, elastic_pool_name, database_name, custom_headers:nil)
552
+ response = get_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, database_name, custom_headers:custom_headers).value!
553
+ response.body unless response.nil?
600
554
  end
601
555
 
602
556
  #
603
- # Deletes a database.
557
+ # Gets a database inside of an elastic pool.
604
558
  #
605
559
  # @param resource_group_name [String] The name of the resource group that
606
560
  # contains the resource. You can obtain this value from the Azure Resource
607
561
  # Manager API or the portal.
608
562
  # @param server_name [String] The name of the server.
609
- # @param database_name [String] The name of the database to be deleted.
563
+ # @param elastic_pool_name [String] The name of the elastic pool to be
564
+ # retrieved.
565
+ # @param database_name [String] The name of the database to be retrieved.
610
566
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
611
567
  # will be added to the HTTP request.
612
568
  #
613
569
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
614
570
  #
615
- def delete_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil)
616
- delete_async(resource_group_name, server_name, database_name, custom_headers).value!
571
+ def get_by_elastic_pool_with_http_info(resource_group_name, server_name, elastic_pool_name, database_name, custom_headers:nil)
572
+ get_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, database_name, custom_headers:custom_headers).value!
617
573
  end
618
574
 
619
575
  #
620
- # Deletes a database.
576
+ # Gets a database inside of an elastic pool.
621
577
  #
622
578
  # @param resource_group_name [String] The name of the resource group that
623
579
  # contains the resource. You can obtain this value from the Azure Resource
624
580
  # Manager API or the portal.
625
581
  # @param server_name [String] The name of the server.
626
- # @param database_name [String] The name of the database to be deleted.
582
+ # @param elastic_pool_name [String] The name of the elastic pool to be
583
+ # retrieved.
584
+ # @param database_name [String] The name of the database to be retrieved.
627
585
  # @param [Hash{String => String}] A hash of custom headers that will be added
628
586
  # to the HTTP request.
629
587
  #
630
588
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
631
589
  #
632
- def delete_async(resource_group_name, server_name, database_name, custom_headers = nil)
590
+ def get_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, database_name, custom_headers:nil)
633
591
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
634
592
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
635
593
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
636
594
  fail ArgumentError, 'server_name is nil' if server_name.nil?
595
+ fail ArgumentError, 'elastic_pool_name is nil' if elastic_pool_name.nil?
637
596
  fail ArgumentError, 'database_name is nil' if database_name.nil?
638
597
 
639
598
 
640
599
  request_headers = {}
600
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
641
601
 
642
602
  # Set Headers
643
603
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
644
604
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
645
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'
605
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases/{databaseName}'
646
606
 
647
607
  request_url = @base_url || @client.base_url
648
608
 
649
609
  options = {
650
610
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
651
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name},
611
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'elasticPoolName' => elastic_pool_name,'databaseName' => database_name},
652
612
  query_params: {'api-version' => @client.api_version},
653
613
  headers: request_headers.merge(custom_headers || {}),
654
614
  base_url: request_url
655
615
  }
656
- promise = @client.make_request_async(:delete, path_template, options)
616
+ promise = @client.make_request_async(:get, path_template, options)
657
617
 
658
618
  promise = promise.then do |result|
659
619
  http_response = result.response
660
620
  status_code = http_response.status
661
621
  response_content = http_response.body
662
- unless status_code == 200 || status_code == 204
622
+ unless status_code == 200
663
623
  error_model = JSON.load(response_content)
664
624
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
665
625
  end
666
626
 
667
627
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
628
+ # Deserialize Response
629
+ if status_code == 200
630
+ begin
631
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
632
+ result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::Database.mapper()
633
+ result.body = @client.deserialize(result_mapper, parsed_response)
634
+ rescue Exception => e
635
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
636
+ end
637
+ end
668
638
 
669
639
  result
670
640
  end
@@ -673,83 +643,78 @@ module Azure::SQL::Mgmt::V2014_04_01
673
643
  end
674
644
 
675
645
  #
676
- # Gets a database.
646
+ # Returns a list of databases in an elastic pool.
677
647
  #
678
648
  # @param resource_group_name [String] The name of the resource group that
679
649
  # contains the resource. You can obtain this value from the Azure Resource
680
650
  # Manager API or the portal.
681
651
  # @param server_name [String] The name of the server.
682
- # @param database_name [String] The name of the database to be retrieved.
683
- # @param expand [String] A comma separated list of child objects to expand in
684
- # the response. Possible properties: serviceTierAdvisors,
685
- # transparentDataEncryption.
652
+ # @param elastic_pool_name [String] The name of the elastic pool to be
653
+ # retrieved.
686
654
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
687
655
  # will be added to the HTTP request.
688
656
  #
689
- # @return [Database] operation results.
657
+ # @return [DatabaseListResult] operation results.
690
658
  #
691
- def get(resource_group_name, server_name, database_name, expand = nil, custom_headers = nil)
692
- response = get_async(resource_group_name, server_name, database_name, expand, custom_headers).value!
659
+ def list_by_elastic_pool(resource_group_name, server_name, elastic_pool_name, custom_headers:nil)
660
+ response = list_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, custom_headers:custom_headers).value!
693
661
  response.body unless response.nil?
694
662
  end
695
663
 
696
664
  #
697
- # Gets a database.
665
+ # Returns a list of databases in an elastic pool.
698
666
  #
699
667
  # @param resource_group_name [String] The name of the resource group that
700
668
  # contains the resource. You can obtain this value from the Azure Resource
701
669
  # Manager API or the portal.
702
670
  # @param server_name [String] The name of the server.
703
- # @param database_name [String] The name of the database to be retrieved.
704
- # @param expand [String] A comma separated list of child objects to expand in
705
- # the response. Possible properties: serviceTierAdvisors,
706
- # transparentDataEncryption.
671
+ # @param elastic_pool_name [String] The name of the elastic pool to be
672
+ # retrieved.
707
673
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
708
674
  # will be added to the HTTP request.
709
675
  #
710
676
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
711
677
  #
712
- def get_with_http_info(resource_group_name, server_name, database_name, expand = nil, custom_headers = nil)
713
- get_async(resource_group_name, server_name, database_name, expand, custom_headers).value!
678
+ def list_by_elastic_pool_with_http_info(resource_group_name, server_name, elastic_pool_name, custom_headers:nil)
679
+ list_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, custom_headers:custom_headers).value!
714
680
  end
715
681
 
716
682
  #
717
- # Gets a database.
683
+ # Returns a list of databases in an elastic pool.
718
684
  #
719
685
  # @param resource_group_name [String] The name of the resource group that
720
686
  # contains the resource. You can obtain this value from the Azure Resource
721
687
  # Manager API or the portal.
722
688
  # @param server_name [String] The name of the server.
723
- # @param database_name [String] The name of the database to be retrieved.
724
- # @param expand [String] A comma separated list of child objects to expand in
725
- # the response. Possible properties: serviceTierAdvisors,
726
- # transparentDataEncryption.
689
+ # @param elastic_pool_name [String] The name of the elastic pool to be
690
+ # retrieved.
727
691
  # @param [Hash{String => String}] A hash of custom headers that will be added
728
692
  # to the HTTP request.
729
693
  #
730
694
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
731
695
  #
732
- def get_async(resource_group_name, server_name, database_name, expand = nil, custom_headers = nil)
696
+ def list_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, custom_headers:nil)
733
697
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
734
698
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
735
699
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
736
700
  fail ArgumentError, 'server_name is nil' if server_name.nil?
737
- fail ArgumentError, 'database_name is nil' if database_name.nil?
701
+ fail ArgumentError, 'elastic_pool_name is nil' if elastic_pool_name.nil?
738
702
 
739
703
 
740
704
  request_headers = {}
705
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
741
706
 
742
707
  # Set Headers
743
708
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
744
709
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
745
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'
710
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases'
746
711
 
747
712
  request_url = @base_url || @client.base_url
748
713
 
749
714
  options = {
750
715
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
751
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name},
752
- query_params: {'api-version' => @client.api_version,'$expand' => expand},
716
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'elasticPoolName' => elastic_pool_name},
717
+ query_params: {'api-version' => @client.api_version},
753
718
  headers: request_headers.merge(custom_headers || {}),
754
719
  base_url: request_url
755
720
  }
@@ -769,7 +734,7 @@ module Azure::SQL::Mgmt::V2014_04_01
769
734
  if status_code == 200
770
735
  begin
771
736
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
772
- result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::Database.mapper()
737
+ result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::DatabaseListResult.mapper()
773
738
  result.body = @client.deserialize(result_mapper, parsed_response)
774
739
  rescue Exception => e
775
740
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -783,85 +748,82 @@ module Azure::SQL::Mgmt::V2014_04_01
783
748
  end
784
749
 
785
750
  #
786
- # Returns a list of databases in a server.
751
+ # Gets a database inside of a recommented elastic pool.
787
752
  #
788
753
  # @param resource_group_name [String] The name of the resource group that
789
754
  # contains the resource. You can obtain this value from the Azure Resource
790
755
  # Manager API or the portal.
791
756
  # @param server_name [String] The name of the server.
792
- # @param expand [String] A comma separated list of child objects to expand in
793
- # the response. Possible properties: serviceTierAdvisors,
794
- # transparentDataEncryption.
795
- # @param filter [String] An OData filter expression that describes a subset of
796
- # databases to return.
757
+ # @param recommended_elastic_pool_name [String] The name of the elastic pool to
758
+ # be retrieved.
759
+ # @param database_name [String] The name of the database to be retrieved.
797
760
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
798
761
  # will be added to the HTTP request.
799
762
  #
800
- # @return [DatabaseListResult] operation results.
763
+ # @return [Database] operation results.
801
764
  #
802
- def list_by_server(resource_group_name, server_name, expand = nil, filter = nil, custom_headers = nil)
803
- response = list_by_server_async(resource_group_name, server_name, expand, filter, custom_headers).value!
765
+ def get_by_recommended_elastic_pool(resource_group_name, server_name, recommended_elastic_pool_name, database_name, custom_headers:nil)
766
+ response = get_by_recommended_elastic_pool_async(resource_group_name, server_name, recommended_elastic_pool_name, database_name, custom_headers:custom_headers).value!
804
767
  response.body unless response.nil?
805
768
  end
806
769
 
807
770
  #
808
- # Returns a list of databases in a server.
771
+ # Gets a database inside of a recommented elastic pool.
809
772
  #
810
773
  # @param resource_group_name [String] The name of the resource group that
811
774
  # contains the resource. You can obtain this value from the Azure Resource
812
775
  # Manager API or the portal.
813
776
  # @param server_name [String] The name of the server.
814
- # @param expand [String] A comma separated list of child objects to expand in
815
- # the response. Possible properties: serviceTierAdvisors,
816
- # transparentDataEncryption.
817
- # @param filter [String] An OData filter expression that describes a subset of
818
- # databases to return.
777
+ # @param recommended_elastic_pool_name [String] The name of the elastic pool to
778
+ # be retrieved.
779
+ # @param database_name [String] The name of the database to be retrieved.
819
780
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
820
781
  # will be added to the HTTP request.
821
782
  #
822
783
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
823
784
  #
824
- def list_by_server_with_http_info(resource_group_name, server_name, expand = nil, filter = nil, custom_headers = nil)
825
- list_by_server_async(resource_group_name, server_name, expand, filter, custom_headers).value!
785
+ def get_by_recommended_elastic_pool_with_http_info(resource_group_name, server_name, recommended_elastic_pool_name, database_name, custom_headers:nil)
786
+ get_by_recommended_elastic_pool_async(resource_group_name, server_name, recommended_elastic_pool_name, database_name, custom_headers:custom_headers).value!
826
787
  end
827
788
 
828
789
  #
829
- # Returns a list of databases in a server.
790
+ # Gets a database inside of a recommented elastic pool.
830
791
  #
831
792
  # @param resource_group_name [String] The name of the resource group that
832
793
  # contains the resource. You can obtain this value from the Azure Resource
833
794
  # Manager API or the portal.
834
795
  # @param server_name [String] The name of the server.
835
- # @param expand [String] A comma separated list of child objects to expand in
836
- # the response. Possible properties: serviceTierAdvisors,
837
- # transparentDataEncryption.
838
- # @param filter [String] An OData filter expression that describes a subset of
839
- # databases to return.
796
+ # @param recommended_elastic_pool_name [String] The name of the elastic pool to
797
+ # be retrieved.
798
+ # @param database_name [String] The name of the database to be retrieved.
840
799
  # @param [Hash{String => String}] A hash of custom headers that will be added
841
800
  # to the HTTP request.
842
801
  #
843
802
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
844
803
  #
845
- def list_by_server_async(resource_group_name, server_name, expand = nil, filter = nil, custom_headers = nil)
804
+ def get_by_recommended_elastic_pool_async(resource_group_name, server_name, recommended_elastic_pool_name, database_name, custom_headers:nil)
846
805
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
847
806
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
848
807
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
849
808
  fail ArgumentError, 'server_name is nil' if server_name.nil?
809
+ fail ArgumentError, 'recommended_elastic_pool_name is nil' if recommended_elastic_pool_name.nil?
810
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
850
811
 
851
812
 
852
813
  request_headers = {}
814
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
853
815
 
854
816
  # Set Headers
855
817
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
856
818
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
857
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases'
819
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}/databases/{databaseName}'
858
820
 
859
821
  request_url = @base_url || @client.base_url
860
822
 
861
823
  options = {
862
824
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
863
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name},
864
- query_params: {'api-version' => @client.api_version,'$expand' => expand,'$filter' => filter},
825
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'recommendedElasticPoolName' => recommended_elastic_pool_name,'databaseName' => database_name},
826
+ query_params: {'api-version' => @client.api_version},
865
827
  headers: request_headers.merge(custom_headers || {}),
866
828
  base_url: request_url
867
829
  }
@@ -881,7 +843,7 @@ module Azure::SQL::Mgmt::V2014_04_01
881
843
  if status_code == 200
882
844
  begin
883
845
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
884
- result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::DatabaseListResult.mapper()
846
+ result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::Database.mapper()
885
847
  result.body = @client.deserialize(result_mapper, parsed_response)
886
848
  rescue Exception => e
887
849
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -895,80 +857,77 @@ module Azure::SQL::Mgmt::V2014_04_01
895
857
  end
896
858
 
897
859
  #
898
- # Gets a database inside of an elastic pool.
860
+ # Returns a list of databases inside a recommented elastic pool.
899
861
  #
900
862
  # @param resource_group_name [String] The name of the resource group that
901
863
  # contains the resource. You can obtain this value from the Azure Resource
902
864
  # Manager API or the portal.
903
865
  # @param server_name [String] The name of the server.
904
- # @param elastic_pool_name [String] The name of the elastic pool to be
905
- # retrieved.
906
- # @param database_name [String] The name of the database to be retrieved.
866
+ # @param recommended_elastic_pool_name [String] The name of the recommended
867
+ # elastic pool to be retrieved.
907
868
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
908
869
  # will be added to the HTTP request.
909
870
  #
910
- # @return [Database] operation results.
871
+ # @return [DatabaseListResult] operation results.
911
872
  #
912
- def get_by_elastic_pool(resource_group_name, server_name, elastic_pool_name, database_name, custom_headers = nil)
913
- response = get_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, database_name, custom_headers).value!
873
+ def list_by_recommended_elastic_pool(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers:nil)
874
+ response = list_by_recommended_elastic_pool_async(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers:custom_headers).value!
914
875
  response.body unless response.nil?
915
876
  end
916
877
 
917
878
  #
918
- # Gets a database inside of an elastic pool.
879
+ # Returns a list of databases inside a recommented elastic pool.
919
880
  #
920
881
  # @param resource_group_name [String] The name of the resource group that
921
882
  # contains the resource. You can obtain this value from the Azure Resource
922
883
  # Manager API or the portal.
923
884
  # @param server_name [String] The name of the server.
924
- # @param elastic_pool_name [String] The name of the elastic pool to be
925
- # retrieved.
926
- # @param database_name [String] The name of the database to be retrieved.
885
+ # @param recommended_elastic_pool_name [String] The name of the recommended
886
+ # elastic pool to be retrieved.
927
887
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
928
888
  # will be added to the HTTP request.
929
889
  #
930
890
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
931
891
  #
932
- def get_by_elastic_pool_with_http_info(resource_group_name, server_name, elastic_pool_name, database_name, custom_headers = nil)
933
- get_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, database_name, custom_headers).value!
892
+ def list_by_recommended_elastic_pool_with_http_info(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers:nil)
893
+ list_by_recommended_elastic_pool_async(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers:custom_headers).value!
934
894
  end
935
895
 
936
896
  #
937
- # Gets a database inside of an elastic pool.
897
+ # Returns a list of databases inside a recommented elastic pool.
938
898
  #
939
899
  # @param resource_group_name [String] The name of the resource group that
940
900
  # contains the resource. You can obtain this value from the Azure Resource
941
901
  # Manager API or the portal.
942
902
  # @param server_name [String] The name of the server.
943
- # @param elastic_pool_name [String] The name of the elastic pool to be
944
- # retrieved.
945
- # @param database_name [String] The name of the database to be retrieved.
903
+ # @param recommended_elastic_pool_name [String] The name of the recommended
904
+ # elastic pool to be retrieved.
946
905
  # @param [Hash{String => String}] A hash of custom headers that will be added
947
906
  # to the HTTP request.
948
907
  #
949
908
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
950
909
  #
951
- def get_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, database_name, custom_headers = nil)
910
+ def list_by_recommended_elastic_pool_async(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers:nil)
952
911
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
953
912
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
954
913
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
955
914
  fail ArgumentError, 'server_name is nil' if server_name.nil?
956
- fail ArgumentError, 'elastic_pool_name is nil' if elastic_pool_name.nil?
957
- fail ArgumentError, 'database_name is nil' if database_name.nil?
915
+ fail ArgumentError, 'recommended_elastic_pool_name is nil' if recommended_elastic_pool_name.nil?
958
916
 
959
917
 
960
918
  request_headers = {}
919
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
961
920
 
962
921
  # Set Headers
963
922
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
964
923
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
965
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases/{databaseName}'
924
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}/databases'
966
925
 
967
926
  request_url = @base_url || @client.base_url
968
927
 
969
928
  options = {
970
929
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
971
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'elasticPoolName' => elastic_pool_name,'databaseName' => database_name},
930
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'recommendedElasticPoolName' => recommended_elastic_pool_name},
972
931
  query_params: {'api-version' => @client.api_version},
973
932
  headers: request_headers.merge(custom_headers || {}),
974
933
  base_url: request_url
@@ -989,199 +948,251 @@ module Azure::SQL::Mgmt::V2014_04_01
989
948
  if status_code == 200
990
949
  begin
991
950
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
992
- result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::Database.mapper()
951
+ result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::DatabaseListResult.mapper()
993
952
  result.body = @client.deserialize(result_mapper, parsed_response)
994
953
  rescue Exception => e
995
954
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
996
955
  end
997
956
  end
998
957
 
999
- result
958
+ result
959
+ end
960
+
961
+ promise.execute
962
+ end
963
+
964
+ #
965
+ # Imports a bacpac into a new database.
966
+ #
967
+ # @param resource_group_name [String] The name of the resource group that
968
+ # contains the resource. You can obtain this value from the Azure Resource
969
+ # Manager API or the portal.
970
+ # @param server_name [String] The name of the server.
971
+ # @param parameters [ImportRequest] The required parameters for importing a
972
+ # Bacpac into a database.
973
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
974
+ # will be added to the HTTP request.
975
+ #
976
+ # @return [ImportExportResponse] operation results.
977
+ #
978
+ def import(resource_group_name, server_name, parameters, custom_headers:nil)
979
+ response = import_async(resource_group_name, server_name, parameters, custom_headers:custom_headers).value!
980
+ response.body unless response.nil?
981
+ end
982
+
983
+ #
984
+ # @param resource_group_name [String] The name of the resource group that
985
+ # contains the resource. You can obtain this value from the Azure Resource
986
+ # Manager API or the portal.
987
+ # @param server_name [String] The name of the server.
988
+ # @param parameters [ImportRequest] The required parameters for importing a
989
+ # Bacpac into a database.
990
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
991
+ # will be added to the HTTP request.
992
+ #
993
+ # @return [Concurrent::Promise] promise which provides async access to http
994
+ # response.
995
+ #
996
+ def import_async(resource_group_name, server_name, parameters, custom_headers:nil)
997
+ # Send request
998
+ promise = begin_import_async(resource_group_name, server_name, parameters, custom_headers:custom_headers)
999
+
1000
+ promise = promise.then do |response|
1001
+ # Defining deserialization method.
1002
+ deserialize_method = lambda do |parsed_response|
1003
+ result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::ImportExportResponse.mapper()
1004
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
1005
+ end
1006
+
1007
+ # Waiting for response.
1008
+ @client.get_long_running_operation_result(response, deserialize_method)
1000
1009
  end
1001
1010
 
1002
- promise.execute
1011
+ promise
1003
1012
  end
1004
1013
 
1005
1014
  #
1006
- # Returns a list of databases in an elastic pool.
1015
+ # Creates an import operation that imports a bacpac into an existing database.
1016
+ # The existing database must be empty.
1007
1017
  #
1008
1018
  # @param resource_group_name [String] The name of the resource group that
1009
1019
  # contains the resource. You can obtain this value from the Azure Resource
1010
1020
  # Manager API or the portal.
1011
1021
  # @param server_name [String] The name of the server.
1012
- # @param elastic_pool_name [String] The name of the elastic pool to be
1013
- # retrieved.
1022
+ # @param database_name [String] The name of the database to import into
1023
+ # @param parameters [ImportExtensionRequest] The required parameters for
1024
+ # importing a Bacpac into a database.
1014
1025
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1015
1026
  # will be added to the HTTP request.
1016
1027
  #
1017
- # @return [DatabaseListResult] operation results.
1028
+ # @return [ImportExportResponse] operation results.
1018
1029
  #
1019
- def list_by_elastic_pool(resource_group_name, server_name, elastic_pool_name, custom_headers = nil)
1020
- response = list_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, custom_headers).value!
1030
+ def create_import_operation(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
1031
+ response = create_import_operation_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers).value!
1021
1032
  response.body unless response.nil?
1022
1033
  end
1023
1034
 
1024
- #
1025
- # Returns a list of databases in an elastic pool.
1026
1035
  #
1027
1036
  # @param resource_group_name [String] The name of the resource group that
1028
1037
  # contains the resource. You can obtain this value from the Azure Resource
1029
1038
  # Manager API or the portal.
1030
1039
  # @param server_name [String] The name of the server.
1031
- # @param elastic_pool_name [String] The name of the elastic pool to be
1032
- # retrieved.
1040
+ # @param database_name [String] The name of the database to import into
1041
+ # @param parameters [ImportExtensionRequest] The required parameters for
1042
+ # importing a Bacpac into a database.
1033
1043
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1034
1044
  # will be added to the HTTP request.
1035
1045
  #
1036
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1046
+ # @return [Concurrent::Promise] promise which provides async access to http
1047
+ # response.
1037
1048
  #
1038
- def list_by_elastic_pool_with_http_info(resource_group_name, server_name, elastic_pool_name, custom_headers = nil)
1039
- list_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, custom_headers).value!
1049
+ def create_import_operation_async(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
1050
+ # Send request
1051
+ promise = begin_create_import_operation_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers)
1052
+
1053
+ promise = promise.then do |response|
1054
+ # Defining deserialization method.
1055
+ deserialize_method = lambda do |parsed_response|
1056
+ result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::ImportExportResponse.mapper()
1057
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
1058
+ end
1059
+
1060
+ # Waiting for response.
1061
+ @client.get_long_running_operation_result(response, deserialize_method)
1062
+ end
1063
+
1064
+ promise
1040
1065
  end
1041
1066
 
1042
1067
  #
1043
- # Returns a list of databases in an elastic pool.
1068
+ # Exports a database to a bacpac.
1044
1069
  #
1045
1070
  # @param resource_group_name [String] The name of the resource group that
1046
1071
  # contains the resource. You can obtain this value from the Azure Resource
1047
1072
  # Manager API or the portal.
1048
1073
  # @param server_name [String] The name of the server.
1049
- # @param elastic_pool_name [String] The name of the elastic pool to be
1050
- # retrieved.
1051
- # @param [Hash{String => String}] A hash of custom headers that will be added
1052
- # to the HTTP request.
1074
+ # @param database_name [String] The name of the database to be exported.
1075
+ # @param parameters [ExportRequest] The required parameters for exporting a
1076
+ # database.
1077
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1078
+ # will be added to the HTTP request.
1053
1079
  #
1054
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1080
+ # @return [ImportExportResponse] operation results.
1055
1081
  #
1056
- def list_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, custom_headers = nil)
1057
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1058
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1059
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1060
- fail ArgumentError, 'server_name is nil' if server_name.nil?
1061
- fail ArgumentError, 'elastic_pool_name is nil' if elastic_pool_name.nil?
1062
-
1063
-
1064
- request_headers = {}
1065
-
1066
- # Set Headers
1067
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1068
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1069
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases'
1070
-
1071
- request_url = @base_url || @client.base_url
1072
-
1073
- options = {
1074
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1075
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'elasticPoolName' => elastic_pool_name},
1076
- query_params: {'api-version' => @client.api_version},
1077
- headers: request_headers.merge(custom_headers || {}),
1078
- base_url: request_url
1079
- }
1080
- promise = @client.make_request_async(:get, path_template, options)
1082
+ def export(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
1083
+ response = export_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers).value!
1084
+ response.body unless response.nil?
1085
+ end
1081
1086
 
1082
- promise = promise.then do |result|
1083
- http_response = result.response
1084
- status_code = http_response.status
1085
- response_content = http_response.body
1086
- unless status_code == 200
1087
- error_model = JSON.load(response_content)
1088
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1089
- end
1087
+ #
1088
+ # @param resource_group_name [String] The name of the resource group that
1089
+ # contains the resource. You can obtain this value from the Azure Resource
1090
+ # Manager API or the portal.
1091
+ # @param server_name [String] The name of the server.
1092
+ # @param database_name [String] The name of the database to be exported.
1093
+ # @param parameters [ExportRequest] The required parameters for exporting a
1094
+ # database.
1095
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1096
+ # will be added to the HTTP request.
1097
+ #
1098
+ # @return [Concurrent::Promise] promise which provides async access to http
1099
+ # response.
1100
+ #
1101
+ def export_async(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
1102
+ # Send request
1103
+ promise = begin_export_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers)
1090
1104
 
1091
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1092
- # Deserialize Response
1093
- if status_code == 200
1094
- begin
1095
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1096
- result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::DatabaseListResult.mapper()
1097
- result.body = @client.deserialize(result_mapper, parsed_response)
1098
- rescue Exception => e
1099
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1100
- end
1105
+ promise = promise.then do |response|
1106
+ # Defining deserialization method.
1107
+ deserialize_method = lambda do |parsed_response|
1108
+ result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::ImportExportResponse.mapper()
1109
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
1101
1110
  end
1102
1111
 
1103
- result
1112
+ # Waiting for response.
1113
+ @client.get_long_running_operation_result(response, deserialize_method)
1104
1114
  end
1105
1115
 
1106
- promise.execute
1116
+ promise
1107
1117
  end
1108
1118
 
1109
1119
  #
1110
- # Gets a database inside of a recommented elastic pool.
1120
+ # Returns database metrics.
1111
1121
  #
1112
1122
  # @param resource_group_name [String] The name of the resource group that
1113
1123
  # contains the resource. You can obtain this value from the Azure Resource
1114
1124
  # Manager API or the portal.
1115
1125
  # @param server_name [String] The name of the server.
1116
- # @param recommended_elastic_pool_name [String] The name of the elastic pool to
1117
- # be retrieved.
1118
- # @param database_name [String] The name of the database to be retrieved.
1126
+ # @param database_name [String] The name of the database.
1127
+ # @param filter [String] An OData filter expression that describes a subset of
1128
+ # metrics to return.
1119
1129
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1120
1130
  # will be added to the HTTP request.
1121
1131
  #
1122
- # @return [Database] operation results.
1132
+ # @return [MetricListResult] operation results.
1123
1133
  #
1124
- def get_by_recommended_elastic_pool(resource_group_name, server_name, recommended_elastic_pool_name, database_name, custom_headers = nil)
1125
- response = get_by_recommended_elastic_pool_async(resource_group_name, server_name, recommended_elastic_pool_name, database_name, custom_headers).value!
1134
+ def list_metrics(resource_group_name, server_name, database_name, filter, custom_headers:nil)
1135
+ response = list_metrics_async(resource_group_name, server_name, database_name, filter, custom_headers:custom_headers).value!
1126
1136
  response.body unless response.nil?
1127
1137
  end
1128
1138
 
1129
1139
  #
1130
- # Gets a database inside of a recommented elastic pool.
1140
+ # Returns database metrics.
1131
1141
  #
1132
1142
  # @param resource_group_name [String] The name of the resource group that
1133
1143
  # contains the resource. You can obtain this value from the Azure Resource
1134
1144
  # Manager API or the portal.
1135
1145
  # @param server_name [String] The name of the server.
1136
- # @param recommended_elastic_pool_name [String] The name of the elastic pool to
1137
- # be retrieved.
1138
- # @param database_name [String] The name of the database to be retrieved.
1146
+ # @param database_name [String] The name of the database.
1147
+ # @param filter [String] An OData filter expression that describes a subset of
1148
+ # metrics to return.
1139
1149
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1140
1150
  # will be added to the HTTP request.
1141
1151
  #
1142
1152
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1143
1153
  #
1144
- def get_by_recommended_elastic_pool_with_http_info(resource_group_name, server_name, recommended_elastic_pool_name, database_name, custom_headers = nil)
1145
- get_by_recommended_elastic_pool_async(resource_group_name, server_name, recommended_elastic_pool_name, database_name, custom_headers).value!
1154
+ def list_metrics_with_http_info(resource_group_name, server_name, database_name, filter, custom_headers:nil)
1155
+ list_metrics_async(resource_group_name, server_name, database_name, filter, custom_headers:custom_headers).value!
1146
1156
  end
1147
1157
 
1148
1158
  #
1149
- # Gets a database inside of a recommented elastic pool.
1159
+ # Returns database metrics.
1150
1160
  #
1151
1161
  # @param resource_group_name [String] The name of the resource group that
1152
1162
  # contains the resource. You can obtain this value from the Azure Resource
1153
1163
  # Manager API or the portal.
1154
1164
  # @param server_name [String] The name of the server.
1155
- # @param recommended_elastic_pool_name [String] The name of the elastic pool to
1156
- # be retrieved.
1157
- # @param database_name [String] The name of the database to be retrieved.
1165
+ # @param database_name [String] The name of the database.
1166
+ # @param filter [String] An OData filter expression that describes a subset of
1167
+ # metrics to return.
1158
1168
  # @param [Hash{String => String}] A hash of custom headers that will be added
1159
1169
  # to the HTTP request.
1160
1170
  #
1161
1171
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1162
1172
  #
1163
- def get_by_recommended_elastic_pool_async(resource_group_name, server_name, recommended_elastic_pool_name, database_name, custom_headers = nil)
1173
+ def list_metrics_async(resource_group_name, server_name, database_name, filter, custom_headers:nil)
1164
1174
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1165
1175
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1166
1176
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1167
1177
  fail ArgumentError, 'server_name is nil' if server_name.nil?
1168
- fail ArgumentError, 'recommended_elastic_pool_name is nil' if recommended_elastic_pool_name.nil?
1169
1178
  fail ArgumentError, 'database_name is nil' if database_name.nil?
1179
+ fail ArgumentError, 'filter is nil' if filter.nil?
1170
1180
 
1171
1181
 
1172
1182
  request_headers = {}
1183
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1173
1184
 
1174
1185
  # Set Headers
1175
1186
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1176
1187
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1177
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}/databases/{databaseName}'
1188
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metrics'
1178
1189
 
1179
1190
  request_url = @base_url || @client.base_url
1180
1191
 
1181
1192
  options = {
1182
1193
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1183
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'recommendedElasticPoolName' => recommended_elastic_pool_name,'databaseName' => database_name},
1184
- query_params: {'api-version' => @client.api_version},
1194
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name},
1195
+ query_params: {'api-version' => @client.api_version,'$filter' => filter},
1185
1196
  headers: request_headers.merge(custom_headers || {}),
1186
1197
  base_url: request_url
1187
1198
  }
@@ -1201,7 +1212,7 @@ module Azure::SQL::Mgmt::V2014_04_01
1201
1212
  if status_code == 200
1202
1213
  begin
1203
1214
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1204
- result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::Database.mapper()
1215
+ result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::MetricListResult.mapper()
1205
1216
  result.body = @client.deserialize(result_mapper, parsed_response)
1206
1217
  rescue Exception => e
1207
1218
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -1215,76 +1226,74 @@ module Azure::SQL::Mgmt::V2014_04_01
1215
1226
  end
1216
1227
 
1217
1228
  #
1218
- # Returns a list of databases inside a recommented elastic pool.
1229
+ # Returns database metric definitions.
1219
1230
  #
1220
1231
  # @param resource_group_name [String] The name of the resource group that
1221
1232
  # contains the resource. You can obtain this value from the Azure Resource
1222
1233
  # Manager API or the portal.
1223
1234
  # @param server_name [String] The name of the server.
1224
- # @param recommended_elastic_pool_name [String] The name of the recommended
1225
- # elastic pool to be retrieved.
1235
+ # @param database_name [String] The name of the database.
1226
1236
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1227
1237
  # will be added to the HTTP request.
1228
1238
  #
1229
- # @return [DatabaseListResult] operation results.
1239
+ # @return [MetricDefinitionListResult] operation results.
1230
1240
  #
1231
- def list_by_recommended_elastic_pool(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers = nil)
1232
- response = list_by_recommended_elastic_pool_async(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers).value!
1241
+ def list_metric_definitions(resource_group_name, server_name, database_name, custom_headers:nil)
1242
+ response = list_metric_definitions_async(resource_group_name, server_name, database_name, custom_headers:custom_headers).value!
1233
1243
  response.body unless response.nil?
1234
1244
  end
1235
1245
 
1236
1246
  #
1237
- # Returns a list of databases inside a recommented elastic pool.
1247
+ # Returns database metric definitions.
1238
1248
  #
1239
1249
  # @param resource_group_name [String] The name of the resource group that
1240
1250
  # contains the resource. You can obtain this value from the Azure Resource
1241
1251
  # Manager API or the portal.
1242
1252
  # @param server_name [String] The name of the server.
1243
- # @param recommended_elastic_pool_name [String] The name of the recommended
1244
- # elastic pool to be retrieved.
1253
+ # @param database_name [String] The name of the database.
1245
1254
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1246
1255
  # will be added to the HTTP request.
1247
1256
  #
1248
1257
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1249
1258
  #
1250
- def list_by_recommended_elastic_pool_with_http_info(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers = nil)
1251
- list_by_recommended_elastic_pool_async(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers).value!
1259
+ def list_metric_definitions_with_http_info(resource_group_name, server_name, database_name, custom_headers:nil)
1260
+ list_metric_definitions_async(resource_group_name, server_name, database_name, custom_headers:custom_headers).value!
1252
1261
  end
1253
1262
 
1254
1263
  #
1255
- # Returns a list of databases inside a recommented elastic pool.
1264
+ # Returns database metric definitions.
1256
1265
  #
1257
1266
  # @param resource_group_name [String] The name of the resource group that
1258
1267
  # contains the resource. You can obtain this value from the Azure Resource
1259
1268
  # Manager API or the portal.
1260
1269
  # @param server_name [String] The name of the server.
1261
- # @param recommended_elastic_pool_name [String] The name of the recommended
1262
- # elastic pool to be retrieved.
1270
+ # @param database_name [String] The name of the database.
1263
1271
  # @param [Hash{String => String}] A hash of custom headers that will be added
1264
1272
  # to the HTTP request.
1265
1273
  #
1266
1274
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1267
1275
  #
1268
- def list_by_recommended_elastic_pool_async(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers = nil)
1276
+ def list_metric_definitions_async(resource_group_name, server_name, database_name, custom_headers:nil)
1269
1277
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1270
1278
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1271
1279
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1272
1280
  fail ArgumentError, 'server_name is nil' if server_name.nil?
1273
- fail ArgumentError, 'recommended_elastic_pool_name is nil' if recommended_elastic_pool_name.nil?
1281
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
1274
1282
 
1275
1283
 
1276
1284
  request_headers = {}
1285
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1277
1286
 
1278
1287
  # Set Headers
1279
1288
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1280
1289
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1281
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}/databases'
1290
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metricDefinitions'
1282
1291
 
1283
1292
  request_url = @base_url || @client.base_url
1284
1293
 
1285
1294
  options = {
1286
1295
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1287
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'recommendedElasticPoolName' => recommended_elastic_pool_name},
1296
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name},
1288
1297
  query_params: {'api-version' => @client.api_version},
1289
1298
  headers: request_headers.merge(custom_headers || {}),
1290
1299
  base_url: request_url
@@ -1305,7 +1314,7 @@ module Azure::SQL::Mgmt::V2014_04_01
1305
1314
  if status_code == 200
1306
1315
  begin
1307
1316
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1308
- result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::DatabaseListResult.mapper()
1317
+ result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::MetricDefinitionListResult.mapper()
1309
1318
  result.body = @client.deserialize(result_mapper, parsed_response)
1310
1319
  rescue Exception => e
1311
1320
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -1319,86 +1328,74 @@ module Azure::SQL::Mgmt::V2014_04_01
1319
1328
  end
1320
1329
 
1321
1330
  #
1322
- # Imports a bacpac into a new database.
1331
+ # Pauses a data warehouse.
1323
1332
  #
1324
1333
  # @param resource_group_name [String] The name of the resource group that
1325
1334
  # contains the resource. You can obtain this value from the Azure Resource
1326
1335
  # Manager API or the portal.
1327
1336
  # @param server_name [String] The name of the server.
1328
- # @param parameters [ImportRequest] The required parameters for importing a
1329
- # Bacpac into a database.
1337
+ # @param database_name [String] The name of the data warehouse to pause.
1330
1338
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1331
1339
  # will be added to the HTTP request.
1332
1340
  #
1333
- # @return [ImportExportResponse] operation results.
1334
1341
  #
1335
- def begin_import(resource_group_name, server_name, parameters, custom_headers = nil)
1336
- response = begin_import_async(resource_group_name, server_name, parameters, custom_headers).value!
1337
- response.body unless response.nil?
1342
+ def begin_pause(resource_group_name, server_name, database_name, custom_headers:nil)
1343
+ response = begin_pause_async(resource_group_name, server_name, database_name, custom_headers:custom_headers).value!
1344
+ nil
1338
1345
  end
1339
1346
 
1340
1347
  #
1341
- # Imports a bacpac into a new database.
1348
+ # Pauses a data warehouse.
1342
1349
  #
1343
1350
  # @param resource_group_name [String] The name of the resource group that
1344
1351
  # contains the resource. You can obtain this value from the Azure Resource
1345
1352
  # Manager API or the portal.
1346
1353
  # @param server_name [String] The name of the server.
1347
- # @param parameters [ImportRequest] The required parameters for importing a
1348
- # Bacpac into a database.
1354
+ # @param database_name [String] The name of the data warehouse to pause.
1349
1355
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1350
1356
  # will be added to the HTTP request.
1351
1357
  #
1352
1358
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1353
1359
  #
1354
- def begin_import_with_http_info(resource_group_name, server_name, parameters, custom_headers = nil)
1355
- begin_import_async(resource_group_name, server_name, parameters, custom_headers).value!
1360
+ def begin_pause_with_http_info(resource_group_name, server_name, database_name, custom_headers:nil)
1361
+ begin_pause_async(resource_group_name, server_name, database_name, custom_headers:custom_headers).value!
1356
1362
  end
1357
1363
 
1358
1364
  #
1359
- # Imports a bacpac into a new database.
1365
+ # Pauses a data warehouse.
1360
1366
  #
1361
1367
  # @param resource_group_name [String] The name of the resource group that
1362
1368
  # contains the resource. You can obtain this value from the Azure Resource
1363
1369
  # Manager API or the portal.
1364
1370
  # @param server_name [String] The name of the server.
1365
- # @param parameters [ImportRequest] The required parameters for importing a
1366
- # Bacpac into a database.
1371
+ # @param database_name [String] The name of the data warehouse to pause.
1367
1372
  # @param [Hash{String => String}] A hash of custom headers that will be added
1368
1373
  # to the HTTP request.
1369
1374
  #
1370
1375
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1371
1376
  #
1372
- def begin_import_async(resource_group_name, server_name, parameters, custom_headers = nil)
1377
+ def begin_pause_async(resource_group_name, server_name, database_name, custom_headers:nil)
1373
1378
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1374
1379
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1375
1380
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1376
1381
  fail ArgumentError, 'server_name is nil' if server_name.nil?
1377
- fail ArgumentError, 'parameters is nil' if parameters.nil?
1382
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
1378
1383
 
1379
1384
 
1380
1385
  request_headers = {}
1386
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1381
1387
 
1382
1388
  # Set Headers
1383
1389
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1384
1390
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1385
-
1386
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
1387
-
1388
- # Serialize Request
1389
- request_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::ImportRequest.mapper()
1390
- request_content = @client.serialize(request_mapper, parameters)
1391
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1392
-
1393
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import'
1391
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause'
1394
1392
 
1395
1393
  request_url = @base_url || @client.base_url
1396
1394
 
1397
1395
  options = {
1398
1396
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1399
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name},
1397
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name},
1400
1398
  query_params: {'api-version' => @client.api_version},
1401
- body: request_content,
1402
1399
  headers: request_headers.merge(custom_headers || {}),
1403
1400
  base_url: request_url
1404
1401
  }
@@ -1414,16 +1411,6 @@ module Azure::SQL::Mgmt::V2014_04_01
1414
1411
  end
1415
1412
 
1416
1413
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1417
- # Deserialize Response
1418
- if status_code == 200
1419
- begin
1420
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1421
- result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::ImportExportResponse.mapper()
1422
- result.body = @client.deserialize(result_mapper, parsed_response)
1423
- rescue Exception => e
1424
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1425
- end
1426
- end
1427
1414
 
1428
1415
  result
1429
1416
  end
@@ -1432,119 +1419,89 @@ module Azure::SQL::Mgmt::V2014_04_01
1432
1419
  end
1433
1420
 
1434
1421
  #
1435
- # Creates an import operation that imports a bacpac into an existing database.
1436
- # The existing database must be empty.
1422
+ # Resumes a data warehouse.
1437
1423
  #
1438
1424
  # @param resource_group_name [String] The name of the resource group that
1439
1425
  # contains the resource. You can obtain this value from the Azure Resource
1440
1426
  # Manager API or the portal.
1441
1427
  # @param server_name [String] The name of the server.
1442
- # @param database_name [String] The name of the database to import into
1443
- # @param parameters [ImportExtensionRequest] The required parameters for
1444
- # importing a Bacpac into a database.
1428
+ # @param database_name [String] The name of the data warehouse to resume.
1445
1429
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1446
1430
  # will be added to the HTTP request.
1447
1431
  #
1448
- # @return [ImportExportResponse] operation results.
1449
1432
  #
1450
- def begin_create_import_operation(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
1451
- response = begin_create_import_operation_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
1452
- response.body unless response.nil?
1433
+ def begin_resume(resource_group_name, server_name, database_name, custom_headers:nil)
1434
+ response = begin_resume_async(resource_group_name, server_name, database_name, custom_headers:custom_headers).value!
1435
+ nil
1453
1436
  end
1454
1437
 
1455
1438
  #
1456
- # Creates an import operation that imports a bacpac into an existing database.
1457
- # The existing database must be empty.
1439
+ # Resumes a data warehouse.
1458
1440
  #
1459
1441
  # @param resource_group_name [String] The name of the resource group that
1460
1442
  # contains the resource. You can obtain this value from the Azure Resource
1461
1443
  # Manager API or the portal.
1462
1444
  # @param server_name [String] The name of the server.
1463
- # @param database_name [String] The name of the database to import into
1464
- # @param parameters [ImportExtensionRequest] The required parameters for
1465
- # importing a Bacpac into a database.
1445
+ # @param database_name [String] The name of the data warehouse to resume.
1466
1446
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1467
1447
  # will be added to the HTTP request.
1468
1448
  #
1469
1449
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1470
1450
  #
1471
- def begin_create_import_operation_with_http_info(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
1472
- begin_create_import_operation_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
1451
+ def begin_resume_with_http_info(resource_group_name, server_name, database_name, custom_headers:nil)
1452
+ begin_resume_async(resource_group_name, server_name, database_name, custom_headers:custom_headers).value!
1473
1453
  end
1474
1454
 
1475
1455
  #
1476
- # Creates an import operation that imports a bacpac into an existing database.
1477
- # The existing database must be empty.
1456
+ # Resumes a data warehouse.
1478
1457
  #
1479
1458
  # @param resource_group_name [String] The name of the resource group that
1480
1459
  # contains the resource. You can obtain this value from the Azure Resource
1481
1460
  # Manager API or the portal.
1482
1461
  # @param server_name [String] The name of the server.
1483
- # @param database_name [String] The name of the database to import into
1484
- # @param parameters [ImportExtensionRequest] The required parameters for
1485
- # importing a Bacpac into a database.
1462
+ # @param database_name [String] The name of the data warehouse to resume.
1486
1463
  # @param [Hash{String => String}] A hash of custom headers that will be added
1487
1464
  # to the HTTP request.
1488
1465
  #
1489
1466
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1490
1467
  #
1491
- def begin_create_import_operation_async(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
1468
+ def begin_resume_async(resource_group_name, server_name, database_name, custom_headers:nil)
1492
1469
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1493
1470
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1494
1471
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1495
1472
  fail ArgumentError, 'server_name is nil' if server_name.nil?
1496
- fail ArgumentError, 'database_name is nil' if database_name.nil?
1497
- extension_name = 'import'
1498
- fail ArgumentError, 'parameters is nil' if parameters.nil?
1473
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
1499
1474
 
1500
1475
 
1501
1476
  request_headers = {}
1477
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1502
1478
 
1503
1479
  # Set Headers
1504
1480
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1505
1481
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1506
-
1507
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
1508
-
1509
- # Serialize Request
1510
- request_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::ImportExtensionRequest.mapper()
1511
- request_content = @client.serialize(request_mapper, parameters)
1512
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1513
-
1514
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}'
1482
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume'
1515
1483
 
1516
1484
  request_url = @base_url || @client.base_url
1517
1485
 
1518
1486
  options = {
1519
1487
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1520
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'extensionName' => extension_name},
1488
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name},
1521
1489
  query_params: {'api-version' => @client.api_version},
1522
- body: request_content,
1523
1490
  headers: request_headers.merge(custom_headers || {}),
1524
1491
  base_url: request_url
1525
1492
  }
1526
- promise = @client.make_request_async(:put, path_template, options)
1493
+ promise = @client.make_request_async(:post, path_template, options)
1527
1494
 
1528
1495
  promise = promise.then do |result|
1529
1496
  http_response = result.response
1530
1497
  status_code = http_response.status
1531
1498
  response_content = http_response.body
1532
- unless status_code == 201 || status_code == 202
1499
+ unless status_code == 202 || status_code == 200
1533
1500
  error_model = JSON.load(response_content)
1534
1501
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1535
1502
  end
1536
1503
 
1537
1504
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1538
- # Deserialize Response
1539
- if status_code == 201
1540
- begin
1541
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1542
- result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::ImportExportResponse.mapper()
1543
- result.body = @client.deserialize(result_mapper, parsed_response)
1544
- rescue Exception => e
1545
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1546
- end
1547
- end
1548
1505
 
1549
1506
  result
1550
1507
  end
@@ -1553,60 +1510,63 @@ module Azure::SQL::Mgmt::V2014_04_01
1553
1510
  end
1554
1511
 
1555
1512
  #
1556
- # Exports a database to a bacpac.
1513
+ # Creates a new database or updates an existing database.
1557
1514
  #
1558
1515
  # @param resource_group_name [String] The name of the resource group that
1559
1516
  # contains the resource. You can obtain this value from the Azure Resource
1560
1517
  # Manager API or the portal.
1561
1518
  # @param server_name [String] The name of the server.
1562
- # @param database_name [String] The name of the database to be exported.
1563
- # @param parameters [ExportRequest] The required parameters for exporting a
1564
- # database.
1519
+ # @param database_name [String] The name of the database to be operated on
1520
+ # (updated or created).
1521
+ # @param parameters [Database] The required parameters for creating or updating
1522
+ # a database.
1565
1523
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1566
1524
  # will be added to the HTTP request.
1567
1525
  #
1568
- # @return [ImportExportResponse] operation results.
1526
+ # @return [Database] operation results.
1569
1527
  #
1570
- def begin_export(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
1571
- response = begin_export_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
1528
+ def begin_create_or_update(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
1529
+ response = begin_create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers).value!
1572
1530
  response.body unless response.nil?
1573
1531
  end
1574
1532
 
1575
1533
  #
1576
- # Exports a database to a bacpac.
1534
+ # Creates a new database or updates an existing database.
1577
1535
  #
1578
1536
  # @param resource_group_name [String] The name of the resource group that
1579
1537
  # contains the resource. You can obtain this value from the Azure Resource
1580
1538
  # Manager API or the portal.
1581
1539
  # @param server_name [String] The name of the server.
1582
- # @param database_name [String] The name of the database to be exported.
1583
- # @param parameters [ExportRequest] The required parameters for exporting a
1584
- # database.
1540
+ # @param database_name [String] The name of the database to be operated on
1541
+ # (updated or created).
1542
+ # @param parameters [Database] The required parameters for creating or updating
1543
+ # a database.
1585
1544
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1586
1545
  # will be added to the HTTP request.
1587
1546
  #
1588
1547
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1589
1548
  #
1590
- def begin_export_with_http_info(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
1591
- begin_export_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
1549
+ def begin_create_or_update_with_http_info(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
1550
+ begin_create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers).value!
1592
1551
  end
1593
1552
 
1594
1553
  #
1595
- # Exports a database to a bacpac.
1554
+ # Creates a new database or updates an existing database.
1596
1555
  #
1597
1556
  # @param resource_group_name [String] The name of the resource group that
1598
1557
  # contains the resource. You can obtain this value from the Azure Resource
1599
1558
  # Manager API or the portal.
1600
1559
  # @param server_name [String] The name of the server.
1601
- # @param database_name [String] The name of the database to be exported.
1602
- # @param parameters [ExportRequest] The required parameters for exporting a
1603
- # database.
1560
+ # @param database_name [String] The name of the database to be operated on
1561
+ # (updated or created).
1562
+ # @param parameters [Database] The required parameters for creating or updating
1563
+ # a database.
1604
1564
  # @param [Hash{String => String}] A hash of custom headers that will be added
1605
1565
  # to the HTTP request.
1606
1566
  #
1607
1567
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1608
1568
  #
1609
- def begin_export_async(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
1569
+ def begin_create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
1610
1570
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1611
1571
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1612
1572
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
@@ -1616,19 +1576,18 @@ module Azure::SQL::Mgmt::V2014_04_01
1616
1576
 
1617
1577
 
1618
1578
  request_headers = {}
1579
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1619
1580
 
1620
1581
  # Set Headers
1621
1582
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1622
1583
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1623
1584
 
1624
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
1625
-
1626
1585
  # Serialize Request
1627
- request_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::ExportRequest.mapper()
1586
+ request_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::Database.mapper()
1628
1587
  request_content = @client.serialize(request_mapper, parameters)
1629
1588
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1630
1589
 
1631
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export'
1590
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'
1632
1591
 
1633
1592
  request_url = @base_url || @client.base_url
1634
1593
 
@@ -1640,13 +1599,13 @@ module Azure::SQL::Mgmt::V2014_04_01
1640
1599
  headers: request_headers.merge(custom_headers || {}),
1641
1600
  base_url: request_url
1642
1601
  }
1643
- promise = @client.make_request_async(:post, path_template, options)
1602
+ promise = @client.make_request_async(:put, path_template, options)
1644
1603
 
1645
1604
  promise = promise.then do |result|
1646
1605
  http_response = result.response
1647
1606
  status_code = http_response.status
1648
1607
  response_content = http_response.body
1649
- unless status_code == 200 || status_code == 202
1608
+ unless status_code == 200 || status_code == 201 || status_code == 202
1650
1609
  error_model = JSON.load(response_content)
1651
1610
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1652
1611
  end
@@ -1656,7 +1615,17 @@ module Azure::SQL::Mgmt::V2014_04_01
1656
1615
  if status_code == 200
1657
1616
  begin
1658
1617
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1659
- result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::ImportExportResponse.mapper()
1618
+ result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::Database.mapper()
1619
+ result.body = @client.deserialize(result_mapper, parsed_response)
1620
+ rescue Exception => e
1621
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1622
+ end
1623
+ end
1624
+ # Deserialize Response
1625
+ if status_code == 201
1626
+ begin
1627
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1628
+ result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::Database.mapper()
1660
1629
  result.body = @client.deserialize(result_mapper, parsed_response)
1661
1630
  rescue Exception => e
1662
1631
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -1670,66 +1639,81 @@ module Azure::SQL::Mgmt::V2014_04_01
1670
1639
  end
1671
1640
 
1672
1641
  #
1673
- # Pauses a data warehouse.
1642
+ # Updates an existing database.
1674
1643
  #
1675
1644
  # @param resource_group_name [String] The name of the resource group that
1676
1645
  # contains the resource. You can obtain this value from the Azure Resource
1677
1646
  # Manager API or the portal.
1678
1647
  # @param server_name [String] The name of the server.
1679
- # @param database_name [String] The name of the data warehouse to pause.
1648
+ # @param database_name [String] The name of the database to be updated.
1649
+ # @param parameters [DatabaseUpdate] The required parameters for updating a
1650
+ # database.
1680
1651
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1681
1652
  # will be added to the HTTP request.
1682
1653
  #
1654
+ # @return [Database] operation results.
1683
1655
  #
1684
- def begin_pause(resource_group_name, server_name, database_name, custom_headers = nil)
1685
- response = begin_pause_async(resource_group_name, server_name, database_name, custom_headers).value!
1686
- nil
1656
+ def begin_update(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
1657
+ response = begin_update_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers).value!
1658
+ response.body unless response.nil?
1687
1659
  end
1688
1660
 
1689
1661
  #
1690
- # Pauses a data warehouse.
1662
+ # Updates an existing database.
1691
1663
  #
1692
1664
  # @param resource_group_name [String] The name of the resource group that
1693
1665
  # contains the resource. You can obtain this value from the Azure Resource
1694
1666
  # Manager API or the portal.
1695
1667
  # @param server_name [String] The name of the server.
1696
- # @param database_name [String] The name of the data warehouse to pause.
1668
+ # @param database_name [String] The name of the database to be updated.
1669
+ # @param parameters [DatabaseUpdate] The required parameters for updating a
1670
+ # database.
1697
1671
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1698
1672
  # will be added to the HTTP request.
1699
1673
  #
1700
1674
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1701
1675
  #
1702
- def begin_pause_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil)
1703
- begin_pause_async(resource_group_name, server_name, database_name, custom_headers).value!
1676
+ def begin_update_with_http_info(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
1677
+ begin_update_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers).value!
1704
1678
  end
1705
1679
 
1706
1680
  #
1707
- # Pauses a data warehouse.
1681
+ # Updates an existing database.
1708
1682
  #
1709
1683
  # @param resource_group_name [String] The name of the resource group that
1710
1684
  # contains the resource. You can obtain this value from the Azure Resource
1711
1685
  # Manager API or the portal.
1712
1686
  # @param server_name [String] The name of the server.
1713
- # @param database_name [String] The name of the data warehouse to pause.
1687
+ # @param database_name [String] The name of the database to be updated.
1688
+ # @param parameters [DatabaseUpdate] The required parameters for updating a
1689
+ # database.
1714
1690
  # @param [Hash{String => String}] A hash of custom headers that will be added
1715
1691
  # to the HTTP request.
1716
1692
  #
1717
1693
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1718
1694
  #
1719
- def begin_pause_async(resource_group_name, server_name, database_name, custom_headers = nil)
1695
+ def begin_update_async(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
1720
1696
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1721
1697
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1722
1698
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1723
1699
  fail ArgumentError, 'server_name is nil' if server_name.nil?
1724
1700
  fail ArgumentError, 'database_name is nil' if database_name.nil?
1701
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1725
1702
 
1726
1703
 
1727
1704
  request_headers = {}
1705
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1728
1706
 
1729
1707
  # Set Headers
1730
1708
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1731
1709
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1732
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause'
1710
+
1711
+ # Serialize Request
1712
+ request_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::DatabaseUpdate.mapper()
1713
+ request_content = @client.serialize(request_mapper, parameters)
1714
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1715
+
1716
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'
1733
1717
 
1734
1718
  request_url = @base_url || @client.base_url
1735
1719
 
@@ -1737,10 +1721,11 @@ module Azure::SQL::Mgmt::V2014_04_01
1737
1721
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1738
1722
  path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name},
1739
1723
  query_params: {'api-version' => @client.api_version},
1724
+ body: request_content,
1740
1725
  headers: request_headers.merge(custom_headers || {}),
1741
1726
  base_url: request_url
1742
1727
  }
1743
- promise = @client.make_request_async(:post, path_template, options)
1728
+ promise = @client.make_request_async(:patch, path_template, options)
1744
1729
 
1745
1730
  promise = promise.then do |result|
1746
1731
  http_response = result.response
@@ -1752,6 +1737,16 @@ module Azure::SQL::Mgmt::V2014_04_01
1752
1737
  end
1753
1738
 
1754
1739
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1740
+ # Deserialize Response
1741
+ if status_code == 200
1742
+ begin
1743
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1744
+ result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::Database.mapper()
1745
+ result.body = @client.deserialize(result_mapper, parsed_response)
1746
+ rescue Exception => e
1747
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1748
+ end
1749
+ end
1755
1750
 
1756
1751
  result
1757
1752
  end
@@ -1760,73 +1755,85 @@ module Azure::SQL::Mgmt::V2014_04_01
1760
1755
  end
1761
1756
 
1762
1757
  #
1763
- # Resumes a data warehouse.
1758
+ # Imports a bacpac into a new database.
1764
1759
  #
1765
1760
  # @param resource_group_name [String] The name of the resource group that
1766
1761
  # contains the resource. You can obtain this value from the Azure Resource
1767
1762
  # Manager API or the portal.
1768
1763
  # @param server_name [String] The name of the server.
1769
- # @param database_name [String] The name of the data warehouse to resume.
1764
+ # @param parameters [ImportRequest] The required parameters for importing a
1765
+ # Bacpac into a database.
1770
1766
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1771
1767
  # will be added to the HTTP request.
1772
1768
  #
1769
+ # @return [ImportExportResponse] operation results.
1773
1770
  #
1774
- def begin_resume(resource_group_name, server_name, database_name, custom_headers = nil)
1775
- response = begin_resume_async(resource_group_name, server_name, database_name, custom_headers).value!
1776
- nil
1771
+ def begin_import(resource_group_name, server_name, parameters, custom_headers:nil)
1772
+ response = begin_import_async(resource_group_name, server_name, parameters, custom_headers:custom_headers).value!
1773
+ response.body unless response.nil?
1777
1774
  end
1778
1775
 
1779
1776
  #
1780
- # Resumes a data warehouse.
1777
+ # Imports a bacpac into a new database.
1781
1778
  #
1782
1779
  # @param resource_group_name [String] The name of the resource group that
1783
1780
  # contains the resource. You can obtain this value from the Azure Resource
1784
1781
  # Manager API or the portal.
1785
1782
  # @param server_name [String] The name of the server.
1786
- # @param database_name [String] The name of the data warehouse to resume.
1783
+ # @param parameters [ImportRequest] The required parameters for importing a
1784
+ # Bacpac into a database.
1787
1785
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1788
1786
  # will be added to the HTTP request.
1789
1787
  #
1790
1788
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1791
1789
  #
1792
- def begin_resume_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil)
1793
- begin_resume_async(resource_group_name, server_name, database_name, custom_headers).value!
1790
+ def begin_import_with_http_info(resource_group_name, server_name, parameters, custom_headers:nil)
1791
+ begin_import_async(resource_group_name, server_name, parameters, custom_headers:custom_headers).value!
1794
1792
  end
1795
1793
 
1796
1794
  #
1797
- # Resumes a data warehouse.
1795
+ # Imports a bacpac into a new database.
1798
1796
  #
1799
1797
  # @param resource_group_name [String] The name of the resource group that
1800
1798
  # contains the resource. You can obtain this value from the Azure Resource
1801
1799
  # Manager API or the portal.
1802
1800
  # @param server_name [String] The name of the server.
1803
- # @param database_name [String] The name of the data warehouse to resume.
1801
+ # @param parameters [ImportRequest] The required parameters for importing a
1802
+ # Bacpac into a database.
1804
1803
  # @param [Hash{String => String}] A hash of custom headers that will be added
1805
1804
  # to the HTTP request.
1806
1805
  #
1807
1806
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1808
1807
  #
1809
- def begin_resume_async(resource_group_name, server_name, database_name, custom_headers = nil)
1808
+ def begin_import_async(resource_group_name, server_name, parameters, custom_headers:nil)
1810
1809
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1811
1810
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1812
1811
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1813
1812
  fail ArgumentError, 'server_name is nil' if server_name.nil?
1814
- fail ArgumentError, 'database_name is nil' if database_name.nil?
1813
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1815
1814
 
1816
1815
 
1817
1816
  request_headers = {}
1817
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1818
1818
 
1819
1819
  # Set Headers
1820
1820
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1821
1821
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1822
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume'
1822
+
1823
+ # Serialize Request
1824
+ request_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::ImportRequest.mapper()
1825
+ request_content = @client.serialize(request_mapper, parameters)
1826
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1827
+
1828
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import'
1823
1829
 
1824
1830
  request_url = @base_url || @client.base_url
1825
1831
 
1826
1832
  options = {
1827
1833
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1828
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name},
1834
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name},
1829
1835
  query_params: {'api-version' => @client.api_version},
1836
+ body: request_content,
1830
1837
  headers: request_headers.merge(custom_headers || {}),
1831
1838
  base_url: request_url
1832
1839
  }
@@ -1836,12 +1843,22 @@ module Azure::SQL::Mgmt::V2014_04_01
1836
1843
  http_response = result.response
1837
1844
  status_code = http_response.status
1838
1845
  response_content = http_response.body
1839
- unless status_code == 202 || status_code == 200
1846
+ unless status_code == 200 || status_code == 202
1840
1847
  error_model = JSON.load(response_content)
1841
1848
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1842
1849
  end
1843
1850
 
1844
1851
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1852
+ # Deserialize Response
1853
+ if status_code == 200
1854
+ begin
1855
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1856
+ result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::ImportExportResponse.mapper()
1857
+ result.body = @client.deserialize(result_mapper, parsed_response)
1858
+ rescue Exception => e
1859
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1860
+ end
1861
+ end
1845
1862
 
1846
1863
  result
1847
1864
  end
@@ -1850,91 +1867,91 @@ module Azure::SQL::Mgmt::V2014_04_01
1850
1867
  end
1851
1868
 
1852
1869
  #
1853
- # Creates a new database or updates an existing database.
1870
+ # Creates an import operation that imports a bacpac into an existing database.
1871
+ # The existing database must be empty.
1854
1872
  #
1855
1873
  # @param resource_group_name [String] The name of the resource group that
1856
1874
  # contains the resource. You can obtain this value from the Azure Resource
1857
1875
  # Manager API or the portal.
1858
1876
  # @param server_name [String] The name of the server.
1859
- # @param database_name [String] The name of the database to be operated on
1860
- # (updated or created).
1861
- # @param parameters [Database] The required parameters for creating or updating
1862
- # a database.
1877
+ # @param database_name [String] The name of the database to import into
1878
+ # @param parameters [ImportExtensionRequest] The required parameters for
1879
+ # importing a Bacpac into a database.
1863
1880
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1864
1881
  # will be added to the HTTP request.
1865
1882
  #
1866
- # @return [Database] operation results.
1883
+ # @return [ImportExportResponse] operation results.
1867
1884
  #
1868
- def begin_create_or_update(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
1869
- response = begin_create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
1885
+ def begin_create_import_operation(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
1886
+ response = begin_create_import_operation_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers).value!
1870
1887
  response.body unless response.nil?
1871
1888
  end
1872
1889
 
1873
1890
  #
1874
- # Creates a new database or updates an existing database.
1891
+ # Creates an import operation that imports a bacpac into an existing database.
1892
+ # The existing database must be empty.
1875
1893
  #
1876
1894
  # @param resource_group_name [String] The name of the resource group that
1877
1895
  # contains the resource. You can obtain this value from the Azure Resource
1878
1896
  # Manager API or the portal.
1879
1897
  # @param server_name [String] The name of the server.
1880
- # @param database_name [String] The name of the database to be operated on
1881
- # (updated or created).
1882
- # @param parameters [Database] The required parameters for creating or updating
1883
- # a database.
1898
+ # @param database_name [String] The name of the database to import into
1899
+ # @param parameters [ImportExtensionRequest] The required parameters for
1900
+ # importing a Bacpac into a database.
1884
1901
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1885
1902
  # will be added to the HTTP request.
1886
1903
  #
1887
1904
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1888
1905
  #
1889
- def begin_create_or_update_with_http_info(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
1890
- begin_create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
1906
+ def begin_create_import_operation_with_http_info(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
1907
+ begin_create_import_operation_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers).value!
1891
1908
  end
1892
1909
 
1893
1910
  #
1894
- # Creates a new database or updates an existing database.
1911
+ # Creates an import operation that imports a bacpac into an existing database.
1912
+ # The existing database must be empty.
1895
1913
  #
1896
1914
  # @param resource_group_name [String] The name of the resource group that
1897
1915
  # contains the resource. You can obtain this value from the Azure Resource
1898
1916
  # Manager API or the portal.
1899
1917
  # @param server_name [String] The name of the server.
1900
- # @param database_name [String] The name of the database to be operated on
1901
- # (updated or created).
1902
- # @param parameters [Database] The required parameters for creating or updating
1903
- # a database.
1918
+ # @param database_name [String] The name of the database to import into
1919
+ # @param parameters [ImportExtensionRequest] The required parameters for
1920
+ # importing a Bacpac into a database.
1904
1921
  # @param [Hash{String => String}] A hash of custom headers that will be added
1905
1922
  # to the HTTP request.
1906
1923
  #
1907
1924
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1908
1925
  #
1909
- def begin_create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
1926
+ def begin_create_import_operation_async(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
1910
1927
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1911
1928
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1912
1929
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1913
1930
  fail ArgumentError, 'server_name is nil' if server_name.nil?
1914
1931
  fail ArgumentError, 'database_name is nil' if database_name.nil?
1932
+ extension_name = 'import'
1915
1933
  fail ArgumentError, 'parameters is nil' if parameters.nil?
1916
1934
 
1917
1935
 
1918
1936
  request_headers = {}
1937
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1919
1938
 
1920
1939
  # Set Headers
1921
1940
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1922
1941
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1923
1942
 
1924
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
1925
-
1926
1943
  # Serialize Request
1927
- request_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::Database.mapper()
1944
+ request_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::ImportExtensionRequest.mapper()
1928
1945
  request_content = @client.serialize(request_mapper, parameters)
1929
1946
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1930
1947
 
1931
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'
1948
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}'
1932
1949
 
1933
1950
  request_url = @base_url || @client.base_url
1934
1951
 
1935
1952
  options = {
1936
1953
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1937
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name},
1954
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'extensionName' => extension_name},
1938
1955
  query_params: {'api-version' => @client.api_version},
1939
1956
  body: request_content,
1940
1957
  headers: request_headers.merge(custom_headers || {}),
@@ -1946,27 +1963,17 @@ module Azure::SQL::Mgmt::V2014_04_01
1946
1963
  http_response = result.response
1947
1964
  status_code = http_response.status
1948
1965
  response_content = http_response.body
1949
- unless status_code == 200 || status_code == 201 || status_code == 202
1966
+ unless status_code == 201 || status_code == 202
1950
1967
  error_model = JSON.load(response_content)
1951
1968
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1952
1969
  end
1953
1970
 
1954
1971
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1955
1972
  # Deserialize Response
1956
- if status_code == 200
1957
- begin
1958
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1959
- result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::Database.mapper()
1960
- result.body = @client.deserialize(result_mapper, parsed_response)
1961
- rescue Exception => e
1962
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1963
- end
1964
- end
1965
- # Deserialize Response
1966
1973
  if status_code == 201
1967
1974
  begin
1968
1975
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1969
- result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::Database.mapper()
1976
+ result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::ImportExportResponse.mapper()
1970
1977
  result.body = @client.deserialize(result_mapper, parsed_response)
1971
1978
  rescue Exception => e
1972
1979
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -1980,60 +1987,60 @@ module Azure::SQL::Mgmt::V2014_04_01
1980
1987
  end
1981
1988
 
1982
1989
  #
1983
- # Updates an existing database.
1990
+ # Exports a database to a bacpac.
1984
1991
  #
1985
1992
  # @param resource_group_name [String] The name of the resource group that
1986
1993
  # contains the resource. You can obtain this value from the Azure Resource
1987
1994
  # Manager API or the portal.
1988
1995
  # @param server_name [String] The name of the server.
1989
- # @param database_name [String] The name of the database to be updated.
1990
- # @param parameters [DatabaseUpdate] The required parameters for updating a
1996
+ # @param database_name [String] The name of the database to be exported.
1997
+ # @param parameters [ExportRequest] The required parameters for exporting a
1991
1998
  # database.
1992
1999
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1993
2000
  # will be added to the HTTP request.
1994
2001
  #
1995
- # @return [Database] operation results.
2002
+ # @return [ImportExportResponse] operation results.
1996
2003
  #
1997
- def begin_update(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
1998
- response = begin_update_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
2004
+ def begin_export(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
2005
+ response = begin_export_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers).value!
1999
2006
  response.body unless response.nil?
2000
2007
  end
2001
2008
 
2002
2009
  #
2003
- # Updates an existing database.
2010
+ # Exports a database to a bacpac.
2004
2011
  #
2005
2012
  # @param resource_group_name [String] The name of the resource group that
2006
2013
  # contains the resource. You can obtain this value from the Azure Resource
2007
2014
  # Manager API or the portal.
2008
2015
  # @param server_name [String] The name of the server.
2009
- # @param database_name [String] The name of the database to be updated.
2010
- # @param parameters [DatabaseUpdate] The required parameters for updating a
2016
+ # @param database_name [String] The name of the database to be exported.
2017
+ # @param parameters [ExportRequest] The required parameters for exporting a
2011
2018
  # database.
2012
2019
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
2013
2020
  # will be added to the HTTP request.
2014
2021
  #
2015
2022
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2016
2023
  #
2017
- def begin_update_with_http_info(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
2018
- begin_update_async(resource_group_name, server_name, database_name, parameters, custom_headers).value!
2024
+ def begin_export_with_http_info(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
2025
+ begin_export_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers).value!
2019
2026
  end
2020
2027
 
2021
2028
  #
2022
- # Updates an existing database.
2029
+ # Exports a database to a bacpac.
2023
2030
  #
2024
2031
  # @param resource_group_name [String] The name of the resource group that
2025
2032
  # contains the resource. You can obtain this value from the Azure Resource
2026
2033
  # Manager API or the portal.
2027
2034
  # @param server_name [String] The name of the server.
2028
- # @param database_name [String] The name of the database to be updated.
2029
- # @param parameters [DatabaseUpdate] The required parameters for updating a
2035
+ # @param database_name [String] The name of the database to be exported.
2036
+ # @param parameters [ExportRequest] The required parameters for exporting a
2030
2037
  # database.
2031
2038
  # @param [Hash{String => String}] A hash of custom headers that will be added
2032
2039
  # to the HTTP request.
2033
2040
  #
2034
2041
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2035
2042
  #
2036
- def begin_update_async(resource_group_name, server_name, database_name, parameters, custom_headers = nil)
2043
+ def begin_export_async(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
2037
2044
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2038
2045
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2039
2046
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
@@ -2043,19 +2050,18 @@ module Azure::SQL::Mgmt::V2014_04_01
2043
2050
 
2044
2051
 
2045
2052
  request_headers = {}
2053
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2046
2054
 
2047
2055
  # Set Headers
2048
2056
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2049
2057
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2050
2058
 
2051
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
2052
-
2053
2059
  # Serialize Request
2054
- request_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::DatabaseUpdate.mapper()
2060
+ request_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::ExportRequest.mapper()
2055
2061
  request_content = @client.serialize(request_mapper, parameters)
2056
2062
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2057
2063
 
2058
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'
2064
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export'
2059
2065
 
2060
2066
  request_url = @base_url || @client.base_url
2061
2067
 
@@ -2067,7 +2073,7 @@ module Azure::SQL::Mgmt::V2014_04_01
2067
2073
  headers: request_headers.merge(custom_headers || {}),
2068
2074
  base_url: request_url
2069
2075
  }
2070
- promise = @client.make_request_async(:patch, path_template, options)
2076
+ promise = @client.make_request_async(:post, path_template, options)
2071
2077
 
2072
2078
  promise = promise.then do |result|
2073
2079
  http_response = result.response
@@ -2083,7 +2089,7 @@ module Azure::SQL::Mgmt::V2014_04_01
2083
2089
  if status_code == 200
2084
2090
  begin
2085
2091
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2086
- result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::Database.mapper()
2092
+ result_mapper = Azure::SQL::Mgmt::V2014_04_01::Models::ImportExportResponse.mapper()
2087
2093
  result.body = @client.deserialize(result_mapper, parsed_response)
2088
2094
  rescue Exception => e
2089
2095
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)