class PulpAnsibleClient::PulpAnsibleGalaxyApiCollectionsApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/pulp_ansible_client/api/pulp_ansible_galaxy_api_collections_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

create(path, data, opts = {}) click to toggle source

Queues a task that creates a new Collection from an uploaded artifact. @param path [String] @param data [GalaxyCollection] @param [Hash] opts the optional parameters @return [GalaxyCollection]

# File lib/pulp_ansible_client/api/pulp_ansible_galaxy_api_collections_api.rb, line 27
def create(path, data, opts = {})
  data, _status_code, _headers = create_with_http_info(path, data, opts)
  data
end
create_with_http_info(path, data, opts = {}) click to toggle source

Queues a task that creates a new Collection from an uploaded artifact. @param path [String] @param data [GalaxyCollection] @param [Hash] opts the optional parameters @return [Array<(GalaxyCollection, Integer, Hash)>] GalaxyCollection data, response status code and response headers

# File lib/pulp_ansible_client/api/pulp_ansible_galaxy_api_collections_api.rb, line 37
def create_with_http_info(path, data, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PulpAnsibleGalaxyApiCollectionsApi.create ...'
  end
  # verify the required parameter 'path' is set
  if @api_client.config.client_side_validation && path.nil?
    fail ArgumentError, "Missing the required parameter 'path' when calling PulpAnsibleGalaxyApiCollectionsApi.create"
  end
  # verify the required parameter 'data' is set
  if @api_client.config.client_side_validation && data.nil?
    fail ArgumentError, "Missing the required parameter 'data' when calling PulpAnsibleGalaxyApiCollectionsApi.create"
  end
  # resource path
  local_var_path = '/pulp_ansible/galaxy/{path}/api/v2/collections/'.sub('{' + 'path' + '}', CGI.escape(path.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'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

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

  # return_type
  return_type = opts[:return_type] || 'GalaxyCollection' 

  # auth_names
  auth_names = opts[:auth_names] || ['Basic']

  new_options = opts.merge(
    :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: PulpAnsibleGalaxyApiCollectionsApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list(path, opts = {}) click to toggle source

View for Collection models. @param path [String] @param [Hash] opts the optional parameters @option opts [Integer] :page A page number within the paginated result set. @option opts [String] :fields A list of fields to include in the response. @option opts [String] :exclude_fields A list of fields to exclude from the response. @return [InlineResponse20011]

# File lib/pulp_ansible_client/api/pulp_ansible_galaxy_api_collections_api.rb, line 97
def list(path, opts = {})
  data, _status_code, _headers = list_with_http_info(path, opts)
  data
end
list_0(path, opts = {}) click to toggle source

ViewSet for Collections. @param path [String] @param [Hash] opts the optional parameters @option opts [Integer] :limit Number of results to return per page. @option opts [Integer] :offset The initial index from which to return the results. @option opts [String] :fields A list of fields to include in the response. @option opts [String] :exclude_fields A list of fields to exclude from the response. @return [InlineResponse20013]

# File lib/pulp_ansible_client/api/pulp_ansible_galaxy_api_collections_api.rb, line 167
def list_0(path, opts = {})
  data, _status_code, _headers = list_0_with_http_info(path, opts)
  data
end
list_0_with_http_info(path, opts = {}) click to toggle source

ViewSet for Collections. @param path [String] @param [Hash] opts the optional parameters @option opts [Integer] :limit Number of results to return per page. @option opts [Integer] :offset The initial index from which to return the results. @option opts [String] :fields A list of fields to include in the response. @option opts [String] :exclude_fields A list of fields to exclude from the response. @return [Array<(InlineResponse20013, Integer, Hash)>] InlineResponse20013 data, response status code and response headers

# File lib/pulp_ansible_client/api/pulp_ansible_galaxy_api_collections_api.rb, line 180
def list_0_with_http_info(path, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PulpAnsibleGalaxyApiCollectionsApi.list_0 ...'
  end
  # verify the required parameter 'path' is set
  if @api_client.config.client_side_validation && path.nil?
    fail ArgumentError, "Missing the required parameter 'path' when calling PulpAnsibleGalaxyApiCollectionsApi.list_0"
  end
  # resource path
  local_var_path = '/pulp_ansible/galaxy/{path}/api/v3/collections/'.sub('{' + 'path' + '}', CGI.escape(path.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = opts[:'exclude_fields'] if !opts[:'exclude_fields'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

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

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'InlineResponse20013' 

  # auth_names
  auth_names = opts[:auth_names] || ['Basic']

  new_options = opts.merge(
    :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(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PulpAnsibleGalaxyApiCollectionsApi#list_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_with_http_info(path, opts = {}) click to toggle source

View for Collection models. @param path [String] @param [Hash] opts the optional parameters @option opts [Integer] :page A page number within the paginated result set. @option opts [String] :fields A list of fields to include in the response. @option opts [String] :exclude_fields A list of fields to exclude from the response. @return [Array<(InlineResponse20011, Integer, Hash)>] InlineResponse20011 data, response status code and response headers

# File lib/pulp_ansible_client/api/pulp_ansible_galaxy_api_collections_api.rb, line 109
def list_with_http_info(path, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PulpAnsibleGalaxyApiCollectionsApi.list ...'
  end
  # verify the required parameter 'path' is set
  if @api_client.config.client_side_validation && path.nil?
    fail ArgumentError, "Missing the required parameter 'path' when calling PulpAnsibleGalaxyApiCollectionsApi.list"
  end
  # resource path
  local_var_path = '/pulp_ansible/galaxy/{path}/api/v2/collections/'.sub('{' + 'path' + '}', CGI.escape(path.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = opts[:'exclude_fields'] if !opts[:'exclude_fields'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

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

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'InlineResponse20011' 

  # auth_names
  auth_names = opts[:auth_names] || ['Basic']

  new_options = opts.merge(
    :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(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PulpAnsibleGalaxyApiCollectionsApi#list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
read(collection_href, opts = {}) click to toggle source

Get the detail view of a Collection. @param collection_href [String] URI of Collection. e.g.: /pulp_ansible/galaxy/1/api/v2/collections/1/1/ @param [Hash] opts the optional parameters @option opts [String] :fields A list of fields to include in the response. @option opts [String] :exclude_fields A list of fields to exclude from the response. @return [GalaxyCollection]

# File lib/pulp_ansible_client/api/pulp_ansible_galaxy_api_collections_api.rb, line 237
def read(collection_href, opts = {})
  data, _status_code, _headers = read_with_http_info(collection_href, opts)
  data
end
read_with_http_info(collection_href, opts = {}) click to toggle source

Get the detail view of a Collection. @param collection_href [String] URI of Collection. e.g.: /pulp_ansible/galaxy/1/api/v2/collections/1/1/ @param [Hash] opts the optional parameters @option opts [String] :fields A list of fields to include in the response. @option opts [String] :exclude_fields A list of fields to exclude from the response. @return [Array<(GalaxyCollection, Integer, Hash)>] GalaxyCollection data, response status code and response headers

# File lib/pulp_ansible_client/api/pulp_ansible_galaxy_api_collections_api.rb, line 248
def read_with_http_info(collection_href, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PulpAnsibleGalaxyApiCollectionsApi.read ...'
  end
  # verify the required parameter 'collection_href' is set
  if @api_client.config.client_side_validation && collection_href.nil?
    fail ArgumentError, "Missing the required parameter 'collection_href' when calling PulpAnsibleGalaxyApiCollectionsApi.read"
  end
  # resource path
  local_var_path = '{collection_href}'.sub('{' + 'collection_href' + '}', CGI.escape(collection_href.to_s).gsub('%2F', '/'))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

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

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'GalaxyCollection' 

  # auth_names
  auth_names = opts[:auth_names] || ['Basic']

  new_options = opts.merge(
    :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(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PulpAnsibleGalaxyApiCollectionsApi#read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end