Method: Ionoscloud::ApplicationLoadBalancersApi#datacenters_applicationloadbalancers_flowlogs_post_with_http_info

Defined in:
lib/ionoscloud/api/application_load_balancers_api.rb

#datacenters_applicationloadbalancers_flowlogs_post_with_http_info(datacenter_id, application_load_balancer_id, application_load_balancer_flow_log, opts = {}) ⇒ Array<(FlowLog, Integer, Hash)>

Create an ALB Flow Log Creates a flow log for the Application Load Balancer specified by ID.

Parameters:

  • datacenter_id (String)

    The unique ID of the data center.

  • application_load_balancer_id (String)

    The unique ID of the Application Load Balancer.

  • application_load_balancer_flow_log (FlowLog)

    The flow log to create.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :pretty (Boolean)

    Controls whether the response is pretty-printed (with indentations and new lines).

  • :depth (Integer)

    Controls the detail depth of the response objects. GET /datacenters/ - depth&#x3D;0: Only direct properties are included; children (servers and other elements) are not included. - depth&#x3D;1: Direct properties and children references are included. - depth&#x3D;2: Direct properties and children properties are included. - depth&#x3D;3: Direct properties and children properties and children&#39;s children are included. - depth&#x3D;… and so on

  • :x_contract_number (Integer)

    Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Returns:

  • (Array<(FlowLog, Integer, Hash)>)

    FlowLog data, response status code and response headers



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
650
651
652
653
654
# File 'lib/ionoscloud/api/application_load_balancers_api.rb', line 587

def datacenters_applicationloadbalancers_flowlogs_post_with_http_info(datacenter_id, application_load_balancer_id, application_load_balancer_flow_log, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ApplicationLoadBalancersApi.datacenters_applicationloadbalancers_flowlogs_post ...'
  end
  # verify the required parameter 'datacenter_id' is set
  if @api_client.config.client_side_validation && datacenter_id.nil?
    fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ApplicationLoadBalancersApi.datacenters_applicationloadbalancers_flowlogs_post"
  end
  # verify the required parameter 'application_load_balancer_id' is set
  if @api_client.config.client_side_validation && application_load_balancer_id.nil?
    fail ArgumentError, "Missing the required parameter 'application_load_balancer_id' when calling ApplicationLoadBalancersApi.datacenters_applicationloadbalancers_flowlogs_post"
  end
  # verify the required parameter 'application_load_balancer_flow_log' is set
  if @api_client.config.client_side_validation && application_load_balancer_flow_log.nil?
    fail ArgumentError, "Missing the required parameter 'application_load_balancer_flow_log' when calling ApplicationLoadBalancersApi.datacenters_applicationloadbalancers_flowlogs_post"
  end
  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ApplicationLoadBalancersApi.datacenters_applicationloadbalancers_flowlogs_post, must be smaller than or equal to 10.'
  end

  if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
    fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ApplicationLoadBalancersApi.datacenters_applicationloadbalancers_flowlogs_post, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/datacenters/{datacenterId}/applicationloadbalancers/{applicationLoadBalancerId}/flowlogs'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'applicationLoadBalancerId' + '}', CGI.escape(application_load_balancer_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
  query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(application_load_balancer_flow_log)

  # return_type
  return_type = opts[:debug_return_type] || 'FlowLog'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']

  new_options = opts.merge(
    :operation => :"ApplicationLoadBalancersApi.datacenters_applicationloadbalancers_flowlogs_post",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ApplicationLoadBalancersApi#datacenters_applicationloadbalancers_flowlogs_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end