Method: PulpFileClient::RepositoriesFileApi#sync_with_http_info

Defined in:
lib/pulp_file_client/api/repositories_file_api.rb

#sync_with_http_info(file_file_repository_href, repository_sync_url, opts = {}) ⇒ Array<(AsyncOperationResponse, Integer, Hash)>

Sync from a remote Trigger an asynchronous task to sync file content.

Parameters:

  • file_file_repository_href (String)
  • repository_sync_url (RepositorySyncURL)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_task_diagnostics (Array<String>)

    List of profilers to use on tasks.

Returns:

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

    AsyncOperationResponse data, response status code and response headers



933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
# File 'lib/pulp_file_client/api/repositories_file_api.rb', line 933

def sync_with_http_info(file_file_repository_href, repository_sync_url, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RepositoriesFileApi.sync ...'
  end
  # verify the required parameter 'file_file_repository_href' is set
  if @api_client.config.client_side_validation && file_file_repository_href.nil?
    fail ArgumentError, "Missing the required parameter 'file_file_repository_href' when calling RepositoriesFileApi.sync"
  end
  # verify the required parameter 'repository_sync_url' is set
  if @api_client.config.client_side_validation && repository_sync_url.nil?
    fail ArgumentError, "Missing the required parameter 'repository_sync_url' when calling RepositoriesFileApi.sync"
  end
  # resource path
  local_var_path = '{file_file_repository_href}sync/'.sub('{' + 'file_file_repository_href' + '}', CGI.escape(file_file_repository_href.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'X-Task-Diagnostics'] = @api_client.build_collection_param(opts[:'x_task_diagnostics'], :csv) if !opts[:'x_task_diagnostics'].nil?

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basicAuth']

  new_options = opts.merge(
    :operation => :"RepositoriesFileApi.sync",
    :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: RepositoriesFileApi#sync\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end