Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import json
import logging
import datetime
import os
import sys
# CloudGenix SDK
import cloudgenix
# bar
from progressbar import Bar, ETA, Percentage, ProgressBar
# Global Vars
TIME_BETWEEN_API_UPDATES = 60 # seconds
REFRESH_LOGIN_TOKEN_INTERVAL = 7 # hours
SCRIPT_VERSION = cloudgenix.version
SCRIPT_NAME = 'CloudGenix Site Interface info -> CSV Generator'
# Set NON-SYSLOG logging to use function name
logger = logging.getLogger(__name__)
####################################################################
# Read cloudgenix_settings file for auth token or username/password
####################################################################
sys.path.append(os.getcwd())
try:
from cloudgenix_settings import CLOUDGENIX_AUTH_TOKEN
except ImportError:
# Get AUTH_TOKEN/X_AUTH_TOKEN from env variable, if it exists. X_AUTH_TOKEN takes priority.
if "X_AUTH_TOKEN" in os.environ:
SOFTWARE.
"""
# standard modules
import argparse
import logging
# CloudGenix Python SDK
import cloudgenix
# alias JSON pretty printer (jd), and JSON Detailed pretty printer (jd_detailed) from cloudgenix SDK.
jd = cloudgenix.jd
jd_detailed = cloudgenix.jd_detailed
# Global Vars
SDK_VERSION = cloudgenix.version
SCRIPT_NAME = 'CloudGenix Python SDK demo'
# Set logging to use function name
logger = logging.getLogger(__name__)
############################################################################
# Begin Script, parse arguments.
############################################################################
# Parse arguments
parser = argparse.ArgumentParser(description="{0}.".format(SCRIPT_NAME))
# Allow Controller modification and debug level sets.
controller_group = parser.add_argument_group('API', 'These options change how this program connects to the API.')
controller_group.add_argument("--controller", "-C",