azure_mgmt_mysql 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql.rb +79 -0
  4. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/check_name_availability.rb +128 -0
  5. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/configurations.rb +402 -0
  6. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/databases.rb +549 -0
  7. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/firewall_rules.rb +549 -0
  8. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/location_based_performance_tier.rb +118 -0
  9. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/log_files.rb +128 -0
  10. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/configuration.rb +132 -0
  11. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/configuration_list_result.rb +55 -0
  12. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/database.rb +84 -0
  13. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/database_list_result.rb +55 -0
  14. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/firewall_rule.rb +92 -0
  15. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/firewall_rule_list_result.rb +55 -0
  16. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/geo_redundant_backup.rb +16 -0
  17. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/log_file.rb +119 -0
  18. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/log_file_list_result.rb +55 -0
  19. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/name_availability.rb +68 -0
  20. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/name_availability_request.rb +57 -0
  21. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/operation.rb +95 -0
  22. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/operation_display.rb +83 -0
  23. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/operation_list_result.rb +55 -0
  24. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/operation_origin.rb +17 -0
  25. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/performance_tier_list_result.rb +56 -0
  26. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/performance_tier_properties.rb +67 -0
  27. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/performance_tier_service_level_objectives.rb +126 -0
  28. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/proxy_resource.rb +71 -0
  29. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/server.rb +220 -0
  30. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/server_for_create.rb +92 -0
  31. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/server_list_result.rb +55 -0
  32. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/server_properties_for_create.rb +86 -0
  33. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/server_properties_for_default_create.rb +100 -0
  34. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/server_properties_for_geo_restore.rb +88 -0
  35. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/server_properties_for_replica.rb +87 -0
  36. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/server_properties_for_restore.rb +99 -0
  37. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/server_security_alert_policy.rb +166 -0
  38. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/server_security_alert_policy_state.rb +16 -0
  39. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/server_state.rb +17 -0
  40. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/server_update_parameters.rb +126 -0
  41. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/server_version.rb +16 -0
  42. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/sku.rb +97 -0
  43. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/sku_tier.rb +17 -0
  44. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/ssl_enforcement_enum.rb +16 -0
  45. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/storage_autogrow.rb +16 -0
  46. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/storage_profile.rb +81 -0
  47. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/tracked_resource.rb +93 -0
  48. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/virtual_network_rule.rb +99 -0
  49. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/virtual_network_rule_list_result.rb +100 -0
  50. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/models/virtual_network_rule_state.rb +19 -0
  51. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/module_definition.rb +9 -0
  52. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/my_sqlmanagement_client.rb +172 -0
  53. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/operations.rb +112 -0
  54. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/replicas.rb +128 -0
  55. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/server_security_alert_policies.rb +294 -0
  56. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/servers.rb +918 -0
  57. data/lib/2017-12-01-preview/generated/azure_mgmt_mysql/virtual_network_rules.rb +676 -0
  58. data/lib/2017-12-01/generated/azure_mgmt_mysql.rb +79 -0
  59. data/lib/2017-12-01/generated/azure_mgmt_mysql/check_name_availability.rb +128 -0
  60. data/lib/2017-12-01/generated/azure_mgmt_mysql/configurations.rb +402 -0
  61. data/lib/2017-12-01/generated/azure_mgmt_mysql/databases.rb +549 -0
  62. data/lib/2017-12-01/generated/azure_mgmt_mysql/firewall_rules.rb +549 -0
  63. data/lib/2017-12-01/generated/azure_mgmt_mysql/location_based_performance_tier.rb +118 -0
  64. data/lib/2017-12-01/generated/azure_mgmt_mysql/log_files.rb +128 -0
  65. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/configuration.rb +132 -0
  66. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/configuration_list_result.rb +55 -0
  67. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/database.rb +84 -0
  68. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/database_list_result.rb +55 -0
  69. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/firewall_rule.rb +92 -0
  70. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/firewall_rule_list_result.rb +55 -0
  71. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/geo_redundant_backup.rb +16 -0
  72. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/log_file.rb +119 -0
  73. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/log_file_list_result.rb +55 -0
  74. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/name_availability.rb +68 -0
  75. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/name_availability_request.rb +57 -0
  76. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/operation.rb +95 -0
  77. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/operation_display.rb +83 -0
  78. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/operation_list_result.rb +55 -0
  79. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/operation_origin.rb +17 -0
  80. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/performance_tier_list_result.rb +56 -0
  81. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/performance_tier_properties.rb +67 -0
  82. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/performance_tier_service_level_objectives.rb +126 -0
  83. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/proxy_resource.rb +71 -0
  84. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/server.rb +220 -0
  85. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/server_for_create.rb +92 -0
  86. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/server_list_result.rb +55 -0
  87. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/server_properties_for_create.rb +86 -0
  88. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/server_properties_for_default_create.rb +100 -0
  89. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/server_properties_for_geo_restore.rb +88 -0
  90. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/server_properties_for_replica.rb +87 -0
  91. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/server_properties_for_restore.rb +99 -0
  92. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/server_security_alert_policy.rb +166 -0
  93. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/server_security_alert_policy_state.rb +16 -0
  94. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/server_state.rb +17 -0
  95. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/server_update_parameters.rb +126 -0
  96. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/server_version.rb +16 -0
  97. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/sku.rb +97 -0
  98. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/sku_tier.rb +17 -0
  99. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/ssl_enforcement_enum.rb +16 -0
  100. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/storage_autogrow.rb +16 -0
  101. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/storage_profile.rb +81 -0
  102. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/tracked_resource.rb +93 -0
  103. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/virtual_network_rule.rb +99 -0
  104. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/virtual_network_rule_list_result.rb +100 -0
  105. data/lib/2017-12-01/generated/azure_mgmt_mysql/models/virtual_network_rule_state.rb +19 -0
  106. data/lib/2017-12-01/generated/azure_mgmt_mysql/module_definition.rb +9 -0
  107. data/lib/2017-12-01/generated/azure_mgmt_mysql/my_sqlmanagement_client.rb +172 -0
  108. data/lib/2017-12-01/generated/azure_mgmt_mysql/operations.rb +112 -0
  109. data/lib/2017-12-01/generated/azure_mgmt_mysql/replicas.rb +128 -0
  110. data/lib/2017-12-01/generated/azure_mgmt_mysql/server_security_alert_policies.rb +294 -0
  111. data/lib/2017-12-01/generated/azure_mgmt_mysql/servers.rb +918 -0
  112. data/lib/2017-12-01/generated/azure_mgmt_mysql/virtual_network_rules.rb +676 -0
  113. data/lib/azure_mgmt_mysql.rb +7 -0
  114. data/lib/module_definition.rb +7 -0
  115. data/lib/profiles/latest/modules/mysql_profile_module.rb +245 -0
  116. data/lib/profiles/latest/mysql_latest_profile_client.rb +40 -0
  117. data/lib/profiles/latest/mysql_module_definition.rb +8 -0
  118. data/lib/version.rb +7 -0
  119. metadata +234 -0
@@ -0,0 +1,79 @@
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
+ require 'uri'
7
+ require 'cgi'
8
+ require 'date'
9
+ require 'json'
10
+ require 'base64'
11
+ require 'erb'
12
+ require 'securerandom'
13
+ require 'time'
14
+ require 'timeliness'
15
+ require 'faraday'
16
+ require 'faraday-cookie_jar'
17
+ require 'concurrent'
18
+ require 'ms_rest'
19
+ require '2017-12-01/generated/azure_mgmt_mysql/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::Mysql::Mgmt::V2017_12_01
23
+ autoload :Servers, '2017-12-01/generated/azure_mgmt_mysql/servers.rb'
24
+ autoload :Replicas, '2017-12-01/generated/azure_mgmt_mysql/replicas.rb'
25
+ autoload :FirewallRules, '2017-12-01/generated/azure_mgmt_mysql/firewall_rules.rb'
26
+ autoload :VirtualNetworkRules, '2017-12-01/generated/azure_mgmt_mysql/virtual_network_rules.rb'
27
+ autoload :Databases, '2017-12-01/generated/azure_mgmt_mysql/databases.rb'
28
+ autoload :Configurations, '2017-12-01/generated/azure_mgmt_mysql/configurations.rb'
29
+ autoload :LogFiles, '2017-12-01/generated/azure_mgmt_mysql/log_files.rb'
30
+ autoload :LocationBasedPerformanceTier, '2017-12-01/generated/azure_mgmt_mysql/location_based_performance_tier.rb'
31
+ autoload :CheckNameAvailability, '2017-12-01/generated/azure_mgmt_mysql/check_name_availability.rb'
32
+ autoload :ServerSecurityAlertPolicies, '2017-12-01/generated/azure_mgmt_mysql/server_security_alert_policies.rb'
33
+ autoload :Operations, '2017-12-01/generated/azure_mgmt_mysql/operations.rb'
34
+ autoload :MySQLManagementClient, '2017-12-01/generated/azure_mgmt_mysql/my_sqlmanagement_client.rb'
35
+
36
+ module Models
37
+ autoload :VirtualNetworkRuleListResult, '2017-12-01/generated/azure_mgmt_mysql/models/virtual_network_rule_list_result.rb'
38
+ autoload :FirewallRuleListResult, '2017-12-01/generated/azure_mgmt_mysql/models/firewall_rule_list_result.rb'
39
+ autoload :NameAvailabilityRequest, '2017-12-01/generated/azure_mgmt_mysql/models/name_availability_request.rb'
40
+ autoload :StorageProfile, '2017-12-01/generated/azure_mgmt_mysql/models/storage_profile.rb'
41
+ autoload :ProxyResource, '2017-12-01/generated/azure_mgmt_mysql/models/proxy_resource.rb'
42
+ autoload :NameAvailability, '2017-12-01/generated/azure_mgmt_mysql/models/name_availability.rb'
43
+ autoload :PerformanceTierListResult, '2017-12-01/generated/azure_mgmt_mysql/models/performance_tier_list_result.rb'
44
+ autoload :Operation, '2017-12-01/generated/azure_mgmt_mysql/models/operation.rb'
45
+ autoload :PerformanceTierServiceLevelObjectives, '2017-12-01/generated/azure_mgmt_mysql/models/performance_tier_service_level_objectives.rb'
46
+ autoload :ServerPropertiesForCreate, '2017-12-01/generated/azure_mgmt_mysql/models/server_properties_for_create.rb'
47
+ autoload :LogFileListResult, '2017-12-01/generated/azure_mgmt_mysql/models/log_file_list_result.rb'
48
+ autoload :OperationListResult, '2017-12-01/generated/azure_mgmt_mysql/models/operation_list_result.rb'
49
+ autoload :ServerUpdateParameters, '2017-12-01/generated/azure_mgmt_mysql/models/server_update_parameters.rb'
50
+ autoload :PerformanceTierProperties, '2017-12-01/generated/azure_mgmt_mysql/models/performance_tier_properties.rb'
51
+ autoload :DatabaseListResult, '2017-12-01/generated/azure_mgmt_mysql/models/database_list_result.rb'
52
+ autoload :ServerForCreate, '2017-12-01/generated/azure_mgmt_mysql/models/server_for_create.rb'
53
+ autoload :Sku, '2017-12-01/generated/azure_mgmt_mysql/models/sku.rb'
54
+ autoload :ConfigurationListResult, '2017-12-01/generated/azure_mgmt_mysql/models/configuration_list_result.rb'
55
+ autoload :ServerListResult, '2017-12-01/generated/azure_mgmt_mysql/models/server_list_result.rb'
56
+ autoload :OperationDisplay, '2017-12-01/generated/azure_mgmt_mysql/models/operation_display.rb'
57
+ autoload :TrackedResource, '2017-12-01/generated/azure_mgmt_mysql/models/tracked_resource.rb'
58
+ autoload :ServerPropertiesForDefaultCreate, '2017-12-01/generated/azure_mgmt_mysql/models/server_properties_for_default_create.rb'
59
+ autoload :ServerPropertiesForRestore, '2017-12-01/generated/azure_mgmt_mysql/models/server_properties_for_restore.rb'
60
+ autoload :ServerPropertiesForGeoRestore, '2017-12-01/generated/azure_mgmt_mysql/models/server_properties_for_geo_restore.rb'
61
+ autoload :ServerPropertiesForReplica, '2017-12-01/generated/azure_mgmt_mysql/models/server_properties_for_replica.rb'
62
+ autoload :Server, '2017-12-01/generated/azure_mgmt_mysql/models/server.rb'
63
+ autoload :FirewallRule, '2017-12-01/generated/azure_mgmt_mysql/models/firewall_rule.rb'
64
+ autoload :VirtualNetworkRule, '2017-12-01/generated/azure_mgmt_mysql/models/virtual_network_rule.rb'
65
+ autoload :Database, '2017-12-01/generated/azure_mgmt_mysql/models/database.rb'
66
+ autoload :Configuration, '2017-12-01/generated/azure_mgmt_mysql/models/configuration.rb'
67
+ autoload :LogFile, '2017-12-01/generated/azure_mgmt_mysql/models/log_file.rb'
68
+ autoload :ServerSecurityAlertPolicy, '2017-12-01/generated/azure_mgmt_mysql/models/server_security_alert_policy.rb'
69
+ autoload :ServerVersion, '2017-12-01/generated/azure_mgmt_mysql/models/server_version.rb'
70
+ autoload :SslEnforcementEnum, '2017-12-01/generated/azure_mgmt_mysql/models/ssl_enforcement_enum.rb'
71
+ autoload :ServerState, '2017-12-01/generated/azure_mgmt_mysql/models/server_state.rb'
72
+ autoload :GeoRedundantBackup, '2017-12-01/generated/azure_mgmt_mysql/models/geo_redundant_backup.rb'
73
+ autoload :StorageAutogrow, '2017-12-01/generated/azure_mgmt_mysql/models/storage_autogrow.rb'
74
+ autoload :SkuTier, '2017-12-01/generated/azure_mgmt_mysql/models/sku_tier.rb'
75
+ autoload :VirtualNetworkRuleState, '2017-12-01/generated/azure_mgmt_mysql/models/virtual_network_rule_state.rb'
76
+ autoload :OperationOrigin, '2017-12-01/generated/azure_mgmt_mysql/models/operation_origin.rb'
77
+ autoload :ServerSecurityAlertPolicyState, '2017-12-01/generated/azure_mgmt_mysql/models/server_security_alert_policy_state.rb'
78
+ end
79
+ end
@@ -0,0 +1,128 @@
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::Mysql::Mgmt::V2017_12_01
7
+ #
8
+ # The Microsoft Azure management API provides create, read, update, and
9
+ # delete functionality for Azure MySQL resources including servers,
10
+ # databases, firewall rules, VNET rules, log files and configurations with
11
+ # new business model.
12
+ #
13
+ class CheckNameAvailability
14
+ include MsRestAzure
15
+
16
+ #
17
+ # Creates and initializes a new instance of the CheckNameAvailability class.
18
+ # @param client service class for accessing basic functionality.
19
+ #
20
+ def initialize(client)
21
+ @client = client
22
+ end
23
+
24
+ # @return [MySQLManagementClient] reference to the MySQLManagementClient
25
+ attr_reader :client
26
+
27
+ #
28
+ # Check the availability of name for resource
29
+ #
30
+ # @param name_availability_request [NameAvailabilityRequest] The required
31
+ # parameters for checking if resource name is available.
32
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
33
+ # will be added to the HTTP request.
34
+ #
35
+ # @return [NameAvailability] operation results.
36
+ #
37
+ def execute(name_availability_request, custom_headers:nil)
38
+ response = execute_async(name_availability_request, custom_headers:custom_headers).value!
39
+ response.body unless response.nil?
40
+ end
41
+
42
+ #
43
+ # Check the availability of name for resource
44
+ #
45
+ # @param name_availability_request [NameAvailabilityRequest] The required
46
+ # parameters for checking if resource name is available.
47
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
48
+ # will be added to the HTTP request.
49
+ #
50
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
51
+ #
52
+ def execute_with_http_info(name_availability_request, custom_headers:nil)
53
+ execute_async(name_availability_request, custom_headers:custom_headers).value!
54
+ end
55
+
56
+ #
57
+ # Check the availability of name for resource
58
+ #
59
+ # @param name_availability_request [NameAvailabilityRequest] The required
60
+ # parameters for checking if resource name is available.
61
+ # @param [Hash{String => String}] A hash of custom headers that will be added
62
+ # to the HTTP request.
63
+ #
64
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
65
+ #
66
+ def execute_async(name_availability_request, custom_headers:nil)
67
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
68
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
69
+ fail ArgumentError, 'name_availability_request is nil' if name_availability_request.nil?
70
+
71
+
72
+ request_headers = {}
73
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
74
+
75
+ # Set Headers
76
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
77
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
78
+
79
+ # Serialize Request
80
+ request_mapper = Azure::Mysql::Mgmt::V2017_12_01::Models::NameAvailabilityRequest.mapper()
81
+ request_content = @client.serialize(request_mapper, name_availability_request)
82
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
83
+
84
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/checkNameAvailability'
85
+
86
+ request_url = @base_url || @client.base_url
87
+
88
+ options = {
89
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
90
+ path_params: {'subscriptionId' => @client.subscription_id},
91
+ query_params: {'api-version' => @client.api_version},
92
+ body: request_content,
93
+ headers: request_headers.merge(custom_headers || {}),
94
+ base_url: request_url
95
+ }
96
+ promise = @client.make_request_async(:post, path_template, options)
97
+
98
+ promise = promise.then do |result|
99
+ http_response = result.response
100
+ status_code = http_response.status
101
+ response_content = http_response.body
102
+ unless status_code == 200
103
+ error_model = JSON.load(response_content)
104
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
105
+ end
106
+
107
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
108
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
109
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
110
+ # Deserialize Response
111
+ if status_code == 200
112
+ begin
113
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
114
+ result_mapper = Azure::Mysql::Mgmt::V2017_12_01::Models::NameAvailability.mapper()
115
+ result.body = @client.deserialize(result_mapper, parsed_response)
116
+ rescue Exception => e
117
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
118
+ end
119
+ end
120
+
121
+ result
122
+ end
123
+
124
+ promise.execute
125
+ end
126
+
127
+ end
128
+ end
@@ -0,0 +1,402 @@
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::Mysql::Mgmt::V2017_12_01
7
+ #
8
+ # The Microsoft Azure management API provides create, read, update, and
9
+ # delete functionality for Azure MySQL resources including servers,
10
+ # databases, firewall rules, VNET rules, log files and configurations with
11
+ # new business model.
12
+ #
13
+ class Configurations
14
+ include MsRestAzure
15
+
16
+ #
17
+ # Creates and initializes a new instance of the Configurations class.
18
+ # @param client service class for accessing basic functionality.
19
+ #
20
+ def initialize(client)
21
+ @client = client
22
+ end
23
+
24
+ # @return [MySQLManagementClient] reference to the MySQLManagementClient
25
+ attr_reader :client
26
+
27
+ #
28
+ # Updates a configuration of a server.
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 configuration_name [String] The name of the server configuration.
35
+ # @param parameters [Configuration] The required parameters for updating a
36
+ # server configuration.
37
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
38
+ # will be added to the HTTP request.
39
+ #
40
+ # @return [Configuration] operation results.
41
+ #
42
+ def create_or_update(resource_group_name, server_name, configuration_name, parameters, custom_headers:nil)
43
+ response = create_or_update_async(resource_group_name, server_name, configuration_name, parameters, custom_headers:custom_headers).value!
44
+ response.body unless response.nil?
45
+ end
46
+
47
+ #
48
+ # @param resource_group_name [String] The name of the resource group that
49
+ # contains the resource. You can obtain this value from the Azure Resource
50
+ # Manager API or the portal.
51
+ # @param server_name [String] The name of the server.
52
+ # @param configuration_name [String] The name of the server configuration.
53
+ # @param parameters [Configuration] The required parameters for updating a
54
+ # server configuration.
55
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
56
+ # will be added to the HTTP request.
57
+ #
58
+ # @return [Concurrent::Promise] promise which provides async access to http
59
+ # response.
60
+ #
61
+ def create_or_update_async(resource_group_name, server_name, configuration_name, parameters, custom_headers:nil)
62
+ # Send request
63
+ promise = begin_create_or_update_async(resource_group_name, server_name, configuration_name, parameters, custom_headers:custom_headers)
64
+
65
+ promise = promise.then do |response|
66
+ # Defining deserialization method.
67
+ deserialize_method = lambda do |parsed_response|
68
+ result_mapper = Azure::Mysql::Mgmt::V2017_12_01::Models::Configuration.mapper()
69
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
70
+ end
71
+
72
+ # Waiting for response.
73
+ @client.get_long_running_operation_result(response, deserialize_method)
74
+ end
75
+
76
+ promise
77
+ end
78
+
79
+ #
80
+ # Gets information about a configuration of server.
81
+ #
82
+ # @param resource_group_name [String] The name of the resource group that
83
+ # contains the resource. You can obtain this value from the Azure Resource
84
+ # Manager API or the portal.
85
+ # @param server_name [String] The name of the server.
86
+ # @param configuration_name [String] The name of the server configuration.
87
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
88
+ # will be added to the HTTP request.
89
+ #
90
+ # @return [Configuration] operation results.
91
+ #
92
+ def get(resource_group_name, server_name, configuration_name, custom_headers:nil)
93
+ response = get_async(resource_group_name, server_name, configuration_name, custom_headers:custom_headers).value!
94
+ response.body unless response.nil?
95
+ end
96
+
97
+ #
98
+ # Gets information about a configuration of server.
99
+ #
100
+ # @param resource_group_name [String] The name of the resource group that
101
+ # contains the resource. You can obtain this value from the Azure Resource
102
+ # Manager API or the portal.
103
+ # @param server_name [String] The name of the server.
104
+ # @param configuration_name [String] The name of the server configuration.
105
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
106
+ # will be added to the HTTP request.
107
+ #
108
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
109
+ #
110
+ def get_with_http_info(resource_group_name, server_name, configuration_name, custom_headers:nil)
111
+ get_async(resource_group_name, server_name, configuration_name, custom_headers:custom_headers).value!
112
+ end
113
+
114
+ #
115
+ # Gets information about a configuration of server.
116
+ #
117
+ # @param resource_group_name [String] The name of the resource group that
118
+ # contains the resource. You can obtain this value from the Azure Resource
119
+ # Manager API or the portal.
120
+ # @param server_name [String] The name of the server.
121
+ # @param configuration_name [String] The name of the server configuration.
122
+ # @param [Hash{String => String}] A hash of custom headers that will be added
123
+ # to the HTTP request.
124
+ #
125
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
126
+ #
127
+ def get_async(resource_group_name, server_name, configuration_name, custom_headers:nil)
128
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
129
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
130
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
131
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
132
+ fail ArgumentError, 'configuration_name is nil' if configuration_name.nil?
133
+
134
+
135
+ request_headers = {}
136
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
137
+
138
+ # Set Headers
139
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
140
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
141
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/configurations/{configurationName}'
142
+
143
+ request_url = @base_url || @client.base_url
144
+
145
+ options = {
146
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
147
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'configurationName' => configuration_name},
148
+ query_params: {'api-version' => @client.api_version},
149
+ headers: request_headers.merge(custom_headers || {}),
150
+ base_url: request_url
151
+ }
152
+ promise = @client.make_request_async(:get, path_template, options)
153
+
154
+ promise = promise.then do |result|
155
+ http_response = result.response
156
+ status_code = http_response.status
157
+ response_content = http_response.body
158
+ unless status_code == 200
159
+ error_model = JSON.load(response_content)
160
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
161
+ end
162
+
163
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
164
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
165
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
166
+ # Deserialize Response
167
+ if status_code == 200
168
+ begin
169
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
170
+ result_mapper = Azure::Mysql::Mgmt::V2017_12_01::Models::Configuration.mapper()
171
+ result.body = @client.deserialize(result_mapper, parsed_response)
172
+ rescue Exception => e
173
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
174
+ end
175
+ end
176
+
177
+ result
178
+ end
179
+
180
+ promise.execute
181
+ end
182
+
183
+ #
184
+ # List all the configurations in a given server.
185
+ #
186
+ # @param resource_group_name [String] The name of the resource group that
187
+ # contains the resource. You can obtain this value from the Azure Resource
188
+ # Manager API or the portal.
189
+ # @param server_name [String] The name of the server.
190
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
191
+ # will be added to the HTTP request.
192
+ #
193
+ # @return [ConfigurationListResult] operation results.
194
+ #
195
+ def list_by_server(resource_group_name, server_name, custom_headers:nil)
196
+ response = list_by_server_async(resource_group_name, server_name, custom_headers:custom_headers).value!
197
+ response.body unless response.nil?
198
+ end
199
+
200
+ #
201
+ # List all the configurations in a given server.
202
+ #
203
+ # @param resource_group_name [String] The name of the resource group that
204
+ # contains the resource. You can obtain this value from the Azure Resource
205
+ # Manager API or the portal.
206
+ # @param server_name [String] The name of the server.
207
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
208
+ # will be added to the HTTP request.
209
+ #
210
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
211
+ #
212
+ def list_by_server_with_http_info(resource_group_name, server_name, custom_headers:nil)
213
+ list_by_server_async(resource_group_name, server_name, custom_headers:custom_headers).value!
214
+ end
215
+
216
+ #
217
+ # List all the configurations in a given server.
218
+ #
219
+ # @param resource_group_name [String] The name of the resource group that
220
+ # contains the resource. You can obtain this value from the Azure Resource
221
+ # Manager API or the portal.
222
+ # @param server_name [String] The name of the server.
223
+ # @param [Hash{String => String}] A hash of custom headers that will be added
224
+ # to the HTTP request.
225
+ #
226
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
227
+ #
228
+ def list_by_server_async(resource_group_name, server_name, custom_headers:nil)
229
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
230
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
231
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
232
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
233
+
234
+
235
+ request_headers = {}
236
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
237
+
238
+ # Set Headers
239
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
240
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
241
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/configurations'
242
+
243
+ request_url = @base_url || @client.base_url
244
+
245
+ options = {
246
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
247
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name},
248
+ query_params: {'api-version' => @client.api_version},
249
+ headers: request_headers.merge(custom_headers || {}),
250
+ base_url: request_url
251
+ }
252
+ promise = @client.make_request_async(:get, path_template, options)
253
+
254
+ promise = promise.then do |result|
255
+ http_response = result.response
256
+ status_code = http_response.status
257
+ response_content = http_response.body
258
+ unless status_code == 200
259
+ error_model = JSON.load(response_content)
260
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
261
+ end
262
+
263
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
264
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
265
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
266
+ # Deserialize Response
267
+ if status_code == 200
268
+ begin
269
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
270
+ result_mapper = Azure::Mysql::Mgmt::V2017_12_01::Models::ConfigurationListResult.mapper()
271
+ result.body = @client.deserialize(result_mapper, parsed_response)
272
+ rescue Exception => e
273
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
274
+ end
275
+ end
276
+
277
+ result
278
+ end
279
+
280
+ promise.execute
281
+ end
282
+
283
+ #
284
+ # Updates a configuration of a server.
285
+ #
286
+ # @param resource_group_name [String] The name of the resource group that
287
+ # contains the resource. You can obtain this value from the Azure Resource
288
+ # Manager API or the portal.
289
+ # @param server_name [String] The name of the server.
290
+ # @param configuration_name [String] The name of the server configuration.
291
+ # @param parameters [Configuration] The required parameters for updating a
292
+ # server configuration.
293
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
294
+ # will be added to the HTTP request.
295
+ #
296
+ # @return [Configuration] operation results.
297
+ #
298
+ def begin_create_or_update(resource_group_name, server_name, configuration_name, parameters, custom_headers:nil)
299
+ response = begin_create_or_update_async(resource_group_name, server_name, configuration_name, parameters, custom_headers:custom_headers).value!
300
+ response.body unless response.nil?
301
+ end
302
+
303
+ #
304
+ # Updates a configuration of a server.
305
+ #
306
+ # @param resource_group_name [String] The name of the resource group that
307
+ # contains the resource. You can obtain this value from the Azure Resource
308
+ # Manager API or the portal.
309
+ # @param server_name [String] The name of the server.
310
+ # @param configuration_name [String] The name of the server configuration.
311
+ # @param parameters [Configuration] The required parameters for updating a
312
+ # server configuration.
313
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
314
+ # will be added to the HTTP request.
315
+ #
316
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
317
+ #
318
+ def begin_create_or_update_with_http_info(resource_group_name, server_name, configuration_name, parameters, custom_headers:nil)
319
+ begin_create_or_update_async(resource_group_name, server_name, configuration_name, parameters, custom_headers:custom_headers).value!
320
+ end
321
+
322
+ #
323
+ # Updates a configuration of a server.
324
+ #
325
+ # @param resource_group_name [String] The name of the resource group that
326
+ # contains the resource. You can obtain this value from the Azure Resource
327
+ # Manager API or the portal.
328
+ # @param server_name [String] The name of the server.
329
+ # @param configuration_name [String] The name of the server configuration.
330
+ # @param parameters [Configuration] The required parameters for updating a
331
+ # server configuration.
332
+ # @param [Hash{String => String}] A hash of custom headers that will be added
333
+ # to the HTTP request.
334
+ #
335
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
336
+ #
337
+ def begin_create_or_update_async(resource_group_name, server_name, configuration_name, parameters, custom_headers:nil)
338
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
339
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
340
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
341
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
342
+ fail ArgumentError, 'configuration_name is nil' if configuration_name.nil?
343
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
344
+
345
+
346
+ request_headers = {}
347
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
348
+
349
+ # Set Headers
350
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
351
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
352
+
353
+ # Serialize Request
354
+ request_mapper = Azure::Mysql::Mgmt::V2017_12_01::Models::Configuration.mapper()
355
+ request_content = @client.serialize(request_mapper, parameters)
356
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
357
+
358
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/configurations/{configurationName}'
359
+
360
+ request_url = @base_url || @client.base_url
361
+
362
+ options = {
363
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
364
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name,'configurationName' => configuration_name},
365
+ query_params: {'api-version' => @client.api_version},
366
+ body: request_content,
367
+ headers: request_headers.merge(custom_headers || {}),
368
+ base_url: request_url
369
+ }
370
+ promise = @client.make_request_async(:put, path_template, options)
371
+
372
+ promise = promise.then do |result|
373
+ http_response = result.response
374
+ status_code = http_response.status
375
+ response_content = http_response.body
376
+ unless status_code == 200 || status_code == 202
377
+ error_model = JSON.load(response_content)
378
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
379
+ end
380
+
381
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
382
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
383
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
384
+ # Deserialize Response
385
+ if status_code == 200
386
+ begin
387
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
388
+ result_mapper = Azure::Mysql::Mgmt::V2017_12_01::Models::Configuration.mapper()
389
+ result.body = @client.deserialize(result_mapper, parsed_response)
390
+ rescue Exception => e
391
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
392
+ end
393
+ end
394
+
395
+ result
396
+ end
397
+
398
+ promise.execute
399
+ end
400
+
401
+ end
402
+ end