Class: NasneChecker::Nasne

Inherits:
Object
  • Object
show all
Defined in:
lib/nasne_checker/nasne.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host) ⇒ Nasne



8
9
10
11
# File 'lib/nasne_checker/nasne.rb', line 8

def initialize(host)
  @host = host
  @clients = {}
end

Instance Attribute Details

#hostObject (readonly)

Returns the value of attribute host.



6
7
8
# File 'lib/nasne_checker/nasne.rb', line 6

def host
  @host
end

Instance Method Details

#hdd_detailObject



34
35
36
37
# File 'lib/nasne_checker/nasne.rb', line 34

def hdd_detail
  hdd = hdd_list[:HDD].select{ |info| info[:registerFlag] == 1 }
  hdd.map {|info| hdd_info(info[:id])[:HDD] }
end

#hdd_info(id) ⇒ Object



30
31
32
# File 'lib/nasne_checker/nasne.rb', line 30

def hdd_info(id)
  get('64210', '/status/HDDInfoGet', id: id).body
end

#hdd_listObject



26
27
28
# File 'lib/nasne_checker/nasne.rb', line 26

def hdd_list
  get('64210', '/status/HDDListGet').body
end

#reserved_listObject



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/nasne_checker/nasne.rb', line 13

def reserved_list
  get(
    '64220', '/schedule/reservedListGet',
    searchCriteria: 0,
    filter: 0,
    startingIndex: 0,
    requestedCount: 0,
    sortCriteria: 0,
    withDescriptionLong: 0,
    withUserData: 1
  ).body
end