azure_mgmt_sql 0.18.0 → 0.19.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 +4 -4
- data/lib/2014-04-01/generated/azure_mgmt_sql/sql_management_client.rb +1 -1
- data/lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb +1 -1
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql.rb +18 -16
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/database_blob_auditing_policies.rb +219 -0
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/managed_instance_administrators.rb +26 -39
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/database_blob_auditing_policy.rb +15 -1
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/database_blob_auditing_policy_list_result.rb +100 -0
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/database_vulnerability_assessment.rb +2 -2
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/extended_database_blob_auditing_policy.rb +15 -1
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/extended_server_blob_auditing_policy.rb +15 -1
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/server_blob_auditing_policy.rb +15 -1
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/server_blob_auditing_policy_list_result.rb +100 -0
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/server_blob_auditing_policies.rb +214 -0
- data/lib/2017-03-01-preview/generated/azure_mgmt_sql/sql_management_client.rb +1 -1
- data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/database_vulnerability_assessment.rb +2 -2
- data/lib/2017-10-01-preview/generated/azure_mgmt_sql/sql_management_client.rb +1 -1
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/models/managed_instance_vulnerability_assessment.rb +2 -2
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/models/server_vulnerability_assessment.rb +2 -2
- data/lib/2018-06-01-preview/generated/azure_mgmt_sql/sql_management_client.rb +1 -1
- data/lib/profiles/latest/modules/sql_profile_module.rb +56 -48
- data/lib/version.rb +1 -1
- metadata +4 -2
data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/database_blob_auditing_policy.rb
CHANGED
@@ -22,7 +22,7 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
|
|
22
22
|
|
23
23
|
# @return [String] Specifies the blob storage endpoint (e.g.
|
24
24
|
# https://MyAccount.blob.core.windows.net). If state is Enabled,
|
25
|
-
# storageEndpoint is required.
|
25
|
+
# storageEndpoint or isAzureMonitorTargetEnabled is required.
|
26
26
|
attr_accessor :storage_endpoint
|
27
27
|
|
28
28
|
# @return [String] Specifies the identifier key of the auditing storage
|
@@ -137,6 +137,12 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
|
|
137
137
|
#
|
138
138
|
attr_accessor :is_azure_monitor_target_enabled
|
139
139
|
|
140
|
+
# @return [Integer] Specifies the amount of time in milliseconds that can
|
141
|
+
# elapse before audit actions are forced to be processed.
|
142
|
+
# The default minimum value is 1000 (1 second). The maximum is
|
143
|
+
# 2,147,483,647.
|
144
|
+
attr_accessor :queue_delay_ms
|
145
|
+
|
140
146
|
|
141
147
|
#
|
142
148
|
# Mapper for DatabaseBlobAuditingPolicy class as Ruby Hash.
|
@@ -259,6 +265,14 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
|
|
259
265
|
type: {
|
260
266
|
name: 'Boolean'
|
261
267
|
}
|
268
|
+
},
|
269
|
+
queue_delay_ms: {
|
270
|
+
client_side_validation: true,
|
271
|
+
required: false,
|
272
|
+
serialized_name: 'properties.queueDelayMs',
|
273
|
+
type: {
|
274
|
+
name: 'Number'
|
275
|
+
}
|
262
276
|
}
|
263
277
|
}
|
264
278
|
}
|
@@ -0,0 +1,100 @@
|
|
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
|
+
module Models
|
8
|
+
#
|
9
|
+
# A list of database auditing settings.
|
10
|
+
#
|
11
|
+
class DatabaseBlobAuditingPolicyListResult
|
12
|
+
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
include MsRest::JSONable
|
16
|
+
# @return [Array<DatabaseBlobAuditingPolicy>] Array of results.
|
17
|
+
attr_accessor :value
|
18
|
+
|
19
|
+
# @return [String] Link to retrieve next page of results.
|
20
|
+
attr_accessor :next_link
|
21
|
+
|
22
|
+
# return [Proc] with next page method call.
|
23
|
+
attr_accessor :next_method
|
24
|
+
|
25
|
+
#
|
26
|
+
# Gets the rest of the items for the request, enabling auto-pagination.
|
27
|
+
#
|
28
|
+
# @return [Array<DatabaseBlobAuditingPolicy>] operation results.
|
29
|
+
#
|
30
|
+
def get_all_items
|
31
|
+
items = @value
|
32
|
+
page = self
|
33
|
+
while page.next_link != nil && !page.next_link.strip.empty? do
|
34
|
+
page = page.get_next_page
|
35
|
+
items.concat(page.value)
|
36
|
+
end
|
37
|
+
items
|
38
|
+
end
|
39
|
+
|
40
|
+
#
|
41
|
+
# Gets the next page of results.
|
42
|
+
#
|
43
|
+
# @return [DatabaseBlobAuditingPolicyListResult] with next page content.
|
44
|
+
#
|
45
|
+
def get_next_page
|
46
|
+
response = @next_method.call(@next_link).value! unless @next_method.nil?
|
47
|
+
unless response.nil?
|
48
|
+
@next_link = response.body.next_link
|
49
|
+
@value = response.body.value
|
50
|
+
self
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
#
|
55
|
+
# Mapper for DatabaseBlobAuditingPolicyListResult class as Ruby Hash.
|
56
|
+
# This will be used for serialization/deserialization.
|
57
|
+
#
|
58
|
+
def self.mapper()
|
59
|
+
{
|
60
|
+
client_side_validation: true,
|
61
|
+
required: false,
|
62
|
+
serialized_name: 'DatabaseBlobAuditingPolicyListResult',
|
63
|
+
type: {
|
64
|
+
name: 'Composite',
|
65
|
+
class_name: 'DatabaseBlobAuditingPolicyListResult',
|
66
|
+
model_properties: {
|
67
|
+
value: {
|
68
|
+
client_side_validation: true,
|
69
|
+
required: false,
|
70
|
+
read_only: true,
|
71
|
+
serialized_name: 'value',
|
72
|
+
type: {
|
73
|
+
name: 'Sequence',
|
74
|
+
element: {
|
75
|
+
client_side_validation: true,
|
76
|
+
required: false,
|
77
|
+
serialized_name: 'DatabaseBlobAuditingPolicyElementType',
|
78
|
+
type: {
|
79
|
+
name: 'Composite',
|
80
|
+
class_name: 'DatabaseBlobAuditingPolicy'
|
81
|
+
}
|
82
|
+
}
|
83
|
+
}
|
84
|
+
},
|
85
|
+
next_link: {
|
86
|
+
client_side_validation: true,
|
87
|
+
required: false,
|
88
|
+
read_only: true,
|
89
|
+
serialized_name: 'nextLink',
|
90
|
+
type: {
|
91
|
+
name: 'String'
|
92
|
+
}
|
93
|
+
}
|
94
|
+
}
|
95
|
+
}
|
96
|
+
}
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/database_vulnerability_assessment.rb
CHANGED
@@ -17,8 +17,8 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
|
|
17
17
|
# required if server level vulnerability assessment policy doesn't set
|
18
18
|
attr_accessor :storage_container_path
|
19
19
|
|
20
|
-
# @return [String] A shared access signature (SAS Key) that has
|
21
|
-
# access to the blob container specified in 'storageContainerPath'
|
20
|
+
# @return [String] A shared access signature (SAS Key) that has read and
|
21
|
+
# write access to the blob container specified in 'storageContainerPath'
|
22
22
|
# parameter. If 'storageAccountAccessKey' isn't specified,
|
23
23
|
# StorageContainerSasKey is required.
|
24
24
|
attr_accessor :storage_container_sas_key
|
@@ -23,7 +23,7 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
|
|
23
23
|
|
24
24
|
# @return [String] Specifies the blob storage endpoint (e.g.
|
25
25
|
# https://MyAccount.blob.core.windows.net). If state is Enabled,
|
26
|
-
# storageEndpoint is required.
|
26
|
+
# storageEndpoint or isAzureMonitorTargetEnabled is required.
|
27
27
|
attr_accessor :storage_endpoint
|
28
28
|
|
29
29
|
# @return [String] Specifies the identifier key of the auditing storage
|
@@ -138,6 +138,12 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
|
|
138
138
|
#
|
139
139
|
attr_accessor :is_azure_monitor_target_enabled
|
140
140
|
|
141
|
+
# @return [Integer] Specifies the amount of time in milliseconds that can
|
142
|
+
# elapse before audit actions are forced to be processed.
|
143
|
+
# The default minimum value is 1000 (1 second). The maximum is
|
144
|
+
# 2,147,483,647.
|
145
|
+
attr_accessor :queue_delay_ms
|
146
|
+
|
141
147
|
|
142
148
|
#
|
143
149
|
# Mapper for ExtendedDatabaseBlobAuditingPolicy class as Ruby Hash.
|
@@ -259,6 +265,14 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
|
|
259
265
|
type: {
|
260
266
|
name: 'Boolean'
|
261
267
|
}
|
268
|
+
},
|
269
|
+
queue_delay_ms: {
|
270
|
+
client_side_validation: true,
|
271
|
+
required: false,
|
272
|
+
serialized_name: 'properties.queueDelayMs',
|
273
|
+
type: {
|
274
|
+
name: 'Number'
|
275
|
+
}
|
262
276
|
}
|
263
277
|
}
|
264
278
|
}
|
data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/extended_server_blob_auditing_policy.rb
CHANGED
@@ -23,7 +23,7 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
|
|
23
23
|
|
24
24
|
# @return [String] Specifies the blob storage endpoint (e.g.
|
25
25
|
# https://MyAccount.blob.core.windows.net). If state is Enabled,
|
26
|
-
# storageEndpoint is required.
|
26
|
+
# storageEndpoint or isAzureMonitorTargetEnabled is required.
|
27
27
|
attr_accessor :storage_endpoint
|
28
28
|
|
29
29
|
# @return [String] Specifies the identifier key of the auditing storage
|
@@ -138,6 +138,12 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
|
|
138
138
|
#
|
139
139
|
attr_accessor :is_azure_monitor_target_enabled
|
140
140
|
|
141
|
+
# @return [Integer] Specifies the amount of time in milliseconds that can
|
142
|
+
# elapse before audit actions are forced to be processed.
|
143
|
+
# The default minimum value is 1000 (1 second). The maximum is
|
144
|
+
# 2,147,483,647.
|
145
|
+
attr_accessor :queue_delay_ms
|
146
|
+
|
141
147
|
|
142
148
|
#
|
143
149
|
# Mapper for ExtendedServerBlobAuditingPolicy class as Ruby Hash.
|
@@ -259,6 +265,14 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
|
|
259
265
|
type: {
|
260
266
|
name: 'Boolean'
|
261
267
|
}
|
268
|
+
},
|
269
|
+
queue_delay_ms: {
|
270
|
+
client_side_validation: true,
|
271
|
+
required: false,
|
272
|
+
serialized_name: 'properties.queueDelayMs',
|
273
|
+
type: {
|
274
|
+
name: 'Number'
|
275
|
+
}
|
262
276
|
}
|
263
277
|
}
|
264
278
|
}
|
@@ -19,7 +19,7 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
|
|
19
19
|
|
20
20
|
# @return [String] Specifies the blob storage endpoint (e.g.
|
21
21
|
# https://MyAccount.blob.core.windows.net). If state is Enabled,
|
22
|
-
# storageEndpoint is required.
|
22
|
+
# storageEndpoint or isAzureMonitorTargetEnabled is required.
|
23
23
|
attr_accessor :storage_endpoint
|
24
24
|
|
25
25
|
# @return [String] Specifies the identifier key of the auditing storage
|
@@ -134,6 +134,12 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
|
|
134
134
|
#
|
135
135
|
attr_accessor :is_azure_monitor_target_enabled
|
136
136
|
|
137
|
+
# @return [Integer] Specifies the amount of time in milliseconds that can
|
138
|
+
# elapse before audit actions are forced to be processed.
|
139
|
+
# The default minimum value is 1000 (1 second). The maximum is
|
140
|
+
# 2,147,483,647.
|
141
|
+
attr_accessor :queue_delay_ms
|
142
|
+
|
137
143
|
|
138
144
|
#
|
139
145
|
# Mapper for ServerBlobAuditingPolicy class as Ruby Hash.
|
@@ -247,6 +253,14 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
|
|
247
253
|
type: {
|
248
254
|
name: 'Boolean'
|
249
255
|
}
|
256
|
+
},
|
257
|
+
queue_delay_ms: {
|
258
|
+
client_side_validation: true,
|
259
|
+
required: false,
|
260
|
+
serialized_name: 'properties.queueDelayMs',
|
261
|
+
type: {
|
262
|
+
name: 'Number'
|
263
|
+
}
|
250
264
|
}
|
251
265
|
}
|
252
266
|
}
|
@@ -0,0 +1,100 @@
|
|
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
|
+
module Models
|
8
|
+
#
|
9
|
+
# A list of server auditing settings.
|
10
|
+
#
|
11
|
+
class ServerBlobAuditingPolicyListResult
|
12
|
+
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
include MsRest::JSONable
|
16
|
+
# @return [Array<ServerBlobAuditingPolicy>] Array of results.
|
17
|
+
attr_accessor :value
|
18
|
+
|
19
|
+
# @return [String] Link to retrieve next page of results.
|
20
|
+
attr_accessor :next_link
|
21
|
+
|
22
|
+
# return [Proc] with next page method call.
|
23
|
+
attr_accessor :next_method
|
24
|
+
|
25
|
+
#
|
26
|
+
# Gets the rest of the items for the request, enabling auto-pagination.
|
27
|
+
#
|
28
|
+
# @return [Array<ServerBlobAuditingPolicy>] operation results.
|
29
|
+
#
|
30
|
+
def get_all_items
|
31
|
+
items = @value
|
32
|
+
page = self
|
33
|
+
while page.next_link != nil && !page.next_link.strip.empty? do
|
34
|
+
page = page.get_next_page
|
35
|
+
items.concat(page.value)
|
36
|
+
end
|
37
|
+
items
|
38
|
+
end
|
39
|
+
|
40
|
+
#
|
41
|
+
# Gets the next page of results.
|
42
|
+
#
|
43
|
+
# @return [ServerBlobAuditingPolicyListResult] with next page content.
|
44
|
+
#
|
45
|
+
def get_next_page
|
46
|
+
response = @next_method.call(@next_link).value! unless @next_method.nil?
|
47
|
+
unless response.nil?
|
48
|
+
@next_link = response.body.next_link
|
49
|
+
@value = response.body.value
|
50
|
+
self
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
#
|
55
|
+
# Mapper for ServerBlobAuditingPolicyListResult class as Ruby Hash.
|
56
|
+
# This will be used for serialization/deserialization.
|
57
|
+
#
|
58
|
+
def self.mapper()
|
59
|
+
{
|
60
|
+
client_side_validation: true,
|
61
|
+
required: false,
|
62
|
+
serialized_name: 'ServerBlobAuditingPolicyListResult',
|
63
|
+
type: {
|
64
|
+
name: 'Composite',
|
65
|
+
class_name: 'ServerBlobAuditingPolicyListResult',
|
66
|
+
model_properties: {
|
67
|
+
value: {
|
68
|
+
client_side_validation: true,
|
69
|
+
required: false,
|
70
|
+
read_only: true,
|
71
|
+
serialized_name: 'value',
|
72
|
+
type: {
|
73
|
+
name: 'Sequence',
|
74
|
+
element: {
|
75
|
+
client_side_validation: true,
|
76
|
+
required: false,
|
77
|
+
serialized_name: 'ServerBlobAuditingPolicyElementType',
|
78
|
+
type: {
|
79
|
+
name: 'Composite',
|
80
|
+
class_name: 'ServerBlobAuditingPolicy'
|
81
|
+
}
|
82
|
+
}
|
83
|
+
}
|
84
|
+
},
|
85
|
+
next_link: {
|
86
|
+
client_side_validation: true,
|
87
|
+
required: false,
|
88
|
+
read_only: true,
|
89
|
+
serialized_name: 'nextLink',
|
90
|
+
type: {
|
91
|
+
name: 'String'
|
92
|
+
}
|
93
|
+
}
|
94
|
+
}
|
95
|
+
}
|
96
|
+
}
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
@@ -175,6 +175,106 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
|
|
175
175
|
promise
|
176
176
|
end
|
177
177
|
|
178
|
+
#
|
179
|
+
# Lists auditing settings of a server.
|
180
|
+
#
|
181
|
+
# @param resource_group_name [String] The name of the resource group that
|
182
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
183
|
+
# Manager API or the portal.
|
184
|
+
# @param server_name [String] The name of the server.
|
185
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
186
|
+
# will be added to the HTTP request.
|
187
|
+
#
|
188
|
+
# @return [Array<ServerBlobAuditingPolicy>] operation results.
|
189
|
+
#
|
190
|
+
def list_by_server(resource_group_name, server_name, custom_headers:nil)
|
191
|
+
first_page = list_by_server_as_lazy(resource_group_name, server_name, custom_headers:custom_headers)
|
192
|
+
first_page.get_all_items
|
193
|
+
end
|
194
|
+
|
195
|
+
#
|
196
|
+
# Lists auditing settings of a server.
|
197
|
+
#
|
198
|
+
# @param resource_group_name [String] The name of the resource group that
|
199
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
200
|
+
# Manager API or the portal.
|
201
|
+
# @param server_name [String] The name of the server.
|
202
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
203
|
+
# will be added to the HTTP request.
|
204
|
+
#
|
205
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
206
|
+
#
|
207
|
+
def list_by_server_with_http_info(resource_group_name, server_name, custom_headers:nil)
|
208
|
+
list_by_server_async(resource_group_name, server_name, custom_headers:custom_headers).value!
|
209
|
+
end
|
210
|
+
|
211
|
+
#
|
212
|
+
# Lists auditing settings of a server.
|
213
|
+
#
|
214
|
+
# @param resource_group_name [String] The name of the resource group that
|
215
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
216
|
+
# Manager API or the portal.
|
217
|
+
# @param server_name [String] The name of the server.
|
218
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
219
|
+
# to the HTTP request.
|
220
|
+
#
|
221
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
222
|
+
#
|
223
|
+
def list_by_server_async(resource_group_name, server_name, custom_headers:nil)
|
224
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
225
|
+
fail ArgumentError, 'server_name is nil' if server_name.nil?
|
226
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
227
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
228
|
+
|
229
|
+
|
230
|
+
request_headers = {}
|
231
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
232
|
+
|
233
|
+
# Set Headers
|
234
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
235
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
236
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings'
|
237
|
+
|
238
|
+
request_url = @base_url || @client.base_url
|
239
|
+
|
240
|
+
options = {
|
241
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
242
|
+
path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'subscriptionId' => @client.subscription_id},
|
243
|
+
query_params: {'api-version' => @client.api_version},
|
244
|
+
headers: request_headers.merge(custom_headers || {}),
|
245
|
+
base_url: request_url
|
246
|
+
}
|
247
|
+
promise = @client.make_request_async(:get, path_template, options)
|
248
|
+
|
249
|
+
promise = promise.then do |result|
|
250
|
+
http_response = result.response
|
251
|
+
status_code = http_response.status
|
252
|
+
response_content = http_response.body
|
253
|
+
unless status_code == 200
|
254
|
+
error_model = JSON.load(response_content)
|
255
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
256
|
+
end
|
257
|
+
|
258
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
259
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
260
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
261
|
+
# Deserialize Response
|
262
|
+
if status_code == 200
|
263
|
+
begin
|
264
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
265
|
+
result_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::ServerBlobAuditingPolicyListResult.mapper()
|
266
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
267
|
+
rescue Exception => e
|
268
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
269
|
+
end
|
270
|
+
end
|
271
|
+
|
272
|
+
result
|
273
|
+
end
|
274
|
+
|
275
|
+
promise.execute
|
276
|
+
end
|
277
|
+
|
178
278
|
#
|
179
279
|
# Creates or updates a server's blob auditing policy.
|
180
280
|
#
|
@@ -290,5 +390,119 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
|
|
290
390
|
promise.execute
|
291
391
|
end
|
292
392
|
|
393
|
+
#
|
394
|
+
# Lists auditing settings of a server.
|
395
|
+
#
|
396
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
397
|
+
# to List operation.
|
398
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
399
|
+
# will be added to the HTTP request.
|
400
|
+
#
|
401
|
+
# @return [ServerBlobAuditingPolicyListResult] operation results.
|
402
|
+
#
|
403
|
+
def list_by_server_next(next_page_link, custom_headers:nil)
|
404
|
+
response = list_by_server_next_async(next_page_link, custom_headers:custom_headers).value!
|
405
|
+
response.body unless response.nil?
|
406
|
+
end
|
407
|
+
|
408
|
+
#
|
409
|
+
# Lists auditing settings of a server.
|
410
|
+
#
|
411
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
412
|
+
# to List operation.
|
413
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
414
|
+
# will be added to the HTTP request.
|
415
|
+
#
|
416
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
417
|
+
#
|
418
|
+
def list_by_server_next_with_http_info(next_page_link, custom_headers:nil)
|
419
|
+
list_by_server_next_async(next_page_link, custom_headers:custom_headers).value!
|
420
|
+
end
|
421
|
+
|
422
|
+
#
|
423
|
+
# Lists auditing settings of a server.
|
424
|
+
#
|
425
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
426
|
+
# to List operation.
|
427
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
428
|
+
# to the HTTP request.
|
429
|
+
#
|
430
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
431
|
+
#
|
432
|
+
def list_by_server_next_async(next_page_link, custom_headers:nil)
|
433
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
434
|
+
|
435
|
+
|
436
|
+
request_headers = {}
|
437
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
438
|
+
|
439
|
+
# Set Headers
|
440
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
441
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
442
|
+
path_template = '{nextLink}'
|
443
|
+
|
444
|
+
request_url = @base_url || @client.base_url
|
445
|
+
|
446
|
+
options = {
|
447
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
448
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
449
|
+
headers: request_headers.merge(custom_headers || {}),
|
450
|
+
base_url: request_url
|
451
|
+
}
|
452
|
+
promise = @client.make_request_async(:get, path_template, options)
|
453
|
+
|
454
|
+
promise = promise.then do |result|
|
455
|
+
http_response = result.response
|
456
|
+
status_code = http_response.status
|
457
|
+
response_content = http_response.body
|
458
|
+
unless status_code == 200
|
459
|
+
error_model = JSON.load(response_content)
|
460
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
461
|
+
end
|
462
|
+
|
463
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
464
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
465
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
466
|
+
# Deserialize Response
|
467
|
+
if status_code == 200
|
468
|
+
begin
|
469
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
470
|
+
result_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::ServerBlobAuditingPolicyListResult.mapper()
|
471
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
472
|
+
rescue Exception => e
|
473
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
474
|
+
end
|
475
|
+
end
|
476
|
+
|
477
|
+
result
|
478
|
+
end
|
479
|
+
|
480
|
+
promise.execute
|
481
|
+
end
|
482
|
+
|
483
|
+
#
|
484
|
+
# Lists auditing settings of a server.
|
485
|
+
#
|
486
|
+
# @param resource_group_name [String] The name of the resource group that
|
487
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
488
|
+
# Manager API or the portal.
|
489
|
+
# @param server_name [String] The name of the server.
|
490
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
491
|
+
# will be added to the HTTP request.
|
492
|
+
#
|
493
|
+
# @return [ServerBlobAuditingPolicyListResult] which provide lazy access to
|
494
|
+
# pages of the response.
|
495
|
+
#
|
496
|
+
def list_by_server_as_lazy(resource_group_name, server_name, custom_headers:nil)
|
497
|
+
response = list_by_server_async(resource_group_name, server_name, custom_headers:custom_headers).value!
|
498
|
+
unless response.nil?
|
499
|
+
page = response.body
|
500
|
+
page.next_method = Proc.new do |next_page_link|
|
501
|
+
list_by_server_next_async(next_page_link, custom_headers:custom_headers)
|
502
|
+
end
|
503
|
+
page
|
504
|
+
end
|
505
|
+
end
|
506
|
+
|
293
507
|
end
|
294
508
|
end
|