-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: hide elements for cloud or enterprise (#1364)
**Issue number:** https://splunk.atlassian.net/browse/ADDON-74887 ## Summary ### Changes Adds ability to hide: 1. form fields 2. tabs 3. services based on platform (cloud vs enterprise) schema changes: - adds `hideForPlatform` ('cloud' or 'enterprise') that hides this specific element if platform matches declared one there is a usage of `| rest/services/server/info splunk_server=local` search to get information about platform. > Please provide a summary of what's being changed ### User experience > Please describe what the user experience looks like before and after this change ## Checklist If your change doesn't seem to apply, please leave them unchecked. * [x] I have performed a self-review of this change * [x] Changes have been tested * [x] Changes are documented * [x] PR title follows [conventional commit semantics](https://www.conventionalcommits.org/en/v1.0.0/) --------- Signed-off-by: Viktor Tsvetkov <[email protected]> Co-authored-by: Viktor Tsvetkov <[email protected]>
- Loading branch information
1 parent
82f822b
commit 21aa28f
Showing
49 changed files
with
1,834 additions
and
165 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
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
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
47 changes: 47 additions & 0 deletions
47
...cted_output_global_config_everything/Splunk_TA_UCCExample/bin/service_hidden_for_cloud.py
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,47 @@ | ||
import import_declare_test | ||
|
||
import json | ||
import sys | ||
|
||
from splunklib import modularinput as smi | ||
|
||
|
||
class SERVICE_HIDDEN_FOR_CLOUD(smi.Script): | ||
def __init__(self): | ||
super(SERVICE_HIDDEN_FOR_CLOUD, self).__init__() | ||
|
||
def get_scheme(self): | ||
scheme = smi.Scheme('service_hidden_for_cloud') | ||
scheme.description = 'Service hidden for cloud' | ||
scheme.use_external_validation = True | ||
scheme.streaming_mode_xml = True | ||
scheme.use_single_instance = False | ||
|
||
scheme.add_argument( | ||
smi.Argument( | ||
'name', | ||
title='Name', | ||
description='Name', | ||
required_on_create=True | ||
) | ||
) | ||
return scheme | ||
|
||
def validate_input(self, definition: smi.ValidationDefinition): | ||
return | ||
|
||
def stream_events(self, inputs: smi.InputDefinition, ew: smi.EventWriter): | ||
input_items = [{'count': len(inputs.inputs)}] | ||
for input_name, input_item in inputs.inputs.items(): | ||
input_item['name'] = input_name | ||
input_items.append(input_item) | ||
event = smi.Event( | ||
data=json.dumps(input_items), | ||
sourcetype='service_hidden_for_cloud', | ||
) | ||
ew.write_event(event) | ||
|
||
|
||
if __name__ == '__main__': | ||
exit_code = SERVICE_HIDDEN_FOR_CLOUD().run(sys.argv) | ||
sys.exit(exit_code) |
Oops, something went wrong.