-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added more fields and missing API file
- Loading branch information
Soufiane Jounaid
committed
Mar 29, 2024
1 parent
18483eb
commit e351c0a
Showing
4 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import requests | ||
import json | ||
from django.conf import settings | ||
import logging | ||
|
||
logger = logging.getLogger("default") | ||
|
||
|
||
class EDGE_HW_API: | ||
def get_devices(self): | ||
url = self.make_url("devices") | ||
logger.info("Requesting %s from Edge HW API ...", url) | ||
resp = requests.get(url) | ||
logger.info("Response received. Parsing to json ...") | ||
return resp.json() | ||
|
||
def make_url(self, endpoint): | ||
return "{0}/{1}".format(settings.EDGE_HW_ROOT, endpoint) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters