azure_mgmt_sql 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ab0c40061cdecef1ebd6074b9a043e1e85b1c333
|
|
4
|
+
data.tar.gz: 5027386d26c94aad6f6a0b2e909368d49249f8a7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d70541b77c8d997c1464b0eb8aed6cbd32b68e2fadc8e49afde42e217979d9fe031427a560741b61547febe78f1f46352df8b5c4b1305cb97e77fe05431274ea
|
|
7
|
+
data.tar.gz: d5e5e3fe08c2698175db5ea776e10690e30d8694ce4eb640dd08ba91b59849240ad7571c44450b24fa53b74d32388d64d31448e596b3b94b5419b152f933cdef
|
|
@@ -148,31 +148,28 @@ module Azure::ARM::SQL
|
|
|
148
148
|
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
|
149
149
|
|
|
150
150
|
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/Default'
|
|
151
|
+
|
|
152
|
+
request_url = @base_url || @client.base_url
|
|
153
|
+
|
|
151
154
|
options = {
|
|
152
155
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
153
156
|
path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'subscriptionId' => @client.subscription_id},
|
|
154
157
|
query_params: {'api-version' => @client.api_version},
|
|
155
158
|
body: request_content,
|
|
156
|
-
headers: request_headers.merge(custom_headers || {})
|
|
159
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
160
|
+
base_url: request_url
|
|
157
161
|
}
|
|
162
|
+
promise = @client.make_request_async(:put, path_template, options)
|
|
158
163
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
request = MsRest::HttpOperationRequest.new(request_url, path_template, :put, options)
|
|
162
|
-
promise = request.run_promise do |req|
|
|
163
|
-
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
164
|
-
end
|
|
165
|
-
|
|
166
|
-
promise = promise.then do |http_response|
|
|
164
|
+
promise = promise.then do |result|
|
|
165
|
+
http_response = result.response
|
|
167
166
|
status_code = http_response.status
|
|
168
167
|
response_content = http_response.body
|
|
169
168
|
unless status_code == 200 || status_code == 201
|
|
170
169
|
error_model = JSON.load(response_content)
|
|
171
|
-
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
170
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
172
171
|
end
|
|
173
172
|
|
|
174
|
-
# Create Result
|
|
175
|
-
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
176
173
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
177
174
|
# Deserialize Response
|
|
178
175
|
if status_code == 200
|
|
@@ -256,30 +253,27 @@ module Azure::ARM::SQL
|
|
|
256
253
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
257
254
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
258
255
|
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/Default'
|
|
256
|
+
|
|
257
|
+
request_url = @base_url || @client.base_url
|
|
258
|
+
|
|
259
259
|
options = {
|
|
260
260
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
261
261
|
path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'subscriptionId' => @client.subscription_id},
|
|
262
262
|
query_params: {'api-version' => @client.api_version},
|
|
263
|
-
headers: request_headers.merge(custom_headers || {})
|
|
263
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
264
|
+
base_url: request_url
|
|
264
265
|
}
|
|
266
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
265
267
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
|
|
269
|
-
promise = request.run_promise do |req|
|
|
270
|
-
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
271
|
-
end
|
|
272
|
-
|
|
273
|
-
promise = promise.then do |http_response|
|
|
268
|
+
promise = promise.then do |result|
|
|
269
|
+
http_response = result.response
|
|
274
270
|
status_code = http_response.status
|
|
275
271
|
response_content = http_response.body
|
|
276
272
|
unless status_code == 200
|
|
277
273
|
error_model = JSON.load(response_content)
|
|
278
|
-
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
274
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
279
275
|
end
|
|
280
276
|
|
|
281
|
-
# Create Result
|
|
282
|
-
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
283
277
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
284
278
|
# Deserialize Response
|
|
285
279
|
if status_code == 200
|
|
@@ -35,10 +35,6 @@ module Azure::ARM::SQL
|
|
|
35
35
|
# is generated and included in each request. Default is true.
|
|
36
36
|
attr_accessor :generate_client_request_id
|
|
37
37
|
|
|
38
|
-
# @return Subscription credentials which uniquely identify client
|
|
39
|
-
# subscription.
|
|
40
|
-
attr_accessor :credentials
|
|
41
|
-
|
|
42
38
|
# @return [SecurityAlertPolicy] security_alert_policy
|
|
43
39
|
attr_reader :security_alert_policy
|
|
44
40
|
|
|
@@ -63,5 +59,60 @@ module Azure::ARM::SQL
|
|
|
63
59
|
@generate_client_request_id = true
|
|
64
60
|
end
|
|
65
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
|
+
|
|
109
|
+
request_headers = @request_headers
|
|
110
|
+
request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
|
|
111
|
+
options.merge!({headers: request_headers.merge(options[:headers] || {})})
|
|
112
|
+
options.merge!({credentials: @credentials}) unless @credentials.nil?
|
|
113
|
+
|
|
114
|
+
super(request_url, method, path, options)
|
|
115
|
+
end
|
|
116
|
+
|
|
66
117
|
end
|
|
67
118
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: azure_mgmt_sql
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Microsoft Corporation
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-10-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -72,14 +72,14 @@ dependencies:
|
|
|
72
72
|
requirements:
|
|
73
73
|
- - "~>"
|
|
74
74
|
- !ruby/object:Gem::Version
|
|
75
|
-
version: 0.
|
|
75
|
+
version: 0.6.0
|
|
76
76
|
type: :runtime
|
|
77
77
|
prerelease: false
|
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
79
|
requirements:
|
|
80
80
|
- - "~>"
|
|
81
81
|
- !ruby/object:Gem::Version
|
|
82
|
-
version: 0.
|
|
82
|
+
version: 0.6.0
|
|
83
83
|
description: Microsoft Azure SQL Management Client Library for Ruby
|
|
84
84
|
email: azrubyteam@microsoft.com
|
|
85
85
|
executables: []
|
|
@@ -109,7 +109,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
109
109
|
requirements:
|
|
110
110
|
- - ">="
|
|
111
111
|
- !ruby/object:Gem::Version
|
|
112
|
-
version:
|
|
112
|
+
version: 2.0.0
|
|
113
113
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
114
|
requirements:
|
|
115
115
|
- - ">="
|