Your ROOT_URL in app.ini is https://git.bwnetwork.us/ but you are visiting http://git.bwnetwork.us/Administrator/Splunk_Docker/src/commit/d59c1fc90e884995e54f8d3731547e612a54c162/files/splunk-etc/apps/splunk-rolling-upgrade/bin/upgrade_shc.py You should set ROOT_URL correctly, otherwise the web may not work correctly.

48 lines
1.5 KiB

import os
import sys
from typing import Optional
current_path = os.path.dirname(os.path.realpath(__file__))
app_specific_lib_path = os.path.join(current_path, "..", "lib")
sys.path.insert(0, app_specific_lib_path)
import logging
from splunkupgrade.utils.logger_utils import (
initialize_logger_for_rest_endpoints,
)
initialize_logger_for_rest_endpoints()
from splunkupgrade.processors.shc.shc_upgrade_rest_processor import ShcUpgradeRestProcessor
from splunkupgrade.utils.types import JsonObject
from splunk.persistconn.application import PersistentServerConnectionApplication
logger = logging.getLogger(__name__)
class UpgradeShcRestEndpoint(PersistentServerConnectionApplication):
def __init__(
self,
_command_line: Optional[str] = None,
_command_arg: Optional[str] = None,
):
super(PersistentServerConnectionApplication, self).__init__()
# Handle a syncronous from splunkd.
def handle(self, in_string: bytes) -> JsonObject:
"""
Called for a simple synchronous request.
@param in_string: request data passed in
@rtype: string or dict
@return: String to return in response. If a dict was passed in,
it will automatically be JSON encoded before being returned.
"""
return ShcUpgradeRestProcessor().handle(in_string)
def done(self):
"""
Virtual method which can be optionally overridden to receive a
callback after the request completes.
"""
pass

Powered by BW's shoe-string budget.