Class: Runcible::Resources::RepositoryGroup

Inherits:
Base
  • Object
show all
Defined in:
lib/runcible/resources/repository_group.rb

Overview

Class Method Summary collapse

Methods inherited from Base

add_http_auth_header, add_oauth_header, call, combine_get_params, config, config=, generate_log_message, generate_payload, get_response, log_debug, log_exception, process_response, required_params

Class Method Details

.associate(id, criteria) ⇒ RestClient::Response

Associates Repositories with a Repository Group

Parameters:

  • id (String)

    the ID of the Repository group

  • criteria (Hash)

    criteria based on Mongo syntax representing repos to associate

Returns:

  • (RestClient::Response)


78
79
80
# File 'lib/runcible/resources/repository_group.rb', line 78

def self.associate(id, criteria)
  call(:post, path(id) + "actions/associate/", :payload => {:required => criteria})
end

.create(id, optional = {}) ⇒ RestClient::Response

Creates a Repository Group

Parameters:

  • id (String)

    the ID of the group

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

    container for all optional parameters

Returns:

  • (RestClient::Response)


45
46
47
48
# File 'lib/runcible/resources/repository_group.rb', line 45

def self.create(id, optional={})
  required = required_params(binding.send(:local_variables), binding)
  call(:post, path, :payload => { :required => required, :optional => optional })
end

.delete(id) ⇒ RestClient::Response

Deletes a Repository Group

Parameters:

  • id (String)

    the ID of the Repository group

Returns:

  • (RestClient::Response)


69
70
71
# File 'lib/runcible/resources/repository_group.rb', line 69

def self.delete(id)
  call(:delete, path(id))
end

.path(id = nil) ⇒ String

Generates the API path for Repository Groups

Parameters:

  • id (String) (defaults to: nil)

    the ID of the Repository group

Returns:

  • (String)

    the Repository group path, may contain the id if passed



35
36
37
38
# File 'lib/runcible/resources/repository_group.rb', line 35

def self.path(id=nil)
  groups = "repo_groups/"
  id.nil? ? groups : groups + "#{id}/"
end

.retrieve(id) ⇒ RestClient::Response

Retrieves a Repository Group

Parameters:

  • id (String)

    the ID of the Repository group

Returns:

  • (RestClient::Response)


54
55
56
# File 'lib/runcible/resources/repository_group.rb', line 54

def self.retrieve(id)
  call(:get, path(id))
end

.retrieve_allRestClient::Response

Retrieves all Repository Group

Returns:

  • (RestClient::Response)


61
62
63
# File 'lib/runcible/resources/repository_group.rb', line 61

def self.retrieve_all
  call(:get, path)
end

.unassociate(id, criteria) ⇒ RestClient::Response

Unassociates Repositories with a Repository Group

Parameters:

  • id (String)

    the ID of the Repository group

  • criteria (Hash)

    criteria based on Mongo syntax representing repos ta unassociate

Returns:

  • (RestClient::Response)


87
88
89
# File 'lib/runcible/resources/repository_group.rb', line 87

def self.unassociate(id, criteria)
  call(:post, path(id) + "actions/unassociate/", :payload => {:required => criteria})
end