Class: Azure::ARM::CDN::Profiles

Inherits:
Object
  • Object
show all
Includes:
Models, MsRestAzure
Defined in:
lib/azure_mgmt_cdn/profiles.rb

Overview

Use these APIs to manage Azure CDN resources through the Azure Resource Manager. You must make sure that requests made to these resources are secure. For more information, see <a href=“msdn.microsoft.com/en-us/library/azure/dn790557.aspx”>Authenticating Azure Resource Manager requests.</a>

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Profiles

Creates and initializes a new instance of the Profiles class.

Parameters:

  • client

    service class for accessing basic functionality.



22
23
24
# File 'lib/azure_mgmt_cdn/profiles.rb', line 22

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientObject (readonly)

Returns reference to the CdnManagementClient.

Returns:

  • reference to the CdnManagementClient



27
28
29
# File 'lib/azure_mgmt_cdn/profiles.rb', line 27

def client
  @client
end

Instance Method Details

#begin_create(profile_name, profile_properties, resource_group_name, custom_headers = nil) ⇒ Concurrent::Promise

Creates a new CDN Profile with the specified parameters

group needed for creation Azure subscription applied to HTTP request.

response.

Parameters:

  • profile_name (String)

    Name of the CDN profile within the resource

  • profile_properties (ProfileCreateParameters)

    Profile properties

  • resource_group_name (String)

    Name of the resource group within the

  • The (Hash{String => String})

    hash of custom headers need to be

Returns:

  • (Concurrent::Promise)

    Promise object which allows to get HTTP



267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
# File 'lib/azure_mgmt_cdn/profiles.rb', line 267

def begin_create(profile_name, profile_properties, resource_group_name, custom_headers = nil)
  fail ArgumentError, 'profile_name is nil' if profile_name.nil?
  fail ArgumentError, 'profile_properties is nil' if profile_properties.nil?
  profile_properties.validate unless profile_properties.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
  unless profile_properties.nil?
    profile_properties = ProfileCreateParameters.serialize_object(profile_properties)
  end
  request_content = JSON.generate(profile_properties, quirks_mode: true)
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'profileName' => profile_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {})
  }
  request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :put, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_response|
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 201 || status_code == 202
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        unless parsed_response.nil?
          parsed_response = Profile.deserialize_object(parsed_response)
        end
        result.body = parsed_response
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        unless parsed_response.nil?
          parsed_response = Profile.deserialize_object(parsed_response)
        end
        result.body = parsed_response
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#begin_delete_if_exists(profile_name, resource_group_name, custom_headers = nil) ⇒ Concurrent::Promise

Deletes an existing CDN Profile with the specified parameters. Deleting a profile will result in the deletion of all sub resources including endpoints, origins and CustomDomains

group Azure subscription applied to HTTP request.

response.

Parameters:

  • profile_name (String)

    Name of the CDN profile within the resource

  • resource_group_name (String)

    Name of the resource group within the

  • The (Hash{String => String})

    hash of custom headers need to be

Returns:

  • (Concurrent::Promise)

    Promise object which allows to get HTTP



498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
# File 'lib/azure_mgmt_cdn/profiles.rb', line 498

def begin_delete_if_exists(profile_name, resource_group_name, custom_headers = nil)
  fail ArgumentError, 'profile_name is nil' if profile_name.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'profileName' => profile_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {})
  }
  request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :delete, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_response|
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 202 || status_code == 204
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?

    result
  end

  promise.execute
end

#begin_update(profile_name, profile_properties, resource_group_name, custom_headers = nil) ⇒ Concurrent::Promise

Updates an existing CDN Profile with the specified parameters

group needed for update Azure subscription applied to HTTP request.

response.

Parameters:

  • profile_name (String)

    Name of the CDN profile within the resource

  • profile_properties (ProfileUpdateParameters)

    Profile properties

  • resource_group_name (String)

    Name of the resource group within the

  • The (Hash{String => String})

    hash of custom headers need to be

Returns:

  • (Concurrent::Promise)

    Promise object which allows to get HTTP



393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
# File 'lib/azure_mgmt_cdn/profiles.rb', line 393

def begin_update(profile_name, profile_properties, resource_group_name, custom_headers = nil)
  fail ArgumentError, 'profile_name is nil' if profile_name.nil?
  fail ArgumentError, 'profile_properties is nil' if profile_properties.nil?
  profile_properties.validate unless profile_properties.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
  unless profile_properties.nil?
    profile_properties = ProfileUpdateParameters.serialize_object(profile_properties)
  end
  request_content = JSON.generate(profile_properties, quirks_mode: true)
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'profileName' => profile_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {})
  }
  request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :patch, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_response|
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 202
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        unless parsed_response.nil?
          parsed_response = Profile.deserialize_object(parsed_response)
        end
        result.body = parsed_response
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#create(profile_name, profile_properties, resource_group_name, custom_headers = nil) ⇒ Concurrent::Promise

Creates a new CDN Profile with the specified parameters

group needed for creation Azure subscription client request, current version is 2015-06-01 for the response.

response.

Parameters:

  • profile_name (String)

    Name of the CDN profile within the resource

  • profile_properties (ProfileCreateParameters)

    Profile properties

  • resource_group_name (String)

    Name of the resource group within the

  • @client.subscription_id (String)

    Azure Subscription ID

  • @client.api_version (String)

    Version of the API to be used with the

  • @client.accept_language (String)

    Gets or sets the preferred language

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# File 'lib/azure_mgmt_cdn/profiles.rb', line 233

def create(profile_name, profile_properties, resource_group_name, custom_headers = nil)
  # Send request
  promise = begin_create(profile_name, profile_properties, resource_group_name, custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      unless parsed_response.nil?
        parsed_response = Profile.deserialize_object(parsed_response)
      end
    end

    # Waiting for response.
    @client.get_put_operation_result(response, deserialize_method)
  end

  promise
end

#delete_if_exists(profile_name, resource_group_name, custom_headers = nil) ⇒ Concurrent::Promise

Deletes an existing CDN Profile with the specified parameters. Deleting a profile will result in the deletion of all sub resources including endpoints, origins and CustomDomains

group Azure subscription response.

Parameters:

  • profile_name (String)

    Name of the CDN profile within the resource

  • resource_group_name (String)

    Name of the resource group within the

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
# File 'lib/azure_mgmt_cdn/profiles.rb', line 467

def delete_if_exists(profile_name, resource_group_name, custom_headers = nil)
  # Send request
  promise = begin_delete_if_exists(profile_name, resource_group_name, custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
    end

   # Waiting for response.
   @client.get_post_or_delete_operation_result(response, deserialize_method)
  end

  promise
end

#generate_sso_uri(profile_name, resource_group_name, custom_headers = nil) ⇒ Concurrent::Promise

Generates a dynamic SSO URI used to sign in to the CDN Supplemental Portal used for advanced management tasks, such as Country Filtering, Advanced HTTP Reports, and Real-time Stats and Alerts. The SSO URI changes approximately every 10 minutes.

group Azure subscription applied to HTTP request.

response.

Parameters:

  • profile_name (String)

    Name of the CDN profile within the resource

  • resource_group_name (String)

    Name of the resource group within the

  • The (Hash{String => String})

    hash of custom headers need to be

Returns:

  • (Concurrent::Promise)

    Promise object which allows to get HTTP



554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
# File 'lib/azure_mgmt_cdn/profiles.rb', line 554

def generate_sso_uri(profile_name, resource_group_name, custom_headers = nil)
  fail ArgumentError, 'profile_name is nil' if profile_name.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/generateSsoUri'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'profileName' => profile_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {})
  }
  request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :post, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_response|
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        unless parsed_response.nil?
          parsed_response = SsoUri.deserialize_object(parsed_response)
        end
        result.body = parsed_response
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get(profile_name, resource_group_name, custom_headers = nil) ⇒ Concurrent::Promise

Gets a CDN profile with the specified parameters

group Azure subscription applied to HTTP request.

response.

Parameters:

  • profile_name (String)

    Name of the CDN profile within the resource

  • resource_group_name (String)

    Name of the resource group within the

  • The (Hash{String => String})

    hash of custom headers need to be

Returns:

  • (Concurrent::Promise)

    Promise object which allows to get HTTP



163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
# File 'lib/azure_mgmt_cdn/profiles.rb', line 163

def get(profile_name, resource_group_name, custom_headers = nil)
  fail ArgumentError, 'profile_name is nil' if profile_name.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'profileName' => profile_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {})
  }
  request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_response|
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        unless parsed_response.nil?
          parsed_response = Profile.deserialize_object(parsed_response)
        end
        result.body = parsed_response
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_resource_group(resource_group_name, custom_headers = nil) ⇒ Concurrent::Promise

Lists the CDN Profiles within a resource group

Azure subscription applied to HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group within the

  • The (Hash{String => String})

    hash of custom headers need to be

Returns:

  • (Concurrent::Promise)

    Promise object which allows to get HTTP



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/azure_mgmt_cdn/profiles.rb', line 99

def list_by_resource_group(resource_group_name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {})
  }
  request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_response|
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        unless parsed_response.nil?
          parsed_response = ProfileListResult.deserialize_object(parsed_response)
        end
        result.body = parsed_response
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_subscription_id(custom_headers = nil) ⇒ Concurrent::Promise

Lists the CDN Profiles within an Azure subscitption

applied to HTTP request.

response.

Parameters:

  • The (Hash{String => String})

    hash of custom headers need to be

Returns:

  • (Concurrent::Promise)

    Promise object which allows to get HTTP



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/azure_mgmt_cdn/profiles.rb', line 38

def list_by_subscription_id(custom_headers = nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/profiles'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {})
  }
  request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
  promise = request.run_promise do |req|
    @client.credentials.sign_request(req) unless @client.credentials.nil?
  end

  promise = promise.then do |http_response|
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(request, http_response, error_model)
    end

    # Create Result
    result = MsRestAzure::AzureOperationResponse.new(request, http_response)
    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        unless parsed_response.nil?
          parsed_response = ProfileListResult.deserialize_object(parsed_response)
        end
        result.body = parsed_response
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#update(profile_name, profile_properties, resource_group_name, custom_headers = nil) ⇒ Concurrent::Promise

Updates an existing CDN Profile with the specified parameters

group needed for update Azure subscription client request, current version is 2015-06-01 for the response.

response.

Parameters:

  • profile_name (String)

    Name of the CDN profile within the resource

  • profile_properties (ProfileUpdateParameters)

    Profile properties

  • resource_group_name (String)

    Name of the resource group within the

  • @client.subscription_id (String)

    Azure Subscription ID

  • @client.api_version (String)

    Version of the API to be used with the

  • @client.accept_language (String)

    Gets or sets the preferred language

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
# File 'lib/azure_mgmt_cdn/profiles.rb', line 359

def update(profile_name, profile_properties, resource_group_name, custom_headers = nil)
  # Send request
  promise = begin_update(profile_name, profile_properties, resource_group_name, custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      unless parsed_response.nil?
        parsed_response = Profile.deserialize_object(parsed_response)
      end
    end

    # Waiting for response.
    @client.get_put_operation_result(response, deserialize_method)
  end

  promise
end