Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a9315f7

Browse files
author
tywatts
committedAug 21, 2024
Allow for non default port grafana instances for get_snapshot_by_key
1 parent 2a22146 commit a9315f7

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed
 

‎GrafanaSnapshot/feature/base.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
class Base(object):
2-
def __init__(self, api, host, protocol):
2+
def __init__(self, api, host, protocol, port=3000):
33
self.api = api
44
self.host = host
55
self.protocol = protocol
6+
self.port = port

‎GrafanaSnapshot/feature/snapshots.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def get_snapshot_by_key(self, key):
5151
snapshot_list = []
5252
for snapshot in snapshot:
5353
if key in snapshot["name"]:
54-
url=snapshot["name"]+" : "+self.protocol+"://"+self.host+":3000/dashboard/snapshot/"+snapshot["key"]
54+
url=snapshot["name"]+" : "+self.protocol+"://"+self.host+":"+str(self.port)+"/dashboard/snapshot/"+snapshot["key"]
5555
snapshot_list.append(url)
5656

5757
return snapshot_list

‎GrafanaSnapshot/snapshot_face.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ def __init__(
3232
protocol=protocol,
3333
verify=verify,
3434
)
35-
self.snapshots = Snapshots(self.api, host, protocol)
35+
self.snapshots = Snapshots(self.api, host, protocol, port)

0 commit comments

Comments
 (0)
Please sign in to comment.