azure_mgmt_storage 0.21.1 → 0.21.2
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/2015-05-01-preview/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
- data/lib/2015-06-15/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
- data/lib/2016-01-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
- data/lib/2016-12-01/generated/azure_mgmt_storage.rb +2 -0
- data/lib/2016-12-01/generated/azure_mgmt_storage/models/permissions.rb +22 -0
- data/lib/2016-12-01/generated/azure_mgmt_storage/models/service_sas_parameters.rb +7 -7
- data/lib/2016-12-01/generated/azure_mgmt_storage/models/signed_resource.rb +18 -0
- data/lib/2016-12-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
- data/lib/2017-06-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
- data/lib/2017-10-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
- data/lib/2018-02-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
- data/lib/2018-03-01-preview/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
- data/lib/2018-07-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
- data/lib/2018-11-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
- data/lib/2019-04-01/generated/azure_mgmt_storage.rb +1 -0
- data/lib/2019-04-01/generated/azure_mgmt_storage/models/minimum_tls_version.rb +17 -0
- data/lib/2019-04-01/generated/azure_mgmt_storage/models/storage_account.rb +26 -0
- data/lib/2019-04-01/generated/azure_mgmt_storage/models/storage_account_create_parameters.rb +26 -0
- data/lib/2019-04-01/generated/azure_mgmt_storage/models/storage_account_update_parameters.rb +26 -0
- data/lib/2019-04-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
- data/lib/2019-06-01/generated/azure_mgmt_storage.rb +73 -57
- data/lib/2019-06-01/generated/azure_mgmt_storage/blob_containers.rb +20 -8
- data/lib/2019-06-01/generated/azure_mgmt_storage/models/blob_container.rb +49 -0
- data/lib/2019-06-01/generated/azure_mgmt_storage/models/encryption.rb +13 -0
- data/lib/2019-06-01/generated/azure_mgmt_storage/models/list_container_item.rb +49 -0
- data/lib/2019-06-01/generated/azure_mgmt_storage/models/list_containers_include.rb +15 -0
- data/lib/2019-06-01/generated/azure_mgmt_storage/models/list_queue.rb +83 -0
- data/lib/2019-06-01/generated/azure_mgmt_storage/models/list_queue_resource.rb +101 -0
- data/lib/2019-06-01/generated/azure_mgmt_storage/models/list_queue_services.rb +58 -0
- data/lib/2019-06-01/generated/azure_mgmt_storage/models/list_table_resource.rb +101 -0
- data/lib/2019-06-01/generated/azure_mgmt_storage/models/list_table_services.rb +58 -0
- data/lib/2019-06-01/generated/azure_mgmt_storage/models/minimum_tls_version.rb +17 -0
- data/lib/2019-06-01/generated/azure_mgmt_storage/models/private_endpoint_connection_list_result.rb +57 -0
- data/lib/2019-06-01/generated/azure_mgmt_storage/models/queue_service_properties.rb +77 -0
- data/lib/2019-06-01/generated/azure_mgmt_storage/models/storage_account.rb +26 -0
- data/lib/2019-06-01/generated/azure_mgmt_storage/models/storage_account_create_parameters.rb +26 -0
- data/lib/2019-06-01/generated/azure_mgmt_storage/models/storage_account_update_parameters.rb +26 -0
- data/lib/2019-06-01/generated/azure_mgmt_storage/models/storage_queue.rb +97 -0
- data/lib/2019-06-01/generated/azure_mgmt_storage/models/table.rb +74 -0
- data/lib/2019-06-01/generated/azure_mgmt_storage/models/table_service_properties.rb +77 -0
- data/lib/2019-06-01/generated/azure_mgmt_storage/private_endpoint_connections.rb +122 -9
- data/lib/2019-06-01/generated/azure_mgmt_storage/queue.rb +805 -0
- data/lib/2019-06-01/generated/azure_mgmt_storage/queue_services.rb +386 -0
- data/lib/2019-06-01/generated/azure_mgmt_storage/storage_management_client.rb +17 -1
- data/lib/2019-06-01/generated/azure_mgmt_storage/table_operations.rb +743 -0
- data/lib/2019-06-01/generated/azure_mgmt_storage/table_services.rb +386 -0
- data/lib/azure_mgmt_storage.rb +10 -10
- data/lib/profiles/latest/modules/storage_profile_module.rb +247 -191
- data/lib/version.rb +1 -1
- metadata +21 -2
@@ -0,0 +1,74 @@
|
|
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::Storage::Mgmt::V2019_06_01
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# Properties of the table, including Id, resource name, resource type.
|
10
|
+
#
|
11
|
+
class Table < Resource
|
12
|
+
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
# @return [String] Table name under the specified account
|
16
|
+
attr_accessor :table_name
|
17
|
+
|
18
|
+
|
19
|
+
#
|
20
|
+
# Mapper for Table class as Ruby Hash.
|
21
|
+
# This will be used for serialization/deserialization.
|
22
|
+
#
|
23
|
+
def self.mapper()
|
24
|
+
{
|
25
|
+
client_side_validation: true,
|
26
|
+
required: false,
|
27
|
+
serialized_name: 'Table',
|
28
|
+
type: {
|
29
|
+
name: 'Composite',
|
30
|
+
class_name: 'Table',
|
31
|
+
model_properties: {
|
32
|
+
id: {
|
33
|
+
client_side_validation: true,
|
34
|
+
required: false,
|
35
|
+
read_only: true,
|
36
|
+
serialized_name: 'id',
|
37
|
+
type: {
|
38
|
+
name: 'String'
|
39
|
+
}
|
40
|
+
},
|
41
|
+
name: {
|
42
|
+
client_side_validation: true,
|
43
|
+
required: false,
|
44
|
+
read_only: true,
|
45
|
+
serialized_name: 'name',
|
46
|
+
type: {
|
47
|
+
name: 'String'
|
48
|
+
}
|
49
|
+
},
|
50
|
+
type: {
|
51
|
+
client_side_validation: true,
|
52
|
+
required: false,
|
53
|
+
read_only: true,
|
54
|
+
serialized_name: 'type',
|
55
|
+
type: {
|
56
|
+
name: 'String'
|
57
|
+
}
|
58
|
+
},
|
59
|
+
table_name: {
|
60
|
+
client_side_validation: true,
|
61
|
+
required: false,
|
62
|
+
read_only: true,
|
63
|
+
serialized_name: 'properties.tableName',
|
64
|
+
type: {
|
65
|
+
name: 'String'
|
66
|
+
}
|
67
|
+
}
|
68
|
+
}
|
69
|
+
}
|
70
|
+
}
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
@@ -0,0 +1,77 @@
|
|
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::Storage::Mgmt::V2019_06_01
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# The properties of a storage account’s Table service.
|
10
|
+
#
|
11
|
+
class TableServiceProperties < Resource
|
12
|
+
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
# @return [CorsRules] Specifies CORS rules for the Table service. You can
|
16
|
+
# include up to five CorsRule elements in the request. If no CorsRule
|
17
|
+
# elements are included in the request body, all CORS rules will be
|
18
|
+
# deleted, and CORS will be disabled for the Table service.
|
19
|
+
attr_accessor :cors
|
20
|
+
|
21
|
+
|
22
|
+
#
|
23
|
+
# Mapper for TableServiceProperties 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: 'TableServiceProperties',
|
31
|
+
type: {
|
32
|
+
name: 'Composite',
|
33
|
+
class_name: 'TableServiceProperties',
|
34
|
+
model_properties: {
|
35
|
+
id: {
|
36
|
+
client_side_validation: true,
|
37
|
+
required: false,
|
38
|
+
read_only: true,
|
39
|
+
serialized_name: 'id',
|
40
|
+
type: {
|
41
|
+
name: 'String'
|
42
|
+
}
|
43
|
+
},
|
44
|
+
name: {
|
45
|
+
client_side_validation: true,
|
46
|
+
required: false,
|
47
|
+
read_only: true,
|
48
|
+
serialized_name: 'name',
|
49
|
+
type: {
|
50
|
+
name: 'String'
|
51
|
+
}
|
52
|
+
},
|
53
|
+
type: {
|
54
|
+
client_side_validation: true,
|
55
|
+
required: false,
|
56
|
+
read_only: true,
|
57
|
+
serialized_name: 'type',
|
58
|
+
type: {
|
59
|
+
name: 'String'
|
60
|
+
}
|
61
|
+
},
|
62
|
+
cors: {
|
63
|
+
client_side_validation: true,
|
64
|
+
required: false,
|
65
|
+
serialized_name: 'properties.cors',
|
66
|
+
type: {
|
67
|
+
name: 'Composite',
|
68
|
+
class_name: 'CorsRules'
|
69
|
+
}
|
70
|
+
}
|
71
|
+
}
|
72
|
+
}
|
73
|
+
}
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
@@ -21,6 +21,119 @@ module Azure::Storage::Mgmt::V2019_06_01
|
|
21
21
|
# @return [StorageManagementClient] reference to the StorageManagementClient
|
22
22
|
attr_reader :client
|
23
23
|
|
24
|
+
#
|
25
|
+
# List all the private endpoint connections associated with the storage
|
26
|
+
# account.
|
27
|
+
#
|
28
|
+
# @param resource_group_name [String] The name of the resource group within the
|
29
|
+
# user's subscription. The name is case insensitive.
|
30
|
+
# @param account_name [String] The name of the storage account within the
|
31
|
+
# specified resource group. Storage account names must be between 3 and 24
|
32
|
+
# characters in length and use numbers and lower-case letters only.
|
33
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
34
|
+
# will be added to the HTTP request.
|
35
|
+
#
|
36
|
+
# @return [PrivateEndpointConnectionListResult] operation results.
|
37
|
+
#
|
38
|
+
def list(resource_group_name, account_name, custom_headers:nil)
|
39
|
+
response = list_async(resource_group_name, account_name, custom_headers:custom_headers).value!
|
40
|
+
response.body unless response.nil?
|
41
|
+
end
|
42
|
+
|
43
|
+
#
|
44
|
+
# List all the private endpoint connections associated with the storage
|
45
|
+
# account.
|
46
|
+
#
|
47
|
+
# @param resource_group_name [String] The name of the resource group within the
|
48
|
+
# user's subscription. The name is case insensitive.
|
49
|
+
# @param account_name [String] The name of the storage account within the
|
50
|
+
# specified resource group. Storage account names must be between 3 and 24
|
51
|
+
# characters in length and use numbers and lower-case letters only.
|
52
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
53
|
+
# will be added to the HTTP request.
|
54
|
+
#
|
55
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
56
|
+
#
|
57
|
+
def list_with_http_info(resource_group_name, account_name, custom_headers:nil)
|
58
|
+
list_async(resource_group_name, account_name, custom_headers:custom_headers).value!
|
59
|
+
end
|
60
|
+
|
61
|
+
#
|
62
|
+
# List all the private endpoint connections associated with the storage
|
63
|
+
# account.
|
64
|
+
#
|
65
|
+
# @param resource_group_name [String] The name of the resource group within the
|
66
|
+
# user's subscription. The name is case insensitive.
|
67
|
+
# @param account_name [String] The name of the storage account within the
|
68
|
+
# specified resource group. Storage account names must be between 3 and 24
|
69
|
+
# characters in length and use numbers and lower-case letters only.
|
70
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
71
|
+
# to the HTTP request.
|
72
|
+
#
|
73
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
74
|
+
#
|
75
|
+
def list_async(resource_group_name, account_name, custom_headers:nil)
|
76
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
77
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
78
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
79
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
80
|
+
fail ArgumentError, 'account_name is nil' if account_name.nil?
|
81
|
+
fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
|
82
|
+
fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
|
83
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
84
|
+
fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
|
85
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
86
|
+
fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
|
87
|
+
|
88
|
+
|
89
|
+
request_headers = {}
|
90
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
91
|
+
|
92
|
+
# Set Headers
|
93
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
94
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
95
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections'
|
96
|
+
|
97
|
+
request_url = @base_url || @client.base_url
|
98
|
+
|
99
|
+
options = {
|
100
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
101
|
+
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
|
102
|
+
query_params: {'api-version' => @client.api_version},
|
103
|
+
headers: request_headers.merge(custom_headers || {}),
|
104
|
+
base_url: request_url
|
105
|
+
}
|
106
|
+
promise = @client.make_request_async(:get, path_template, options)
|
107
|
+
|
108
|
+
promise = promise.then do |result|
|
109
|
+
http_response = result.response
|
110
|
+
status_code = http_response.status
|
111
|
+
response_content = http_response.body
|
112
|
+
unless status_code == 200
|
113
|
+
error_model = JSON.load(response_content)
|
114
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
115
|
+
end
|
116
|
+
|
117
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
118
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
119
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
120
|
+
# Deserialize Response
|
121
|
+
if status_code == 200
|
122
|
+
begin
|
123
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
124
|
+
result_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::PrivateEndpointConnectionListResult.mapper()
|
125
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
126
|
+
rescue Exception => e
|
127
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
result
|
132
|
+
end
|
133
|
+
|
134
|
+
promise.execute
|
135
|
+
end
|
136
|
+
|
24
137
|
#
|
25
138
|
# Gets the specified private endpoint connection associated with the storage
|
26
139
|
# account.
|
@@ -31,7 +144,7 @@ module Azure::Storage::Mgmt::V2019_06_01
|
|
31
144
|
# specified resource group. Storage account names must be between 3 and 24
|
32
145
|
# characters in length and use numbers and lower-case letters only.
|
33
146
|
# @param private_endpoint_connection_name [String] The name of the private
|
34
|
-
# endpoint connection associated with the
|
147
|
+
# endpoint connection associated with the Azure resource
|
35
148
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
36
149
|
# will be added to the HTTP request.
|
37
150
|
#
|
@@ -52,7 +165,7 @@ module Azure::Storage::Mgmt::V2019_06_01
|
|
52
165
|
# specified resource group. Storage account names must be between 3 and 24
|
53
166
|
# characters in length and use numbers and lower-case letters only.
|
54
167
|
# @param private_endpoint_connection_name [String] The name of the private
|
55
|
-
# endpoint connection associated with the
|
168
|
+
# endpoint connection associated with the Azure resource
|
56
169
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
57
170
|
# will be added to the HTTP request.
|
58
171
|
#
|
@@ -72,7 +185,7 @@ module Azure::Storage::Mgmt::V2019_06_01
|
|
72
185
|
# specified resource group. Storage account names must be between 3 and 24
|
73
186
|
# characters in length and use numbers and lower-case letters only.
|
74
187
|
# @param private_endpoint_connection_name [String] The name of the private
|
75
|
-
# endpoint connection associated with the
|
188
|
+
# endpoint connection associated with the Azure resource
|
76
189
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
77
190
|
# to the HTTP request.
|
78
191
|
#
|
@@ -151,7 +264,7 @@ module Azure::Storage::Mgmt::V2019_06_01
|
|
151
264
|
# specified resource group. Storage account names must be between 3 and 24
|
152
265
|
# characters in length and use numbers and lower-case letters only.
|
153
266
|
# @param private_endpoint_connection_name [String] The name of the private
|
154
|
-
# endpoint connection associated with the
|
267
|
+
# endpoint connection associated with the Azure resource
|
155
268
|
# @param properties [PrivateEndpointConnection] The private endpoint connection
|
156
269
|
# properties.
|
157
270
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
@@ -174,7 +287,7 @@ module Azure::Storage::Mgmt::V2019_06_01
|
|
174
287
|
# specified resource group. Storage account names must be between 3 and 24
|
175
288
|
# characters in length and use numbers and lower-case letters only.
|
176
289
|
# @param private_endpoint_connection_name [String] The name of the private
|
177
|
-
# endpoint connection associated with the
|
290
|
+
# endpoint connection associated with the Azure resource
|
178
291
|
# @param properties [PrivateEndpointConnection] The private endpoint connection
|
179
292
|
# properties.
|
180
293
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
@@ -196,7 +309,7 @@ module Azure::Storage::Mgmt::V2019_06_01
|
|
196
309
|
# specified resource group. Storage account names must be between 3 and 24
|
197
310
|
# characters in length and use numbers and lower-case letters only.
|
198
311
|
# @param private_endpoint_connection_name [String] The name of the private
|
199
|
-
# endpoint connection associated with the
|
312
|
+
# endpoint connection associated with the Azure resource
|
200
313
|
# @param properties [PrivateEndpointConnection] The private endpoint connection
|
201
314
|
# properties.
|
202
315
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
@@ -285,7 +398,7 @@ module Azure::Storage::Mgmt::V2019_06_01
|
|
285
398
|
# specified resource group. Storage account names must be between 3 and 24
|
286
399
|
# characters in length and use numbers and lower-case letters only.
|
287
400
|
# @param private_endpoint_connection_name [String] The name of the private
|
288
|
-
# endpoint connection associated with the
|
401
|
+
# endpoint connection associated with the Azure resource
|
289
402
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
290
403
|
# will be added to the HTTP request.
|
291
404
|
#
|
@@ -305,7 +418,7 @@ module Azure::Storage::Mgmt::V2019_06_01
|
|
305
418
|
# specified resource group. Storage account names must be between 3 and 24
|
306
419
|
# characters in length and use numbers and lower-case letters only.
|
307
420
|
# @param private_endpoint_connection_name [String] The name of the private
|
308
|
-
# endpoint connection associated with the
|
421
|
+
# endpoint connection associated with the Azure resource
|
309
422
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
310
423
|
# will be added to the HTTP request.
|
311
424
|
#
|
@@ -325,7 +438,7 @@ module Azure::Storage::Mgmt::V2019_06_01
|
|
325
438
|
# specified resource group. Storage account names must be between 3 and 24
|
326
439
|
# characters in length and use numbers and lower-case letters only.
|
327
440
|
# @param private_endpoint_connection_name [String] The name of the private
|
328
|
-
# endpoint connection associated with the
|
441
|
+
# endpoint connection associated with the Azure resource
|
329
442
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
330
443
|
# to the HTTP request.
|
331
444
|
#
|
@@ -0,0 +1,805 @@
|
|
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::Storage::Mgmt::V2019_06_01
|
7
|
+
#
|
8
|
+
# The Azure Storage Management API.
|
9
|
+
#
|
10
|
+
class Queue
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the Queue class.
|
15
|
+
# @param client service class for accessing basic functionality.
|
16
|
+
#
|
17
|
+
def initialize(client)
|
18
|
+
@client = client
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [StorageManagementClient] reference to the StorageManagementClient
|
22
|
+
attr_reader :client
|
23
|
+
|
24
|
+
#
|
25
|
+
# Creates a new queue with the specified queue name, under the specified
|
26
|
+
# account.
|
27
|
+
#
|
28
|
+
# @param resource_group_name [String] The name of the resource group within the
|
29
|
+
# user's subscription. The name is case insensitive.
|
30
|
+
# @param account_name [String] The name of the storage account within the
|
31
|
+
# specified resource group. Storage account names must be between 3 and 24
|
32
|
+
# characters in length and use numbers and lower-case letters only.
|
33
|
+
# @param queue_name [String] A queue name must be unique within a storage
|
34
|
+
# account and must be between 3 and 63 characters.The name must comprise of
|
35
|
+
# lowercase alphanumeric and dash(-) characters only, it should begin and end
|
36
|
+
# with an alphanumeric character and it cannot have two consecutive dash(-)
|
37
|
+
# characters.
|
38
|
+
# @param queue [StorageQueue] Queue properties and metadata to be created with
|
39
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
40
|
+
# will be added to the HTTP request.
|
41
|
+
#
|
42
|
+
# @return [StorageQueue] operation results.
|
43
|
+
#
|
44
|
+
def create(resource_group_name, account_name, queue_name, queue, custom_headers:nil)
|
45
|
+
response = create_async(resource_group_name, account_name, queue_name, queue, custom_headers:custom_headers).value!
|
46
|
+
response.body unless response.nil?
|
47
|
+
end
|
48
|
+
|
49
|
+
#
|
50
|
+
# Creates a new queue with the specified queue name, under the specified
|
51
|
+
# account.
|
52
|
+
#
|
53
|
+
# @param resource_group_name [String] The name of the resource group within the
|
54
|
+
# user's subscription. The name is case insensitive.
|
55
|
+
# @param account_name [String] The name of the storage account within the
|
56
|
+
# specified resource group. Storage account names must be between 3 and 24
|
57
|
+
# characters in length and use numbers and lower-case letters only.
|
58
|
+
# @param queue_name [String] A queue name must be unique within a storage
|
59
|
+
# account and must be between 3 and 63 characters.The name must comprise of
|
60
|
+
# lowercase alphanumeric and dash(-) characters only, it should begin and end
|
61
|
+
# with an alphanumeric character and it cannot have two consecutive dash(-)
|
62
|
+
# characters.
|
63
|
+
# @param queue [StorageQueue] Queue properties and metadata to be created with
|
64
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
65
|
+
# will be added to the HTTP request.
|
66
|
+
#
|
67
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
68
|
+
#
|
69
|
+
def create_with_http_info(resource_group_name, account_name, queue_name, queue, custom_headers:nil)
|
70
|
+
create_async(resource_group_name, account_name, queue_name, queue, custom_headers:custom_headers).value!
|
71
|
+
end
|
72
|
+
|
73
|
+
#
|
74
|
+
# Creates a new queue with the specified queue name, under the specified
|
75
|
+
# account.
|
76
|
+
#
|
77
|
+
# @param resource_group_name [String] The name of the resource group within the
|
78
|
+
# user's subscription. The name is case insensitive.
|
79
|
+
# @param account_name [String] The name of the storage account within the
|
80
|
+
# specified resource group. Storage account names must be between 3 and 24
|
81
|
+
# characters in length and use numbers and lower-case letters only.
|
82
|
+
# @param queue_name [String] A queue name must be unique within a storage
|
83
|
+
# account and must be between 3 and 63 characters.The name must comprise of
|
84
|
+
# lowercase alphanumeric and dash(-) characters only, it should begin and end
|
85
|
+
# with an alphanumeric character and it cannot have two consecutive dash(-)
|
86
|
+
# characters.
|
87
|
+
# @param queue [StorageQueue] Queue properties and metadata to be created with
|
88
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
89
|
+
# to the HTTP request.
|
90
|
+
#
|
91
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
92
|
+
#
|
93
|
+
def create_async(resource_group_name, account_name, queue_name, queue, custom_headers:nil)
|
94
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
95
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
96
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
97
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
98
|
+
fail ArgumentError, 'account_name is nil' if account_name.nil?
|
99
|
+
fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
|
100
|
+
fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
|
101
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
102
|
+
fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
|
103
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
104
|
+
fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
|
105
|
+
fail ArgumentError, 'queue_name is nil' if queue_name.nil?
|
106
|
+
fail ArgumentError, "'queue_name' should satisfy the constraint - 'MaxLength': '63'" if !queue_name.nil? && queue_name.length > 63
|
107
|
+
fail ArgumentError, "'queue_name' should satisfy the constraint - 'MinLength': '3'" if !queue_name.nil? && queue_name.length < 3
|
108
|
+
fail ArgumentError, "'queue_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$'" if !queue_name.nil? && queue_name.match(Regexp.new('^^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$$')).nil?
|
109
|
+
fail ArgumentError, 'queue is nil' if queue.nil?
|
110
|
+
|
111
|
+
|
112
|
+
request_headers = {}
|
113
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
114
|
+
|
115
|
+
# Set Headers
|
116
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
117
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
118
|
+
|
119
|
+
# Serialize Request
|
120
|
+
request_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::StorageQueue.mapper()
|
121
|
+
request_content = @client.serialize(request_mapper, queue)
|
122
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
123
|
+
|
124
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}'
|
125
|
+
|
126
|
+
request_url = @base_url || @client.base_url
|
127
|
+
|
128
|
+
options = {
|
129
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
130
|
+
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id,'queueName' => queue_name},
|
131
|
+
query_params: {'api-version' => @client.api_version},
|
132
|
+
body: request_content,
|
133
|
+
headers: request_headers.merge(custom_headers || {}),
|
134
|
+
base_url: request_url
|
135
|
+
}
|
136
|
+
promise = @client.make_request_async(:put, path_template, options)
|
137
|
+
|
138
|
+
promise = promise.then do |result|
|
139
|
+
http_response = result.response
|
140
|
+
status_code = http_response.status
|
141
|
+
response_content = http_response.body
|
142
|
+
unless status_code == 200
|
143
|
+
error_model = JSON.load(response_content)
|
144
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
145
|
+
end
|
146
|
+
|
147
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
148
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
149
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
150
|
+
# Deserialize Response
|
151
|
+
if status_code == 200
|
152
|
+
begin
|
153
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
154
|
+
result_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::StorageQueue.mapper()
|
155
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
156
|
+
rescue Exception => e
|
157
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
result
|
162
|
+
end
|
163
|
+
|
164
|
+
promise.execute
|
165
|
+
end
|
166
|
+
|
167
|
+
#
|
168
|
+
# Creates a new queue with the specified queue name, under the specified
|
169
|
+
# account.
|
170
|
+
#
|
171
|
+
# @param resource_group_name [String] The name of the resource group within the
|
172
|
+
# user's subscription. The name is case insensitive.
|
173
|
+
# @param account_name [String] The name of the storage account within the
|
174
|
+
# specified resource group. Storage account names must be between 3 and 24
|
175
|
+
# characters in length and use numbers and lower-case letters only.
|
176
|
+
# @param queue_name [String] A queue name must be unique within a storage
|
177
|
+
# account and must be between 3 and 63 characters.The name must comprise of
|
178
|
+
# lowercase alphanumeric and dash(-) characters only, it should begin and end
|
179
|
+
# with an alphanumeric character and it cannot have two consecutive dash(-)
|
180
|
+
# characters.
|
181
|
+
# @param queue [StorageQueue] Queue properties and metadata to be created with
|
182
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
183
|
+
# will be added to the HTTP request.
|
184
|
+
#
|
185
|
+
# @return [StorageQueue] operation results.
|
186
|
+
#
|
187
|
+
def update(resource_group_name, account_name, queue_name, queue, custom_headers:nil)
|
188
|
+
response = update_async(resource_group_name, account_name, queue_name, queue, custom_headers:custom_headers).value!
|
189
|
+
response.body unless response.nil?
|
190
|
+
end
|
191
|
+
|
192
|
+
#
|
193
|
+
# Creates a new queue with the specified queue name, under the specified
|
194
|
+
# account.
|
195
|
+
#
|
196
|
+
# @param resource_group_name [String] The name of the resource group within the
|
197
|
+
# user's subscription. The name is case insensitive.
|
198
|
+
# @param account_name [String] The name of the storage account within the
|
199
|
+
# specified resource group. Storage account names must be between 3 and 24
|
200
|
+
# characters in length and use numbers and lower-case letters only.
|
201
|
+
# @param queue_name [String] A queue name must be unique within a storage
|
202
|
+
# account and must be between 3 and 63 characters.The name must comprise of
|
203
|
+
# lowercase alphanumeric and dash(-) characters only, it should begin and end
|
204
|
+
# with an alphanumeric character and it cannot have two consecutive dash(-)
|
205
|
+
# characters.
|
206
|
+
# @param queue [StorageQueue] Queue properties and metadata to be created with
|
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 update_with_http_info(resource_group_name, account_name, queue_name, queue, custom_headers:nil)
|
213
|
+
update_async(resource_group_name, account_name, queue_name, queue, custom_headers:custom_headers).value!
|
214
|
+
end
|
215
|
+
|
216
|
+
#
|
217
|
+
# Creates a new queue with the specified queue name, under the specified
|
218
|
+
# account.
|
219
|
+
#
|
220
|
+
# @param resource_group_name [String] The name of the resource group within the
|
221
|
+
# user's subscription. The name is case insensitive.
|
222
|
+
# @param account_name [String] The name of the storage account within the
|
223
|
+
# specified resource group. Storage account names must be between 3 and 24
|
224
|
+
# characters in length and use numbers and lower-case letters only.
|
225
|
+
# @param queue_name [String] A queue name must be unique within a storage
|
226
|
+
# account and must be between 3 and 63 characters.The name must comprise of
|
227
|
+
# lowercase alphanumeric and dash(-) characters only, it should begin and end
|
228
|
+
# with an alphanumeric character and it cannot have two consecutive dash(-)
|
229
|
+
# characters.
|
230
|
+
# @param queue [StorageQueue] Queue properties and metadata to be created with
|
231
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
232
|
+
# to the HTTP request.
|
233
|
+
#
|
234
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
235
|
+
#
|
236
|
+
def update_async(resource_group_name, account_name, queue_name, queue, custom_headers:nil)
|
237
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
238
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
239
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
240
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
241
|
+
fail ArgumentError, 'account_name is nil' if account_name.nil?
|
242
|
+
fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
|
243
|
+
fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
|
244
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
245
|
+
fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
|
246
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
247
|
+
fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
|
248
|
+
fail ArgumentError, 'queue_name is nil' if queue_name.nil?
|
249
|
+
fail ArgumentError, "'queue_name' should satisfy the constraint - 'MaxLength': '63'" if !queue_name.nil? && queue_name.length > 63
|
250
|
+
fail ArgumentError, "'queue_name' should satisfy the constraint - 'MinLength': '3'" if !queue_name.nil? && queue_name.length < 3
|
251
|
+
fail ArgumentError, "'queue_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$'" if !queue_name.nil? && queue_name.match(Regexp.new('^^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$$')).nil?
|
252
|
+
fail ArgumentError, 'queue is nil' if queue.nil?
|
253
|
+
|
254
|
+
|
255
|
+
request_headers = {}
|
256
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
257
|
+
|
258
|
+
# Set Headers
|
259
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
260
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
261
|
+
|
262
|
+
# Serialize Request
|
263
|
+
request_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::StorageQueue.mapper()
|
264
|
+
request_content = @client.serialize(request_mapper, queue)
|
265
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
266
|
+
|
267
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}'
|
268
|
+
|
269
|
+
request_url = @base_url || @client.base_url
|
270
|
+
|
271
|
+
options = {
|
272
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
273
|
+
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id,'queueName' => queue_name},
|
274
|
+
query_params: {'api-version' => @client.api_version},
|
275
|
+
body: request_content,
|
276
|
+
headers: request_headers.merge(custom_headers || {}),
|
277
|
+
base_url: request_url
|
278
|
+
}
|
279
|
+
promise = @client.make_request_async(:patch, path_template, options)
|
280
|
+
|
281
|
+
promise = promise.then do |result|
|
282
|
+
http_response = result.response
|
283
|
+
status_code = http_response.status
|
284
|
+
response_content = http_response.body
|
285
|
+
unless status_code == 200
|
286
|
+
error_model = JSON.load(response_content)
|
287
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
288
|
+
end
|
289
|
+
|
290
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
291
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
292
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
293
|
+
# Deserialize Response
|
294
|
+
if status_code == 200
|
295
|
+
begin
|
296
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
297
|
+
result_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::StorageQueue.mapper()
|
298
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
299
|
+
rescue Exception => e
|
300
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
301
|
+
end
|
302
|
+
end
|
303
|
+
|
304
|
+
result
|
305
|
+
end
|
306
|
+
|
307
|
+
promise.execute
|
308
|
+
end
|
309
|
+
|
310
|
+
#
|
311
|
+
# Gets the queue with the specified queue name, under the specified account if
|
312
|
+
# it exists.
|
313
|
+
#
|
314
|
+
# @param resource_group_name [String] The name of the resource group within the
|
315
|
+
# user's subscription. The name is case insensitive.
|
316
|
+
# @param account_name [String] The name of the storage account within the
|
317
|
+
# specified resource group. Storage account names must be between 3 and 24
|
318
|
+
# characters in length and use numbers and lower-case letters only.
|
319
|
+
# @param queue_name [String] A queue name must be unique within a storage
|
320
|
+
# account and must be between 3 and 63 characters.The name must comprise of
|
321
|
+
# lowercase alphanumeric and dash(-) characters only, it should begin and end
|
322
|
+
# with an alphanumeric character and it cannot have two consecutive dash(-)
|
323
|
+
# characters.
|
324
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
325
|
+
# will be added to the HTTP request.
|
326
|
+
#
|
327
|
+
# @return [StorageQueue] operation results.
|
328
|
+
#
|
329
|
+
def get(resource_group_name, account_name, queue_name, custom_headers:nil)
|
330
|
+
response = get_async(resource_group_name, account_name, queue_name, custom_headers:custom_headers).value!
|
331
|
+
response.body unless response.nil?
|
332
|
+
end
|
333
|
+
|
334
|
+
#
|
335
|
+
# Gets the queue with the specified queue name, under the specified account if
|
336
|
+
# it exists.
|
337
|
+
#
|
338
|
+
# @param resource_group_name [String] The name of the resource group within the
|
339
|
+
# user's subscription. The name is case insensitive.
|
340
|
+
# @param account_name [String] The name of the storage account within the
|
341
|
+
# specified resource group. Storage account names must be between 3 and 24
|
342
|
+
# characters in length and use numbers and lower-case letters only.
|
343
|
+
# @param queue_name [String] A queue name must be unique within a storage
|
344
|
+
# account and must be between 3 and 63 characters.The name must comprise of
|
345
|
+
# lowercase alphanumeric and dash(-) characters only, it should begin and end
|
346
|
+
# with an alphanumeric character and it cannot have two consecutive dash(-)
|
347
|
+
# characters.
|
348
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
349
|
+
# will be added to the HTTP request.
|
350
|
+
#
|
351
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
352
|
+
#
|
353
|
+
def get_with_http_info(resource_group_name, account_name, queue_name, custom_headers:nil)
|
354
|
+
get_async(resource_group_name, account_name, queue_name, custom_headers:custom_headers).value!
|
355
|
+
end
|
356
|
+
|
357
|
+
#
|
358
|
+
# Gets the queue with the specified queue name, under the specified account if
|
359
|
+
# it exists.
|
360
|
+
#
|
361
|
+
# @param resource_group_name [String] The name of the resource group within the
|
362
|
+
# user's subscription. The name is case insensitive.
|
363
|
+
# @param account_name [String] The name of the storage account within the
|
364
|
+
# specified resource group. Storage account names must be between 3 and 24
|
365
|
+
# characters in length and use numbers and lower-case letters only.
|
366
|
+
# @param queue_name [String] A queue name must be unique within a storage
|
367
|
+
# account and must be between 3 and 63 characters.The name must comprise of
|
368
|
+
# lowercase alphanumeric and dash(-) characters only, it should begin and end
|
369
|
+
# with an alphanumeric character and it cannot have two consecutive dash(-)
|
370
|
+
# characters.
|
371
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
372
|
+
# to the HTTP request.
|
373
|
+
#
|
374
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
375
|
+
#
|
376
|
+
def get_async(resource_group_name, account_name, queue_name, custom_headers:nil)
|
377
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
378
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
379
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
380
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
381
|
+
fail ArgumentError, 'account_name is nil' if account_name.nil?
|
382
|
+
fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
|
383
|
+
fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
|
384
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
385
|
+
fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
|
386
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
387
|
+
fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
|
388
|
+
fail ArgumentError, 'queue_name is nil' if queue_name.nil?
|
389
|
+
fail ArgumentError, "'queue_name' should satisfy the constraint - 'MaxLength': '63'" if !queue_name.nil? && queue_name.length > 63
|
390
|
+
fail ArgumentError, "'queue_name' should satisfy the constraint - 'MinLength': '3'" if !queue_name.nil? && queue_name.length < 3
|
391
|
+
fail ArgumentError, "'queue_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$'" if !queue_name.nil? && queue_name.match(Regexp.new('^^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$$')).nil?
|
392
|
+
|
393
|
+
|
394
|
+
request_headers = {}
|
395
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
396
|
+
|
397
|
+
# Set Headers
|
398
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
399
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
400
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}'
|
401
|
+
|
402
|
+
request_url = @base_url || @client.base_url
|
403
|
+
|
404
|
+
options = {
|
405
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
406
|
+
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id,'queueName' => queue_name},
|
407
|
+
query_params: {'api-version' => @client.api_version},
|
408
|
+
headers: request_headers.merge(custom_headers || {}),
|
409
|
+
base_url: request_url
|
410
|
+
}
|
411
|
+
promise = @client.make_request_async(:get, path_template, options)
|
412
|
+
|
413
|
+
promise = promise.then do |result|
|
414
|
+
http_response = result.response
|
415
|
+
status_code = http_response.status
|
416
|
+
response_content = http_response.body
|
417
|
+
unless status_code == 200
|
418
|
+
error_model = JSON.load(response_content)
|
419
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
420
|
+
end
|
421
|
+
|
422
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
423
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
424
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
425
|
+
# Deserialize Response
|
426
|
+
if status_code == 200
|
427
|
+
begin
|
428
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
429
|
+
result_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::StorageQueue.mapper()
|
430
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
431
|
+
rescue Exception => e
|
432
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
433
|
+
end
|
434
|
+
end
|
435
|
+
|
436
|
+
result
|
437
|
+
end
|
438
|
+
|
439
|
+
promise.execute
|
440
|
+
end
|
441
|
+
|
442
|
+
#
|
443
|
+
# Deletes the queue with the specified queue name, under the specified account
|
444
|
+
# if it exists.
|
445
|
+
#
|
446
|
+
# @param resource_group_name [String] The name of the resource group within the
|
447
|
+
# user's subscription. The name is case insensitive.
|
448
|
+
# @param account_name [String] The name of the storage account within the
|
449
|
+
# specified resource group. Storage account names must be between 3 and 24
|
450
|
+
# characters in length and use numbers and lower-case letters only.
|
451
|
+
# @param queue_name [String] A queue name must be unique within a storage
|
452
|
+
# account and must be between 3 and 63 characters.The name must comprise of
|
453
|
+
# lowercase alphanumeric and dash(-) characters only, it should begin and end
|
454
|
+
# with an alphanumeric character and it cannot have two consecutive dash(-)
|
455
|
+
# characters.
|
456
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
457
|
+
# will be added to the HTTP request.
|
458
|
+
#
|
459
|
+
#
|
460
|
+
def delete(resource_group_name, account_name, queue_name, custom_headers:nil)
|
461
|
+
response = delete_async(resource_group_name, account_name, queue_name, custom_headers:custom_headers).value!
|
462
|
+
nil
|
463
|
+
end
|
464
|
+
|
465
|
+
#
|
466
|
+
# Deletes the queue with the specified queue name, under the specified account
|
467
|
+
# if it exists.
|
468
|
+
#
|
469
|
+
# @param resource_group_name [String] The name of the resource group within the
|
470
|
+
# user's subscription. The name is case insensitive.
|
471
|
+
# @param account_name [String] The name of the storage account within the
|
472
|
+
# specified resource group. Storage account names must be between 3 and 24
|
473
|
+
# characters in length and use numbers and lower-case letters only.
|
474
|
+
# @param queue_name [String] A queue name must be unique within a storage
|
475
|
+
# account and must be between 3 and 63 characters.The name must comprise of
|
476
|
+
# lowercase alphanumeric and dash(-) characters only, it should begin and end
|
477
|
+
# with an alphanumeric character and it cannot have two consecutive dash(-)
|
478
|
+
# characters.
|
479
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
480
|
+
# will be added to the HTTP request.
|
481
|
+
#
|
482
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
483
|
+
#
|
484
|
+
def delete_with_http_info(resource_group_name, account_name, queue_name, custom_headers:nil)
|
485
|
+
delete_async(resource_group_name, account_name, queue_name, custom_headers:custom_headers).value!
|
486
|
+
end
|
487
|
+
|
488
|
+
#
|
489
|
+
# Deletes the queue with the specified queue name, under the specified account
|
490
|
+
# if it exists.
|
491
|
+
#
|
492
|
+
# @param resource_group_name [String] The name of the resource group within the
|
493
|
+
# user's subscription. The name is case insensitive.
|
494
|
+
# @param account_name [String] The name of the storage account within the
|
495
|
+
# specified resource group. Storage account names must be between 3 and 24
|
496
|
+
# characters in length and use numbers and lower-case letters only.
|
497
|
+
# @param queue_name [String] A queue name must be unique within a storage
|
498
|
+
# account and must be between 3 and 63 characters.The name must comprise of
|
499
|
+
# lowercase alphanumeric and dash(-) characters only, it should begin and end
|
500
|
+
# with an alphanumeric character and it cannot have two consecutive dash(-)
|
501
|
+
# characters.
|
502
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
503
|
+
# to the HTTP request.
|
504
|
+
#
|
505
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
506
|
+
#
|
507
|
+
def delete_async(resource_group_name, account_name, queue_name, custom_headers:nil)
|
508
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
509
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
510
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
511
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
512
|
+
fail ArgumentError, 'account_name is nil' if account_name.nil?
|
513
|
+
fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
|
514
|
+
fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
|
515
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
516
|
+
fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
|
517
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
518
|
+
fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
|
519
|
+
fail ArgumentError, 'queue_name is nil' if queue_name.nil?
|
520
|
+
fail ArgumentError, "'queue_name' should satisfy the constraint - 'MaxLength': '63'" if !queue_name.nil? && queue_name.length > 63
|
521
|
+
fail ArgumentError, "'queue_name' should satisfy the constraint - 'MinLength': '3'" if !queue_name.nil? && queue_name.length < 3
|
522
|
+
fail ArgumentError, "'queue_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$'" if !queue_name.nil? && queue_name.match(Regexp.new('^^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$$')).nil?
|
523
|
+
|
524
|
+
|
525
|
+
request_headers = {}
|
526
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
527
|
+
|
528
|
+
# Set Headers
|
529
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
530
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
531
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}'
|
532
|
+
|
533
|
+
request_url = @base_url || @client.base_url
|
534
|
+
|
535
|
+
options = {
|
536
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
537
|
+
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id,'queueName' => queue_name},
|
538
|
+
query_params: {'api-version' => @client.api_version},
|
539
|
+
headers: request_headers.merge(custom_headers || {}),
|
540
|
+
base_url: request_url
|
541
|
+
}
|
542
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
543
|
+
|
544
|
+
promise = promise.then do |result|
|
545
|
+
http_response = result.response
|
546
|
+
status_code = http_response.status
|
547
|
+
response_content = http_response.body
|
548
|
+
unless status_code == 204
|
549
|
+
error_model = JSON.load(response_content)
|
550
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
551
|
+
end
|
552
|
+
|
553
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
554
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
555
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
556
|
+
|
557
|
+
result
|
558
|
+
end
|
559
|
+
|
560
|
+
promise.execute
|
561
|
+
end
|
562
|
+
|
563
|
+
#
|
564
|
+
# Gets a list of all the queues under the specified storage account
|
565
|
+
#
|
566
|
+
# @param resource_group_name [String] The name of the resource group within the
|
567
|
+
# user's subscription. The name is case insensitive.
|
568
|
+
# @param account_name [String] The name of the storage account within the
|
569
|
+
# specified resource group. Storage account names must be between 3 and 24
|
570
|
+
# characters in length and use numbers and lower-case letters only.
|
571
|
+
# @param maxpagesize [String] Optional, a maximum number of queues that should
|
572
|
+
# be included in a list queue response
|
573
|
+
# @param filter [String] Optional, When specified, only the queues with a name
|
574
|
+
# starting with the given filter will be listed.
|
575
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
576
|
+
# will be added to the HTTP request.
|
577
|
+
#
|
578
|
+
# @return [Array<ListQueue>] operation results.
|
579
|
+
#
|
580
|
+
def list(resource_group_name, account_name, maxpagesize:nil, filter:nil, custom_headers:nil)
|
581
|
+
first_page = list_as_lazy(resource_group_name, account_name, maxpagesize:maxpagesize, filter:filter, custom_headers:custom_headers)
|
582
|
+
first_page.get_all_items
|
583
|
+
end
|
584
|
+
|
585
|
+
#
|
586
|
+
# Gets a list of all the queues under the specified storage account
|
587
|
+
#
|
588
|
+
# @param resource_group_name [String] The name of the resource group within the
|
589
|
+
# user's subscription. The name is case insensitive.
|
590
|
+
# @param account_name [String] The name of the storage account within the
|
591
|
+
# specified resource group. Storage account names must be between 3 and 24
|
592
|
+
# characters in length and use numbers and lower-case letters only.
|
593
|
+
# @param maxpagesize [String] Optional, a maximum number of queues that should
|
594
|
+
# be included in a list queue response
|
595
|
+
# @param filter [String] Optional, When specified, only the queues with a name
|
596
|
+
# starting with the given filter will be listed.
|
597
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
598
|
+
# will be added to the HTTP request.
|
599
|
+
#
|
600
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
601
|
+
#
|
602
|
+
def list_with_http_info(resource_group_name, account_name, maxpagesize:nil, filter:nil, custom_headers:nil)
|
603
|
+
list_async(resource_group_name, account_name, maxpagesize:maxpagesize, filter:filter, custom_headers:custom_headers).value!
|
604
|
+
end
|
605
|
+
|
606
|
+
#
|
607
|
+
# Gets a list of all the queues under the specified storage account
|
608
|
+
#
|
609
|
+
# @param resource_group_name [String] The name of the resource group within the
|
610
|
+
# user's subscription. The name is case insensitive.
|
611
|
+
# @param account_name [String] The name of the storage account within the
|
612
|
+
# specified resource group. Storage account names must be between 3 and 24
|
613
|
+
# characters in length and use numbers and lower-case letters only.
|
614
|
+
# @param maxpagesize [String] Optional, a maximum number of queues that should
|
615
|
+
# be included in a list queue response
|
616
|
+
# @param filter [String] Optional, When specified, only the queues with a name
|
617
|
+
# starting with the given filter will be listed.
|
618
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
619
|
+
# to the HTTP request.
|
620
|
+
#
|
621
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
622
|
+
#
|
623
|
+
def list_async(resource_group_name, account_name, maxpagesize:nil, filter:nil, custom_headers:nil)
|
624
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
625
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
626
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
627
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
628
|
+
fail ArgumentError, 'account_name is nil' if account_name.nil?
|
629
|
+
fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
|
630
|
+
fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
|
631
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
632
|
+
fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
|
633
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
634
|
+
fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
|
635
|
+
|
636
|
+
|
637
|
+
request_headers = {}
|
638
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
639
|
+
|
640
|
+
# Set Headers
|
641
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
642
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
643
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues'
|
644
|
+
|
645
|
+
request_url = @base_url || @client.base_url
|
646
|
+
|
647
|
+
options = {
|
648
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
649
|
+
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
|
650
|
+
query_params: {'api-version' => @client.api_version,'$maxpagesize' => maxpagesize,'$filter' => filter},
|
651
|
+
headers: request_headers.merge(custom_headers || {}),
|
652
|
+
base_url: request_url
|
653
|
+
}
|
654
|
+
promise = @client.make_request_async(:get, path_template, options)
|
655
|
+
|
656
|
+
promise = promise.then do |result|
|
657
|
+
http_response = result.response
|
658
|
+
status_code = http_response.status
|
659
|
+
response_content = http_response.body
|
660
|
+
unless status_code == 200
|
661
|
+
error_model = JSON.load(response_content)
|
662
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
663
|
+
end
|
664
|
+
|
665
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
666
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
667
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
668
|
+
# Deserialize Response
|
669
|
+
if status_code == 200
|
670
|
+
begin
|
671
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
672
|
+
result_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::ListQueueResource.mapper()
|
673
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
674
|
+
rescue Exception => e
|
675
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
676
|
+
end
|
677
|
+
end
|
678
|
+
|
679
|
+
result
|
680
|
+
end
|
681
|
+
|
682
|
+
promise.execute
|
683
|
+
end
|
684
|
+
|
685
|
+
#
|
686
|
+
# Gets a list of all the queues under the specified storage account
|
687
|
+
#
|
688
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
689
|
+
# to List operation.
|
690
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
691
|
+
# will be added to the HTTP request.
|
692
|
+
#
|
693
|
+
# @return [ListQueueResource] operation results.
|
694
|
+
#
|
695
|
+
def list_next(next_page_link, custom_headers:nil)
|
696
|
+
response = list_next_async(next_page_link, custom_headers:custom_headers).value!
|
697
|
+
response.body unless response.nil?
|
698
|
+
end
|
699
|
+
|
700
|
+
#
|
701
|
+
# Gets a list of all the queues under the specified storage account
|
702
|
+
#
|
703
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
704
|
+
# to List operation.
|
705
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
706
|
+
# will be added to the HTTP request.
|
707
|
+
#
|
708
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
709
|
+
#
|
710
|
+
def list_next_with_http_info(next_page_link, custom_headers:nil)
|
711
|
+
list_next_async(next_page_link, custom_headers:custom_headers).value!
|
712
|
+
end
|
713
|
+
|
714
|
+
#
|
715
|
+
# Gets a list of all the queues under the specified storage account
|
716
|
+
#
|
717
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
718
|
+
# to List operation.
|
719
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
720
|
+
# to the HTTP request.
|
721
|
+
#
|
722
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
723
|
+
#
|
724
|
+
def list_next_async(next_page_link, custom_headers:nil)
|
725
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
726
|
+
|
727
|
+
|
728
|
+
request_headers = {}
|
729
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
730
|
+
|
731
|
+
# Set Headers
|
732
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
733
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
734
|
+
path_template = '{nextLink}'
|
735
|
+
|
736
|
+
request_url = @base_url || @client.base_url
|
737
|
+
|
738
|
+
options = {
|
739
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
740
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
741
|
+
headers: request_headers.merge(custom_headers || {}),
|
742
|
+
base_url: request_url
|
743
|
+
}
|
744
|
+
promise = @client.make_request_async(:get, path_template, options)
|
745
|
+
|
746
|
+
promise = promise.then do |result|
|
747
|
+
http_response = result.response
|
748
|
+
status_code = http_response.status
|
749
|
+
response_content = http_response.body
|
750
|
+
unless status_code == 200
|
751
|
+
error_model = JSON.load(response_content)
|
752
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
753
|
+
end
|
754
|
+
|
755
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
756
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
757
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
758
|
+
# Deserialize Response
|
759
|
+
if status_code == 200
|
760
|
+
begin
|
761
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
762
|
+
result_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::ListQueueResource.mapper()
|
763
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
764
|
+
rescue Exception => e
|
765
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
766
|
+
end
|
767
|
+
end
|
768
|
+
|
769
|
+
result
|
770
|
+
end
|
771
|
+
|
772
|
+
promise.execute
|
773
|
+
end
|
774
|
+
|
775
|
+
#
|
776
|
+
# Gets a list of all the queues under the specified storage account
|
777
|
+
#
|
778
|
+
# @param resource_group_name [String] The name of the resource group within the
|
779
|
+
# user's subscription. The name is case insensitive.
|
780
|
+
# @param account_name [String] The name of the storage account within the
|
781
|
+
# specified resource group. Storage account names must be between 3 and 24
|
782
|
+
# characters in length and use numbers and lower-case letters only.
|
783
|
+
# @param maxpagesize [String] Optional, a maximum number of queues that should
|
784
|
+
# be included in a list queue response
|
785
|
+
# @param filter [String] Optional, When specified, only the queues with a name
|
786
|
+
# starting with the given filter will be listed.
|
787
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
788
|
+
# will be added to the HTTP request.
|
789
|
+
#
|
790
|
+
# @return [ListQueueResource] which provide lazy access to pages of the
|
791
|
+
# response.
|
792
|
+
#
|
793
|
+
def list_as_lazy(resource_group_name, account_name, maxpagesize:nil, filter:nil, custom_headers:nil)
|
794
|
+
response = list_async(resource_group_name, account_name, maxpagesize:maxpagesize, filter:filter, custom_headers:custom_headers).value!
|
795
|
+
unless response.nil?
|
796
|
+
page = response.body
|
797
|
+
page.next_method = Proc.new do |next_page_link|
|
798
|
+
list_next_async(next_page_link, custom_headers:custom_headers)
|
799
|
+
end
|
800
|
+
page
|
801
|
+
end
|
802
|
+
end
|
803
|
+
|
804
|
+
end
|
805
|
+
end
|