-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-writing main branch history to be common with next branch
- Loading branch information
1 parent
3d2149e
commit 87e5df5
Showing
10 changed files
with
251 additions
and
335 deletions.
There are no files selected for viewing
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,14 +1,4 @@ | ||
# File: __init__.py | ||
# | ||
# Copyright (c) 2021 Splunk Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software distributed under | ||
# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
# either express or implied. See the License for the specific language governing permissions | ||
# and limitations under the License. | ||
# Licensed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt) |
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# File: query_view.py | ||
# Copyright (c) 2021 Splunk Inc. | ||
# | ||
# Licensed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt) | ||
|
||
|
||
def get_ctx_result(result): | ||
ctx_result = {} | ||
param = result.get_param() | ||
summary = result.get_summary() | ||
data = result.get_data() | ||
|
||
ctx_result['param'] = param | ||
|
||
if (data): | ||
ctx_result['data'] = data[0] | ||
|
||
if (summary): | ||
ctx_result['summary'] = summary | ||
|
||
return ctx_result | ||
|
||
|
||
def display_attributes(provides, all_app_runs, context): | ||
context['results'] = results = [] | ||
context['attributes'] = [] | ||
print("DEBUG all_app_runs = {}".format(all_app_runs)) | ||
for summary, action_results in all_app_runs: | ||
for result in action_results: | ||
ctx_result = get_ctx_result(result) | ||
if (not ctx_result): | ||
continue | ||
results.append(ctx_result) | ||
print("DEBUG ctx_result = {}".format(ctx_result)) | ||
|
||
# populate keys into 'attributes' variable for django template | ||
try: | ||
for n in list(ctx_result['data']['entries'][0]['attributes'].keys()): | ||
if n not in context['attributes']: | ||
context['attributes'].append(n) | ||
except Exception as e: | ||
context['attributes'] = False | ||
context['error'] = str(e) | ||
|
||
return 'display_attributes.html' |
Oops, something went wrong.