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,963 @@
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_03_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 ManagedDatabases
14
+ include MsRestAzure
15
+
16
+ #
17
+ # Creates and initializes a new instance of the ManagedDatabases 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
+ # Completes the restore operation on a managed database.
29
+ #
30
+ # @param location_name [String] The name of the region where the resource is
31
+ # located.
32
+ # @param operation_id Management operation id that this request tries to
33
+ # complete.
34
+ # @param parameters [CompleteDatabaseRestoreDefinition] The definition for
35
+ # completing the restore of this managed database.
36
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
37
+ # will be added to the HTTP request.
38
+ #
39
+ def complete_restore(location_name, operation_id, parameters, custom_headers:nil)
40
+ response = complete_restore_async(location_name, operation_id, parameters, custom_headers:custom_headers).value!
41
+ nil
42
+ end
43
+
44
+ #
45
+ # @param location_name [String] The name of the region where the resource is
46
+ # located.
47
+ # @param operation_id Management operation id that this request tries to
48
+ # complete.
49
+ # @param parameters [CompleteDatabaseRestoreDefinition] The definition for
50
+ # completing the restore of this managed database.
51
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
52
+ # will be added to the HTTP request.
53
+ #
54
+ # @return [Concurrent::Promise] promise which provides async access to http
55
+ # response.
56
+ #
57
+ def complete_restore_async(location_name, operation_id, parameters, custom_headers:nil)
58
+ # Send request
59
+ promise = begin_complete_restore_async(location_name, operation_id, parameters, custom_headers:custom_headers)
60
+
61
+ promise = promise.then do |response|
62
+ # Defining deserialization method.
63
+ deserialize_method = lambda do |parsed_response|
64
+ end
65
+
66
+ # Waiting for response.
67
+ @client.get_long_running_operation_result(response, deserialize_method)
68
+ end
69
+
70
+ promise
71
+ end
72
+
73
+ #
74
+ # Gets a list of managed databases.
75
+ #
76
+ # @param resource_group_name [String] The name of the resource group that
77
+ # contains the resource. You can obtain this value from the Azure Resource
78
+ # Manager API or the portal.
79
+ # @param managed_instance_name [String] The name of the managed instance.
80
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
81
+ # will be added to the HTTP request.
82
+ #
83
+ # @return [Array<ManagedDatabase>] operation results.
84
+ #
85
+ def list_by_instance(resource_group_name, managed_instance_name, custom_headers:nil)
86
+ first_page = list_by_instance_as_lazy(resource_group_name, managed_instance_name, custom_headers:custom_headers)
87
+ first_page.get_all_items
88
+ end
89
+
90
+ #
91
+ # Gets a list of managed databases.
92
+ #
93
+ # @param resource_group_name [String] The name of the resource group that
94
+ # contains the resource. You can obtain this value from the Azure Resource
95
+ # Manager API or the portal.
96
+ # @param managed_instance_name [String] The name of the managed instance.
97
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
98
+ # will be added to the HTTP request.
99
+ #
100
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
101
+ #
102
+ def list_by_instance_with_http_info(resource_group_name, managed_instance_name, custom_headers:nil)
103
+ list_by_instance_async(resource_group_name, managed_instance_name, custom_headers:custom_headers).value!
104
+ end
105
+
106
+ #
107
+ # Gets a list of managed databases.
108
+ #
109
+ # @param resource_group_name [String] The name of the resource group that
110
+ # contains the resource. You can obtain this value from the Azure Resource
111
+ # Manager API or the portal.
112
+ # @param managed_instance_name [String] The name of the managed instance.
113
+ # @param [Hash{String => String}] A hash of custom headers that will be added
114
+ # to the HTTP request.
115
+ #
116
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
117
+ #
118
+ def list_by_instance_async(resource_group_name, managed_instance_name, custom_headers:nil)
119
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
120
+ fail ArgumentError, 'managed_instance_name is nil' if managed_instance_name.nil?
121
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
122
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
123
+
124
+
125
+ request_headers = {}
126
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
127
+
128
+ # Set Headers
129
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
130
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
131
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases'
132
+
133
+ request_url = @base_url || @client.base_url
134
+
135
+ options = {
136
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
137
+ path_params: {'resourceGroupName' => resource_group_name,'managedInstanceName' => managed_instance_name,'subscriptionId' => @client.subscription_id},
138
+ query_params: {'api-version' => @client.api_version},
139
+ headers: request_headers.merge(custom_headers || {}),
140
+ base_url: request_url
141
+ }
142
+ promise = @client.make_request_async(:get, path_template, options)
143
+
144
+ promise = promise.then do |result|
145
+ http_response = result.response
146
+ status_code = http_response.status
147
+ response_content = http_response.body
148
+ unless status_code == 200
149
+ error_model = JSON.load(response_content)
150
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
151
+ end
152
+
153
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
154
+ # Deserialize Response
155
+ if status_code == 200
156
+ begin
157
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
158
+ result_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::ManagedDatabaseListResult.mapper()
159
+ result.body = @client.deserialize(result_mapper, parsed_response)
160
+ rescue Exception => e
161
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
162
+ end
163
+ end
164
+
165
+ result
166
+ end
167
+
168
+ promise.execute
169
+ end
170
+
171
+ #
172
+ # Gets a managed database.
173
+ #
174
+ # @param resource_group_name [String] The name of the resource group that
175
+ # contains the resource. You can obtain this value from the Azure Resource
176
+ # Manager API or the portal.
177
+ # @param managed_instance_name [String] The name of the managed instance.
178
+ # @param database_name [String] The name of the database.
179
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
180
+ # will be added to the HTTP request.
181
+ #
182
+ # @return [ManagedDatabase] operation results.
183
+ #
184
+ def get(resource_group_name, managed_instance_name, database_name, custom_headers:nil)
185
+ response = get_async(resource_group_name, managed_instance_name, database_name, custom_headers:custom_headers).value!
186
+ response.body unless response.nil?
187
+ end
188
+
189
+ #
190
+ # Gets a managed database.
191
+ #
192
+ # @param resource_group_name [String] The name of the resource group that
193
+ # contains the resource. You can obtain this value from the Azure Resource
194
+ # Manager API or the portal.
195
+ # @param managed_instance_name [String] The name of the managed instance.
196
+ # @param database_name [String] The name of the database.
197
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
198
+ # will be added to the HTTP request.
199
+ #
200
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
201
+ #
202
+ def get_with_http_info(resource_group_name, managed_instance_name, database_name, custom_headers:nil)
203
+ get_async(resource_group_name, managed_instance_name, database_name, custom_headers:custom_headers).value!
204
+ end
205
+
206
+ #
207
+ # Gets a managed database.
208
+ #
209
+ # @param resource_group_name [String] The name of the resource group that
210
+ # contains the resource. You can obtain this value from the Azure Resource
211
+ # Manager API or the portal.
212
+ # @param managed_instance_name [String] The name of the managed instance.
213
+ # @param database_name [String] The name of the database.
214
+ # @param [Hash{String => String}] A hash of custom headers that will be added
215
+ # to the HTTP request.
216
+ #
217
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
218
+ #
219
+ def get_async(resource_group_name, managed_instance_name, database_name, custom_headers:nil)
220
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
221
+ fail ArgumentError, 'managed_instance_name is nil' if managed_instance_name.nil?
222
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
223
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
224
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
225
+
226
+
227
+ request_headers = {}
228
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
229
+
230
+ # Set Headers
231
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
232
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
233
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}'
234
+
235
+ request_url = @base_url || @client.base_url
236
+
237
+ options = {
238
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
239
+ path_params: {'resourceGroupName' => resource_group_name,'managedInstanceName' => managed_instance_name,'databaseName' => database_name,'subscriptionId' => @client.subscription_id},
240
+ query_params: {'api-version' => @client.api_version},
241
+ headers: request_headers.merge(custom_headers || {}),
242
+ base_url: request_url
243
+ }
244
+ promise = @client.make_request_async(:get, path_template, options)
245
+
246
+ promise = promise.then do |result|
247
+ http_response = result.response
248
+ status_code = http_response.status
249
+ response_content = http_response.body
250
+ unless status_code == 200
251
+ error_model = JSON.load(response_content)
252
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
253
+ end
254
+
255
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
256
+ # Deserialize Response
257
+ if status_code == 200
258
+ begin
259
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
260
+ result_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::ManagedDatabase.mapper()
261
+ result.body = @client.deserialize(result_mapper, parsed_response)
262
+ rescue Exception => e
263
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
264
+ end
265
+ end
266
+
267
+ result
268
+ end
269
+
270
+ promise.execute
271
+ end
272
+
273
+ #
274
+ # Creates a new database or updates an existing database.
275
+ #
276
+ # @param resource_group_name [String] The name of the resource group that
277
+ # contains the resource. You can obtain this value from the Azure Resource
278
+ # Manager API or the portal.
279
+ # @param managed_instance_name [String] The name of the managed instance.
280
+ # @param database_name [String] The name of the database.
281
+ # @param parameters [ManagedDatabase] The requested database resource state.
282
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
283
+ # will be added to the HTTP request.
284
+ #
285
+ # @return [ManagedDatabase] operation results.
286
+ #
287
+ def create_or_update(resource_group_name, managed_instance_name, database_name, parameters, custom_headers:nil)
288
+ response = create_or_update_async(resource_group_name, managed_instance_name, database_name, parameters, custom_headers:custom_headers).value!
289
+ response.body unless response.nil?
290
+ end
291
+
292
+ #
293
+ # @param resource_group_name [String] The name of the resource group that
294
+ # contains the resource. You can obtain this value from the Azure Resource
295
+ # Manager API or the portal.
296
+ # @param managed_instance_name [String] The name of the managed instance.
297
+ # @param database_name [String] The name of the database.
298
+ # @param parameters [ManagedDatabase] The requested database resource state.
299
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
300
+ # will be added to the HTTP request.
301
+ #
302
+ # @return [Concurrent::Promise] promise which provides async access to http
303
+ # response.
304
+ #
305
+ def create_or_update_async(resource_group_name, managed_instance_name, database_name, parameters, custom_headers:nil)
306
+ # Send request
307
+ promise = begin_create_or_update_async(resource_group_name, managed_instance_name, database_name, parameters, custom_headers:custom_headers)
308
+
309
+ promise = promise.then do |response|
310
+ # Defining deserialization method.
311
+ deserialize_method = lambda do |parsed_response|
312
+ result_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::ManagedDatabase.mapper()
313
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
314
+ end
315
+
316
+ # Waiting for response.
317
+ @client.get_long_running_operation_result(response, deserialize_method)
318
+ end
319
+
320
+ promise
321
+ end
322
+
323
+ #
324
+ # Deletes the managed database.
325
+ #
326
+ # @param resource_group_name [String] The name of the resource group that
327
+ # contains the resource. You can obtain this value from the Azure Resource
328
+ # Manager API or the portal.
329
+ # @param managed_instance_name [String] The name of the managed instance.
330
+ # @param database_name [String] The name of the database.
331
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
332
+ # will be added to the HTTP request.
333
+ #
334
+ def delete(resource_group_name, managed_instance_name, database_name, custom_headers:nil)
335
+ response = delete_async(resource_group_name, managed_instance_name, database_name, custom_headers:custom_headers).value!
336
+ nil
337
+ end
338
+
339
+ #
340
+ # @param resource_group_name [String] The name of the resource group that
341
+ # contains the resource. You can obtain this value from the Azure Resource
342
+ # Manager API or the portal.
343
+ # @param managed_instance_name [String] The name of the managed instance.
344
+ # @param database_name [String] The name of the database.
345
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
346
+ # will be added to the HTTP request.
347
+ #
348
+ # @return [Concurrent::Promise] promise which provides async access to http
349
+ # response.
350
+ #
351
+ def delete_async(resource_group_name, managed_instance_name, database_name, custom_headers:nil)
352
+ # Send request
353
+ promise = begin_delete_async(resource_group_name, managed_instance_name, database_name, custom_headers:custom_headers)
354
+
355
+ promise = promise.then do |response|
356
+ # Defining deserialization method.
357
+ deserialize_method = lambda do |parsed_response|
358
+ end
359
+
360
+ # Waiting for response.
361
+ @client.get_long_running_operation_result(response, deserialize_method)
362
+ end
363
+
364
+ promise
365
+ end
366
+
367
+ #
368
+ # Updates an existing database.
369
+ #
370
+ # @param resource_group_name [String] The name of the resource group that
371
+ # contains the resource. You can obtain this value from the Azure Resource
372
+ # Manager API or the portal.
373
+ # @param managed_instance_name [String] The name of the managed instance.
374
+ # @param database_name [String] The name of the database.
375
+ # @param parameters [ManagedDatabaseUpdate] The requested database resource
376
+ # state.
377
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
378
+ # will be added to the HTTP request.
379
+ #
380
+ # @return [ManagedDatabase] operation results.
381
+ #
382
+ def update(resource_group_name, managed_instance_name, database_name, parameters, custom_headers:nil)
383
+ response = update_async(resource_group_name, managed_instance_name, database_name, parameters, custom_headers:custom_headers).value!
384
+ response.body unless response.nil?
385
+ end
386
+
387
+ #
388
+ # @param resource_group_name [String] The name of the resource group that
389
+ # contains the resource. You can obtain this value from the Azure Resource
390
+ # Manager API or the portal.
391
+ # @param managed_instance_name [String] The name of the managed instance.
392
+ # @param database_name [String] The name of the database.
393
+ # @param parameters [ManagedDatabaseUpdate] The requested database resource
394
+ # state.
395
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
396
+ # will be added to the HTTP request.
397
+ #
398
+ # @return [Concurrent::Promise] promise which provides async access to http
399
+ # response.
400
+ #
401
+ def update_async(resource_group_name, managed_instance_name, database_name, parameters, custom_headers:nil)
402
+ # Send request
403
+ promise = begin_update_async(resource_group_name, managed_instance_name, database_name, parameters, custom_headers:custom_headers)
404
+
405
+ promise = promise.then do |response|
406
+ # Defining deserialization method.
407
+ deserialize_method = lambda do |parsed_response|
408
+ result_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::ManagedDatabase.mapper()
409
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
410
+ end
411
+
412
+ # Waiting for response.
413
+ @client.get_long_running_operation_result(response, deserialize_method)
414
+ end
415
+
416
+ promise
417
+ end
418
+
419
+ #
420
+ # Completes the restore operation on a managed database.
421
+ #
422
+ # @param location_name [String] The name of the region where the resource is
423
+ # located.
424
+ # @param operation_id Management operation id that this request tries to
425
+ # complete.
426
+ # @param parameters [CompleteDatabaseRestoreDefinition] The definition for
427
+ # completing the restore of this managed database.
428
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
429
+ # will be added to the HTTP request.
430
+ #
431
+ #
432
+ def begin_complete_restore(location_name, operation_id, parameters, custom_headers:nil)
433
+ response = begin_complete_restore_async(location_name, operation_id, parameters, custom_headers:custom_headers).value!
434
+ nil
435
+ end
436
+
437
+ #
438
+ # Completes the restore operation on a managed database.
439
+ #
440
+ # @param location_name [String] The name of the region where the resource is
441
+ # located.
442
+ # @param operation_id Management operation id that this request tries to
443
+ # complete.
444
+ # @param parameters [CompleteDatabaseRestoreDefinition] The definition for
445
+ # completing the restore of this managed database.
446
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
447
+ # will be added to the HTTP request.
448
+ #
449
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
450
+ #
451
+ def begin_complete_restore_with_http_info(location_name, operation_id, parameters, custom_headers:nil)
452
+ begin_complete_restore_async(location_name, operation_id, parameters, custom_headers:custom_headers).value!
453
+ end
454
+
455
+ #
456
+ # Completes the restore operation on a managed database.
457
+ #
458
+ # @param location_name [String] The name of the region where the resource is
459
+ # located.
460
+ # @param operation_id Management operation id that this request tries to
461
+ # complete.
462
+ # @param parameters [CompleteDatabaseRestoreDefinition] The definition for
463
+ # completing the restore of this managed database.
464
+ # @param [Hash{String => String}] A hash of custom headers that will be added
465
+ # to the HTTP request.
466
+ #
467
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
468
+ #
469
+ def begin_complete_restore_async(location_name, operation_id, parameters, custom_headers:nil)
470
+ fail ArgumentError, 'location_name is nil' if location_name.nil?
471
+ fail ArgumentError, 'operation_id is nil' if operation_id.nil?
472
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
473
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
474
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
475
+
476
+
477
+ request_headers = {}
478
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
479
+
480
+ # Set Headers
481
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
482
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
483
+
484
+ # Serialize Request
485
+ request_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::CompleteDatabaseRestoreDefinition.mapper()
486
+ request_content = @client.serialize(request_mapper, parameters)
487
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
488
+
489
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/managedDatabaseRestoreAzureAsyncOperation/{operationId}/completeRestore'
490
+
491
+ request_url = @base_url || @client.base_url
492
+
493
+ options = {
494
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
495
+ path_params: {'locationName' => location_name,'operationId' => operation_id,'subscriptionId' => @client.subscription_id},
496
+ query_params: {'api-version' => @client.api_version},
497
+ body: request_content,
498
+ headers: request_headers.merge(custom_headers || {}),
499
+ base_url: request_url
500
+ }
501
+ promise = @client.make_request_async(:post, path_template, options)
502
+
503
+ promise = promise.then do |result|
504
+ http_response = result.response
505
+ status_code = http_response.status
506
+ response_content = http_response.body
507
+ unless status_code == 200 || status_code == 202
508
+ error_model = JSON.load(response_content)
509
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
510
+ end
511
+
512
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
513
+
514
+ result
515
+ end
516
+
517
+ promise.execute
518
+ end
519
+
520
+ #
521
+ # Creates a new database or updates an existing database.
522
+ #
523
+ # @param resource_group_name [String] The name of the resource group that
524
+ # contains the resource. You can obtain this value from the Azure Resource
525
+ # Manager API or the portal.
526
+ # @param managed_instance_name [String] The name of the managed instance.
527
+ # @param database_name [String] The name of the database.
528
+ # @param parameters [ManagedDatabase] The requested database resource state.
529
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
530
+ # will be added to the HTTP request.
531
+ #
532
+ # @return [ManagedDatabase] operation results.
533
+ #
534
+ def begin_create_or_update(resource_group_name, managed_instance_name, database_name, parameters, custom_headers:nil)
535
+ response = begin_create_or_update_async(resource_group_name, managed_instance_name, database_name, parameters, custom_headers:custom_headers).value!
536
+ response.body unless response.nil?
537
+ end
538
+
539
+ #
540
+ # Creates a new database or updates an existing database.
541
+ #
542
+ # @param resource_group_name [String] The name of the resource group that
543
+ # contains the resource. You can obtain this value from the Azure Resource
544
+ # Manager API or the portal.
545
+ # @param managed_instance_name [String] The name of the managed instance.
546
+ # @param database_name [String] The name of the database.
547
+ # @param parameters [ManagedDatabase] The requested database resource state.
548
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
549
+ # will be added to the HTTP request.
550
+ #
551
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
552
+ #
553
+ def begin_create_or_update_with_http_info(resource_group_name, managed_instance_name, database_name, parameters, custom_headers:nil)
554
+ begin_create_or_update_async(resource_group_name, managed_instance_name, database_name, parameters, custom_headers:custom_headers).value!
555
+ end
556
+
557
+ #
558
+ # Creates a new database or updates an existing database.
559
+ #
560
+ # @param resource_group_name [String] The name of the resource group that
561
+ # contains the resource. You can obtain this value from the Azure Resource
562
+ # Manager API or the portal.
563
+ # @param managed_instance_name [String] The name of the managed instance.
564
+ # @param database_name [String] The name of the database.
565
+ # @param parameters [ManagedDatabase] The requested database resource state.
566
+ # @param [Hash{String => String}] A hash of custom headers that will be added
567
+ # to the HTTP request.
568
+ #
569
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
570
+ #
571
+ def begin_create_or_update_async(resource_group_name, managed_instance_name, database_name, parameters, custom_headers:nil)
572
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
573
+ fail ArgumentError, 'managed_instance_name is nil' if managed_instance_name.nil?
574
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
575
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
576
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
577
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
578
+
579
+
580
+ request_headers = {}
581
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
582
+
583
+ # Set Headers
584
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
585
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
586
+
587
+ # Serialize Request
588
+ request_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::ManagedDatabase.mapper()
589
+ request_content = @client.serialize(request_mapper, parameters)
590
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
591
+
592
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}'
593
+
594
+ request_url = @base_url || @client.base_url
595
+
596
+ options = {
597
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
598
+ path_params: {'resourceGroupName' => resource_group_name,'managedInstanceName' => managed_instance_name,'databaseName' => database_name,'subscriptionId' => @client.subscription_id},
599
+ query_params: {'api-version' => @client.api_version},
600
+ body: request_content,
601
+ headers: request_headers.merge(custom_headers || {}),
602
+ base_url: request_url
603
+ }
604
+ promise = @client.make_request_async(:put, path_template, options)
605
+
606
+ promise = promise.then do |result|
607
+ http_response = result.response
608
+ status_code = http_response.status
609
+ response_content = http_response.body
610
+ unless status_code == 200 || status_code == 202 || status_code == 201
611
+ error_model = JSON.load(response_content)
612
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
613
+ end
614
+
615
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
616
+ # Deserialize Response
617
+ if status_code == 200
618
+ begin
619
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
620
+ result_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::ManagedDatabase.mapper()
621
+ result.body = @client.deserialize(result_mapper, parsed_response)
622
+ rescue Exception => e
623
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
624
+ end
625
+ end
626
+ # Deserialize Response
627
+ if status_code == 201
628
+ begin
629
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
630
+ result_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::ManagedDatabase.mapper()
631
+ result.body = @client.deserialize(result_mapper, parsed_response)
632
+ rescue Exception => e
633
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
634
+ end
635
+ end
636
+
637
+ result
638
+ end
639
+
640
+ promise.execute
641
+ end
642
+
643
+ #
644
+ # Deletes the managed database.
645
+ #
646
+ # @param resource_group_name [String] The name of the resource group that
647
+ # contains the resource. You can obtain this value from the Azure Resource
648
+ # Manager API or the portal.
649
+ # @param managed_instance_name [String] The name of the managed instance.
650
+ # @param database_name [String] The name of the database.
651
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
652
+ # will be added to the HTTP request.
653
+ #
654
+ #
655
+ def begin_delete(resource_group_name, managed_instance_name, database_name, custom_headers:nil)
656
+ response = begin_delete_async(resource_group_name, managed_instance_name, database_name, custom_headers:custom_headers).value!
657
+ nil
658
+ end
659
+
660
+ #
661
+ # Deletes the managed database.
662
+ #
663
+ # @param resource_group_name [String] The name of the resource group that
664
+ # contains the resource. You can obtain this value from the Azure Resource
665
+ # Manager API or the portal.
666
+ # @param managed_instance_name [String] The name of the managed instance.
667
+ # @param database_name [String] The name of the database.
668
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
669
+ # will be added to the HTTP request.
670
+ #
671
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
672
+ #
673
+ def begin_delete_with_http_info(resource_group_name, managed_instance_name, database_name, custom_headers:nil)
674
+ begin_delete_async(resource_group_name, managed_instance_name, database_name, custom_headers:custom_headers).value!
675
+ end
676
+
677
+ #
678
+ # Deletes the managed database.
679
+ #
680
+ # @param resource_group_name [String] The name of the resource group that
681
+ # contains the resource. You can obtain this value from the Azure Resource
682
+ # Manager API or the portal.
683
+ # @param managed_instance_name [String] The name of the managed instance.
684
+ # @param database_name [String] The name of the database.
685
+ # @param [Hash{String => String}] A hash of custom headers that will be added
686
+ # to the HTTP request.
687
+ #
688
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
689
+ #
690
+ def begin_delete_async(resource_group_name, managed_instance_name, database_name, custom_headers:nil)
691
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
692
+ fail ArgumentError, 'managed_instance_name is nil' if managed_instance_name.nil?
693
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
694
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
695
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
696
+
697
+
698
+ request_headers = {}
699
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
700
+
701
+ # Set Headers
702
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
703
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
704
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}'
705
+
706
+ request_url = @base_url || @client.base_url
707
+
708
+ options = {
709
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
710
+ path_params: {'resourceGroupName' => resource_group_name,'managedInstanceName' => managed_instance_name,'databaseName' => database_name,'subscriptionId' => @client.subscription_id},
711
+ query_params: {'api-version' => @client.api_version},
712
+ headers: request_headers.merge(custom_headers || {}),
713
+ base_url: request_url
714
+ }
715
+ promise = @client.make_request_async(:delete, path_template, options)
716
+
717
+ promise = promise.then do |result|
718
+ http_response = result.response
719
+ status_code = http_response.status
720
+ response_content = http_response.body
721
+ unless status_code == 200 || status_code == 202 || status_code == 204
722
+ error_model = JSON.load(response_content)
723
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
724
+ end
725
+
726
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
727
+
728
+ result
729
+ end
730
+
731
+ promise.execute
732
+ end
733
+
734
+ #
735
+ # Updates an existing database.
736
+ #
737
+ # @param resource_group_name [String] The name of the resource group that
738
+ # contains the resource. You can obtain this value from the Azure Resource
739
+ # Manager API or the portal.
740
+ # @param managed_instance_name [String] The name of the managed instance.
741
+ # @param database_name [String] The name of the database.
742
+ # @param parameters [ManagedDatabaseUpdate] The requested database resource
743
+ # state.
744
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
745
+ # will be added to the HTTP request.
746
+ #
747
+ # @return [ManagedDatabase] operation results.
748
+ #
749
+ def begin_update(resource_group_name, managed_instance_name, database_name, parameters, custom_headers:nil)
750
+ response = begin_update_async(resource_group_name, managed_instance_name, database_name, parameters, custom_headers:custom_headers).value!
751
+ response.body unless response.nil?
752
+ end
753
+
754
+ #
755
+ # Updates an existing database.
756
+ #
757
+ # @param resource_group_name [String] The name of the resource group that
758
+ # contains the resource. You can obtain this value from the Azure Resource
759
+ # Manager API or the portal.
760
+ # @param managed_instance_name [String] The name of the managed instance.
761
+ # @param database_name [String] The name of the database.
762
+ # @param parameters [ManagedDatabaseUpdate] The requested database resource
763
+ # state.
764
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
765
+ # will be added to the HTTP request.
766
+ #
767
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
768
+ #
769
+ def begin_update_with_http_info(resource_group_name, managed_instance_name, database_name, parameters, custom_headers:nil)
770
+ begin_update_async(resource_group_name, managed_instance_name, database_name, parameters, custom_headers:custom_headers).value!
771
+ end
772
+
773
+ #
774
+ # Updates an existing database.
775
+ #
776
+ # @param resource_group_name [String] The name of the resource group that
777
+ # contains the resource. You can obtain this value from the Azure Resource
778
+ # Manager API or the portal.
779
+ # @param managed_instance_name [String] The name of the managed instance.
780
+ # @param database_name [String] The name of the database.
781
+ # @param parameters [ManagedDatabaseUpdate] The requested database resource
782
+ # state.
783
+ # @param [Hash{String => String}] A hash of custom headers that will be added
784
+ # to the HTTP request.
785
+ #
786
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
787
+ #
788
+ def begin_update_async(resource_group_name, managed_instance_name, database_name, parameters, custom_headers:nil)
789
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
790
+ fail ArgumentError, 'managed_instance_name is nil' if managed_instance_name.nil?
791
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
792
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
793
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
794
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
795
+
796
+
797
+ request_headers = {}
798
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
799
+
800
+ # Set Headers
801
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
802
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
803
+
804
+ # Serialize Request
805
+ request_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::ManagedDatabaseUpdate.mapper()
806
+ request_content = @client.serialize(request_mapper, parameters)
807
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
808
+
809
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}'
810
+
811
+ request_url = @base_url || @client.base_url
812
+
813
+ options = {
814
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
815
+ path_params: {'resourceGroupName' => resource_group_name,'managedInstanceName' => managed_instance_name,'databaseName' => database_name,'subscriptionId' => @client.subscription_id},
816
+ query_params: {'api-version' => @client.api_version},
817
+ body: request_content,
818
+ headers: request_headers.merge(custom_headers || {}),
819
+ base_url: request_url
820
+ }
821
+ promise = @client.make_request_async(:patch, path_template, options)
822
+
823
+ promise = promise.then do |result|
824
+ http_response = result.response
825
+ status_code = http_response.status
826
+ response_content = http_response.body
827
+ unless status_code == 200 || status_code == 202
828
+ error_model = JSON.load(response_content)
829
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
830
+ end
831
+
832
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
833
+ # Deserialize Response
834
+ if status_code == 200
835
+ begin
836
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
837
+ result_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::ManagedDatabase.mapper()
838
+ result.body = @client.deserialize(result_mapper, parsed_response)
839
+ rescue Exception => e
840
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
841
+ end
842
+ end
843
+
844
+ result
845
+ end
846
+
847
+ promise.execute
848
+ end
849
+
850
+ #
851
+ # Gets a list of managed databases.
852
+ #
853
+ # @param next_page_link [String] The NextLink from the previous successful call
854
+ # to List operation.
855
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
856
+ # will be added to the HTTP request.
857
+ #
858
+ # @return [ManagedDatabaseListResult] operation results.
859
+ #
860
+ def list_by_instance_next(next_page_link, custom_headers:nil)
861
+ response = list_by_instance_next_async(next_page_link, custom_headers:custom_headers).value!
862
+ response.body unless response.nil?
863
+ end
864
+
865
+ #
866
+ # Gets a list of managed databases.
867
+ #
868
+ # @param next_page_link [String] The NextLink from the previous successful call
869
+ # to List operation.
870
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
871
+ # will be added to the HTTP request.
872
+ #
873
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
874
+ #
875
+ def list_by_instance_next_with_http_info(next_page_link, custom_headers:nil)
876
+ list_by_instance_next_async(next_page_link, custom_headers:custom_headers).value!
877
+ end
878
+
879
+ #
880
+ # Gets a list of managed databases.
881
+ #
882
+ # @param next_page_link [String] The NextLink from the previous successful call
883
+ # to List operation.
884
+ # @param [Hash{String => String}] A hash of custom headers that will be added
885
+ # to the HTTP request.
886
+ #
887
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
888
+ #
889
+ def list_by_instance_next_async(next_page_link, custom_headers:nil)
890
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
891
+
892
+
893
+ request_headers = {}
894
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
895
+
896
+ # Set Headers
897
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
898
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
899
+ path_template = '{nextLink}'
900
+
901
+ request_url = @base_url || @client.base_url
902
+
903
+ options = {
904
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
905
+ skip_encoding_path_params: {'nextLink' => next_page_link},
906
+ headers: request_headers.merge(custom_headers || {}),
907
+ base_url: request_url
908
+ }
909
+ promise = @client.make_request_async(:get, path_template, options)
910
+
911
+ promise = promise.then do |result|
912
+ http_response = result.response
913
+ status_code = http_response.status
914
+ response_content = http_response.body
915
+ unless status_code == 200
916
+ error_model = JSON.load(response_content)
917
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
918
+ end
919
+
920
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
921
+ # Deserialize Response
922
+ if status_code == 200
923
+ begin
924
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
925
+ result_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::ManagedDatabaseListResult.mapper()
926
+ result.body = @client.deserialize(result_mapper, parsed_response)
927
+ rescue Exception => e
928
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
929
+ end
930
+ end
931
+
932
+ result
933
+ end
934
+
935
+ promise.execute
936
+ end
937
+
938
+ #
939
+ # Gets a list of managed databases.
940
+ #
941
+ # @param resource_group_name [String] The name of the resource group that
942
+ # contains the resource. You can obtain this value from the Azure Resource
943
+ # Manager API or the portal.
944
+ # @param managed_instance_name [String] The name of the managed instance.
945
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
946
+ # will be added to the HTTP request.
947
+ #
948
+ # @return [ManagedDatabaseListResult] which provide lazy access to pages of the
949
+ # response.
950
+ #
951
+ def list_by_instance_as_lazy(resource_group_name, managed_instance_name, custom_headers:nil)
952
+ response = list_by_instance_async(resource_group_name, managed_instance_name, custom_headers:custom_headers).value!
953
+ unless response.nil?
954
+ page = response.body
955
+ page.next_method = Proc.new do |next_page_link|
956
+ list_by_instance_next_async(next_page_link, custom_headers:custom_headers)
957
+ end
958
+ page
959
+ end
960
+ end
961
+
962
+ end
963
+ end