Class: Pulp::Repository

Inherits:
Connection::Base show all
Defined in:
lib/pulp/repository.rb

Overview

Create Repository:

Minimum Options to create a repository:
r = Pulp::Repository.create(:feed => "http://mirror.switch.ch/ftp/mirror/epel/6/x86_64/", :id => 'epel-6-x86_64', :name => 'epel-6-x86_64', :arch => 'x86_64')

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Connection::Base

base, base_delete, base_get, base_post, base_put, base_unparsed_delete, base_unparsed_get, base_unparsed_post, base_unparsed_put, identifier, #initialize, merge_params, parse_item_cmd, plain_base, plain_get, plain_unparsed_get, reset, #set_fields

Methods included from Common::Lifecycle

#fields, included, #locked_fields, #record_fields, #special_fields, #user_fields

Constructor Details

This class inherits a constructor from Pulp::Connection::Base

Class Method Details

.schedulesObject



63
64
65
# File 'lib/pulp/repository.rb', line 63

def self.schedules
  self.base_get('schedules/')
end

Instance Method Details

#add_note(key, note) ⇒ Object



92
93
94
95
96
# File 'lib/pulp/repository.rb', line 92

def add_note(key,note)
  self.class.base_unparsed_post('notes/',self.id,{:key => key, :value => note})
  refresh
  self
end

#delete_note(key) ⇒ Object



98
99
100
101
102
# File 'lib/pulp/repository.rb', line 98

def delete_note(key)
  self.class.base_unparsed_delete("notes/#{key}/",self.id)
  refresh
  self
end

#delete_schedule(type) ⇒ Object



80
81
82
# File 'lib/pulp/repository.rb', line 80

def delete_schedule(type)
  self.class.base_delete("schedules/#{type}/",id)
end

#delete_sync_scheduleObject



84
85
86
# File 'lib/pulp/repository.rb', line 84

def delete_sync_schedule
  delete_schedule('sync')
end

#get_schedule(type) ⇒ Object



72
73
74
# File 'lib/pulp/repository.rb', line 72

def get_schedule(type)
  self.class.base_get("schedules/#{type}/",id)
end

#get_sync_scheduleObject



76
77
78
# File 'lib/pulp/repository.rb', line 76

def get_sync_schedule
  get_schedule('sync')
end

#update_note(key, new_value) ⇒ Object



104
105
106
107
108
# File 'lib/pulp/repository.rb', line 104

def update_note(key,new_value)
  self.class.base_unparsed_put("notes/#{key}/",self.id,new_value)
  refresh
  self
end

#update_schedule(type, schedule) ⇒ Object



88
89
90
# File 'lib/pulp/repository.rb', line 88

def update_schedule(type,schedule)
  self.class.base_put("schedules/#{type}/",id,{:schedule => schedule})
end

#update_sync_schedule(schedule) ⇒ Object



68
69
70
# File 'lib/pulp/repository.rb', line 68

def update_sync_schedule(schedule)
  update_schedule('sync',schedule)
end