Class: Azure::DataFactory::Mgmt::V2018_06_01::DataFlowDebugSession

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2018-06-01/generated/azure_mgmt_data_factory/data_flow_debug_session.rb

Overview

The Azure Data Factory V2 management API provides a RESTful set of web services that interact with Azure Data Factory V2 services.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ DataFlowDebugSession

Creates and initializes a new instance of the DataFlowDebugSession class.

Parameters:

  • client

    service class for accessing basic functionality.



18
19
20
# File 'lib/2018-06-01/generated/azure_mgmt_data_factory/data_flow_debug_session.rb', line 18

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientDataFactoryManagementClient (readonly)

Returns reference to the DataFactoryManagementClient.

Returns:



23
24
25
# File 'lib/2018-06-01/generated/azure_mgmt_data_factory/data_flow_debug_session.rb', line 23

def client
  @client
end

Instance Method Details

#add_data_flow(resource_group_name, factory_name, request, custom_headers: nil) ⇒ AddDataFlowToDebugSessionResponse

Add a data flow into debug session.

debug content. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • factory_name (String)

    The factory name.

  • request (DataFlowDebugPackage)

    Data flow debug session definition with

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

    A hash of custom headers that

Returns:

  • (AddDataFlowToDebugSessionResponse)

    operation results.



183
184
185
186
# File 'lib/2018-06-01/generated/azure_mgmt_data_factory/data_flow_debug_session.rb', line 183

def add_data_flow(resource_group_name, factory_name, request, custom_headers:nil)
  response = add_data_flow_async(resource_group_name, factory_name, request, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#add_data_flow_async(resource_group_name, factory_name, request, custom_headers: nil) ⇒ Concurrent::Promise

Add a data flow into debug session.

debug content. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • factory_name (String)

    The factory name.

  • request (DataFlowDebugPackage)

    Data flow debug session definition with

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
# File 'lib/2018-06-01/generated/azure_mgmt_data_factory/data_flow_debug_session.rb', line 216

def add_data_flow_async(resource_group_name, factory_name, request, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'factory_name is nil' if factory_name.nil?
  fail ArgumentError, "'factory_name' should satisfy the constraint - 'MaxLength': '63'" if !factory_name.nil? && factory_name.length > 63
  fail ArgumentError, "'factory_name' should satisfy the constraint - 'MinLength': '3'" if !factory_name.nil? && factory_name.length < 3
  fail ArgumentError, "'factory_name' should satisfy the constraint - 'Pattern': '^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'" if !factory_name.nil? && factory_name.match(Regexp.new('^^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'request is nil' if request.nil?


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

  # 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_mapper = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugPackage.mapper()
  request_content = @client.serialize(request_mapper,  request)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/addDataFlowToDebugSession'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'factoryName' => factory_name},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.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(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::DataFactory::Mgmt::V2018_06_01::Models::AddDataFlowToDebugSessionResponse.mapper()
        result.body = @client.deserialize(result_mapper, 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

#add_data_flow_with_http_info(resource_group_name, factory_name, request, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Add a data flow into debug session.

debug content. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • factory_name (String)

    The factory name.

  • request (DataFlowDebugPackage)

    Data flow debug session definition with

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



200
201
202
# File 'lib/2018-06-01/generated/azure_mgmt_data_factory/data_flow_debug_session.rb', line 200

def add_data_flow_with_http_info(resource_group_name, factory_name, request, custom_headers:nil)
  add_data_flow_async(resource_group_name, factory_name, request, custom_headers:custom_headers).value!
end

#begin_create(resource_group_name, factory_name, request, custom_headers: nil) ⇒ CreateDataFlowDebugSessionResponse

Creates a data flow debug session.

definition will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • factory_name (String)

    The factory name.

  • request (CreateDataFlowDebugSessionRequest)

    Data flow debug session

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

    A hash of custom headers that

Returns:

  • (CreateDataFlowDebugSessionResponse)

    operation results.



446
447
448
449
# File 'lib/2018-06-01/generated/azure_mgmt_data_factory/data_flow_debug_session.rb', line 446

def begin_create(resource_group_name, factory_name, request, custom_headers:nil)
  response = begin_create_async(resource_group_name, factory_name, request, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_create_async(resource_group_name, factory_name, request, custom_headers: nil) ⇒ Concurrent::Promise

Creates a data flow debug session.

definition to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • factory_name (String)

    The factory name.

  • request (CreateDataFlowDebugSessionRequest)

    Data flow debug session

  • 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
543
544
545
546
# File 'lib/2018-06-01/generated/azure_mgmt_data_factory/data_flow_debug_session.rb', line 479

def begin_create_async(resource_group_name, factory_name, request, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'factory_name is nil' if factory_name.nil?
  fail ArgumentError, "'factory_name' should satisfy the constraint - 'MaxLength': '63'" if !factory_name.nil? && factory_name.length > 63
  fail ArgumentError, "'factory_name' should satisfy the constraint - 'MinLength': '3'" if !factory_name.nil? && factory_name.length < 3
  fail ArgumentError, "'factory_name' should satisfy the constraint - 'Pattern': '^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'" if !factory_name.nil? && factory_name.match(Regexp.new('^^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'request is nil' if request.nil?


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

  # 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_mapper = Azure::DataFactory::Mgmt::V2018_06_01::Models::CreateDataFlowDebugSessionRequest.mapper()
  request_content = @client.serialize(request_mapper,  request)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/createDataFlowDebugSession'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'factoryName' => factory_name},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 202 || status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::DataFactory::Mgmt::V2018_06_01::Models::CreateDataFlowDebugSessionResponse.mapper()
        result.body = @client.deserialize(result_mapper, 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_create_with_http_info(resource_group_name, factory_name, request, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Creates a data flow debug session.

definition will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • factory_name (String)

    The factory name.

  • request (CreateDataFlowDebugSessionRequest)

    Data flow debug session

  • 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/2018-06-01/generated/azure_mgmt_data_factory/data_flow_debug_session.rb', line 463

def begin_create_with_http_info(resource_group_name, factory_name, request, custom_headers:nil)
  begin_create_async(resource_group_name, factory_name, request, custom_headers:custom_headers).value!
end

#begin_execute_command(resource_group_name, factory_name, request, custom_headers: nil) ⇒ DataFlowDebugCommandResponse

Execute a data flow debug command.

definition. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • factory_name (String)

    The factory name.

  • request (DataFlowDebugCommandRequest)

    Data flow debug command

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

    A hash of custom headers that

Returns:

  • (DataFlowDebugCommandResponse)

    operation results.



560
561
562
563
# File 'lib/2018-06-01/generated/azure_mgmt_data_factory/data_flow_debug_session.rb', line 560

def begin_execute_command(resource_group_name, factory_name, request, custom_headers:nil)
  response = begin_execute_command_async(resource_group_name, factory_name, request, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_execute_command_async(resource_group_name, factory_name, request, custom_headers: nil) ⇒ Concurrent::Promise

Execute a data flow debug command.

definition. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • factory_name (String)

    The factory name.

  • request (DataFlowDebugCommandRequest)

    Data flow debug command

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
650
651
652
653
654
655
656
657
658
659
660
# File 'lib/2018-06-01/generated/azure_mgmt_data_factory/data_flow_debug_session.rb', line 593

def begin_execute_command_async(resource_group_name, factory_name, request, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'factory_name is nil' if factory_name.nil?
  fail ArgumentError, "'factory_name' should satisfy the constraint - 'MaxLength': '63'" if !factory_name.nil? && factory_name.length > 63
  fail ArgumentError, "'factory_name' should satisfy the constraint - 'MinLength': '3'" if !factory_name.nil? && factory_name.length < 3
  fail ArgumentError, "'factory_name' should satisfy the constraint - 'Pattern': '^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'" if !factory_name.nil? && factory_name.match(Regexp.new('^^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'request is nil' if request.nil?


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

  # 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_mapper = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugCommandRequest.mapper()
  request_content = @client.serialize(request_mapper,  request)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/executeDataFlowDebugCommand'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'factoryName' => factory_name},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 202 || status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugCommandResponse.mapper()
        result.body = @client.deserialize(result_mapper, 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_execute_command_with_http_info(resource_group_name, factory_name, request, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Execute a data flow debug command.

definition. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • factory_name (String)

    The factory name.

  • request (DataFlowDebugCommandRequest)

    Data flow debug command

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



577
578
579
# File 'lib/2018-06-01/generated/azure_mgmt_data_factory/data_flow_debug_session.rb', line 577

def begin_execute_command_with_http_info(resource_group_name, factory_name, request, custom_headers:nil)
  begin_execute_command_async(resource_group_name, factory_name, request, custom_headers:custom_headers).value!
end

#create(resource_group_name, factory_name, request, custom_headers: nil) ⇒ CreateDataFlowDebugSessionResponse

Creates a data flow debug session.

definition will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • factory_name (String)

    The factory name.

  • request (CreateDataFlowDebugSessionRequest)

    Data flow debug session

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

    A hash of custom headers that

Returns:

  • (CreateDataFlowDebugSessionResponse)

    operation results.



37
38
39
40
# File 'lib/2018-06-01/generated/azure_mgmt_data_factory/data_flow_debug_session.rb', line 37

def create(resource_group_name, factory_name, request, custom_headers:nil)
  response = create_async(resource_group_name, factory_name, request, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_async(resource_group_name, factory_name, request, custom_headers: nil) ⇒ Concurrent::Promise

definition will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • factory_name (String)

    The factory name.

  • request (CreateDataFlowDebugSessionRequest)

    Data flow debug session

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/2018-06-01/generated/azure_mgmt_data_factory/data_flow_debug_session.rb', line 53

def create_async(resource_group_name, factory_name, request, custom_headers:nil)
  # Send request
  promise = begin_create_async(resource_group_name, factory_name, request, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::DataFactory::Mgmt::V2018_06_01::Models::CreateDataFlowDebugSessionResponse.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

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

  promise
end

#delete(resource_group_name, factory_name, request, custom_headers: nil) ⇒ Object

Deletes a data flow debug session.

definition for deletion will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • factory_name (String)

    The factory name.

  • request (DeleteDataFlowDebugSessionRequest)

    Data flow debug session

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

    A hash of custom headers that



296
297
298
299
# File 'lib/2018-06-01/generated/azure_mgmt_data_factory/data_flow_debug_session.rb', line 296

def delete(resource_group_name, factory_name, request, custom_headers:nil)
  response = delete_async(resource_group_name, factory_name, request, custom_headers:custom_headers).value!
  nil
end

#delete_async(resource_group_name, factory_name, request, custom_headers: nil) ⇒ Concurrent::Promise

Deletes a data flow debug session.

definition for deletion to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • factory_name (String)

    The factory name.

  • request (DeleteDataFlowDebugSessionRequest)

    Data flow debug session

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
# File 'lib/2018-06-01/generated/azure_mgmt_data_factory/data_flow_debug_session.rb', line 329

def delete_async(resource_group_name, factory_name, request, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'factory_name is nil' if factory_name.nil?
  fail ArgumentError, "'factory_name' should satisfy the constraint - 'MaxLength': '63'" if !factory_name.nil? && factory_name.length > 63
  fail ArgumentError, "'factory_name' should satisfy the constraint - 'MinLength': '3'" if !factory_name.nil? && factory_name.length < 3
  fail ArgumentError, "'factory_name' should satisfy the constraint - 'Pattern': '^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'" if !factory_name.nil? && factory_name.match(Regexp.new('^^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'request is nil' if request.nil?


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

  # 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_mapper = Azure::DataFactory::Mgmt::V2018_06_01::Models::DeleteDataFlowDebugSessionRequest.mapper()
  request_content = @client.serialize(request_mapper,  request)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/deleteDataFlowDebugSession'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'factoryName' => factory_name},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.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(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#delete_with_http_info(resource_group_name, factory_name, request, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes a data flow debug session.

definition for deletion will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • factory_name (String)

    The factory name.

  • request (DeleteDataFlowDebugSessionRequest)

    Data flow debug session

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



313
314
315
# File 'lib/2018-06-01/generated/azure_mgmt_data_factory/data_flow_debug_session.rb', line 313

def delete_with_http_info(resource_group_name, factory_name, request, custom_headers:nil)
  delete_async(resource_group_name, factory_name, request, custom_headers:custom_headers).value!
end

#execute_command(resource_group_name, factory_name, request, custom_headers: nil) ⇒ DataFlowDebugCommandResponse

Execute a data flow debug command.

definition. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • factory_name (String)

    The factory name.

  • request (DataFlowDebugCommandRequest)

    Data flow debug command

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

    A hash of custom headers that

Returns:

  • (DataFlowDebugCommandResponse)

    operation results.



400
401
402
403
# File 'lib/2018-06-01/generated/azure_mgmt_data_factory/data_flow_debug_session.rb', line 400

def execute_command(resource_group_name, factory_name, request, custom_headers:nil)
  response = execute_command_async(resource_group_name, factory_name, request, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#execute_command_async(resource_group_name, factory_name, request, custom_headers: nil) ⇒ Concurrent::Promise

definition. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • factory_name (String)

    The factory name.

  • request (DataFlowDebugCommandRequest)

    Data flow debug command

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
# File 'lib/2018-06-01/generated/azure_mgmt_data_factory/data_flow_debug_session.rb', line 416

def execute_command_async(resource_group_name, factory_name, request, custom_headers:nil)
  # Send request
  promise = begin_execute_command_async(resource_group_name, factory_name, request, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::DataFactory::Mgmt::V2018_06_01::Models::DataFlowDebugCommandResponse.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

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

  promise
end

#query_by_factory(resource_group_name, factory_name, custom_headers: nil) ⇒ Array<DataFlowDebugSessionInfo>

Query all active data flow debug sessions.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • factory_name (String)

    The factory name.

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

    A hash of custom headers that

Returns:

  • (Array<DataFlowDebugSessionInfo>)

    operation results.



81
82
83
84
# File 'lib/2018-06-01/generated/azure_mgmt_data_factory/data_flow_debug_session.rb', line 81

def query_by_factory(resource_group_name, factory_name, custom_headers:nil)
  first_page = query_by_factory_as_lazy(resource_group_name, factory_name, custom_headers:custom_headers)
  first_page.get_all_items
end

#query_by_factory_as_lazy(resource_group_name, factory_name, custom_headers: nil) ⇒ QueryDataFlowDebugSessionsResponse

Query all active data flow debug sessions.

will be added to the HTTP request.

pages of the response.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • factory_name (String)

    The factory name.

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

    A hash of custom headers that

Returns:

  • (QueryDataFlowDebugSessionsResponse)

    which provide lazy access to



763
764
765
766
767
768
769
770
771
772
# File 'lib/2018-06-01/generated/azure_mgmt_data_factory/data_flow_debug_session.rb', line 763

def query_by_factory_as_lazy(resource_group_name, factory_name, custom_headers:nil)
  response = query_by_factory_async(resource_group_name, factory_name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      query_by_factory_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#query_by_factory_async(resource_group_name, factory_name, custom_headers: nil) ⇒ Concurrent::Promise

Query all active data flow debug sessions.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • factory_name (String)

    The factory name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/2018-06-01/generated/azure_mgmt_data_factory/data_flow_debug_session.rb', line 110

def query_by_factory_async(resource_group_name, factory_name, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'factory_name is nil' if factory_name.nil?
  fail ArgumentError, "'factory_name' should satisfy the constraint - 'MaxLength': '63'" if !factory_name.nil? && factory_name.length > 63
  fail ArgumentError, "'factory_name' should satisfy the constraint - 'MinLength': '3'" if !factory_name.nil? && factory_name.length < 3
  fail ArgumentError, "'factory_name' should satisfy the constraint - 'Pattern': '^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$'" if !factory_name.nil? && factory_name.match(Regexp.new('^^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # 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.DataFactory/factories/{factoryName}/queryDataFlowDebugSessions'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'factoryName' => factory_name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.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(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::DataFactory::Mgmt::V2018_06_01::Models::QueryDataFlowDebugSessionsResponse.mapper()
        result.body = @client.deserialize(result_mapper, 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

#query_by_factory_next(next_page_link, custom_headers: nil) ⇒ QueryDataFlowDebugSessionsResponse

Query all active data flow debug sessions.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (QueryDataFlowDebugSessionsResponse)

    operation results.



672
673
674
675
# File 'lib/2018-06-01/generated/azure_mgmt_data_factory/data_flow_debug_session.rb', line 672

def query_by_factory_next(next_page_link, custom_headers:nil)
  response = query_by_factory_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#query_by_factory_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Query all active data flow debug sessions.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
747
748
749
750
# File 'lib/2018-06-01/generated/azure_mgmt_data_factory/data_flow_debug_session.rb', line 701

def query_by_factory_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


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

  # 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}'

  request_url = @base_url || @client.base_url

  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 || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.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(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::DataFactory::Mgmt::V2018_06_01::Models::QueryDataFlowDebugSessionsResponse.mapper()
        result.body = @client.deserialize(result_mapper, 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

#query_by_factory_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Query all active data flow debug sessions.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



687
688
689
# File 'lib/2018-06-01/generated/azure_mgmt_data_factory/data_flow_debug_session.rb', line 687

def query_by_factory_next_with_http_info(next_page_link, custom_headers:nil)
  query_by_factory_next_async(next_page_link, custom_headers:custom_headers).value!
end

#query_by_factory_with_http_info(resource_group_name, factory_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Query all active data flow debug sessions.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The resource group name.

  • factory_name (String)

    The factory name.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



96
97
98
# File 'lib/2018-06-01/generated/azure_mgmt_data_factory/data_flow_debug_session.rb', line 96

def query_by_factory_with_http_info(resource_group_name, factory_name, custom_headers:nil)
  query_by_factory_async(resource_group_name, factory_name, custom_headers:custom_headers).value!
end