azure_mgmt_mariadb 0.17.3 → 0.17.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84b73ebafa73199b28eedeeaeab2d6a8ac19941bbc9140f5e4d65a0bb05178cc
4
- data.tar.gz: 9cd5efe636f55b78de12b1d3145b82a7a2dd81f397d5ddd8431c86511e0bbfa0
3
+ metadata.gz: ca3b497e5e7079ccc8cf58c24210a4cbf38bc1a9d733f8198eea33b849fd21d2
4
+ data.tar.gz: b9d26e0922ba83550c0f609c0bd59e9eac74ba3f4c87132edf5b4d0a77acccc6
5
5
  SHA512:
6
- metadata.gz: c39203b3a6d23ba55ba579c40de545e1b2551e651819d239d93621b23ddb646d6c88aa0ef77bedb28f9142f2009b038dd0086d053c7ac959f9bc692f5c7bf05d
7
- data.tar.gz: c802ed4df2e1b6e50b84d8f598f1100a57fc1e5551f3ea1e88336751a3f6aaaa90e608538a474bc5930ef2b8c094be283cdd407cacbbe792eabb1e4d96db6b71
6
+ metadata.gz: 2489d044f4bf0cd9053ab1046a4b98173bdb4047b4eb0031f22afd94e0464e40f0a5f879412fb9007a373a472266f7d960ae820fdac35cc48fdfbaf7475c8e67
7
+ data.tar.gz: e00075cc1ad08519401e6177c72f48a310a0d9185d0f2df058206f70bba0b9ec9a60d5d5a6ec0fca685d315094ff419d67969b6324d20aba14456460415e8f56
@@ -165,7 +165,7 @@ module Azure::MariaDB::Mgmt::V2018_06_01_preview
165
165
  #
166
166
  def add_telemetry
167
167
  sdk_information = 'azure_mgmt_mariadb'
168
- sdk_information = "#{sdk_information}/0.17.3"
168
+ sdk_information = "#{sdk_information}/0.17.4"
169
169
  add_user_agent_information(sdk_information)
170
170
  end
171
171
  end
@@ -165,7 +165,7 @@ module Azure::MariaDB::Mgmt::V2018_06_01
165
165
  #
166
166
  def add_telemetry
167
167
  sdk_information = 'azure_mgmt_mariadb'
168
- sdk_information = "#{sdk_information}/0.17.3"
168
+ sdk_information = "#{sdk_information}/0.17.4"
169
169
  add_user_agent_information(sdk_information)
170
170
  end
171
171
  end
@@ -0,0 +1,30 @@
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 '2020-01-01/generated/azure_mgmt_mariadb/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::MariaDB::Mgmt::V2020_01_01
23
+ autoload :Servers, '2020-01-01/generated/azure_mgmt_mariadb/servers.rb'
24
+ autoload :MariaDBManagementClient, '2020-01-01/generated/azure_mgmt_mariadb/maria_dbmanagement_client.rb'
25
+
26
+ module Models
27
+ autoload :ErrorResponse, '2020-01-01/generated/azure_mgmt_mariadb/models/error_response.rb'
28
+ autoload :ErrorAdditionalInfo, '2020-01-01/generated/azure_mgmt_mariadb/models/error_additional_info.rb'
29
+ end
30
+ end
@@ -0,0 +1,131 @@
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::MariaDB::Mgmt::V2020_01_01
7
+ #
8
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class MariaDBManagementClient < MsRestAzure::AzureServiceClient
11
+ include MsRestAzure
12
+ include MsRestAzure::Serialization
13
+
14
+ # @return [String] the base URI of the service.
15
+ attr_accessor :base_url
16
+
17
+ # @return Credentials needed for the client to connect to Azure.
18
+ attr_reader :credentials
19
+
20
+ # @return [String] The ID of the target subscription.
21
+ attr_accessor :subscription_id
22
+
23
+ # @return [String] The API version to use for this operation.
24
+ attr_reader :api_version
25
+
26
+ # @return [String] The preferred language for the response.
27
+ attr_accessor :accept_language
28
+
29
+ # @return [Integer] The retry timeout in seconds for Long Running
30
+ # Operations. Default value is 30.
31
+ attr_accessor :long_running_operation_retry_timeout
32
+
33
+ # @return [Boolean] Whether a unique x-ms-client-request-id should be
34
+ # generated. When set to true a unique x-ms-client-request-id value is
35
+ # generated and included in each request. Default is true.
36
+ attr_accessor :generate_client_request_id
37
+
38
+ # @return [Servers] servers
39
+ attr_reader :servers
40
+
41
+ #
42
+ # Creates initializes a new instance of the MariaDBManagementClient class.
43
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
44
+ # @param base_url [String] the base URI of the service.
45
+ # @param options [Array] filters to be applied to the HTTP requests.
46
+ #
47
+ def initialize(credentials = nil, base_url = nil, options = nil)
48
+ super(credentials, options)
49
+ @base_url = base_url || 'https://management.azure.com'
50
+
51
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
52
+ @credentials = credentials
53
+
54
+ @servers = Servers.new(self)
55
+ @api_version = '2020-01-01'
56
+ @accept_language = 'en-US'
57
+ @long_running_operation_retry_timeout = 30
58
+ @generate_client_request_id = true
59
+ add_telemetry
60
+ end
61
+
62
+ #
63
+ # Makes a request and returns the body of the response.
64
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
65
+ # @param path [String] the path, relative to {base_url}.
66
+ # @param options [Hash{String=>String}] specifying any request options like :body.
67
+ # @return [Hash{String=>String}] containing the body of the response.
68
+ # Example:
69
+ #
70
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
71
+ # path = "/path"
72
+ # options = {
73
+ # body: request_content,
74
+ # query_params: {'api-version' => '2016-02-01'}
75
+ # }
76
+ # result = @client.make_request(:put, path, options)
77
+ #
78
+ def make_request(method, path, options = {})
79
+ result = make_request_with_http_info(method, path, options)
80
+ result.body unless result.nil?
81
+ end
82
+
83
+ #
84
+ # Makes a request and returns the operation response.
85
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
86
+ # @param path [String] the path, relative to {base_url}.
87
+ # @param options [Hash{String=>String}] specifying any request options like :body.
88
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
89
+ #
90
+ def make_request_with_http_info(method, path, options = {})
91
+ result = make_request_async(method, path, options).value!
92
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
93
+ result
94
+ end
95
+
96
+ #
97
+ # Makes a request asynchronously.
98
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
99
+ # @param path [String] the path, relative to {base_url}.
100
+ # @param options [Hash{String=>String}] specifying any request options like :body.
101
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
102
+ #
103
+ def make_request_async(method, path, options = {})
104
+ fail ArgumentError, 'method is nil' if method.nil?
105
+ fail ArgumentError, 'path is nil' if path.nil?
106
+
107
+ request_url = options[:base_url] || @base_url
108
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
109
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
110
+ end
111
+
112
+ request_headers = @request_headers
113
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
114
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
115
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
116
+
117
+ super(request_url, method, path, options)
118
+ end
119
+
120
+
121
+ private
122
+ #
123
+ # Adds telemetry information.
124
+ #
125
+ def add_telemetry
126
+ sdk_information = 'azure_mgmt_mariadb'
127
+ sdk_information = "#{sdk_information}/0.17.4"
128
+ add_user_agent_information(sdk_information)
129
+ end
130
+ end
131
+ end
@@ -0,0 +1,59 @@
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::MariaDB::Mgmt::V2020_01_01
7
+ module Models
8
+ #
9
+ # The resource management error additional info.
10
+ #
11
+ class ErrorAdditionalInfo
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] The additional info type.
16
+ attr_accessor :type
17
+
18
+ # @return The additional info.
19
+ attr_accessor :info
20
+
21
+
22
+ #
23
+ # Mapper for ErrorAdditionalInfo class as Ruby Hash.
24
+ # This will be used for serialization/deserialization.
25
+ #
26
+ def self.mapper()
27
+ {
28
+ client_side_validation: true,
29
+ required: false,
30
+ serialized_name: 'ErrorAdditionalInfo',
31
+ type: {
32
+ name: 'Composite',
33
+ class_name: 'ErrorAdditionalInfo',
34
+ model_properties: {
35
+ type: {
36
+ client_side_validation: true,
37
+ required: false,
38
+ read_only: true,
39
+ serialized_name: 'type',
40
+ type: {
41
+ name: 'String'
42
+ }
43
+ },
44
+ info: {
45
+ client_side_validation: true,
46
+ required: false,
47
+ read_only: true,
48
+ serialized_name: 'info',
49
+ type: {
50
+ name: 'Object'
51
+ }
52
+ }
53
+ }
54
+ }
55
+ }
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,113 @@
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::MariaDB::Mgmt::V2020_01_01
7
+ module Models
8
+ #
9
+ # The resource management error response.
10
+ #
11
+ class ErrorResponse
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] The error code.
16
+ attr_accessor :code
17
+
18
+ # @return [String] The error message.
19
+ attr_accessor :message
20
+
21
+ # @return [String] The error target.
22
+ attr_accessor :target
23
+
24
+ # @return [Array<ErrorResponse>] The error details.
25
+ attr_accessor :details
26
+
27
+ # @return [Array<ErrorAdditionalInfo>] The error additional info.
28
+ attr_accessor :additional_info
29
+
30
+
31
+ #
32
+ # Mapper for ErrorResponse class as Ruby Hash.
33
+ # This will be used for serialization/deserialization.
34
+ #
35
+ def self.mapper()
36
+ {
37
+ client_side_validation: true,
38
+ required: false,
39
+ serialized_name: 'ErrorResponse',
40
+ type: {
41
+ name: 'Composite',
42
+ class_name: 'ErrorResponse',
43
+ model_properties: {
44
+ code: {
45
+ client_side_validation: true,
46
+ required: false,
47
+ read_only: true,
48
+ serialized_name: 'code',
49
+ type: {
50
+ name: 'String'
51
+ }
52
+ },
53
+ message: {
54
+ client_side_validation: true,
55
+ required: false,
56
+ read_only: true,
57
+ serialized_name: 'message',
58
+ type: {
59
+ name: 'String'
60
+ }
61
+ },
62
+ target: {
63
+ client_side_validation: true,
64
+ required: false,
65
+ read_only: true,
66
+ serialized_name: 'target',
67
+ type: {
68
+ name: 'String'
69
+ }
70
+ },
71
+ details: {
72
+ client_side_validation: true,
73
+ required: false,
74
+ read_only: true,
75
+ serialized_name: 'details',
76
+ type: {
77
+ name: 'Sequence',
78
+ element: {
79
+ client_side_validation: true,
80
+ required: false,
81
+ serialized_name: 'ErrorResponseElementType',
82
+ type: {
83
+ name: 'Composite',
84
+ class_name: 'ErrorResponse'
85
+ }
86
+ }
87
+ }
88
+ },
89
+ additional_info: {
90
+ client_side_validation: true,
91
+ required: false,
92
+ read_only: true,
93
+ serialized_name: 'additionalInfo',
94
+ type: {
95
+ name: 'Sequence',
96
+ element: {
97
+ client_side_validation: true,
98
+ required: false,
99
+ serialized_name: 'ErrorAdditionalInfoElementType',
100
+ type: {
101
+ name: 'Composite',
102
+ class_name: 'ErrorAdditionalInfo'
103
+ }
104
+ }
105
+ }
106
+ }
107
+ }
108
+ }
109
+ }
110
+ end
111
+ end
112
+ end
113
+ end
@@ -0,0 +1,9 @@
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 end
7
+ module Azure::MariaDB end
8
+ module Azure::MariaDB::Mgmt end
9
+ module Azure::MariaDB::Mgmt::V2020_01_01 end
@@ -0,0 +1,290 @@
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::MariaDB::Mgmt::V2020_01_01
7
+ #
8
+ # The Microsoft Azure management API provides create, read, update, and
9
+ # delete functionality for Azure MariaDB resources including servers,
10
+ # databases, firewall rules, VNET rules, security alert policies, log files,
11
+ # encryption keys, active directory administrator and configurations.
12
+ #
13
+ class Servers
14
+ include MsRestAzure
15
+
16
+ #
17
+ # Creates and initializes a new instance of the Servers class.
18
+ # @param client service class for accessing basic functionality.
19
+ #
20
+ def initialize(client)
21
+ @client = client
22
+ end
23
+
24
+ # @return [MariaDBManagementClient] reference to the MariaDBManagementClient
25
+ attr_reader :client
26
+
27
+ #
28
+ # Starts a stopped server.
29
+ #
30
+ # @param resource_group_name [String] The name of the resource group. The name
31
+ # is case insensitive.
32
+ # @param server_name [String] The name of the server.
33
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
34
+ # will be added to the HTTP request.
35
+ #
36
+ def start(resource_group_name, server_name, custom_headers:nil)
37
+ response = start_async(resource_group_name, server_name, custom_headers:custom_headers).value!
38
+ nil
39
+ end
40
+
41
+ #
42
+ # @param resource_group_name [String] The name of the resource group. The name
43
+ # is case insensitive.
44
+ # @param server_name [String] The name of the server.
45
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
46
+ # will be added to the HTTP request.
47
+ #
48
+ # @return [Concurrent::Promise] promise which provides async access to http
49
+ # response.
50
+ #
51
+ def start_async(resource_group_name, server_name, custom_headers:nil)
52
+ # Send request
53
+ promise = begin_start_async(resource_group_name, server_name, custom_headers:custom_headers)
54
+
55
+ promise = promise.then do |response|
56
+ # Defining deserialization method.
57
+ deserialize_method = lambda do |parsed_response|
58
+ end
59
+
60
+ # Waiting for response.
61
+ @client.get_long_running_operation_result(response, deserialize_method)
62
+ end
63
+
64
+ promise
65
+ end
66
+
67
+ #
68
+ # Stops a running server.
69
+ #
70
+ # @param resource_group_name [String] The name of the resource group. The name
71
+ # is case insensitive.
72
+ # @param server_name [String] The name of the server.
73
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
74
+ # will be added to the HTTP request.
75
+ #
76
+ def stop(resource_group_name, server_name, custom_headers:nil)
77
+ response = stop_async(resource_group_name, server_name, custom_headers:custom_headers).value!
78
+ nil
79
+ end
80
+
81
+ #
82
+ # @param resource_group_name [String] The name of the resource group. The name
83
+ # is case insensitive.
84
+ # @param server_name [String] The name of the server.
85
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
86
+ # will be added to the HTTP request.
87
+ #
88
+ # @return [Concurrent::Promise] promise which provides async access to http
89
+ # response.
90
+ #
91
+ def stop_async(resource_group_name, server_name, custom_headers:nil)
92
+ # Send request
93
+ promise = begin_stop_async(resource_group_name, server_name, custom_headers:custom_headers)
94
+
95
+ promise = promise.then do |response|
96
+ # Defining deserialization method.
97
+ deserialize_method = lambda do |parsed_response|
98
+ end
99
+
100
+ # Waiting for response.
101
+ @client.get_long_running_operation_result(response, deserialize_method)
102
+ end
103
+
104
+ promise
105
+ end
106
+
107
+ #
108
+ # Starts a stopped server.
109
+ #
110
+ # @param resource_group_name [String] The name of the resource group. The name
111
+ # is case insensitive.
112
+ # @param server_name [String] The name of the server.
113
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
114
+ # will be added to the HTTP request.
115
+ #
116
+ #
117
+ def begin_start(resource_group_name, server_name, custom_headers:nil)
118
+ response = begin_start_async(resource_group_name, server_name, custom_headers:custom_headers).value!
119
+ nil
120
+ end
121
+
122
+ #
123
+ # Starts a stopped server.
124
+ #
125
+ # @param resource_group_name [String] The name of the resource group. The name
126
+ # is case insensitive.
127
+ # @param server_name [String] The name of the server.
128
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
129
+ # will be added to the HTTP request.
130
+ #
131
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
132
+ #
133
+ def begin_start_with_http_info(resource_group_name, server_name, custom_headers:nil)
134
+ begin_start_async(resource_group_name, server_name, custom_headers:custom_headers).value!
135
+ end
136
+
137
+ #
138
+ # Starts a stopped server.
139
+ #
140
+ # @param resource_group_name [String] The name of the resource group. The name
141
+ # is case insensitive.
142
+ # @param server_name [String] The name of the server.
143
+ # @param [Hash{String => String}] A hash of custom headers that will be added
144
+ # to the HTTP request.
145
+ #
146
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
147
+ #
148
+ def begin_start_async(resource_group_name, server_name, custom_headers:nil)
149
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
150
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
151
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
152
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
153
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
154
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
155
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
156
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
157
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
158
+
159
+
160
+ request_headers = {}
161
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
162
+
163
+ # Set Headers
164
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
165
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
166
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/start'
167
+
168
+ request_url = @base_url || @client.base_url
169
+
170
+ options = {
171
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
172
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name},
173
+ query_params: {'api-version' => @client.api_version},
174
+ headers: request_headers.merge(custom_headers || {}),
175
+ base_url: request_url
176
+ }
177
+ promise = @client.make_request_async(:post, path_template, options)
178
+
179
+ promise = promise.then do |result|
180
+ http_response = result.response
181
+ status_code = http_response.status
182
+ response_content = http_response.body
183
+ unless status_code == 200 || status_code == 202
184
+ error_model = JSON.load(response_content)
185
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
186
+ end
187
+
188
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
189
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
190
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
191
+
192
+ result
193
+ end
194
+
195
+ promise.execute
196
+ end
197
+
198
+ #
199
+ # Stops a running server.
200
+ #
201
+ # @param resource_group_name [String] The name of the resource group. The name
202
+ # is case insensitive.
203
+ # @param server_name [String] The name of the server.
204
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
205
+ # will be added to the HTTP request.
206
+ #
207
+ #
208
+ def begin_stop(resource_group_name, server_name, custom_headers:nil)
209
+ response = begin_stop_async(resource_group_name, server_name, custom_headers:custom_headers).value!
210
+ nil
211
+ end
212
+
213
+ #
214
+ # Stops a running server.
215
+ #
216
+ # @param resource_group_name [String] The name of the resource group. The name
217
+ # is case insensitive.
218
+ # @param server_name [String] The name of the server.
219
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
220
+ # will be added to the HTTP request.
221
+ #
222
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
223
+ #
224
+ def begin_stop_with_http_info(resource_group_name, server_name, custom_headers:nil)
225
+ begin_stop_async(resource_group_name, server_name, custom_headers:custom_headers).value!
226
+ end
227
+
228
+ #
229
+ # Stops a running server.
230
+ #
231
+ # @param resource_group_name [String] The name of the resource group. The name
232
+ # is case insensitive.
233
+ # @param server_name [String] The name of the server.
234
+ # @param [Hash{String => String}] A hash of custom headers that will be added
235
+ # to the HTTP request.
236
+ #
237
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
238
+ #
239
+ def begin_stop_async(resource_group_name, server_name, custom_headers:nil)
240
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
241
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
242
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
243
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
244
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
245
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
246
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
247
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
248
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
249
+
250
+
251
+ request_headers = {}
252
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
253
+
254
+ # Set Headers
255
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
256
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
257
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/stop'
258
+
259
+ request_url = @base_url || @client.base_url
260
+
261
+ options = {
262
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
263
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'serverName' => server_name},
264
+ query_params: {'api-version' => @client.api_version},
265
+ headers: request_headers.merge(custom_headers || {}),
266
+ base_url: request_url
267
+ }
268
+ promise = @client.make_request_async(:post, path_template, options)
269
+
270
+ promise = promise.then do |result|
271
+ http_response = result.response
272
+ status_code = http_response.status
273
+ response_content = http_response.body
274
+ unless status_code == 200 || status_code == 202
275
+ error_model = JSON.load(response_content)
276
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
277
+ end
278
+
279
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
280
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
281
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
282
+
283
+ result
284
+ end
285
+
286
+ promise.execute
287
+ end
288
+
289
+ end
290
+ end
@@ -4,4 +4,5 @@
4
4
 
5
5
  require '2018-06-01/generated/azure_mgmt_mariadb'
6
6
  require '2018-06-01-preview/generated/azure_mgmt_mariadb'
7
+ require '2020-01-01/generated/azure_mgmt_mariadb'
7
8
  require 'profiles/latest/mariadb_latest_profile_client'
@@ -6,7 +6,6 @@ require 'azure_mgmt_mariadb'
6
6
 
7
7
  module Azure::MariaDB::Profiles::Latest
8
8
  module Mgmt
9
- Servers = Azure::MariaDB::Mgmt::V2018_06_01::Servers
10
9
  Replicas = Azure::MariaDB::Mgmt::V2018_06_01::Replicas
11
10
  FirewallRules = Azure::MariaDB::Mgmt::V2018_06_01::FirewallRules
12
11
  VirtualNetworkRules = Azure::MariaDB::Mgmt::V2018_06_01::VirtualNetworkRules
@@ -17,6 +16,7 @@ module Azure::MariaDB::Profiles::Latest
17
16
  CheckNameAvailability = Azure::MariaDB::Mgmt::V2018_06_01::CheckNameAvailability
18
17
  ServerSecurityAlertPolicies = Azure::MariaDB::Mgmt::V2018_06_01::ServerSecurityAlertPolicies
19
18
  Operations = Azure::MariaDB::Mgmt::V2018_06_01::Operations
19
+ Servers = Azure::MariaDB::Mgmt::V2020_01_01::Servers
20
20
 
21
21
  module Models
22
22
  VirtualNetworkRuleListResult = Azure::MariaDB::Mgmt::V2018_06_01::Models::VirtualNetworkRuleListResult
@@ -60,13 +60,15 @@ module Azure::MariaDB::Profiles::Latest
60
60
  VirtualNetworkRuleState = Azure::MariaDB::Mgmt::V2018_06_01::Models::VirtualNetworkRuleState
61
61
  OperationOrigin = Azure::MariaDB::Mgmt::V2018_06_01::Models::OperationOrigin
62
62
  ServerSecurityAlertPolicyState = Azure::MariaDB::Mgmt::V2018_06_01::Models::ServerSecurityAlertPolicyState
63
+ ErrorResponse = Azure::MariaDB::Mgmt::V2020_01_01::Models::ErrorResponse
64
+ ErrorAdditionalInfo = Azure::MariaDB::Mgmt::V2020_01_01::Models::ErrorAdditionalInfo
63
65
  end
64
66
 
65
67
  #
66
68
  # MariaDBManagementClass
67
69
  #
68
70
  class MariaDBManagementClass
69
- attr_reader :servers, :replicas, :firewall_rules, :virtual_network_rules, :databases, :configurations, :log_files, :location_based_performance_tier, :check_name_availability, :server_security_alert_policies, :operations, :configurable, :base_url, :options, :model_classes
71
+ attr_reader :replicas, :firewall_rules, :virtual_network_rules, :databases, :configurations, :log_files, :location_based_performance_tier, :check_name_availability, :server_security_alert_policies, :operations, :servers, :configurable, :base_url, :options, :model_classes
70
72
 
71
73
  def initialize(options = {})
72
74
  if options.is_a?(Hash) && options.length == 0
@@ -86,7 +88,6 @@ module Azure::MariaDB::Profiles::Latest
86
88
  @client_0.subscription_id = configurable.subscription_id
87
89
  end
88
90
  add_telemetry(@client_0)
89
- @servers = @client_0.servers
90
91
  @replicas = @client_0.replicas
91
92
  @firewall_rules = @client_0.firewall_rules
92
93
  @virtual_network_rules = @client_0.virtual_network_rules
@@ -98,6 +99,13 @@ module Azure::MariaDB::Profiles::Latest
98
99
  @server_security_alert_policies = @client_0.server_security_alert_policies
99
100
  @operations = @client_0.operations
100
101
 
102
+ @client_1 = Azure::MariaDB::Mgmt::V2020_01_01::MariaDBManagementClient.new(configurable.credentials, base_url, options)
103
+ if(@client_1.respond_to?(:subscription_id))
104
+ @client_1.subscription_id = configurable.subscription_id
105
+ end
106
+ add_telemetry(@client_1)
107
+ @servers = @client_1.servers
108
+
101
109
  @model_classes = ModelClasses.new
102
110
  end
103
111
 
@@ -107,7 +115,9 @@ module Azure::MariaDB::Profiles::Latest
107
115
  end
108
116
 
109
117
  def method_missing(method, *args)
110
- if @client_0.respond_to?method
118
+ if @client_1.respond_to?method
119
+ @client_1.send(method, *args)
120
+ elsif @client_0.respond_to?method
111
121
  @client_0.send(method, *args)
112
122
  else
113
123
  super
@@ -240,6 +250,12 @@ module Azure::MariaDB::Profiles::Latest
240
250
  def server_security_alert_policy_state
241
251
  Azure::MariaDB::Mgmt::V2018_06_01::Models::ServerSecurityAlertPolicyState
242
252
  end
253
+ def error_response
254
+ Azure::MariaDB::Mgmt::V2020_01_01::Models::ErrorResponse
255
+ end
256
+ def error_additional_info
257
+ Azure::MariaDB::Mgmt::V2020_01_01::Models::ErrorAdditionalInfo
258
+ end
243
259
  end
244
260
  end
245
261
  end
@@ -3,5 +3,5 @@
3
3
  # Licensed under the MIT License. See License.txt in the project root for license information.
4
4
 
5
5
  module Azure::MariaDB::Mgmt
6
- VERSION = '0.17.3'
6
+ VERSION = '0.17.4'
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: azure_mgmt_mariadb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.3
4
+ version: 0.17.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Microsoft Corporation
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-02 00:00:00.000000000 Z
11
+ date: 2020-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -199,6 +199,12 @@ files:
199
199
  - lib/2018-06-01/generated/azure_mgmt_mariadb/server_security_alert_policies.rb
200
200
  - lib/2018-06-01/generated/azure_mgmt_mariadb/servers.rb
201
201
  - lib/2018-06-01/generated/azure_mgmt_mariadb/virtual_network_rules.rb
202
+ - lib/2020-01-01/generated/azure_mgmt_mariadb.rb
203
+ - lib/2020-01-01/generated/azure_mgmt_mariadb/maria_dbmanagement_client.rb
204
+ - lib/2020-01-01/generated/azure_mgmt_mariadb/models/error_additional_info.rb
205
+ - lib/2020-01-01/generated/azure_mgmt_mariadb/models/error_response.rb
206
+ - lib/2020-01-01/generated/azure_mgmt_mariadb/module_definition.rb
207
+ - lib/2020-01-01/generated/azure_mgmt_mariadb/servers.rb
202
208
  - lib/azure_mgmt_mariadb.rb
203
209
  - lib/module_definition.rb
204
210
  - lib/profiles/latest/mariadb_latest_profile_client.rb