azure_mgmt_storage 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e56b0d1a618a8836d17f03f7a5b856825e2ab6d
|
4
|
+
data.tar.gz: e9df46e1c786792387f7e4740ff1dc72dd56661f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c60475c890009b812b27448c399c48f8f908527912c5b2b7ebe9ca5cb417b6040cfcb0998f4bca0f633e9142e8004157c5485cb7cb5d6aed72bf6008c7c18b53
|
7
|
+
data.tar.gz: 1960f7413ec74be21477cdf448c9b88a9e0ef9436dc1d4d3f42c3460cbc1d63b70800c335d0fbc3eca0ffaa6353cc9176b5be6fd401015ceb5826376e9f57eaa
|
@@ -87,31 +87,28 @@ module Azure::ARM::Storage
|
|
87
87
|
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
88
88
|
|
89
89
|
path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'
|
90
|
+
|
91
|
+
request_url = @base_url || @client.base_url
|
92
|
+
|
90
93
|
options = {
|
91
94
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
92
95
|
path_params: {'subscriptionId' => @client.subscription_id},
|
93
96
|
query_params: {'api-version' => @client.api_version},
|
94
97
|
body: request_content,
|
95
|
-
headers: request_headers.merge(custom_headers || {})
|
98
|
+
headers: request_headers.merge(custom_headers || {}),
|
99
|
+
base_url: request_url
|
96
100
|
}
|
101
|
+
promise = @client.make_request_async(:post, path_template, options)
|
97
102
|
|
98
|
-
|
99
|
-
|
100
|
-
request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
|
101
|
-
promise = request.run_promise do |req|
|
102
|
-
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
103
|
-
end
|
104
|
-
|
105
|
-
promise = promise.then do |http_response|
|
103
|
+
promise = promise.then do |result|
|
104
|
+
http_response = result.response
|
106
105
|
status_code = http_response.status
|
107
106
|
response_content = http_response.body
|
108
107
|
unless status_code == 200
|
109
108
|
error_model = JSON.load(response_content)
|
110
|
-
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
109
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
111
110
|
end
|
112
111
|
|
113
|
-
# Create Result
|
114
|
-
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
115
112
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
116
113
|
# Deserialize Response
|
117
114
|
if status_code == 200
|
@@ -274,31 +271,28 @@ module Azure::ARM::Storage
|
|
274
271
|
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
275
272
|
|
276
273
|
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'
|
274
|
+
|
275
|
+
request_url = @base_url || @client.base_url
|
276
|
+
|
277
277
|
options = {
|
278
278
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
279
279
|
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
|
280
280
|
query_params: {'api-version' => @client.api_version},
|
281
281
|
body: request_content,
|
282
|
-
headers: request_headers.merge(custom_headers || {})
|
282
|
+
headers: request_headers.merge(custom_headers || {}),
|
283
|
+
base_url: request_url
|
283
284
|
}
|
285
|
+
promise = @client.make_request_async(:put, path_template, options)
|
284
286
|
|
285
|
-
|
286
|
-
|
287
|
-
request = MsRest::HttpOperationRequest.new(request_url, path_template, :put, options)
|
288
|
-
promise = request.run_promise do |req|
|
289
|
-
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
290
|
-
end
|
291
|
-
|
292
|
-
promise = promise.then do |http_response|
|
287
|
+
promise = promise.then do |result|
|
288
|
+
http_response = result.response
|
293
289
|
status_code = http_response.status
|
294
290
|
response_content = http_response.body
|
295
291
|
unless status_code == 202 || status_code == 200
|
296
292
|
error_model = JSON.load(response_content)
|
297
|
-
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
293
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
298
294
|
end
|
299
295
|
|
300
|
-
# Create Result
|
301
|
-
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
302
296
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
303
297
|
# Deserialize Response
|
304
298
|
if status_code == 200
|
@@ -377,30 +371,27 @@ module Azure::ARM::Storage
|
|
377
371
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
378
372
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
379
373
|
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'
|
374
|
+
|
375
|
+
request_url = @base_url || @client.base_url
|
376
|
+
|
380
377
|
options = {
|
381
378
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
382
379
|
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
|
383
380
|
query_params: {'api-version' => @client.api_version},
|
384
|
-
headers: request_headers.merge(custom_headers || {})
|
381
|
+
headers: request_headers.merge(custom_headers || {}),
|
382
|
+
base_url: request_url
|
385
383
|
}
|
384
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
386
385
|
|
387
|
-
|
388
|
-
|
389
|
-
request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, options)
|
390
|
-
promise = request.run_promise do |req|
|
391
|
-
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
392
|
-
end
|
393
|
-
|
394
|
-
promise = promise.then do |http_response|
|
386
|
+
promise = promise.then do |result|
|
387
|
+
http_response = result.response
|
395
388
|
status_code = http_response.status
|
396
389
|
response_content = http_response.body
|
397
390
|
unless status_code == 200 || status_code == 204
|
398
391
|
error_model = JSON.load(response_content)
|
399
|
-
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
392
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
400
393
|
end
|
401
394
|
|
402
|
-
# Create Result
|
403
|
-
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
404
395
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
405
396
|
|
406
397
|
result
|
@@ -476,30 +467,27 @@ module Azure::ARM::Storage
|
|
476
467
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
477
468
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
478
469
|
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'
|
470
|
+
|
471
|
+
request_url = @base_url || @client.base_url
|
472
|
+
|
479
473
|
options = {
|
480
474
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
481
475
|
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
|
482
476
|
query_params: {'api-version' => @client.api_version},
|
483
|
-
headers: request_headers.merge(custom_headers || {})
|
477
|
+
headers: request_headers.merge(custom_headers || {}),
|
478
|
+
base_url: request_url
|
484
479
|
}
|
480
|
+
promise = @client.make_request_async(:get, path_template, options)
|
485
481
|
|
486
|
-
|
487
|
-
|
488
|
-
request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
|
489
|
-
promise = request.run_promise do |req|
|
490
|
-
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
491
|
-
end
|
492
|
-
|
493
|
-
promise = promise.then do |http_response|
|
482
|
+
promise = promise.then do |result|
|
483
|
+
http_response = result.response
|
494
484
|
status_code = http_response.status
|
495
485
|
response_content = http_response.body
|
496
486
|
unless status_code == 200
|
497
487
|
error_model = JSON.load(response_content)
|
498
|
-
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
488
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
499
489
|
end
|
500
490
|
|
501
|
-
# Create Result
|
502
|
-
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
503
491
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
504
492
|
# Deserialize Response
|
505
493
|
if status_code == 200
|
@@ -618,31 +606,28 @@ module Azure::ARM::Storage
|
|
618
606
|
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
619
607
|
|
620
608
|
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'
|
609
|
+
|
610
|
+
request_url = @base_url || @client.base_url
|
611
|
+
|
621
612
|
options = {
|
622
613
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
623
614
|
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
|
624
615
|
query_params: {'api-version' => @client.api_version},
|
625
616
|
body: request_content,
|
626
|
-
headers: request_headers.merge(custom_headers || {})
|
617
|
+
headers: request_headers.merge(custom_headers || {}),
|
618
|
+
base_url: request_url
|
627
619
|
}
|
620
|
+
promise = @client.make_request_async(:patch, path_template, options)
|
628
621
|
|
629
|
-
|
630
|
-
|
631
|
-
request = MsRest::HttpOperationRequest.new(request_url, path_template, :patch, options)
|
632
|
-
promise = request.run_promise do |req|
|
633
|
-
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
634
|
-
end
|
635
|
-
|
636
|
-
promise = promise.then do |http_response|
|
622
|
+
promise = promise.then do |result|
|
623
|
+
http_response = result.response
|
637
624
|
status_code = http_response.status
|
638
625
|
response_content = http_response.body
|
639
626
|
unless status_code == 200
|
640
627
|
error_model = JSON.load(response_content)
|
641
|
-
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
628
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
642
629
|
end
|
643
630
|
|
644
|
-
# Create Result
|
645
|
-
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
646
631
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
647
632
|
# Deserialize Response
|
648
633
|
if status_code == 200
|
@@ -708,30 +693,27 @@ module Azure::ARM::Storage
|
|
708
693
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
709
694
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
710
695
|
path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'
|
696
|
+
|
697
|
+
request_url = @base_url || @client.base_url
|
698
|
+
|
711
699
|
options = {
|
712
700
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
713
701
|
path_params: {'subscriptionId' => @client.subscription_id},
|
714
702
|
query_params: {'api-version' => @client.api_version},
|
715
|
-
headers: request_headers.merge(custom_headers || {})
|
703
|
+
headers: request_headers.merge(custom_headers || {}),
|
704
|
+
base_url: request_url
|
716
705
|
}
|
706
|
+
promise = @client.make_request_async(:get, path_template, options)
|
717
707
|
|
718
|
-
|
719
|
-
|
720
|
-
request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
|
721
|
-
promise = request.run_promise do |req|
|
722
|
-
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
723
|
-
end
|
724
|
-
|
725
|
-
promise = promise.then do |http_response|
|
708
|
+
promise = promise.then do |result|
|
709
|
+
http_response = result.response
|
726
710
|
status_code = http_response.status
|
727
711
|
response_content = http_response.body
|
728
712
|
unless status_code == 200
|
729
713
|
error_model = JSON.load(response_content)
|
730
|
-
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
714
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
731
715
|
end
|
732
716
|
|
733
|
-
# Create Result
|
734
|
-
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
735
717
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
736
718
|
# Deserialize Response
|
737
719
|
if status_code == 200
|
@@ -807,30 +789,27 @@ module Azure::ARM::Storage
|
|
807
789
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
808
790
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
809
791
|
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'
|
792
|
+
|
793
|
+
request_url = @base_url || @client.base_url
|
794
|
+
|
810
795
|
options = {
|
811
796
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
812
797
|
path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
|
813
798
|
query_params: {'api-version' => @client.api_version},
|
814
|
-
headers: request_headers.merge(custom_headers || {})
|
799
|
+
headers: request_headers.merge(custom_headers || {}),
|
800
|
+
base_url: request_url
|
815
801
|
}
|
802
|
+
promise = @client.make_request_async(:get, path_template, options)
|
816
803
|
|
817
|
-
|
818
|
-
|
819
|
-
request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
|
820
|
-
promise = request.run_promise do |req|
|
821
|
-
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
822
|
-
end
|
823
|
-
|
824
|
-
promise = promise.then do |http_response|
|
804
|
+
promise = promise.then do |result|
|
805
|
+
http_response = result.response
|
825
806
|
status_code = http_response.status
|
826
807
|
response_content = http_response.body
|
827
808
|
unless status_code == 200
|
828
809
|
error_model = JSON.load(response_content)
|
829
|
-
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
810
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
830
811
|
end
|
831
812
|
|
832
|
-
# Create Result
|
833
|
-
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
834
813
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
835
814
|
# Deserialize Response
|
836
815
|
if status_code == 200
|
@@ -901,30 +880,27 @@ module Azure::ARM::Storage
|
|
901
880
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
902
881
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
903
882
|
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'
|
883
|
+
|
884
|
+
request_url = @base_url || @client.base_url
|
885
|
+
|
904
886
|
options = {
|
905
887
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
906
888
|
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
|
907
889
|
query_params: {'api-version' => @client.api_version},
|
908
|
-
headers: request_headers.merge(custom_headers || {})
|
890
|
+
headers: request_headers.merge(custom_headers || {}),
|
891
|
+
base_url: request_url
|
909
892
|
}
|
893
|
+
promise = @client.make_request_async(:post, path_template, options)
|
910
894
|
|
911
|
-
|
912
|
-
|
913
|
-
request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
|
914
|
-
promise = request.run_promise do |req|
|
915
|
-
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
916
|
-
end
|
917
|
-
|
918
|
-
promise = promise.then do |http_response|
|
895
|
+
promise = promise.then do |result|
|
896
|
+
http_response = result.response
|
919
897
|
status_code = http_response.status
|
920
898
|
response_content = http_response.body
|
921
899
|
unless status_code == 200
|
922
900
|
error_model = JSON.load(response_content)
|
923
|
-
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
901
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
924
902
|
end
|
925
903
|
|
926
|
-
# Create Result
|
927
|
-
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
928
904
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
929
905
|
# Deserialize Response
|
930
906
|
if status_code == 200
|
@@ -1019,31 +995,28 @@ module Azure::ARM::Storage
|
|
1019
995
|
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
1020
996
|
|
1021
997
|
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'
|
998
|
+
|
999
|
+
request_url = @base_url || @client.base_url
|
1000
|
+
|
1022
1001
|
options = {
|
1023
1002
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1024
1003
|
path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
|
1025
1004
|
query_params: {'api-version' => @client.api_version},
|
1026
1005
|
body: request_content,
|
1027
|
-
headers: request_headers.merge(custom_headers || {})
|
1006
|
+
headers: request_headers.merge(custom_headers || {}),
|
1007
|
+
base_url: request_url
|
1028
1008
|
}
|
1009
|
+
promise = @client.make_request_async(:post, path_template, options)
|
1029
1010
|
|
1030
|
-
|
1031
|
-
|
1032
|
-
request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
|
1033
|
-
promise = request.run_promise do |req|
|
1034
|
-
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
1035
|
-
end
|
1036
|
-
|
1037
|
-
promise = promise.then do |http_response|
|
1011
|
+
promise = promise.then do |result|
|
1012
|
+
http_response = result.response
|
1038
1013
|
status_code = http_response.status
|
1039
1014
|
response_content = http_response.body
|
1040
1015
|
unless status_code == 200
|
1041
1016
|
error_model = JSON.load(response_content)
|
1042
|
-
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
1017
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
1043
1018
|
end
|
1044
1019
|
|
1045
|
-
# Create Result
|
1046
|
-
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
1047
1020
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1048
1021
|
# Deserialize Response
|
1049
1022
|
if status_code == 200
|
@@ -36,10 +36,6 @@ module Azure::ARM::Storage
|
|
36
36
|
# is generated and included in each request. Default is true.
|
37
37
|
attr_accessor :generate_client_request_id
|
38
38
|
|
39
|
-
# @return Subscription credentials which uniquely identify client
|
40
|
-
# subscription.
|
41
|
-
attr_accessor :credentials
|
42
|
-
|
43
39
|
# @return [StorageAccounts] storage_accounts
|
44
40
|
attr_reader :storage_accounts
|
45
41
|
|
@@ -68,5 +64,60 @@ module Azure::ARM::Storage
|
|
68
64
|
@generate_client_request_id = true
|
69
65
|
end
|
70
66
|
|
67
|
+
#
|
68
|
+
# Makes a request and returns the body of the response.
|
69
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
70
|
+
# @param path [String] the path, relative to {base_url}.
|
71
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
72
|
+
# @return [Hash{String=>String}] containing the body of the response.
|
73
|
+
# Example:
|
74
|
+
#
|
75
|
+
# request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
|
76
|
+
# path = "/path"
|
77
|
+
# options = {
|
78
|
+
# body: request_content,
|
79
|
+
# query_params: {'api-version' => '2016-02-01'}
|
80
|
+
# }
|
81
|
+
# result = @client.make_request(:put, path, options)
|
82
|
+
#
|
83
|
+
def make_request(method, path, options = {})
|
84
|
+
result = make_request_with_http_info(method, path, options)
|
85
|
+
result.body unless result.nil?
|
86
|
+
end
|
87
|
+
|
88
|
+
#
|
89
|
+
# Makes a request and returns the operation response.
|
90
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
91
|
+
# @param path [String] the path, relative to {base_url}.
|
92
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
93
|
+
# @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
|
94
|
+
#
|
95
|
+
def make_request_with_http_info(method, path, options = {})
|
96
|
+
result = make_request_async(method, path, options).value!
|
97
|
+
result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
|
98
|
+
result
|
99
|
+
end
|
100
|
+
|
101
|
+
#
|
102
|
+
# Makes a request asynchronously.
|
103
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
104
|
+
# @param path [String] the path, relative to {base_url}.
|
105
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
106
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
107
|
+
#
|
108
|
+
def make_request_async(method, path, options = {})
|
109
|
+
fail ArgumentError, 'method is nil' if method.nil?
|
110
|
+
fail ArgumentError, 'path is nil' if path.nil?
|
111
|
+
|
112
|
+
request_url = options[:base_url] || @base_url
|
113
|
+
|
114
|
+
request_headers = @request_headers
|
115
|
+
request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
|
116
|
+
options.merge!({headers: request_headers.merge(options[:headers] || {})})
|
117
|
+
options.merge!({credentials: @credentials}) unless @credentials.nil?
|
118
|
+
|
119
|
+
super(request_url, method, path, options)
|
120
|
+
end
|
121
|
+
|
71
122
|
end
|
72
123
|
end
|
@@ -69,30 +69,27 @@ module Azure::ARM::Storage
|
|
69
69
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
70
70
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
71
71
|
path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages'
|
72
|
+
|
73
|
+
request_url = @base_url || @client.base_url
|
74
|
+
|
72
75
|
options = {
|
73
76
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
74
77
|
path_params: {'subscriptionId' => @client.subscription_id},
|
75
78
|
query_params: {'api-version' => @client.api_version},
|
76
|
-
headers: request_headers.merge(custom_headers || {})
|
79
|
+
headers: request_headers.merge(custom_headers || {}),
|
80
|
+
base_url: request_url
|
77
81
|
}
|
82
|
+
promise = @client.make_request_async(:get, path_template, options)
|
78
83
|
|
79
|
-
|
80
|
-
|
81
|
-
request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
|
82
|
-
promise = request.run_promise do |req|
|
83
|
-
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
84
|
-
end
|
85
|
-
|
86
|
-
promise = promise.then do |http_response|
|
84
|
+
promise = promise.then do |result|
|
85
|
+
http_response = result.response
|
87
86
|
status_code = http_response.status
|
88
87
|
response_content = http_response.body
|
89
88
|
unless status_code == 200
|
90
89
|
error_model = JSON.load(response_content)
|
91
|
-
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
90
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
92
91
|
end
|
93
92
|
|
94
|
-
# Create Result
|
95
|
-
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
96
93
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
97
94
|
# Deserialize Response
|
98
95
|
if status_code == 200
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: azure_mgmt_storage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Microsoft Corporation
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 0.6.0
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
82
|
+
version: 0.6.0
|
83
83
|
description: Microsoft Azure Storage Management Client Library for Ruby
|
84
84
|
email: azrubyteam@microsoft.com
|
85
85
|
executables: []
|
@@ -134,7 +134,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
134
134
|
requirements:
|
135
135
|
- - ">="
|
136
136
|
- !ruby/object:Gem::Version
|
137
|
-
version:
|
137
|
+
version: 2.0.0
|
138
138
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
139
139
|
requirements:
|
140
140
|
- - ">="
|