-
Notifications
You must be signed in to change notification settings - Fork 7
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 #5 from ascendcorp/feature/refactor-structure
Feature/refactor structure
- Loading branch information
Showing
13 changed files
with
85 additions
and
72 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,3 +1,2 @@ | ||
# -*- coding: utf-8 -*- | ||
from .GenerateSnapshot import GenerateSnapshot | ||
from .DeleteSnapshot import DeleteSnapshot | ||
from .snapshot_face import SnapshotFace |
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,2 @@ | ||
from .base import Base | ||
from .snapshots import Snapshots |
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,3 @@ | ||
class Base(object): | ||
def __init__(self, api): | ||
self.api = api |
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,36 @@ | ||
from grafana_api.grafana_face import GrafanaFace | ||
|
||
from .feature import ( | ||
Snapshots, | ||
) | ||
|
||
|
||
class SnapshotFace: | ||
def __init__( | ||
self, | ||
auth, | ||
host="localhost", | ||
port=None, | ||
url_path_prefix="", | ||
protocol="https", | ||
verify=False, | ||
): | ||
""" | ||
Init auth | ||
:param auth: API Token (https://grafana.com/docs/http_api/auth/#create-api-token) | ||
:param host: Host of the API server Ex. 127.0.0.1 | ||
:param port: Ex. 3000 (default port) | ||
:param protocol: http or https | ||
.. code-block:: python | ||
grafana = GenerateSnapshot(auth='', host='xx', port=3000, protocol="https") | ||
""" | ||
self.api = GrafanaFace( | ||
auth, | ||
host=host, | ||
port=port, | ||
url_path_prefix=url_path_prefix, | ||
protocol=protocol, | ||
verify=verify, | ||
) | ||
|
||
self.snapshots = Snapshots(self.api) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
unittest-xml-reporting | ||
urllib3 | ||
requests | ||
pytest | ||
|
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