class RhnSatellite::System
Public Class Methods
active?(server_name)
click to toggle source
# File lib/rhn_satellite/system.rb, line 28 def active?(server_name) active_systems.any?{|system| system["name"] =~ /#{server_name}$/ } end
active_systems()
click to toggle source
# File lib/rhn_satellite/system.rb, line 10 def active_systems base.default_call('system.listActiveSystems').to_a end
delete(system_ids)
click to toggle source
# File lib/rhn_satellite/system.rb, line 14 def delete(system_ids) base.default_call('system.deleteSystems',[*system_ids].collect{|i| i.to_i }) end
details(system_id)
click to toggle source
# File lib/rhn_satellite/system.rb, line 18 def details(system_id) base.default_call('system.getDetails',system_id.to_i) end
get_id(name)
click to toggle source
# File lib/rhn_satellite/system.rb, line 6 def get_id(name) base.default_call('system.getId',name) end
latest_available_packages(system_ids)
click to toggle source
# File lib/rhn_satellite/system.rb, line 40 def latest_available_packages(system_ids) base.default_call('system.listLatestAvailablePackages',system_ids).to_a end
latest_installable_packages(system_id)
click to toggle source
# File lib/rhn_satellite/system.rb, line 44 def latest_installable_packages(system_id) base.default_call('system.listLatestInstallablePackages',system_id).to_a end
latest_upgradable_packages(system_id)
click to toggle source
# File lib/rhn_satellite/system.rb, line 48 def latest_upgradable_packages(system_id) base.default_call('system.listLatestUpgradablePackages',system_id).to_a end
newer_installed_packages(system_id,package_name,version,release,epoch)
click to toggle source
# File lib/rhn_satellite/system.rb, line 36 def newer_installed_packages(system_id,package_name,version,release,epoch) base.default_call('system.listNewerInstalledPackages',system_id,package_name,version,release,epoch).to_a end
online?(server_name)
click to toggle source
# File lib/rhn_satellite/system.rb, line 22 def online?(server_name) !(system = get(server_name)).nil? && \ !(sysdetails = details(system['id'])).nil? && \ (sysdetails['osa_status'] == 'online') end
relevant_erratas(system_id)
click to toggle source
# File lib/rhn_satellite/system.rb, line 32 def relevant_erratas(system_id) base.default_call('system.getRelevantErrata',system_id).to_a end
schedule_apply_errata(system_ids,errata_ids,earliest_occurence=nil)
click to toggle source
# File lib/rhn_satellite/system.rb, line 76 def schedule_apply_errata(system_ids,errata_ids,earliest_occurence=nil) base.default_call( 'system.scheduleApplyErrata', *([ [*system_ids].collect{|i| i.to_i }, [*errata_ids].collect{|i| i.to_i }, RhnSatellite::Common::Misc.gen_date_time(earliest_occurence) ].compact)) end
schedule_package_install(system_id,package_ids,earliest_occurence='now')
click to toggle source
# File lib/rhn_satellite/system.rb, line 90 def schedule_package_install(system_id,package_ids,earliest_occurence='now') base.default_call('system.schedulePackageInstall',system_id.to_i,package_ids,RhnSatellite::Common::Misc.gen_date_time(earliest_occurence)) end
schedule_reboot(system_id,earliest_occurence='now')
click to toggle source
# File lib/rhn_satellite/system.rb, line 86 def schedule_reboot(system_id,earliest_occurence='now') base.default_call('system.scheduleReboot',system_id.to_i,RhnSatellite::Common::Misc.gen_date_time(earliest_occurence)) end
schedule_script_run(system_id,user,group,timeout,script,earliest_occurence='now')
click to toggle source
# File lib/rhn_satellite/system.rb, line 94 def schedule_script_run(system_id,user,group,timeout,script,earliest_occurence='now') base.default_call('system.scheduleScriptRun',system_id.to_i,user,group,timeout.to_i,script,RhnSatellite::Common::Misc.gen_date_time(earliest_occurence)) end
schedule_script_runs(system_ids,user,group,timeout,script,earliest_occurence='now')
click to toggle source
# File lib/rhn_satellite/system.rb, line 98 def schedule_script_runs(system_ids,user,group,timeout,script,earliest_occurence='now') base.default_call('system.scheduleScriptRun',system_ids,user,group,timeout.to_i,script,RhnSatellite::Common::Misc.gen_date_time(earliest_occurence)) end
script_action_details(action_id)
click to toggle source
# File lib/rhn_satellite/system.rb, line 106 def script_action_details(action_id) base.default_call('system.getScriptActionDetails',action_id).to_a end
script_results(action_id)
click to toggle source
# File lib/rhn_satellite/system.rb, line 102 def script_results(action_id) base.default_call('system.getScriptResults',action_id).to_a end
set_base_channel(system_id,channel_label)
click to toggle source
# File lib/rhn_satellite/system.rb, line 59 def set_base_channel(system_id,channel_label) base.default_call('system.setBaseChannel',system_id.to_i,channel_label) end
set_child_channels(system_id,child_channel_labels)
click to toggle source
# File lib/rhn_satellite/system.rb, line 69 def set_child_channels(system_id,child_channel_labels) base.default_call('system.setChildChannels',system_id.to_i,child_channel_labels) end
subscribable_base_channels(system_id)
click to toggle source
# File lib/rhn_satellite/system.rb, line 62 def subscribable_base_channels(system_id) base.default_call('system.listSubscribableBaseChannels',system_id.to_i) end
subscribable_child_channels(system_id)
click to toggle source
# File lib/rhn_satellite/system.rb, line 72 def subscribable_child_channels(system_id) base.default_call('system.listSubscribableChildChannels',system_id.to_i) end
subscribed_base_channel(system_id)
click to toggle source
# File lib/rhn_satellite/system.rb, line 56 def subscribed_base_channel(system_id) base.default_call('system.getSubscribedBaseChannel',system_id.to_i) end
subscribed_child_channels(system_id)
click to toggle source
# File lib/rhn_satellite/system.rb, line 66 def subscribed_child_channels(system_id) base.default_call('system.listSubscribedChildChannels',system_id.to_i) end
uptodate?(system_id)
click to toggle source
# File lib/rhn_satellite/system.rb, line 52 def uptodate?(system_id) latest_upgradable_packages(system_id).empty? && relevant_erratas(system_id).empty? end