Esempio n. 1
0
 def post(self):
     print('params', self.params)
     if self.params.a != 1:
         raise params.InvalidParams('a != 1')
     if self.params.b and self.params.b != 'b':
         raise params.InvalidParams('b != b')
     return self.write(str(self.params))
Esempio n. 2
0
 def get(self, mac):
     try:
         mac_field.validate(mac)
     except ValueError as e:
         raise params.InvalidParams('invalid mac: {}'.format(e))
     print mac
     self.write(mac)
Esempio n. 3
0
 def get(self):
     print('params', self.params)
     if self.params.a != 1:
         raise params.InvalidParams('a != 1')
     return self.write(str(self.params))
Esempio n. 4
0
 def post(self):
     print('params', self.params)
     if 'a' not in self.params:
         raise params.InvalidParams('no a')
     return self.write(str(self.params))