class Runcible::Resources::RepositoryGroup

@see docs.pulpproject.org/dev-guide/integration/integration/rest-api/repo/groups/

Public Class Methods

path(id = nil) click to toggle source

Generates the API path for Repository Groups

@param [String] id the ID of the Repository group @return [String] the Repository group path, may contain the id if passed

# File lib/runcible/resources/repository_group.rb, line 11
def self.path(id = nil)
  groups = 'repo_groups/'
  id.nil? ? groups : groups + "#{id}/"
end

Public Instance Methods

associate(id, criteria) click to toggle source

Associates Repositories with a Repository Group

@param [String] id the ID of the Repository group @param [Hash] criteria criteria based on Mongo syntax representing repos to associate @return [RestClient::Response]

# File lib/runcible/resources/repository_group.rb, line 62
def associate(id, criteria)
  call(:post, path(id) + 'actions/associate/', :payload => {:required => criteria})
end
create(id, optional = {}) click to toggle source

Creates a Repository Group

@param [String] id the ID of the group @param [Hash] optional container for all optional parameters @return [RestClient::Response]

# File lib/runcible/resources/repository_group.rb, line 21
def create(id, optional = {})
  required = required_params(binding.send(:local_variables), binding)
  call(:post, path, :payload => { :required => required, :optional => optional })
end
delete(id) click to toggle source

Deletes a Repository Group

@param [String] id the ID of the Repository group @return [RestClient::Response]

# File lib/runcible/resources/repository_group.rb, line 53
def delete(id)
  call(:delete, path(id))
end
publish(id, distributor_id, optional = {}) click to toggle source

Publishes a repository group using the specified distributor

@param [String] id the id of the repository @param [String] distributor_id the id of the distributor @param [Hash] optional optional params @return [RestClient::Response]

# File lib/runcible/resources/repository_group.rb, line 81
def publish(id, distributor_id, optional = {})
  call(:post, "#{path(id)}actions/publish/",
       :payload => {:required => {:id => distributor_id}, :optional => optional})
end
retrieve(id) click to toggle source

Retrieves a Repository Group

@param [String] id the ID of the Repository group @return [RestClient::Response]

# File lib/runcible/resources/repository_group.rb, line 30
def retrieve(id)
  call(:get, path(id))
end
retrieve_all() click to toggle source

Retrieves all Repository Group

@return [RestClient::Response]

# File lib/runcible/resources/repository_group.rb, line 45
def retrieve_all
  call(:get, path)
end
retrieve_distributors(id) click to toggle source

Retrieves a Repository Group's distributors

@param [String] id the ID of the Repository group @return [RestClient::Response]

# File lib/runcible/resources/repository_group.rb, line 38
def retrieve_distributors(id)
  call(:get, path(id) + 'distributors/')
end
unassociate(id, criteria) click to toggle source

Unassociates Repositories with a Repository Group

@param [String] id the ID of the Repository group @param [Hash] criteria criteria based on Mongo syntax representing repos ta unassociate @return [RestClient::Response]

# File lib/runcible/resources/repository_group.rb, line 71
def unassociate(id, criteria)
  call(:post, path(id) + 'actions/unassociate/', :payload => {:required => criteria})
end