azure_mgmt_cdn 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rspec +3 -0
- data/LICENSE.txt +21 -0
- data/Rakefile +5 -0
- data/azure_mgmt_cdn.gemspec +34 -0
- data/lib/azure_mgmt_cdn.rb +77 -0
- data/lib/azure_mgmt_cdn/cdn_management_client.rb +87 -0
- data/lib/azure_mgmt_cdn/custom_domains.rb +482 -0
- data/lib/azure_mgmt_cdn/endpoints.rb +940 -0
- data/lib/azure_mgmt_cdn/models/check_name_availability_input.rb +66 -0
- data/lib/azure_mgmt_cdn/models/check_name_availability_output.rb +75 -0
- data/lib/azure_mgmt_cdn/models/custom_domain.rb +82 -0
- data/lib/azure_mgmt_cdn/models/custom_domain_list_result.rb +77 -0
- data/lib/azure_mgmt_cdn/models/custom_domain_parameters.rb +62 -0
- data/lib/azure_mgmt_cdn/models/custom_domain_properties.rb +84 -0
- data/lib/azure_mgmt_cdn/models/custom_domain_properties_parameters.rb +56 -0
- data/lib/azure_mgmt_cdn/models/custom_domain_resource_state.rb +17 -0
- data/lib/azure_mgmt_cdn/models/deep_created_origin.rb +72 -0
- data/lib/azure_mgmt_cdn/models/deep_created_origin_properties.rb +78 -0
- data/lib/azure_mgmt_cdn/models/endpoint.rb +95 -0
- data/lib/azure_mgmt_cdn/models/endpoint_create_parameters.rb +82 -0
- data/lib/azure_mgmt_cdn/models/endpoint_list_result.rb +76 -0
- data/lib/azure_mgmt_cdn/models/endpoint_properties.rb +197 -0
- data/lib/azure_mgmt_cdn/models/endpoint_properties_create_parameters.rb +160 -0
- data/lib/azure_mgmt_cdn/models/endpoint_properties_update_parameters.rb +127 -0
- data/lib/azure_mgmt_cdn/models/endpoint_resource_state.rb +20 -0
- data/lib/azure_mgmt_cdn/models/endpoint_update_parameters.rb +72 -0
- data/lib/azure_mgmt_cdn/models/error_response.rb +65 -0
- data/lib/azure_mgmt_cdn/models/load_parameters.rb +58 -0
- data/lib/azure_mgmt_cdn/models/operation.rb +71 -0
- data/lib/azure_mgmt_cdn/models/operation_display.rb +75 -0
- data/lib/azure_mgmt_cdn/models/operation_list_result.rb +77 -0
- data/lib/azure_mgmt_cdn/models/origin.rb +83 -0
- data/lib/azure_mgmt_cdn/models/origin_list_result.rb +76 -0
- data/lib/azure_mgmt_cdn/models/origin_parameters.rb +62 -0
- data/lib/azure_mgmt_cdn/models/origin_properties.rb +106 -0
- data/lib/azure_mgmt_cdn/models/origin_properties_parameters.rb +78 -0
- data/lib/azure_mgmt_cdn/models/origin_resource_state.rb +17 -0
- data/lib/azure_mgmt_cdn/models/profile.rb +95 -0
- data/lib/azure_mgmt_cdn/models/profile_create_parameters.rb +82 -0
- data/lib/azure_mgmt_cdn/models/profile_list_result.rb +76 -0
- data/lib/azure_mgmt_cdn/models/profile_properties.rb +90 -0
- data/lib/azure_mgmt_cdn/models/profile_properties_create_parameters.rb +63 -0
- data/lib/azure_mgmt_cdn/models/profile_resource_state.rb +18 -0
- data/lib/azure_mgmt_cdn/models/profile_update_parameters.rb +57 -0
- data/lib/azure_mgmt_cdn/models/provisioning_state.rb +17 -0
- data/lib/azure_mgmt_cdn/models/purge_parameters.rb +58 -0
- data/lib/azure_mgmt_cdn/models/query_string_caching_behavior.rb +18 -0
- data/lib/azure_mgmt_cdn/models/sku.rb +60 -0
- data/lib/azure_mgmt_cdn/models/sku_name.rb +16 -0
- data/lib/azure_mgmt_cdn/models/sso_uri.rb +56 -0
- data/lib/azure_mgmt_cdn/models/tracked_resource.rb +85 -0
- data/lib/azure_mgmt_cdn/models/validate_custom_domain_input.rb +56 -0
- data/lib/azure_mgmt_cdn/models/validate_custom_domain_output.rb +75 -0
- data/lib/azure_mgmt_cdn/module_definition.rb +8 -0
- data/lib/azure_mgmt_cdn/name_availability.rb +101 -0
- data/lib/azure_mgmt_cdn/operations.rb +87 -0
- data/lib/azure_mgmt_cdn/origins.rb +533 -0
- data/lib/azure_mgmt_cdn/profiles.rb +607 -0
- data/lib/azure_mgmt_cdn/version.rb +8 -0
- metadata +172 -0
@@ -0,0 +1,16 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 0.16.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
|
+
# Defines values for SkuName
|
10
|
+
#
|
11
|
+
module SkuName
|
12
|
+
Standard = "Standard"
|
13
|
+
Premium = "Premium"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 0.16.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
|
+
# Sso uri required to login to third party web portal
|
10
|
+
#
|
11
|
+
class SsoUri
|
12
|
+
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
# @return [String] The uri used to login to third party web portal
|
16
|
+
attr_accessor :sso_uri_value
|
17
|
+
|
18
|
+
#
|
19
|
+
# Validate the object. Throws ValidationError if validation fails.
|
20
|
+
#
|
21
|
+
def validate
|
22
|
+
# Nothing to validate
|
23
|
+
end
|
24
|
+
|
25
|
+
#
|
26
|
+
# Serializes given Model object into Ruby Hash.
|
27
|
+
# @param object Model object to serialize.
|
28
|
+
# @return [Hash] Serialized object in form of Ruby Hash.
|
29
|
+
#
|
30
|
+
def self.serialize_object(object)
|
31
|
+
object.validate
|
32
|
+
output_object = {}
|
33
|
+
|
34
|
+
serialized_property = object.sso_uri_value
|
35
|
+
output_object['ssoUriValue'] = serialized_property unless serialized_property.nil?
|
36
|
+
|
37
|
+
output_object
|
38
|
+
end
|
39
|
+
|
40
|
+
#
|
41
|
+
# Deserializes given Ruby Hash into Model object.
|
42
|
+
# @param object [Hash] Ruby Hash object to deserialize.
|
43
|
+
# @return [SsoUri] Deserialized object.
|
44
|
+
#
|
45
|
+
def self.deserialize_object(object)
|
46
|
+
return if object.nil?
|
47
|
+
output_object = SsoUri.new
|
48
|
+
|
49
|
+
deserialized_property = object['ssoUriValue']
|
50
|
+
output_object.sso_uri_value = deserialized_property
|
51
|
+
|
52
|
+
output_object
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 0.16.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
|
+
# ARM tracked resource
|
10
|
+
#
|
11
|
+
class TrackedResource < MsRestAzure::Resource
|
12
|
+
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
# @return [String] Resource location
|
16
|
+
attr_accessor :location
|
17
|
+
|
18
|
+
# @return [Hash{String => String}] Resource tags
|
19
|
+
attr_accessor :tags
|
20
|
+
|
21
|
+
#
|
22
|
+
# Validate the object. Throws ValidationError if validation fails.
|
23
|
+
#
|
24
|
+
def validate
|
25
|
+
fail MsRest::ValidationError, 'property location is nil' if @location.nil?
|
26
|
+
fail MsRest::ValidationError, 'property tags is nil' if @tags.nil?
|
27
|
+
@tags.each{ |e| e.validate if e.respond_to?(:validate) } unless @tags.nil?
|
28
|
+
end
|
29
|
+
|
30
|
+
#
|
31
|
+
# Serializes given Model object into Ruby Hash.
|
32
|
+
# @param object Model object to serialize.
|
33
|
+
# @return [Hash] Serialized object in form of Ruby Hash.
|
34
|
+
#
|
35
|
+
def self.serialize_object(object)
|
36
|
+
object.validate
|
37
|
+
output_object = {}
|
38
|
+
|
39
|
+
serialized_property = object.location
|
40
|
+
output_object['location'] = serialized_property unless serialized_property.nil?
|
41
|
+
|
42
|
+
serialized_property = object.tags
|
43
|
+
output_object['tags'] = serialized_property unless serialized_property.nil?
|
44
|
+
|
45
|
+
serialized_property = object.id
|
46
|
+
output_object['id'] = serialized_property unless serialized_property.nil?
|
47
|
+
|
48
|
+
serialized_property = object.name
|
49
|
+
output_object['name'] = serialized_property unless serialized_property.nil?
|
50
|
+
|
51
|
+
serialized_property = object.type
|
52
|
+
output_object['type'] = serialized_property unless serialized_property.nil?
|
53
|
+
|
54
|
+
output_object
|
55
|
+
end
|
56
|
+
|
57
|
+
#
|
58
|
+
# Deserializes given Ruby Hash into Model object.
|
59
|
+
# @param object [Hash] Ruby Hash object to deserialize.
|
60
|
+
# @return [TrackedResource] Deserialized object.
|
61
|
+
#
|
62
|
+
def self.deserialize_object(object)
|
63
|
+
return if object.nil?
|
64
|
+
output_object = TrackedResource.new
|
65
|
+
|
66
|
+
deserialized_property = object['location']
|
67
|
+
output_object.location = deserialized_property
|
68
|
+
|
69
|
+
deserialized_property = object['tags']
|
70
|
+
output_object.tags = deserialized_property
|
71
|
+
|
72
|
+
deserialized_property = object['id']
|
73
|
+
output_object.id = deserialized_property
|
74
|
+
|
75
|
+
deserialized_property = object['name']
|
76
|
+
output_object.name = deserialized_property
|
77
|
+
|
78
|
+
deserialized_property = object['type']
|
79
|
+
output_object.type = deserialized_property
|
80
|
+
|
81
|
+
output_object
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 0.16.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
|
+
# Input of the custom domain to be validated
|
10
|
+
#
|
11
|
+
class ValidateCustomDomainInput
|
12
|
+
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
# @return [String] The host name of the custom domain
|
16
|
+
attr_accessor :host_name
|
17
|
+
|
18
|
+
#
|
19
|
+
# Validate the object. Throws ValidationError if validation fails.
|
20
|
+
#
|
21
|
+
def validate
|
22
|
+
fail MsRest::ValidationError, 'property host_name is nil' if @host_name.nil?
|
23
|
+
end
|
24
|
+
|
25
|
+
#
|
26
|
+
# Serializes given Model object into Ruby Hash.
|
27
|
+
# @param object Model object to serialize.
|
28
|
+
# @return [Hash] Serialized object in form of Ruby Hash.
|
29
|
+
#
|
30
|
+
def self.serialize_object(object)
|
31
|
+
object.validate
|
32
|
+
output_object = {}
|
33
|
+
|
34
|
+
serialized_property = object.host_name
|
35
|
+
output_object['hostName'] = serialized_property unless serialized_property.nil?
|
36
|
+
|
37
|
+
output_object
|
38
|
+
end
|
39
|
+
|
40
|
+
#
|
41
|
+
# Deserializes given Ruby Hash into Model object.
|
42
|
+
# @param object [Hash] Ruby Hash object to deserialize.
|
43
|
+
# @return [ValidateCustomDomainInput] Deserialized object.
|
44
|
+
#
|
45
|
+
def self.deserialize_object(object)
|
46
|
+
return if object.nil?
|
47
|
+
output_object = ValidateCustomDomainInput.new
|
48
|
+
|
49
|
+
deserialized_property = object['hostName']
|
50
|
+
output_object.host_name = deserialized_property
|
51
|
+
|
52
|
+
output_object
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 0.16.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 custom domain validation
|
10
|
+
#
|
11
|
+
class ValidateCustomDomainOutput
|
12
|
+
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
# @return [Boolean] Indicates whether the custom domain is validated or
|
16
|
+
# not
|
17
|
+
attr_accessor :custom_domain_validated
|
18
|
+
|
19
|
+
# @return [String] The reason why the custom domain is not valid
|
20
|
+
attr_accessor :reason
|
21
|
+
|
22
|
+
# @return [String] The message on why the custom domain is not valid
|
23
|
+
attr_accessor :message
|
24
|
+
|
25
|
+
#
|
26
|
+
# Validate the object. Throws ValidationError if validation fails.
|
27
|
+
#
|
28
|
+
def validate
|
29
|
+
# Nothing to validate
|
30
|
+
end
|
31
|
+
|
32
|
+
#
|
33
|
+
# Serializes given Model object into Ruby Hash.
|
34
|
+
# @param object Model object to serialize.
|
35
|
+
# @return [Hash] Serialized object in form of Ruby Hash.
|
36
|
+
#
|
37
|
+
def self.serialize_object(object)
|
38
|
+
object.validate
|
39
|
+
output_object = {}
|
40
|
+
|
41
|
+
serialized_property = object.custom_domain_validated
|
42
|
+
output_object['customDomainValidated'] = serialized_property unless serialized_property.nil?
|
43
|
+
|
44
|
+
serialized_property = object.reason
|
45
|
+
output_object['reason'] = serialized_property unless serialized_property.nil?
|
46
|
+
|
47
|
+
serialized_property = object.message
|
48
|
+
output_object['message'] = serialized_property unless serialized_property.nil?
|
49
|
+
|
50
|
+
output_object
|
51
|
+
end
|
52
|
+
|
53
|
+
#
|
54
|
+
# Deserializes given Ruby Hash into Model object.
|
55
|
+
# @param object [Hash] Ruby Hash object to deserialize.
|
56
|
+
# @return [ValidateCustomDomainOutput] Deserialized object.
|
57
|
+
#
|
58
|
+
def self.deserialize_object(object)
|
59
|
+
return if object.nil?
|
60
|
+
output_object = ValidateCustomDomainOutput.new
|
61
|
+
|
62
|
+
deserialized_property = object['customDomainValidated']
|
63
|
+
output_object.custom_domain_validated = deserialized_property
|
64
|
+
|
65
|
+
deserialized_property = object['reason']
|
66
|
+
output_object.reason = deserialized_property
|
67
|
+
|
68
|
+
deserialized_property = object['message']
|
69
|
+
output_object.message = deserialized_property
|
70
|
+
|
71
|
+
output_object
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,101 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 0.16.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
|
+
#
|
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. For more information, see <a
|
11
|
+
# href="https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx">Authenticating
|
12
|
+
# Azure Resource Manager requests.</a>
|
13
|
+
#
|
14
|
+
class NameAvailability
|
15
|
+
include Azure::ARM::CDN::Models
|
16
|
+
include MsRestAzure
|
17
|
+
|
18
|
+
#
|
19
|
+
# Creates and initializes a new instance of the NameAvailability class.
|
20
|
+
# @param client service class for accessing basic functionality.
|
21
|
+
#
|
22
|
+
def initialize(client)
|
23
|
+
@client = client
|
24
|
+
end
|
25
|
+
|
26
|
+
# @return reference to the CdnManagementClient
|
27
|
+
attr_reader :client
|
28
|
+
|
29
|
+
#
|
30
|
+
# Check the availability of a resource name. This is needed for resources
|
31
|
+
# where name is globally unique (ex: endpoint). With this operation checks if
|
32
|
+
# the name is available or not without creating the resource.
|
33
|
+
#
|
34
|
+
# @param check_name_availability_input [CheckNameAvailabilityInput] input to
|
35
|
+
# check
|
36
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
37
|
+
# applied to HTTP request.
|
38
|
+
#
|
39
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
40
|
+
# response.
|
41
|
+
#
|
42
|
+
def check_name_availability(check_name_availability_input, custom_headers = nil)
|
43
|
+
fail ArgumentError, 'check_name_availability_input is nil' if check_name_availability_input.nil?
|
44
|
+
check_name_availability_input.validate unless check_name_availability_input.nil?
|
45
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
46
|
+
request_headers = {}
|
47
|
+
|
48
|
+
# Set Headers
|
49
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
50
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
51
|
+
|
52
|
+
# Serialize Request
|
53
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
54
|
+
unless check_name_availability_input.nil?
|
55
|
+
check_name_availability_input = CheckNameAvailabilityInput.serialize_object(check_name_availability_input)
|
56
|
+
end
|
57
|
+
request_content = JSON.generate(check_name_availability_input, quirks_mode: true)
|
58
|
+
path_template = '/providers/Microsoft.Cdn/checkNameAvailability'
|
59
|
+
options = {
|
60
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
61
|
+
query_params: {'api-version' => @client.api_version},
|
62
|
+
body: request_content,
|
63
|
+
headers: request_headers.merge(custom_headers || {})
|
64
|
+
}
|
65
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :post, options)
|
66
|
+
promise = request.run_promise do |req|
|
67
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
68
|
+
end
|
69
|
+
|
70
|
+
promise = promise.then do |http_response|
|
71
|
+
status_code = http_response.status
|
72
|
+
response_content = http_response.body
|
73
|
+
unless status_code == 200
|
74
|
+
error_model = JSON.load(response_content)
|
75
|
+
fail MsRest::HttpOperationError.new(request, http_response, error_model)
|
76
|
+
end
|
77
|
+
|
78
|
+
# Create Result
|
79
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
80
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
81
|
+
# Deserialize Response
|
82
|
+
if status_code == 200
|
83
|
+
begin
|
84
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
85
|
+
unless parsed_response.nil?
|
86
|
+
parsed_response = CheckNameAvailabilityOutput.deserialize_object(parsed_response)
|
87
|
+
end
|
88
|
+
result.body = parsed_response
|
89
|
+
rescue Exception => e
|
90
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
result
|
95
|
+
end
|
96
|
+
|
97
|
+
promise.execute
|
98
|
+
end
|
99
|
+
|
100
|
+
end
|
101
|
+
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 0.16.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
|
+
#
|
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. For more information, see <a
|
11
|
+
# href="https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx">Authenticating
|
12
|
+
# Azure Resource Manager requests.</a>
|
13
|
+
#
|
14
|
+
class Operations
|
15
|
+
include Azure::ARM::CDN::Models
|
16
|
+
include MsRestAzure
|
17
|
+
|
18
|
+
#
|
19
|
+
# Creates and initializes a new instance of the Operations class.
|
20
|
+
# @param client service class for accessing basic functionality.
|
21
|
+
#
|
22
|
+
def initialize(client)
|
23
|
+
@client = client
|
24
|
+
end
|
25
|
+
|
26
|
+
# @return reference to the CdnManagementClient
|
27
|
+
attr_reader :client
|
28
|
+
|
29
|
+
#
|
30
|
+
# Lists all of the available CDN REST API operations
|
31
|
+
#
|
32
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
33
|
+
# applied to HTTP request.
|
34
|
+
#
|
35
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
36
|
+
# response.
|
37
|
+
#
|
38
|
+
def list(custom_headers = nil)
|
39
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
40
|
+
request_headers = {}
|
41
|
+
|
42
|
+
# Set Headers
|
43
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
44
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
45
|
+
path_template = '/providers/Microsoft.Cdn/operations'
|
46
|
+
options = {
|
47
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
48
|
+
query_params: {'api-version' => @client.api_version},
|
49
|
+
headers: request_headers.merge(custom_headers || {})
|
50
|
+
}
|
51
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
52
|
+
promise = request.run_promise do |req|
|
53
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
54
|
+
end
|
55
|
+
|
56
|
+
promise = promise.then do |http_response|
|
57
|
+
status_code = http_response.status
|
58
|
+
response_content = http_response.body
|
59
|
+
unless status_code == 200
|
60
|
+
error_model = JSON.load(response_content)
|
61
|
+
fail MsRest::HttpOperationError.new(request, http_response, error_model)
|
62
|
+
end
|
63
|
+
|
64
|
+
# Create Result
|
65
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
66
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
67
|
+
# Deserialize Response
|
68
|
+
if status_code == 200
|
69
|
+
begin
|
70
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
71
|
+
unless parsed_response.nil?
|
72
|
+
parsed_response = OperationListResult.deserialize_object(parsed_response)
|
73
|
+
end
|
74
|
+
result.body = parsed_response
|
75
|
+
rescue Exception => e
|
76
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
result
|
81
|
+
end
|
82
|
+
|
83
|
+
promise.execute
|
84
|
+
end
|
85
|
+
|
86
|
+
end
|
87
|
+
end
|