isp-maintenance/mgrctl/settings/api.py

26 lines
729 B
Python
Raw Normal View History

from requests.packages import urllib3
from mgrctl.settings.platform import (
PLATFORM_TYPE,
PLATFORM_VERIFY_SSL_WARNING
)
2024-05-26 22:06:58 +08:00
# Name of nginx container:
INPUT_HOSTNAME = 'input' if PLATFORM_TYPE == 'vm' else 'dci_input_1'
# Port that nginx container is listening:
INPUT_PORT = '1500'
# Internal API url:
INPUT_URL = f'http://{INPUT_HOSTNAME}:{INPUT_PORT}'
2024-05-26 22:06:58 +08:00
# Headers for internal auth:
HEADERS = {"Internal-Auth": "on", "Accept": "application/json"}
# Suppress warning from urllib3:
if not PLATFORM_VERIFY_SSL_WARNING:
# ! This is not recommended,
# ! the user will not see a message about an untrusted SSL connection
urllib3.disable_warnings(
category=urllib3.exceptions.InsecureRequestWarning
)