Class: Azure::ARM::Web::Certificates

Inherits:
Object
  • Object
show all
Includes:
Models, MsRestAzure
Defined in:
lib/generated/azure_mgmt_web/certificates.rb

Overview

Use these APIs to manage Azure Websites resources through the Azure Resource Manager. All task operations conform to the HTTP/1.1 protocol specification and each operation returns an x-ms-request-id header that can be used to obtain information about the request. 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) ⇒ Certificates

Creates and initializes a new instance of the Certificates class.

Parameters:

  • client

    service class for accessing basic functionality.



25
26
27
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 25

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientWebSiteManagementClient (readonly)

Returns reference to the WebSiteManagementClient.

Returns:



30
31
32
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 30

def client
  @client
end

Instance Method Details

#create_or_update_certificate(resource_group_name, name, certificate_envelope, custom_headers = nil) ⇒ Certificate

Creates or modifies an existing certificate.

exists already. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group

  • name (String)

    Name of the certificate.

  • certificate_envelope (Certificate)

    Details of certificate if it

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



252
253
254
255
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 252

def create_or_update_certificate(resource_group_name, name, certificate_envelope, custom_headers = nil)
  response = create_or_update_certificate_async(resource_group_name, name, certificate_envelope, custom_headers).value!
  response.body unless response.nil?
end

#create_or_update_certificate_async(resource_group_name, name, certificate_envelope, custom_headers = nil) ⇒ Concurrent::Promise

Creates or modifies an existing certificate.

exists already. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group

  • name (String)

    Name of the certificate.

  • certificate_envelope (Certificate)

    Details of certificate if it

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
340
341
342
343
344
345
346
347
348
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 285

def create_or_update_certificate_async(resource_group_name, name, certificate_envelope, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'certificate_envelope is nil' if certificate_envelope.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?

  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Serialize Request
  request_mapper = Certificate.mapper()
  request_content = @client.serialize(request_mapper,  certificate_envelope, 'certificate_envelope')
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_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 == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.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)
        result_mapper = Certificate.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_or_update_certificate_with_http_info(resource_group_name, name, certificate_envelope, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Creates or modifies an existing certificate.

exists already. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group

  • name (String)

    Name of the certificate.

  • certificate_envelope (Certificate)

    Details of certificate if it

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



269
270
271
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 269

def create_or_update_certificate_with_http_info(resource_group_name, name, certificate_envelope, custom_headers = nil)
  create_or_update_certificate_async(resource_group_name, name, certificate_envelope, custom_headers).value!
end

#create_or_update_csr(resource_group_name, name, csr_envelope, custom_headers = nil) ⇒ Csr

Creates or modifies an existing certificate signing request.

exists already. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group

  • name (String)

    Name of the certificate.

  • csr_envelope (Csr)

    Details of certificate signing request if it

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Csr)

    operation results.



760
761
762
763
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 760

def create_or_update_csr(resource_group_name, name, csr_envelope, custom_headers = nil)
  response = create_or_update_csr_async(resource_group_name, name, csr_envelope, custom_headers).value!
  response.body unless response.nil?
end

#create_or_update_csr_async(resource_group_name, name, csr_envelope, custom_headers = nil) ⇒ Concurrent::Promise

Creates or modifies an existing certificate signing request.

exists already. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group

  • name (String)

    Name of the certificate.

  • csr_envelope (Csr)

    Details of certificate signing request if it

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 793

def create_or_update_csr_async(resource_group_name, name, csr_envelope, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'csr_envelope is nil' if csr_envelope.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?

  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Serialize Request
  request_mapper = Csr.mapper()
  request_content = @client.serialize(request_mapper,  csr_envelope, 'csr_envelope')
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/csrs/{name}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_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 == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.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)
        result_mapper = Csr.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_or_update_csr_with_http_info(resource_group_name, name, csr_envelope, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Creates or modifies an existing certificate signing request.

exists already. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group

  • name (String)

    Name of the certificate.

  • csr_envelope (Csr)

    Details of certificate signing request if it

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



777
778
779
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 777

def create_or_update_csr_with_http_info(resource_group_name, name, csr_envelope, custom_headers = nil)
  create_or_update_csr_async(resource_group_name, name, csr_envelope, custom_headers).value!
end

#delete_certificate(resource_group_name, name, custom_headers = nil) ⇒ Object

Delete a certificate by name in a specificed subscription and resourcegroup.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group

  • name (String)

    Name of the certificate to be deleted.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Object)

    operation results.



360
361
362
363
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 360

def delete_certificate(resource_group_name, name, custom_headers = nil)
  response = delete_certificate_async(resource_group_name, name, custom_headers).value!
  response.body unless response.nil?
end

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

Delete a certificate by name in a specificed subscription and resourcegroup.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group

  • name (String)

    Name of the certificate to be deleted.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



389
390
391
392
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
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 389

def delete_certificate_async(resource_group_name, name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'name is nil' if 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.Web/certificates/{name}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_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 == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.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

#delete_certificate_with_http_info(resource_group_name, name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Delete a certificate by name in a specificed subscription and resourcegroup.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group

  • name (String)

    Name of the certificate to be deleted.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



375
376
377
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 375

def delete_certificate_with_http_info(resource_group_name, name, custom_headers = nil)
  delete_certificate_async(resource_group_name, name, custom_headers).value!
end

#delete_csr(resource_group_name, name, custom_headers = nil) ⇒ Object

Delete the certificate signing request.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group

  • name (String)

    Name of the certificate signing request.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Object)

    operation results.



868
869
870
871
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 868

def delete_csr(resource_group_name, name, custom_headers = nil)
  response = delete_csr_async(resource_group_name, name, custom_headers).value!
  response.body unless response.nil?
end

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

Delete the certificate signing request.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group

  • name (String)

    Name of the certificate signing request.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 897

def delete_csr_async(resource_group_name, name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'name is nil' if 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.Web/csrs/{name}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_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 == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.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

#delete_csr_with_http_info(resource_group_name, name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Delete the certificate signing request.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group

  • name (String)

    Name of the certificate signing request.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



883
884
885
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 883

def delete_csr_with_http_info(resource_group_name, name, custom_headers = nil)
  delete_csr_async(resource_group_name, name, custom_headers).value!
end

#get_certificate(resource_group_name, name, custom_headers = nil) ⇒ Certificate

Get a certificate by certificate name for a subscription in the specified resource group.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group

  • name (String)

    Name of the certificate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



154
155
156
157
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 154

def get_certificate(resource_group_name, name, custom_headers = nil)
  response = get_certificate_async(resource_group_name, name, custom_headers).value!
  response.body unless response.nil?
end

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

Get a certificate by certificate name for a subscription in the specified resource group.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group

  • name (String)

    Name of the certificate.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 185

def get_certificate_async(resource_group_name, name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'name is nil' if 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.Web/certificates/{name}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_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 MsRestAzure::AzureOperationError.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)
        result_mapper = Certificate.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_certificate_with_http_info(resource_group_name, name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Get a certificate by certificate name for a subscription in the specified resource group.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group

  • name (String)

    Name of the certificate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



170
171
172
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 170

def get_certificate_with_http_info(resource_group_name, name, custom_headers = nil)
  get_certificate_async(resource_group_name, name, custom_headers).value!
end

#get_certificates(resource_group_name, custom_headers = nil) ⇒ Array<Certificate>

Get certificates for a subscription in the specified resource group.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



62
63
64
65
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 62

def get_certificates(resource_group_name, custom_headers = nil)
  first_page = get_certificates_as_lazy(resource_group_name, custom_headers)
  first_page.get_all_items
end

#get_certificates_as_lazy(resource_group_name, custom_headers = nil) ⇒ CertificateCollection

Get certificates for a subscription in the specified resource group.

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of the resource group

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



42
43
44
45
46
47
48
49
50
51
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 42

def get_certificates_as_lazy(resource_group_name, custom_headers = nil)
  response = get_certificates_async(resource_group_name, custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_link|
      get_certificates_next_async(next_link, custom_headers)
    end
    page
  end
end

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

Get certificates for a subscription in the specified resource group.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



89
90
91
92
93
94
95
96
97
98
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
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 89

def get_certificates_async(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.Web/certificates'
  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_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_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 MsRestAzure::AzureOperationError.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)
        result_mapper = CertificateCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_certificates_next(next_page_link, custom_headers = nil) ⇒ CertificateCollection

Get certificates for a subscription in the specified resource group.

call to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



1062
1063
1064
1065
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 1062

def get_certificates_next(next_page_link, custom_headers = nil)
  response = get_certificates_next_async(next_page_link, custom_headers).value!
  response.body unless response.nil?
end

#get_certificates_next_async(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise

Get certificates for a subscription in the specified resource group.

call to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 1091

def get_certificates_next_async(next_page_link, custom_headers = nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.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 = '{nextLink}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_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 MsRestAzure::AzureOperationError.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)
        result_mapper = CertificateCollection.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_certificates_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Get certificates for a subscription in the specified resource group.

call to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1077
1078
1079
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 1077

def get_certificates_next_with_http_info(next_page_link, custom_headers = nil)
  get_certificates_next_async(next_page_link, custom_headers).value!
end

#get_certificates_with_http_info(resource_group_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Get certificates for a subscription in the specified resource group.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



76
77
78
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 76

def get_certificates_with_http_info(resource_group_name, custom_headers = nil)
  get_certificates_async(resource_group_name, custom_headers).value!
end

#get_csr(resource_group_name, name, custom_headers = nil) ⇒ Csr

Gets a certificate signing request by certificate name for a subscription in the specified resource group

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group

  • name (String)

    Name of the certificate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Csr)

    operation results.



662
663
664
665
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 662

def get_csr(resource_group_name, name, custom_headers = nil)
  response = get_csr_async(resource_group_name, name, custom_headers).value!
  response.body unless response.nil?
end

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

Gets a certificate signing request by certificate name for a subscription in the specified resource group

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group

  • name (String)

    Name of the certificate.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 693

def get_csr_async(resource_group_name, name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'name is nil' if 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.Web/csrs/{name}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_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 MsRestAzure::AzureOperationError.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)
        result_mapper = Csr.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_csr_with_http_info(resource_group_name, name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets a certificate signing request by certificate name for a subscription in the specified resource group

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group

  • name (String)

    Name of the certificate.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



678
679
680
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 678

def get_csr_with_http_info(resource_group_name, name, custom_headers = nil)
  get_csr_async(resource_group_name, name, custom_headers).value!
end

#get_csrs(resource_group_name, custom_headers = nil) ⇒ Array

Gets the certificate signing requests for a subscription in the specified resource group

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array)

    operation results.



554
555
556
557
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 554

def get_csrs(resource_group_name, custom_headers = nil)
  response = get_csrs_async(resource_group_name, custom_headers).value!
  response.body unless response.nil?
end

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

Gets the certificate signing requests for a subscription in the specified resource group

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 583

def get_csrs_async(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.Web/csrs'
  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_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_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 MsRestAzure::AzureOperationError.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)
        result_mapper = {
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'Sequence',
            element: {
                required: false,
                serialized_name: 'CsrElementType',
                type: {
                  name: 'Composite',
                  class_name: 'Csr'
                }
            }
          }
        }
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_csrs_with_http_info(resource_group_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the certificate signing requests for a subscription in the specified resource group

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



569
570
571
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 569

def get_csrs_with_http_info(resource_group_name, custom_headers = nil)
  get_csrs_async(resource_group_name, custom_headers).value!
end

#update_certificate(resource_group_name, name, certificate_envelope, custom_headers = nil) ⇒ Certificate

Creates or modifies an existing certificate.

exists already. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group

  • name (String)

    Name of the certificate.

  • certificate_envelope (Certificate)

    Details of certificate if it

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



446
447
448
449
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 446

def update_certificate(resource_group_name, name, certificate_envelope, custom_headers = nil)
  response = update_certificate_async(resource_group_name, name, certificate_envelope, custom_headers).value!
  response.body unless response.nil?
end

#update_certificate_async(resource_group_name, name, certificate_envelope, custom_headers = nil) ⇒ Concurrent::Promise

Creates or modifies an existing certificate.

exists already. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group

  • name (String)

    Name of the certificate.

  • certificate_envelope (Certificate)

    Details of certificate if it

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
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
537
538
539
540
541
542
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 479

def update_certificate_async(resource_group_name, name, certificate_envelope, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'certificate_envelope is nil' if certificate_envelope.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?

  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Serialize Request
  request_mapper = Certificate.mapper()
  request_content = @client.serialize(request_mapper,  certificate_envelope, 'certificate_envelope')
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_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 == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.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)
        result_mapper = Certificate.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_certificate_with_http_info(resource_group_name, name, certificate_envelope, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Creates or modifies an existing certificate.

exists already. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group

  • name (String)

    Name of the certificate.

  • certificate_envelope (Certificate)

    Details of certificate if it

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



463
464
465
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 463

def update_certificate_with_http_info(resource_group_name, name, certificate_envelope, custom_headers = nil)
  update_certificate_async(resource_group_name, name, certificate_envelope, custom_headers).value!
end

#update_csr(resource_group_name, name, csr_envelope, custom_headers = nil) ⇒ Csr

Creates or modifies an existing certificate signing request.

exists already. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group

  • name (String)

    Name of the certificate.

  • csr_envelope (Csr)

    Details of certificate signing request if it

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Csr)

    operation results.



954
955
956
957
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 954

def update_csr(resource_group_name, name, csr_envelope, custom_headers = nil)
  response = update_csr_async(resource_group_name, name, csr_envelope, custom_headers).value!
  response.body unless response.nil?
end

#update_csr_async(resource_group_name, name, csr_envelope, custom_headers = nil) ⇒ Concurrent::Promise

Creates or modifies an existing certificate signing request.

exists already. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group

  • name (String)

    Name of the certificate.

  • csr_envelope (Csr)

    Details of certificate signing request if it

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 987

def update_csr_async(resource_group_name, name, csr_envelope, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'csr_envelope is nil' if csr_envelope.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?

  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Serialize Request
  request_mapper = Csr.mapper()
  request_content = @client.serialize(request_mapper,  csr_envelope, 'csr_envelope')
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/csrs/{name}'
  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {})
  }

  request_url = @base_url || @client.base_url

  request = MsRest::HttpOperationRequest.new(request_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 == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.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)
        result_mapper = Csr.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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_csr_with_http_info(resource_group_name, name, csr_envelope, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Creates or modifies an existing certificate signing request.

exists already. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of the resource group

  • name (String)

    Name of the certificate.

  • csr_envelope (Csr)

    Details of certificate signing request if it

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



971
972
973
# File 'lib/generated/azure_mgmt_web/certificates.rb', line 971

def update_csr_with_http_info(resource_group_name, name, csr_envelope, custom_headers = nil)
  update_csr_async(resource_group_name, name, csr_envelope, custom_headers).value!
end