for reservable nodes - granularity still hardwired in PLC/Leases
[plcapi.git] / PLC / Methods / GetLeaseGranularity.py
1 # $Id$
2 # $URL$
3 from PLC.Method import Method
4 from PLC.Auth import Auth
5 from PLC.Faults import *
6 from PLC.Parameter import Parameter
7 from PLC.Leases import Lease
8
9 class GetLeaseGranularity(Method):
10     """
11     Returns the granularity in seconds for the reservation system
12     """
13
14     roles = ['admin', 'pi', 'user', 'tech', 'node', 'anonymous']
15
16     accepts = [
17         Auth(),
18         ]
19
20     # for now only return /etc/myplc-release verbatim
21     returns = Parameter (int, "the granularity in seconds for the reservation system")
22
23     def call(self, auth):
24
25         return Lease.granularity