Commit Graph

9 Commits

Author SHA1 Message Date
Harald Welte 69fca4c877 add COPYING + GPL notice to all files that were missing it 2023-06-05 10:40:15 +02:00
Harald Welte c9ae2b0825 apitool: Move ApiClient class to osmocom.lpmgd.client module
This way other code can easily import the API client
2023-06-05 10:37:03 +02:00
Harald Welte fb1b88f5af add GET of individual token or list of all tokens of resource 2023-06-05 10:17:27 +02:00
Harald Welte 11ffb5ca95 add REST + apitool support for listing all resources 2023-06-05 10:05:54 +02:00
Harald Welte 425f84f552 rest_server: fix token release
resource.usage_token_put() works on the Token instance, and not
the uuid string.  So we first need to look-up the Token instance
for the client-provided UUID string, and then we can call
usage_token_put()
2023-06-04 20:40:22 +02:00
Harald Welte 6544151ff9 model: Change resource.usage_tokens from list to dict
this way we can have efficient look-ups by token UUID
2023-06-04 20:39:56 +02:00
Harald Welte 8893527121 UsageToken: fix to_dict() method; return only json-serializable objects
after this commit, the get-usage-token operation via the REST interface
actually works and returns a valid JSON response body
2023-06-04 20:16:27 +02:00
Harald Welte d1ec16e679 model: Fix _validate_status and update_status methods 2023-06-04 20:08:29 +02:00
Harald Welte 3d2692656a directory re-organization: lib as osmocom.lpmgd module 2023-06-04 13:19:48 +02:00