azure_mgmt_cdn 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/azure_mgmt_cdn.rb +16 -20
  3. data/lib/generated/azure_mgmt_cdn/cdn_management_client.rb +362 -11
  4. data/lib/generated/azure_mgmt_cdn/custom_domains.rb +240 -234
  5. data/lib/generated/azure_mgmt_cdn/endpoints.rb +735 -572
  6. data/lib/generated/azure_mgmt_cdn/models/check_name_availability_input.rb +1 -1
  7. data/lib/generated/azure_mgmt_cdn/models/check_name_availability_output.rb +4 -4
  8. data/lib/generated/azure_mgmt_cdn/models/custom_domain.rb +42 -10
  9. data/lib/generated/azure_mgmt_cdn/models/custom_domain_list_result.rb +45 -2
  10. data/lib/generated/azure_mgmt_cdn/models/custom_domain_parameters.rb +3 -2
  11. data/lib/generated/azure_mgmt_cdn/models/custom_domain_resource_state.rb +1 -1
  12. data/lib/generated/azure_mgmt_cdn/models/deep_created_origin.rb +10 -2
  13. data/lib/generated/azure_mgmt_cdn/models/endpoint.rb +70 -42
  14. data/lib/generated/azure_mgmt_cdn/models/endpoint_list_result.rb +45 -2
  15. data/lib/generated/azure_mgmt_cdn/models/endpoint_resource_state.rb +1 -1
  16. data/lib/generated/azure_mgmt_cdn/models/endpoint_update_parameters.rb +44 -15
  17. data/lib/generated/azure_mgmt_cdn/models/error_response.rb +4 -3
  18. data/lib/generated/azure_mgmt_cdn/models/geo_filter.rb +75 -0
  19. data/lib/generated/azure_mgmt_cdn/models/geo_filter_actions.rb +16 -0
  20. data/lib/generated/azure_mgmt_cdn/models/load_parameters.rb +1 -1
  21. data/lib/generated/azure_mgmt_cdn/models/operation.rb +2 -2
  22. data/lib/generated/azure_mgmt_cdn/models/operation_display.rb +4 -4
  23. data/lib/generated/azure_mgmt_cdn/models/operation_list_result.rb +45 -2
  24. data/lib/generated/azure_mgmt_cdn/models/origin.rb +38 -11
  25. data/lib/generated/azure_mgmt_cdn/models/origin_list_result.rb +45 -2
  26. data/lib/generated/azure_mgmt_cdn/models/origin_resource_state.rb +1 -1
  27. data/lib/generated/azure_mgmt_cdn/models/{origin_parameters.rb → origin_update_parameters.rb} +14 -6
  28. data/lib/generated/azure_mgmt_cdn/models/profile.rb +13 -15
  29. data/lib/generated/azure_mgmt_cdn/models/profile_list_result.rb +45 -2
  30. data/lib/generated/azure_mgmt_cdn/models/profile_resource_state.rb +1 -1
  31. data/lib/generated/azure_mgmt_cdn/models/profile_update_parameters.rb +1 -1
  32. data/lib/generated/azure_mgmt_cdn/models/purge_parameters.rb +1 -1
  33. data/lib/generated/azure_mgmt_cdn/models/query_string_caching_behavior.rb +1 -1
  34. data/lib/generated/azure_mgmt_cdn/models/resource_type.rb +1 -1
  35. data/lib/generated/azure_mgmt_cdn/models/sku.rb +3 -4
  36. data/lib/generated/azure_mgmt_cdn/models/sku_name.rb +2 -1
  37. data/lib/generated/azure_mgmt_cdn/models/sso_uri.rb +1 -1
  38. data/lib/generated/azure_mgmt_cdn/models/validate_custom_domain_input.rb +1 -1
  39. data/lib/generated/azure_mgmt_cdn/models/validate_custom_domain_output.rb +1 -1
  40. data/lib/generated/azure_mgmt_cdn/module_definition.rb +1 -1
  41. data/lib/generated/azure_mgmt_cdn/origins.rb +154 -387
  42. data/lib/generated/azure_mgmt_cdn/profiles.rb +480 -257
  43. data/lib/generated/azure_mgmt_cdn/version.rb +2 -2
  44. metadata +7 -11
  45. data/lib/generated/azure_mgmt_cdn/models/endpoint_create_parameters.rb +0 -173
  46. data/lib/generated/azure_mgmt_cdn/models/profile_create_parameters.rb +0 -72
  47. data/lib/generated/azure_mgmt_cdn/models/provisioning_state.rb +0 -17
  48. data/lib/generated/azure_mgmt_cdn/models/tracked_resource.rb +0 -85
  49. data/lib/generated/azure_mgmt_cdn/name_availability.rb +0 -133
  50. data/lib/generated/azure_mgmt_cdn/operations.rb +0 -111
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -8,7 +8,7 @@ module Azure::ARM::CDN
8
8
  #
9
9
  # Origin properties needed for origin creation or update.
10
10
  #
11
- class OriginParameters
11
+ class OriginUpdateParameters
12
12
 
13
13
  include MsRestAzure
14
14
 
@@ -26,19 +26,19 @@ module Azure::ARM::CDN
26
26
 
27
27
 
28
28
  #
29
- # Mapper for OriginParameters class as Ruby Hash.
29
+ # Mapper for OriginUpdateParameters class as Ruby Hash.
30
30
  # This will be used for serialization/deserialization.
31
31
  #
32
32
  def self.mapper()
33
33
  {
34
34
  required: false,
35
- serialized_name: 'OriginParameters',
35
+ serialized_name: 'OriginUpdateParameters',
36
36
  type: {
37
37
  name: 'Composite',
38
- class_name: 'OriginParameters',
38
+ class_name: 'OriginUpdateParameters',
39
39
  model_properties: {
40
40
  host_name: {
41
- required: true,
41
+ required: false,
42
42
  serialized_name: 'properties.hostName',
43
43
  type: {
44
44
  name: 'String'
@@ -47,6 +47,10 @@ module Azure::ARM::CDN
47
47
  http_port: {
48
48
  required: false,
49
49
  serialized_name: 'properties.httpPort',
50
+ constraints: {
51
+ InclusiveMaximum: 65535,
52
+ InclusiveMinimum: 1
53
+ },
50
54
  type: {
51
55
  name: 'Number'
52
56
  }
@@ -54,6 +58,10 @@ module Azure::ARM::CDN
54
58
  https_port: {
55
59
  required: false,
56
60
  serialized_name: 'properties.httpsPort',
61
+ constraints: {
62
+ InclusiveMaximum: 65535,
63
+ InclusiveMinimum: 1
64
+ },
57
65
  type: {
58
66
  name: 'Number'
59
67
  }
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -7,23 +7,22 @@ module Azure::ARM::CDN
7
7
  module Models
8
8
  #
9
9
  # CDN profile represents the top level resource and the entry point into
10
- # the CDN API. This allows users to set up a logical grouping of
11
- # endpoints in addition to creating shared configuration settings and
12
- # selecting pricing tiers and providers.
10
+ # the CDN API. This allows users to set up a logical grouping of endpoints
11
+ # in addition to creating shared configuration settings and selecting
12
+ # pricing tiers and providers.
13
13
  #
14
- class Profile < TrackedResource
14
+ class Profile < MsRestAzure::Resource
15
15
 
16
16
  include MsRestAzure
17
17
 
18
18
  # @return [Sku] The SKU (pricing tier) of the CDN profile.
19
19
  attr_accessor :sku
20
20
 
21
- # @return [ProfileResourceState] Resource status of the profile.
22
- # Possible values include: 'Creating', 'Active', 'Deleting', 'Disabled'
21
+ # @return [ProfileResourceState] Resource status of the profile. Possible
22
+ # values include: 'Creating', 'Active', 'Deleting', 'Disabled'
23
23
  attr_accessor :resource_state
24
24
 
25
- # @return [ProvisioningState] Provisioning status of the profile.
26
- # Possible values include: 'Creating', 'Succeeded', 'Failed'
25
+ # @return [String] Provisioning status of the profile.
27
26
  attr_accessor :provisioning_state
28
27
 
29
28
 
@@ -71,7 +70,7 @@ module Azure::ARM::CDN
71
70
  }
72
71
  },
73
72
  tags: {
74
- required: true,
73
+ required: false,
75
74
  serialized_name: 'tags',
76
75
  type: {
77
76
  name: 'Dictionary',
@@ -85,7 +84,7 @@ module Azure::ARM::CDN
85
84
  }
86
85
  },
87
86
  sku: {
88
- required: false,
87
+ required: true,
89
88
  serialized_name: 'sku',
90
89
  type: {
91
90
  name: 'Composite',
@@ -97,16 +96,15 @@ module Azure::ARM::CDN
97
96
  read_only: true,
98
97
  serialized_name: 'properties.resourceState',
99
98
  type: {
100
- name: 'Enum',
101
- module: 'ProfileResourceState'
99
+ name: 'String'
102
100
  }
103
101
  },
104
102
  provisioning_state: {
105
103
  required: false,
104
+ read_only: true,
106
105
  serialized_name: 'properties.provisioningState',
107
106
  type: {
108
- name: 'Enum',
109
- module: 'ProvisioningState'
107
+ name: 'String'
110
108
  }
111
109
  }
112
110
  }
@@ -1,12 +1,13 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
6
6
  module Azure::ARM::CDN
7
7
  module Models
8
8
  #
9
- # Model object.
9
+ # Result of the request to list profiles. It contains a list of profile
10
+ # objects and a URL link to get the the next set of results.
10
11
  #
11
12
  class ProfileListResult
12
13
 
@@ -15,6 +16,41 @@ module Azure::ARM::CDN
15
16
  # @return [Array<Profile>] List of CDN profiles within a resource group.
16
17
  attr_accessor :value
17
18
 
19
+ # @return [String] URL to get the next set of profile objects if there
20
+ # are any.
21
+ attr_accessor :next_link
22
+
23
+ # return [Proc] with next page method call.
24
+ attr_accessor :next_method
25
+
26
+ #
27
+ # Gets the rest of the items for the request, enabling auto-pagination.
28
+ #
29
+ # @return [Array<Profile>] operation results.
30
+ #
31
+ def get_all_items
32
+ items = @value
33
+ page = self
34
+ while page.next_link != nil do
35
+ page = page.get_next_page
36
+ items.concat(page.value)
37
+ end
38
+ items
39
+ end
40
+
41
+ #
42
+ # Gets the next page of results.
43
+ #
44
+ # @return [ProfileListResult] with next page content.
45
+ #
46
+ def get_next_page
47
+ response = @next_method.call(@next_link).value! unless @next_method.nil?
48
+ unless response.nil?
49
+ @next_link = response.body.next_link
50
+ @value = response.body.value
51
+ self
52
+ end
53
+ end
18
54
 
19
55
  #
20
56
  # Mapper for ProfileListResult class as Ruby Hash.
@@ -42,6 +78,13 @@ module Azure::ARM::CDN
42
78
  }
43
79
  }
44
80
  }
81
+ },
82
+ next_link: {
83
+ required: false,
84
+ serialized_name: 'nextLink',
85
+ type: {
86
+ name: 'String'
87
+ }
45
88
  }
46
89
  }
47
90
  }
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -14,7 +14,7 @@ module Azure::ARM::CDN
14
14
 
15
15
  # @return [SkuName] Name of the pricing tier. Possible values include:
16
16
  # 'Standard_Verizon', 'Premium_Verizon', 'Custom_Verizon',
17
- # 'Standard_Akamai'
17
+ # 'Standard_Akamai', 'Standard_ChinaCdn'
18
18
  attr_accessor :name
19
19
 
20
20
 
@@ -34,8 +34,7 @@ module Azure::ARM::CDN
34
34
  required: false,
35
35
  serialized_name: 'name',
36
36
  type: {
37
- name: 'Enum',
38
- module: 'SkuName'
37
+ name: 'String'
39
38
  }
40
39
  }
41
40
  }
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -13,6 +13,7 @@ module Azure::ARM::CDN
13
13
  PremiumVerizon = "Premium_Verizon"
14
14
  CustomVerizon = "Custom_Verizon"
15
15
  StandardAkamai = "Standard_Akamai"
16
+ StandardChinaCdn = "Standard_ChinaCdn"
16
17
  end
17
18
  end
18
19
  end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -7,9 +7,7 @@ module Azure::ARM::CDN
7
7
  #
8
8
  # Use these APIs to manage Azure CDN resources through the Azure Resource
9
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>
10
+ # secure.
13
11
  #
14
12
  class Origins
15
13
  include Azure::ARM::CDN::Models
@@ -29,55 +27,58 @@ module Azure::ARM::CDN
29
27
  #
30
28
  # Lists the existing CDN origins within an endpoint.
31
29
  #
32
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
33
- # @param profile_name [String] Name of the CDN profile within the resource
34
- # group.
35
- # @param resource_group_name [String] Name of the resource group within the
30
+ # @param resource_group_name [String] Name of the Resource group within the
36
31
  # Azure subscription.
32
+ # @param profile_name [String] Name of the CDN profile which is unique within
33
+ # the resource group.
34
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
35
+ # unique globally.
37
36
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
38
37
  # will be added to the HTTP request.
39
38
  #
40
- # @return [OriginListResult] operation results.
39
+ # @return [Array<Origin>] operation results.
41
40
  #
42
- def list_by_endpoint(endpoint_name, profile_name, resource_group_name, custom_headers = nil)
43
- response = list_by_endpoint_async(endpoint_name, profile_name, resource_group_name, custom_headers).value!
44
- response.body unless response.nil?
41
+ def list_by_endpoint(resource_group_name, profile_name, endpoint_name, custom_headers = nil)
42
+ first_page = list_by_endpoint_as_lazy(resource_group_name, profile_name, endpoint_name, custom_headers)
43
+ first_page.get_all_items
45
44
  end
46
45
 
47
46
  #
48
47
  # Lists the existing CDN origins within an endpoint.
49
48
  #
50
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
51
- # @param profile_name [String] Name of the CDN profile within the resource
52
- # group.
53
- # @param resource_group_name [String] Name of the resource group within the
49
+ # @param resource_group_name [String] Name of the Resource group within the
54
50
  # Azure subscription.
51
+ # @param profile_name [String] Name of the CDN profile which is unique within
52
+ # the resource group.
53
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
54
+ # unique globally.
55
55
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
56
56
  # will be added to the HTTP request.
57
57
  #
58
58
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
59
59
  #
60
- def list_by_endpoint_with_http_info(endpoint_name, profile_name, resource_group_name, custom_headers = nil)
61
- list_by_endpoint_async(endpoint_name, profile_name, resource_group_name, custom_headers).value!
60
+ def list_by_endpoint_with_http_info(resource_group_name, profile_name, endpoint_name, custom_headers = nil)
61
+ list_by_endpoint_async(resource_group_name, profile_name, endpoint_name, custom_headers).value!
62
62
  end
63
63
 
64
64
  #
65
65
  # Lists the existing CDN origins within an endpoint.
66
66
  #
67
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
68
- # @param profile_name [String] Name of the CDN profile within the resource
69
- # group.
70
- # @param resource_group_name [String] Name of the resource group within the
67
+ # @param resource_group_name [String] Name of the Resource group within the
71
68
  # Azure subscription.
69
+ # @param profile_name [String] Name of the CDN profile which is unique within
70
+ # the resource group.
71
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
72
+ # unique globally.
72
73
  # @param [Hash{String => String}] A hash of custom headers that will be added
73
74
  # to the HTTP request.
74
75
  #
75
76
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
76
77
  #
77
- def list_by_endpoint_async(endpoint_name, profile_name, resource_group_name, custom_headers = nil)
78
- fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
79
- fail ArgumentError, 'profile_name is nil' if profile_name.nil?
78
+ def list_by_endpoint_async(resource_group_name, profile_name, endpoint_name, custom_headers = nil)
80
79
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
80
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
81
+ fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
81
82
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
82
83
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
83
84
 
@@ -93,7 +94,7 @@ module Azure::ARM::CDN
93
94
 
94
95
  options = {
95
96
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
96
- path_params: {'endpointName' => endpoint_name,'profileName' => profile_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
97
+ path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'endpointName' => endpoint_name,'subscriptionId' => @client.subscription_id},
97
98
  query_params: {'api-version' => @client.api_version},
98
99
  headers: request_headers.merge(custom_headers || {}),
99
100
  base_url: request_url
@@ -130,62 +131,65 @@ module Azure::ARM::CDN
130
131
  #
131
132
  # Gets an existing CDN origin within an endpoint.
132
133
  #
133
- # @param origin_name [String] Name of the origin, an arbitrary value but it
134
- # needs to be unique under endpoint
135
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
136
- # @param profile_name [String] Name of the CDN profile within the resource
137
- # group.
138
- # @param resource_group_name [String] Name of the resource group within the
134
+ # @param resource_group_name [String] Name of the Resource group within the
139
135
  # Azure subscription.
136
+ # @param profile_name [String] Name of the CDN profile which is unique within
137
+ # the resource group.
138
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
139
+ # unique globally.
140
+ # @param origin_name [String] Name of the origin which is unique within the
141
+ # endpoint.
140
142
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
141
143
  # will be added to the HTTP request.
142
144
  #
143
145
  # @return [Origin] operation results.
144
146
  #
145
- def get(origin_name, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
146
- response = get_async(origin_name, endpoint_name, profile_name, resource_group_name, custom_headers).value!
147
+ def get(resource_group_name, profile_name, endpoint_name, origin_name, custom_headers = nil)
148
+ response = get_async(resource_group_name, profile_name, endpoint_name, origin_name, custom_headers).value!
147
149
  response.body unless response.nil?
148
150
  end
149
151
 
150
152
  #
151
153
  # Gets an existing CDN origin within an endpoint.
152
154
  #
153
- # @param origin_name [String] Name of the origin, an arbitrary value but it
154
- # needs to be unique under endpoint
155
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
156
- # @param profile_name [String] Name of the CDN profile within the resource
157
- # group.
158
- # @param resource_group_name [String] Name of the resource group within the
155
+ # @param resource_group_name [String] Name of the Resource group within the
159
156
  # Azure subscription.
157
+ # @param profile_name [String] Name of the CDN profile which is unique within
158
+ # the resource group.
159
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
160
+ # unique globally.
161
+ # @param origin_name [String] Name of the origin which is unique within the
162
+ # endpoint.
160
163
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
161
164
  # will be added to the HTTP request.
162
165
  #
163
166
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
164
167
  #
165
- def get_with_http_info(origin_name, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
166
- get_async(origin_name, endpoint_name, profile_name, resource_group_name, custom_headers).value!
168
+ def get_with_http_info(resource_group_name, profile_name, endpoint_name, origin_name, custom_headers = nil)
169
+ get_async(resource_group_name, profile_name, endpoint_name, origin_name, custom_headers).value!
167
170
  end
168
171
 
169
172
  #
170
173
  # Gets an existing CDN origin within an endpoint.
171
174
  #
172
- # @param origin_name [String] Name of the origin, an arbitrary value but it
173
- # needs to be unique under endpoint
174
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
175
- # @param profile_name [String] Name of the CDN profile within the resource
176
- # group.
177
- # @param resource_group_name [String] Name of the resource group within the
175
+ # @param resource_group_name [String] Name of the Resource group within the
178
176
  # Azure subscription.
177
+ # @param profile_name [String] Name of the CDN profile which is unique within
178
+ # the resource group.
179
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
180
+ # unique globally.
181
+ # @param origin_name [String] Name of the origin which is unique within the
182
+ # endpoint.
179
183
  # @param [Hash{String => String}] A hash of custom headers that will be added
180
184
  # to the HTTP request.
181
185
  #
182
186
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
183
187
  #
184
- def get_async(origin_name, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
185
- fail ArgumentError, 'origin_name is nil' if origin_name.nil?
186
- fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
187
- fail ArgumentError, 'profile_name is nil' if profile_name.nil?
188
+ def get_async(resource_group_name, profile_name, endpoint_name, origin_name, custom_headers = nil)
188
189
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
190
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
191
+ fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
192
+ fail ArgumentError, 'origin_name is nil' if origin_name.nil?
189
193
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
190
194
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
191
195
 
@@ -201,7 +205,7 @@ module Azure::ARM::CDN
201
205
 
202
206
  options = {
203
207
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
204
- path_params: {'originName' => origin_name,'endpointName' => endpoint_name,'profileName' => profile_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
208
+ path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'endpointName' => endpoint_name,'originName' => origin_name,'subscriptionId' => @client.subscription_id},
205
209
  query_params: {'api-version' => @client.api_version},
206
210
  headers: request_headers.merge(custom_headers || {}),
207
211
  base_url: request_url
@@ -236,44 +240,46 @@ module Azure::ARM::CDN
236
240
  end
237
241
 
238
242
  #
239
- # Creates a new CDN origin within an endpoint.
243
+ # Updates an existing CDN origin within an endpoint.
240
244
  #
241
- # @param origin_name [String] Name of the origin, an arbitrary value but it
242
- # needs to be unique under endpoint
243
- # @param origin_properties [OriginParameters] Origin properties
244
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
245
- # @param profile_name [String] Name of the CDN profile within the resource
246
- # group.
247
- # @param resource_group_name [String] Name of the resource group within the
245
+ # @param resource_group_name [String] Name of the Resource group within the
248
246
  # Azure subscription.
247
+ # @param profile_name [String] Name of the CDN profile which is unique within
248
+ # the resource group.
249
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
250
+ # unique globally.
251
+ # @param origin_name [String] Name of the origin which is unique within the
252
+ # endpoint.
253
+ # @param origin_update_properties [OriginUpdateParameters] Origin properties
249
254
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
250
255
  # will be added to the HTTP request.
251
256
  #
252
257
  # @return [Origin] operation results.
253
258
  #
254
- def create(origin_name, origin_properties, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
255
- response = create_async(origin_name, origin_properties, endpoint_name, profile_name, resource_group_name, custom_headers).value!
259
+ def update(resource_group_name, profile_name, endpoint_name, origin_name, origin_update_properties, custom_headers = nil)
260
+ response = update_async(resource_group_name, profile_name, endpoint_name, origin_name, origin_update_properties, custom_headers).value!
256
261
  response.body unless response.nil?
257
262
  end
258
263
 
259
264
  #
260
- # @param origin_name [String] Name of the origin, an arbitrary value but it
261
- # needs to be unique under endpoint
262
- # @param origin_properties [OriginParameters] Origin properties
263
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
264
- # @param profile_name [String] Name of the CDN profile within the resource
265
- # group.
266
- # @param resource_group_name [String] Name of the resource group within the
265
+ # @param resource_group_name [String] Name of the Resource group within the
267
266
  # Azure subscription.
267
+ # @param profile_name [String] Name of the CDN profile which is unique within
268
+ # the resource group.
269
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
270
+ # unique globally.
271
+ # @param origin_name [String] Name of the origin which is unique within the
272
+ # endpoint.
273
+ # @param origin_update_properties [OriginUpdateParameters] Origin properties
268
274
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
269
275
  # will be added to the HTTP request.
270
276
  #
271
277
  # @return [Concurrent::Promise] promise which provides async access to http
272
278
  # response.
273
279
  #
274
- def create_async(origin_name, origin_properties, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
280
+ def update_async(resource_group_name, profile_name, endpoint_name, origin_name, origin_update_properties, custom_headers = nil)
275
281
  # Send request
276
- promise = begin_create_async(origin_name, origin_properties, endpoint_name, profile_name, resource_group_name, custom_headers)
282
+ promise = begin_update_async(resource_group_name, profile_name, endpoint_name, origin_name, origin_update_properties, custom_headers)
277
283
 
278
284
  promise = promise.then do |response|
279
285
  # Defining deserialization method.
@@ -290,68 +296,71 @@ module Azure::ARM::CDN
290
296
  end
291
297
 
292
298
  #
293
- # Creates a new CDN origin within an endpoint.
299
+ # Updates an existing CDN origin within an endpoint.
294
300
  #
295
- # @param origin_name [String] Name of the origin, an arbitrary value but it
296
- # needs to be unique under endpoint
297
- # @param origin_properties [OriginParameters] Origin properties
298
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
299
- # @param profile_name [String] Name of the CDN profile within the resource
300
- # group.
301
- # @param resource_group_name [String] Name of the resource group within the
301
+ # @param resource_group_name [String] Name of the Resource group within the
302
302
  # Azure subscription.
303
+ # @param profile_name [String] Name of the CDN profile which is unique within
304
+ # the resource group.
305
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
306
+ # unique globally.
307
+ # @param origin_name [String] Name of the origin which is unique within the
308
+ # endpoint.
309
+ # @param origin_update_properties [OriginUpdateParameters] Origin properties
303
310
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
304
311
  # will be added to the HTTP request.
305
312
  #
306
313
  # @return [Origin] operation results.
307
314
  #
308
- def begin_create(origin_name, origin_properties, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
309
- response = begin_create_async(origin_name, origin_properties, endpoint_name, profile_name, resource_group_name, custom_headers).value!
315
+ def begin_update(resource_group_name, profile_name, endpoint_name, origin_name, origin_update_properties, custom_headers = nil)
316
+ response = begin_update_async(resource_group_name, profile_name, endpoint_name, origin_name, origin_update_properties, custom_headers).value!
310
317
  response.body unless response.nil?
311
318
  end
312
319
 
313
320
  #
314
- # Creates a new CDN origin within an endpoint.
321
+ # Updates an existing CDN origin within an endpoint.
315
322
  #
316
- # @param origin_name [String] Name of the origin, an arbitrary value but it
317
- # needs to be unique under endpoint
318
- # @param origin_properties [OriginParameters] Origin properties
319
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
320
- # @param profile_name [String] Name of the CDN profile within the resource
321
- # group.
322
- # @param resource_group_name [String] Name of the resource group within the
323
+ # @param resource_group_name [String] Name of the Resource group within the
323
324
  # Azure subscription.
325
+ # @param profile_name [String] Name of the CDN profile which is unique within
326
+ # the resource group.
327
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
328
+ # unique globally.
329
+ # @param origin_name [String] Name of the origin which is unique within the
330
+ # endpoint.
331
+ # @param origin_update_properties [OriginUpdateParameters] Origin properties
324
332
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
325
333
  # will be added to the HTTP request.
326
334
  #
327
335
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
328
336
  #
329
- def begin_create_with_http_info(origin_name, origin_properties, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
330
- begin_create_async(origin_name, origin_properties, endpoint_name, profile_name, resource_group_name, custom_headers).value!
337
+ def begin_update_with_http_info(resource_group_name, profile_name, endpoint_name, origin_name, origin_update_properties, custom_headers = nil)
338
+ begin_update_async(resource_group_name, profile_name, endpoint_name, origin_name, origin_update_properties, custom_headers).value!
331
339
  end
332
340
 
333
341
  #
334
- # Creates a new CDN origin within an endpoint.
342
+ # Updates an existing CDN origin within an endpoint.
335
343
  #
336
- # @param origin_name [String] Name of the origin, an arbitrary value but it
337
- # needs to be unique under endpoint
338
- # @param origin_properties [OriginParameters] Origin properties
339
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
340
- # @param profile_name [String] Name of the CDN profile within the resource
341
- # group.
342
- # @param resource_group_name [String] Name of the resource group within the
344
+ # @param resource_group_name [String] Name of the Resource group within the
343
345
  # Azure subscription.
346
+ # @param profile_name [String] Name of the CDN profile which is unique within
347
+ # the resource group.
348
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
349
+ # unique globally.
350
+ # @param origin_name [String] Name of the origin which is unique within the
351
+ # endpoint.
352
+ # @param origin_update_properties [OriginUpdateParameters] Origin properties
344
353
  # @param [Hash{String => String}] A hash of custom headers that will be added
345
354
  # to the HTTP request.
346
355
  #
347
356
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
348
357
  #
349
- def begin_create_async(origin_name, origin_properties, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
350
- fail ArgumentError, 'origin_name is nil' if origin_name.nil?
351
- fail ArgumentError, 'origin_properties is nil' if origin_properties.nil?
352
- fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
353
- fail ArgumentError, 'profile_name is nil' if profile_name.nil?
358
+ def begin_update_async(resource_group_name, profile_name, endpoint_name, origin_name, origin_update_properties, custom_headers = nil)
354
359
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
360
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
361
+ fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
362
+ fail ArgumentError, 'origin_name is nil' if origin_name.nil?
363
+ fail ArgumentError, 'origin_update_properties is nil' if origin_update_properties.nil?
355
364
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
356
365
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
357
366
 
@@ -365,8 +374,8 @@ module Azure::ARM::CDN
365
374
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
366
375
 
367
376
  # Serialize Request
368
- request_mapper = OriginParameters.mapper()
369
- request_content = @client.serialize(request_mapper, origin_properties, 'origin_properties')
377
+ request_mapper = OriginUpdateParameters.mapper()
378
+ request_content = @client.serialize(request_mapper, origin_update_properties, 'origin_update_properties')
370
379
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
371
380
 
372
381
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}'
@@ -375,19 +384,19 @@ module Azure::ARM::CDN
375
384
 
376
385
  options = {
377
386
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
378
- path_params: {'originName' => origin_name,'endpointName' => endpoint_name,'profileName' => profile_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
387
+ path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'endpointName' => endpoint_name,'originName' => origin_name,'subscriptionId' => @client.subscription_id},
379
388
  query_params: {'api-version' => @client.api_version},
380
389
  body: request_content,
381
390
  headers: request_headers.merge(custom_headers || {}),
382
391
  base_url: request_url
383
392
  }
384
- promise = @client.make_request_async(:put, path_template, options)
393
+ promise = @client.make_request_async(:patch, path_template, options)
385
394
 
386
395
  promise = promise.then do |result|
387
396
  http_response = result.response
388
397
  status_code = http_response.status
389
398
  response_content = http_response.body
390
- unless status_code == 200 || status_code == 201 || status_code == 202
399
+ unless status_code == 200 || status_code == 202
391
400
  error_model = JSON.load(response_content)
392
401
  fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
393
402
  end
@@ -404,16 +413,6 @@ module Azure::ARM::CDN
404
413
  end
405
414
  end
406
415
  # Deserialize Response
407
- if status_code == 201
408
- begin
409
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
410
- result_mapper = Origin.mapper()
411
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
412
- rescue Exception => e
413
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
414
- end
415
- end
416
- # Deserialize Response
417
416
  if status_code == 202
418
417
  begin
419
418
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
@@ -431,124 +430,46 @@ module Azure::ARM::CDN
431
430
  end
432
431
 
433
432
  #
434
- # Updates an existing CDN origin within an endpoint.
435
- #
436
- # @param origin_name [String] Name of the origin. Must be unique within
437
- # endpoint.
438
- # @param origin_properties [OriginParameters] Origin properties
439
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
440
- # @param profile_name [String] Name of the CDN profile within the resource
441
- # group.
442
- # @param resource_group_name [String] Name of the resource group within the
443
- # Azure subscription.
444
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
445
- # will be added to the HTTP request.
446
- #
447
- # @return [Origin] operation results.
448
- #
449
- def update(origin_name, origin_properties, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
450
- response = update_async(origin_name, origin_properties, endpoint_name, profile_name, resource_group_name, custom_headers).value!
451
- response.body unless response.nil?
452
- end
453
-
454
- #
455
- # @param origin_name [String] Name of the origin. Must be unique within
456
- # endpoint.
457
- # @param origin_properties [OriginParameters] Origin properties
458
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
459
- # @param profile_name [String] Name of the CDN profile within the resource
460
- # group.
461
- # @param resource_group_name [String] Name of the resource group within the
462
- # Azure subscription.
463
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
464
- # will be added to the HTTP request.
465
- #
466
- # @return [Concurrent::Promise] promise which provides async access to http
467
- # response.
468
- #
469
- def update_async(origin_name, origin_properties, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
470
- # Send request
471
- promise = begin_update_async(origin_name, origin_properties, endpoint_name, profile_name, resource_group_name, custom_headers)
472
-
473
- promise = promise.then do |response|
474
- # Defining deserialization method.
475
- deserialize_method = lambda do |parsed_response|
476
- result_mapper = Origin.mapper()
477
- parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
478
- end
479
-
480
- # Waiting for response.
481
- @client.get_long_running_operation_result(response, deserialize_method)
482
- end
483
-
484
- promise
485
- end
486
-
487
- #
488
- # Updates an existing CDN origin within an endpoint.
433
+ # Lists the existing CDN origins within an endpoint.
489
434
  #
490
- # @param origin_name [String] Name of the origin. Must be unique within
491
- # endpoint.
492
- # @param origin_properties [OriginParameters] Origin properties
493
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
494
- # @param profile_name [String] Name of the CDN profile within the resource
495
- # group.
496
- # @param resource_group_name [String] Name of the resource group within the
497
- # Azure subscription.
435
+ # @param next_page_link [String] The NextLink from the previous successful call
436
+ # to List operation.
498
437
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
499
438
  # will be added to the HTTP request.
500
439
  #
501
- # @return [Origin] operation results.
440
+ # @return [OriginListResult] operation results.
502
441
  #
503
- def begin_update(origin_name, origin_properties, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
504
- response = begin_update_async(origin_name, origin_properties, endpoint_name, profile_name, resource_group_name, custom_headers).value!
442
+ def list_by_endpoint_next(next_page_link, custom_headers = nil)
443
+ response = list_by_endpoint_next_async(next_page_link, custom_headers).value!
505
444
  response.body unless response.nil?
506
445
  end
507
446
 
508
447
  #
509
- # Updates an existing CDN origin within an endpoint.
448
+ # Lists the existing CDN origins within an endpoint.
510
449
  #
511
- # @param origin_name [String] Name of the origin. Must be unique within
512
- # endpoint.
513
- # @param origin_properties [OriginParameters] Origin properties
514
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
515
- # @param profile_name [String] Name of the CDN profile within the resource
516
- # group.
517
- # @param resource_group_name [String] Name of the resource group within the
518
- # Azure subscription.
450
+ # @param next_page_link [String] The NextLink from the previous successful call
451
+ # to List operation.
519
452
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
520
453
  # will be added to the HTTP request.
521
454
  #
522
455
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
523
456
  #
524
- def begin_update_with_http_info(origin_name, origin_properties, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
525
- begin_update_async(origin_name, origin_properties, endpoint_name, profile_name, resource_group_name, custom_headers).value!
457
+ def list_by_endpoint_next_with_http_info(next_page_link, custom_headers = nil)
458
+ list_by_endpoint_next_async(next_page_link, custom_headers).value!
526
459
  end
527
460
 
528
461
  #
529
- # Updates an existing CDN origin within an endpoint.
462
+ # Lists the existing CDN origins within an endpoint.
530
463
  #
531
- # @param origin_name [String] Name of the origin. Must be unique within
532
- # endpoint.
533
- # @param origin_properties [OriginParameters] Origin properties
534
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
535
- # @param profile_name [String] Name of the CDN profile within the resource
536
- # group.
537
- # @param resource_group_name [String] Name of the resource group within the
538
- # Azure subscription.
464
+ # @param next_page_link [String] The NextLink from the previous successful call
465
+ # to List operation.
539
466
  # @param [Hash{String => String}] A hash of custom headers that will be added
540
467
  # to the HTTP request.
541
468
  #
542
469
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
543
470
  #
544
- def begin_update_async(origin_name, origin_properties, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
545
- fail ArgumentError, 'origin_name is nil' if origin_name.nil?
546
- fail ArgumentError, 'origin_properties is nil' if origin_properties.nil?
547
- fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
548
- fail ArgumentError, 'profile_name is nil' if profile_name.nil?
549
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
550
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
551
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
471
+ def list_by_endpoint_next_async(next_page_link, custom_headers = nil)
472
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
552
473
 
553
474
 
554
475
  request_headers = {}
@@ -556,33 +477,23 @@ module Azure::ARM::CDN
556
477
  # Set Headers
557
478
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
558
479
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
559
-
560
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
561
-
562
- # Serialize Request
563
- request_mapper = OriginParameters.mapper()
564
- request_content = @client.serialize(request_mapper, origin_properties, 'origin_properties')
565
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
566
-
567
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}'
480
+ path_template = '{nextLink}'
568
481
 
569
482
  request_url = @base_url || @client.base_url
570
483
 
571
484
  options = {
572
485
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
573
- path_params: {'originName' => origin_name,'endpointName' => endpoint_name,'profileName' => profile_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
574
- query_params: {'api-version' => @client.api_version},
575
- body: request_content,
486
+ skip_encoding_path_params: {'nextLink' => next_page_link},
576
487
  headers: request_headers.merge(custom_headers || {}),
577
488
  base_url: request_url
578
489
  }
579
- promise = @client.make_request_async(:patch, path_template, options)
490
+ promise = @client.make_request_async(:get, path_template, options)
580
491
 
581
492
  promise = promise.then do |result|
582
493
  http_response = result.response
583
494
  status_code = http_response.status
584
495
  response_content = http_response.body
585
- unless status_code == 200 || status_code == 202
496
+ unless status_code == 200
586
497
  error_model = JSON.load(response_content)
587
498
  fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
588
499
  end
@@ -592,17 +503,7 @@ module Azure::ARM::CDN
592
503
  if status_code == 200
593
504
  begin
594
505
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
595
- result_mapper = Origin.mapper()
596
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
597
- rescue Exception => e
598
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
599
- end
600
- end
601
- # Deserialize Response
602
- if status_code == 202
603
- begin
604
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
605
- result_mapper = Origin.mapper()
506
+ result_mapper = OriginListResult.mapper()
606
507
  result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
607
508
  rescue Exception => e
608
509
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -616,163 +517,29 @@ module Azure::ARM::CDN
616
517
  end
617
518
 
618
519
  #
619
- # Deletes an existing CDN origin within an endpoint.
620
- #
621
- # @param origin_name [String] Name of the origin. Must be unique within
622
- # endpoint.
623
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
624
- # @param profile_name [String] Name of the CDN profile within the resource
625
- # group.
626
- # @param resource_group_name [String] Name of the resource group within the
627
- # Azure subscription.
628
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
629
- # will be added to the HTTP request.
630
- #
631
- # @return [Origin] operation results.
632
- #
633
- def delete_if_exists(origin_name, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
634
- response = delete_if_exists_async(origin_name, endpoint_name, profile_name, resource_group_name, custom_headers).value!
635
- response.body unless response.nil?
636
- end
637
-
520
+ # Lists the existing CDN origins within an endpoint.
638
521
  #
639
- # @param origin_name [String] Name of the origin. Must be unique within
640
- # endpoint.
641
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
642
- # @param profile_name [String] Name of the CDN profile within the resource
643
- # group.
644
- # @param resource_group_name [String] Name of the resource group within the
522
+ # @param resource_group_name [String] Name of the Resource group within the
645
523
  # Azure subscription.
524
+ # @param profile_name [String] Name of the CDN profile which is unique within
525
+ # the resource group.
526
+ # @param endpoint_name [String] Name of the endpoint under the profile which is
527
+ # unique globally.
646
528
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
647
529
  # will be added to the HTTP request.
648
530
  #
649
- # @return [Concurrent::Promise] promise which provides async access to http
531
+ # @return [OriginListResult] which provide lazy access to pages of the
650
532
  # response.
651
533
  #
652
- def delete_if_exists_async(origin_name, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
653
- # Send request
654
- promise = begin_delete_if_exists_async(origin_name, endpoint_name, profile_name, resource_group_name, custom_headers)
655
-
656
- promise = promise.then do |response|
657
- # Defining deserialization method.
658
- deserialize_method = lambda do |parsed_response|
659
- result_mapper = Origin.mapper()
660
- parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
661
- end
662
-
663
- # Waiting for response.
664
- @client.get_long_running_operation_result(response, deserialize_method)
665
- end
666
-
667
- promise
668
- end
669
-
670
- #
671
- # Deletes an existing CDN origin within an endpoint.
672
- #
673
- # @param origin_name [String] Name of the origin. Must be unique within
674
- # endpoint.
675
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
676
- # @param profile_name [String] Name of the CDN profile within the resource
677
- # group.
678
- # @param resource_group_name [String] Name of the resource group within the
679
- # Azure subscription.
680
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
681
- # will be added to the HTTP request.
682
- #
683
- # @return [Origin] operation results.
684
- #
685
- def begin_delete_if_exists(origin_name, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
686
- response = begin_delete_if_exists_async(origin_name, endpoint_name, profile_name, resource_group_name, custom_headers).value!
687
- response.body unless response.nil?
688
- end
689
-
690
- #
691
- # Deletes an existing CDN origin within an endpoint.
692
- #
693
- # @param origin_name [String] Name of the origin. Must be unique within
694
- # endpoint.
695
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
696
- # @param profile_name [String] Name of the CDN profile within the resource
697
- # group.
698
- # @param resource_group_name [String] Name of the resource group within the
699
- # Azure subscription.
700
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
701
- # will be added to the HTTP request.
702
- #
703
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
704
- #
705
- def begin_delete_if_exists_with_http_info(origin_name, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
706
- begin_delete_if_exists_async(origin_name, endpoint_name, profile_name, resource_group_name, custom_headers).value!
707
- end
708
-
709
- #
710
- # Deletes an existing CDN origin within an endpoint.
711
- #
712
- # @param origin_name [String] Name of the origin. Must be unique within
713
- # endpoint.
714
- # @param endpoint_name [String] Name of the endpoint within the CDN profile.
715
- # @param profile_name [String] Name of the CDN profile within the resource
716
- # group.
717
- # @param resource_group_name [String] Name of the resource group within the
718
- # Azure subscription.
719
- # @param [Hash{String => String}] A hash of custom headers that will be added
720
- # to the HTTP request.
721
- #
722
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
723
- #
724
- def begin_delete_if_exists_async(origin_name, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
725
- fail ArgumentError, 'origin_name is nil' if origin_name.nil?
726
- fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
727
- fail ArgumentError, 'profile_name is nil' if profile_name.nil?
728
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
729
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
730
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
731
-
732
-
733
- request_headers = {}
734
-
735
- # Set Headers
736
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
737
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
738
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}'
739
-
740
- request_url = @base_url || @client.base_url
741
-
742
- options = {
743
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
744
- path_params: {'originName' => origin_name,'endpointName' => endpoint_name,'profileName' => profile_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
745
- query_params: {'api-version' => @client.api_version},
746
- headers: request_headers.merge(custom_headers || {}),
747
- base_url: request_url
748
- }
749
- promise = @client.make_request_async(:delete, path_template, options)
750
-
751
- promise = promise.then do |result|
752
- http_response = result.response
753
- status_code = http_response.status
754
- response_content = http_response.body
755
- unless status_code == 202 || status_code == 204
756
- error_model = JSON.load(response_content)
757
- fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
534
+ def list_by_endpoint_as_lazy(resource_group_name, profile_name, endpoint_name, custom_headers = nil)
535
+ response = list_by_endpoint_async(resource_group_name, profile_name, endpoint_name, custom_headers).value!
536
+ unless response.nil?
537
+ page = response.body
538
+ page.next_method = Proc.new do |next_page_link|
539
+ list_by_endpoint_next_async(next_page_link, custom_headers)
758
540
  end
759
-
760
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
761
- # Deserialize Response
762
- if status_code == 202
763
- begin
764
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
765
- result_mapper = Origin.mapper()
766
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
767
- rescue Exception => e
768
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
769
- end
770
- end
771
-
772
- result
541
+ page
773
542
  end
774
-
775
- promise.execute
776
543
  end
777
544
 
778
545
  end