Class: OffTheGrid::HostGroup

Inherits:
NamedResource show all
Defined in:
lib/off_the_grid/host_group.rb

Overview

A class to represent SGE Host Groups

Instance Attribute Summary

Attributes inherited from NamedResource

#name

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from NamedResource

#initialize

Methods included from GridResource

#<=>, #delete, #extract_detail, #new?, #save, #validate_before_delete, #validate_before_save

Constructor Details

This class inherits a constructor from OffTheGrid::NamedResource

Class Method Details

.listObject

Get the list of SGE host groups



5
6
7
# File 'lib/off_the_grid/host_group.rb', line 5

def self.list
  `qconf -shgrpl`.chomp.split("\n").sort.collect { |name| new(name) }
end

Instance Method Details

#as_treeObject



13
14
15
# File 'lib/off_the_grid/host_group.rb', line 13

def as_tree
  `qconf -shgrp_tree #{name}`.chomp
end

#detailsObject



9
10
11
# File 'lib/off_the_grid/host_group.rb', line 9

def details
  `qconf -shgrp #{name}`.chomp
end

#hostsObject



17
18
19
# File 'lib/off_the_grid/host_group.rb', line 17

def hosts
  extract_detail(:hostlist).map { |host| ExecuteHost.new(host) }
end