# Add here any global default values that apply for any ODL release
# -----------------------------------------------------------------

# What release to use. Choices are:
#
#   carbon-snapshot-0.6.0    (master)
#   boron-snapshot-0.5.2     (stable/boron)
#   boron-0.5.1-SR1
#   boron-0.5.0
#   beryllium-snapshot-0.4.5 (stable/beryllium)
#   beryllium-0.4.4-SR4
#   beryllium-0.4.3-SR3
#   beryllium-0.4.2-SR2
#   beryllium-0.4.1-SR1
#   beryllium-0.4.0
#   lithium-0.3.4-SR4      (SR4)
#   lithium-0.3.3-SR3      (SR3)
#   lithium-0.3.2-SR2      (SR2)
#   lithium-0.3.1-SR1      (SR1)
#   helium-0.2.3-SR3

ODL_RELEASE=${ODL_RELEASE:-carbon-snapshot-0.6.0}

# The IP address of ODL. Set this in local.conf.
ODL_MGR_IP=${ODL_MGR_IP:-$SERVICE_HOST}

# The list of IP addresses used as OVS manager, separated by a comma.
# In non-clustering cases, this is normally the same as ODL_MGR_IP. However,
# for HA deployments the southbound portion to ODL is expected to
# use the ip addresses of the ODL instances instead of a single vip. That
# enables OVS to simultaneouly connect to more than one ODL instance.
# Example of expected format: ODL_OVS_MANAGERS=1.1.1.1,2.2.2.2,3.3.3.3
ODL_OVS_MANAGERS=${ODL_OVS_MANAGERS:-$ODL_MGR_IP}

# The default ODL port for Tomcat to use
# NOTE: We make this configurable because by default, ODL uses port 8080 for
# Tomcat (Helium releases) or Jetty (Lithium and later releases), and this
# conflicts with swift which also uses port 8080.
ODL_PORT=${ODL_PORT:-8087}

# The ODL endpoint URL
ODL_ENDPOINT=${ODL_ENDPOINT:-http://${ODL_MGR_IP}:${ODL_PORT}/controller/nb/v2/neutron}

# The ODL username
ODL_USERNAME=${ODL_USERNAME:-admin}

# The ODL password
ODL_PASSWORD=${ODL_PASSWORD:-admin}

# use v2 type driver
# this requires post mitaka
ODL_V2DRIVER=${ODL_V2DRIVER:-False}

# The OpenDaylight URL PREFIX
ODL_URL_PREFIX=${ODL_URL_PREFIX:-https://nexus.opendaylight.org}

# OpenDaylight snapshot & release repositories paths
# Can be overidden in case you host proxy repositories which have a different diretory structure than OpenDaylight's
ODL_URL_SNAPSHOT_REPOSITORY_PATH=${ODL_URL_SNAPSHOT_REPOSITORY_PATH:-content/repositories/opendaylight.snapshot}
ODL_URL_RELEASE_REPOSITORY_PATH=${ODL_URL_RELEASE_REPOSITORY_PATH:-content/repositories/opendaylight.release}

# How long (in seconds) to pause after ODL starts to let it complete booting
ODL_BOOT_WAIT=${ODL_BOOT_WAIT:-600}

# Enable OpenDaylight l3 forwarding
ODL_L3=${ODL_L3:-False}

# If you need to route the traffic out of the box, set
# ODL_PROVIDER_MAPPINGS to map br-ex as shown below. Note
# This used to be accomplished via PUBLIC_BRIDGE, but that
# is no longer necessary.
#
# The physical provider network to device mapping. Use this
# to instruct ODL to map ports into specific bridges
# Examples:
# ODL_PROVIDER_MAPPINGS=${ODL_PROVIDER_MAPPINGS:-br-ex:eth2}
# ODL_PROVIDER_MAPPINGS=${ODL_PROVIDER_MAPPINGS:-physnet1:eth1,br-ex:eth2}

# MAC address for next hop gateway at external network
ODL_L3GW_MAC=${ODL_L3GW_MAC:-''}

# Enable debug logs for odl ovsdb
ODL_NETVIRT_DEBUG_LOGS=${ODL_NETVIRT_DEBUG_LOGS:-False}

# Karaf logfile information
ODL_KARAF_LOG_DATE=$(date +%Y-%m-%d-%H%M%S)
ODL_KARAF_LOG_BASE=${ODL_KARAF_LOG_BASE:-screen-karaf.log}
ODL_KARAF_LOG_NAME=$ODL_KARAF_LOG_BASE.$ODL_KARAF_LOG_DATE

# The bridge to configure
OVS_BR=${OVS_BR:-br-int}

ODL_OVS_HOSTCONFIGS=${ODL_OVS_HOSTCONFIGS:-}
ODL_OVS_HOSTCONFIGS_OPTIONS=${ODL_OVS_HOSTCONFIGS_OPTIONS:---debug --noovs_dpdk --bridge_mappings=physnet1:br-ex}
if [ "$ODL_OVS_HOSTCONFIGS" != "" ]; then
    ODL_OVS_HOSTCONFIGS_OPTIONS=${ODL_OVS_HOSTCONFIGS_OPTIONS} --ovs_hostconfigs="$ODL_OVS_HOSTCONFIGS"
fi

# Use the existing ready java env
ODL_USING_EXISTING_JAVA=${ODL_USING_EXISTING_JAVA:-False}

# Allow the min/max/perm Java memory to be configurable
ODL_JAVA_MIN_MEM=${ODL_JAVA_MIN_MEM:-256m}
ODL_JAVA_MAX_MEM=${ODL_JAVA_MAX_MEM:-512m}
ODL_JAVA_MAX_PERM_MEM=${ODL_JAVA_MAX_PERM_MEM:-512m}

# Interval in test_with_retry calls
ODL_RETRY_SLEEP_INTERVAL=${ODL_RETRY_SLEEP_INTERVAL:-5}

# Skip installation of distribution provided Open vSwitch
SKIP_OVS_INSTALL=$(trueorfalse False SKIP_OVS_INSTALL)

# The ODL Restconf URL
# URI to hostconfigs: empty for default value
ODL_HOSTCONF_URI=${ODL_HOSTCONF_URI:-}

# Port binding controller
ODL_PORT_BINDING_CONTROLLER=${ODL_PORT_BINDING_CONTROLLER:-network-topology}

# Snapshot version - allows using a specific version e.g. 0.5.0-20160719.101233-3643
# latest: check the latest snapshot
# specific version: the specific version of the snapshot
# "": odl release
ODL_SNAPSHOT_VERSION=${ODL_SNAPSHOT_VERSION:-}

# Set to True to keep odl running after unstack
UNSTACK_KEEP_ODL=${UNSTACK_KEEP_ODL:-False}
