2024-06-04 17:38:17 +02:00
|
|
|
from requests.packages import urllib3
|
|
|
|
from mgrctl.settings.platform import (
|
|
|
|
PLATFORM_TYPE,
|
|
|
|
PLATFORM_VERIFY_SSL_WARNING
|
|
|
|
)
|
2024-05-26 16:06:58 +02: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'
|
|
|
|
|
2024-06-04 17:38:17 +02:00
|
|
|
# Internal API url:
|
|
|
|
INPUT_URL = f'http://{INPUT_HOSTNAME}:{INPUT_PORT}'
|
|
|
|
|
2024-05-26 16:06:58 +02:00
|
|
|
# Headers for internal auth:
|
|
|
|
HEADERS = {"Internal-Auth": "on", "Accept": "application/json"}
|
2024-06-04 17:38:17 +02:00
|
|
|
|
|
|
|
# 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
|
|
|
|
)
|