You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
768 B
30 lines
768 B
# Copyright (C) 2005-2025 Splunk Inc. All Rights Reserved.
|
|
import splunk.rest as rest
|
|
|
|
|
|
def fetch_services(session_key):
|
|
path = rest.makeSplunkdUri() + 'servicesNS/nobody/SA-ITOA/itoa_interface/service'
|
|
fields = [
|
|
'title',
|
|
'_key',
|
|
'kpis.title',
|
|
'kpis._key',
|
|
'kpis.type',
|
|
'kpis.unit',
|
|
'kpis.search_time_series',
|
|
'kpis.search_alert_earliest'
|
|
]
|
|
getargs = {
|
|
'fields': ','.join(fields),
|
|
'sort_key': 'identifying_name',
|
|
'sort_dir': 'asc'
|
|
}
|
|
response, content = rest.simpleRequest(
|
|
path,
|
|
method='GET',
|
|
getargs=getargs,
|
|
sessionKey=session_key,
|
|
raiseAllErrors=False
|
|
)
|
|
return {'response': response, 'content': content}
|