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

List saved queries in views and repos #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions src/humiolib/HumioClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -832,15 +832,15 @@ def create_saved_query(self, query_name, query_string):

def _list_saved_queries(self):
"""
List saved queries on repository
List saved queries on repository or view

:return: Response to web request
:rtype: Response Object
"""

headers = self._default_user_headers
request = {
"query": "query {{repository(name: {}){{savedQueries {{ id, name, displayName, query {{queryString}} }} }} }}".format(
"query": "query {{searchDomain(name: {}){{savedQueries {{ id, name, displayName, query {{queryString}} }} }} }}".format(
json.dumps(self.repository)
),
"variables": None,
Expand All @@ -849,14 +849,14 @@ def _list_saved_queries(self):

def list_saved_queries(self):
"""
List saved queries on repository
List saved queries on repository or view

:return: Response to web request as json string
:rtype: str
"""

resp = self._list_saved_queries()
return resp.json()["data"]["repository"]["savedQueries"]
return resp.json()["data"]["searchDomain"]["savedQueries"]

def _update_saved_query(self, query_id, updated_query_name, updated_query_string):
"""
Expand Down