azure_mgmt_cdn 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/azure_mgmt_cdn/cdn_management_client.rb +268 -14
  3. data/lib/generated/azure_mgmt_cdn/custom_domains.rb +28 -28
  4. data/lib/generated/azure_mgmt_cdn/edge_nodes.rb +109 -0
  5. data/lib/generated/azure_mgmt_cdn/endpoints.rb +306 -60
  6. data/lib/generated/azure_mgmt_cdn/models/cidr_ip_address.rb +54 -0
  7. data/lib/generated/azure_mgmt_cdn/models/custom_domain.rb +3 -5
  8. data/lib/generated/azure_mgmt_cdn/models/deep_created_origin.rb +3 -3
  9. data/lib/generated/azure_mgmt_cdn/models/edge_node.rb +97 -0
  10. data/lib/generated/azure_mgmt_cdn/models/edgenode_result.rb +53 -0
  11. data/lib/generated/azure_mgmt_cdn/models/endpoint.rb +22 -21
  12. data/lib/generated/azure_mgmt_cdn/models/endpoint_update_parameters.rb +16 -15
  13. data/lib/generated/azure_mgmt_cdn/models/geo_filter.rb +5 -5
  14. data/lib/generated/azure_mgmt_cdn/models/ip_address_group.rb +80 -0
  15. data/lib/generated/azure_mgmt_cdn/models/load_parameters.rb +3 -3
  16. data/lib/generated/azure_mgmt_cdn/models/profile.rb +2 -1
  17. data/lib/generated/azure_mgmt_cdn/models/profile_update_parameters.rb +1 -1
  18. data/lib/generated/azure_mgmt_cdn/models/purge_parameters.rb +1 -1
  19. data/lib/generated/azure_mgmt_cdn/models/resource_usage.rb +74 -0
  20. data/lib/generated/azure_mgmt_cdn/models/resource_usage_list_result.rb +94 -0
  21. data/lib/generated/azure_mgmt_cdn/models/sku.rb +2 -1
  22. data/lib/generated/azure_mgmt_cdn/models/sso_uri.rb +2 -2
  23. data/lib/generated/azure_mgmt_cdn/models/validate_custom_domain_input.rb +1 -1
  24. data/lib/generated/azure_mgmt_cdn/models/validate_custom_domain_output.rb +1 -1
  25. data/lib/generated/azure_mgmt_cdn/origins.rb +14 -14
  26. data/lib/generated/azure_mgmt_cdn/profiles.rb +230 -22
  27. data/lib/generated/azure_mgmt_cdn/version.rb +1 -1
  28. data/lib/generated/azure_mgmt_cdn.rb +21 -14
  29. metadata +11 -4
@@ -0,0 +1,94 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::CDN
7
+ module Models
8
+ #
9
+ # Output of check resource usage API.
10
+ #
11
+ class ResourceUsageListResult
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [Array<ResourceUsage>] List of resource usages.
16
+ attr_accessor :value
17
+
18
+ # @return [String] URL to get the next set of custom domain objects if
19
+ # there are any.
20
+ attr_accessor :next_link
21
+
22
+ # return [Proc] with next page method call.
23
+ attr_accessor :next_method
24
+
25
+ #
26
+ # Gets the rest of the items for the request, enabling auto-pagination.
27
+ #
28
+ # @return [Array<ResourceUsage>] operation results.
29
+ #
30
+ def get_all_items
31
+ items = @value
32
+ page = self
33
+ while page.next_link != nil do
34
+ page = page.get_next_page
35
+ items.concat(page.value)
36
+ end
37
+ items
38
+ end
39
+
40
+ #
41
+ # Gets the next page of results.
42
+ #
43
+ # @return [ResourceUsageListResult] with next page content.
44
+ #
45
+ def get_next_page
46
+ response = @next_method.call(@next_link).value! unless @next_method.nil?
47
+ unless response.nil?
48
+ @next_link = response.body.next_link
49
+ @value = response.body.value
50
+ self
51
+ end
52
+ end
53
+
54
+ #
55
+ # Mapper for ResourceUsageListResult class as Ruby Hash.
56
+ # This will be used for serialization/deserialization.
57
+ #
58
+ def self.mapper()
59
+ {
60
+ required: false,
61
+ serialized_name: 'ResourceUsageListResult',
62
+ type: {
63
+ name: 'Composite',
64
+ class_name: 'ResourceUsageListResult',
65
+ model_properties: {
66
+ value: {
67
+ required: false,
68
+ serialized_name: 'value',
69
+ type: {
70
+ name: 'Sequence',
71
+ element: {
72
+ required: false,
73
+ serialized_name: 'ResourceUsageElementType',
74
+ type: {
75
+ name: 'Composite',
76
+ class_name: 'ResourceUsage'
77
+ }
78
+ }
79
+ }
80
+ },
81
+ next_link: {
82
+ required: false,
83
+ serialized_name: 'nextLink',
84
+ type: {
85
+ name: 'String'
86
+ }
87
+ }
88
+ }
89
+ }
90
+ }
91
+ end
92
+ end
93
+ end
94
+ end
@@ -6,7 +6,8 @@
6
6
  module Azure::ARM::CDN
7
7
  module Models
8
8
  #
9
- # The SKU (pricing tier) of the CDN profile.
9
+ # The pricing tier (defines a CDN provider, feature list and rate) of the
10
+ # CDN profile.
10
11
  #
11
12
  class Sku
12
13
 
@@ -6,13 +6,13 @@
6
6
  module Azure::ARM::CDN
7
7
  module Models
8
8
  #
9
- # SSO URI required to login to third party web portal.
9
+ # SSO URI required to login to the supplemental portal.
10
10
  #
11
11
  class SsoUri
12
12
 
13
13
  include MsRestAzure
14
14
 
15
- # @return [String] The URI used to login to third party web portal.
15
+ # @return [String] The URI used to login to the supplemental portal.
16
16
  attr_accessor :sso_uri_value
17
17
 
18
18
 
@@ -6,7 +6,7 @@
6
6
  module Azure::ARM::CDN
7
7
  module Models
8
8
  #
9
- # Input of the custom domain to be validated.
9
+ # Input of the custom domain to be validated for DNS mapping.
10
10
  #
11
11
  class ValidateCustomDomainInput
12
12
 
@@ -19,7 +19,7 @@ module Azure::ARM::CDN
19
19
  # @return [String] The reason why the custom domain is not valid.
20
20
  attr_accessor :reason
21
21
 
22
- # @return [String] The message describing why the custom domain is not
22
+ # @return [String] Error message describing why the custom domain is not
23
23
  # valid.
24
24
  attr_accessor :message
25
25
 
@@ -25,7 +25,7 @@ module Azure::ARM::CDN
25
25
  attr_reader :client
26
26
 
27
27
  #
28
- # Lists the existing CDN origins within an endpoint.
28
+ # Lists all of the existing origins within an endpoint.
29
29
  #
30
30
  # @param resource_group_name [String] Name of the Resource group within the
31
31
  # Azure subscription.
@@ -44,7 +44,7 @@ module Azure::ARM::CDN
44
44
  end
45
45
 
46
46
  #
47
- # Lists the existing CDN origins within an endpoint.
47
+ # Lists all of the existing origins within an endpoint.
48
48
  #
49
49
  # @param resource_group_name [String] Name of the Resource group within the
50
50
  # Azure subscription.
@@ -62,7 +62,7 @@ module Azure::ARM::CDN
62
62
  end
63
63
 
64
64
  #
65
- # Lists the existing CDN origins within an endpoint.
65
+ # Lists all of the existing origins within an endpoint.
66
66
  #
67
67
  # @param resource_group_name [String] Name of the Resource group within the
68
68
  # Azure subscription.
@@ -129,7 +129,7 @@ module Azure::ARM::CDN
129
129
  end
130
130
 
131
131
  #
132
- # Gets an existing CDN origin within an endpoint.
132
+ # Gets an existing origin within an endpoint.
133
133
  #
134
134
  # @param resource_group_name [String] Name of the Resource group within the
135
135
  # Azure subscription.
@@ -150,7 +150,7 @@ module Azure::ARM::CDN
150
150
  end
151
151
 
152
152
  #
153
- # Gets an existing CDN origin within an endpoint.
153
+ # Gets an existing origin within an endpoint.
154
154
  #
155
155
  # @param resource_group_name [String] Name of the Resource group within the
156
156
  # Azure subscription.
@@ -170,7 +170,7 @@ module Azure::ARM::CDN
170
170
  end
171
171
 
172
172
  #
173
- # Gets an existing CDN origin within an endpoint.
173
+ # Gets an existing origin within an endpoint.
174
174
  #
175
175
  # @param resource_group_name [String] Name of the Resource group within the
176
176
  # Azure subscription.
@@ -240,7 +240,7 @@ module Azure::ARM::CDN
240
240
  end
241
241
 
242
242
  #
243
- # Updates an existing CDN origin within an endpoint.
243
+ # Updates an existing origin within an endpoint.
244
244
  #
245
245
  # @param resource_group_name [String] Name of the Resource group within the
246
246
  # Azure subscription.
@@ -296,7 +296,7 @@ module Azure::ARM::CDN
296
296
  end
297
297
 
298
298
  #
299
- # Updates an existing CDN origin within an endpoint.
299
+ # Updates an existing origin within an endpoint.
300
300
  #
301
301
  # @param resource_group_name [String] Name of the Resource group within the
302
302
  # Azure subscription.
@@ -318,7 +318,7 @@ module Azure::ARM::CDN
318
318
  end
319
319
 
320
320
  #
321
- # Updates an existing CDN origin within an endpoint.
321
+ # Updates an existing origin within an endpoint.
322
322
  #
323
323
  # @param resource_group_name [String] Name of the Resource group within the
324
324
  # Azure subscription.
@@ -339,7 +339,7 @@ module Azure::ARM::CDN
339
339
  end
340
340
 
341
341
  #
342
- # Updates an existing CDN origin within an endpoint.
342
+ # Updates an existing origin within an endpoint.
343
343
  #
344
344
  # @param resource_group_name [String] Name of the Resource group within the
345
345
  # Azure subscription.
@@ -430,7 +430,7 @@ module Azure::ARM::CDN
430
430
  end
431
431
 
432
432
  #
433
- # Lists the existing CDN origins within an endpoint.
433
+ # Lists all of the existing origins within an endpoint.
434
434
  #
435
435
  # @param next_page_link [String] The NextLink from the previous successful call
436
436
  # to List operation.
@@ -445,7 +445,7 @@ module Azure::ARM::CDN
445
445
  end
446
446
 
447
447
  #
448
- # Lists the existing CDN origins within an endpoint.
448
+ # Lists all of the existing origins within an endpoint.
449
449
  #
450
450
  # @param next_page_link [String] The NextLink from the previous successful call
451
451
  # to List operation.
@@ -459,7 +459,7 @@ module Azure::ARM::CDN
459
459
  end
460
460
 
461
461
  #
462
- # Lists the existing CDN origins within an endpoint.
462
+ # Lists all of the existing origins within an endpoint.
463
463
  #
464
464
  # @param next_page_link [String] The NextLink from the previous successful call
465
465
  # to List operation.
@@ -517,7 +517,7 @@ module Azure::ARM::CDN
517
517
  end
518
518
 
519
519
  #
520
- # Lists the existing CDN origins within an endpoint.
520
+ # Lists all of the existing origins within an endpoint.
521
521
  #
522
522
  # @param resource_group_name [String] Name of the Resource group within the
523
523
  # Azure subscription.
@@ -25,7 +25,7 @@ module Azure::ARM::CDN
25
25
  attr_reader :client
26
26
 
27
27
  #
28
- # Lists all the CDN profiles within an Azure subscription.
28
+ # Lists all of the CDN profiles within an Azure subscription.
29
29
  #
30
30
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
31
  # will be added to the HTTP request.
@@ -38,7 +38,7 @@ module Azure::ARM::CDN
38
38
  end
39
39
 
40
40
  #
41
- # Lists all the CDN profiles within an Azure subscription.
41
+ # Lists all of the CDN profiles within an Azure subscription.
42
42
  #
43
43
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
44
44
  # will be added to the HTTP request.
@@ -50,7 +50,7 @@ module Azure::ARM::CDN
50
50
  end
51
51
 
52
52
  #
53
- # Lists all the CDN profiles within an Azure subscription.
53
+ # Lists all of the CDN profiles within an Azure subscription.
54
54
  #
55
55
  # @param [Hash{String => String}] A hash of custom headers that will be added
56
56
  # to the HTTP request.
@@ -108,7 +108,7 @@ module Azure::ARM::CDN
108
108
  end
109
109
 
110
110
  #
111
- # Lists all the CDN profiles within a resource group.
111
+ # Lists all of the CDN profiles within a resource group.
112
112
  #
113
113
  # @param resource_group_name [String] Name of the Resource group within the
114
114
  # Azure subscription.
@@ -123,7 +123,7 @@ module Azure::ARM::CDN
123
123
  end
124
124
 
125
125
  #
126
- # Lists all the CDN profiles within a resource group.
126
+ # Lists all of the CDN profiles within a resource group.
127
127
  #
128
128
  # @param resource_group_name [String] Name of the Resource group within the
129
129
  # Azure subscription.
@@ -137,7 +137,7 @@ module Azure::ARM::CDN
137
137
  end
138
138
 
139
139
  #
140
- # Lists all the CDN profiles within a resource group.
140
+ # Lists all of the CDN profiles within a resource group.
141
141
  #
142
142
  # @param resource_group_name [String] Name of the Resource group within the
143
143
  # Azure subscription.
@@ -399,8 +399,8 @@ module Azure::ARM::CDN
399
399
 
400
400
  #
401
401
  # Deletes an existing CDN profile with the specified parameters. Deleting a
402
- # profile will result in the deletion of all subresources including endpoints,
403
- # origins and custom domains.
402
+ # profile will result in the deletion of all of the sub-resources including
403
+ # endpoints, origins and custom domains.
404
404
  #
405
405
  # @param resource_group_name [String] Name of the Resource group within the
406
406
  # Azure subscription.
@@ -550,6 +550,103 @@ module Azure::ARM::CDN
550
550
  promise.execute
551
551
  end
552
552
 
553
+ #
554
+ # Checks the quota and actual usage of endpoints under the given CDN profile.
555
+ #
556
+ # @param resource_group_name [String] Name of the Resource group within the
557
+ # Azure subscription.
558
+ # @param profile_name [String] Name of the CDN profile which is unique within
559
+ # the resource group.
560
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
561
+ # will be added to the HTTP request.
562
+ #
563
+ # @return [Array<ResourceUsage>] operation results.
564
+ #
565
+ def list_resource_usage(resource_group_name, profile_name, custom_headers = nil)
566
+ first_page = list_resource_usage_as_lazy(resource_group_name, profile_name, custom_headers)
567
+ first_page.get_all_items
568
+ end
569
+
570
+ #
571
+ # Checks the quota and actual usage of endpoints under the given CDN profile.
572
+ #
573
+ # @param resource_group_name [String] Name of the Resource group within the
574
+ # Azure subscription.
575
+ # @param profile_name [String] Name of the CDN profile which is unique within
576
+ # the resource group.
577
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
578
+ # will be added to the HTTP request.
579
+ #
580
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
581
+ #
582
+ def list_resource_usage_with_http_info(resource_group_name, profile_name, custom_headers = nil)
583
+ list_resource_usage_async(resource_group_name, profile_name, custom_headers).value!
584
+ end
585
+
586
+ #
587
+ # Checks the quota and actual usage of endpoints under the given CDN profile.
588
+ #
589
+ # @param resource_group_name [String] Name of the Resource group within the
590
+ # Azure subscription.
591
+ # @param profile_name [String] Name of the CDN profile which is unique within
592
+ # the resource group.
593
+ # @param [Hash{String => String}] A hash of custom headers that will be added
594
+ # to the HTTP request.
595
+ #
596
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
597
+ #
598
+ def list_resource_usage_async(resource_group_name, profile_name, custom_headers = nil)
599
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
600
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
601
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
602
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
603
+
604
+
605
+ request_headers = {}
606
+
607
+ # Set Headers
608
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
609
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
610
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/checkResourceUsage'
611
+
612
+ request_url = @base_url || @client.base_url
613
+
614
+ options = {
615
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
616
+ path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'subscriptionId' => @client.subscription_id},
617
+ query_params: {'api-version' => @client.api_version},
618
+ headers: request_headers.merge(custom_headers || {}),
619
+ base_url: request_url
620
+ }
621
+ promise = @client.make_request_async(:post, path_template, options)
622
+
623
+ promise = promise.then do |result|
624
+ http_response = result.response
625
+ status_code = http_response.status
626
+ response_content = http_response.body
627
+ unless status_code == 200
628
+ error_model = JSON.load(response_content)
629
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
630
+ end
631
+
632
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
633
+ # Deserialize Response
634
+ if status_code == 200
635
+ begin
636
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
637
+ result_mapper = ResourceUsageListResult.mapper()
638
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
639
+ rescue Exception => e
640
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
641
+ end
642
+ end
643
+
644
+ result
645
+ end
646
+
647
+ promise.execute
648
+ end
649
+
553
650
  #
554
651
  # Creates a new CDN profile with a profile name under the specified
555
652
  # subscription and resource group.
@@ -811,8 +908,8 @@ module Azure::ARM::CDN
811
908
 
812
909
  #
813
910
  # Deletes an existing CDN profile with the specified parameters. Deleting a
814
- # profile will result in the deletion of all subresources including endpoints,
815
- # origins and custom domains.
911
+ # profile will result in the deletion of all of the sub-resources including
912
+ # endpoints, origins and custom domains.
816
913
  #
817
914
  # @param resource_group_name [String] Name of the Resource group within the
818
915
  # Azure subscription.
@@ -829,8 +926,8 @@ module Azure::ARM::CDN
829
926
 
830
927
  #
831
928
  # Deletes an existing CDN profile with the specified parameters. Deleting a
832
- # profile will result in the deletion of all subresources including endpoints,
833
- # origins and custom domains.
929
+ # profile will result in the deletion of all of the sub-resources including
930
+ # endpoints, origins and custom domains.
834
931
  #
835
932
  # @param resource_group_name [String] Name of the Resource group within the
836
933
  # Azure subscription.
@@ -847,8 +944,8 @@ module Azure::ARM::CDN
847
944
 
848
945
  #
849
946
  # Deletes an existing CDN profile with the specified parameters. Deleting a
850
- # profile will result in the deletion of all subresources including endpoints,
851
- # origins and custom domains.
947
+ # profile will result in the deletion of all of the sub-resources including
948
+ # endpoints, origins and custom domains.
852
949
  #
853
950
  # @param resource_group_name [String] Name of the Resource group within the
854
951
  # Azure subscription.
@@ -902,7 +999,7 @@ module Azure::ARM::CDN
902
999
  end
903
1000
 
904
1001
  #
905
- # Lists all the CDN profiles within an Azure subscription.
1002
+ # Lists all of the CDN profiles within an Azure subscription.
906
1003
  #
907
1004
  # @param next_page_link [String] The NextLink from the previous successful call
908
1005
  # to List operation.
@@ -917,7 +1014,7 @@ module Azure::ARM::CDN
917
1014
  end
918
1015
 
919
1016
  #
920
- # Lists all the CDN profiles within an Azure subscription.
1017
+ # Lists all of the CDN profiles within an Azure subscription.
921
1018
  #
922
1019
  # @param next_page_link [String] The NextLink from the previous successful call
923
1020
  # to List operation.
@@ -931,7 +1028,7 @@ module Azure::ARM::CDN
931
1028
  end
932
1029
 
933
1030
  #
934
- # Lists all the CDN profiles within an Azure subscription.
1031
+ # Lists all of the CDN profiles within an Azure subscription.
935
1032
  #
936
1033
  # @param next_page_link [String] The NextLink from the previous successful call
937
1034
  # to List operation.
@@ -989,7 +1086,7 @@ module Azure::ARM::CDN
989
1086
  end
990
1087
 
991
1088
  #
992
- # Lists all the CDN profiles within a resource group.
1089
+ # Lists all of the CDN profiles within a resource group.
993
1090
  #
994
1091
  # @param next_page_link [String] The NextLink from the previous successful call
995
1092
  # to List operation.
@@ -1004,7 +1101,7 @@ module Azure::ARM::CDN
1004
1101
  end
1005
1102
 
1006
1103
  #
1007
- # Lists all the CDN profiles within a resource group.
1104
+ # Lists all of the CDN profiles within a resource group.
1008
1105
  #
1009
1106
  # @param next_page_link [String] The NextLink from the previous successful call
1010
1107
  # to List operation.
@@ -1018,7 +1115,7 @@ module Azure::ARM::CDN
1018
1115
  end
1019
1116
 
1020
1117
  #
1021
- # Lists all the CDN profiles within a resource group.
1118
+ # Lists all of the CDN profiles within a resource group.
1022
1119
  #
1023
1120
  # @param next_page_link [String] The NextLink from the previous successful call
1024
1121
  # to List operation.
@@ -1076,7 +1173,94 @@ module Azure::ARM::CDN
1076
1173
  end
1077
1174
 
1078
1175
  #
1079
- # Lists all the CDN profiles within an Azure subscription.
1176
+ # Checks the quota and actual usage of endpoints under the given CDN profile.
1177
+ #
1178
+ # @param next_page_link [String] The NextLink from the previous successful call
1179
+ # to List operation.
1180
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1181
+ # will be added to the HTTP request.
1182
+ #
1183
+ # @return [ResourceUsageListResult] operation results.
1184
+ #
1185
+ def list_resource_usage_next(next_page_link, custom_headers = nil)
1186
+ response = list_resource_usage_next_async(next_page_link, custom_headers).value!
1187
+ response.body unless response.nil?
1188
+ end
1189
+
1190
+ #
1191
+ # Checks the quota and actual usage of endpoints under the given CDN profile.
1192
+ #
1193
+ # @param next_page_link [String] The NextLink from the previous successful call
1194
+ # to List operation.
1195
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1196
+ # will be added to the HTTP request.
1197
+ #
1198
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1199
+ #
1200
+ def list_resource_usage_next_with_http_info(next_page_link, custom_headers = nil)
1201
+ list_resource_usage_next_async(next_page_link, custom_headers).value!
1202
+ end
1203
+
1204
+ #
1205
+ # Checks the quota and actual usage of endpoints under the given CDN profile.
1206
+ #
1207
+ # @param next_page_link [String] The NextLink from the previous successful call
1208
+ # to List operation.
1209
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1210
+ # to the HTTP request.
1211
+ #
1212
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1213
+ #
1214
+ def list_resource_usage_next_async(next_page_link, custom_headers = nil)
1215
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1216
+
1217
+
1218
+ request_headers = {}
1219
+
1220
+ # Set Headers
1221
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1222
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1223
+ path_template = '{nextLink}'
1224
+
1225
+ request_url = @base_url || @client.base_url
1226
+
1227
+ options = {
1228
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1229
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1230
+ headers: request_headers.merge(custom_headers || {}),
1231
+ base_url: request_url
1232
+ }
1233
+ promise = @client.make_request_async(:post, path_template, options)
1234
+
1235
+ promise = promise.then do |result|
1236
+ http_response = result.response
1237
+ status_code = http_response.status
1238
+ response_content = http_response.body
1239
+ unless status_code == 200
1240
+ error_model = JSON.load(response_content)
1241
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1242
+ end
1243
+
1244
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1245
+ # Deserialize Response
1246
+ if status_code == 200
1247
+ begin
1248
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1249
+ result_mapper = ResourceUsageListResult.mapper()
1250
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
1251
+ rescue Exception => e
1252
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1253
+ end
1254
+ end
1255
+
1256
+ result
1257
+ end
1258
+
1259
+ promise.execute
1260
+ end
1261
+
1262
+ #
1263
+ # Lists all of the CDN profiles within an Azure subscription.
1080
1264
  #
1081
1265
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1082
1266
  # will be added to the HTTP request.
@@ -1096,7 +1280,7 @@ module Azure::ARM::CDN
1096
1280
  end
1097
1281
 
1098
1282
  #
1099
- # Lists all the CDN profiles within a resource group.
1283
+ # Lists all of the CDN profiles within a resource group.
1100
1284
  #
1101
1285
  # @param resource_group_name [String] Name of the Resource group within the
1102
1286
  # Azure subscription.
@@ -1117,5 +1301,29 @@ module Azure::ARM::CDN
1117
1301
  end
1118
1302
  end
1119
1303
 
1304
+ #
1305
+ # Checks the quota and actual usage of endpoints under the given CDN profile.
1306
+ #
1307
+ # @param resource_group_name [String] Name of the Resource group within the
1308
+ # Azure subscription.
1309
+ # @param profile_name [String] Name of the CDN profile which is unique within
1310
+ # the resource group.
1311
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1312
+ # will be added to the HTTP request.
1313
+ #
1314
+ # @return [ResourceUsageListResult] which provide lazy access to pages of the
1315
+ # response.
1316
+ #
1317
+ def list_resource_usage_as_lazy(resource_group_name, profile_name, custom_headers = nil)
1318
+ response = list_resource_usage_async(resource_group_name, profile_name, custom_headers).value!
1319
+ unless response.nil?
1320
+ page = response.body
1321
+ page.next_method = Proc.new do |next_page_link|
1322
+ list_resource_usage_next_async(next_page_link, custom_headers)
1323
+ end
1324
+ page
1325
+ end
1326
+ end
1327
+
1120
1328
  end
1121
1329
  end
@@ -4,5 +4,5 @@
4
4
  # regenerated.
5
5
 
6
6
  module Azure::ARM::CDN
7
- VERSION = '0.8.0'
7
+ VERSION = '0.9.0'
8
8
  end