You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
logger.error("POST request failed with status_code=%s, reason=%s, text=%s on url=%s"% (attempt.status_code, attempt.reason, attempt.text, url))
100
101
yield {'result': 'Unknown failure, received a non-200 response code of %s on the url %s, reason %s, text result is %s'% (attempt.status_code, url, attempt.reason, attempt.text)}
Copy file name to clipboardExpand all lines: bin/splunkversioncontrol_backup.py
+11-2Lines changed: 11 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,12 @@
47
47
<title>gitRepoURL</title>
48
48
<description>git repository URL to store the objects (SSH URL only)</description>
49
49
</arg>
50
+
<arg name="sslVerify">
51
+
<title>sslVerify</title>
52
+
<description>Set to 'true' or 'false' to enable/disable SSL verification for REST requests to `srcUrl`. Set to a path to specify a file with valid CA. (https://2.python-requests.org/en/master/user/advanced/#ssl-cert-verification)</description>
53
+
<validation>is_bool('sslVerify')</validation>
54
+
<required_on_create>false</required_on_create>
55
+
</arg>
50
56
<arg name="noPrivate">
51
57
<title>noPrivate</title>
52
58
<description>disable the backup of user level / private objects (true/false), default false</description>
@@ -203,10 +209,13 @@ def validate_arguments():
203
209
else:
204
210
ssh_command="ssh"
205
211
212
+
sslVerify=False
213
+
if'sslVerify'inval_data:
214
+
sslVerify=val_data['sslVerify']
215
+
206
216
#Run a sanity check and make sure we can connect into the remote Splunk instance
logger.fatal("i=\"%s\" Could not obtain a list of all apps, URL=%s statuscode=%s reason=%s, response=\"%s\""% (self.stanzaName, url, res.status_code, res.reason, res.text))
logger.debug("Now running query against url=%s to obtain config information"% (url))
106
106
107
-
res=self.runHttpRequest(url, headers, None, "get", "querying the inputs for splunkversioncontrol_restore with name %s"% (splunk_vc_name))
107
+
res=self.runHttpRequest(url, headers, None, "get", "querying the inputs for splunkversioncontrol_restore with name %s"% (splunk_vc_name), sslVerify=sslVerify)
logger.warn("Warning invalid kvstore data, will wipe it and continue in collection splunkversioncontrol_rest_restore_status on url=%s, value returned res=\"%s\""% (url, payload))
logger.warn("Found existing entry from %s but time is %s, this is past the limit of current time minus %s (%s)"% (kvstore_start_time, curtime, time_wait, target_time))
218
225
#More than 10 minutes ago, delete the entry and move on
219
-
self.runHttpRequest(url, headers, None, "delete", "wiping kvstore splunkversioncontrol_rest_restore_status due to record %s older than %s time period"% (kvstore_start_time, target_time))
226
+
self.runHttpRequest(url, headers, None, "delete", "wiping kvstore splunkversioncontrol_rest_restore_status due to record %s older than %s time period"% (kvstore_start_time, target_time), sslVerify=sslVerify)
220
227
else:
221
228
removal_target=kvstore_start_time+time_wait+1
222
229
logger.warn("Attempted to run but found a running restore instance with time=%s and current_time=%s, will delete and move on after current_time_minus=%s seconds (override_time=%s)"% (kvstore_start_time, curtime, time_wait, removal_target))
self.response.write("Restore has failed to complete successfully in app %s, object of type %s, with name %s, from tag %s, scope %s with restoreAsUser %s and your username of %s. Message is %s"% (app, type, obj_name, tag, scope, restoreAsUser, username, message))
240
247
logger.warn("Restore has failed to complete successfully in app=%s, object of type=%s, with name=%s, from tag=%s, scope=%s with restoreAsUser=%s and requested by username=%s, message=%s"% (app, type, obj_name, tag, scope, restoreAsUser, username, message))
241
248
242
-
self.runHttpRequest(url, headers, None, 'delete', 'wiping kvstore splunkversioncontrol_rest_restore_status after completed run')
0 commit comments