azure_mgmt_cdn 0.15.2 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (154) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-06-01/generated/azure_mgmt_cdn/cdn_management_client.rb +4 -1
  3. data/lib/2015-06-01/generated/azure_mgmt_cdn/custom_domains.rb +38 -37
  4. data/lib/2015-06-01/generated/azure_mgmt_cdn/endpoints.rb +88 -88
  5. data/lib/2015-06-01/generated/azure_mgmt_cdn/name_availability.rb +6 -7
  6. data/lib/2015-06-01/generated/azure_mgmt_cdn/operations.rb +6 -5
  7. data/lib/2015-06-01/generated/azure_mgmt_cdn/origins.rb +42 -41
  8. data/lib/2015-06-01/generated/azure_mgmt_cdn/profiles.rb +54 -51
  9. data/lib/2016-04-02/generated/azure_mgmt_cdn.rb +70 -0
  10. data/lib/2016-04-02/generated/azure_mgmt_cdn/cdn_management_client.rb +151 -0
  11. data/lib/2016-04-02/generated/azure_mgmt_cdn/custom_domains.rb +719 -0
  12. data/lib/2016-04-02/generated/azure_mgmt_cdn/endpoints.rb +1456 -0
  13. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/check_name_availability_input.rb +60 -0
  14. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/check_name_availability_output.rb +69 -0
  15. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/custom_domain.rb +103 -0
  16. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/custom_domain_list_result.rb +57 -0
  17. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/custom_domain_parameters.rb +47 -0
  18. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/custom_domain_resource_state.rb +17 -0
  19. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/deep_created_origin.rb +82 -0
  20. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/endpoint.rb +249 -0
  21. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/endpoint_create_parameters.rb +185 -0
  22. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/endpoint_list_result.rb +56 -0
  23. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/endpoint_resource_state.rb +20 -0
  24. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/endpoint_update_parameters.rb +152 -0
  25. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/error_response.rb +58 -0
  26. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/load_parameters.rb +55 -0
  27. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/operation.rb +58 -0
  28. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/operation_display.rb +70 -0
  29. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/operation_list_result.rb +57 -0
  30. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/origin.rb +128 -0
  31. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/origin_list_result.rb +56 -0
  32. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/origin_parameters.rb +71 -0
  33. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/origin_resource_state.rb +17 -0
  34. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/profile.rb +128 -0
  35. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/profile_create_parameters.rb +77 -0
  36. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/profile_list_result.rb +56 -0
  37. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/profile_resource_state.rb +18 -0
  38. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/profile_update_parameters.rb +54 -0
  39. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/provisioning_state.rb +17 -0
  40. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/purge_parameters.rb +55 -0
  41. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/query_string_caching_behavior.rb +18 -0
  42. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/resource.rb +72 -0
  43. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/resource_type.rb +15 -0
  44. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/sku.rb +49 -0
  45. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/sku_name.rb +18 -0
  46. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/sso_uri.rb +46 -0
  47. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/tracked_resource.rb +92 -0
  48. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/validate_custom_domain_input.rb +47 -0
  49. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/validate_custom_domain_output.rb +70 -0
  50. data/lib/2016-04-02/generated/azure_mgmt_cdn/module_definition.rb +9 -0
  51. data/lib/2016-04-02/generated/azure_mgmt_cdn/name_availability.rb +130 -0
  52. data/lib/2016-04-02/generated/azure_mgmt_cdn/operations.rb +110 -0
  53. data/lib/2016-04-02/generated/azure_mgmt_cdn/origins.rb +778 -0
  54. data/lib/2016-04-02/generated/azure_mgmt_cdn/profiles.rb +899 -0
  55. data/lib/2016-10-02/generated/azure_mgmt_cdn/cdn_management_client.rb +46 -38
  56. data/lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb +53 -48
  57. data/lib/2016-10-02/generated/azure_mgmt_cdn/edge_nodes.rb +15 -13
  58. data/lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb +112 -109
  59. data/lib/2016-10-02/generated/azure_mgmt_cdn/origins.rb +31 -29
  60. data/lib/2016-10-02/generated/azure_mgmt_cdn/profiles.rb +93 -85
  61. data/lib/2017-04-02/generated/azure_mgmt_cdn.rb +18 -16
  62. data/lib/2017-04-02/generated/azure_mgmt_cdn/cdn_management_client.rb +16 -15
  63. data/lib/2017-04-02/generated/azure_mgmt_cdn/custom_domains.rb +53 -48
  64. data/lib/2017-04-02/generated/azure_mgmt_cdn/edge_nodes.rb +15 -13
  65. data/lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb +136 -113
  66. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/custom_domain.rb +1 -25
  67. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/edge_node.rb +1 -25
  68. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/endpoint.rb +6 -3
  69. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/endpoint_update_parameters.rb +5 -2
  70. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/origin.rb +1 -1
  71. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/profile.rb +1 -1
  72. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/profile_update_parameters.rb +1 -1
  73. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/proxy_resource.rb +63 -0
  74. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/resource.rb +1 -31
  75. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/tracked_resource.rb +92 -0
  76. data/lib/2017-04-02/generated/azure_mgmt_cdn/operations.rb +15 -13
  77. data/lib/2017-04-02/generated/azure_mgmt_cdn/origins.rb +31 -29
  78. data/lib/2017-04-02/generated/azure_mgmt_cdn/profiles.rb +93 -85
  79. data/lib/2017-04-02/generated/azure_mgmt_cdn/resource_usage_operations.rb +15 -13
  80. data/lib/2017-10-12/generated/azure_mgmt_cdn.rb +93 -0
  81. data/lib/2017-10-12/generated/azure_mgmt_cdn/cdn_management_client.rb +358 -0
  82. data/lib/2017-10-12/generated/azure_mgmt_cdn/custom_domains.rb +970 -0
  83. data/lib/2017-10-12/generated/azure_mgmt_cdn/edge_nodes.rb +223 -0
  84. data/lib/2017-10-12/generated/azure_mgmt_cdn/endpoints.rb +1922 -0
  85. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/cache_expiration_action_parameters.rb +89 -0
  86. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/check_name_availability_input.rb +60 -0
  87. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/check_name_availability_output.rb +72 -0
  88. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/cidr_ip_address.rb +57 -0
  89. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/custom_domain.rb +148 -0
  90. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/custom_domain_list_result.rb +102 -0
  91. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/custom_domain_parameters.rb +48 -0
  92. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/custom_domain_resource_state.rb +17 -0
  93. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/custom_https_provisioning_state.rb +19 -0
  94. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/custom_https_provisioning_substate.rb +24 -0
  95. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/deep_created_origin.rb +91 -0
  96. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/delivery_rule.rb +96 -0
  97. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/delivery_rule_action.rb +46 -0
  98. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/delivery_rule_cache_expiration_action.rb +64 -0
  99. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/delivery_rule_condition.rb +47 -0
  100. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/delivery_rule_url_file_extension_condition.rb +64 -0
  101. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/delivery_rule_url_path_condition.rb +64 -0
  102. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/edge_node.rb +83 -0
  103. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/edgenode_result.rb +101 -0
  104. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/endpoint.rb +318 -0
  105. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/endpoint_list_result.rb +101 -0
  106. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/endpoint_properties_update_parameters_delivery_policy.rb +67 -0
  107. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/endpoint_resource_state.rb +20 -0
  108. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/endpoint_update_parameters.rb +223 -0
  109. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/error_response.rb +60 -0
  110. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/geo_filter.rb +80 -0
  111. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/geo_filter_actions.rb +16 -0
  112. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/ip_address_group.rb +86 -0
  113. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/load_parameters.rb +55 -0
  114. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/operation.rb +59 -0
  115. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/operation_display.rb +72 -0
  116. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/operations_list_result.rb +102 -0
  117. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/optimization_type.rb +19 -0
  118. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/origin.rb +158 -0
  119. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/origin_list_result.rb +101 -0
  120. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/origin_resource_state.rb +17 -0
  121. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/origin_update_parameters.rb +79 -0
  122. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/profile.rb +125 -0
  123. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/profile_list_result.rb +101 -0
  124. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/profile_resource_state.rb +18 -0
  125. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/profile_update_parameters.rb +54 -0
  126. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/proxy_resource.rb +63 -0
  127. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/purge_parameters.rb +55 -0
  128. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/query_string_caching_behavior.rb +18 -0
  129. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/resource.rb +71 -0
  130. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/resource_type.rb +15 -0
  131. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/resource_usage.rb +83 -0
  132. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/resource_usage_list_result.rb +100 -0
  133. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/sku.rb +49 -0
  134. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/sku_name.rb +19 -0
  135. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/sso_uri.rb +48 -0
  136. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/supported_optimization_types_list_result.rb +56 -0
  137. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/tracked_resource.rb +92 -0
  138. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/url_file_extension_condition_parameters.rb +70 -0
  139. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/url_path_condition_parameters.rb +72 -0
  140. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/validate_custom_domain_input.rb +47 -0
  141. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/validate_custom_domain_output.rb +72 -0
  142. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/validate_probe_input.rb +46 -0
  143. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/validate_probe_output.rb +73 -0
  144. data/lib/2017-10-12/generated/azure_mgmt_cdn/module_definition.rb +9 -0
  145. data/lib/2017-10-12/generated/azure_mgmt_cdn/operations.rb +217 -0
  146. data/lib/2017-10-12/generated/azure_mgmt_cdn/origins.rb +556 -0
  147. data/lib/2017-10-12/generated/azure_mgmt_cdn/profiles.rb +1460 -0
  148. data/lib/2017-10-12/generated/azure_mgmt_cdn/resource_usage_operations.rb +226 -0
  149. data/lib/azure_mgmt_cdn.rb +2 -0
  150. data/lib/profiles/latest/cdn_latest_profile_client.rb +28 -9
  151. data/lib/profiles/latest/cdn_module_definition.rb +0 -1
  152. data/lib/profiles/latest/modules/cdn_profile_module.rb +277 -210
  153. data/lib/version.rb +1 -1
  154. metadata +119 -2
@@ -0,0 +1,556 @@
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::CDN::Mgmt::V2017_10_12
7
+ #
8
+ # Use these APIs to manage Azure CDN resources through the Azure Resource
9
+ # Manager. You must make sure that requests made to these resources are
10
+ # secure.
11
+ #
12
+ class Origins
13
+ include MsRestAzure
14
+
15
+ #
16
+ # Creates and initializes a new instance of the Origins class.
17
+ # @param client service class for accessing basic functionality.
18
+ #
19
+ def initialize(client)
20
+ @client = client
21
+ end
22
+
23
+ # @return [CdnManagementClient] reference to the CdnManagementClient
24
+ attr_reader :client
25
+
26
+ #
27
+ # Lists all of the existing origins within an endpoint.
28
+ #
29
+ # @param resource_group_name [String] Name of the Resource group within the
30
+ # Azure subscription.
31
+ # @param profile_name [String] Name of the CDN profile which is unique within
32
+ # the resource group.
33
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
34
+ # unique globally.
35
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
36
+ # will be added to the HTTP request.
37
+ #
38
+ # @return [Array<Origin>] operation results.
39
+ #
40
+ def list_by_endpoint(resource_group_name, profile_name, endpoint_name, custom_headers:nil)
41
+ first_page = list_by_endpoint_as_lazy(resource_group_name, profile_name, endpoint_name, custom_headers:custom_headers)
42
+ first_page.get_all_items
43
+ end
44
+
45
+ #
46
+ # Lists all of the existing origins within an endpoint.
47
+ #
48
+ # @param resource_group_name [String] Name of the Resource group within the
49
+ # Azure subscription.
50
+ # @param profile_name [String] Name of the CDN profile which is unique within
51
+ # the resource group.
52
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
53
+ # unique globally.
54
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
55
+ # will be added to the HTTP request.
56
+ #
57
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
58
+ #
59
+ def list_by_endpoint_with_http_info(resource_group_name, profile_name, endpoint_name, custom_headers:nil)
60
+ list_by_endpoint_async(resource_group_name, profile_name, endpoint_name, custom_headers:custom_headers).value!
61
+ end
62
+
63
+ #
64
+ # Lists all of the existing origins within an endpoint.
65
+ #
66
+ # @param resource_group_name [String] Name of the Resource group within the
67
+ # Azure subscription.
68
+ # @param profile_name [String] Name of the CDN profile which is unique within
69
+ # the resource group.
70
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
71
+ # unique globally.
72
+ # @param [Hash{String => String}] A hash of custom headers that will be added
73
+ # to the HTTP request.
74
+ #
75
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
76
+ #
77
+ def list_by_endpoint_async(resource_group_name, profile_name, endpoint_name, custom_headers:nil)
78
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
79
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
80
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
81
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
82
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
83
+ fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
84
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
85
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
86
+
87
+
88
+ request_headers = {}
89
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
90
+
91
+ # Set Headers
92
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
93
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
94
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins'
95
+
96
+ request_url = @base_url || @client.base_url
97
+
98
+ options = {
99
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
100
+ path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'endpointName' => endpoint_name,'subscriptionId' => @client.subscription_id},
101
+ query_params: {'api-version' => @client.api_version},
102
+ headers: request_headers.merge(custom_headers || {}),
103
+ base_url: request_url
104
+ }
105
+ promise = @client.make_request_async(:get, path_template, options)
106
+
107
+ promise = promise.then do |result|
108
+ http_response = result.response
109
+ status_code = http_response.status
110
+ response_content = http_response.body
111
+ unless status_code == 200
112
+ error_model = JSON.load(response_content)
113
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
114
+ end
115
+
116
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
117
+ # Deserialize Response
118
+ if status_code == 200
119
+ begin
120
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
121
+ result_mapper = Azure::CDN::Mgmt::V2017_10_12::Models::OriginListResult.mapper()
122
+ result.body = @client.deserialize(result_mapper, parsed_response)
123
+ rescue Exception => e
124
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
125
+ end
126
+ end
127
+
128
+ result
129
+ end
130
+
131
+ promise.execute
132
+ end
133
+
134
+ #
135
+ # Gets an existing origin within an endpoint.
136
+ #
137
+ # @param resource_group_name [String] Name of the Resource group within the
138
+ # Azure subscription.
139
+ # @param profile_name [String] Name of the CDN profile which is unique within
140
+ # the resource group.
141
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
142
+ # unique globally.
143
+ # @param origin_name [String] Name of the origin which is unique within the
144
+ # endpoint.
145
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
146
+ # will be added to the HTTP request.
147
+ #
148
+ # @return [Origin] operation results.
149
+ #
150
+ def get(resource_group_name, profile_name, endpoint_name, origin_name, custom_headers:nil)
151
+ response = get_async(resource_group_name, profile_name, endpoint_name, origin_name, custom_headers:custom_headers).value!
152
+ response.body unless response.nil?
153
+ end
154
+
155
+ #
156
+ # Gets an existing origin within an endpoint.
157
+ #
158
+ # @param resource_group_name [String] Name of the Resource group within the
159
+ # Azure subscription.
160
+ # @param profile_name [String] Name of the CDN profile which is unique within
161
+ # the resource group.
162
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
163
+ # unique globally.
164
+ # @param origin_name [String] Name of the origin which is unique within the
165
+ # endpoint.
166
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
167
+ # will be added to the HTTP request.
168
+ #
169
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
170
+ #
171
+ def get_with_http_info(resource_group_name, profile_name, endpoint_name, origin_name, custom_headers:nil)
172
+ get_async(resource_group_name, profile_name, endpoint_name, origin_name, custom_headers:custom_headers).value!
173
+ end
174
+
175
+ #
176
+ # Gets an existing origin within an endpoint.
177
+ #
178
+ # @param resource_group_name [String] Name of the Resource group within the
179
+ # Azure subscription.
180
+ # @param profile_name [String] Name of the CDN profile which is unique within
181
+ # the resource group.
182
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
183
+ # unique globally.
184
+ # @param origin_name [String] Name of the origin which is unique within the
185
+ # endpoint.
186
+ # @param [Hash{String => String}] A hash of custom headers that will be added
187
+ # to the HTTP request.
188
+ #
189
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
190
+ #
191
+ def get_async(resource_group_name, profile_name, endpoint_name, origin_name, custom_headers:nil)
192
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
193
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
194
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
195
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
196
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
197
+ fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
198
+ fail ArgumentError, 'origin_name is nil' if origin_name.nil?
199
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
200
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
201
+
202
+
203
+ request_headers = {}
204
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
205
+
206
+ # Set Headers
207
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
208
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
209
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}'
210
+
211
+ request_url = @base_url || @client.base_url
212
+
213
+ options = {
214
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
215
+ path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'endpointName' => endpoint_name,'originName' => origin_name,'subscriptionId' => @client.subscription_id},
216
+ query_params: {'api-version' => @client.api_version},
217
+ headers: request_headers.merge(custom_headers || {}),
218
+ base_url: request_url
219
+ }
220
+ promise = @client.make_request_async(:get, path_template, options)
221
+
222
+ promise = promise.then do |result|
223
+ http_response = result.response
224
+ status_code = http_response.status
225
+ response_content = http_response.body
226
+ unless status_code == 200
227
+ error_model = JSON.load(response_content)
228
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
229
+ end
230
+
231
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
232
+ # Deserialize Response
233
+ if status_code == 200
234
+ begin
235
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
236
+ result_mapper = Azure::CDN::Mgmt::V2017_10_12::Models::Origin.mapper()
237
+ result.body = @client.deserialize(result_mapper, parsed_response)
238
+ rescue Exception => e
239
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
240
+ end
241
+ end
242
+
243
+ result
244
+ end
245
+
246
+ promise.execute
247
+ end
248
+
249
+ #
250
+ # Updates an existing origin within an endpoint.
251
+ #
252
+ # @param resource_group_name [String] Name of the Resource group within the
253
+ # Azure subscription.
254
+ # @param profile_name [String] Name of the CDN profile which is unique within
255
+ # the resource group.
256
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
257
+ # unique globally.
258
+ # @param origin_name [String] Name of the origin which is unique within the
259
+ # endpoint.
260
+ # @param origin_update_properties [OriginUpdateParameters] Origin properties
261
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
262
+ # will be added to the HTTP request.
263
+ #
264
+ # @return [Origin] operation results.
265
+ #
266
+ def update(resource_group_name, profile_name, endpoint_name, origin_name, origin_update_properties, custom_headers:nil)
267
+ response = update_async(resource_group_name, profile_name, endpoint_name, origin_name, origin_update_properties, custom_headers:custom_headers).value!
268
+ response.body unless response.nil?
269
+ end
270
+
271
+ #
272
+ # @param resource_group_name [String] Name of the Resource group within the
273
+ # Azure subscription.
274
+ # @param profile_name [String] Name of the CDN profile which is unique within
275
+ # the resource group.
276
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
277
+ # unique globally.
278
+ # @param origin_name [String] Name of the origin which is unique within the
279
+ # endpoint.
280
+ # @param origin_update_properties [OriginUpdateParameters] Origin properties
281
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
282
+ # will be added to the HTTP request.
283
+ #
284
+ # @return [Concurrent::Promise] promise which provides async access to http
285
+ # response.
286
+ #
287
+ def update_async(resource_group_name, profile_name, endpoint_name, origin_name, origin_update_properties, custom_headers:nil)
288
+ # Send request
289
+ promise = begin_update_async(resource_group_name, profile_name, endpoint_name, origin_name, origin_update_properties, custom_headers:custom_headers)
290
+
291
+ promise = promise.then do |response|
292
+ # Defining deserialization method.
293
+ deserialize_method = lambda do |parsed_response|
294
+ result_mapper = Azure::CDN::Mgmt::V2017_10_12::Models::Origin.mapper()
295
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
296
+ end
297
+
298
+ # Waiting for response.
299
+ @client.get_long_running_operation_result(response, deserialize_method)
300
+ end
301
+
302
+ promise
303
+ end
304
+
305
+ #
306
+ # Updates an existing origin within an endpoint.
307
+ #
308
+ # @param resource_group_name [String] Name of the Resource group within the
309
+ # Azure subscription.
310
+ # @param profile_name [String] Name of the CDN profile which is unique within
311
+ # the resource group.
312
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
313
+ # unique globally.
314
+ # @param origin_name [String] Name of the origin which is unique within the
315
+ # endpoint.
316
+ # @param origin_update_properties [OriginUpdateParameters] Origin properties
317
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
318
+ # will be added to the HTTP request.
319
+ #
320
+ # @return [Origin] operation results.
321
+ #
322
+ def begin_update(resource_group_name, profile_name, endpoint_name, origin_name, origin_update_properties, custom_headers:nil)
323
+ response = begin_update_async(resource_group_name, profile_name, endpoint_name, origin_name, origin_update_properties, custom_headers:custom_headers).value!
324
+ response.body unless response.nil?
325
+ end
326
+
327
+ #
328
+ # Updates an existing origin within an endpoint.
329
+ #
330
+ # @param resource_group_name [String] Name of the Resource group within the
331
+ # Azure subscription.
332
+ # @param profile_name [String] Name of the CDN profile which is unique within
333
+ # the resource group.
334
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
335
+ # unique globally.
336
+ # @param origin_name [String] Name of the origin which is unique within the
337
+ # endpoint.
338
+ # @param origin_update_properties [OriginUpdateParameters] Origin properties
339
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
340
+ # will be added to the HTTP request.
341
+ #
342
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
343
+ #
344
+ def begin_update_with_http_info(resource_group_name, profile_name, endpoint_name, origin_name, origin_update_properties, custom_headers:nil)
345
+ begin_update_async(resource_group_name, profile_name, endpoint_name, origin_name, origin_update_properties, custom_headers:custom_headers).value!
346
+ end
347
+
348
+ #
349
+ # Updates an existing origin within an endpoint.
350
+ #
351
+ # @param resource_group_name [String] Name of the Resource group within the
352
+ # Azure subscription.
353
+ # @param profile_name [String] Name of the CDN profile which is unique within
354
+ # the resource group.
355
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
356
+ # unique globally.
357
+ # @param origin_name [String] Name of the origin which is unique within the
358
+ # endpoint.
359
+ # @param origin_update_properties [OriginUpdateParameters] Origin properties
360
+ # @param [Hash{String => String}] A hash of custom headers that will be added
361
+ # to the HTTP request.
362
+ #
363
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
364
+ #
365
+ def begin_update_async(resource_group_name, profile_name, endpoint_name, origin_name, origin_update_properties, custom_headers:nil)
366
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
367
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
368
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
369
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
370
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
371
+ fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
372
+ fail ArgumentError, 'origin_name is nil' if origin_name.nil?
373
+ fail ArgumentError, 'origin_update_properties is nil' if origin_update_properties.nil?
374
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
375
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
376
+
377
+
378
+ request_headers = {}
379
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
380
+
381
+ # Set Headers
382
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
383
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
384
+
385
+ # Serialize Request
386
+ request_mapper = Azure::CDN::Mgmt::V2017_10_12::Models::OriginUpdateParameters.mapper()
387
+ request_content = @client.serialize(request_mapper, origin_update_properties)
388
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
389
+
390
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}'
391
+
392
+ request_url = @base_url || @client.base_url
393
+
394
+ options = {
395
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
396
+ path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'endpointName' => endpoint_name,'originName' => origin_name,'subscriptionId' => @client.subscription_id},
397
+ query_params: {'api-version' => @client.api_version},
398
+ body: request_content,
399
+ headers: request_headers.merge(custom_headers || {}),
400
+ base_url: request_url
401
+ }
402
+ promise = @client.make_request_async(:patch, path_template, options)
403
+
404
+ promise = promise.then do |result|
405
+ http_response = result.response
406
+ status_code = http_response.status
407
+ response_content = http_response.body
408
+ unless status_code == 200 || status_code == 202
409
+ error_model = JSON.load(response_content)
410
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
411
+ end
412
+
413
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
414
+ # Deserialize Response
415
+ if status_code == 200
416
+ begin
417
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
418
+ result_mapper = Azure::CDN::Mgmt::V2017_10_12::Models::Origin.mapper()
419
+ result.body = @client.deserialize(result_mapper, parsed_response)
420
+ rescue Exception => e
421
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
422
+ end
423
+ end
424
+ # Deserialize Response
425
+ if status_code == 202
426
+ begin
427
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
428
+ result_mapper = Azure::CDN::Mgmt::V2017_10_12::Models::Origin.mapper()
429
+ result.body = @client.deserialize(result_mapper, parsed_response)
430
+ rescue Exception => e
431
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
432
+ end
433
+ end
434
+
435
+ result
436
+ end
437
+
438
+ promise.execute
439
+ end
440
+
441
+ #
442
+ # Lists all of the existing origins within an endpoint.
443
+ #
444
+ # @param next_page_link [String] The NextLink from the previous successful call
445
+ # to List operation.
446
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
447
+ # will be added to the HTTP request.
448
+ #
449
+ # @return [OriginListResult] operation results.
450
+ #
451
+ def list_by_endpoint_next(next_page_link, custom_headers:nil)
452
+ response = list_by_endpoint_next_async(next_page_link, custom_headers:custom_headers).value!
453
+ response.body unless response.nil?
454
+ end
455
+
456
+ #
457
+ # Lists all of the existing origins within an endpoint.
458
+ #
459
+ # @param next_page_link [String] The NextLink from the previous successful call
460
+ # to List operation.
461
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
462
+ # will be added to the HTTP request.
463
+ #
464
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
465
+ #
466
+ def list_by_endpoint_next_with_http_info(next_page_link, custom_headers:nil)
467
+ list_by_endpoint_next_async(next_page_link, custom_headers:custom_headers).value!
468
+ end
469
+
470
+ #
471
+ # Lists all of the existing origins within an endpoint.
472
+ #
473
+ # @param next_page_link [String] The NextLink from the previous successful call
474
+ # to List operation.
475
+ # @param [Hash{String => String}] A hash of custom headers that will be added
476
+ # to the HTTP request.
477
+ #
478
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
479
+ #
480
+ def list_by_endpoint_next_async(next_page_link, custom_headers:nil)
481
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
482
+
483
+
484
+ request_headers = {}
485
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
486
+
487
+ # Set Headers
488
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
489
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
490
+ path_template = '{nextLink}'
491
+
492
+ request_url = @base_url || @client.base_url
493
+
494
+ options = {
495
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
496
+ skip_encoding_path_params: {'nextLink' => next_page_link},
497
+ headers: request_headers.merge(custom_headers || {}),
498
+ base_url: request_url
499
+ }
500
+ promise = @client.make_request_async(:get, path_template, options)
501
+
502
+ promise = promise.then do |result|
503
+ http_response = result.response
504
+ status_code = http_response.status
505
+ response_content = http_response.body
506
+ unless status_code == 200
507
+ error_model = JSON.load(response_content)
508
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
509
+ end
510
+
511
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
512
+ # Deserialize Response
513
+ if status_code == 200
514
+ begin
515
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
516
+ result_mapper = Azure::CDN::Mgmt::V2017_10_12::Models::OriginListResult.mapper()
517
+ result.body = @client.deserialize(result_mapper, parsed_response)
518
+ rescue Exception => e
519
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
520
+ end
521
+ end
522
+
523
+ result
524
+ end
525
+
526
+ promise.execute
527
+ end
528
+
529
+ #
530
+ # Lists all of the existing origins within an endpoint.
531
+ #
532
+ # @param resource_group_name [String] Name of the Resource group within the
533
+ # Azure subscription.
534
+ # @param profile_name [String] Name of the CDN profile which is unique within
535
+ # the resource group.
536
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
537
+ # unique globally.
538
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
539
+ # will be added to the HTTP request.
540
+ #
541
+ # @return [OriginListResult] which provide lazy access to pages of the
542
+ # response.
543
+ #
544
+ def list_by_endpoint_as_lazy(resource_group_name, profile_name, endpoint_name, custom_headers:nil)
545
+ response = list_by_endpoint_async(resource_group_name, profile_name, endpoint_name, custom_headers:custom_headers).value!
546
+ unless response.nil?
547
+ page = response.body
548
+ page.next_method = Proc.new do |next_page_link|
549
+ list_by_endpoint_next_async(next_page_link, custom_headers:custom_headers)
550
+ end
551
+ page
552
+ end
553
+ end
554
+
555
+ end
556
+ end