backend_confs¶
BackendConf(url, username, password)
¶
Base Class to fetch configurations from rest endpoint. The classes need management url & session_id of the splunk to fetch the configurations.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url |
management url of the Splunk instance. |
required | |
username |
username of the Splunk instance |
required | |
password |
password of the Splunk instance |
required |
Source code in pytest_splunk_addon_ui_smartx/backend_confs.py
30 31 32 33 34 35 36 37 38 |
|
parse_conf(json_res, single_stanza=False)
¶
Parse the json result in to the configuration dictionary :param json_res: the json_res got from the request :returns: dictionary
Source code in pytest_splunk_addon_ui_smartx/backend_confs.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
|
rest_call(url)
¶
rest call to the splunk rest-endpoint :param url: url to call :returns: json result of the request
Source code in pytest_splunk_addon_ui_smartx/backend_confs.py
40 41 42 43 44 45 46 47 48 49 50 51 |
|
rest_call_delete(url)
¶
rest call to the splunk rest-endpoint :param url: url to call :returns: json result of the request
Source code in pytest_splunk_addon_ui_smartx/backend_confs.py
70 71 72 73 74 75 76 77 78 79 |
|
rest_call_post(url, kwargs)
¶
rest call to the splunk rest-endpoint :param url: url to call :returns: json result of the request
:param kwargs: body of request method
:returns: json result of the request
Source code in pytest_splunk_addon_ui_smartx/backend_confs.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
|
ListBackendConf(url, username, password)
¶
Bases: BackendConf
For the configuration which can have more than one stanzas. The list will be fetched from endpoint/ and a specific stanza will be fetched from endpoint/{stanza_name}
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url |
management url of the Splunk instance. |
required | |
username |
username of the Splunk instance |
required | |
password |
password of the Splunk instance |
required |
Source code in pytest_splunk_addon_ui_smartx/backend_confs.py
30 31 32 33 34 35 36 37 38 |
|
delete_all_stanzas(query=None)
¶
Delete all stanza from the configuration. :query: query params for filter the stanza :returns: json result of the request
Source code in pytest_splunk_addon_ui_smartx/backend_confs.py
146 147 148 149 150 151 152 153 154 |
|
delete_stanza(stanza)
¶
Delete a specific stanza of the configuration. :param stanza: stanza to delete :returns: json result of the request
Source code in pytest_splunk_addon_ui_smartx/backend_confs.py
156 157 158 159 160 161 162 163 |
|
get_all_stanzas(query=None)
¶
Get list of all stanzas of the configuration :query: query params for filter the stanza :returns: dictionary {stanza: {param: value, … }, … }
Source code in pytest_splunk_addon_ui_smartx/backend_confs.py
108 109 110 111 112 113 114 115 116 117 118 |
|
get_stanza(stanza, decrypt=False)
¶
Get a specific stanza of the configuration. :param stanza: stanza to fetch :returns: dictionary {param: value, … }
Source code in pytest_splunk_addon_ui_smartx/backend_confs.py
120 121 122 123 124 125 126 127 128 129 130 131 132 |
|
get_stanza_value(stanza, param, decrypt=False)
¶
Get value of a specific parameter from a stanza :param stanza: str The Stanza we are interested in :param param: the parameter to fetch :returns: str value
Source code in pytest_splunk_addon_ui_smartx/backend_confs.py
165 166 167 168 169 170 171 172 173 |
|
post_stanza(url, kwargs)
¶
Create a specific stanza of the configuration. :param url: url to call :returns: json result of the request
:param kwargs: body of request method
:returns: json result of the request
Source code in pytest_splunk_addon_ui_smartx/backend_confs.py
134 135 136 137 138 139 140 141 142 143 144 |
|
SingleBackendConf(url, username, password)
¶
Bases: BackendConf
For the configurations which can only have one stanza. for example, logging.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url |
management url of the Splunk instance. |
required | |
username |
username of the Splunk instance |
required | |
password |
password of the Splunk instance |
required |
Source code in pytest_splunk_addon_ui_smartx/backend_confs.py
30 31 32 33 34 35 36 37 38 |
|
get_parameter(param, decrypt=False)
¶
Get value of a specific parameter from the stanza :param param: the parameter to fetch :returns: str value
Source code in pytest_splunk_addon_ui_smartx/backend_confs.py
192 193 194 195 196 197 198 199 |
|
get_stanza(decrypt=False)
¶
Get the values of the Stanza from the configuration :returns: dictionary {param: value, … }
Source code in pytest_splunk_addon_ui_smartx/backend_confs.py
181 182 183 184 185 186 187 188 189 190 |
|
update_parameters(kwargs)
¶
Updates the values of the stanza in the configuration :param kwargs: body of request method :returns: json result of the request
Source code in pytest_splunk_addon_ui_smartx/backend_confs.py
201 202 203 204 205 206 207 208 |
|