source: trunk/examples/new_interface.py @ 329

Last change on this file since 329 was 286, checked in by bas, 11 years ago

PBSacct framework for accounting records, beta
list some changes

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 927 bytes
Line 
1#!/usr/bin/env python
2#
3# Author: Bas van der Vlies <basv@sara.nl>
4# Date  : 02 March 2005
5# Desc. : Usage of the new PBSQuery module
6#
7# SVN info:
8# $Id: new_interface.py 286 2012-12-20 11:01:00Z bas $
9#
10#
11#
12
13import pbs
14from PBSQuery import PBSQuery
15from PBSQuery import PBSError
16
17import sys
18
19def main():
20
21  p = PBSQuery()
22  p.new_data_structure()
23
24  #job = p.getjob('2983215')
25  #print job['substate']
26  #print job.substate
27  #print job.queue
28  #print job.Resource_List
29  #print job.Resource_List.nodes
30  #print job.Resource_List.arch
31  #print job.Variable_List.PBS_O_HOME
32
33  l = ['np', 'state' ]
34  node = p.getnode("gb-r5n1", l)
35  print node.name, node['np']
36
37  sys.exit(0)
38
39  #nodes = p.getnodes(l)
40  for id in nodes:
41        print id
42
43        try:
44                print nodes[id].np
45                print nodes[id].status.arch
46                print nodes[id].status.uname
47                print nodes[id].state
48        except PBSError, detail:
49                print detail
50                pass
51       
52     #for attrib in nodes[id]:
53     #  print attrib, nodes[id][attrib]
54
55main()
Note: See TracBrowser for help on using the repository browser.