Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for non default port grafana instances for get_snapshot_by_key #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion GrafanaSnapshot/feature/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class Base(object):
def __init__(self, api, host, protocol):
def __init__(self, api, host, protocol, port=3000):
self.api = api
self.host = host
self.protocol = protocol
self.port = port
2 changes: 1 addition & 1 deletion GrafanaSnapshot/feature/snapshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def get_snapshot_by_key(self, key):
snapshot_list = []
for snapshot in snapshot:
if key in snapshot["name"]:
url=snapshot["name"]+" : "+self.protocol+"://"+self.host+":3000/dashboard/snapshot/"+snapshot["key"]
url=snapshot["name"]+" : "+self.protocol+"://"+self.host+":"+str(self.port)+"/dashboard/snapshot/"+snapshot["key"]
snapshot_list.append(url)

return snapshot_list
Expand Down
2 changes: 1 addition & 1 deletion GrafanaSnapshot/snapshot_face.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ def __init__(
protocol=protocol,
verify=verify,
)
self.snapshots = Snapshots(self.api, host, protocol)
self.snapshots = Snapshots(self.api, host, protocol, port)