azure_mgmt_sql 0.16.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (206) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2014-04-01/generated/azure_mgmt_sql.rb +62 -61
  3. data/lib/2014-04-01/generated/azure_mgmt_sql/models/database.rb +8 -8
  4. data/lib/2014-04-01/generated/azure_mgmt_sql/models/elastic_pool.rb +8 -8
  5. data/lib/2014-04-01/generated/azure_mgmt_sql/models/server.rb +8 -8
  6. data/lib/2014-04-01/generated/azure_mgmt_sql/models/tracked_resource.rb +11 -11
  7. data/lib/2014-04-01/generated/azure_mgmt_sql/server_advisors.rb +454 -0
  8. data/lib/2014-04-01/generated/azure_mgmt_sql/sql_management_client.rb +22 -17
  9. data/lib/2015-05-01-preview/generated/azure_mgmt_sql.rb +43 -25
  10. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/database_automatic_tuning_operations.rb +246 -0
  11. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/database_blob_auditing_policies.rb +6 -12
  12. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/firewall_rules.rb +666 -0
  13. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/managed_instances.rb +986 -0
  14. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/automatic_tuning_disabled_reason.rb +21 -0
  15. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/automatic_tuning_mode.rb +18 -0
  16. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/automatic_tuning_option_mode_actual.rb +16 -0
  17. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/automatic_tuning_option_mode_desired.rb +17 -0
  18. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/automatic_tuning_options.rb +91 -0
  19. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/database_automatic_tuning.rb +110 -0
  20. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/database_blob_auditing_policy.rb +72 -2
  21. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/firewall_rule.rb +86 -0
  22. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/firewall_rule_list.rb +55 -0
  23. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/firewall_rule_list_result.rb +100 -0
  24. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/managed_instance.rb +206 -0
  25. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/managed_instance_list_result.rb +100 -0
  26. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/managed_instance_update.rb +161 -0
  27. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/proxy_resource_with_writable_name.rb +61 -0
  28. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/resource_with_writable_name.rb +70 -0
  29. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/sku.rb +97 -0
  30. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb +20 -6
  31. data/lib/2017-03-01-preview/generated/azure_mgmt_sql.rb +88 -11
  32. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/backup_long_term_retention_policies.rb +402 -0
  33. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/data_warehouse_user_activities_operations.rb +134 -0
  34. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/database_blob_auditing_policies.rb +258 -0
  35. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/database_operations.rb +4 -4
  36. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/database_vulnerability_assessment_rule_baselines.rb +400 -0
  37. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/database_vulnerability_assessments.rb +356 -0
  38. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/databases.rb +4 -4
  39. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/extended_database_blob_auditing_policies.rb +258 -0
  40. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/extended_server_blob_auditing_policies.rb +290 -0
  41. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/job_agents.rb +816 -0
  42. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/job_credentials.rb +571 -0
  43. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/job_executions.rb +1101 -0
  44. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/job_step_executions.rb +415 -0
  45. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/job_steps.rb +927 -0
  46. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/job_target_executions.rb +697 -0
  47. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/job_target_groups.rb +571 -0
  48. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/job_versions.rb +358 -0
  49. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/jobs.rb +570 -0
  50. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/long_term_retention_backups.rb +925 -0
  51. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/managed_databases.rb +963 -0
  52. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/backup_long_term_retention_policy.rb +110 -0
  53. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/blob_auditing_policy_state.rb +16 -0
  54. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/complete_database_restore_definition.rb +47 -0
  55. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/create_mode.rb +1 -0
  56. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/data_warehouse_user_activities.rb +74 -0
  57. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/database.rb +9 -9
  58. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/database_blob_auditing_policy.rb +238 -0
  59. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/database_operation.rb +36 -0
  60. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/{status.rb → database_status.rb} +2 -2
  61. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/database_update.rb +9 -9
  62. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/database_vulnerability_assessment.rb +100 -0
  63. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/database_vulnerability_assessment_rule_baseline.rb +84 -0
  64. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/database_vulnerability_assessment_rule_baseline_item.rb +56 -0
  65. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/extended_database_blob_auditing_policy.rb +238 -0
  66. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/extended_server_blob_auditing_policy.rb +238 -0
  67. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/job.rb +99 -0
  68. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/job_agent.rb +122 -0
  69. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/job_agent_list_result.rb +100 -0
  70. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/job_agent_state.rb +19 -0
  71. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/job_agent_update.rb +54 -0
  72. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/job_credential.rb +85 -0
  73. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/job_credential_list_result.rb +100 -0
  74. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/job_execution.rb +224 -0
  75. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/job_execution_lifecycle.rb +24 -0
  76. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/job_execution_list_result.rb +100 -0
  77. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/job_execution_target.rb +73 -0
  78. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/job_list_result.rb +100 -0
  79. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/job_schedule.rb +98 -0
  80. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/job_schedule_type.rb +16 -0
  81. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/job_step.rb +135 -0
  82. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/job_step_action.rb +73 -0
  83. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/job_step_action_source.rb +15 -0
  84. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/job_step_action_type.rb +15 -0
  85. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/job_step_execution_options.rb +100 -0
  86. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/job_step_list_result.rb +100 -0
  87. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/job_step_output.rb +127 -0
  88. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/job_step_output_type.rb +15 -0
  89. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/job_target.rb +121 -0
  90. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/job_target_group.rb +82 -0
  91. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/job_target_group_list_result.rb +100 -0
  92. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/job_target_group_membership_type.rb +16 -0
  93. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/job_target_type.rb +19 -0
  94. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/job_version.rb +62 -0
  95. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/job_version_list_result.rb +100 -0
  96. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/long_term_retention_backup.rb +134 -0
  97. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/{database_restore_point_list_result.rb → long_term_retention_backup_list_result.rb} +9 -9
  98. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/long_term_retention_database_state.rb +17 -0
  99. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/managed_database.rb +242 -0
  100. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/managed_database_create_mode.rb +17 -0
  101. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/managed_database_list_result.rb +100 -0
  102. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/managed_database_status.rb +19 -0
  103. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/managed_database_update.rb +210 -0
  104. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/provisioning_state.rb +19 -0
  105. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/{database_restore_point.rb → restore_point.rb} +6 -5
  106. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/restore_point_list_result.rb +68 -0
  107. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/security_alert_policy_state.rb +17 -0
  108. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/sensitivity_label.rb +84 -0
  109. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/sensitivity_label_list_result.rb +100 -0
  110. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/sensitivity_label_source.rb +16 -0
  111. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/server_blob_auditing_policy.rb +226 -0
  112. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/server_security_alert_policy.rb +166 -0
  113. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/{arm_sku.rb → sku.rb} +16 -11
  114. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/vulnerability_assessment_policy_baseline_name.rb +16 -0
  115. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/vulnerability_assessment_recurring_scans_properties.rb +80 -0
  116. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/{database_restore_points.rb → restore_points.rb} +93 -111
  117. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/sensitivity_labels.rb +612 -0
  118. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/server_automatic_tuning_operations.rb +4 -4
  119. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/server_blob_auditing_policies.rb +290 -0
  120. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/server_dns_aliases.rb +4 -4
  121. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/server_security_alert_policies.rb +290 -0
  122. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/sql_management_client.rb +100 -9
  123. data/lib/2017-10-01-preview/generated/azure_mgmt_sql.rb +104 -0
  124. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/backup_short_term_retention_policies.rb +684 -0
  125. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/capabilities.rb +128 -0
  126. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/database_operations.rb +338 -0
  127. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/database_vulnerability_assessment_scans.rb +621 -0
  128. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/databases.rb +1566 -0
  129. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/elastic_pool_operations.rb +338 -0
  130. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/elastic_pools.rb +815 -0
  131. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/instance_failover_groups.rb +983 -0
  132. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/managed_instance_tde_certificates.rb +175 -0
  133. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/backup_short_term_retention_policy.rb +74 -0
  134. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/backup_short_term_retention_policy_list_result.rb +101 -0
  135. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/capability_group.rb +17 -0
  136. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/capability_status.rb +18 -0
  137. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/catalog_collation_type.rb +16 -0
  138. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/create_mode.rb +24 -0
  139. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/database.rb +482 -0
  140. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/database_license_type.rb +16 -0
  141. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/database_list_result.rb +100 -0
  142. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/database_operation.rb +233 -0
  143. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/database_operation_list_result.rb +100 -0
  144. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/database_read_scale.rb +16 -0
  145. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/database_status.rb +32 -0
  146. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/database_update.rb +425 -0
  147. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/database_vulnerability_assessment.rb +100 -0
  148. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/database_vulnerability_assessment_scans_export.rb +76 -0
  149. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/edition_capability.rb +107 -0
  150. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/elastic_pool.rb +187 -0
  151. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/elastic_pool_edition_capability.rb +107 -0
  152. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/elastic_pool_license_type.rb +16 -0
  153. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/elastic_pool_list_result.rb +100 -0
  154. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/elastic_pool_operation.rb +231 -0
  155. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/elastic_pool_operation_list_result.rb +100 -0
  156. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/elastic_pool_per_database_max_performance_level_capability.rb +108 -0
  157. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/elastic_pool_per_database_min_performance_level_capability.rb +86 -0
  158. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/elastic_pool_per_database_settings.rb +57 -0
  159. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/elastic_pool_performance_level_capability.rb +200 -0
  160. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/elastic_pool_state.rb +17 -0
  161. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/elastic_pool_update.rb +116 -0
  162. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/instance_failover_group.rb +156 -0
  163. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/instance_failover_group_list_result.rb +100 -0
  164. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/instance_failover_group_read_only_endpoint.rb +48 -0
  165. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/instance_failover_group_read_write_endpoint.rb +62 -0
  166. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/instance_failover_group_replication_role.rb +16 -0
  167. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/license_type_capability.rb +72 -0
  168. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/location_capabilities.rb +116 -0
  169. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/log_size_capability.rb +61 -0
  170. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/log_size_unit.rb +19 -0
  171. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/managed_instance_edition_capability.rb +94 -0
  172. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/managed_instance_family_capability.rb +161 -0
  173. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/managed_instance_pair_info.rb +57 -0
  174. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/managed_instance_vcores_capability.rb +84 -0
  175. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/managed_instance_version_capability.rb +94 -0
  176. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/management_operation_state.rb +20 -0
  177. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/max_size_capability.rb +61 -0
  178. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/max_size_range_capability.rb +113 -0
  179. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/max_size_unit.rb +18 -0
  180. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/partner_region_info.rb +60 -0
  181. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/performance_level_capability.rb +60 -0
  182. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/performance_level_unit.rb +16 -0
  183. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/proxy_resource.rb +62 -0
  184. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/read_only_endpoint_failover_policy.rb +16 -0
  185. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/read_write_endpoint_failover_policy.rb +16 -0
  186. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/resource.rb +71 -0
  187. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/resource_move_definition.rb +46 -0
  188. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/sample_name.rb +17 -0
  189. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/server_version_capability.rb +116 -0
  190. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/service_objective_capability.rb +166 -0
  191. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/sku.rb +97 -0
  192. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/tde_certificate.rb +84 -0
  193. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/tracked_resource.rb +92 -0
  194. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/vulnerability_assessment_recurring_scans_properties.rb +80 -0
  195. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/vulnerability_assessment_scan_error.rb +59 -0
  196. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/vulnerability_assessment_scan_record.rb +169 -0
  197. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/vulnerability_assessment_scan_record_list_result.rb +102 -0
  198. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/vulnerability_assessment_scan_state.rb +18 -0
  199. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/vulnerability_assessment_scan_trigger_type.rb +16 -0
  200. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/module_definition.rb +9 -0
  201. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/sql_management_client.rb +171 -0
  202. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/tde_certificates.rb +175 -0
  203. data/lib/azure_mgmt_sql.rb +2 -1
  204. data/lib/profiles/latest/modules/sql_profile_module.rb +855 -411
  205. data/lib/version.rb +1 -1
  206. metadata +186 -10
@@ -0,0 +1,1566 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::SQL::Mgmt::V2017_10_01_preview
7
+ #
8
+ # The Azure SQL Database management API provides a RESTful set of web
9
+ # services that interact with Azure SQL Database services to manage your
10
+ # databases. The API enables you to create, retrieve, update, and delete
11
+ # databases.
12
+ #
13
+ class Databases
14
+ include MsRestAzure
15
+
16
+ #
17
+ # Creates and initializes a new instance of the Databases class.
18
+ # @param client service class for accessing basic functionality.
19
+ #
20
+ def initialize(client)
21
+ @client = client
22
+ end
23
+
24
+ # @return [SqlManagementClient] reference to the SqlManagementClient
25
+ attr_reader :client
26
+
27
+ #
28
+ # Upgrades a data warehouse.
29
+ #
30
+ # @param resource_group_name [String] The name of the resource group that
31
+ # contains the resource. You can obtain this value from the Azure Resource
32
+ # Manager API or the portal.
33
+ # @param server_name [String] The name of the server.
34
+ # @param database_name [String] The name of the database to be upgraded.
35
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
36
+ # will be added to the HTTP request.
37
+ #
38
+ def upgrade_data_warehouse(resource_group_name, server_name, database_name, custom_headers:nil)
39
+ response = upgrade_data_warehouse_async(resource_group_name, server_name, database_name, custom_headers:custom_headers).value!
40
+ nil
41
+ end
42
+
43
+ #
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 database to be upgraded.
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 upgrade_data_warehouse_async(resource_group_name, server_name, database_name, custom_headers:nil)
56
+ # Send request
57
+ promise = begin_upgrade_data_warehouse_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
69
+ end
70
+
71
+ #
72
+ # Gets a list of databases.
73
+ #
74
+ # @param resource_group_name [String] The name of the resource group that
75
+ # contains the resource. You can obtain this value from the Azure Resource
76
+ # Manager API or the portal.
77
+ # @param server_name [String] The name of the server.
78
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
79
+ # will be added to the HTTP request.
80
+ #
81
+ # @return [Array<Database>] operation results.
82
+ #
83
+ def list_by_server(resource_group_name, server_name, custom_headers:nil)
84
+ first_page = list_by_server_as_lazy(resource_group_name, server_name, custom_headers:custom_headers)
85
+ first_page.get_all_items
86
+ end
87
+
88
+ #
89
+ # Gets a list of databases.
90
+ #
91
+ # @param resource_group_name [String] The name of the resource group that
92
+ # contains the resource. You can obtain this value from the Azure Resource
93
+ # Manager API or the portal.
94
+ # @param server_name [String] The name of the server.
95
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
96
+ # will be added to the HTTP request.
97
+ #
98
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
99
+ #
100
+ def list_by_server_with_http_info(resource_group_name, server_name, custom_headers:nil)
101
+ list_by_server_async(resource_group_name, server_name, custom_headers:custom_headers).value!
102
+ end
103
+
104
+ #
105
+ # Gets a list of databases.
106
+ #
107
+ # @param resource_group_name [String] The name of the resource group that
108
+ # contains the resource. You can obtain this value from the Azure Resource
109
+ # Manager API or the portal.
110
+ # @param server_name [String] The name of the server.
111
+ # @param [Hash{String => String}] A hash of custom headers that will be added
112
+ # to the HTTP request.
113
+ #
114
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
115
+ #
116
+ def list_by_server_async(resource_group_name, server_name, custom_headers:nil)
117
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
118
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
119
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
120
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
121
+
122
+
123
+ request_headers = {}
124
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
125
+
126
+ # Set Headers
127
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
128
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
129
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases'
130
+
131
+ request_url = @base_url || @client.base_url
132
+
133
+ options = {
134
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
135
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'subscriptionId' => @client.subscription_id},
136
+ query_params: {'api-version' => @client.api_version},
137
+ headers: request_headers.merge(custom_headers || {}),
138
+ base_url: request_url
139
+ }
140
+ promise = @client.make_request_async(:get, path_template, options)
141
+
142
+ promise = promise.then do |result|
143
+ http_response = result.response
144
+ status_code = http_response.status
145
+ response_content = http_response.body
146
+ unless status_code == 200
147
+ error_model = JSON.load(response_content)
148
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
149
+ end
150
+
151
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
152
+ # Deserialize Response
153
+ if status_code == 200
154
+ begin
155
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
156
+ result_mapper = Azure::SQL::Mgmt::V2017_10_01_preview::Models::DatabaseListResult.mapper()
157
+ result.body = @client.deserialize(result_mapper, parsed_response)
158
+ rescue Exception => e
159
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
160
+ end
161
+ end
162
+
163
+ result
164
+ end
165
+
166
+ promise.execute
167
+ end
168
+
169
+ #
170
+ # Gets a database.
171
+ #
172
+ # @param resource_group_name [String] The name of the resource group that
173
+ # contains the resource. You can obtain this value from the Azure Resource
174
+ # Manager API or the portal.
175
+ # @param server_name [String] The name of the server.
176
+ # @param database_name [String] The name of the database.
177
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
178
+ # will be added to the HTTP request.
179
+ #
180
+ # @return [Database] operation results.
181
+ #
182
+ def get(resource_group_name, server_name, database_name, custom_headers:nil)
183
+ response = get_async(resource_group_name, server_name, database_name, custom_headers:custom_headers).value!
184
+ response.body unless response.nil?
185
+ end
186
+
187
+ #
188
+ # Gets a database.
189
+ #
190
+ # @param resource_group_name [String] The name of the resource group that
191
+ # contains the resource. You can obtain this value from the Azure Resource
192
+ # Manager API or the portal.
193
+ # @param server_name [String] The name of the server.
194
+ # @param database_name [String] The name of the database.
195
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
196
+ # will be added to the HTTP request.
197
+ #
198
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
199
+ #
200
+ def get_with_http_info(resource_group_name, server_name, database_name, custom_headers:nil)
201
+ get_async(resource_group_name, server_name, database_name, custom_headers:custom_headers).value!
202
+ end
203
+
204
+ #
205
+ # Gets a database.
206
+ #
207
+ # @param resource_group_name [String] The name of the resource group that
208
+ # contains the resource. You can obtain this value from the Azure Resource
209
+ # Manager API or the portal.
210
+ # @param server_name [String] The name of the server.
211
+ # @param database_name [String] The name of the database.
212
+ # @param [Hash{String => String}] A hash of custom headers that will be added
213
+ # to the HTTP request.
214
+ #
215
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
216
+ #
217
+ def get_async(resource_group_name, server_name, database_name, custom_headers:nil)
218
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
219
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
220
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
221
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
222
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
223
+
224
+
225
+ request_headers = {}
226
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
227
+
228
+ # Set Headers
229
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
230
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
231
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'
232
+
233
+ request_url = @base_url || @client.base_url
234
+
235
+ options = {
236
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
237
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'subscriptionId' => @client.subscription_id},
238
+ query_params: {'api-version' => @client.api_version},
239
+ headers: request_headers.merge(custom_headers || {}),
240
+ base_url: request_url
241
+ }
242
+ promise = @client.make_request_async(:get, path_template, options)
243
+
244
+ promise = promise.then do |result|
245
+ http_response = result.response
246
+ status_code = http_response.status
247
+ response_content = http_response.body
248
+ unless status_code == 200
249
+ error_model = JSON.load(response_content)
250
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
251
+ end
252
+
253
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
254
+ # Deserialize Response
255
+ if status_code == 200
256
+ begin
257
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
258
+ result_mapper = Azure::SQL::Mgmt::V2017_10_01_preview::Models::Database.mapper()
259
+ result.body = @client.deserialize(result_mapper, parsed_response)
260
+ rescue Exception => e
261
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
262
+ end
263
+ end
264
+
265
+ result
266
+ end
267
+
268
+ promise.execute
269
+ end
270
+
271
+ #
272
+ # Creates a new database or updates an existing database.
273
+ #
274
+ # @param resource_group_name [String] The name of the resource group that
275
+ # contains the resource. You can obtain this value from the Azure Resource
276
+ # Manager API or the portal.
277
+ # @param server_name [String] The name of the server.
278
+ # @param database_name [String] The name of the database.
279
+ # @param parameters [Database] The requested database resource state.
280
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
281
+ # will be added to the HTTP request.
282
+ #
283
+ # @return [Database] operation results.
284
+ #
285
+ def create_or_update(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
286
+ response = create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers).value!
287
+ response.body unless response.nil?
288
+ end
289
+
290
+ #
291
+ # @param resource_group_name [String] The name of the resource group that
292
+ # contains the resource. You can obtain this value from the Azure Resource
293
+ # Manager API or the portal.
294
+ # @param server_name [String] The name of the server.
295
+ # @param database_name [String] The name of the database.
296
+ # @param parameters [Database] The requested database resource state.
297
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
298
+ # will be added to the HTTP request.
299
+ #
300
+ # @return [Concurrent::Promise] promise which provides async access to http
301
+ # response.
302
+ #
303
+ def create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
304
+ # Send request
305
+ promise = begin_create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers)
306
+
307
+ promise = promise.then do |response|
308
+ # Defining deserialization method.
309
+ deserialize_method = lambda do |parsed_response|
310
+ result_mapper = Azure::SQL::Mgmt::V2017_10_01_preview::Models::Database.mapper()
311
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
312
+ end
313
+
314
+ # Waiting for response.
315
+ @client.get_long_running_operation_result(response, deserialize_method)
316
+ end
317
+
318
+ promise
319
+ end
320
+
321
+ #
322
+ # Deletes the database.
323
+ #
324
+ # @param resource_group_name [String] The name of the resource group that
325
+ # contains the resource. You can obtain this value from the Azure Resource
326
+ # Manager API or the portal.
327
+ # @param server_name [String] The name of the server.
328
+ # @param database_name [String] The name of the database.
329
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
330
+ # will be added to the HTTP request.
331
+ #
332
+ def delete(resource_group_name, server_name, database_name, custom_headers:nil)
333
+ response = delete_async(resource_group_name, server_name, database_name, custom_headers:custom_headers).value!
334
+ nil
335
+ end
336
+
337
+ #
338
+ # @param resource_group_name [String] The name of the resource group that
339
+ # contains the resource. You can obtain this value from the Azure Resource
340
+ # Manager API or the portal.
341
+ # @param server_name [String] The name of the server.
342
+ # @param database_name [String] The name of the database.
343
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
344
+ # will be added to the HTTP request.
345
+ #
346
+ # @return [Concurrent::Promise] promise which provides async access to http
347
+ # response.
348
+ #
349
+ def delete_async(resource_group_name, server_name, database_name, custom_headers:nil)
350
+ # Send request
351
+ promise = begin_delete_async(resource_group_name, server_name, database_name, custom_headers:custom_headers)
352
+
353
+ promise = promise.then do |response|
354
+ # Defining deserialization method.
355
+ deserialize_method = lambda do |parsed_response|
356
+ end
357
+
358
+ # Waiting for response.
359
+ @client.get_long_running_operation_result(response, deserialize_method)
360
+ end
361
+
362
+ promise
363
+ end
364
+
365
+ #
366
+ # Updates an existing database.
367
+ #
368
+ # @param resource_group_name [String] The name of the resource group that
369
+ # contains the resource. You can obtain this value from the Azure Resource
370
+ # Manager API or the portal.
371
+ # @param server_name [String] The name of the server.
372
+ # @param database_name [String] The name of the database.
373
+ # @param parameters [DatabaseUpdate] The requested database resource state.
374
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
375
+ # will be added to the HTTP request.
376
+ #
377
+ # @return [Database] operation results.
378
+ #
379
+ def update(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
380
+ response = update_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers).value!
381
+ response.body unless response.nil?
382
+ end
383
+
384
+ #
385
+ # @param resource_group_name [String] The name of the resource group that
386
+ # contains the resource. You can obtain this value from the Azure Resource
387
+ # Manager API or the portal.
388
+ # @param server_name [String] The name of the server.
389
+ # @param database_name [String] The name of the database.
390
+ # @param parameters [DatabaseUpdate] The requested database resource state.
391
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
392
+ # will be added to the HTTP request.
393
+ #
394
+ # @return [Concurrent::Promise] promise which provides async access to http
395
+ # response.
396
+ #
397
+ def update_async(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
398
+ # Send request
399
+ promise = begin_update_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers)
400
+
401
+ promise = promise.then do |response|
402
+ # Defining deserialization method.
403
+ deserialize_method = lambda do |parsed_response|
404
+ result_mapper = Azure::SQL::Mgmt::V2017_10_01_preview::Models::Database.mapper()
405
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
406
+ end
407
+
408
+ # Waiting for response.
409
+ @client.get_long_running_operation_result(response, deserialize_method)
410
+ end
411
+
412
+ promise
413
+ end
414
+
415
+ #
416
+ # Gets a list of databases in an elastic pool.
417
+ #
418
+ # @param resource_group_name [String] The name of the resource group that
419
+ # contains the resource. You can obtain this value from the Azure Resource
420
+ # Manager API or the portal.
421
+ # @param server_name [String] The name of the server.
422
+ # @param elastic_pool_name [String] The name of the elastic pool.
423
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
424
+ # will be added to the HTTP request.
425
+ #
426
+ # @return [Array<Database>] operation results.
427
+ #
428
+ def list_by_elastic_pool(resource_group_name, server_name, elastic_pool_name, custom_headers:nil)
429
+ first_page = list_by_elastic_pool_as_lazy(resource_group_name, server_name, elastic_pool_name, custom_headers:custom_headers)
430
+ first_page.get_all_items
431
+ end
432
+
433
+ #
434
+ # Gets a list of databases in an elastic pool.
435
+ #
436
+ # @param resource_group_name [String] The name of the resource group that
437
+ # contains the resource. You can obtain this value from the Azure Resource
438
+ # Manager API or the portal.
439
+ # @param server_name [String] The name of the server.
440
+ # @param elastic_pool_name [String] The name of the elastic pool.
441
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
442
+ # will be added to the HTTP request.
443
+ #
444
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
445
+ #
446
+ def list_by_elastic_pool_with_http_info(resource_group_name, server_name, elastic_pool_name, custom_headers:nil)
447
+ list_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, custom_headers:custom_headers).value!
448
+ end
449
+
450
+ #
451
+ # Gets a list of databases in an elastic pool.
452
+ #
453
+ # @param resource_group_name [String] The name of the resource group that
454
+ # contains the resource. You can obtain this value from the Azure Resource
455
+ # Manager API or the portal.
456
+ # @param server_name [String] The name of the server.
457
+ # @param elastic_pool_name [String] The name of the elastic pool.
458
+ # @param [Hash{String => String}] A hash of custom headers that will be added
459
+ # to the HTTP request.
460
+ #
461
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
462
+ #
463
+ def list_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, custom_headers:nil)
464
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
465
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
466
+ fail ArgumentError, 'elastic_pool_name is nil' if elastic_pool_name.nil?
467
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
468
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
469
+
470
+
471
+ request_headers = {}
472
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
473
+
474
+ # Set Headers
475
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
476
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
477
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases'
478
+
479
+ request_url = @base_url || @client.base_url
480
+
481
+ options = {
482
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
483
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'elasticPoolName' => elastic_pool_name,'subscriptionId' => @client.subscription_id},
484
+ query_params: {'api-version' => @client.api_version},
485
+ headers: request_headers.merge(custom_headers || {}),
486
+ base_url: request_url
487
+ }
488
+ promise = @client.make_request_async(:get, path_template, options)
489
+
490
+ promise = promise.then do |result|
491
+ http_response = result.response
492
+ status_code = http_response.status
493
+ response_content = http_response.body
494
+ unless status_code == 200
495
+ error_model = JSON.load(response_content)
496
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
497
+ end
498
+
499
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
500
+ # Deserialize Response
501
+ if status_code == 200
502
+ begin
503
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
504
+ result_mapper = Azure::SQL::Mgmt::V2017_10_01_preview::Models::DatabaseListResult.mapper()
505
+ result.body = @client.deserialize(result_mapper, parsed_response)
506
+ rescue Exception => e
507
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
508
+ end
509
+ end
510
+
511
+ result
512
+ end
513
+
514
+ promise.execute
515
+ end
516
+
517
+ #
518
+ # Pauses a database.
519
+ #
520
+ # @param resource_group_name [String] The name of the resource group that
521
+ # contains the resource. You can obtain this value from the Azure Resource
522
+ # Manager API or the portal.
523
+ # @param server_name [String] The name of the server.
524
+ # @param database_name [String] The name of the database to be paused.
525
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
526
+ # will be added to the HTTP request.
527
+ #
528
+ # @return [Database] operation results.
529
+ #
530
+ def pause(resource_group_name, server_name, database_name, custom_headers:nil)
531
+ response = pause_async(resource_group_name, server_name, database_name, custom_headers:custom_headers).value!
532
+ response.body unless response.nil?
533
+ end
534
+
535
+ #
536
+ # @param resource_group_name [String] The name of the resource group that
537
+ # contains the resource. You can obtain this value from the Azure Resource
538
+ # Manager API or the portal.
539
+ # @param server_name [String] The name of the server.
540
+ # @param database_name [String] The name of the database to be paused.
541
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
542
+ # will be added to the HTTP request.
543
+ #
544
+ # @return [Concurrent::Promise] promise which provides async access to http
545
+ # response.
546
+ #
547
+ def pause_async(resource_group_name, server_name, database_name, custom_headers:nil)
548
+ # Send request
549
+ promise = begin_pause_async(resource_group_name, server_name, database_name, custom_headers:custom_headers)
550
+
551
+ promise = promise.then do |response|
552
+ # Defining deserialization method.
553
+ deserialize_method = lambda do |parsed_response|
554
+ result_mapper = Azure::SQL::Mgmt::V2017_10_01_preview::Models::Database.mapper()
555
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
556
+ end
557
+
558
+ # Waiting for response.
559
+ @client.get_long_running_operation_result(response, deserialize_method)
560
+ end
561
+
562
+ promise
563
+ end
564
+
565
+ #
566
+ # Resumes a database.
567
+ #
568
+ # @param resource_group_name [String] The name of the resource group that
569
+ # contains the resource. You can obtain this value from the Azure Resource
570
+ # Manager API or the portal.
571
+ # @param server_name [String] The name of the server.
572
+ # @param database_name [String] The name of the database to be resumed.
573
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
574
+ # will be added to the HTTP request.
575
+ #
576
+ # @return [Database] operation results.
577
+ #
578
+ def resume(resource_group_name, server_name, database_name, custom_headers:nil)
579
+ response = resume_async(resource_group_name, server_name, database_name, custom_headers:custom_headers).value!
580
+ response.body unless response.nil?
581
+ end
582
+
583
+ #
584
+ # @param resource_group_name [String] The name of the resource group that
585
+ # contains the resource. You can obtain this value from the Azure Resource
586
+ # Manager API or the portal.
587
+ # @param server_name [String] The name of the server.
588
+ # @param database_name [String] The name of the database to be resumed.
589
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
590
+ # will be added to the HTTP request.
591
+ #
592
+ # @return [Concurrent::Promise] promise which provides async access to http
593
+ # response.
594
+ #
595
+ def resume_async(resource_group_name, server_name, database_name, custom_headers:nil)
596
+ # Send request
597
+ promise = begin_resume_async(resource_group_name, server_name, database_name, custom_headers:custom_headers)
598
+
599
+ promise = promise.then do |response|
600
+ # Defining deserialization method.
601
+ deserialize_method = lambda do |parsed_response|
602
+ result_mapper = Azure::SQL::Mgmt::V2017_10_01_preview::Models::Database.mapper()
603
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
604
+ end
605
+
606
+ # Waiting for response.
607
+ @client.get_long_running_operation_result(response, deserialize_method)
608
+ end
609
+
610
+ promise
611
+ end
612
+
613
+ #
614
+ # Renames a database.
615
+ #
616
+ # @param resource_group_name [String] The name of the resource group that
617
+ # contains the resource. You can obtain this value from the Azure Resource
618
+ # Manager API or the portal.
619
+ # @param server_name [String] The name of the server.
620
+ # @param database_name [String] The name of the database to rename.
621
+ # @param parameters [ResourceMoveDefinition] The resource move definition for
622
+ # renaming this database.
623
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
624
+ # will be added to the HTTP request.
625
+ #
626
+ #
627
+ def rename(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
628
+ response = rename_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers).value!
629
+ nil
630
+ end
631
+
632
+ #
633
+ # Renames a database.
634
+ #
635
+ # @param resource_group_name [String] The name of the resource group that
636
+ # contains the resource. You can obtain this value from the Azure Resource
637
+ # Manager API or the portal.
638
+ # @param server_name [String] The name of the server.
639
+ # @param database_name [String] The name of the database to rename.
640
+ # @param parameters [ResourceMoveDefinition] The resource move definition for
641
+ # renaming this database.
642
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
643
+ # will be added to the HTTP request.
644
+ #
645
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
646
+ #
647
+ def rename_with_http_info(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
648
+ rename_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers).value!
649
+ end
650
+
651
+ #
652
+ # Renames a database.
653
+ #
654
+ # @param resource_group_name [String] The name of the resource group that
655
+ # contains the resource. You can obtain this value from the Azure Resource
656
+ # Manager API or the portal.
657
+ # @param server_name [String] The name of the server.
658
+ # @param database_name [String] The name of the database to rename.
659
+ # @param parameters [ResourceMoveDefinition] The resource move definition for
660
+ # renaming this database.
661
+ # @param [Hash{String => String}] A hash of custom headers that will be added
662
+ # to the HTTP request.
663
+ #
664
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
665
+ #
666
+ def rename_async(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
667
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
668
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
669
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
670
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
671
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
672
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
673
+
674
+
675
+ request_headers = {}
676
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
677
+
678
+ # Set Headers
679
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
680
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
681
+
682
+ # Serialize Request
683
+ request_mapper = Azure::SQL::Mgmt::V2017_10_01_preview::Models::ResourceMoveDefinition.mapper()
684
+ request_content = @client.serialize(request_mapper, parameters)
685
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
686
+
687
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/move'
688
+
689
+ request_url = @base_url || @client.base_url
690
+
691
+ options = {
692
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
693
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'subscriptionId' => @client.subscription_id},
694
+ query_params: {'api-version' => @client.api_version},
695
+ body: request_content,
696
+ headers: request_headers.merge(custom_headers || {}),
697
+ base_url: request_url
698
+ }
699
+ promise = @client.make_request_async(:post, path_template, options)
700
+
701
+ promise = promise.then do |result|
702
+ http_response = result.response
703
+ status_code = http_response.status
704
+ response_content = http_response.body
705
+ unless status_code == 200
706
+ error_model = JSON.load(response_content)
707
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
708
+ end
709
+
710
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
711
+
712
+ result
713
+ end
714
+
715
+ promise.execute
716
+ end
717
+
718
+ #
719
+ # Upgrades a data warehouse.
720
+ #
721
+ # @param resource_group_name [String] The name of the resource group that
722
+ # contains the resource. You can obtain this value from the Azure Resource
723
+ # Manager API or the portal.
724
+ # @param server_name [String] The name of the server.
725
+ # @param database_name [String] The name of the database to be upgraded.
726
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
727
+ # will be added to the HTTP request.
728
+ #
729
+ #
730
+ def begin_upgrade_data_warehouse(resource_group_name, server_name, database_name, custom_headers:nil)
731
+ response = begin_upgrade_data_warehouse_async(resource_group_name, server_name, database_name, custom_headers:custom_headers).value!
732
+ nil
733
+ end
734
+
735
+ #
736
+ # Upgrades a data warehouse.
737
+ #
738
+ # @param resource_group_name [String] The name of the resource group that
739
+ # contains the resource. You can obtain this value from the Azure Resource
740
+ # Manager API or the portal.
741
+ # @param server_name [String] The name of the server.
742
+ # @param database_name [String] The name of the database to be upgraded.
743
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
744
+ # will be added to the HTTP request.
745
+ #
746
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
747
+ #
748
+ def begin_upgrade_data_warehouse_with_http_info(resource_group_name, server_name, database_name, custom_headers:nil)
749
+ begin_upgrade_data_warehouse_async(resource_group_name, server_name, database_name, custom_headers:custom_headers).value!
750
+ end
751
+
752
+ #
753
+ # Upgrades a data warehouse.
754
+ #
755
+ # @param resource_group_name [String] The name of the resource group that
756
+ # contains the resource. You can obtain this value from the Azure Resource
757
+ # Manager API or the portal.
758
+ # @param server_name [String] The name of the server.
759
+ # @param database_name [String] The name of the database to be upgraded.
760
+ # @param [Hash{String => String}] A hash of custom headers that will be added
761
+ # to the HTTP request.
762
+ #
763
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
764
+ #
765
+ def begin_upgrade_data_warehouse_async(resource_group_name, server_name, database_name, custom_headers:nil)
766
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
767
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
768
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
769
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
770
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
771
+
772
+
773
+ request_headers = {}
774
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
775
+
776
+ # Set Headers
777
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
778
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
779
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/upgradeDataWarehouse'
780
+
781
+ request_url = @base_url || @client.base_url
782
+
783
+ options = {
784
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
785
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'subscriptionId' => @client.subscription_id},
786
+ query_params: {'api-version' => @client.api_version},
787
+ headers: request_headers.merge(custom_headers || {}),
788
+ base_url: request_url
789
+ }
790
+ promise = @client.make_request_async(:post, path_template, options)
791
+
792
+ promise = promise.then do |result|
793
+ http_response = result.response
794
+ status_code = http_response.status
795
+ response_content = http_response.body
796
+ unless status_code == 200 || status_code == 202
797
+ error_model = JSON.load(response_content)
798
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
799
+ end
800
+
801
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
802
+
803
+ result
804
+ end
805
+
806
+ promise.execute
807
+ end
808
+
809
+ #
810
+ # Creates a new database or updates an existing database.
811
+ #
812
+ # @param resource_group_name [String] The name of the resource group that
813
+ # contains the resource. You can obtain this value from the Azure Resource
814
+ # Manager API or the portal.
815
+ # @param server_name [String] The name of the server.
816
+ # @param database_name [String] The name of the database.
817
+ # @param parameters [Database] The requested database resource state.
818
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
819
+ # will be added to the HTTP request.
820
+ #
821
+ # @return [Database] operation results.
822
+ #
823
+ def begin_create_or_update(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
824
+ response = begin_create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers).value!
825
+ response.body unless response.nil?
826
+ end
827
+
828
+ #
829
+ # Creates a new database or updates an existing database.
830
+ #
831
+ # @param resource_group_name [String] The name of the resource group that
832
+ # contains the resource. You can obtain this value from the Azure Resource
833
+ # Manager API or the portal.
834
+ # @param server_name [String] The name of the server.
835
+ # @param database_name [String] The name of the database.
836
+ # @param parameters [Database] The requested database resource state.
837
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
838
+ # will be added to the HTTP request.
839
+ #
840
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
841
+ #
842
+ def begin_create_or_update_with_http_info(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
843
+ begin_create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers).value!
844
+ end
845
+
846
+ #
847
+ # Creates a new database or updates an existing database.
848
+ #
849
+ # @param resource_group_name [String] The name of the resource group that
850
+ # contains the resource. You can obtain this value from the Azure Resource
851
+ # Manager API or the portal.
852
+ # @param server_name [String] The name of the server.
853
+ # @param database_name [String] The name of the database.
854
+ # @param parameters [Database] The requested database resource state.
855
+ # @param [Hash{String => String}] A hash of custom headers that will be added
856
+ # to the HTTP request.
857
+ #
858
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
859
+ #
860
+ def begin_create_or_update_async(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
861
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
862
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
863
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
864
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
865
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
866
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
867
+
868
+
869
+ request_headers = {}
870
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
871
+
872
+ # Set Headers
873
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
874
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
875
+
876
+ # Serialize Request
877
+ request_mapper = Azure::SQL::Mgmt::V2017_10_01_preview::Models::Database.mapper()
878
+ request_content = @client.serialize(request_mapper, parameters)
879
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
880
+
881
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'
882
+
883
+ request_url = @base_url || @client.base_url
884
+
885
+ options = {
886
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
887
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'subscriptionId' => @client.subscription_id},
888
+ query_params: {'api-version' => @client.api_version},
889
+ body: request_content,
890
+ headers: request_headers.merge(custom_headers || {}),
891
+ base_url: request_url
892
+ }
893
+ promise = @client.make_request_async(:put, path_template, options)
894
+
895
+ promise = promise.then do |result|
896
+ http_response = result.response
897
+ status_code = http_response.status
898
+ response_content = http_response.body
899
+ unless status_code == 200 || status_code == 202 || status_code == 201
900
+ error_model = JSON.load(response_content)
901
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
902
+ end
903
+
904
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
905
+ # Deserialize Response
906
+ if status_code == 200
907
+ begin
908
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
909
+ result_mapper = Azure::SQL::Mgmt::V2017_10_01_preview::Models::Database.mapper()
910
+ result.body = @client.deserialize(result_mapper, parsed_response)
911
+ rescue Exception => e
912
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
913
+ end
914
+ end
915
+ # Deserialize Response
916
+ if status_code == 201
917
+ begin
918
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
919
+ result_mapper = Azure::SQL::Mgmt::V2017_10_01_preview::Models::Database.mapper()
920
+ result.body = @client.deserialize(result_mapper, parsed_response)
921
+ rescue Exception => e
922
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
923
+ end
924
+ end
925
+
926
+ result
927
+ end
928
+
929
+ promise.execute
930
+ end
931
+
932
+ #
933
+ # Deletes the database.
934
+ #
935
+ # @param resource_group_name [String] The name of the resource group that
936
+ # contains the resource. You can obtain this value from the Azure Resource
937
+ # Manager API or the portal.
938
+ # @param server_name [String] The name of the server.
939
+ # @param database_name [String] The name of the database.
940
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
941
+ # will be added to the HTTP request.
942
+ #
943
+ #
944
+ def begin_delete(resource_group_name, server_name, database_name, custom_headers:nil)
945
+ response = begin_delete_async(resource_group_name, server_name, database_name, custom_headers:custom_headers).value!
946
+ nil
947
+ end
948
+
949
+ #
950
+ # Deletes the database.
951
+ #
952
+ # @param resource_group_name [String] The name of the resource group that
953
+ # contains the resource. You can obtain this value from the Azure Resource
954
+ # Manager API or the portal.
955
+ # @param server_name [String] The name of the server.
956
+ # @param database_name [String] The name of the database.
957
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
958
+ # will be added to the HTTP request.
959
+ #
960
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
961
+ #
962
+ def begin_delete_with_http_info(resource_group_name, server_name, database_name, custom_headers:nil)
963
+ begin_delete_async(resource_group_name, server_name, database_name, custom_headers:custom_headers).value!
964
+ end
965
+
966
+ #
967
+ # Deletes the database.
968
+ #
969
+ # @param resource_group_name [String] The name of the resource group that
970
+ # contains the resource. You can obtain this value from the Azure Resource
971
+ # Manager API or the portal.
972
+ # @param server_name [String] The name of the server.
973
+ # @param database_name [String] The name of the database.
974
+ # @param [Hash{String => String}] A hash of custom headers that will be added
975
+ # to the HTTP request.
976
+ #
977
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
978
+ #
979
+ def begin_delete_async(resource_group_name, server_name, database_name, custom_headers:nil)
980
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
981
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
982
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
983
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
984
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
985
+
986
+
987
+ request_headers = {}
988
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
989
+
990
+ # Set Headers
991
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
992
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
993
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'
994
+
995
+ request_url = @base_url || @client.base_url
996
+
997
+ options = {
998
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
999
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'subscriptionId' => @client.subscription_id},
1000
+ query_params: {'api-version' => @client.api_version},
1001
+ headers: request_headers.merge(custom_headers || {}),
1002
+ base_url: request_url
1003
+ }
1004
+ promise = @client.make_request_async(:delete, path_template, options)
1005
+
1006
+ promise = promise.then do |result|
1007
+ http_response = result.response
1008
+ status_code = http_response.status
1009
+ response_content = http_response.body
1010
+ unless status_code == 200 || status_code == 202 || status_code == 204
1011
+ error_model = JSON.load(response_content)
1012
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1013
+ end
1014
+
1015
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1016
+
1017
+ result
1018
+ end
1019
+
1020
+ promise.execute
1021
+ end
1022
+
1023
+ #
1024
+ # Updates an existing database.
1025
+ #
1026
+ # @param resource_group_name [String] The name of the resource group that
1027
+ # contains the resource. You can obtain this value from the Azure Resource
1028
+ # Manager API or the portal.
1029
+ # @param server_name [String] The name of the server.
1030
+ # @param database_name [String] The name of the database.
1031
+ # @param parameters [DatabaseUpdate] The requested database resource state.
1032
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1033
+ # will be added to the HTTP request.
1034
+ #
1035
+ # @return [Database] operation results.
1036
+ #
1037
+ def begin_update(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
1038
+ response = begin_update_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers).value!
1039
+ response.body unless response.nil?
1040
+ end
1041
+
1042
+ #
1043
+ # Updates an existing database.
1044
+ #
1045
+ # @param resource_group_name [String] The name of the resource group that
1046
+ # contains the resource. You can obtain this value from the Azure Resource
1047
+ # Manager API or the portal.
1048
+ # @param server_name [String] The name of the server.
1049
+ # @param database_name [String] The name of the database.
1050
+ # @param parameters [DatabaseUpdate] The requested database resource state.
1051
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1052
+ # will be added to the HTTP request.
1053
+ #
1054
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1055
+ #
1056
+ def begin_update_with_http_info(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
1057
+ begin_update_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers).value!
1058
+ end
1059
+
1060
+ #
1061
+ # Updates an existing database.
1062
+ #
1063
+ # @param resource_group_name [String] The name of the resource group that
1064
+ # contains the resource. You can obtain this value from the Azure Resource
1065
+ # Manager API or the portal.
1066
+ # @param server_name [String] The name of the server.
1067
+ # @param database_name [String] The name of the database.
1068
+ # @param parameters [DatabaseUpdate] The requested database resource state.
1069
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1070
+ # to the HTTP request.
1071
+ #
1072
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1073
+ #
1074
+ def begin_update_async(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
1075
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1076
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
1077
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
1078
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1079
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1080
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1081
+
1082
+
1083
+ request_headers = {}
1084
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1085
+
1086
+ # Set Headers
1087
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1088
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1089
+
1090
+ # Serialize Request
1091
+ request_mapper = Azure::SQL::Mgmt::V2017_10_01_preview::Models::DatabaseUpdate.mapper()
1092
+ request_content = @client.serialize(request_mapper, parameters)
1093
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1094
+
1095
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'
1096
+
1097
+ request_url = @base_url || @client.base_url
1098
+
1099
+ options = {
1100
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1101
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'subscriptionId' => @client.subscription_id},
1102
+ query_params: {'api-version' => @client.api_version},
1103
+ body: request_content,
1104
+ headers: request_headers.merge(custom_headers || {}),
1105
+ base_url: request_url
1106
+ }
1107
+ promise = @client.make_request_async(:patch, path_template, options)
1108
+
1109
+ promise = promise.then do |result|
1110
+ http_response = result.response
1111
+ status_code = http_response.status
1112
+ response_content = http_response.body
1113
+ unless status_code == 200 || status_code == 202
1114
+ error_model = JSON.load(response_content)
1115
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1116
+ end
1117
+
1118
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1119
+ # Deserialize Response
1120
+ if status_code == 200
1121
+ begin
1122
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1123
+ result_mapper = Azure::SQL::Mgmt::V2017_10_01_preview::Models::Database.mapper()
1124
+ result.body = @client.deserialize(result_mapper, parsed_response)
1125
+ rescue Exception => e
1126
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1127
+ end
1128
+ end
1129
+
1130
+ result
1131
+ end
1132
+
1133
+ promise.execute
1134
+ end
1135
+
1136
+ #
1137
+ # Pauses a database.
1138
+ #
1139
+ # @param resource_group_name [String] The name of the resource group that
1140
+ # contains the resource. You can obtain this value from the Azure Resource
1141
+ # Manager API or the portal.
1142
+ # @param server_name [String] The name of the server.
1143
+ # @param database_name [String] The name of the database to be paused.
1144
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1145
+ # will be added to the HTTP request.
1146
+ #
1147
+ # @return [Database] operation results.
1148
+ #
1149
+ def begin_pause(resource_group_name, server_name, database_name, custom_headers:nil)
1150
+ response = begin_pause_async(resource_group_name, server_name, database_name, custom_headers:custom_headers).value!
1151
+ response.body unless response.nil?
1152
+ end
1153
+
1154
+ #
1155
+ # Pauses a database.
1156
+ #
1157
+ # @param resource_group_name [String] The name of the resource group that
1158
+ # contains the resource. You can obtain this value from the Azure Resource
1159
+ # Manager API or the portal.
1160
+ # @param server_name [String] The name of the server.
1161
+ # @param database_name [String] The name of the database to be paused.
1162
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1163
+ # will be added to the HTTP request.
1164
+ #
1165
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1166
+ #
1167
+ def begin_pause_with_http_info(resource_group_name, server_name, database_name, custom_headers:nil)
1168
+ begin_pause_async(resource_group_name, server_name, database_name, custom_headers:custom_headers).value!
1169
+ end
1170
+
1171
+ #
1172
+ # Pauses a database.
1173
+ #
1174
+ # @param resource_group_name [String] The name of the resource group that
1175
+ # contains the resource. You can obtain this value from the Azure Resource
1176
+ # Manager API or the portal.
1177
+ # @param server_name [String] The name of the server.
1178
+ # @param database_name [String] The name of the database to be paused.
1179
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1180
+ # to the HTTP request.
1181
+ #
1182
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1183
+ #
1184
+ def begin_pause_async(resource_group_name, server_name, database_name, custom_headers:nil)
1185
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1186
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
1187
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
1188
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1189
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1190
+
1191
+
1192
+ request_headers = {}
1193
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1194
+
1195
+ # Set Headers
1196
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1197
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1198
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause'
1199
+
1200
+ request_url = @base_url || @client.base_url
1201
+
1202
+ options = {
1203
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1204
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'subscriptionId' => @client.subscription_id},
1205
+ query_params: {'api-version' => @client.api_version},
1206
+ headers: request_headers.merge(custom_headers || {}),
1207
+ base_url: request_url
1208
+ }
1209
+ promise = @client.make_request_async(:post, path_template, options)
1210
+
1211
+ promise = promise.then do |result|
1212
+ http_response = result.response
1213
+ status_code = http_response.status
1214
+ response_content = http_response.body
1215
+ unless status_code == 200 || status_code == 202
1216
+ error_model = JSON.load(response_content)
1217
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1218
+ end
1219
+
1220
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1221
+ # Deserialize Response
1222
+ if status_code == 200
1223
+ begin
1224
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1225
+ result_mapper = Azure::SQL::Mgmt::V2017_10_01_preview::Models::Database.mapper()
1226
+ result.body = @client.deserialize(result_mapper, parsed_response)
1227
+ rescue Exception => e
1228
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1229
+ end
1230
+ end
1231
+
1232
+ result
1233
+ end
1234
+
1235
+ promise.execute
1236
+ end
1237
+
1238
+ #
1239
+ # Resumes a database.
1240
+ #
1241
+ # @param resource_group_name [String] The name of the resource group that
1242
+ # contains the resource. You can obtain this value from the Azure Resource
1243
+ # Manager API or the portal.
1244
+ # @param server_name [String] The name of the server.
1245
+ # @param database_name [String] The name of the database to be resumed.
1246
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1247
+ # will be added to the HTTP request.
1248
+ #
1249
+ # @return [Database] operation results.
1250
+ #
1251
+ def begin_resume(resource_group_name, server_name, database_name, custom_headers:nil)
1252
+ response = begin_resume_async(resource_group_name, server_name, database_name, custom_headers:custom_headers).value!
1253
+ response.body unless response.nil?
1254
+ end
1255
+
1256
+ #
1257
+ # Resumes a database.
1258
+ #
1259
+ # @param resource_group_name [String] The name of the resource group that
1260
+ # contains the resource. You can obtain this value from the Azure Resource
1261
+ # Manager API or the portal.
1262
+ # @param server_name [String] The name of the server.
1263
+ # @param database_name [String] The name of the database to be resumed.
1264
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1265
+ # will be added to the HTTP request.
1266
+ #
1267
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1268
+ #
1269
+ def begin_resume_with_http_info(resource_group_name, server_name, database_name, custom_headers:nil)
1270
+ begin_resume_async(resource_group_name, server_name, database_name, custom_headers:custom_headers).value!
1271
+ end
1272
+
1273
+ #
1274
+ # Resumes a database.
1275
+ #
1276
+ # @param resource_group_name [String] The name of the resource group that
1277
+ # contains the resource. You can obtain this value from the Azure Resource
1278
+ # Manager API or the portal.
1279
+ # @param server_name [String] The name of the server.
1280
+ # @param database_name [String] The name of the database to be resumed.
1281
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1282
+ # to the HTTP request.
1283
+ #
1284
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1285
+ #
1286
+ def begin_resume_async(resource_group_name, server_name, database_name, custom_headers:nil)
1287
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1288
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
1289
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
1290
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1291
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1292
+
1293
+
1294
+ request_headers = {}
1295
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1296
+
1297
+ # Set Headers
1298
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1299
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1300
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume'
1301
+
1302
+ request_url = @base_url || @client.base_url
1303
+
1304
+ options = {
1305
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1306
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'subscriptionId' => @client.subscription_id},
1307
+ query_params: {'api-version' => @client.api_version},
1308
+ headers: request_headers.merge(custom_headers || {}),
1309
+ base_url: request_url
1310
+ }
1311
+ promise = @client.make_request_async(:post, path_template, options)
1312
+
1313
+ promise = promise.then do |result|
1314
+ http_response = result.response
1315
+ status_code = http_response.status
1316
+ response_content = http_response.body
1317
+ unless status_code == 200 || status_code == 202
1318
+ error_model = JSON.load(response_content)
1319
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1320
+ end
1321
+
1322
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1323
+ # Deserialize Response
1324
+ if status_code == 200
1325
+ begin
1326
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1327
+ result_mapper = Azure::SQL::Mgmt::V2017_10_01_preview::Models::Database.mapper()
1328
+ result.body = @client.deserialize(result_mapper, parsed_response)
1329
+ rescue Exception => e
1330
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1331
+ end
1332
+ end
1333
+
1334
+ result
1335
+ end
1336
+
1337
+ promise.execute
1338
+ end
1339
+
1340
+ #
1341
+ # Gets a list of databases.
1342
+ #
1343
+ # @param next_page_link [String] The NextLink from the previous successful call
1344
+ # to List operation.
1345
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1346
+ # will be added to the HTTP request.
1347
+ #
1348
+ # @return [DatabaseListResult] operation results.
1349
+ #
1350
+ def list_by_server_next(next_page_link, custom_headers:nil)
1351
+ response = list_by_server_next_async(next_page_link, custom_headers:custom_headers).value!
1352
+ response.body unless response.nil?
1353
+ end
1354
+
1355
+ #
1356
+ # Gets a list of databases.
1357
+ #
1358
+ # @param next_page_link [String] The NextLink from the previous successful call
1359
+ # to List operation.
1360
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1361
+ # will be added to the HTTP request.
1362
+ #
1363
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1364
+ #
1365
+ def list_by_server_next_with_http_info(next_page_link, custom_headers:nil)
1366
+ list_by_server_next_async(next_page_link, custom_headers:custom_headers).value!
1367
+ end
1368
+
1369
+ #
1370
+ # Gets a list of databases.
1371
+ #
1372
+ # @param next_page_link [String] The NextLink from the previous successful call
1373
+ # to List operation.
1374
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1375
+ # to the HTTP request.
1376
+ #
1377
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1378
+ #
1379
+ def list_by_server_next_async(next_page_link, custom_headers:nil)
1380
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1381
+
1382
+
1383
+ request_headers = {}
1384
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1385
+
1386
+ # Set Headers
1387
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1388
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1389
+ path_template = '{nextLink}'
1390
+
1391
+ request_url = @base_url || @client.base_url
1392
+
1393
+ options = {
1394
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1395
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1396
+ headers: request_headers.merge(custom_headers || {}),
1397
+ base_url: request_url
1398
+ }
1399
+ promise = @client.make_request_async(:get, path_template, options)
1400
+
1401
+ promise = promise.then do |result|
1402
+ http_response = result.response
1403
+ status_code = http_response.status
1404
+ response_content = http_response.body
1405
+ unless status_code == 200
1406
+ error_model = JSON.load(response_content)
1407
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1408
+ end
1409
+
1410
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1411
+ # Deserialize Response
1412
+ if status_code == 200
1413
+ begin
1414
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1415
+ result_mapper = Azure::SQL::Mgmt::V2017_10_01_preview::Models::DatabaseListResult.mapper()
1416
+ result.body = @client.deserialize(result_mapper, parsed_response)
1417
+ rescue Exception => e
1418
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1419
+ end
1420
+ end
1421
+
1422
+ result
1423
+ end
1424
+
1425
+ promise.execute
1426
+ end
1427
+
1428
+ #
1429
+ # Gets a list of databases in an elastic pool.
1430
+ #
1431
+ # @param next_page_link [String] The NextLink from the previous successful call
1432
+ # to List operation.
1433
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1434
+ # will be added to the HTTP request.
1435
+ #
1436
+ # @return [DatabaseListResult] operation results.
1437
+ #
1438
+ def list_by_elastic_pool_next(next_page_link, custom_headers:nil)
1439
+ response = list_by_elastic_pool_next_async(next_page_link, custom_headers:custom_headers).value!
1440
+ response.body unless response.nil?
1441
+ end
1442
+
1443
+ #
1444
+ # Gets a list of databases in an elastic pool.
1445
+ #
1446
+ # @param next_page_link [String] The NextLink from the previous successful call
1447
+ # to List operation.
1448
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1449
+ # will be added to the HTTP request.
1450
+ #
1451
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1452
+ #
1453
+ def list_by_elastic_pool_next_with_http_info(next_page_link, custom_headers:nil)
1454
+ list_by_elastic_pool_next_async(next_page_link, custom_headers:custom_headers).value!
1455
+ end
1456
+
1457
+ #
1458
+ # Gets a list of databases in an elastic pool.
1459
+ #
1460
+ # @param next_page_link [String] The NextLink from the previous successful call
1461
+ # to List operation.
1462
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1463
+ # to the HTTP request.
1464
+ #
1465
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1466
+ #
1467
+ def list_by_elastic_pool_next_async(next_page_link, custom_headers:nil)
1468
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1469
+
1470
+
1471
+ request_headers = {}
1472
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1473
+
1474
+ # Set Headers
1475
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1476
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1477
+ path_template = '{nextLink}'
1478
+
1479
+ request_url = @base_url || @client.base_url
1480
+
1481
+ options = {
1482
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1483
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1484
+ headers: request_headers.merge(custom_headers || {}),
1485
+ base_url: request_url
1486
+ }
1487
+ promise = @client.make_request_async(:get, path_template, options)
1488
+
1489
+ promise = promise.then do |result|
1490
+ http_response = result.response
1491
+ status_code = http_response.status
1492
+ response_content = http_response.body
1493
+ unless status_code == 200
1494
+ error_model = JSON.load(response_content)
1495
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1496
+ end
1497
+
1498
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1499
+ # Deserialize Response
1500
+ if status_code == 200
1501
+ begin
1502
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1503
+ result_mapper = Azure::SQL::Mgmt::V2017_10_01_preview::Models::DatabaseListResult.mapper()
1504
+ result.body = @client.deserialize(result_mapper, parsed_response)
1505
+ rescue Exception => e
1506
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1507
+ end
1508
+ end
1509
+
1510
+ result
1511
+ end
1512
+
1513
+ promise.execute
1514
+ end
1515
+
1516
+ #
1517
+ # Gets a list of databases.
1518
+ #
1519
+ # @param resource_group_name [String] The name of the resource group that
1520
+ # contains the resource. You can obtain this value from the Azure Resource
1521
+ # Manager API or the portal.
1522
+ # @param server_name [String] The name of the server.
1523
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1524
+ # will be added to the HTTP request.
1525
+ #
1526
+ # @return [DatabaseListResult] which provide lazy access to pages of the
1527
+ # response.
1528
+ #
1529
+ def list_by_server_as_lazy(resource_group_name, server_name, custom_headers:nil)
1530
+ response = list_by_server_async(resource_group_name, server_name, custom_headers:custom_headers).value!
1531
+ unless response.nil?
1532
+ page = response.body
1533
+ page.next_method = Proc.new do |next_page_link|
1534
+ list_by_server_next_async(next_page_link, custom_headers:custom_headers)
1535
+ end
1536
+ page
1537
+ end
1538
+ end
1539
+
1540
+ #
1541
+ # Gets a list of databases in an elastic pool.
1542
+ #
1543
+ # @param resource_group_name [String] The name of the resource group that
1544
+ # contains the resource. You can obtain this value from the Azure Resource
1545
+ # Manager API or the portal.
1546
+ # @param server_name [String] The name of the server.
1547
+ # @param elastic_pool_name [String] The name of the elastic pool.
1548
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1549
+ # will be added to the HTTP request.
1550
+ #
1551
+ # @return [DatabaseListResult] which provide lazy access to pages of the
1552
+ # response.
1553
+ #
1554
+ def list_by_elastic_pool_as_lazy(resource_group_name, server_name, elastic_pool_name, custom_headers:nil)
1555
+ response = list_by_elastic_pool_async(resource_group_name, server_name, elastic_pool_name, custom_headers:custom_headers).value!
1556
+ unless response.nil?
1557
+ page = response.body
1558
+ page.next_method = Proc.new do |next_page_link|
1559
+ list_by_elastic_pool_next_async(next_page_link, custom_headers:custom_headers)
1560
+ end
1561
+ page
1562
+ end
1563
+ end
1564
+
1565
+ end
1566
+ end