-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #162 from okurz/feature/dashboard_requests
Extract dashboard helper methods
- Loading branch information
Showing
6 changed files
with
45 additions
and
50 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
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,21 @@ | ||
# Copyright SUSE LLC | ||
# SPDX-License-Identifier: MIT | ||
from typing import Dict | ||
import requests as req | ||
|
||
from . import QEM_DASHBOARD | ||
from .utils import retry5 as requests | ||
|
||
|
||
def get_json(route: str, **kwargs: Dict) -> str: | ||
return requests.get(QEM_DASHBOARD + route, **kwargs).json() | ||
|
||
|
||
def patch(route: str, **kwargs: Dict) -> str: | ||
# openqabot/loader/qem.py originally used req.patch so we will just use that here without retry. Can potentially be changed to used retry5 as requests as | ||
# well | ||
return req.patch(QEM_DASHBOARD + route, **kwargs) | ||
|
||
|
||
def put(route: str, **kwargs: Dict) -> str: | ||
return requests.put(QEM_DASHBOARD + route, **kwargs) |
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
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