diff options
| author | Carlos Konstanski <ckonstanski@pippiandcarlos.com> | 2017-11-13 16:50:55 -0700 |
|---|---|---|
| committer | Carlos Konstanski <ckonstanski@pippiandcarlos.com> | 2017-11-13 16:50:55 -0700 |
| commit | ffa2a169ea98fb54a29d90ca158059e79e2816ba (patch) | |
| tree | 018461d031b71178fa48b9672d8e39bac4de1270 | |
initial commit
64 files changed, 5627 insertions, 0 deletions
diff --git a/conf/env.yaml.docker_registry.example b/conf/env.yaml.docker_registry.example new file mode 100644 index 0000000..f00e29c --- /dev/null +++ b/conf/env.yaml.docker_registry.example @@ -0,0 +1,12 @@ +--- +globals: + ansible_ssh_user: root + ansible_private_key_file: /var/lib/jenkins/.ssh/id_rsa + ansible_python_interpreter: /usr/bin/python2 + +environments: + - master: + - host1: + cn: ~ + username: ~ + password: ~ diff --git a/conf/env.yaml.openbook.example b/conf/env.yaml.openbook.example new file mode 100644 index 0000000..d8f971a --- /dev/null +++ b/conf/env.yaml.openbook.example @@ -0,0 +1,134 @@ +--- +globals: + ansible_ssh_user: root + ansible_private_key_file: /var/lib/jenkins/.ssh/id_rsa + ansible_python_interpreter: /usr/bin/python2 + openbook_docker_registry_url: ~ + openbook_docker_registry_username: ~ + openbook_docker_registry_password: ~ + +environments: + - unstable: + - host1: + openbook_database_password: ~ + openbook_gcomm_addresses: ~ + openbook_install_database: True|False + openbook_start_app: True|False + openbook_install_admin_api_server: True|False + openbook_install_customer_api_server: True|False + openbook_install_admin_web_ui: True|False + openbook_install_customer_web_ui: True|False + openbook_install_job_scheduler_server: True|False + openbook_install_workflow_server: True|False + openbook_admin_web_ui_port: ~ + openbook_admin_api_server_port: ~ + openbook_customer_web_ui_port: ~ + openbook_customer_api_server_port: ~ + - host2: + openbook_database_password: ~ + openbook_gcomm_addresses: ~ + openbook_install_database: True|False + openbook_start_app: True|False + openbook_install_admin_api_server: True|False + openbook_install_customer_api_server: True|False + openbook_install_admin_web_ui: True|False + openbook_install_customer_web_ui: True|False + openbook_install_job_scheduler_server: True|False + openbook_install_workflow_server: True|False + openbook_admin_web_ui_port: ~ + openbook_admin_api_server_port: ~ + openbook_customer_web_ui_port: ~ + openbook_customer_api_server_port: ~ + - develop: + - host1: + openbook_database_password: ~ + openbook_gcomm_addresses: ~ + openbook_install_database: True|False + openbook_start_app: True|False + openbook_install_admin_api_server: True|False + openbook_install_customer_api_server: True|False + openbook_install_admin_web_ui: True|False + openbook_install_customer_web_ui: True|False + openbook_install_job_scheduler_server: True|False + openbook_install_workflow_server: True|False + openbook_admin_web_ui_port: ~ + openbook_admin_api_server_port: ~ + openbook_customer_web_ui_port: ~ + openbook_customer_api_server_port: ~ + - host2: + openbook_database_password: ~ + openbook_gcomm_addresses: ~ + openbook_install_database: True|False + openbook_start_app: True|False + openbook_install_admin_api_server: True|False + openbook_install_customer_api_server: True|False + openbook_install_admin_web_ui: True|False + openbook_install_customer_web_ui: True|False + openbook_install_job_scheduler_server: True|False + openbook_install_workflow_server: True|False + openbook_admin_web_ui_port: ~ + openbook_admin_api_server_port: ~ + openbook_customer_web_ui_port: ~ + openbook_customer_api_server_port: ~ + - stage: + - host1: + openbook_database_password: ~ + openbook_gcomm_addresses: ~ + openbook_install_database: True|False + openbook_start_app: True|False + openbook_install_admin_api_server: True|False + openbook_install_customer_api_server: True|False + openbook_install_admin_web_ui: True|False + openbook_install_customer_web_ui: True|False + openbook_install_job_scheduler_server: True|False + openbook_install_workflow_server: True|False + openbook_admin_web_ui_port: ~ + openbook_admin_api_server_port: ~ + openbook_customer_web_ui_port: ~ + openbook_customer_api_server_port: ~ + - host2: + openbook_database_password: ~ + openbook_gcomm_addresses: ~ + openbook_install_database: True|False + openbook_start_app: True|False + openbook_install_admin_api_server: True|False + openbook_install_customer_api_server: True|False + openbook_install_admin_web_ui: True|False + openbook_install_customer_web_ui: True|False + openbook_install_job_scheduler_server: True|False + openbook_install_workflow_server: True|False + openbook_admin_web_ui_port: ~ + openbook_admin_api_server_port: ~ + openbook_customer_web_ui_port: ~ + openbook_customer_api_server_port: ~ + - master: + - host1: + openbook_database_password: ~ + openbook_gcomm_addresses: ~ + openbook_install_database: True|False + openbook_start_app: True|False + openbook_install_admin_api_server: True|False + openbook_install_customer_api_server: True|False + openbook_install_admin_web_ui: True|False + openbook_install_customer_web_ui: True|False + openbook_install_job_scheduler_server: True|False + openbook_install_workflow_server: True|False + openbook_admin_web_ui_port: ~ + openbook_admin_api_server_port: ~ + openbook_customer_web_ui_port: ~ + openbook_customer_api_server_port: ~ + - host2: + openbook_database_password: ~ + openbook_gcomm_addresses: ~ + openbook_install_database: True|False + openbook_start_app: True|False + openbook_install_admin_api_server: True|False + openbook_install_customer_api_server: True|False + openbook_install_admin_web_ui: True|False + openbook_install_customer_web_ui: True|False + openbook_install_job_scheduler_server: True|False + openbook_install_workflow_server: True|False + openbook_admin_web_ui_port: ~ + openbook_admin_api_server_port: ~ + openbook_customer_web_ui_port: ~ + openbook_customer_api_server_port: ~ diff --git a/conf/env.yaml.openbook_docker_slave.example b/conf/env.yaml.openbook_docker_slave.example new file mode 100644 index 0000000..51592e9 --- /dev/null +++ b/conf/env.yaml.openbook_docker_slave.example @@ -0,0 +1,16 @@ +--- +globals: + ansible_ssh_user: root + ansible_private_key_file: /var/lib/jenkins/.ssh/id_rsa + ansible_python_interpreter: /usr/bin/python2 + locale: en_US.utf8 + salt_master: localhost + +environments: + - master: + - host1: + database_root_password: ~ + docker_username: ~ + docker_password: ~ + webdav_username: ~ + webdav_password: ~ diff --git a/docker_registry_installer.yaml b/docker_registry_installer.yaml new file mode 100644 index 0000000..a38e8eb --- /dev/null +++ b/docker_registry_installer.yaml @@ -0,0 +1,3 @@ +--- +- name: "Install Openbook: Docker Edition" + include: playbooks/install_docker_registry.yaml diff --git a/files/ansible.cfg b/files/ansible.cfg new file mode 100644 index 0000000..d814983 --- /dev/null +++ b/files/ansible.cfg @@ -0,0 +1,15 @@ +[defaults] +host_key_checking = False +remote_user = root +log_path = /var/log/ansible/log +private_key_file = /root/.ssh/id_rsa +forks = 40 +ansible_python_interpreter = /usr/bin/python3.5 + +[ssh_connection] +pipelining = True + +[privilege_escalation] +become = True +become_user = root +become_method = sudo diff --git a/files/ci/cloudcfg.sh b/files/ci/cloudcfg.sh new file mode 100755 index 0000000..f7dffd6 --- /dev/null +++ b/files/ci/cloudcfg.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# Prepare the instance for ansible. This amounts to installing python2. + +python=$(which python || which python3 || which python2 || false) + +case "$(${python} -m platform)" in + *Ubuntu*) + export DEBIAN_FRONTEND=noninteractive + apt-get update + apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" dist-upgrade + apt-get -y install python python2.7 + ;; + *centos*|*redhat*) + # RHEL systems still use python2 by default; nothing to do + ;; + *gentoo*) + if [ ! -d /usr/portage/sys-devel/gcc ]; then + emerge-webrsync + fi + emerge --oneshot --update dev-lang/python:2.7 app-portage/gentoolkit + ;; +esac + +exit 0 diff --git a/files/database/etc/openbook/database/my.cnf b/files/database/etc/openbook/database/my.cnf new file mode 100644 index 0000000..4752ae1 --- /dev/null +++ b/files/database/etc/openbook/database/my.cnf @@ -0,0 +1,169 @@ +# MariaDB database server configuration file. +# +# You can copy this file to one of: +# - "/etc/mysql/my.cnf" to set global options, +# - "~/.my.cnf" to set user-specific options. +# +# One can use all long options that the program supports. +# Run program with --help to get a list of available options and with +# --print-defaults to see which it would actually understand and use. +# +# For explanations see +# http://dev.mysql.com/doc/mysql/en/server-system-variables.html + +# This will be passed to all mysql clients +# It has been reported that passwords should be enclosed with ticks/quotes +# escpecially if they contain "#" chars... +# Remember to edit /etc/mysql/debian.cnf when changing the socket location. +[client] +port = 3306 +socket = /var/run/mysqld/mysqld.sock + +# Here is entries for some specific programs +# The following values assume you have at least 32M ram + +# This was formally known as [safe_mysqld]. Both versions are currently parsed. +[mysqld_safe] +socket = /var/run/mysqld/mysqld.sock +nice = 0 + +[mysqld] +# +# * Basic Settings +# +user = mysql +pid-file = /var/run/mysqld/mysqld.pid +socket = /var/run/mysqld/mysqld.sock +port = 3306 +basedir = /usr +datadir = /var/lib/mysql +tmpdir = /tmp +lc_messages_dir = /usr/share/mysql +lc_messages = en_US +skip-external-locking +# +# Instead of skip-networking the default is now to listen only on +# localhost which is more compatible and is not less secure. +bind-address = 0.0.0.0 +# +# * Fine Tuning +# +max_connections = 1000 +connect_timeout = 5 +wait_timeout = 600 +max_allowed_packet = 16M +thread_cache_size = 128 +sort_buffer_size = 4M +bulk_insert_buffer_size = 16M +tmp_table_size = 32M +max_heap_table_size = 32M +# +# * MyISAM +# +# This replaces the startup script and checks MyISAM tables if needed +# the first time they are touched. On error, make copy and try a repair. +myisam_recover_options = BACKUP +key_buffer_size = 128M +#open-files-limit = 2000 +table_open_cache = 400 +myisam_sort_buffer_size = 512M +concurrent_insert = 2 +read_buffer_size = 2M +read_rnd_buffer_size = 1M +# +# * Query Cache Configuration +# +# Cache only tiny result sets, so we can fit more in the query cache. +query_cache_limit = 128K +query_cache_size = 64M +# for more write intensive setups, set to DEMAND or OFF +#query_cache_type = DEMAND +# +# * Logging and Replication +# +# Both location gets rotated by the cronjob. +# Be aware that this log type is a performance killer. +# As of 5.1 you can enable the log at runtime! +#general_log_file = /var/log/mysql/mysql.log +#general_log = 1 +# +# Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf. +# +# we do want to know about network errors and such +log_warnings = 2 +# +# Enable the slow query log to see queries with especially long duration +#slow_query_log[={0|1}] +slow_query_log_file = /var/log/mysql/mariadb-slow.log +long_query_time = 10 +#log_slow_rate_limit = 1000 +log_slow_verbosity = query_plan + +#log-queries-not-using-indexes +#log_slow_admin_statements +# +# The following can be used as easy to replay backup logs or for replication. +# note: if you are setting up a replication slave, see README.Debian about +# other settings you may need to change. +#server-id = 1 +#report_host = master1 +#auto_increment_increment = 2 +#auto_increment_offset = 1 +log_bin = /var/log/mysql/mariadb-bin +log_bin_index = /var/log/mysql/mariadb-bin.index +# not fab for performance, but safer +#sync_binlog = 1 +expire_logs_days = 10 +max_binlog_size = 100M +# slaves +#relay_log = /var/log/mysql/relay-bin +#relay_log_index = /var/log/mysql/relay-bin.index +#relay_log_info_file = /var/log/mysql/relay-bin.info +#log_slave_updates +#read_only +# +# If applications support it, this stricter sql_mode prevents some +# mistakes like inserting invalid dates etc. +#sql_mode = NO_ENGINE_SUBSTITUTION,TRADITIONAL +# +# * InnoDB +# +# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/. +# Read the manual for more InnoDB related options. There are many! +default_storage_engine = InnoDB +# you can't just change log file size, requires special procedure +#innodb_log_file_size = 50M +innodb_buffer_pool_size = 256M +innodb_log_buffer_size = 8M +innodb_file_per_table = 1 +innodb_open_files = 400 +innodb_io_capacity = 400 +innodb_flush_method = O_DIRECT +# +# * Security Features +# +# Read the manual, too, if you want chroot! +# chroot = /var/lib/mysql/ +# +# For generating SSL certificates I recommend the OpenSSL GUI "tinyca". +# +# ssl-ca=/etc/mysql/cacert.pem +# ssl-cert=/etc/mysql/server-cert.pem +# ssl-key=/etc/mysql/server-key.pem + +[mysqldump] +quick +quote-names +max_allowed_packet = 16M + +[mysql] +#no-auto-rehash # faster start of mysql but no tab completion + +[isamchk] +key_buffer = 16M + +# +# * IMPORTANT: Additional settings that can override those from this file! +# The files must end with '.cnf', otherwise they'll be ignored. +# +!includedir /etc/mysql/conf.d/ diff --git a/files/docker-compose.yaml b/files/docker-compose.yaml new file mode 100644 index 0000000..48f5b6e --- /dev/null +++ b/files/docker-compose.yaml @@ -0,0 +1,17 @@ +nginx: + image: "nginx:1.9" + ports: + - 443:443 + links: + - registry:registry + volumes: + - ./nginx/:/etc/nginx/conf.d:ro +registry: + image: registry:2 + ports: + - 127.0.0.1:5000:5000 + environment: + REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /data + REGISTRY_STORAGE_DELETE_ENABLED: "true" + volumes: + - ./data:/data diff --git a/files/docker-registry.gentoo b/files/docker-registry.gentoo new file mode 100644 index 0000000..02883f6 --- /dev/null +++ b/files/docker-registry.gentoo @@ -0,0 +1,30 @@ +#!/sbin/openrc-run +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +depend() { + docker +} + +start() { + ebegin "openbook: start" + docker-compose -f /root/docker-registry/docker-compose.yaml up -d + eend $? +} + +stop() { + ebegin "openstack: stop" + docker-compose -f /root/docker-registry/docker-compose.yaml stop + docker-compose -f /root/docker-registry/docker-compose.yaml rm -f + eend $? +} + +restart() { + stop + start +} + +status() { + docker-compose -f /root/docker-registry/docker-compose.yaml ps +} diff --git a/files/docker-registry.ubuntu b/files/docker-registry.ubuntu new file mode 100644 index 0000000..cd2e676 --- /dev/null +++ b/files/docker-registry.ubuntu @@ -0,0 +1,44 @@ +#!/bin/sh +set -e + +### BEGIN INIT INFO +# Provides: docker-registry +# Required-Start: $docker +# Required-Stop: $docker +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Docker Registry +# Description: +# Docker Registry +### END INIT INFO + +export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin + +do_start() { + docker-compose -f /root/docker-registry/docker-compose.yaml up -d +} + +do_stop() { + docker-compose -f /root/docker-registry/docker-compose.yaml stop + docker-compose -f /root/docker-registry/docker-compose.yaml rm -f +} + +do_status() { + docker-compose -f /root/docker-registry/docker-compose.yaml ps +} + +case $1 in + start*) + do_start + ;; + stop*) + do_stop + ;; + restart*) + do_stop + do_start + ;; + status*) + do_status + ;; +esac diff --git a/files/docker.list b/files/docker.list new file mode 100644 index 0000000..318b353 --- /dev/null +++ b/files/docker.list @@ -0,0 +1 @@ +deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable diff --git a/files/mariadb.list b/files/mariadb.list new file mode 100644 index 0000000..9d4b9da --- /dev/null +++ b/files/mariadb.list @@ -0,0 +1 @@ +deb [arch=amd64,i386] http://sgp1.mirrors.digitalocean.com/mariadb/repo/10.2/ubuntu xenial main diff --git a/files/master b/files/master new file mode 100644 index 0000000..aa49105 --- /dev/null +++ b/files/master @@ -0,0 +1,1088 @@ +##### Primary configuration settings ##### +########################################## +# This configuration file is used to manage the behavior of the Salt Master. +# Values that are commented out but have an empty line after the comment are +# defaults that do not need to be set in the config. If there is no blank line +# after the comment then the value is presented as an example and is not the +# default. + +# Per default, the master will automatically include all config files +# from master.d/*.conf (master.d is a directory in the same directory +# as the main master config file). +#default_include: master.d/*.conf + +# The address of the interface to bind to: +interface: 127.0.0.1 + + +# Whether the master should listen for IPv6 connections. If this is set to True, +# the interface option must be adjusted, too. (For example: "interface: '::'") +#ipv6: False + +# The tcp port used by the publisher: +#publish_port: 4505 + +# The user under which the salt master will run. Salt will update all +# permissions to allow the specified user to run the master. The exception is +# the job cache, which must be deleted if this user is changed. If the +# modified files cause conflicts, set verify_env to False. +#user: root + +# The port used by the communication interface. The ret (return) port is the +# interface used for the file server, authentication, job returns, etc. +#ret_port: 4506 + +# Specify the location of the daemon process ID file: +#pidfile: /var/run/salt-master.pid + +# The root directory prepended to these options: pki_dir, cachedir, +# sock_dir, log_file, autosign_file, autoreject_file, extension_modules, +# key_logfile, pidfile: +#root_dir: / + +# The path to the master's configuration file. +#conf_file: /etc/salt/master + +# Directory used to store public key data: +#pki_dir: /etc/salt/pki/master + +# Key cache. Increases master speed for large numbers of accepted +# keys. Available options: 'sched'. (Updates on a fixed schedule.) +# Note that enabling this feature means that minions will not be +# available to target for up to the length of the maintanence loop +# which by default is 60s. +#key_cache: '' + +# Directory to store job and cache data: +# This directory may contain sensitive data and should be protected accordingly. +# +#cachedir: /var/cache/salt/master + +# Directory for custom modules. This directory can contain subdirectories for +# each of Salt's module types such as "runners", "output", "wheel", "modules", +# "states", "returners", etc. +#extension_modules: <no default> + +# Directory for custom modules. This directory can contain subdirectories for +# each of Salt's module types such as "runners", "output", "wheel", "modules", +# "states", "returners", "engines", etc. +# Like 'extension_modules' but can take an array of paths +#module_dirs: <no default> +# - /var/cache/salt/minion/extmods + +# Verify and set permissions on configuration directories at startup: +#verify_env: True + +# Set the number of hours to keep old job information in the job cache: +#keep_jobs: 24 + +# The number of seconds to wait when the client is requesting information +# about running jobs. +#gather_job_timeout: 10 + +# Set the default timeout for the salt command and api. The default is 5 +# seconds. +#timeout: 5 + +# The loop_interval option controls the seconds for the master's maintenance +# process check cycle. This process updates file server backends, cleans the +# job cache and executes the scheduler. +#loop_interval: 60 + +# Set the default outputter used by the salt command. The default is "nested". +#output: nested + +# Set the default output file used by the salt command. Default is to output +# to the CLI and not to a file. Functions the same way as the "--out-file" +# CLI option, only sets this to a single file for all salt commands. +#output_file: None + +# Return minions that timeout when running commands like test.ping +#show_timeout: True + +# By default, output is colored. To disable colored output, set the color value +# to False. +#color: True + +# Do not strip off the colored output from nested results and state outputs +# (true by default). +# strip_colors: False + +# To display a summary of the number of minions targeted, the number of +# minions returned, and the number of minions that did not return, set the +# cli_summary value to True. (False by default.) +# +#cli_summary: False + +# Set the directory used to hold unix sockets: +#sock_dir: /var/run/salt/master + +# The master can take a while to start up when lspci and/or dmidecode is used +# to populate the grains for the master. Enable if you want to see GPU hardware +# data for your master. +# enable_gpu_grains: False + +# The master maintains a job cache. While this is a great addition, it can be +# a burden on the master for larger deployments (over 5000 minions). +# Disabling the job cache will make previously executed jobs unavailable to +# the jobs system and is not generally recommended. +#job_cache: True + +# Cache minion grains, pillar and mine data via the cache subsystem in the +# cachedir or a database. +#minion_data_cache: True + +# Cache subsystem module to use for minion data cache. +#cache: localfs +# Enables a fast in-memory cache booster and sets the expiration time. +#memcache_expire_seconds: 0 +# Set a memcache limit in items (bank + key) per cache storage (driver + driver_opts). +#memcache_max_items: 1024 +# Each time a cache storage got full cleanup all the expired items not just the oldest one. +#memcache_full_cleanup: False +# Enable collecting the memcache stats and log it on `debug` log level. +#memcache_debug: False + +# Store all returns in the given returner. +# Setting this option requires that any returner-specific configuration also +# be set. See various returners in salt/returners for details on required +# configuration values. (See also, event_return_queue below.) +# +#event_return: mysql + +# On busy systems, enabling event_returns can cause a considerable load on +# the storage system for returners. Events can be queued on the master and +# stored in a batched fashion using a single transaction for multiple events. +# By default, events are not queued. +#event_return_queue: 0 + +# Only return events matching tags in a whitelist, supports glob matches. +#event_return_whitelist: +# - salt/master/a_tag +# - salt/run/*/ret + +# Store all event returns **except** the tags in a blacklist, supports globs. +#event_return_blacklist: +# - salt/master/not_this_tag +# - salt/wheel/*/ret + +# Passing very large events can cause the minion to consume large amounts of +# memory. This value tunes the maximum size of a message allowed onto the +# master event bus. The value is expressed in bytes. +#max_event_size: 1048576 + +# By default, the master AES key rotates every 24 hours. The next command +# following a key rotation will trigger a key refresh from the minion which may +# result in minions which do not respond to the first command after a key refresh. +# +# To tell the master to ping all minions immediately after an AES key refresh, set +# ping_on_rotate to True. This should mitigate the issue where a minion does not +# appear to initially respond after a key is rotated. +# +# Note that ping_on_rotate may cause high load on the master immediately after +# the key rotation event as minions reconnect. Consider this carefully if this +# salt master is managing a large number of minions. +# +# If disabled, it is recommended to handle this event by listening for the +# 'aes_key_rotate' event with the 'key' tag and acting appropriately. +# ping_on_rotate: False + +# By default, the master deletes its cache of minion data when the key for that +# minion is removed. To preserve the cache after key deletion, set +# 'preserve_minion_cache' to True. +# +# WARNING: This may have security implications if compromised minions auth with +# a previous deleted minion ID. +#preserve_minion_cache: False + +# Allow or deny minions from requesting their own key revocation +#allow_minion_key_revoke: True + +# If max_minions is used in large installations, the master might experience +# high-load situations because of having to check the number of connected +# minions for every authentication. This cache provides the minion-ids of +# all connected minions to all MWorker-processes and greatly improves the +# performance of max_minions. +# con_cache: False + +# The master can include configuration from other files. To enable this, +# pass a list of paths to this option. The paths can be either relative or +# absolute; if relative, they are considered to be relative to the directory +# the main master configuration file lives in (this file). Paths can make use +# of shell-style globbing. If no files are matched by a path passed to this +# option, then the master will log a warning message. +# +# Include a config file from some other path: +# include: /etc/salt/extra_config +# +# Include config from several files and directories: +# include: +# - /etc/salt/extra_config + + +##### Large-scale tuning settings ##### +########################################## +# Max open files +# +# Each minion connecting to the master uses AT LEAST one file descriptor, the +# master subscription connection. If enough minions connect you might start +# seeing on the console (and then salt-master crashes): +# Too many open files (tcp_listener.cpp:335) +# Aborted (core dumped) +# +# By default this value will be the one of `ulimit -Hn`, ie, the hard limit for +# max open files. +# +# If you wish to set a different value than the default one, uncomment and +# configure this setting. Remember that this value CANNOT be higher than the +# hard limit. Raising the hard limit depends on your OS and/or distribution, +# a good way to find the limit is to search the internet. For example: +# raise max open files hard limit debian +# +#max_open_files: 100000 + +# The number of worker threads to start. These threads are used to manage +# return calls made from minions to the master. If the master seems to be +# running slowly, increase the number of threads. This setting can not be +# set lower than 3. +#worker_threads: 5 + +# Set the ZeroMQ high water marks +# http://api.zeromq.org/3-2:zmq-setsockopt + +# The listen queue size / backlog +#zmq_backlog: 1000 + +# The publisher interface ZeroMQPubServerChannel +#pub_hwm: 1000 + +# These two ZMQ HWM settings, salt_event_pub_hwm and event_publisher_pub_hwm +# are significant for masters with thousands of minions. When these are +# insufficiently high it will manifest in random responses missing in the CLI +# and even missing from the job cache. Masters that have fast CPUs and many +# cores with appropriate worker_threads will not need these set as high. + +# On deployment with 8,000 minions, 2.4GHz CPUs, 24 cores, 32GiB memory has +# these settings: +# +# salt_event_pub_hwm: 128000 +# event_publisher_pub_hwm: 64000 + +# ZMQ high-water-mark for SaltEvent pub socket +#salt_event_pub_hwm: 20000 + +# ZMQ high-water-mark for EventPublisher pub socket +#event_publisher_pub_hwm: 10000 + +# The master may allocate memory per-event and not +# reclaim it. +# To set a high-water mark for memory allocation, use +# ipc_write_buffer to set a high-water mark for message +# buffering. +# Value: In bytes. Set to 'dynamic' to have Salt select +# a value for you. Default is disabled. +# ipc_write_buffer: 'dynamic' + + +##### Security settings ##### +########################################## +# Enable "open mode", this mode still maintains encryption, but turns off +# authentication, this is only intended for highly secure environments or for +# the situation where your keys end up in a bad state. If you run in open mode +# you do so at your own risk! +#open_mode: False + +# Enable auto_accept, this setting will automatically accept all incoming +# public keys from the minions. Note that this is insecure. +#auto_accept: False + +# Time in minutes that an incoming public key with a matching name found in +# pki_dir/minion_autosign/keyid is automatically accepted. Expired autosign keys +# are removed when the master checks the minion_autosign directory. +# 0 equals no timeout +# autosign_timeout: 120 + +# If the autosign_file is specified, incoming keys specified in the +# autosign_file will be automatically accepted. This is insecure. Regular +# expressions as well as globing lines are supported. +#autosign_file: /etc/salt/autosign.conf + +# Works like autosign_file, but instead allows you to specify minion IDs for +# which keys will automatically be rejected. Will override both membership in +# the autosign_file and the auto_accept setting. +#autoreject_file: /etc/salt/autoreject.conf + +# Enable permissive access to the salt keys. This allows you to run the +# master or minion as root, but have a non-root group be given access to +# your pki_dir. To make the access explicit, root must belong to the group +# you've given access to. This is potentially quite insecure. If an autosign_file +# is specified, enabling permissive_pki_access will allow group access to that +# specific file. +#permissive_pki_access: False + +# Allow users on the master access to execute specific commands on minions. +# This setting should be treated with care since it opens up execution +# capabilities to non root users. By default this capability is completely +# disabled. +#publisher_acl: +# larry: +# - test.ping +# - network.* +# +# Blacklist any of the following users or modules +# +# This example would blacklist all non sudo users, including root from +# running any commands. It would also blacklist any use of the "cmd" +# module. This is completely disabled by default. +# +# +# Check the list of configured users in client ACL against users on the +# system and throw errors if they do not exist. +#client_acl_verify: True +# +#publisher_acl_blacklist: +# users: +# - root +# - '^(?!sudo_).*$' # all non sudo users +# modules: +# - cmd +# +# WARNING: client_acl and client_acl_blacklist options are deprecated and will +# be removed in the future releases. Use publisher_acl and +# publisher_acl_blacklist instead. + +# Enforce publisher_acl & publisher_acl_blacklist when users have sudo +# access to the salt command. +# +#sudo_acl: False + +# The external auth system uses the Salt auth modules to authenticate and +# validate users to access areas of the Salt system. +#external_auth: +# pam: +# fred: +# - test.* +# +# Time (in seconds) for a newly generated token to live. Default: 12 hours +#token_expire: 43200 +# +# Allow eauth users to specify the expiry time of the tokens they generate. +# A boolean applies to all users or a dictionary of whitelisted eauth backends +# and usernames may be given. +# token_expire_user_override: +# pam: +# - fred +# - tom +# ldap: +# - gary +# +#token_expire_user_override: False + +# Allow minions to push files to the master. This is disabled by default, for +# security purposes. +#file_recv: False + +# Set a hard-limit on the size of the files that can be pushed to the master. +# It will be interpreted as megabytes. Default: 100 +#file_recv_max_size: 100 + +# Signature verification on messages published from the master. +# This causes the master to cryptographically sign all messages published to its event +# bus, and minions then verify that signature before acting on the message. +# +# This is False by default. +# +# Note that to facilitate interoperability with masters and minions that are different +# versions, if sign_pub_messages is True but a message is received by a minion with +# no signature, it will still be accepted, and a warning message will be logged. +# Conversely, if sign_pub_messages is False, but a minion receives a signed +# message it will be accepted, the signature will not be checked, and a warning message +# will be logged. This behavior went away in Salt 2014.1.0 and these two situations +# will cause minion to throw an exception and drop the message. +# sign_pub_messages: False + +# Use TLS/SSL encrypted connection between master and minion. +# Can be set to a dictionary containing keyword arguments corresponding to Python's +# 'ssl.wrap_socket' method. +# Default is None. +#ssl: +# keyfile: <path_to_keyfile> +# certfile: <path_to_certfile> +# ssl_version: PROTOCOL_TLSv1_2 + +##### Salt-SSH Configuration ##### +########################################## + +# Pass in an alternative location for the salt-ssh roster file +#roster_file: /etc/salt/roster + +# Define locations for roster files so they can be chosen when using Salt API. +# An administrator can place roster files into these locations. Then when +# calling Salt API, parameter 'roster_file' should contain a relative path to +# these locations. That is, "roster_file=/foo/roster" will be resolved as +# "/etc/salt/roster.d/foo/roster" etc. This feature prevents passing insecure +# custom rosters through the Salt API. +# +#rosters: +# - /etc/salt/roster.d +# - /opt/salt/some/more/rosters + +# The log file of the salt-ssh command: +#ssh_log_file: /var/log/salt/ssh + +# Pass in minion option overrides that will be inserted into the SHIM for +# salt-ssh calls. The local minion config is not used for salt-ssh. Can be +# overridden on a per-minion basis in the roster (`minion_opts`) +#ssh_minion_opts: +# gpg_keydir: /root/gpg + +# Set this to True to default to using ~/.ssh/id_rsa for salt-ssh +# authentication with minions +#ssh_use_home_key: False + +##### Master Module Management ##### +########################################## +# Manage how master side modules are loaded. + +# Add any additional locations to look for master runners: +#runner_dirs: [] + +# Enable Cython for master side modules: +#cython_enable: False + + +##### State System settings ##### +########################################## +# The state system uses a "top" file to tell the minions what environment to +# use and what modules to use. The state_top file is defined relative to the +# root of the base environment as defined in "File Server settings" below. +#state_top: top.sls + +# The master_tops option replaces the external_nodes option by creating +# a plugable system for the generation of external top data. The external_nodes +# option is deprecated by the master_tops option. +# +# To gain the capabilities of the classic external_nodes system, use the +# following configuration: +# master_tops: +# ext_nodes: <Shell command which returns yaml> +# +#master_tops: {} + +# The external_nodes option allows Salt to gather data that would normally be +# placed in a top file. The external_nodes option is the executable that will +# return the ENC data. Remember that Salt will look for external nodes AND top +# files and combine the results if both are enabled! +#external_nodes: None + +# The renderer to use on the minions to render the state data +#renderer: yaml_jinja + +# The Jinja renderer can strip extra carriage returns and whitespace +# See http://jinja.pocoo.org/docs/api/#high-level-api +# +# If this is set to True the first newline after a Jinja block is removed +# (block, not variable tag!). Defaults to False, corresponds to the Jinja +# environment init variable "trim_blocks". +#jinja_trim_blocks: False +# +# If this is set to True leading spaces and tabs are stripped from the start +# of a line to a block. Defaults to False, corresponds to the Jinja +# environment init variable "lstrip_blocks". +#jinja_lstrip_blocks: False + +# The failhard option tells the minions to stop immediately after the first +# failure detected in the state execution, defaults to False +#failhard: False + +# The state_verbose and state_output settings can be used to change the way +# state system data is printed to the display. By default all data is printed. +# The state_verbose setting can be set to True or False, when set to False +# all data that has a result of True and no changes will be suppressed. +#state_verbose: True + +# The state_output setting changes if the output is the full multi line +# output for each changed state if set to 'full', but if set to 'terse' +# the output will be shortened to a single line. If set to 'mixed', the output +# will be terse unless a state failed, in which case that output will be full. +# If set to 'changes', the output will be full unless the state didn't change. +#state_output: full + +# Automatically aggregate all states that have support for mod_aggregate by +# setting to 'True'. Or pass a list of state module names to automatically +# aggregate just those types. +# +# state_aggregate: +# - pkg +# +#state_aggregate: False + +# Send progress events as each function in a state run completes execution +# by setting to 'True'. Progress events are in the format +# 'salt/job/<JID>/prog/<MID>/<RUN NUM>'. +#state_events: False + +##### File Server settings ##### +########################################## +# Salt runs a lightweight file server written in zeromq to deliver files to +# minions. This file server is built into the master daemon and does not +# require a dedicated port. + +# The file server works on environments passed to the master, each environment +# can have multiple root directories, the subdirectories in the multiple file +# roots cannot match, otherwise the downloaded files will not be able to be +# reliably ensured. A base environment is required to house the top file. +# Example: +# file_roots: +# base: +# - /srv/salt/ +# dev: +# - /srv/salt/dev/services +# - /srv/salt/dev/states +# prod: +# - /srv/salt/prod/services +# - /srv/salt/prod/states +# +#file_roots: +# base: +# - /srv/salt +# +file_roots: + base: + - /srv/salt + +# When using multiple environments, each with their own top file, the +# default behaviour is an unordered merge. To prevent top files from +# being merged together and instead to only use the top file from the +# requested environment, set this value to 'same'. +#top_file_merging_strategy: merge + +# To specify the order in which environments are merged, set the ordering +# in the env_order option. Given a conflict, the last matching value will +# win. +#env_order: ['base', 'dev', 'prod'] + +# If top_file_merging_strategy is set to 'same' and an environment does not +# contain a top file, the top file in the environment specified by default_top +# will be used instead. +#default_top: base + +# The hash_type is the hash to use when discovering the hash of a file on +# the master server. The default is md5 but sha1, sha224, sha256, sha384 +# and sha512 are also supported. +# +# WARNING: While md5 is also supported, do not use it due to the high chance +# of possible collisions and thus security breach. +# +# Prior to changing this value, the master should be stopped and all Salt +# caches should be cleared. +#hash_type: sha256 + +# The buffer size in the file server can be adjusted here: +#file_buffer_size: 1048576 + +# A regular expression (or a list of expressions) that will be matched +# against the file path before syncing the modules and states to the minions. +# This includes files affected by the file.recurse state. +# For example, if you manage your custom modules and states in subversion +# and don't want all the '.svn' folders and content synced to your minions, +# you could set this to '/\.svn($|/)'. By default nothing is ignored. +#file_ignore_regex: +# - '/\.svn($|/)' +# - '/\.git($|/)' + +# A file glob (or list of file globs) that will be matched against the file +# path before syncing the modules and states to the minions. This is similar +# to file_ignore_regex above, but works on globs instead of regex. By default +# nothing is ignored. +# file_ignore_glob: +# - '*.pyc' +# - '*/somefolder/*.bak' +# - '*.swp' + +# File Server Backend +# +# Salt supports a modular fileserver backend system, this system allows +# the salt master to link directly to third party systems to gather and +# manage the files available to minions. Multiple backends can be +# configured and will be searched for the requested file in the order in which +# they are defined here. The default setting only enables the standard backend +# "roots" which uses the "file_roots" option. +#fileserver_backend: +# - roots +# +# To use multiple backends list them in the order they are searched: +#fileserver_backend: +# - git +# - roots +# +# Uncomment the line below if you do not want the file_server to follow +# symlinks when walking the filesystem tree. This is set to True +# by default. Currently this only applies to the default roots +# fileserver_backend. +#fileserver_followsymlinks: False +# +# Uncomment the line below if you do not want symlinks to be +# treated as the files they are pointing to. By default this is set to +# False. By uncommenting the line below, any detected symlink while listing +# files on the Master will not be returned to the Minion. +#fileserver_ignoresymlinks: True +# +# By default, the Salt fileserver recurses fully into all defined environments +# to attempt to find files. To limit this behavior so that the fileserver only +# traverses directories with SLS files and special Salt directories like _modules, +# enable the option below. This might be useful for installations where a file root +# has a very large number of files and performance is impacted. Default is False. +# fileserver_limit_traversal: False +# +# The fileserver can fire events off every time the fileserver is updated, +# these are disabled by default, but can be easily turned on by setting this +# flag to True +#fileserver_events: False + +# Git File Server Backend Configuration +# +# Optional parameter used to specify the provider to be used for gitfs. Must +# be one of the following: pygit2, gitpython, or dulwich. If unset, then each +# will be tried in that same order, and the first one with a compatible +# version installed will be the provider that is used. +#gitfs_provider: pygit2 + +# Along with gitfs_password, is used to authenticate to HTTPS remotes. +# gitfs_user: '' + +# Along with gitfs_user, is used to authenticate to HTTPS remotes. +# This parameter is not required if the repository does not use authentication. +#gitfs_password: '' + +# By default, Salt will not authenticate to an HTTP (non-HTTPS) remote. +# This parameter enables authentication over HTTP. Enable this at your own risk. +#gitfs_insecure_auth: False + +# Along with gitfs_privkey (and optionally gitfs_passphrase), is used to +# authenticate to SSH remotes. This parameter (or its per-remote counterpart) +# is required for SSH remotes. +#gitfs_pubkey: '' + +# Along with gitfs_pubkey (and optionally gitfs_passphrase), is used to +# authenticate to SSH remotes. This parameter (or its per-remote counterpart) +# is required for SSH remotes. +#gitfs_privkey: '' + +# This parameter is optional, required only when the SSH key being used to +# authenticate is protected by a passphrase. +#gitfs_passphrase: '' + +# When using the git fileserver backend at least one git remote needs to be +# defined. The user running the salt master will need read access to the repo. +# +# The repos will be searched in order to find the file requested by a client +# and the first repo to have the file will return it. +# When using the git backend branches and tags are translated into salt +# environments. +# Note: file:// repos will be treated as a remote, so refs you want used must +# exist in that repo as *local* refs. +#gitfs_remotes: +# - git://github.com/saltstack/salt-states.git +# - file:///var/git/saltmaster +# +# The gitfs_ssl_verify option specifies whether to ignore ssl certificate +# errors when contacting the gitfs backend. You might want to set this to +# false if you're using a git backend that uses a self-signed certificate but +# keep in mind that setting this flag to anything other than the default of True +# is a security concern, you may want to try using the ssh transport. +#gitfs_ssl_verify: True +# +# The gitfs_root option gives the ability to serve files from a subdirectory +# within the repository. The path is defined relative to the root of the +# repository and defaults to the repository root. +#gitfs_root: somefolder/otherfolder +# +# +##### Pillar settings ##### +########################################## +# Salt Pillars allow for the building of global data that can be made selectively +# available to different minions based on minion grain filtering. The Salt +# Pillar is laid out in the same fashion as the file server, with environments, +# a top file and sls files. However, pillar data does not need to be in the +# highstate format, and is generally just key/value pairs. +pillar_roots: + base: + - /srv/pillar + +#ext_pillar: +# - hiera: /etc/hiera.yaml +# - cmd_yaml: cat /etc/salt/yaml + +# The ext_pillar_first option allows for external pillar sources to populate +# before file system pillar. This allows for targeting file system pillar from +# ext_pillar. +#ext_pillar_first: False + +# The external pillars permitted to be used on-demand using pillar.ext +#on_demand_ext_pillar: +# - libvirt +# - virtkey + +# The pillar_gitfs_ssl_verify option specifies whether to ignore ssl certificate +# errors when contacting the pillar gitfs backend. You might want to set this to +# false if you're using a git backend that uses a self-signed certificate but +# keep in mind that setting this flag to anything other than the default of True +# is a security concern, you may want to try using the ssh transport. +#pillar_gitfs_ssl_verify: True + +# The pillar_opts option adds the master configuration file data to a dict in +# the pillar called "master". This is used to set simple configurations in the +# master config file that can then be used on minions. +#pillar_opts: False + +# The pillar_safe_render_error option prevents the master from passing pillar +# render errors to the minion. This is set on by default because the error could +# contain templating data which would give that minion information it shouldn't +# have, like a password! When set true the error message will only show: +# Rendering SLS 'my.sls' failed. Please see master log for details. +#pillar_safe_render_error: True + +# The pillar_source_merging_strategy option allows you to configure merging strategy +# between different sources. It accepts five values: none, recurse, aggregate, overwrite, +# or smart. None will not do any merging at all. Recurse will merge recursively mapping of data. +# Aggregate instructs aggregation of elements between sources that use the #!yamlex renderer. Overwrite +# will overwrite elements according the order in which they are processed. This is +# behavior of the 2014.1 branch and earlier. Smart guesses the best strategy based +# on the "renderer" setting and is the default value. +#pillar_source_merging_strategy: smart + +# Recursively merge lists by aggregating them instead of replacing them. +#pillar_merge_lists: False + +# Set this option to 'True' to force a 'KeyError' to be raised whenever an +# attempt to retrieve a named value from pillar fails. When this option is set +# to 'False', the failed attempt returns an empty string. Default is 'False'. +#pillar_raise_on_missing: False + +# Git External Pillar (git_pillar) Configuration Options +# +# Specify the provider to be used for git_pillar. Must be either pygit2 or +# gitpython. If unset, then both will be tried in that same order, and the +# first one with a compatible version installed will be the provider that +# is used. +#git_pillar_provider: pygit2 + +# If the desired branch matches this value, and the environment is omitted +# from the git_pillar configuration, then the environment for that git_pillar +# remote will be base. +#git_pillar_base: master + +# If the branch is omitted from a git_pillar remote, then this branch will +# be used instead +#git_pillar_branch: master + +# Environment to use for git_pillar remotes. This is normally derived from +# the branch/tag (or from a per-remote env parameter), but if set this will +# override the process of deriving the env from the branch/tag name. +#git_pillar_env: '' + +# Path relative to the root of the repository where the git_pillar top file +# and SLS files are located. +#git_pillar_root: '' + +# Specifies whether or not to ignore SSL certificate errors when contacting +# the remote repository. +#git_pillar_ssl_verify: False + +# When set to False, if there is an update/checkout lock for a git_pillar +# remote and the pid written to it is not running on the master, the lock +# file will be automatically cleared and a new lock will be obtained. +#git_pillar_global_lock: True + +# Git External Pillar Authentication Options +# +# Along with git_pillar_password, is used to authenticate to HTTPS remotes. +#git_pillar_user: '' + +# Along with git_pillar_user, is used to authenticate to HTTPS remotes. +# This parameter is not required if the repository does not use authentication. +#git_pillar_password: '' + +# By default, Salt will not authenticate to an HTTP (non-HTTPS) remote. +# This parameter enables authentication over HTTP. +#git_pillar_insecure_auth: False + +# Along with git_pillar_privkey (and optionally git_pillar_passphrase), +# is used to authenticate to SSH remotes. +#git_pillar_pubkey: '' + +# Along with git_pillar_pubkey (and optionally git_pillar_passphrase), +# is used to authenticate to SSH remotes. +#git_pillar_privkey: '' + +# This parameter is optional, required only when the SSH key being used +# to authenticate is protected by a passphrase. +#git_pillar_passphrase: '' + +# A master can cache pillars locally to bypass the expense of having to render them +# for each minion on every request. This feature should only be enabled in cases +# where pillar rendering time is known to be unsatisfactory and any attendant security +# concerns about storing pillars in a master cache have been addressed. +# +# When enabling this feature, be certain to read through the additional ``pillar_cache_*`` +# configuration options to fully understand the tunable parameters and their implications. +# +# Note: setting ``pillar_cache: True`` has no effect on targeting Minions with Pillars. +# See https://docs.saltstack.com/en/latest/topics/targeting/pillar.html +#pillar_cache: False + +# If and only if a master has set ``pillar_cache: True``, the cache TTL controls the amount +# of time, in seconds, before the cache is considered invalid by a master and a fresh +# pillar is recompiled and stored. +#pillar_cache_ttl: 3600 + +# If and only if a master has set `pillar_cache: True`, one of several storage providers +# can be utililzed. +# +# `disk`: The default storage backend. This caches rendered pillars to the master cache. +# Rendered pillars are serialized and deserialized as msgpack structures for speed. +# Note that pillars are stored UNENCRYPTED. Ensure that the master cache +# has permissions set appropriately. (Same defaults are provided.) +# +# memory: [EXPERIMENTAL] An optional backend for pillar caches which uses a pure-Python +# in-memory data structure for maximal performance. There are several caveats, +# however. First, because each master worker contains its own in-memory cache, +# there is no guarantee of cache consistency between minion requests. This +# works best in situations where the pillar rarely if ever changes. Secondly, +# and perhaps more importantly, this means that unencrypted pillars will +# be accessible to any process which can examine the memory of the ``salt-master``! +# This may represent a substantial security risk. +# +#pillar_cache_backend: disk + + +##### Syndic settings ##### +########################################## +# The Salt syndic is used to pass commands through a master from a higher +# master. Using the syndic is simple. If this is a master that will have +# syndic servers(s) below it, then set the "order_masters" setting to True. +# +# If this is a master that will be running a syndic daemon for passthrough, then +# the "syndic_master" setting needs to be set to the location of the master server +# to receive commands from. + +# Set the order_masters setting to True if this master will command lower +# masters' syndic interfaces. +#order_masters: False + +# If this master will be running a salt syndic daemon, syndic_master tells +# this master where to receive commands from. +#syndic_master: masterofmasters + +# This is the 'ret_port' of the MasterOfMaster: +#syndic_master_port: 4506 + +# PID file of the syndic daemon: +#syndic_pidfile: /var/run/salt-syndic.pid + +# The log file of the salt-syndic daemon: +#syndic_log_file: /var/log/salt/syndic + +# The behaviour of the multi-syndic when connection to a master of masters failed. +# Can specify ``random`` (default) or ``ordered``. If set to ``random``, masters +# will be iterated in random order. If ``ordered`` is specified, the configured +# order will be used. +#syndic_failover: random + +# The number of seconds for the salt client to wait for additional syndics to +# check in with their lists of expected minions before giving up. +#syndic_wait: 5 + + +##### Peer Publish settings ##### +########################################## +# Salt minions can send commands to other minions, but only if the minion is +# allowed to. By default "Peer Publication" is disabled, and when enabled it +# is enabled for specific minions and specific commands. This allows secure +# compartmentalization of commands based on individual minions. + +# The configuration uses regular expressions to match minions and then a list +# of regular expressions to match functions. The following will allow the +# minion authenticated as foo.example.com to execute functions from the test +# and pkg modules. +#peer: +# foo.example.com: +# - test.* +# - pkg.* +# +# This will allow all minions to execute all commands: +#peer: +# .*: +# - .* +# +# This is not recommended, since it would allow anyone who gets root on any +# single minion to instantly have root on all of the minions! + +# Minions can also be allowed to execute runners from the salt master. +# Since executing a runner from the minion could be considered a security risk, +# it needs to be enabled. This setting functions just like the peer setting +# except that it opens up runners instead of module functions. +# +# All peer runner support is turned off by default and must be enabled before +# using. This will enable all peer runners for all minions: +#peer_run: +# .*: +# - .* +# +# To enable just the manage.up runner for the minion foo.example.com: +#peer_run: +# foo.example.com: +# - manage.up +# +# +##### Mine settings ##### +##################################### +# Restrict mine.get access from minions. By default any minion has a full access +# to get all mine data from master cache. In acl definion below, only pcre matches +# are allowed. +# mine_get: +# .*: +# - .* +# +# The example below enables minion foo.example.com to get 'network.interfaces' mine +# data only, minions web* to get all network.* and disk.* mine data and all other +# minions won't get any mine data. +# mine_get: +# foo.example.com: +# - network.interfaces +# web.*: +# - network.* +# - disk.* + + +##### Logging settings ##### +########################################## +# The location of the master log file +# The master log can be sent to a regular file, local path name, or network +# location. Remote logging works best when configured to use rsyslogd(8) (e.g.: +# ``file:///dev/log``), with rsyslogd(8) configured for network logging. The URI +# format is: <file|udp|tcp>://<host|socketpath>:<port-if-required>/<log-facility> +#log_file: /var/log/salt/master +#log_file: file:///dev/log +#log_file: udp://loghost:10514 + +#log_file: /var/log/salt/master +#key_logfile: /var/log/salt/key + +# The level of messages to send to the console. +# One of 'garbage', 'trace', 'debug', info', 'warning', 'error', 'critical'. +# +# The following log levels are considered INSECURE and may log sensitive data: +# ['garbage', 'trace', 'debug'] +# +#log_level: warning + +# The level of messages to send to the log file. +# One of 'garbage', 'trace', 'debug', info', 'warning', 'error', 'critical'. +# If using 'log_granular_levels' this must be set to the highest desired level. +#log_level_logfile: warning + +# The date and time format used in log messages. Allowed date/time formatting +# can be seen here: http://docs.python.org/library/time.html#time.strftime +#log_datefmt: '%H:%M:%S' +#log_datefmt_logfile: '%Y-%m-%d %H:%M:%S' + +# The format of the console logging messages. Allowed formatting options can +# be seen here: http://docs.python.org/library/logging.html#logrecord-attributes +# +# Console log colors are specified by these additional formatters: +# +# %(colorlevel)s +# %(colorname)s +# %(colorprocess)s +# %(colormsg)s +# +# Since it is desirable to include the surrounding brackets, '[' and ']', in +# the coloring of the messages, these color formatters also include padding as +# well. Color LogRecord attributes are only available for console logging. +# +#log_fmt_console: '%(colorlevel)s %(colormsg)s' +#log_fmt_console: '[%(levelname)-8s] %(message)s' +# +#log_fmt_logfile: '%(asctime)s,%(msecs)03d [%(name)-17s][%(levelname)-8s] %(message)s' + +# This can be used to control logging levels more specificically. This +# example sets the main salt library at the 'warning' level, but sets +# 'salt.modules' to log at the 'debug' level: +# log_granular_levels: +# 'salt': 'warning' +# 'salt.modules': 'debug' +# +#log_granular_levels: {} + + +##### Node Groups ###### +########################################## +# Node groups allow for logical groupings of minion nodes. A group consists of +# a group name and a compound target. Nodgroups can reference other nodegroups +# with 'N@' classifier. Ensure that you do not have circular references. +# +#nodegroups: +# group1: 'L@foo.domain.com,bar.domain.com,baz.domain.com or bl*.domain.com' +# group2: 'G@os:Debian and foo.domain.com' +# group3: 'G@os:Debian and N@group1' +# group4: +# - 'G@foo:bar' +# - 'or' +# - 'G@foo:baz' + + +##### Range Cluster settings ##### +########################################## +# The range server (and optional port) that serves your cluster information +# https://github.com/ytoolshed/range/wiki/%22yamlfile%22-module-file-spec +# +#range_server: range:80 + + +##### Windows Software Repo settings ##### +########################################### +# Location of the repo on the master: +#winrepo_dir_ng: '/srv/salt/win/repo-ng' +# +# List of git repositories to include with the local repo: +#winrepo_remotes_ng: +# - 'https://github.com/saltstack/salt-winrepo-ng.git' + + +##### Windows Software Repo settings - Pre 2015.8 ##### +######################################################## +# Legacy repo settings for pre-2015.8 Windows minions. +# +# Location of the repo on the master: +#winrepo_dir: '/srv/salt/win/repo' +# +# Location of the master's repo cache file: +#winrepo_mastercachefile: '/srv/salt/win/repo/winrepo.p' +# +# List of git repositories to include with the local repo: +#winrepo_remotes: +# - 'https://github.com/saltstack/salt-winrepo.git' + + +##### Returner settings ###### +############################################ +# Which returner(s) will be used for minion's result: +#return: mysql + + +###### Miscellaneous settings ###### +############################################ +# Default match type for filtering events tags: startswith, endswith, find, regex, fnmatch +#event_match_type: startswith + +# Save runner returns to the job cache +#runner_returns: True + +# Permanently include any available Python 3rd party modules into Salt Thin +# when they are generated for Salt-SSH or other purposes. +# The modules should be named by the names they are actually imported inside the Python. +# The value of the parameters can be either one module or a comma separated list of them. +#thin_extra_mods: foo,bar + diff --git a/files/saltstack.list b/files/saltstack.list new file mode 100644 index 0000000..cda4b32 --- /dev/null +++ b/files/saltstack.list @@ -0,0 +1 @@ +deb http://repo.saltstack.com/apt/ubuntu/16.04/amd64/latest xenial main diff --git a/files/slave.jar b/files/slave.jar Binary files differnew file mode 100644 index 0000000..37e0ac5 --- /dev/null +++ b/files/slave.jar diff --git a/inventory_json_develop.rb b/inventory_json_develop.rb new file mode 100755 index 0000000..e4a5938 --- /dev/null +++ b/inventory_json_develop.rb @@ -0,0 +1,49 @@ +#!/usr/bin/ruby + +require "json" +require "yaml" + +def doit() + env_yaml_path = "#{File.dirname($0)}/conf/env.yaml" + if ! File.file?(env_yaml_path) + STDERR.puts "Unable to find env.yaml. Exiting." + exit(1) + end + environ = "" + ["unstable", "develop", "stage", "master"].each do |env| + if File.basename($0).include?(env) + environ = env + break + end + end + if environ == "" + STDERR.puts "Unable to determine environment. Exiting." + exit(1) + end + globs = {} + hostvars = {} + outobj = {} + hosts_arr = [] + yml = YAML.load_file(env_yaml_path) + yml["globals"].each do |key, value| + globs[key] = value + end + yml["environments"].each do |ee| + ee.each do |e, hosts| + if e == environ + hosts.each do |host_hash| + host_hash.each do |host, attributes| + hosts_arr.push(host) + hostvars[host] = globs.merge(attributes) + end + end + end + end + end + outobj["target"] = {"hosts" => hosts_arr} + outobj["_meta"] = {"hostvars" => hostvars} + puts outobj.to_json +end + +doit() +exit(0) diff --git a/inventory_json_master.rb b/inventory_json_master.rb new file mode 100755 index 0000000..e4a5938 --- /dev/null +++ b/inventory_json_master.rb @@ -0,0 +1,49 @@ +#!/usr/bin/ruby + +require "json" +require "yaml" + +def doit() + env_yaml_path = "#{File.dirname($0)}/conf/env.yaml" + if ! File.file?(env_yaml_path) + STDERR.puts "Unable to find env.yaml. Exiting." + exit(1) + end + environ = "" + ["unstable", "develop", "stage", "master"].each do |env| + if File.basename($0).include?(env) + environ = env + break + end + end + if environ == "" + STDERR.puts "Unable to determine environment. Exiting." + exit(1) + end + globs = {} + hostvars = {} + outobj = {} + hosts_arr = [] + yml = YAML.load_file(env_yaml_path) + yml["globals"].each do |key, value| + globs[key] = value + end + yml["environments"].each do |ee| + ee.each do |e, hosts| + if e == environ + hosts.each do |host_hash| + host_hash.each do |host, attributes| + hosts_arr.push(host) + hostvars[host] = globs.merge(attributes) + end + end + end + end + end + outobj["target"] = {"hosts" => hosts_arr} + outobj["_meta"] = {"hostvars" => hostvars} + puts outobj.to_json +end + +doit() +exit(0) diff --git a/inventory_json_stage.rb b/inventory_json_stage.rb new file mode 100755 index 0000000..e4a5938 --- /dev/null +++ b/inventory_json_stage.rb @@ -0,0 +1,49 @@ +#!/usr/bin/ruby + +require "json" +require "yaml" + +def doit() + env_yaml_path = "#{File.dirname($0)}/conf/env.yaml" + if ! File.file?(env_yaml_path) + STDERR.puts "Unable to find env.yaml. Exiting." + exit(1) + end + environ = "" + ["unstable", "develop", "stage", "master"].each do |env| + if File.basename($0).include?(env) + environ = env + break + end + end + if environ == "" + STDERR.puts "Unable to determine environment. Exiting." + exit(1) + end + globs = {} + hostvars = {} + outobj = {} + hosts_arr = [] + yml = YAML.load_file(env_yaml_path) + yml["globals"].each do |key, value| + globs[key] = value + end + yml["environments"].each do |ee| + ee.each do |e, hosts| + if e == environ + hosts.each do |host_hash| + host_hash.each do |host, attributes| + hosts_arr.push(host) + hostvars[host] = globs.merge(attributes) + end + end + end + end + end + outobj["target"] = {"hosts" => hosts_arr} + outobj["_meta"] = {"hostvars" => hostvars} + puts outobj.to_json +end + +doit() +exit(0) diff --git a/inventory_json_unstable.rb b/inventory_json_unstable.rb new file mode 100755 index 0000000..e4a5938 --- /dev/null +++ b/inventory_json_unstable.rb @@ -0,0 +1,49 @@ +#!/usr/bin/ruby + +require "json" +require "yaml" + +def doit() + env_yaml_path = "#{File.dirname($0)}/conf/env.yaml" + if ! File.file?(env_yaml_path) + STDERR.puts "Unable to find env.yaml. Exiting." + exit(1) + end + environ = "" + ["unstable", "develop", "stage", "master"].each do |env| + if File.basename($0).include?(env) + environ = env + break + end + end + if environ == "" + STDERR.puts "Unable to determine environment. Exiting." + exit(1) + end + globs = {} + hostvars = {} + outobj = {} + hosts_arr = [] + yml = YAML.load_file(env_yaml_path) + yml["globals"].each do |key, value| + globs[key] = value + end + yml["environments"].each do |ee| + ee.each do |e, hosts| + if e == environ + hosts.each do |host_hash| + host_hash.each do |host, attributes| + hosts_arr.push(host) + hostvars[host] = globs.merge(attributes) + end + end + end + end + end + outobj["target"] = {"hosts" => hosts_arr} + outobj["_meta"] = {"hostvars" => hostvars} + puts outobj.to_json +end + +doit() +exit(0) diff --git a/ob-deploy-branch.sh b/ob-deploy-branch.sh new file mode 100755 index 0000000..2af4340 --- /dev/null +++ b/ob-deploy-branch.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +branch="${1}" +buildroot="$(pwd)" + +pushd ${buildroot}/conf +cp ${HOME}/env.yaml.openbook . +rm -f env.yaml +ln -s env.yaml.openbook env.yaml +popd +pushd ${buildroot} +ansible-playbook -i inventory_json_${branch}.rb openbook_installer.yaml +popd diff --git a/openbook_docker_slave_installer.yaml b/openbook_docker_slave_installer.yaml new file mode 100644 index 0000000..4f3dd07 --- /dev/null +++ b/openbook_docker_slave_installer.yaml @@ -0,0 +1,3 @@ +--- +- name: "Install Openbook jenkins slave for building docker images" + include: playbooks/install_openbook_docker_slave.yaml diff --git a/openbook_installer.yaml b/openbook_installer.yaml new file mode 100644 index 0000000..3e1f01a --- /dev/null +++ b/openbook_installer.yaml @@ -0,0 +1,3 @@ +--- +- name: "Install Openbook: Docker Edition" + include: playbooks/install_openbook.yaml diff --git a/openbook_stop_start.yaml b/openbook_stop_start.yaml new file mode 100644 index 0000000..045f7a9 --- /dev/null +++ b/openbook_stop_start.yaml @@ -0,0 +1,10 @@ +--- +### +# Use this paybook to stop, start and restart openbook cleanly. +# +# Required variables to be passed in the command line via -e: +# action=[stop|start|restart] +### + +- name: "Stop/Start Openbook" + include: playbooks/stop_start_openbook.yaml diff --git a/playbooks/ansible.yaml b/playbooks/ansible.yaml new file mode 100644 index 0000000..94850fc --- /dev/null +++ b/playbooks/ansible.yaml @@ -0,0 +1,52 @@ +--- +- name: "Install ansible" + hosts: target + tasks: + - name: "Add ansible PPA" + apt_repository: + repo: ppa:ansible/ansible + state: present + + - name: "Update apt" + apt: + update_cache: yes + when: ansible_distribution == "Ubuntu" + + - name: "Install ansible package" + apt: + pkg: "{{ item }}" + state: present + with_items: + - ansible + when: ansible_distribution == "Ubuntu" + + - name: "Update yum cache" + yum: + update_cache: yes + when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS" + + - name: "Install ansible package" + yum: + name: "{{ item }}" + state: present + with_items: + - ansible + when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS" + + - name: "Install ansible package" + portage: + name: "{{ item }}" + state: present + with_items: + - app-admin/ansible + when: ansible_distribution == "Gentoo" + + - name: "Configure ansible" + copy: + src: "../files/{{ item.src }}" + dest: "{{ item.dest }}" + mode: "{{ item.mode }}" + owner: root + group: root + with_items: + - { src: ansible.cfg, dest: /etc/ansible/ansible.cfg, mode: "0644" } diff --git a/playbooks/docker.yaml b/playbooks/docker.yaml new file mode 100644 index 0000000..9ac5499 --- /dev/null +++ b/playbooks/docker.yaml @@ -0,0 +1,88 @@ +--- +- name: "Install docker" + hosts: target + tasks: + - name: "Install kernel extras" + apt: + pkg: "{{ item }}" + state: present + with_items: + - "linux-image-extra-{{ ansible_kernel }}" + - linux-image-extra-virtual + - apt-transport-https + - ca-certificates + - software-properties-common + when: ansible_distribution == "Ubuntu" + + - name: "Install docker apt key" + shell: curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - + when: ansible_distribution == "Ubuntu" + + - name: "Configure docker.list" + copy: + src: "../files/{{ item }}" + dest: "/etc/apt/sources.list.d/{{ item }}" + mode: 0644 + owner: root + group: root + with_items: + - docker.list + when: ansible_distribution == "Ubuntu" + + - name: "Update apt" + apt: + update_cache: yes + when: ansible_distribution == "Ubuntu" + + - name: "Install docker packages" + apt: + pkg: "{{ item }}" + state: present + with_items: + - docker-ce + when: ansible_distribution == "Ubuntu" + + - name: "Install required packages" + yum: + name: "{{ item }}" + state: present + with_items: + - yum-utils + - device-mapper-persistent-data + - lvm2 + when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS" + + - name: "Add docker repository" + shell: yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo + when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS" + + - name: "Update yum cache" + yum: + update_cache: yes + when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS" + + - name: "Install required packages" + yum: + name: "{{ item }}" + state: present + with_items: + - docker-ce + when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS" + + - name: "Install docker" + portage: + package: "{{ item }}" + update: yes + changed_use: yes + with_items: + - app-emulation/docker + when: ansible_distribution == "Gentoo" + + - name: "Enable docker" + service: + name: "{{ item.name }}" + enabled: yes + state: started + runlevel: "{{ item.runlevel }}" + with_items: + - { name: docker, runlevel: default } diff --git a/playbooks/docker_compose.yaml b/playbooks/docker_compose.yaml new file mode 100644 index 0000000..8333a4b --- /dev/null +++ b/playbooks/docker_compose.yaml @@ -0,0 +1,22 @@ +--- +- name: "Install docker-compose" + hosts: target + tasks: + - name: "Install packages" + apt: + pkg: "{{ item }}" + state: present + with_items: + - docker-compose + - apache2-utils + when: ansible_distribution == "Ubuntu" + + - name: "Install packsges" + portage: + package: "{{ item }}" + update: yes + changed_use: yes + with_items: + - app-emulation/docker-compose + - app-admin/apache-tools + when: ansible_distribution == "Gentoo" diff --git a/playbooks/docker_registry.yaml b/playbooks/docker_registry.yaml new file mode 100644 index 0000000..20dfb73 --- /dev/null +++ b/playbooks/docker_registry.yaml @@ -0,0 +1,65 @@ +--- +- name: "Install docker-registry" + hosts: target + tasks: + - name: "Create docker-registry directories" + file: + path: "{{ item.path }}" + state: directory + mode: "{{ item.mode }}" + with_items: + - { path: /root/docker-registry/nginx, mode: "0755" } + - { path: /root/docker-registry/data, mode: "0755" } + + - name: "Create docker-registry files" + template: + src: "../templates/{{ item.src }}" + dest: "{{ item.dest }}" + mode: "{{ item.mode }}" + owner: root + group: root + with_items: + - { src: registry.conf, dest: /root/docker-registry/nginx/registry.conf, mode: "0644" } + + - name: "Create docker-registry files" + copy: + src: "../files/{{ item.src }}" + dest: "{{ item.dest }}" + mode: "{{ item.mode }}" + owner: root + group: root + with_items: + - { src: docker-compose.yaml, dest: /root/docker-registry/docker-compose.yaml, mode: "0644" } + + - name: "Copy SSL certs into nginx directory" + shell: | + cp "/etc/ssl/certs/{{ cn }}.crt" /root/docker-registry/nginx/ + cp "/etc/ssl/certs/{{ cn }}.ca" /root/docker-registry/nginx/ + cp "/etc/ssl/private/{{ cn }}.key" /root/docker-registry/nginx/ + when: ansible_distribution == "Ubuntu" or ansible_distribution == "Gentoo" + + - name: "Create password file" + shell: htpasswd -c -b -s /root/docker-registry/nginx/registry.password '{{ username }}' '{{ password }}' + + - name: "Install init script" + copy: + src: ../files/docker-registry.ubuntu + dest: /etc/init.d/docker-registry + mode: "0755" + when: ansible_distribution == "Ubuntu" + + - name: "Install init script" + copy: + src: ../files/docker-registry.gentoo + dest: /etc/init.d/docker-registry + mode: "0755" + when: ansible_distribution == "Gentoo" + + - name: "Enable docker-registry" + service: + name: "{{ item.name }}" + enabled: yes + state: started + runlevel: "{{ item.runlevel }}" + with_items: + - { name: docker-registry, runlevel: default } diff --git a/playbooks/gradle.yaml b/playbooks/gradle.yaml new file mode 100644 index 0000000..4e7dc6a --- /dev/null +++ b/playbooks/gradle.yaml @@ -0,0 +1,53 @@ +--- +- name: "Install gradle" + hosts: target + tasks: + - name: "Add gradle PPA" + apt_repository: + repo: ppa:cwchien/gradle + state: present + when: ansible_distribution == "Ubuntu" + + - name: "Add nodejs PPA" + shell: curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - + when: ansible_distribution == "Ubuntu" + + - name: "Update apt" + apt: + update_cache: yes + when: ansible_distribution == "Ubuntu" + + - name: "Install packages" + apt: + pkg: "{{ item }}" + state: present + with_items: + - gradle + - nodejs + when: ansible_distribution == "Ubuntu" + + - name: "Update yum cache" + yum: + update_cache: yes + when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS" + + - name: "Install packages" + yum: + name: "{{ item }}" + state: present + with_items: + - gradle + - nodejs + when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS" + + - name: "Install packages" + portage: + name: "{{ item }}" + state: present + with_items: + - dev-java/gradle-bin + - net-libs/nodejs + when: ansible_distribution == "Gentoo" + + - name: "Forcibly upgrade npm" + shell: npm install npm@latest -g diff --git a/playbooks/haveged.yaml b/playbooks/haveged.yaml new file mode 100644 index 0000000..11b2371 --- /dev/null +++ b/playbooks/haveged.yaml @@ -0,0 +1,36 @@ +--- +- name: "Install haveged" + hosts: target + tasks: + - name: "Install haveged package" + apt: + pkg: "{{ item }}" + state: present + with_items: + - haveged + when: ansible_distribution == "Ubuntu" + + - name: "Install haveged package" + yum: + name: "{{ item }}" + state: present + with_items: + - haveged + when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS" + + - name: "Install haveged package" + portage: + name: "{{ item }}" + state: present + with_items: + - sys-apps/haveged + when: ansible_distribution == "Gentoo" + + - name: "Enable haveged" + service: + name: "{{ item.name }}" + enabled: yes + state: started + runlevel: "{{ item.runlevel }}" + with_items: + - { name: haveged, runlevel: default } diff --git a/playbooks/install_docker_registry.yaml b/playbooks/install_docker_registry.yaml new file mode 100644 index 0000000..f22e643 --- /dev/null +++ b/playbooks/install_docker_registry.yaml @@ -0,0 +1,4 @@ +--- +- include: docker.yaml +- include: docker_compose.yaml +- include: docker_registry.yaml diff --git a/playbooks/install_openbook.yaml b/playbooks/install_openbook.yaml new file mode 100644 index 0000000..86d4185 --- /dev/null +++ b/playbooks/install_openbook.yaml @@ -0,0 +1,5 @@ +--- +- include: docker.yaml +- include: haveged.yaml +- include: mysql_client.yaml +- include: openbook.yaml diff --git a/playbooks/install_openbook_docker_slave.yaml b/playbooks/install_openbook_docker_slave.yaml new file mode 100644 index 0000000..ebcec43 --- /dev/null +++ b/playbooks/install_openbook_docker_slave.yaml @@ -0,0 +1,9 @@ +--- +- include: salt.yaml +- include: docker.yaml +- include: mysql_client.yaml +- include: openjdk.yaml +- include: gradle.yaml +- include: jenkins_user.yaml +- include: ssh_keys.yaml +- include: ansible.yaml diff --git a/playbooks/jenkins_user.yaml b/playbooks/jenkins_user.yaml new file mode 100644 index 0000000..14085da --- /dev/null +++ b/playbooks/jenkins_user.yaml @@ -0,0 +1,15 @@ +- name: "Create jenkins user" + hosts: all + tasks: + - name: "Create jenkins group" + group: + name: jenkins + state: present + + - name: "Create jenkins user" + user: + name: jenkins + shell: /bin/bash + comment: "jenkins user" + home: /var/lib/jenkins + group: jenkins diff --git a/playbooks/mysql_client.yaml b/playbooks/mysql_client.yaml new file mode 100644 index 0000000..72e0357 --- /dev/null +++ b/playbooks/mysql_client.yaml @@ -0,0 +1,60 @@ +--- +- name: "Install mysql client" + hosts: target + tasks: + - name: "Install mariadb apt key" + shell: apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 + when: ansible_distribution == "Ubuntu" + + - name: "Configure mariadb.list" + copy: + src: "../files/{{ item }}" + dest: "/etc/apt/sources.list.d/{{ item }}" + mode: 0644 + owner: root + group: root + with_items: + - mariadb.list + when: ansible_distribution == "Ubuntu" + + - name: "Update apt" + apt: + update_cache: yes + when: ansible_distribution == "Ubuntu" + + - name: "Install mariadb-client package" + apt: + pkg: "{{ item }}" + state: present + with_items: + - mariadb-client-10.2 + when: ansible_distribution == "Ubuntu" + + - name: "Add mariadb repository" + yum_repository: + name: MariaDB + description: MariaDB + baseurl: http://yum.mariadb.org/10.2/centos7-amd64 + gpgkey: https://yum.mariadb.org/RPM-GPG-KEY-MariaDB + when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS" + + - name: "Update yum cache" + yum: + update_cache: yes + when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS" + + - name: "Install mariadb-client package" + yum: + name: "{{ item }}" + state: present + with_items: + - MariaDB-client + when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS" + + - name: "Install mariadb-client package" + portage: + name: "{{ item }}" + state: present + with_items: + - dev-db/mariadb + when: ansible_distribution == "Gentoo" diff --git a/playbooks/openbook.yaml b/playbooks/openbook.yaml new file mode 100644 index 0000000..e7609cb --- /dev/null +++ b/playbooks/openbook.yaml @@ -0,0 +1,212 @@ +--- +- name: "Install Openbook" + hosts: target + tasks: + - name: "Install network tools" + apt: + pkg: "{{ item }}" + state: present + with_items: + - netcat-openbsd + - lsof + when: ansible_distribution == "Ubuntu" + + - name: "Install network tools" + yum: + name: "{{ item }}" + state: present + with_items: + - nmap-ncat + - lsof + when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS" + + - name: "Install network tools" + portage: + package: "{{ item }}" + update: yes + changed_use: yes + with_items: + - net-analyzer/netcat + - sys-process/lsof + when: ansible_distribution == "Gentoo" + + - name: "Write hosts entry" + lineinfile: + dest: /etc/hosts + regexp: "{{ item.regexp }}" + line: "{{ item.line }}" + with_items: + - { regexp: '^127\.0\.0\.1.*$', line: "127.0.0.1 localhost {{ ansible_nodename }}" } + + - name: "Create Openbook directories" + file: + path: "{{ item.path }}" + state: directory + mode: "{{ item.mode }}" + with_items: + - { path: /opt/openbook/database, mode: "0755" } + - { path: /opt/openbook/job_scheduler_server, mode: "0755" } + - { path: /opt/openbook/workflow_server, mode: "0755" } + - { path: /opt/openbook/admin_api_server, mode: "0755" } + - { path: /opt/openbook/customer_api_server, mode: "0755" } + - { path: /opt/openbook/admin_web_ui, mode: "0755" } + - { path: /opt/openbook/customer_web_ui, mode: "0755" } + - { path: /etc/openbook/database/conf.d, mode: "0755" } + - { path: /etc/openbook/database/bin, mode: "0755" } + - { path: /var/lib/mysql, mode: "0777" } + - { path: /var/log/mysql, mode: "0777" } + - { path: /etc/openbook/job-scheduler-server, mode: "0777" } + - { path: /etc/openbook/workflow-server, mode: "0777" } + - { path: /etc/openbook/admin-api-server, mode: "0777" } + - { path: /etc/openbook/customer-api-server, mode: "0777" } + - { path: /etc/openbook/admin-web-ui, mode: "0777" } + - { path: /etc/openbook/customer-web-ui, mode: "0777" } + - { path: /var/log/openbook/job-scheduler-server/job-scheduler-server.log, mode: "0777" } + - { path: /var/log/openbook/workflow-server/workflow-server.log, mode: "0777" } + - { path: /var/log/openbook/admin-api-server/admin-api-server.log, mode: "0777" } + - { path: /var/log/openbook/customer-api-server/customer-api-server.log, mode: "0777" } + - { path: /var/log/openbook/admin-web-ui/admin-web-ui.log, mode: "0777" } + - { path: /var/log/openbook/customer-web-ui/customer-web-ui.log, mode: "0777" } + + - name: "Create Openbook files" + template: + src: "../templates/{{ item.src }}" + dest: "{{ item.dest }}" + mode: "{{ item.mode }}" + owner: root + group: root + with_items: + - { src: ci/./openbookctl, dest: /opt/openbook/openbookctl, mode: "0755" } + - { src: database/./run.sh, dest: /opt/openbook/database/run.sh, mode: "0755" } + - { src: job_scheduler_server/./run.sh, dest: /opt/openbook/job_scheduler_server/run.sh, mode: "0755" } + - { src: workflow_server/./run.sh, dest: /opt/openbook/workflow_server/run.sh, mode: "0755" } + - { src: admin_api_server/./run.sh, dest: /opt/openbook/admin_api_server/run.sh, mode: "0755" } + - { src: customer_api_server/./run.sh, dest: /opt/openbook/customer_api_server/run.sh, mode: "0755" } + - { src: admin_web_ui/./run.sh, dest: /opt/openbook/admin_web_ui/run.sh, mode: "0755" } + - { src: customer_web_ui/./run.sh, dest: /opt/openbook/customer_web_ui/run.sh, mode: "0755" } + - { src: job_scheduler_server//etc/openbook/job-scheduler-server/job-scheduler-server.json, dest: /etc/openbook/job-scheduler-server/job-scheduler-server.json, mode: "0644" } + - { src: workflow_server//etc/openbook/workflow-server/workflow-server.json, dest: /etc/openbook/workflow-server/workflow-server.json, mode: "0644" } + - { src: admin_api_server//etc/openbook/admin-api-server/admin-api-server.json, dest: /etc/openbook/admin-api-server/admin-api-server.json, mode: "0644" } + - { src: customer_api_server//etc/openbook/customer-api-server/customer-api-server.json, dest: /etc/openbook/customer-api-server/customer-api-server.json, mode: "0644" } + - { src: admin_web_ui//etc/openbook/admin-web-ui/admin-web-ui.json, dest: /etc/openbook/admin-web-ui/admin-web-ui.json, mode: "0644" } + - { src: customer_web_ui//etc/openbook/customer-web-ui/customer-web-ui.json, dest: /etc/openbook/customer-web-ui/customer-web-ui.json, mode: "0644" } + - { src: database//root/.my.cnf, dest: /root/.my.cnf, mode: "0644" } + - { src: database//etc/openbook/database/create_openbook_schemas.sql, dest: /etc/openbook/database/create_openbook_schemas.sql, mode: "0755" } + - { src: database//etc/openbook/database/debian.cnf, dest: /etc/openbook/database/debian.cnf, mode: "0644" } + - { src: database//etc/openbook/database/conf.d/cluster.cnf, dest: /etc/openbook/database/conf.d/cluster.cnf, mode: "0644" } + - { src: database//etc/openbook/database/conf.d/debconfrc, dest: /etc/openbook/database/conf.d/debconfrc, mode: "0644" } + - { src: database//etc/openbook/database/bin/fix_permissions.sh, dest: /etc/openbook/database/bin/fix_permissions.sh, mode: "0755" } + - { src: database//etc/openbook/database/bin/start_galera_node.sh, dest: /etc/openbook/database/bin/start_galera_node.sh, mode: "0755" } + + - name: "Create Openbook files" + copy: + src: "../files/{{ item.src }}" + dest: "{{ item.dest }}" + mode: "{{ item.mode }}" + owner: root + group: root + with_items: + - { src: ci/./cloudcfg.sh, dest: /opt/openbook/cloudcfg.sh, mode: "0755" } + - { src: database//etc/openbook/database/my.cnf, dest: /etc/openbook/database/my.cnf, mode: "0644" } + + - name: "Create Openbook init script: Ubuntu" + template: + src: "../templates/{{ item.src }}" + dest: "{{ item.dest }}" + mode: "{{ item.mode }}" + owner: root + group: root + with_items: + - { src: ci/./openbook.ubuntu, dest: /etc/init.d/openbook, mode: "0755" } + when: ansible_distribution == "Ubuntu" + + - name: "Create Openbook init script: Redhat" + template: + src: "../templates/{{ item.src }}" + dest: "{{ item.dest }}" + mode: "{{ item.mode }}" + owner: root + group: root + with_items: + - { src: ci/./openbook.redhat, dest: /etc/init.d/openbook, mode: "0755" } + when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS" + + - name: "Create Openbook init script: Gentoo" + template: + src: "../templates/{{ item.src }}" + dest: "{{ item.dest }}" + mode: "{{ item.mode }}" + owner: root + group: root + with_items: + - { src: ci/./openbook.gentoo, dest: /etc/init.d/openbook, mode: "0755" } + when: ansible_distribution == "Gentoo" + + - name: "Add service script to systemd" + shell: systemctl enable openbook + when: ansible_distribution == "Ubuntu" or ansible_distribution == "RedHat" or ansible_distribution == "CentOS" + + - name: "Enable openbook service" + service: + name: "{{ item.name }}" + enabled: yes + runlevel: "{{ item.runlevel }}" + with_items: + - { name: openbook, runlevel: default } + +- name: "Stop Openbook" + hosts: "{{ groups['target']|sort(reverse=True) }}" + serial: 1 + tasks: + - name: "Stop Openbook" + shell: | + /etc/init.d/openbook stop + for cont in $(docker ps | grep -v 'COMMAND' | awk '{print $1}'); do + docker stop ${cont} + done + docker container prune -f + +- name: "Install Openbook" + hosts: target + tasks: + - name: "Delete existing docker images" + shell: | + /opt/openbook/openbookctl stop || true + for i in $(docker images | grep -v CREATED | awk '{print $3}'); do + docker rmi --force $i + done + docker container prune -f + ignore_errors: True + + - name: "Pull docker images" + shell: | + docker login --username "{{ openbook_docker_registry_username }}" --password "{{ openbook_docker_registry_password }}" "{{ openbook_docker_registry_url }}" + if [ "{{ openbook_install_database|string() }}" == "True" ]; then + docker pull "{{ openbook_docker_registry_url }}/openbook_database" + fi + if [ "{{ openbook_install_job_scheduler_server|string() }}" == "True" ]; then + docker pull "{{ openbook_docker_registry_url }}/openbook_job_scheduler_server_unstable" + fi + if [ "{{ openbook_install_workflow_server|string() }}" == "True" ]; then + docker pull "{{ openbook_docker_registry_url }}/openbook_workflow_server_unstable" + fi + if [ "{{ openbook_install_admin_api_server|string() }}" == "True" ]; then + docker pull "{{ openbook_docker_registry_url }}/openbook_admin_api_server_unstable" + fi + if [ "{{ openbook_install_customer_api_server|string() }}" == "True" ]; then + docker pull "{{ openbook_docker_registry_url }}/openbook_customer_api_server_unstable" + fi + if [ "{{ openbook_install_admin_web_ui|string() }}" == "True" ]; then + docker pull "{{ openbook_docker_registry_url }}/openbook_admin_web_ui_unstable" + fi + if [ "{{ openbook_install_customer_web_ui|string() }}" == "True" ]; then + docker pull "{{ openbook_docker_registry_url }}/openbook_customer_web_ui_unstable" + fi + +- name: "Start Openbook" + hosts: "{{ groups['target']|sort }}" + serial: 1 + tasks: + - name: "Start Openbook" + shell: /etc/init.d/openbook start + when: openbook_start_app == True diff --git a/playbooks/openjdk.yaml b/playbooks/openjdk.yaml new file mode 100644 index 0000000..00c7d90 --- /dev/null +++ b/playbooks/openjdk.yaml @@ -0,0 +1,59 @@ +--- +- name: "Install openjdk" + hosts: target + tasks: + - name: "Update apt" + apt: + update_cache: yes + when: ansible_distribution == "Ubuntu" + + - name: "Install openjdk package" + apt: + pkg: "{{ item }}" + state: present + with_items: + - openjdk-8-jdk-headless + when: ansible_distribution == "Ubuntu" + + - name: "Update yum cache" + yum: + update_cache: yes + when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS" + + - name: "Install openjdk package" + yum: + name: "{{ item }}" + state: present + with_items: + - openjdk + when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS" + + - name: "Install icedtea package" + portage: + name: "{{ item }}" + state: present + with_items: + - dev-java/icedtea:8 + when: ansible_distribution == "Gentoo" + + - name: "Set icedtea-8 as default java" + shell: java-config -S icedtea-8 + when: ansible_distribution == "Gentoo" + + - name: "/dev/urandom fix" + lineinfile: + dest: "/etc/java-8-openjdk/security/java.security" + regexp: "{{ item.regexp }}" + line: "{{ item.line }}" + with_items: + - { regexp: '^securerandom.source=file:/dev/random.*$', line: "securerandom.source=file:/dev/urandom" } + when: ansible_distribution == "Ubuntu" + + - name: "/dev/urandom fix" + lineinfile: + dest: "/etc/java-config-2/current-system-vm/jre/lib/security/java.security" + regexp: "{{ item.regexp }}" + line: "{{ item.line }}" + with_items: + - { regexp: '^securerandom.source=file:/dev/random.*$', line: "securerandom.source=file:/dev/urandom" } + when: ansible_distribution == "Gentoo" diff --git a/playbooks/salt.yaml b/playbooks/salt.yaml new file mode 100644 index 0000000..bdf6b7e --- /dev/null +++ b/playbooks/salt.yaml @@ -0,0 +1,96 @@ +--- +- name: "Install salt" + hosts: all + tasks: + - name: "Create salt-master directories" + file: + path: "{{ item }}" + state: directory + mode: 0755 + owner: root + group: root + with_items: + - /srv + - /srv/keys + - /srv/reactor + + - name: "Create salt-master symlinks" + file: + src: "/var/lib/jenkins/workspace/build-docker-container/{{ item }}" + dest: "/srv/{{ item }}" + state: link + force: yes + with_items: + - bootstrap + - pillar + - salt + + - name: "Install salt apt key" + shell: curl -fsSL https://repo.saltstack.com/apt/ubuntu/16.04/amd64/latest/SALTSTACK-GPG-KEY.pub | apt-key add - + when: ansible_distribution == "Ubuntu" + + - name: "Configure saltstack.list" + copy: + src: "../files/{{ item }}" + dest: "/etc/apt/sources.list.d/{{ item }}" + mode: 0644 + owner: root + group: root + with_items: + - saltstack.list + when: ansible_distribution == "Ubuntu" + + - name: "Update apt" + apt: + update_cache: yes + when: ansible_distribution == "Ubuntu" + + - name: "Install salt packages" + apt: + pkg: "{{ item }}" + state: present + with_items: + - jq + - ruby + - salt-master + - salt-minion + when: ansible_distribution == "Ubuntu" + + - name: "Install salt packages" + portage: + package: "{{ item }}" + update: yes + changed_use: yes + with_items: + - app-misc/jq + - dev-lang/ruby + - app-admin/salt + when: ansible_distribution == "Gentoo" + + - name: "Configure salt-master" + copy: + src: "../files/{{ item }}" + dest: "/etc/salt/{{ item }}" + mode: 0644 + owner: root + group: root + with_items: + - master + + - name: "Configure salt-minion" + lineinfile: + dest: "/etc/salt/minion" + regexp: "{{ item.regexp }}" + line: "{{ item.line }}" + with_items: + - { regexp: '^#master:.*$', line: "master: {{ salt_master }}" } + + - name: "Enable salt services" + service: + name: "{{ item.name }}" + enabled: yes + state: started + runlevel: "{{ item.runlevel }}" + with_items: + - { name: salt-master, runlevel: default } + - { name: salt-minion, runlevel: default } diff --git a/playbooks/ssh_keys.yaml b/playbooks/ssh_keys.yaml new file mode 100644 index 0000000..e0046b2 --- /dev/null +++ b/playbooks/ssh_keys.yaml @@ -0,0 +1,39 @@ +--- +- name: "Generate SSH keypair" + hosts: all + vars: + ssh_privkey_path: /root/.ssh/id_rsa + tasks: + - name: "Detect existing SSH privkey" + stat: + path: "{{ ssh_privkey_path }}" + register: ssh_privkey + + - name: "Detect existing SSH pubkey" + stat: + path: "{{ ssh_privkey_path }}.pub" + register: ssh_pubkey + + - name: "Generate SSH keypair" + shell: ssh-keygen -q -t rsa -b 4096 -f "{{ ssh_privkey_path }}" -N '' + when: ssh_privkey.stat.exists == False or ssh_pubkey.stat.exists == False + +- name: "Generate SSH keypair" + hosts: all + become_user: jenkins + vars: + ssh_privkey_path: /var/lib/jenkins/.ssh/id_rsa + tasks: + - name: "Detect existing SSH privkey" + stat: + path: "{{ ssh_privkey_path }}" + register: ssh_privkey + + - name: "Detect existing SSH pubkey" + stat: + path: "{{ ssh_privkey_path }}.pub" + register: ssh_pubkey + + - name: "Generate SSH keypair" + shell: ssh-keygen -q -t rsa -b 4096 -f "{{ ssh_privkey_path }}" -N '' + when: ssh_privkey.stat.exists == False or ssh_pubkey.stat.exists == False diff --git a/playbooks/stop_start_openbook.yaml b/playbooks/stop_start_openbook.yaml new file mode 100644 index 0000000..83c1d57 --- /dev/null +++ b/playbooks/stop_start_openbook.yaml @@ -0,0 +1,28 @@ +--- +- name: "Verify action to take" + hosts: localhost + tasks: + - name: "Check that -e 'action=[stop|start]' was passed in" + fail: msg="The variable 'action' was not passed in with a value of 'stop' or 'start' on the command line." + when: action not in ["stop", "start"] + +- name: "Stop Openbook" + hosts: "{{ groups['target']|sort(reverse=True) }}" + serial: 1 + tasks: + - name: "Stop Openbook" + shell: | + /etc/init.d/openbook stop + for cont in $(docker ps | grep -v 'COMMAND' | awk '{print $1}'); do + docker stop ${cont} + done + docker container prune -f + when: action == "stop" + +- name: "Start Openbook" + hosts: "{{ groups['target']|sort }}" + serial: 1 + tasks: + - name: "Start Openbook" + shell: /etc/init.d/openbook start + when: action == "start" diff --git a/templates/admin_api_server/etc/openbook/admin-api-server/admin-api-server.json b/templates/admin_api_server/etc/openbook/admin-api-server/admin-api-server.json new file mode 100644 index 0000000..2faa9c8 --- /dev/null +++ b/templates/admin_api_server/etc/openbook/admin-api-server/admin-api-server.json @@ -0,0 +1,21 @@ + +{% set ips = openbook_gcomm_addresses.split(",") %} +{% if ips|length > 1 %} +{% set failover = "failover:" %} +{% else %} +{% set failover = "" %} +{% endif %} + + +{ + "log.path": "/var/log/openbook/admin-api-server/admin-api-server.log" + +{% if "True" == openbook_install_admin_api_server|string() %} + ,"entityDS.url": "jdbc:mariadb:{{ failover }}//{{ openbook_gcomm_addresses }}/openbook" + ,"workflowDS.url": "jdbc:mariadb:{{ failover }}//{{ openbook_gcomm_addresses }}/openbook_workflow" + ,"jobsDS.url": "jdbc:mariadb:{{ failover }}//{{ openbook_gcomm_addresses }}/openbook_jobs" + ,"application.port": {{ openbook_admin_api_server_port }} + ,"cluster.interfaces": ["{{ ansible_default_ipv4.address }}"] +{% endif %} + +} diff --git a/templates/admin_api_server/run.sh b/templates/admin_api_server/run.sh new file mode 100755 index 0000000..8270ff3 --- /dev/null +++ b/templates/admin_api_server/run.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +docker run -d --rm --net=host -p {{ openbook_admin_api_server_port }}:8083 -p 5701:5701 -p 5702:5702 -v /etc/openbook/admin-api-server:/etc/openbook/admin-api-server -v /var/log/openbook/admin-api-server:/var/log/openbook/admin-api-server --name admin_api_server_unstable openbook-docker-registry.verizoncloudplatform.com/openbook_admin_api_server_unstable +exit 0 diff --git a/templates/admin_web_ui/etc/openbook/admin-web-ui/admin-web-ui.json b/templates/admin_web_ui/etc/openbook/admin-web-ui/admin-web-ui.json new file mode 100644 index 0000000..c05e4f8 --- /dev/null +++ b/templates/admin_web_ui/etc/openbook/admin-web-ui/admin-web-ui.json @@ -0,0 +1,9 @@ +{ + "log.path": "/var/log/openbook/admin-web-ui/admin-web-ui.log" + +{% if "True" == openbook_install_admin_web_ui|string() %} + ,"application.port": {{ openbook_admin_web_ui_port }} + ,"cluster.interfaces": ["{{ ansible_default_ipv4.address }}"] +{% endif %} + +} diff --git a/templates/admin_web_ui/run.sh b/templates/admin_web_ui/run.sh new file mode 100755 index 0000000..51082d4 --- /dev/null +++ b/templates/admin_web_ui/run.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +docker run -d --rm --net=host -p {{ openbook_admin_web_ui_port }}:8082 -p 5701:5701 -p 5702:5702 -v /etc/openbook/admin-web-ui:/etc/openbook/admin-web-ui -v /var/log/openbook/admin-web-ui:/var/log/openbook/admin-web-ui --name admin_web_ui_unstable openbook-docker-registry.verizoncloudplatform.com/openbook_admin_web_ui_unstable +exit 0 diff --git a/templates/ci/openbook.gentoo b/templates/ci/openbook.gentoo new file mode 100755 index 0000000..430d70d --- /dev/null +++ b/templates/ci/openbook.gentoo @@ -0,0 +1,25 @@ +#!/sbin/openrc-run + +extra_commands=test_database + +depend() { + need docker +} + +start() { + ebegin "Starting Openbook" + /opt/openbook/openbookctl start + eend $? +} + +stop() { + ebegin "Stopping Openbook" + /opt/openbook/openbookctl stop + eend $? +} + +test_database() { + ebegin "Testing database" + /opt/openbook/openbookctl test_database + eend $? +} diff --git a/templates/ci/openbook.redhat b/templates/ci/openbook.redhat new file mode 100755 index 0000000..c4d3040 --- /dev/null +++ b/templates/ci/openbook.redhat @@ -0,0 +1,29 @@ +#!/bin/bash + +# openbook +# +# chkconfig: 2345 10 90 +# description: Manage the Openbook application +# +### BEGIN INIT INFO +# Provides: openbook +# Required-Start: docker +# Required-Stop: docker +# Short-Description: Bring up/down networking +# Description: Manage the Openbook application +### END INIT INFO + +case $1 in + start*) + /opt/openbook/openbookctl start + ;; + stop*) + /opt/openbook/openbookctl stop + ;; + test_database*) + /opt/openbook/openbookctl test_database + ;; + *) + /opt/openbook/openbookctl help + ;; +esac diff --git a/templates/ci/openbook.ubuntu b/templates/ci/openbook.ubuntu new file mode 100755 index 0000000..02900fa --- /dev/null +++ b/templates/ci/openbook.ubuntu @@ -0,0 +1,25 @@ +#!/bin/sh + +### BEGIN INIT INFO +# Provides: openbook +# Required-Start: docker +# Required-Stop: docker +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Manage the Openbook application +### END INIT INFO + +case $1 in + start*) + /opt/openbook/openbookctl start + ;; + stop*) + /opt/openbook/openbookctl stop + ;; + test_database*) + /opt/openbook/openbookctl test_database + ;; + *) + /opt/openbook/openbookctl help + ;; +esac diff --git a/templates/ci/openbookctl b/templates/ci/openbookctl new file mode 100755 index 0000000..0563a16 --- /dev/null +++ b/templates/ci/openbookctl @@ -0,0 +1,114 @@ +#!/bin/bash + +echo 'mysql root password: {{ openbook_database_password }}' +echo 'wsrep_node_address: {{ ansible_default_ipv4.address }}' +echo 'wsrep_cluster_address: gcomm://{{ openbook_gcomm_addresses }}' + +{% if "True" == openbook_install_database|string() %} +wait_for_database() { + echo "Waiting for database to start..." + started=1 + for i in {120..0}; do + if echo 'SELECT 1' | mysql -h 127.0.0.1 -u root --password='{{ openbook_database_password }}' &>/dev/null; then + started=0 + break + fi + sleep 1 + done + if [ $started -eq 1 ]; then + echo "Error: database did not start." + exit 1 + fi +} + +ensure_openbook_databases_created() { + if ! echo "SHOW DATABASES;" | mysql -h 127.0.0.1 -u root --password='{{ openbook_database_password }}' 2>/dev/null | fgrep 'openbook'; then + echo "Creating Openbook schema..." + mysql -h 127.0.0.1 -u root --password='{{ openbook_database_password }}' &>/dev/null < /etc/openbook/database/create_openbook_schemas.sql + fi +} +{% endif %} + +do_start() { +{% if "True" == openbook_install_database|string() %} + chmod 777 /var/lib/mysql + chmod 777 /var/log/mysql + /opt/openbook/database/run.sh + wait_for_database + ensure_openbook_databases_created +{% endif %} +{% if "True" == openbook_install_job_scheduler_server|string() %} + /opt/openbook/job_scheduler_server/run.sh +{% endif %} +{% if "True" == openbook_install_workflow_server|string() %} + /opt/openbook/workflow_server/run.sh +{% endif %} +{% if "True" == openbook_install_admin_api_server|string() %} + /opt/openbook/admin_api_server/run.sh +{% endif %} +{% if "True" == openbook_install_customer_api_server|string() %} + /opt/openbook/customer_api_server/run.sh +{% endif %} +{% if "True" == openbook_install_admin_web_ui|string() %} + /opt/openbook/admin_web_ui/run.sh +{% endif %} +{% if "True" == openbook_install_customer_web_ui|string() %} + /opt/openbook/customer_web_ui/run.sh +{% endif %} + echo + echo "Openbook started. All components may not be fully initialized and available." +} + +do_stop() { +{% if "True" == openbook_install_customer_web_ui|string() %} + docker stop customer_web_ui_unstable +{% endif %} +{% if "True" == openbook_install_admin_web_ui|string() %} + docker stop admin_web_ui_unstable +{% endif %} +{% if "True" == openbook_install_customer_api_server|string() %} + docker stop customer_api_server_unstable +{% endif %} +{% if "True" == openbook_install_admin_api_server|string() %} + docker stop admin_api_server_unstable +{% endif %} +{% if "True" == openbook_install_workflow_server|string() %} + docker stop workflow_server_unstable +{% endif %} +{% if "True" == openbook_install_job_scheduler_server|string() %} + docker stop job_scheduler_server_unstable +{% endif %} +{% if "True" == openbook_install_database|string() %} + docker stop database +{% endif %} + docker container prune -f +} + +do_help() { + echo "Usage:" + echo " $0 start" + echo " $0 stop" +{% if "True" == openbook_install_database|string() %} + echo " $0 test_database" +{% endif %} +} + +case $1 in + start*) + do_start + ;; + stop*) + do_stop + ;; +{% if "True" == openbook_install_database|string() %} + test_database*) + wait_for_database + echo "Database is up." + ;; +{% endif %} + *) + do_help + ;; +esac + +exit 0 diff --git a/templates/customer_api_server/etc/openbook/customer-api-server/customer-api-server.json b/templates/customer_api_server/etc/openbook/customer-api-server/customer-api-server.json new file mode 100644 index 0000000..caa52eb --- /dev/null +++ b/templates/customer_api_server/etc/openbook/customer-api-server/customer-api-server.json @@ -0,0 +1,21 @@ + +{% set ips = openbook_gcomm_addresses.split(",") %} +{% if ips|length > 1 %} +{% set failover = "failover:" %} +{% else %} +{% set failover = "" %} +{% endif %} + + +{ + "log.path": "/var/log/openbook/customer-api-server/customer-api-server.log" + +{% if "True" == openbook_install_customer_api_server|string() %} + ,"entityDS.url": "jdbc:mariadb:{{ failover }}//{{ openbook_gcomm_addresses }}/openbook" + ,"workflowDS.url": "jdbc:mariadb:{{ failover }}//{{ openbook_gcomm_addresses }}/openbook_workflow" + ,"jobsDS.url": "jdbc:mariadb:{{ failover }}//{{ openbook_gcomm_addresses }}/openbook_jobs" + ,"application.port": {{ openbook_customer_api_server_port }} + ,"cluster.interfaces": ["{{ ansible_default_ipv4.address }}"] + {% endif %} + +} diff --git a/templates/customer_api_server/run.sh b/templates/customer_api_server/run.sh new file mode 100755 index 0000000..f773510 --- /dev/null +++ b/templates/customer_api_server/run.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +docker run -d --rm --net=host -p {{ openbook_customer_api_server_port }}:8081 -p 5701:5701 -p 5702:5702 -v /etc/openbook/customer-api-server:/etc/openbook/customer-api-server -v /var/log/openbook/customer-api-server:/var/log/openbook/customer-api-server --name customer_api_server_unstable openbook-docker-registry.verizoncloudplatform.com/openbook_customer_api_server_unstable +exit 0 diff --git a/templates/customer_web_ui/etc/openbook/customer-web-ui/customer-web-ui.json b/templates/customer_web_ui/etc/openbook/customer-web-ui/customer-web-ui.json new file mode 100644 index 0000000..e743a7d --- /dev/null +++ b/templates/customer_web_ui/etc/openbook/customer-web-ui/customer-web-ui.json @@ -0,0 +1,9 @@ +{ + "log.path": "/var/log/openbook/customer-web-ui/customer-web-ui.log" + +{% if "True" == openbook_install_customer_web_ui|string() %} + ,"application.port": {{ openbook_customer_web_ui_port }} + ,"cluster.interfaces": ["{{ ansible_default_ipv4.address }}"] +{% endif %} + +} diff --git a/templates/customer_web_ui/run.sh b/templates/customer_web_ui/run.sh new file mode 100755 index 0000000..afd0e86 --- /dev/null +++ b/templates/customer_web_ui/run.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +docker run -d --rm --net=host -p {{ openbook_customer_web_ui_port }}:8080 -p 5701:5701 -p 5702:5702 -v /etc/openbook/customer-web-ui:/etc/openbook/customer-web-ui -v /var/log/openbook/customer-web-ui:/var/log/openbook/customer-web-ui --name customer_web_ui_unstable openbook-docker-registry.verizoncloudplatform.com/openbook_customer_web_ui_unstable +exit 0 diff --git a/templates/database/etc/openbook/database/bin/fix_permissions.sh b/templates/database/etc/openbook/database/bin/fix_permissions.sh new file mode 100755 index 0000000..69f2b75 --- /dev/null +++ b/templates/database/etc/openbook/database/bin/fix_permissions.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +sed -e 's|{{ "{{" }} openbook_database_password {{ "}}" }}|{{ openbook_database_password }}|g' -i /root/.my.cnf + +# wait for mysql to start +for i in {120..0}; do + if echo 'SELECT 1' | mysql &>/dev/null; then + break + fi + sleep 1 +done + +# privilege fixes - must be idempotent! +mysql <<EOF +DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('%', 'localhost', '127.0.0.1', '127.0.2.1', '::', '::1'); +DELETE FROM mysql.user WHERE User=''; +DELETE FROM mysql.db WHERE Db='test' OR Db='test\_%'; +FLUSH PRIVILEGES; +GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY '{{ openbook_database_password }}' WITH GRANT OPTION; +GRANT ALL PRIVILEGES ON *.* TO 'root'@'127.0.0.1' IDENTIFIED BY '{{ openbook_database_password }}' WITH GRANT OPTION; +GRANT ALL PRIVILEGES ON *.* TO 'root'@'::1' IDENTIFIED BY '{{ openbook_database_password }}' WITH GRANT OPTION; +GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '{{ openbook_database_password }}' WITH GRANT OPTION; +GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY '{{ openbook_database_password }}'; +GRANT ALL PRIVILEGES ON openbook.* TO 'openbook'@'localhost' IDENTIFIED BY '{{ openbook_database_password }}'; +GRANT ALL PRIVILEGES ON openbook.* TO 'openbook'@'127.0.0.1' IDENTIFIED BY '{{ openbook_database_password }}'; +GRANT ALL PRIVILEGES ON openbook.* TO 'openbook'@'::1' IDENTIFIED BY '{{ openbook_database_password }}'; +GRANT ALL PRIVILEGES ON openbook.* TO 'openbook'@'%' IDENTIFIED BY '{{ openbook_database_password }}'; +GRANT ALL PRIVILEGES ON openbook_jobs.* TO 'openbook'@'localhost' IDENTIFIED BY '{{ openbook_database_password }}'; +GRANT ALL PRIVILEGES ON openbook_jobs.* TO 'openbook'@'127.0.0.1' IDENTIFIED BY '{{ openbook_database_password }}'; +GRANT ALL PRIVILEGES ON openbook_jobs.* TO 'openbook'@'::1' IDENTIFIED BY '{{ openbook_database_password }}'; +GRANT ALL PRIVILEGES ON openbook_jobs.* TO 'openbook'@'%' IDENTIFIED BY '{{ openbook_database_password }}'; +GRANT ALL PRIVILEGES ON openbook_workflow.* TO 'openbook'@'localhost' IDENTIFIED BY '{{ openbook_database_password }}'; +GRANT ALL PRIVILEGES ON openbook_workflow.* TO 'openbook'@'127.0.0.1' IDENTIFIED BY '{{ openbook_database_password }}'; +GRANT ALL PRIVILEGES ON openbook_workflow.* TO 'openbook'@'::1' IDENTIFIED BY '{{ openbook_database_password }}'; +GRANT ALL PRIVILEGES ON openbook_workflow.* TO 'openbook'@'%' IDENTIFIED BY '{{ openbook_database_password }}'; +FLUSH PRIVILEGES; +EOF + +exit 0 diff --git a/templates/database/etc/openbook/database/bin/start_galera_node.sh b/templates/database/etc/openbook/database/bin/start_galera_node.sh new file mode 100755 index 0000000..ee580d8 --- /dev/null +++ b/templates/database/etc/openbook/database/bin/start_galera_node.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# the mysql database files will be missing if this is the first startup after a fresh install +if [ ! -d "/var/lib/mysql/mysql" ]; then + export DEBIAN_FRONTEND=noninteractive + . /etc/profile + debconf-set-selections /etc/mysql/conf.d/debconfrc + dpkg-reconfigure mariadb-server-10.2 +fi + +/etc/mysql/bin/fix_permissions.sh & +/etc/init.d/xinetd start +exec /usr/sbin/mysqld ${@} diff --git a/templates/database/etc/openbook/database/conf.d/cluster.cnf b/templates/database/etc/openbook/database/conf.d/cluster.cnf new file mode 100644 index 0000000..cbc26a6 --- /dev/null +++ b/templates/database/etc/openbook/database/conf.d/cluster.cnf @@ -0,0 +1,17 @@ +[mysqld] +query_cache_size=0 +default-storage-engine=innodb +query_cache_type=0 +group_concat_max_len=1000000 +innodb_autoinc_lock_mode=2 +innodb_locks_unsafe_for_binlog=1 +binlog_format=row + +[galera] +wsrep_on=ON +wsrep_provider=/usr/lib/galera/libgalera_smm.so +wsrep_cluster_name="openbook_cluster" +wsrep_cluster_address="gcomm://{{ openbook_gcomm_addresses }}" +wsrep_sst_method=rsync +wsrep_node_address="{{ ansible_default_ipv4.address }}" +wsrep_node_name="{{ ansible_hostname }}" diff --git a/templates/database/etc/openbook/database/conf.d/debconfrc b/templates/database/etc/openbook/database/conf.d/debconfrc new file mode 100644 index 0000000..e86387e --- /dev/null +++ b/templates/database/etc/openbook/database/conf.d/debconfrc @@ -0,0 +1,2 @@ +mariadb-server-10.2 mysql-server/root_password password {{ openbook_database_password }} +mariadb-server-10.2 mysql-server/root_password_again password {{ openbook_database_password }} diff --git a/templates/database/etc/openbook/database/create_openbook_schemas.sql b/templates/database/etc/openbook/database/create_openbook_schemas.sql new file mode 100644 index 0000000..d3011e2 --- /dev/null +++ b/templates/database/etc/openbook/database/create_openbook_schemas.sql @@ -0,0 +1,2538 @@ +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `openbook` /*!40100 DEFAULT CHARACTER SET latin1 */; +GRANT ALL PRIVILEGES ON openbook.* TO openbook@'%' IDENTIFIED BY '{{ openbook_database_password }}'; +GRANT ALL PRIVILEGES ON openbook.* TO openbook@localhost IDENTIFIED BY '{{ openbook_database_password }}'; +USE `openbook`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `DATABASECHANGELOG` ( + `ID` varchar(63) NOT NULL, + `AUTHOR` varchar(63) NOT NULL, + `FILENAME` varchar(200) NOT NULL, + `DATEEXECUTED` datetime NOT NULL, + `ORDEREXECUTED` int(11) NOT NULL, + `EXECTYPE` varchar(10) NOT NULL, + `MD5SUM` varchar(35) DEFAULT NULL, + `DESCRIPTION` varchar(255) DEFAULT NULL, + `COMMENTS` varchar(255) DEFAULT NULL, + `TAG` varchar(255) DEFAULT NULL, + `LIQUIBASE` varchar(20) DEFAULT NULL, + `CONTEXTS` varchar(255) DEFAULT NULL, + `LABELS` varchar(255) DEFAULT NULL, + `DEPLOYMENT_ID` varchar(10) DEFAULT NULL, + PRIMARY KEY (`ID`,`AUTHOR`,`FILENAME`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `DATABASECHANGELOGLOCK` ( + `ID` int(11) NOT NULL, + `LOCKED` tinyint(1) NOT NULL, + `LOCKGRANTED` datetime DEFAULT NULL, + `LOCKEDBY` varchar(255) DEFAULT NULL, + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_adhoc_charge` ( + `charge_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `payer_id` int(10) unsigned NOT NULL, + `payer_type` varchar(64) NOT NULL, + `posted_date` datetime(6) NOT NULL, + `product_name` varchar(64) NOT NULL, + `invoice_group` varchar(64) NOT NULL, + `quantity` decimal(36,12) DEFAULT NULL, + `quantity_units` varchar(128) DEFAULT NULL, + `rate` decimal(22,12) DEFAULT NULL, + `charge` decimal(19,2) NOT NULL, + `currency` varchar(3) NOT NULL, + `item_detail` varchar(1024) DEFAULT NULL, + PRIMARY KEY (`charge_id`), + KEY `ix_adhoc_charge_1` (`payer_id`,`payer_type`,`posted_date`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_app_config` ( + `property_group` varchar(128) NOT NULL, + `property_name` varchar(128) NOT NULL, + `property_value` text DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_audit_event` ( + `event_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `event_time` datetime(6) NOT NULL, + `event_type` varchar(32) NOT NULL, + `entity_id` varchar(64) NOT NULL, + `entity_name` varchar(255) DEFAULT NULL, + `entity_type` varchar(45) NOT NULL, + `user_id` varchar(128) DEFAULT NULL, + `event_data` longtext DEFAULT NULL, + PRIMARY KEY (`event_id`), + KEY `ix_audit_event_1` (`event_time`,`event_type`,`entity_id`), + KEY `ix_audit_event_2` (`user_id`,`event_time`) +) ENGINE=InnoDB AUTO_INCREMENT=1801 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_aws_raw_charges` ( + `identity_LineItemId` varchar(64) DEFAULT NULL, + `sync_timestamp` datetime DEFAULT NULL, + `bill_InvoiceId` varchar(64) DEFAULT NULL, + `bill_BillingEntity` varchar(64) DEFAULT NULL, + `bill_BillType` varchar(64) DEFAULT NULL, + `bill_PayerAccountId` varchar(64) DEFAULT NULL, + `bill_BillingPeriodStartDate` varchar(64) DEFAULT NULL, + `bill_BillingPeriodEndDate` varchar(64) DEFAULT NULL, + `lineItem_UsageAccountId` varchar(64) DEFAULT NULL, + `lineItem_LineItemType` varchar(64) DEFAULT NULL, + `lineItem_UsageStartDate` varchar(64) DEFAULT NULL, + `lineItem_UsageEndDate` varchar(64) DEFAULT NULL, + `lineItem_ProductCode` varchar(64) DEFAULT NULL, + `lineItem_UsageType` varchar(64) DEFAULT NULL, + `lineItem_Operation` varchar(64) DEFAULT NULL, + `lineItem_AvailabilityZone` varchar(64) DEFAULT NULL, + `lineItem_ResourceId` varchar(64) DEFAULT NULL, + `lineItem_UsageAmount` decimal(22,12) DEFAULT NULL, + `lineItem_CurrencyCode` varchar(64) DEFAULT NULL, + `lineItem_UnblendedRate` decimal(22,12) DEFAULT NULL, + `lineItem_UnblendedCost` decimal(22,12) DEFAULT NULL, + `lineItem_BlendedRate` decimal(22,12) DEFAULT NULL, + `lineItem_BlendedCost` decimal(22,12) DEFAULT NULL, + `lineItem_LineItemDescription` varchar(256) DEFAULT NULL, + `lineItem_TaxType` varchar(64) DEFAULT NULL, + `product_ProductName` varchar(64) DEFAULT NULL, + `product_availability` varchar(64) DEFAULT NULL, + `product_clockSpeed` varchar(64) DEFAULT NULL, + `product_durability` varchar(64) DEFAULT NULL, + `product_fromLocation` varchar(64) DEFAULT NULL, + `product_fromLocationType` varchar(64) DEFAULT NULL, + `product_group` varchar(64) DEFAULT NULL, + `product_groupDescription` varchar(64) DEFAULT NULL, + `product_instanceFamily` varchar(64) DEFAULT NULL, + `product_instanceType` varchar(64) DEFAULT NULL, + `product_licenseModel` varchar(64) DEFAULT NULL, + `product_location` varchar(64) DEFAULT NULL, + `product_locationType` varchar(64) DEFAULT NULL, + `product_maxIopsBurstPerformance` varchar(64) DEFAULT NULL, + `product_maxIopsvolume` varchar(64) DEFAULT NULL, + `product_maxThroughputvolume` varchar(64) DEFAULT NULL, + `product_maxVolumeSize` varchar(64) DEFAULT NULL, + `product_memory` varchar(64) DEFAULT NULL, + `product_networkPerformance` varchar(64) DEFAULT NULL, + `product_operatingSystem` varchar(64) DEFAULT NULL, + `product_operation` varchar(64) DEFAULT NULL, + `product_physicalProcessor` varchar(64) DEFAULT NULL, + `product_preInstalledSw` varchar(64) DEFAULT NULL, + `product_processorArchitecture` varchar(64) DEFAULT NULL, + `product_processorFeatures` varchar(64) DEFAULT NULL, + `product_productFamily` varchar(64) DEFAULT NULL, + `product_servicecode` varchar(64) DEFAULT NULL, + `product_sku` varchar(64) DEFAULT NULL, + `product_storage` varchar(64) DEFAULT NULL, + `product_storageClass` varchar(64) DEFAULT NULL, + `product_storageMedia` varchar(64) DEFAULT NULL, + `product_tenancy` varchar(64) DEFAULT NULL, + `product_toLocation` varchar(64) DEFAULT NULL, + `product_toLocationType` varchar(64) DEFAULT NULL, + `product_transferType` varchar(64) DEFAULT NULL, + `product_usagetype` varchar(64) DEFAULT NULL, + `product_vcpu` varchar(64) DEFAULT NULL, + `product_volumeType` varchar(64) DEFAULT NULL, + `pricing_term` varchar(64) DEFAULT NULL, + `payer_id` int(10) unsigned NOT NULL, + `payer_type` varchar(64) DEFAULT 'Customer', + `tenant_name` varchar(64) DEFAULT NULL, + `tags` text DEFAULT NULL, + UNIQUE KEY `aws_id` (`lineItem_ResourceId`,`lineItem_UsageType`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_aws_raw_data` ( + `identity_LineItemId` varchar(64) DEFAULT NULL, + `sync_timestamp` datetime DEFAULT NULL, + `bill_InvoiceId` varchar(64) DEFAULT NULL, + `bill_BillingEntity` varchar(64) DEFAULT NULL, + `bill_BillType` varchar(64) DEFAULT NULL, + `bill_PayerAccountId` varchar(64) DEFAULT NULL, + `bill_BillingPeriodStartDate` varchar(64) DEFAULT NULL, + `bill_BillingPeriodEndDate` varchar(64) DEFAULT NULL, + `lineItem_UsageAccountId` varchar(64) DEFAULT NULL, + `lineItem_LineItemType` varchar(64) DEFAULT NULL, + `lineItem_UsageStartDate` varchar(64) DEFAULT NULL, + `lineItem_UsageEndDate` varchar(64) DEFAULT NULL, + `lineItem_ProductCode` varchar(64) DEFAULT NULL, + `lineItem_UsageType` varchar(64) DEFAULT NULL, + `lineItem_Operation` varchar(64) DEFAULT NULL, + `lineItem_AvailabilityZone` varchar(64) DEFAULT NULL, + `lineItem_ResourceId` varchar(64) DEFAULT NULL, + `lineItem_UsageAmount` decimal(22,12) DEFAULT NULL, + `lineItem_CurrencyCode` varchar(64) DEFAULT NULL, + `lineItem_UnblendedRate` decimal(22,12) DEFAULT NULL, + `lineItem_UnblendedCost` decimal(22,12) DEFAULT NULL, + `lineItem_BlendedRate` decimal(22,12) DEFAULT NULL, + `lineItem_BlendedCost` decimal(22,12) DEFAULT NULL, + `lineItem_LineItemDescription` varchar(256) DEFAULT NULL, + `lineItem_TaxType` varchar(64) DEFAULT NULL, + `product_ProductName` varchar(64) DEFAULT NULL, + `product_availability` varchar(64) DEFAULT NULL, + `product_clockSpeed` varchar(64) DEFAULT NULL, + `product_durability` varchar(64) DEFAULT NULL, + `product_fromLocation` varchar(64) DEFAULT NULL, + `product_fromLocationType` varchar(64) DEFAULT NULL, + `product_group` varchar(64) DEFAULT NULL, + `product_groupDescription` varchar(64) DEFAULT NULL, + `product_instanceFamily` varchar(64) DEFAULT NULL, + `product_instanceType` varchar(64) DEFAULT NULL, + `product_licenseModel` varchar(64) DEFAULT NULL, + `product_location` varchar(64) DEFAULT NULL, + `product_locationType` varchar(64) DEFAULT NULL, + `product_maxIopsBurstPerformance` varchar(64) DEFAULT NULL, + `product_maxIopsvolume` varchar(64) DEFAULT NULL, + `product_maxThroughputvolume` varchar(64) DEFAULT NULL, + `product_maxVolumeSize` varchar(64) DEFAULT NULL, + `product_memory` varchar(64) DEFAULT NULL, + `product_networkPerformance` varchar(64) DEFAULT NULL, + `product_operatingSystem` varchar(64) DEFAULT NULL, + `product_operation` varchar(64) DEFAULT NULL, + `product_physicalProcessor` varchar(64) DEFAULT NULL, + `product_preInstalledSw` varchar(64) DEFAULT NULL, + `product_processorArchitecture` varchar(64) DEFAULT NULL, + `product_processorFeatures` varchar(64) DEFAULT NULL, + `product_productFamily` varchar(64) DEFAULT NULL, + `product_servicecode` varchar(64) DEFAULT NULL, + `product_sku` varchar(64) DEFAULT NULL, + `product_storage` varchar(64) DEFAULT NULL, + `product_storageClass` varchar(64) DEFAULT NULL, + `product_storageMedia` varchar(64) DEFAULT NULL, + `product_tenancy` varchar(64) DEFAULT NULL, + `product_toLocation` varchar(64) DEFAULT NULL, + `product_toLocationType` varchar(64) DEFAULT NULL, + `product_transferType` varchar(64) DEFAULT NULL, + `product_usagetype` varchar(64) DEFAULT NULL, + `product_vcpu` varchar(64) DEFAULT NULL, + `product_volumeType` varchar(64) DEFAULT NULL, + `pricing_term` varchar(64) DEFAULT NULL, + `tags` text DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_credit` ( + `credit_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `payer_id` int(10) unsigned NOT NULL, + `payer_type` varchar(64) NOT NULL, + `credit_amount` decimal(19,2) DEFAULT NULL, + `remaining_amount` decimal(19,2) DEFAULT NULL, + `credit_type` varchar(16) NOT NULL, + `granted_by` varchar(256) NOT NULL, + `posted_date` datetime(6) NOT NULL, + `expire_date` datetime(6) NOT NULL, + `currency` varchar(3) NOT NULL, + `memo` varchar(1024) DEFAULT NULL, + PRIMARY KEY (`credit_id`), + KEY `ix_credit_1` (`payer_id`,`payer_type`,`expire_date`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_customer` ( + `customer_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `customer_name` varchar(512) NOT NULL, + `created_via` varchar(128) DEFAULT NULL, + `metadata` text DEFAULT NULL, + `tax_rate` decimal(18,4) DEFAULT 0.0000, + `currency` char(6) DEFAULT NULL, + `discount_percent` decimal(18,4) DEFAULT 0.0000, + `billing_frequency` varchar(40) DEFAULT NULL, + `last_bill_date` datetime(6) DEFAULT NULL, + `next_bill_date` datetime(6) DEFAULT NULL, + `is_active` tinyint(1) DEFAULT 1, + `create_date` datetime(6) DEFAULT NULL, + `activate_date` datetime(6) DEFAULT NULL, + `billing_start_date` datetime(6) DEFAULT NULL, + `last_payment_date` datetime(6) DEFAULT NULL, + `deactivate_date` datetime(6) DEFAULT NULL, + `description` varchar(5120) DEFAULT NULL, + `minimum_invoice_commitment` decimal(19,2) DEFAULT NULL, + `invoicing_method` varchar(32) NOT NULL, + `management_region_id` varchar(64) DEFAULT NULL, + `billing_address_line_1` varchar(512) DEFAULT NULL, + `billing_address_line_2` varchar(512) DEFAULT NULL, + `billing_address_city` varchar(512) DEFAULT NULL, + `billing_address_region` varchar(128) DEFAULT NULL, + `billing_address_country` varchar(2) DEFAULT NULL, + `billing_address_postal_code` varchar(64) DEFAULT NULL, + `payer_payment_details` varchar(5120) DEFAULT '{"PaymentMethod":"None"}', + `payment_method_confirmed` tinyint(1) DEFAULT 0, + `balance_due` decimal(19,2) DEFAULT NULL, + `spend_soft_limit` decimal(12,2) DEFAULT NULL, + `spend_hard_limit` decimal(12,2) DEFAULT NULL, + `terms_and_conditions_2_accept_date` datetime(6) DEFAULT NULL, + `tax_id` varchar(128) DEFAULT NULL, + `registration_number` varchar(128) DEFAULT NULL, + PRIMARY KEY (`customer_id`), + UNIQUE KEY `ix_customer_3` (`management_region_id`,`customer_name`(255)) +) ENGINE=InnoDB AUTO_INCREMENT=315465 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_discount` ( + `discount_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `payer_id` int(10) unsigned NOT NULL, + `payer_type` varchar(64) NOT NULL, + `discount_percent` decimal(5,2) NOT NULL, + `granted_by` varchar(256) NOT NULL, + `apply_to_charge_category` varchar(32) DEFAULT NULL, + `trigger_charge_category` varchar(32) DEFAULT NULL, + `trigger_amount` decimal(19,2) DEFAULT NULL, + `start_date` datetime(6) NOT NULL, + `end_date` datetime(6) NOT NULL, + PRIMARY KEY (`discount_id`), + KEY `ix_discount_1` (`payer_id`,`payer_type`,`end_date`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_email_notification` ( + `message_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `recipient` varchar(128) NOT NULL, + `sender` varchar(128) NOT NULL, + `subject` varchar(256) NOT NULL, + `message_text` longtext NOT NULL, + `smtp_server_details` longtext NOT NULL, + `date_generated` datetime(6) NOT NULL, + `date_sent` datetime(6) DEFAULT NULL, + `date_last_send_attempt` datetime(6) DEFAULT NULL, + `send_status` varchar(16) DEFAULT NULL, + `send_status_detail` varchar(5120) DEFAULT NULL, + `send_attempt_count` smallint(6) DEFAULT NULL, + `payer_id` int(10) unsigned DEFAULT NULL, + `payer_type` varchar(64) DEFAULT NULL, + `message_type` varchar(128) NOT NULL, + PRIMARY KEY (`message_id`), + KEY `ix_email_notification_1` (`recipient`,`date_generated`), + KEY `ix_email_notification_2` (`sender`,`date_generated`), + KEY `ix_email_notification_3` (`date_sent`), + KEY `ix_email_notification_4` (`payer_id`,`payer_type`,`message_type`,`date_sent`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_email_template` ( + `provider_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `template_subject` varchar(256) NOT NULL, + `template_name` varchar(128) NOT NULL, + `template_text` longtext NOT NULL, + PRIMARY KEY (`provider_id`,`template_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_entity_attribute` ( + `entity_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `attribute_class` varchar(32) NOT NULL, + `attribute_category` varchar(128) NOT NULL, + `attribute_name` varchar(128) NOT NULL, + `attribute_value` varchar(512) NOT NULL, + `attribute_unit` varchar(64) DEFAULT NULL, + `add_date` datetime(6) DEFAULT NULL, + `expire_date` datetime(6) NOT NULL, + PRIMARY KEY (`entity_id`,`expire_date`,`attribute_class`,`attribute_category`,`attribute_name`), + KEY `ix_entity_attribute_1` (`attribute_class`), + KEY `ix_entity_attribute_2` (`attribute_category`), + KEY `ix_entity_attribute_3` (`attribute_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_exception_event` ( + `event_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `event_time` datetime(6) NOT NULL, + `event_type` varchar(32) NOT NULL, + `entity_id` varchar(64) NOT NULL, + `entity_name` varchar(255) DEFAULT NULL, + `entity_type` varchar(45) NOT NULL, + `user_id` varchar(128) DEFAULT NULL, + `event_data` longtext DEFAULT NULL, + PRIMARY KEY (`event_id`), + KEY `ix_exception_event_1` (`event_time`,`event_type`,`entity_id`), + KEY `ix_exception_event_2` (`user_id`,`event_time`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_gcp_raw_charges` ( + `accountId` varchar(128) DEFAULT NULL, + `amount` decimal(22,12) DEFAULT NULL, + `cost` varchar(64) DEFAULT NULL, + `creditId` varchar(64) DEFAULT NULL, + `credits` varchar(64) DEFAULT NULL, + `currency` varchar(64) DEFAULT NULL, + `description` varchar(255) DEFAULT NULL, + `endTime` varchar(64) DEFAULT NULL, + `lineItemId` varchar(255) DEFAULT NULL, + `measurementId` varchar(64) DEFAULT NULL, + `measurements` varchar(64) DEFAULT NULL, + `projectId` varchar(64) DEFAULT NULL, + `projectName` varchar(64) DEFAULT NULL, + `projectNumber` varchar(64) DEFAULT NULL, + `startTime` varchar(64) DEFAULT NULL, + `sum` bigint(20) DEFAULT NULL, + `unit` varchar(64) DEFAULT NULL, + `payer_id` int(10) unsigned DEFAULT 0, + `payer_type` varchar(64) DEFAULT 'Customer', + `tenant_name` varchar(64) DEFAULT NULL, + `tags` text DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_host` ( + `host_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `service_manager_id` int(10) unsigned NOT NULL, + `service_region_id` int(10) unsigned NOT NULL, + `host_foreign_id` varchar(256) DEFAULT NULL, + `host_name` varchar(256) NOT NULL, + `hypervisor_type` varchar(64) DEFAULT NULL, + `add_date` datetime(6) NOT NULL, + `remove_date` datetime(6) NOT NULL, + `cpu_allocation_ratio` decimal(6,2) DEFAULT NULL, + `ram_allocation_ratio` decimal(6,2) DEFAULT NULL, + `host_aggregate` varchar(255) DEFAULT NULL, + `disk_allocation_ratio` decimal(6,2) DEFAULT NULL, + PRIMARY KEY (`host_id`), + KEY `ix_host_1` (`service_manager_id`,`service_region_id`,`host_foreign_id`(255)) +) ENGINE=InnoDB AUTO_INCREMENT=1858 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_host_attributes` ( + `host_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `update_date` datetime(6) NOT NULL, + `ram_mb` int(11) NOT NULL, + `ram_mb_used` int(11) NOT NULL, + `disk_gb` int(11) NOT NULL, + `disk_gb_used` int(11) NOT NULL, + `vcpus` int(11) NOT NULL, + `vcpus_used` int(11) NOT NULL, + `vm_count` int(11) NOT NULL, + `socket_count` int(11) NOT NULL, + PRIMARY KEY (`host_id`,`update_date`) +) ENGINE=InnoDB AUTO_INCREMENT=1858 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_invoice` ( + `invoice_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `payer_id` int(10) unsigned NOT NULL, + `payer_type` varchar(64) NOT NULL, + `payer_name` varchar(512) NOT NULL, + `invoice_number` varchar(45) DEFAULT NULL, + `invoice_date` datetime(6) NOT NULL, + `period_begin` datetime(6) NOT NULL, + `period_end` datetime(6) NOT NULL, + `invoice_amount` decimal(19,2) NOT NULL, + `actual_charges` decimal(19,2) NOT NULL, + `invoice_currency` varchar(16) DEFAULT NULL, + `management_region_id` int(10) unsigned NOT NULL, + `balance_due` decimal(19,2) NOT NULL, + `invoice_pdf` longblob DEFAULT NULL, + `payment_processing` tinyint(1) DEFAULT 0, + `payer_metadata` text DEFAULT NULL, + PRIMARY KEY (`invoice_id`), + KEY `ix_invoice_1` (`management_region_id`,`payer_type`,`payer_id`) +) ENGINE=InnoDB AUTO_INCREMENT=12484695 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_invoice_detail` ( + `invoice_id` int(10) unsigned NOT NULL, + `customer_id` int(10) unsigned DEFAULT NULL, + `customer_name` varchar(255) DEFAULT NULL, + `service_region_id` int(10) unsigned DEFAULT NULL, + `service_region_name` varchar(128) DEFAULT NULL, + `rate` decimal(22,12) NOT NULL, + `rate_display` varchar(255) DEFAULT NULL, + `rate_unit` varchar(128) NOT NULL, + `rate_interval` varchar(128) DEFAULT NULL, + `rate_multiplier_percent` decimal(10,6) DEFAULT NULL, + `units_billed` decimal(36,12) DEFAULT NULL, + `units_billed_display` varchar(128) DEFAULT NULL, + `item_invoice_amount` decimal(19,2) NOT NULL, + `item_category` varchar(128) NOT NULL, + `item_group` varchar(128) NOT NULL, + `item_type` varchar(128) NOT NULL, + `item_detail` varchar(512) NOT NULL, + `tenant_id` int(10) unsigned DEFAULT NULL, + `tenant_name` varchar(256) DEFAULT NULL, + `stack_type` varchar(16) DEFAULT NULL, + `service_manager_id` int(10) unsigned DEFAULT NULL, + `service_manager_name` varchar(128) DEFAULT NULL, + `service_instance_metadata` text DEFAULT NULL, + KEY `ix_invoice_detail_1` (`invoice_id`), + KEY `ix_invoice_detail_2` (`customer_id`), + KEY `ix_invoice_detail_4` (`invoice_id`,`customer_name`,`item_group`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_job_status` ( + `job_id` varchar(256) NOT NULL, + `start_time` datetime(6) NOT NULL, + `end_time` datetime(6) DEFAULT NULL, + `status` varchar(32) DEFAULT NULL, + `result` varchar(32) DEFAULT NULL, + `result_detail` longtext DEFAULT NULL, + PRIMARY KEY (`job_id`(255),`start_time`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_lookup_values` ( + `type` varchar(128) NOT NULL, + `name` varchar(256) NOT NULL, + `value` longtext NOT NULL, + PRIMARY KEY (`type`,`name`(255)) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_metadata_attributes` ( + `entity_id` int(10) unsigned NOT NULL, + `entity_type` varchar(32) NOT NULL, + `name` varchar(128) NOT NULL, + `datatype` varchar(16) NOT NULL, + `unit` varchar(16) DEFAULT NULL, + `value_range` text DEFAULT NULL, + PRIMARY KEY (`entity_id`,`entity_type`,`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_metric` ( + `metric_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `service_manager_type_id` int(10) unsigned DEFAULT NULL, + `metric_name` varchar(128) DEFAULT NULL, + `metric_label` varchar(128) DEFAULT NULL, + `metric_source` varchar(32) DEFAULT NULL, + `metric_type` varchar(16) NOT NULL, + `metric_unit` varchar(16) NOT NULL, + `entity_resolution` varchar(32) NOT NULL, + `time_resolution` varchar(16) NOT NULL, + PRIMARY KEY (`metric_id`), + UNIQUE KEY `ix_metric_1` (`service_manager_type_id`,`metric_name`) +) ENGINE=InnoDB AUTO_INCREMENT=56 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_metric_aggregate_customer_daily` ( + `metric_id` int(11) NOT NULL DEFAULT 0, + `customer_id` int(11) NOT NULL DEFAULT 0, + `aggregate_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `min` double DEFAULT NULL, + `max` double DEFAULT NULL, + `avg` double DEFAULT NULL, + `sum` double DEFAULT NULL, + `count` int(11) DEFAULT NULL, + `sum_of_hourly_max` double DEFAULT NULL, + `sum_of_hourly_avg` double DEFAULT NULL, + `diff_of_min_max` double DEFAULT NULL, + `service_region_id` int(10) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`metric_id`,`customer_id`,`service_region_id`,`aggregate_datetime`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 + PARTITION BY RANGE (to_days(`aggregate_datetime`)); +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_metric_aggregate_customer_hourly` ( + `metric_id` int(11) NOT NULL DEFAULT 0, + `customer_id` int(11) NOT NULL DEFAULT 0, + `aggregate_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `min` double DEFAULT NULL, + `max` double DEFAULT NULL, + `avg` double DEFAULT NULL, + `sum` double DEFAULT NULL, + `count` int(11) DEFAULT NULL, + `service_region_id` int(10) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`metric_id`,`customer_id`,`service_region_id`,`aggregate_datetime`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 + PARTITION BY RANGE (to_days(`aggregate_datetime`)); +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_metric_aggregate_customer_monthly` ( + `metric_id` int(11) NOT NULL DEFAULT 0, + `customer_id` int(11) NOT NULL DEFAULT 0, + `aggregate_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `min` double DEFAULT NULL, + `max` double DEFAULT NULL, + `avg` double DEFAULT NULL, + `sum` double DEFAULT NULL, + `count` int(11) DEFAULT NULL, + `sum_of_hourly_max` double DEFAULT NULL, + `sum_of_hourly_avg` double DEFAULT NULL, + `diff_of_min_max` double DEFAULT NULL, + `service_region_id` int(10) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`metric_id`,`customer_id`,`service_region_id`,`aggregate_datetime`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_metric_aggregate_resource_daily` ( + `metric_id` int(11) NOT NULL DEFAULT 0, + `resource_id` int(11) NOT NULL DEFAULT 0, + `resource_foreign_id` varchar(255) NOT NULL DEFAULT '', + `aggregate_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `min` double DEFAULT NULL, + `max` double DEFAULT NULL, + `avg` double DEFAULT NULL, + `sum` double DEFAULT NULL, + `count` int(11) DEFAULT NULL, + `sum_of_hourly_max` double DEFAULT NULL, + `sum_of_hourly_avg` double DEFAULT NULL, + `diff_of_min_max` double DEFAULT NULL, + `service_region_id` int(10) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`metric_id`,`resource_id`,`resource_foreign_id`,`service_region_id`,`aggregate_datetime`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 + PARTITION BY RANGE (to_days(`aggregate_datetime`)); +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_metric_aggregate_resource_hourly` ( + `metric_id` int(11) NOT NULL DEFAULT 0, + `resource_id` int(11) NOT NULL DEFAULT 0, + `resource_foreign_id` varchar(255) NOT NULL DEFAULT '', + `tenant_id` int(11) NOT NULL DEFAULT 0, + `customer_id` int(11) NOT NULL DEFAULT 0, + `aggregate_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `min` double DEFAULT NULL, + `max` double DEFAULT NULL, + `avg` double DEFAULT NULL, + `sum` double DEFAULT NULL, + `count` int(11) DEFAULT NULL, + `service_region_id` int(10) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`metric_id`,`resource_id`,`resource_foreign_id`,`service_region_id`,`aggregate_datetime`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 + PARTITION BY RANGE (to_days(`aggregate_datetime`)); +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_metric_aggregate_resource_monthly` ( + `metric_id` int(11) NOT NULL DEFAULT 0, + `resource_id` int(11) NOT NULL DEFAULT 0, + `resource_foreign_id` varchar(255) NOT NULL DEFAULT '', + `aggregate_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `min` double DEFAULT NULL, + `max` double DEFAULT NULL, + `avg` double DEFAULT NULL, + `sum` double DEFAULT NULL, + `count` int(11) DEFAULT NULL, + `sum_of_hourly_max` double DEFAULT NULL, + `sum_of_hourly_avg` double DEFAULT NULL, + `diff_of_min_max` double DEFAULT NULL, + `service_region_id` int(10) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`metric_id`,`resource_id`,`resource_foreign_id`,`service_region_id`,`aggregate_datetime`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_metric_aggregate_tenant_daily` ( + `metric_id` int(11) NOT NULL DEFAULT 0, + `tenant_id` int(11) NOT NULL DEFAULT 0, + `aggregate_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `min` double DEFAULT NULL, + `max` double DEFAULT NULL, + `avg` double DEFAULT NULL, + `sum` double DEFAULT NULL, + `count` int(11) DEFAULT NULL, + `sum_of_hourly_max` double DEFAULT NULL, + `sum_of_hourly_avg` double DEFAULT NULL, + `diff_of_min_max` double DEFAULT NULL, + `service_region_id` int(10) unsigned NOT NULL DEFAULT 0, + `customer_id` int(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`metric_id`,`tenant_id`,`service_region_id`,`aggregate_datetime`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 + PARTITION BY RANGE (to_days(`aggregate_datetime`)); +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_metric_aggregate_tenant_hourly` ( + `metric_id` int(11) NOT NULL DEFAULT 0, + `tenant_id` int(11) NOT NULL DEFAULT 0, + `customer_id` int(11) NOT NULL DEFAULT 0, + `aggregate_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `min` double DEFAULT NULL, + `max` double DEFAULT NULL, + `avg` double DEFAULT NULL, + `sum` double DEFAULT NULL, + `count` int(11) DEFAULT NULL, + `service_region_id` int(10) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`metric_id`,`tenant_id`,`service_region_id`,`aggregate_datetime`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 + PARTITION BY RANGE (to_days(`aggregate_datetime`)); +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_metric_aggregate_tenant_monthly` ( + `metric_id` int(11) NOT NULL DEFAULT 0, + `tenant_id` int(11) NOT NULL DEFAULT 0, + `aggregate_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `min` double DEFAULT NULL, + `max` double DEFAULT NULL, + `avg` double DEFAULT NULL, + `sum` double DEFAULT NULL, + `count` int(11) DEFAULT NULL, + `sum_of_hourly_max` double DEFAULT NULL, + `sum_of_hourly_avg` double DEFAULT NULL, + `diff_of_min_max` double DEFAULT NULL, + `service_region_id` int(10) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`metric_id`,`tenant_id`,`service_region_id`,`aggregate_datetime`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_metric_values` ( + `metric_id` int(11) NOT NULL, + `resource_id` int(11) DEFAULT NULL, + `resource_foreign_id` varchar(256) DEFAULT NULL, + `service_manager_id` int(11) DEFAULT NULL, + `tenant_id` int(11) DEFAULT NULL, + `tenant_foreign_id` varchar(64) DEFAULT NULL, + `customer_id` int(11) DEFAULT NULL, + `metric_datetime` datetime(6) DEFAULT NULL, + `metric_value` double NOT NULL, + `service_region_id` int(10) unsigned NOT NULL DEFAULT 0, + KEY `ix_metric_values_1` (`metric_id`,`resource_id`,`service_region_id`,`metric_datetime`), + KEY `ix_metric_values_2` (`metric_id`,`tenant_id`,`service_region_id`,`metric_datetime`), + KEY `ix_metric_values_3` (`metric_id`,`customer_id`,`service_region_id`,`metric_datetime`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 + PARTITION BY RANGE (to_days(`metric_datetime`)); +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_parent_child_relationships` ( + `parent_id` int(10) unsigned NOT NULL, + `parent_type` varchar(64) NOT NULL, + `child_id` int(10) unsigned NOT NULL, + `child_type` varchar(64) NOT NULL, + `add_date` datetime(6) NOT NULL, + `remove_date` datetime(6) NOT NULL, + PRIMARY KEY (`parent_id`,`parent_type`,`child_id`,`child_type`,`add_date`,`remove_date`), + KEY `ix_parent_child_relationships_1` (`child_id`,`child_type`), + KEY `ix_parent_child_relationships_2` (`parent_id`,`parent_type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_payment` ( + `payment_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `payer_id` int(10) unsigned NOT NULL, + `payer_type` varchar(64) NOT NULL, + `payment_date` datetime(6) NOT NULL, + `amount` decimal(19,2) NOT NULL, + `payment_method` varchar(64) NOT NULL, + `payment_reference` varchar(256) DEFAULT NULL, + `payment_method_detail` longtext DEFAULT NULL, + `payment_status` varchar(64) DEFAULT NULL, + `payment_status_detail` longtext DEFAULT NULL, + `external_reference` varchar(256) DEFAULT NULL, + PRIMARY KEY (`payment_id`), + KEY `ix_payment_1` (`payer_type`,`payer_id`,`payment_date`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_product` ( + `product_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `product_name` varchar(64) NOT NULL, + `product_type` varchar(16) NOT NULL, + `base_entity_id` int(10) unsigned DEFAULT NULL, + `product_group` varchar(64) NOT NULL, + `product_details` text DEFAULT NULL, + `active_product` tinyint(4) NOT NULL, + `public_product` tinyint(4) NOT NULL, + `management_region_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`product_id`) +) ENGINE=InnoDB AUTO_INCREMENT=91 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_promo_code` ( + `management_region_id` int(10) unsigned NOT NULL, + `promo_code_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `promo_code` varchar(128) NOT NULL, + `salesperson` varchar(128) DEFAULT NULL, + `discount_or_credit` varchar(8) NOT NULL, + `credit_amount` decimal(19,2) DEFAULT NULL, + `credit_type` varchar(16) DEFAULT NULL, + `apply_to_charge_category` varchar(32) DEFAULT NULL, + `trigger_charge_category` varchar(32) DEFAULT NULL, + `trigger_amount` decimal(19,2) DEFAULT NULL, + `discount_percent` decimal(5,2) DEFAULT NULL, + `available_invoice_periods` int(11) DEFAULT NULL, + `expire_date` datetime(6) DEFAULT NULL, + `currency` varchar(3) DEFAULT NULL, + PRIMARY KEY (`promo_code_id`), + UNIQUE KEY `ix_promo_code_3` (`management_region_id`,`promo_code`), + KEY `ix_promo_code_1` (`promo_code`), + KEY `ix_promo_code_2` (`salesperson`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_promo_code_redemption` ( + `promo_code_id` int(10) unsigned NOT NULL, + `payer_id` int(10) unsigned NOT NULL, + `payer_type` varchar(64) NOT NULL, + `redemption_date` datetime(6) DEFAULT NULL, + PRIMARY KEY (`payer_id`,`promo_code_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_properties_schema` ( + `property_group` varchar(128) NOT NULL, + `property_name` varchar(128) NOT NULL, + `default_value` text DEFAULT NULL, + `form_label` varchar(1024) NOT NULL, + `form_order` smallint(6) NOT NULL, + `data_type` varchar(16) NOT NULL, + `data_format` varchar(32) DEFAULT NULL, + `permitted_values` text DEFAULT NULL, + `required` tinyint(4) NOT NULL DEFAULT 0, + `description` varchar(2048) DEFAULT NULL, + `property_type` tinyint(4) NOT NULL DEFAULT 0, + PRIMARY KEY (`property_group`,`property_name`,`property_type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_provider` ( + `provider_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `provider_name` varchar(512) NOT NULL, + `provider_type` varchar(64) NOT NULL, + `metadata` text DEFAULT NULL, + `tax_rate` decimal(18,4) DEFAULT 0.0000, + `currency` char(6) DEFAULT NULL, + `discount_percent` decimal(18,4) DEFAULT 0.0000, + `billing_frequency` varchar(40) DEFAULT NULL, + `last_bill_date` datetime(6) DEFAULT NULL, + `next_bill_date` datetime(6) DEFAULT NULL, + `last_payment_date` datetime(6) DEFAULT NULL, + `is_active` tinyint(1) DEFAULT 1, + `create_date` datetime(6) DEFAULT NULL, + `activate_date` datetime(6) DEFAULT NULL, + `billing_start_date` datetime(6) DEFAULT NULL, + `deactivate_date` datetime(6) DEFAULT NULL, + `description` longtext DEFAULT NULL, + `minimum_invoice_commitment` decimal(19,2) DEFAULT NULL, + `invoicing_method` varchar(32) DEFAULT NULL, + `invoice_processing_method` varchar(32) DEFAULT NULL, + `billing_address_line_1` varchar(512) DEFAULT NULL, + `billing_address_line_2` varchar(512) DEFAULT NULL, + `billing_address_city` varchar(512) DEFAULT NULL, + `billing_address_region` varchar(128) DEFAULT NULL, + `billing_address_country` varchar(2) DEFAULT NULL, + `billing_address_postal_code` varchar(64) DEFAULT NULL, + `legal_address_line_1` varchar(512) DEFAULT NULL, + `legal_address_line_2` varchar(512) DEFAULT NULL, + `legal_address_city` varchar(512) DEFAULT NULL, + `legal_address_region` varchar(128) DEFAULT NULL, + `legal_address_country` varchar(2) DEFAULT NULL, + `legal_address_postal_code` varchar(64) DEFAULT NULL, + `payer_payment_details` varchar(5120) DEFAULT NULL, + `payee_payment_details` varchar(5120) DEFAULT NULL, + `public_url` varchar(512) NOT NULL, + `management_region_id` varchar(64) NOT NULL, + `balance_due` decimal(19,2) DEFAULT NULL, + `openbook_processes_payments` tinyint(1) DEFAULT 0, + `openbook_processes_past_due_invoices` tinyint(1) DEFAULT 0, + `openstack_tenant_id` varchar(36) DEFAULT NULL, + `tax_id` varchar(128) DEFAULT NULL, + `registration_number` varchar(128) DEFAULT NULL, + `os_service_manager_id` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`provider_id`), + UNIQUE KEY `ix_provider_2` (`management_region_id`), + UNIQUE KEY `ix_provider_1` (`public_url`(255)) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_provider_payment_processors` ( + `provider_id` int(10) unsigned NOT NULL, + `processor_name` varchar(128) NOT NULL, + `property_name` varchar(128) NOT NULL, + `property_value` text DEFAULT NULL, + PRIMARY KEY (`provider_id`,`processor_name`,`property_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_provider_properties` ( + `provider_id` int(10) unsigned NOT NULL, + `property_group` varchar(128) NOT NULL, + `property_name` varchar(128) NOT NULL, + `property_value` text DEFAULT NULL, + PRIMARY KEY (`provider_id`,`property_group`,`property_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_provider_region` ( + `provider_id` int(10) unsigned NOT NULL, + `region_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`provider_id`,`region_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_provider_service_manager` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `provider_id` int(11) NOT NULL, + `service_manager_id` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=117 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_rate` ( + `rate_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `rate_plan_id` int(10) unsigned NOT NULL, + `description` varchar(256) DEFAULT NULL, + `product_id` int(10) unsigned NOT NULL, + `service_region_id` int(10) unsigned NOT NULL, + `rate_structure` text NOT NULL, + PRIMARY KEY (`rate_id`), + KEY `ix_rate_1` (`rate_plan_id`) +) ENGINE=InnoDB AUTO_INCREMENT=681 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_rate_plan` ( + `rate_plan_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `rate_plan_name` varchar(255) DEFAULT NULL, + `applies_to` varchar(32) NOT NULL, + `rate_plan_description` varchar(1024) DEFAULT NULL, + `currency` char(6) DEFAULT NULL, + `rate_multiplier_percent` decimal(10,6) DEFAULT NULL, + `management_region_id` varchar(64) NOT NULL, + PRIMARY KEY (`rate_plan_id`), + UNIQUE KEY `ix_rate_plan_2` (`management_region_id`,`rate_plan_name`), + KEY `ix_rate_plan_1` (`management_region_id`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_rate_plan_assignment` ( + `rate_plan_id` int(10) unsigned NOT NULL, + `assignee_id` int(10) unsigned NOT NULL, + `assignee_type` varchar(64) NOT NULL, + `assignment_start_date` datetime(6) NOT NULL, + `assignment_end_date` datetime(6) NOT NULL, + `assignment_type` varchar(64) NOT NULL, + PRIMARY KEY (`rate_plan_id`,`assignee_id`,`assignment_start_date`,`assignment_end_date`), + KEY `ix_rate_plan_assignment_1` (`assignee_type`,`assignee_id`,`assignment_start_date`,`assignment_end_date`), + KEY `ix_rate_plan_assignment_2` (`assignment_type`,`assignee_id`,`assignment_start_date`,`assignment_end_date`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_region` ( + `region_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `region_name` varchar(128) NOT NULL, + `region_type` varchar(64) NOT NULL, + `parent_region_id` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`region_id`), + UNIQUE KEY `ix_region_1` (`parent_region_id`,`region_type`,`region_name`), + KEY `ix_region_2` (`parent_region_id`) +) ENGINE=InnoDB AUTO_INCREMENT=140 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_resource_event` ( + `event_id` varchar(100) NOT NULL, + `event_type` varchar(128) NOT NULL, + `event_date` datetime(6) NOT NULL, + `resource_id` varchar(36) DEFAULT NULL, + `resource_name` varchar(256) DEFAULT NULL, + `resource_foreign_id` varchar(512) DEFAULT NULL, + `customer_id` varchar(36) DEFAULT NULL, + `customer_name` varchar(512) DEFAULT NULL, + `tenant_foreign_id` varchar(512) DEFAULT NULL, + `service_manager_id` int(10) unsigned NOT NULL, + `service_region_id` int(10) unsigned DEFAULT NULL, + `management_region_id` int(10) unsigned DEFAULT NULL, + `tenant_id` int(10) unsigned DEFAULT NULL, + `tenant_name` varchar(512) DEFAULT NULL, + PRIMARY KEY (`service_manager_id`,`event_id`), + KEY `ix_vm_event_1` (`resource_foreign_id`(255),`event_date`), + KEY `ix_vm_event_2` (`customer_id`), + KEY `ix_vm_event_3` (`resource_name`(255),`event_date`), + KEY `ix_vm_event_4` (`service_manager_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_resource_group` ( + `resource_group_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `resource_group_name` varchar(512) NOT NULL, + `resource_group_type` varchar(64) DEFAULT NULL, + `customer_id` int(10) unsigned NOT NULL, + `parent_id` int(10) unsigned NOT NULL, + `parent_type` varchar(64) NOT NULL, + PRIMARY KEY (`resource_group_id`), + KEY `ix_resource_group_1` (`parent_id`), + KEY `ix_resource_group_2` (`customer_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_service` ( + `service_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `service_type` varchar(128) NOT NULL, + `service_description` longtext DEFAULT NULL, + `service_manager_type_id` int(10) unsigned DEFAULT NULL, + `states` text DEFAULT NULL, + `externally_managed` tinyint(4) NOT NULL DEFAULT 1, + PRIMARY KEY (`service_id`), + UNIQUE KEY `ix_service_1` (`service_manager_type_id`,`service_type`) +) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_service_instance` ( + `service_instance_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `service_id` int(10) unsigned NOT NULL, + `service_instance_name` varchar(256) NOT NULL, + `service_manager_id` int(10) unsigned NOT NULL, + `service_region_id` int(10) unsigned NOT NULL DEFAULT 0, + `service_instance_foreign_id` varchar(256) DEFAULT NULL, + `tenant_id` int(10) unsigned DEFAULT NULL, + `current_attributes` text DEFAULT NULL, + PRIMARY KEY (`service_instance_id`), + UNIQUE KEY `ix_provisioned_entity_1` (`service_manager_id`,`service_region_id`,`service_instance_foreign_id`(255)), + KEY `ix_provisioned_entity_3` (`service_manager_id`) +) ENGINE=InnoDB AUTO_INCREMENT=82971 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_service_instance_aggregates` ( + `customer_id` int(10) unsigned NOT NULL DEFAULT 0, + `customer_name` varchar(255) DEFAULT NULL, + `tenant_id` int(10) unsigned NOT NULL DEFAULT 0, + `tenant_name` varchar(255) DEFAULT NULL, + `management_region_id` varchar(128) NOT NULL DEFAULT '', + `service_manager_id` int(10) unsigned NOT NULL, + `service_manager_name` varchar(256) NOT NULL, + `service_region_id` int(10) unsigned NOT NULL, + `service_region_name` varchar(128) NOT NULL, + `aggregate_category` varchar(128) NOT NULL, + `aggregate_name` varchar(128) NOT NULL, + `aggregate_type` varchar(64) NOT NULL, + `aggregate_value` int(11) NOT NULL, + `aggregate_interval` varchar(32) NOT NULL, + `aggregate_datetime` datetime(6) NOT NULL, + PRIMARY KEY (`management_region_id`,`customer_id`,`service_manager_id`,`tenant_id`,`service_region_id`,`aggregate_category`,`aggregate_name`,`aggregate_type`,`aggregate_interval`,`aggregate_datetime`), + KEY `ix_service_instance_aggregates_2` (`service_manager_id`,`service_region_id`,`aggregate_datetime`,`aggregate_name`), + KEY `ix_service_instance_aggregates_3` (`customer_id`,`tenant_id`,`aggregate_datetime`,`aggregate_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_service_instance_attributes` ( + `service_instance_id` int(10) unsigned NOT NULL, + `start_date` datetime(6) NOT NULL, + `end_date` datetime(6) NOT NULL, + `attributes` blob DEFAULT NULL, + UNIQUE KEY `ix_resource_configuration_history_1` (`service_instance_id`,`start_date`,`end_date`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_service_instance_state` ( + `service_instance_id` int(10) unsigned NOT NULL, + `state` varchar(64) NOT NULL, + `start_date` datetime(6) NOT NULL, + `end_date` datetime(6) NOT NULL, + `interval_length_milliseconds` bigint(20) DEFAULT NULL, + PRIMARY KEY (`service_instance_id`,`state`,`start_date`), + KEY `ix_service_instance_state_1` (`service_instance_id`,`state`,`start_date`,`end_date`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_service_manager` ( + `service_manager_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `service_manager_name` varchar(256) NOT NULL, + `service_manager_description` varchar(512) DEFAULT NULL, + `metadata` longtext DEFAULT NULL, + `service_region_id` int(10) unsigned NOT NULL, + `service_manager_type_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`service_manager_id`), + UNIQUE KEY `ix_service_manager_1` (`service_manager_name`(255)) +) ENGINE=InnoDB AUTO_INCREMENT=71 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_service_manager_properties` ( + `service_manager_id` int(10) unsigned NOT NULL, + `property_group` varchar(128) NOT NULL, + `property_name` varchar(128) NOT NULL, + `property_value` text DEFAULT NULL, + PRIMARY KEY (`service_manager_id`,`property_group`,`property_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_service_manager_sync_metrics` ( + `service_manager_id` int(10) unsigned NOT NULL, + `metric_name` varchar(255) NOT NULL, + `metric_value` text NOT NULL, + PRIMARY KEY (`service_manager_id`,`metric_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_service_manager_type` ( + `service_manager_type_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `service_manager_type` varchar(32) NOT NULL, + `service_manager_type_description` varchar(256) DEFAULT NULL, + `system_defined` tinyint(4) NOT NULL DEFAULT 0, + PRIMARY KEY (`service_manager_type_id`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_tenant` ( + `tenant_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `tenant_name` varchar(512) NOT NULL, + `tenant_foreign_id` varchar(512) DEFAULT NULL, + `create_date` datetime(6) NOT NULL, + `deactivate_date` datetime(6) DEFAULT NULL, + `customer_id` int(10) unsigned DEFAULT NULL, + `service_manager_id` int(10) unsigned NOT NULL, + `is_active` tinyint(4) NOT NULL DEFAULT 0, + KEY `ix_tenant_1` (`tenant_id`), + KEY `ix_tenant_2` (`customer_id`), + KEY `ix_tenant_3` (`service_manager_id`) +) ENGINE=InnoDB AUTO_INCREMENT=1958 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_unbilled_charges` ( + `invoice_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `payer_id` int(10) unsigned NOT NULL, + `payer_type` varchar(64) NOT NULL, + `payer_name` varchar(512) NOT NULL, + `invoice_number` varchar(45) DEFAULT NULL, + `invoice_date` datetime(6) NOT NULL, + `period_begin` datetime(6) NOT NULL, + `period_end` datetime(6) NOT NULL, + `invoice_amount` decimal(19,2) NOT NULL, + `actual_charges` decimal(19,2) NOT NULL, + `invoice_currency` varchar(16) DEFAULT NULL, + `management_region_id` int(10) unsigned NOT NULL, + `payer_metadata` text DEFAULT NULL, + PRIMARY KEY (`invoice_id`), + KEY `t_unbilled_charges_1` (`management_region_id`,`payer_type`,`payer_id`) +) ENGINE=InnoDB AUTO_INCREMENT=845 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_unbilled_charges_detail` ( + `invoice_id` int(10) unsigned NOT NULL, + `customer_id` int(10) unsigned DEFAULT NULL, + `customer_name` varchar(255) DEFAULT NULL, + `service_region_id` int(10) unsigned DEFAULT NULL, + `service_region_name` varchar(128) DEFAULT NULL, + `rate` decimal(22,12) NOT NULL, + `rate_display` varchar(255) DEFAULT NULL, + `rate_unit` varchar(128) NOT NULL, + `rate_interval` varchar(128) DEFAULT NULL, + `rate_multiplier_percent` decimal(10,6) DEFAULT NULL, + `units_billed` decimal(36,12) DEFAULT NULL, + `units_billed_display` varchar(128) DEFAULT NULL, + `item_invoice_amount` decimal(19,2) NOT NULL, + `item_category` varchar(128) NOT NULL, + `item_group` varchar(128) NOT NULL, + `item_type` varchar(128) NOT NULL, + `item_detail` varchar(512) NOT NULL, + `tenant_id` int(10) unsigned DEFAULT NULL, + `tenant_name` varchar(256) DEFAULT NULL, + `stack_type` varchar(16) DEFAULT NULL, + `service_manager_id` int(10) unsigned DEFAULT NULL, + `service_manager_name` varchar(128) DEFAULT NULL, + `service_instance_metadata` text DEFAULT NULL, + KEY `ix_unbilled_charges_detail_1` (`invoice_id`), + KEY `ix_unbilled_charges_detail_2` (`customer_id`), + KEY `ix_unbilled_charges_detail_4` (`invoice_id`,`customer_name`,`item_group`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_unbilled_charges_detail_temp` ( + `invoice_id` int(10) unsigned NOT NULL, + `customer_id` int(10) unsigned DEFAULT NULL, + `customer_name` varchar(255) DEFAULT NULL, + `service_region_id` int(10) unsigned DEFAULT NULL, + `service_region_name` varchar(128) DEFAULT NULL, + `rate` decimal(22,12) NOT NULL, + `rate_display` varchar(255) DEFAULT NULL, + `rate_unit` varchar(128) NOT NULL, + `rate_interval` varchar(128) DEFAULT NULL, + `rate_multiplier_percent` decimal(10,6) DEFAULT NULL, + `units_billed` decimal(36,12) DEFAULT NULL, + `units_billed_display` varchar(128) DEFAULT NULL, + `item_invoice_amount` decimal(19,2) NOT NULL, + `item_category` varchar(128) NOT NULL, + `item_group` varchar(128) NOT NULL, + `item_type` varchar(128) NOT NULL, + `item_detail` varchar(512) NOT NULL, + `tenant_id` int(10) unsigned DEFAULT NULL, + `tenant_name` varchar(256) DEFAULT NULL, + `stack_type` varchar(16) DEFAULT NULL, + `service_manager_id` int(10) unsigned DEFAULT NULL, + `service_manager_name` varchar(128) DEFAULT NULL, + `service_instance_metadata` text DEFAULT NULL, + KEY `ix_unbilled_charges_detail_1` (`invoice_id`), + KEY `ix_unbilled_charges_detail_2` (`customer_id`), + KEY `ix_unbilled_charges_detail_4` (`invoice_id`,`customer_name`,`item_group`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_unbilled_charges_temp` ( + `invoice_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `payer_id` int(10) unsigned NOT NULL, + `payer_type` varchar(64) NOT NULL, + `payer_name` varchar(512) NOT NULL, + `invoice_number` varchar(45) DEFAULT NULL, + `invoice_date` datetime(6) NOT NULL, + `period_begin` datetime(6) NOT NULL, + `period_end` datetime(6) NOT NULL, + `invoice_amount` decimal(19,2) NOT NULL, + `actual_charges` decimal(19,2) NOT NULL, + `invoice_currency` varchar(16) DEFAULT NULL, + `management_region_id` int(10) unsigned NOT NULL, + `payer_metadata` text DEFAULT NULL, + PRIMARY KEY (`invoice_id`), + KEY `t_unbilled_charges_1` (`management_region_id`,`payer_type`,`payer_id`) +) ENGINE=InnoDB AUTO_INCREMENT=845 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_user_permissions` ( + `user_id` int(10) unsigned NOT NULL, + `permission` longtext NOT NULL, + PRIMARY KEY (`user_id`,`permission`(255)) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_user_projects` ( + `user_projects_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `user_id` int(10) unsigned NOT NULL, + `user_foreign_id` varchar(128) NOT NULL, + `service_manager_id` int(10) unsigned NOT NULL, + `role_id` varchar(128) NOT NULL, + `role_name` varchar(128) NOT NULL, + `project_id` varchar(128) NOT NULL, + `add_date` datetime(6) NOT NULL, + `remove_date` datetime(6) NOT NULL, + PRIMARY KEY (`user_projects_id`), + KEY `ix_host_1` (`user_id`,`service_manager_id`,`role_id`,`project_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_user_roles` ( + `user_id` int(10) unsigned NOT NULL, + `role_name` varchar(128) NOT NULL, + `role_context` int(10) unsigned NOT NULL, + `context_type` varchar(64) NOT NULL, + UNIQUE KEY `user_id` (`user_id`,`role_name`,`role_context`,`context_type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_users` ( + `user_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `username` varchar(128) NOT NULL, + `first_name` varchar(256) DEFAULT NULL, + `last_name` varchar(256) DEFAULT NULL, + `email_address` varchar(512) DEFAULT NULL, + `phone_number` varchar(64) DEFAULT NULL, + `password` varchar(512) DEFAULT NULL, + `is_active` tinyint(1) DEFAULT NULL, + `password_change_token` varchar(64) DEFAULT NULL, + `last_password_change_date` datetime(6) DEFAULT NULL, + `password_change_token_expire_date` datetime(6) DEFAULT NULL, + `external` tinyint(1) DEFAULT 0, + PRIMARY KEY (`user_id`), + UNIQUE KEY `username` (`username`) +) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `v_all_charges` ( + `invoice_id` tinyint NOT NULL, + `payer_id` tinyint NOT NULL, + `payer_type` tinyint NOT NULL, + `payer_name` tinyint NOT NULL, + `invoice_number` tinyint NOT NULL, + `invoice_date` tinyint NOT NULL, + `period_begin` tinyint NOT NULL, + `period_end` tinyint NOT NULL, + `invoice_amount` tinyint NOT NULL, + `actual_charges` tinyint NOT NULL, + `invoice_currency` tinyint NOT NULL, + `management_region_id` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `v_all_charges_detail` ( + `invoice_id` tinyint NOT NULL, + `customer_id` tinyint NOT NULL, + `customer_name` tinyint NOT NULL, + `service_region_id` tinyint NOT NULL, + `rate` tinyint NOT NULL, + `rate_display` tinyint NOT NULL, + `rate_unit` tinyint NOT NULL, + `rate_interval` tinyint NOT NULL, + `rate_multiplier_percent` tinyint NOT NULL, + `units_billed` tinyint NOT NULL, + `units_billed_display` tinyint NOT NULL, + `item_invoice_amount` tinyint NOT NULL, + `item_category` tinyint NOT NULL, + `item_group` tinyint NOT NULL, + `item_type` tinyint NOT NULL, + `item_detail` tinyint NOT NULL, + `tenant_id` tinyint NOT NULL, + `tenant_name` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `v_current_host` ( + `host_id` tinyint NOT NULL, + `service_manager_id` tinyint NOT NULL, + `service_manager_name` tinyint NOT NULL, + `service_region_id` tinyint NOT NULL, + `region_name` tinyint NOT NULL, + `host_foreign_id` tinyint NOT NULL, + `host_name` tinyint NOT NULL, + `hypervisor_type` tinyint NOT NULL, + `host_aggregate` tinyint NOT NULL, + `add_date` tinyint NOT NULL, + `remove_date` tinyint NOT NULL, + `cpu_allocation_ratio` tinyint NOT NULL, + `ram_allocation_ratio` tinyint NOT NULL, + `disk_allocation_ratio` tinyint NOT NULL, + `update_date` tinyint NOT NULL, + `ram_mb` tinyint NOT NULL, + `ram_mb_used` tinyint NOT NULL, + `disk_gb` tinyint NOT NULL, + `disk_gb_used` tinyint NOT NULL, + `vcpus` tinyint NOT NULL, + `vcpus_used` tinyint NOT NULL, + `vm_count` tinyint NOT NULL, + `socket_count` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `v_current_host_attributes` ( + `host_id` tinyint NOT NULL, + `update_date` tinyint NOT NULL, + `ram_mb` tinyint NOT NULL, + `ram_mb_used` tinyint NOT NULL, + `disk_gb` tinyint NOT NULL, + `disk_gb_used` tinyint NOT NULL, + `vcpus` tinyint NOT NULL, + `vcpus_used` tinyint NOT NULL, + `vm_count` tinyint NOT NULL, + `socket_count` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `v_customer` ( + `customer_id` tinyint NOT NULL, + `customer_name` tinyint NOT NULL, + `metadata` tinyint NOT NULL, + `tax_rate` tinyint NOT NULL, + `currency` tinyint NOT NULL, + `discount_percent` tinyint NOT NULL, + `billing_frequency` tinyint NOT NULL, + `last_bill_date` tinyint NOT NULL, + `next_bill_date` tinyint NOT NULL, + `is_active` tinyint NOT NULL, + `create_date` tinyint NOT NULL, + `activate_date` tinyint NOT NULL, + `billing_start_date` tinyint NOT NULL, + `last_payment_date` tinyint NOT NULL, + `deactivate_date` tinyint NOT NULL, + `description` tinyint NOT NULL, + `minimum_invoice_commitment` tinyint NOT NULL, + `invoicing_method` tinyint NOT NULL, + `management_region_id` tinyint NOT NULL, + `billing_address_line_1` tinyint NOT NULL, + `billing_address_line_2` tinyint NOT NULL, + `billing_address_city` tinyint NOT NULL, + `billing_address_region` tinyint NOT NULL, + `billing_address_country` tinyint NOT NULL, + `billing_address_postal_code` tinyint NOT NULL, + `payer_payment_details` tinyint NOT NULL, + `payment_method_confirmed` tinyint NOT NULL, + `balance_due` tinyint NOT NULL, + `spend_soft_limit` tinyint NOT NULL, + `spend_hard_limit` tinyint NOT NULL, + `terms_and_conditions_2_accept_date` tinyint NOT NULL, + `tax_id` tinyint NOT NULL, + `registration_number` tinyint NOT NULL, + `management_region_name` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `v_metric` ( + `metric_id` tinyint NOT NULL, + `service_manager_type_id` tinyint NOT NULL, + `metric_name` tinyint NOT NULL, + `metric_label` tinyint NOT NULL, + `metric_source` tinyint NOT NULL, + `metric_type` tinyint NOT NULL, + `metric_unit` tinyint NOT NULL, + `entity_resolution` tinyint NOT NULL, + `time_resolution` tinyint NOT NULL, + `service_manager_type` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `v_promo_code_redemption` ( + `management_region_id` tinyint NOT NULL, + `promo_code_id` tinyint NOT NULL, + `promo_code` tinyint NOT NULL, + `salesperson` tinyint NOT NULL, + `discount_or_credit` tinyint NOT NULL, + `credit_amount` tinyint NOT NULL, + `credit_type` tinyint NOT NULL, + `apply_to_charge_category` tinyint NOT NULL, + `trigger_charge_category` tinyint NOT NULL, + `trigger_amount` tinyint NOT NULL, + `discount_percent` tinyint NOT NULL, + `available_invoice_periods` tinyint NOT NULL, + `expire_date` tinyint NOT NULL, + `currency` tinyint NOT NULL, + `redemption_date` tinyint NOT NULL, + `customer_id` tinyint NOT NULL, + `customer_name` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `v_provider` ( + `provider_id` tinyint NOT NULL, + `provider_name` tinyint NOT NULL, + `provider_type` tinyint NOT NULL, + `metadata` tinyint NOT NULL, + `tax_rate` tinyint NOT NULL, + `currency` tinyint NOT NULL, + `discount_percent` tinyint NOT NULL, + `billing_frequency` tinyint NOT NULL, + `last_bill_date` tinyint NOT NULL, + `next_bill_date` tinyint NOT NULL, + `last_payment_date` tinyint NOT NULL, + `is_active` tinyint NOT NULL, + `create_date` tinyint NOT NULL, + `activate_date` tinyint NOT NULL, + `billing_start_date` tinyint NOT NULL, + `deactivate_date` tinyint NOT NULL, + `description` tinyint NOT NULL, + `minimum_invoice_commitment` tinyint NOT NULL, + `invoicing_method` tinyint NOT NULL, + `invoice_processing_method` tinyint NOT NULL, + `billing_address_line_1` tinyint NOT NULL, + `billing_address_line_2` tinyint NOT NULL, + `billing_address_city` tinyint NOT NULL, + `billing_address_region` tinyint NOT NULL, + `billing_address_country` tinyint NOT NULL, + `billing_address_postal_code` tinyint NOT NULL, + `legal_address_line_1` tinyint NOT NULL, + `legal_address_line_2` tinyint NOT NULL, + `legal_address_city` tinyint NOT NULL, + `legal_address_region` tinyint NOT NULL, + `legal_address_country` tinyint NOT NULL, + `legal_address_postal_code` tinyint NOT NULL, + `payer_payment_details` tinyint NOT NULL, + `payee_payment_details` tinyint NOT NULL, + `public_url` tinyint NOT NULL, + `management_region_id` tinyint NOT NULL, + `balance_due` tinyint NOT NULL, + `openbook_processes_payments` tinyint NOT NULL, + `openbook_processes_past_due_invoices` tinyint NOT NULL, + `openstack_tenant_id` tinyint NOT NULL, + `tax_id` tinyint NOT NULL, + `registration_number` tinyint NOT NULL, + `os_service_manager_id` tinyint NOT NULL, + `parent_management_region_id` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `v_rate_plan_assignment` ( + `rate_plan_id` tinyint NOT NULL, + `assignee_id` tinyint NOT NULL, + `assignee_type` tinyint NOT NULL, + `assignment_start_date` tinyint NOT NULL, + `assignment_end_date` tinyint NOT NULL, + `assignment_type` tinyint NOT NULL, + `management_region_id` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `v_service` ( + `service_id` tinyint NOT NULL, + `service_type` tinyint NOT NULL, + `service_description` tinyint NOT NULL, + `service_manager_type_id` tinyint NOT NULL, + `states` tinyint NOT NULL, + `externally_managed` tinyint NOT NULL, + `service_manager_type` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `v_service_instance` ( + `service_instance_id` tinyint NOT NULL, + `service_id` tinyint NOT NULL, + `service_instance_name` tinyint NOT NULL, + `service_manager_id` tinyint NOT NULL, + `service_region_id` tinyint NOT NULL, + `service_instance_foreign_id` tinyint NOT NULL, + `tenant_id` tinyint NOT NULL, + `current_attributes` tinyint NOT NULL, + `tenant_name` tinyint NOT NULL, + `tenant_foreign_id` tinyint NOT NULL, + `customer_id` tinyint NOT NULL, + `customer_name` tinyint NOT NULL, + `management_region_id` tinyint NOT NULL, + `service_manager_name` tinyint NOT NULL, + `service_region_name` tinyint NOT NULL, + `service_manager_type` tinyint NOT NULL, + `service_type` tinyint NOT NULL, + `provisioned_date` tinyint NOT NULL, + `deprovisioned_date` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `v_service_instance_attributes` ( + `service_instance_id` tinyint NOT NULL, + `start_date` tinyint NOT NULL, + `end_date` tinyint NOT NULL, + `attributes` tinyint NOT NULL, + `tenant_id` tinyint NOT NULL, + `tenant_foreign_id` tinyint NOT NULL, + `tenant_name` tinyint NOT NULL, + `customer_id` tinyint NOT NULL, + `customer_name` tinyint NOT NULL, + `management_region_id` tinyint NOT NULL, + `service_instance_name` tinyint NOT NULL, + `service_instance_foreign_id` tinyint NOT NULL, + `service_manager_id` tinyint NOT NULL, + `service_manager_name` tinyint NOT NULL, + `service_id` tinyint NOT NULL, + `service_type` tinyint NOT NULL, + `service_manager_type` tinyint NOT NULL, + `service_region_id` tinyint NOT NULL, + `service_region_name` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `v_service_instance_state` ( + `service_instance_id` tinyint NOT NULL, + `state` tinyint NOT NULL, + `start_date` tinyint NOT NULL, + `end_date` tinyint NOT NULL, + `interval_length_milliseconds` tinyint NOT NULL, + `tenant_id` tinyint NOT NULL, + `tenant_foreign_id` tinyint NOT NULL, + `tenant_name` tinyint NOT NULL, + `customer_id` tinyint NOT NULL, + `customer_name` tinyint NOT NULL, + `management_region_id` tinyint NOT NULL, + `service_instance_name` tinyint NOT NULL, + `service_instance_foreign_id` tinyint NOT NULL, + `service_manager_id` tinyint NOT NULL, + `service_manager_name` tinyint NOT NULL, + `service_id` tinyint NOT NULL, + `service_type` tinyint NOT NULL, + `service_manager_type` tinyint NOT NULL, + `service_region_id` tinyint NOT NULL, + `service_region_name` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `v_service_manager` ( + `service_manager_id` tinyint NOT NULL, + `service_manager_name` tinyint NOT NULL, + `service_manager_description` tinyint NOT NULL, + `metadata` tinyint NOT NULL, + `service_region_id` tinyint NOT NULL, + `service_manager_type_id` tinyint NOT NULL, + `service_manager_type` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `v_tenant` ( + `tenant_id` tinyint NOT NULL, + `tenant_name` tinyint NOT NULL, + `tenant_foreign_id` tinyint NOT NULL, + `create_date` tinyint NOT NULL, + `deactivate_date` tinyint NOT NULL, + `customer_id` tinyint NOT NULL, + `service_manager_id` tinyint NOT NULL, + `is_active` tinyint NOT NULL, + `customer_name` tinyint NOT NULL, + `management_region_id` tinyint NOT NULL, + `service_manager_type` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `v_users` ( + `user_id` tinyint NOT NULL, + `username` tinyint NOT NULL, + `first_name` tinyint NOT NULL, + `last_name` tinyint NOT NULL, + `email_address` tinyint NOT NULL, + `phone_number` tinyint NOT NULL, + `password` tinyint NOT NULL, + `is_active` tinyint NOT NULL, + `password_change_token` tinyint NOT NULL, + `last_password_change_date` tinyint NOT NULL, + `password_change_token_expire_date` tinyint NOT NULL, + `role_name` tinyint NOT NULL, + `role_context` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `openbook_jobs` /*!40100 DEFAULT CHARACTER SET utf8 */; +GRANT ALL PRIVILEGES ON openbook_jobs.* TO openbook_jobs@'%' IDENTIFIED BY '{{ openbook_database_password }}'; +GRANT ALL PRIVILEGES ON openbook_jobs.* TO openbook_jobs@localhost IDENTIFIED BY '{{ openbook_database_password }}'; +USE `openbook_jobs`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `QRTZ_BLOB_TRIGGERS` ( + `SCHED_NAME` varchar(120) NOT NULL, + `TRIGGER_NAME` varchar(200) NOT NULL, + `TRIGGER_GROUP` varchar(200) NOT NULL, + `BLOB_DATA` blob DEFAULT NULL, + PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), + KEY `SCHED_NAME` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), + CONSTRAINT `QRTZ_BLOB_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `QRTZ_CALENDARS` ( + `SCHED_NAME` varchar(120) NOT NULL, + `CALENDAR_NAME` varchar(200) NOT NULL, + `CALENDAR` blob NOT NULL, + PRIMARY KEY (`SCHED_NAME`,`CALENDAR_NAME`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `QRTZ_CRON_TRIGGERS` ( + `SCHED_NAME` varchar(120) NOT NULL, + `TRIGGER_NAME` varchar(200) NOT NULL, + `TRIGGER_GROUP` varchar(200) NOT NULL, + `CRON_EXPRESSION` varchar(120) NOT NULL, + `TIME_ZONE_ID` varchar(80) DEFAULT NULL, + PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), + CONSTRAINT `QRTZ_CRON_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `QRTZ_FIRED_TRIGGERS` ( + `SCHED_NAME` varchar(120) NOT NULL, + `ENTRY_ID` varchar(95) NOT NULL, + `TRIGGER_NAME` varchar(200) NOT NULL, + `TRIGGER_GROUP` varchar(200) NOT NULL, + `INSTANCE_NAME` varchar(200) NOT NULL, + `FIRED_TIME` bigint(13) NOT NULL, + `SCHED_TIME` bigint(13) NOT NULL, + `PRIORITY` int(11) NOT NULL, + `STATE` varchar(16) NOT NULL, + `JOB_NAME` varchar(200) DEFAULT NULL, + `JOB_GROUP` varchar(200) DEFAULT NULL, + `IS_NONCONCURRENT` varchar(1) DEFAULT NULL, + `REQUESTS_RECOVERY` varchar(1) DEFAULT NULL, + PRIMARY KEY (`SCHED_NAME`,`ENTRY_ID`), + KEY `IDX_QRTZ_FT_TRIG_INST_NAME` (`SCHED_NAME`,`INSTANCE_NAME`), + KEY `IDX_QRTZ_FT_INST_JOB_REQ_RCVRY` (`SCHED_NAME`,`INSTANCE_NAME`,`REQUESTS_RECOVERY`), + KEY `IDX_QRTZ_FT_J_G` (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`), + KEY `IDX_QRTZ_FT_JG` (`SCHED_NAME`,`JOB_GROUP`), + KEY `IDX_QRTZ_FT_T_G` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), + KEY `IDX_QRTZ_FT_TG` (`SCHED_NAME`,`TRIGGER_GROUP`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `QRTZ_JOB_DETAILS` ( + `SCHED_NAME` varchar(120) NOT NULL, + `JOB_NAME` varchar(200) NOT NULL, + `JOB_GROUP` varchar(200) NOT NULL, + `DESCRIPTION` varchar(250) DEFAULT NULL, + `JOB_CLASS_NAME` varchar(250) NOT NULL, + `IS_DURABLE` varchar(1) NOT NULL, + `IS_NONCONCURRENT` varchar(1) NOT NULL, + `IS_UPDATE_DATA` varchar(1) NOT NULL, + `REQUESTS_RECOVERY` varchar(1) NOT NULL, + `JOB_DATA` blob DEFAULT NULL, + PRIMARY KEY (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`), + KEY `IDX_QRTZ_J_REQ_RECOVERY` (`SCHED_NAME`,`REQUESTS_RECOVERY`), + KEY `IDX_QRTZ_J_GRP` (`SCHED_NAME`,`JOB_GROUP`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `QRTZ_LOCKS` ( + `SCHED_NAME` varchar(120) NOT NULL, + `LOCK_NAME` varchar(40) NOT NULL, + PRIMARY KEY (`SCHED_NAME`,`LOCK_NAME`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `QRTZ_PAUSED_TRIGGER_GRPS` ( + `SCHED_NAME` varchar(120) NOT NULL, + `TRIGGER_GROUP` varchar(200) NOT NULL, + PRIMARY KEY (`SCHED_NAME`,`TRIGGER_GROUP`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `QRTZ_SCHEDULER_STATE` ( + `SCHED_NAME` varchar(120) NOT NULL, + `INSTANCE_NAME` varchar(200) NOT NULL, + `LAST_CHECKIN_TIME` bigint(13) NOT NULL, + `CHECKIN_INTERVAL` bigint(13) NOT NULL, + PRIMARY KEY (`SCHED_NAME`,`INSTANCE_NAME`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `QRTZ_SIMPLE_TRIGGERS` ( + `SCHED_NAME` varchar(120) NOT NULL, + `TRIGGER_NAME` varchar(200) NOT NULL, + `TRIGGER_GROUP` varchar(200) NOT NULL, + `REPEAT_COUNT` bigint(7) NOT NULL, + `REPEAT_INTERVAL` bigint(12) NOT NULL, + `TIMES_TRIGGERED` bigint(10) NOT NULL, + PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), + CONSTRAINT `QRTZ_SIMPLE_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `QRTZ_SIMPROP_TRIGGERS` ( + `SCHED_NAME` varchar(120) NOT NULL, + `TRIGGER_NAME` varchar(200) NOT NULL, + `TRIGGER_GROUP` varchar(200) NOT NULL, + `STR_PROP_1` varchar(512) DEFAULT NULL, + `STR_PROP_2` varchar(512) DEFAULT NULL, + `STR_PROP_3` varchar(512) DEFAULT NULL, + `INT_PROP_1` int(11) DEFAULT NULL, + `INT_PROP_2` int(11) DEFAULT NULL, + `LONG_PROP_1` bigint(20) DEFAULT NULL, + `LONG_PROP_2` bigint(20) DEFAULT NULL, + `DEC_PROP_1` decimal(13,4) DEFAULT NULL, + `DEC_PROP_2` decimal(13,4) DEFAULT NULL, + `BOOL_PROP_1` varchar(1) DEFAULT NULL, + `BOOL_PROP_2` varchar(1) DEFAULT NULL, + PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), + CONSTRAINT `QRTZ_SIMPROP_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `QRTZ_TRIGGERS` ( + `SCHED_NAME` varchar(120) NOT NULL, + `TRIGGER_NAME` varchar(200) NOT NULL, + `TRIGGER_GROUP` varchar(200) NOT NULL, + `JOB_NAME` varchar(200) NOT NULL, + `JOB_GROUP` varchar(200) NOT NULL, + `DESCRIPTION` varchar(250) DEFAULT NULL, + `NEXT_FIRE_TIME` bigint(13) DEFAULT NULL, + `PREV_FIRE_TIME` bigint(13) DEFAULT NULL, + `PRIORITY` int(11) DEFAULT NULL, + `TRIGGER_STATE` varchar(16) NOT NULL, + `TRIGGER_TYPE` varchar(8) NOT NULL, + `START_TIME` bigint(13) NOT NULL, + `END_TIME` bigint(13) DEFAULT NULL, + `CALENDAR_NAME` varchar(200) DEFAULT NULL, + `MISFIRE_INSTR` smallint(2) DEFAULT NULL, + `JOB_DATA` blob DEFAULT NULL, + PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), + KEY `IDX_QRTZ_T_J` (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`), + KEY `IDX_QRTZ_T_JG` (`SCHED_NAME`,`JOB_GROUP`), + KEY `IDX_QRTZ_T_C` (`SCHED_NAME`,`CALENDAR_NAME`), + KEY `IDX_QRTZ_T_G` (`SCHED_NAME`,`TRIGGER_GROUP`), + KEY `IDX_QRTZ_T_STATE` (`SCHED_NAME`,`TRIGGER_STATE`), + KEY `IDX_QRTZ_T_N_STATE` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`,`TRIGGER_STATE`), + KEY `IDX_QRTZ_T_N_G_STATE` (`SCHED_NAME`,`TRIGGER_GROUP`,`TRIGGER_STATE`), + KEY `IDX_QRTZ_T_NEXT_FIRE_TIME` (`SCHED_NAME`,`NEXT_FIRE_TIME`), + KEY `IDX_QRTZ_T_NFT_ST` (`SCHED_NAME`,`TRIGGER_STATE`,`NEXT_FIRE_TIME`), + KEY `IDX_QRTZ_T_NFT_MISFIRE` (`SCHED_NAME`,`MISFIRE_INSTR`,`NEXT_FIRE_TIME`), + KEY `IDX_QRTZ_T_NFT_ST_MISFIRE` (`SCHED_NAME`,`MISFIRE_INSTR`,`NEXT_FIRE_TIME`,`TRIGGER_STATE`), + KEY `IDX_QRTZ_T_NFT_ST_MISFIRE_GRP` (`SCHED_NAME`,`MISFIRE_INSTR`,`NEXT_FIRE_TIME`,`TRIGGER_GROUP`,`TRIGGER_STATE`), + CONSTRAINT `QRTZ_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) REFERENCES `QRTZ_JOB_DETAILS` (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `openbook_workflow` /*!40100 DEFAULT CHARACTER SET utf8 */; +GRANT ALL PRIVILEGES ON openbook_workflow.* TO openbook_workflow@'%' IDENTIFIED BY '{{ openbook_database_password }}'; +GRANT ALL PRIVILEGES ON openbook_workflow.* TO openbook_workflow@localhost IDENTIFIED BY '{{ openbook_database_password }}'; +USE `openbook_workflow`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ACT_EVT_LOG` ( + `LOG_NR_` bigint(20) NOT NULL AUTO_INCREMENT, + `TYPE_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `PROC_DEF_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `TIME_STAMP_` timestamp(3) NOT NULL DEFAULT current_timestamp(3) ON UPDATE current_timestamp(3), + `USER_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `DATA_` longblob DEFAULT NULL, + `LOCK_OWNER_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `LOCK_TIME_` timestamp(3) NULL DEFAULT NULL, + `IS_PROCESSED_` tinyint(4) DEFAULT 0, + PRIMARY KEY (`LOG_NR_`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ACT_GE_BYTEARRAY` ( + `ID_` varchar(64) COLLATE utf8_bin NOT NULL, + `REV_` int(11) DEFAULT NULL, + `NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `DEPLOYMENT_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `BYTES_` longblob DEFAULT NULL, + `GENERATED_` tinyint(4) DEFAULT NULL, + PRIMARY KEY (`ID_`), + KEY `ACT_FK_BYTEARR_DEPL` (`DEPLOYMENT_ID_`), + CONSTRAINT `ACT_FK_BYTEARR_DEPL` FOREIGN KEY (`DEPLOYMENT_ID_`) REFERENCES `ACT_RE_DEPLOYMENT` (`ID_`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ACT_GE_PROPERTY` ( + `NAME_` varchar(64) COLLATE utf8_bin NOT NULL, + `VALUE_` varchar(300) COLLATE utf8_bin DEFAULT NULL, + `REV_` int(11) DEFAULT NULL, + PRIMARY KEY (`NAME_`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ACT_HI_ACTINST` ( + `ID_` varchar(64) COLLATE utf8_bin NOT NULL, + `PROC_DEF_ID_` varchar(64) COLLATE utf8_bin NOT NULL, + `PROC_INST_ID_` varchar(64) COLLATE utf8_bin NOT NULL, + `EXECUTION_ID_` varchar(64) COLLATE utf8_bin NOT NULL, + `ACT_ID_` varchar(255) COLLATE utf8_bin NOT NULL, + `TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `CALL_PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `ACT_NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `ACT_TYPE_` varchar(255) COLLATE utf8_bin NOT NULL, + `ASSIGNEE_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `START_TIME_` datetime(3) NOT NULL, + `END_TIME_` datetime(3) DEFAULT NULL, + `DURATION_` bigint(20) DEFAULT NULL, + `TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '', + PRIMARY KEY (`ID_`), + KEY `ACT_IDX_HI_ACT_INST_START` (`START_TIME_`), + KEY `ACT_IDX_HI_ACT_INST_END` (`END_TIME_`), + KEY `ACT_IDX_HI_ACT_INST_PROCINST` (`PROC_INST_ID_`,`ACT_ID_`), + KEY `ACT_IDX_HI_ACT_INST_EXEC` (`EXECUTION_ID_`,`ACT_ID_`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ACT_HI_ATTACHMENT` ( + `ID_` varchar(64) COLLATE utf8_bin NOT NULL, + `REV_` int(11) DEFAULT NULL, + `USER_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `DESCRIPTION_` varchar(4000) COLLATE utf8_bin DEFAULT NULL, + `TYPE_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `URL_` varchar(4000) COLLATE utf8_bin DEFAULT NULL, + `CONTENT_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `TIME_` datetime(3) DEFAULT NULL, + PRIMARY KEY (`ID_`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ACT_HI_COMMENT` ( + `ID_` varchar(64) COLLATE utf8_bin NOT NULL, + `TYPE_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `TIME_` datetime(3) NOT NULL, + `USER_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `ACTION_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `MESSAGE_` varchar(4000) COLLATE utf8_bin DEFAULT NULL, + `FULL_MSG_` longblob DEFAULT NULL, + PRIMARY KEY (`ID_`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ACT_HI_DETAIL` ( + `ID_` varchar(64) COLLATE utf8_bin NOT NULL, + `TYPE_` varchar(255) COLLATE utf8_bin NOT NULL, + `PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `ACT_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `NAME_` varchar(255) COLLATE utf8_bin NOT NULL, + `VAR_TYPE_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `REV_` int(11) DEFAULT NULL, + `TIME_` datetime(3) NOT NULL, + `BYTEARRAY_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `DOUBLE_` double DEFAULT NULL, + `LONG_` bigint(20) DEFAULT NULL, + `TEXT_` varchar(4000) COLLATE utf8_bin DEFAULT NULL, + `TEXT2_` varchar(4000) COLLATE utf8_bin DEFAULT NULL, + PRIMARY KEY (`ID_`), + KEY `ACT_IDX_HI_DETAIL_PROC_INST` (`PROC_INST_ID_`), + KEY `ACT_IDX_HI_DETAIL_ACT_INST` (`ACT_INST_ID_`), + KEY `ACT_IDX_HI_DETAIL_TIME` (`TIME_`), + KEY `ACT_IDX_HI_DETAIL_NAME` (`NAME_`), + KEY `ACT_IDX_HI_DETAIL_TASK_ID` (`TASK_ID_`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ACT_HI_IDENTITYLINK` ( + `ID_` varchar(64) COLLATE utf8_bin NOT NULL, + `GROUP_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `TYPE_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `USER_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + PRIMARY KEY (`ID_`), + KEY `ACT_IDX_HI_IDENT_LNK_USER` (`USER_ID_`), + KEY `ACT_IDX_HI_IDENT_LNK_TASK` (`TASK_ID_`), + KEY `ACT_IDX_HI_IDENT_LNK_PROCINST` (`PROC_INST_ID_`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ACT_HI_PROCINST` ( + `ID_` varchar(64) COLLATE utf8_bin NOT NULL, + `PROC_INST_ID_` varchar(64) COLLATE utf8_bin NOT NULL, + `BUSINESS_KEY_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `PROC_DEF_ID_` varchar(64) COLLATE utf8_bin NOT NULL, + `START_TIME_` datetime(3) NOT NULL, + `END_TIME_` datetime(3) DEFAULT NULL, + `DURATION_` bigint(20) DEFAULT NULL, + `START_USER_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `START_ACT_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `END_ACT_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `SUPER_PROCESS_INSTANCE_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `DELETE_REASON_` varchar(4000) COLLATE utf8_bin DEFAULT NULL, + `TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '', + `NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + PRIMARY KEY (`ID_`), + UNIQUE KEY `PROC_INST_ID_` (`PROC_INST_ID_`), + KEY `ACT_IDX_HI_PRO_INST_END` (`END_TIME_`), + KEY `ACT_IDX_HI_PRO_I_BUSKEY` (`BUSINESS_KEY_`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ACT_HI_TASKINST` ( + `ID_` varchar(64) COLLATE utf8_bin NOT NULL, + `PROC_DEF_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `TASK_DEF_KEY_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `PARENT_TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `DESCRIPTION_` varchar(4000) COLLATE utf8_bin DEFAULT NULL, + `OWNER_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `ASSIGNEE_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `START_TIME_` datetime(3) NOT NULL, + `CLAIM_TIME_` datetime(3) DEFAULT NULL, + `END_TIME_` datetime(3) DEFAULT NULL, + `DURATION_` bigint(20) DEFAULT NULL, + `DELETE_REASON_` varchar(4000) COLLATE utf8_bin DEFAULT NULL, + `PRIORITY_` int(11) DEFAULT NULL, + `DUE_DATE_` datetime(3) DEFAULT NULL, + `FORM_KEY_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `CATEGORY_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '', + PRIMARY KEY (`ID_`), + KEY `ACT_IDX_HI_TASK_INST_PROCINST` (`PROC_INST_ID_`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ACT_HI_VARINST` ( + `ID_` varchar(64) COLLATE utf8_bin NOT NULL, + `PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `NAME_` varchar(255) COLLATE utf8_bin NOT NULL, + `VAR_TYPE_` varchar(100) COLLATE utf8_bin DEFAULT NULL, + `REV_` int(11) DEFAULT NULL, + `BYTEARRAY_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `DOUBLE_` double DEFAULT NULL, + `LONG_` bigint(20) DEFAULT NULL, + `TEXT_` varchar(4000) COLLATE utf8_bin DEFAULT NULL, + `TEXT2_` varchar(4000) COLLATE utf8_bin DEFAULT NULL, + `CREATE_TIME_` datetime(3) DEFAULT NULL, + `LAST_UPDATED_TIME_` datetime(3) DEFAULT NULL, + PRIMARY KEY (`ID_`), + KEY `ACT_IDX_HI_PROCVAR_PROC_INST` (`PROC_INST_ID_`), + KEY `ACT_IDX_HI_PROCVAR_NAME_TYPE` (`NAME_`,`VAR_TYPE_`), + KEY `ACT_IDX_HI_PROCVAR_TASK_ID` (`TASK_ID_`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ACT_ID_GROUP` ( + `ID_` varchar(64) COLLATE utf8_bin NOT NULL, + `REV_` int(11) DEFAULT NULL, + `NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `TYPE_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + PRIMARY KEY (`ID_`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ACT_ID_INFO` ( + `ID_` varchar(64) COLLATE utf8_bin NOT NULL, + `REV_` int(11) DEFAULT NULL, + `USER_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `TYPE_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `KEY_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `VALUE_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `PASSWORD_` longblob DEFAULT NULL, + `PARENT_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + PRIMARY KEY (`ID_`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ACT_ID_MEMBERSHIP` ( + `USER_ID_` varchar(64) COLLATE utf8_bin NOT NULL, + `GROUP_ID_` varchar(64) COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`USER_ID_`,`GROUP_ID_`), + KEY `ACT_FK_MEMB_GROUP` (`GROUP_ID_`), + CONSTRAINT `ACT_FK_MEMB_GROUP` FOREIGN KEY (`GROUP_ID_`) REFERENCES `ACT_ID_GROUP` (`ID_`), + CONSTRAINT `ACT_FK_MEMB_USER` FOREIGN KEY (`USER_ID_`) REFERENCES `ACT_ID_USER` (`ID_`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ACT_ID_USER` ( + `ID_` varchar(64) COLLATE utf8_bin NOT NULL, + `REV_` int(11) DEFAULT NULL, + `FIRST_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `LAST_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `EMAIL_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `PWD_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `PICTURE_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + PRIMARY KEY (`ID_`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ACT_PROCDEF_INFO` ( + `ID_` varchar(64) COLLATE utf8_bin NOT NULL, + `PROC_DEF_ID_` varchar(64) COLLATE utf8_bin NOT NULL, + `REV_` int(11) DEFAULT NULL, + `INFO_JSON_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + PRIMARY KEY (`ID_`), + UNIQUE KEY `ACT_UNIQ_INFO_PROCDEF` (`PROC_DEF_ID_`), + KEY `ACT_IDX_INFO_PROCDEF` (`PROC_DEF_ID_`), + KEY `ACT_FK_INFO_JSON_BA` (`INFO_JSON_ID_`), + CONSTRAINT `ACT_FK_INFO_JSON_BA` FOREIGN KEY (`INFO_JSON_ID_`) REFERENCES `ACT_GE_BYTEARRAY` (`ID_`), + CONSTRAINT `ACT_FK_INFO_PROCDEF` FOREIGN KEY (`PROC_DEF_ID_`) REFERENCES `ACT_RE_PROCDEF` (`ID_`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ACT_RE_DEPLOYMENT` ( + `ID_` varchar(64) COLLATE utf8_bin NOT NULL, + `NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `CATEGORY_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '', + `DEPLOY_TIME_` timestamp(3) NULL DEFAULT NULL, + PRIMARY KEY (`ID_`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ACT_RE_MODEL` ( + `ID_` varchar(64) COLLATE utf8_bin NOT NULL, + `REV_` int(11) DEFAULT NULL, + `NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `KEY_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `CATEGORY_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `CREATE_TIME_` timestamp(3) NULL DEFAULT NULL, + `LAST_UPDATE_TIME_` timestamp(3) NULL DEFAULT NULL, + `VERSION_` int(11) DEFAULT NULL, + `META_INFO_` varchar(4000) COLLATE utf8_bin DEFAULT NULL, + `DEPLOYMENT_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `EDITOR_SOURCE_VALUE_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `EDITOR_SOURCE_EXTRA_VALUE_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '', + PRIMARY KEY (`ID_`), + KEY `ACT_FK_MODEL_SOURCE` (`EDITOR_SOURCE_VALUE_ID_`), + KEY `ACT_FK_MODEL_SOURCE_EXTRA` (`EDITOR_SOURCE_EXTRA_VALUE_ID_`), + KEY `ACT_FK_MODEL_DEPLOYMENT` (`DEPLOYMENT_ID_`), + CONSTRAINT `ACT_FK_MODEL_DEPLOYMENT` FOREIGN KEY (`DEPLOYMENT_ID_`) REFERENCES `ACT_RE_DEPLOYMENT` (`ID_`), + CONSTRAINT `ACT_FK_MODEL_SOURCE` FOREIGN KEY (`EDITOR_SOURCE_VALUE_ID_`) REFERENCES `ACT_GE_BYTEARRAY` (`ID_`), + CONSTRAINT `ACT_FK_MODEL_SOURCE_EXTRA` FOREIGN KEY (`EDITOR_SOURCE_EXTRA_VALUE_ID_`) REFERENCES `ACT_GE_BYTEARRAY` (`ID_`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ACT_RE_PROCDEF` ( + `ID_` varchar(64) COLLATE utf8_bin NOT NULL, + `REV_` int(11) DEFAULT NULL, + `CATEGORY_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `KEY_` varchar(255) COLLATE utf8_bin NOT NULL, + `VERSION_` int(11) NOT NULL, + `DEPLOYMENT_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `RESOURCE_NAME_` varchar(4000) COLLATE utf8_bin DEFAULT NULL, + `DGRM_RESOURCE_NAME_` varchar(4000) COLLATE utf8_bin DEFAULT NULL, + `DESCRIPTION_` varchar(4000) COLLATE utf8_bin DEFAULT NULL, + `HAS_START_FORM_KEY_` tinyint(4) DEFAULT NULL, + `HAS_GRAPHICAL_NOTATION_` tinyint(4) DEFAULT NULL, + `SUSPENSION_STATE_` int(11) DEFAULT NULL, + `TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '', + PRIMARY KEY (`ID_`), + UNIQUE KEY `ACT_UNIQ_PROCDEF` (`KEY_`,`VERSION_`,`TENANT_ID_`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ACT_RU_EVENT_SUBSCR` ( + `ID_` varchar(64) COLLATE utf8_bin NOT NULL, + `REV_` int(11) DEFAULT NULL, + `EVENT_TYPE_` varchar(255) COLLATE utf8_bin NOT NULL, + `EVENT_NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `ACTIVITY_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `CONFIGURATION_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `CREATED_` timestamp(3) NOT NULL DEFAULT current_timestamp(3), + `PROC_DEF_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '', + PRIMARY KEY (`ID_`), + KEY `ACT_IDX_EVENT_SUBSCR_CONFIG_` (`CONFIGURATION_`), + KEY `ACT_FK_EVENT_EXEC` (`EXECUTION_ID_`), + CONSTRAINT `ACT_FK_EVENT_EXEC` FOREIGN KEY (`EXECUTION_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ACT_RU_EXECUTION` ( + `ID_` varchar(64) COLLATE utf8_bin NOT NULL, + `REV_` int(11) DEFAULT NULL, + `PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `BUSINESS_KEY_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `PARENT_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `PROC_DEF_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `SUPER_EXEC_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `ACT_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `IS_ACTIVE_` tinyint(4) DEFAULT NULL, + `IS_CONCURRENT_` tinyint(4) DEFAULT NULL, + `IS_SCOPE_` tinyint(4) DEFAULT NULL, + `IS_EVENT_SCOPE_` tinyint(4) DEFAULT NULL, + `SUSPENSION_STATE_` int(11) DEFAULT NULL, + `CACHED_ENT_STATE_` int(11) DEFAULT NULL, + `TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '', + `NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `LOCK_TIME_` timestamp(3) NULL DEFAULT NULL, + PRIMARY KEY (`ID_`), + KEY `ACT_IDX_EXEC_BUSKEY` (`BUSINESS_KEY_`), + KEY `ACT_FK_EXE_PROCINST` (`PROC_INST_ID_`), + KEY `ACT_FK_EXE_PARENT` (`PARENT_ID_`), + KEY `ACT_FK_EXE_SUPER` (`SUPER_EXEC_`), + KEY `ACT_FK_EXE_PROCDEF` (`PROC_DEF_ID_`), + CONSTRAINT `ACT_FK_EXE_PARENT` FOREIGN KEY (`PARENT_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`), + CONSTRAINT `ACT_FK_EXE_PROCDEF` FOREIGN KEY (`PROC_DEF_ID_`) REFERENCES `ACT_RE_PROCDEF` (`ID_`), + CONSTRAINT `ACT_FK_EXE_PROCINST` FOREIGN KEY (`PROC_INST_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `ACT_FK_EXE_SUPER` FOREIGN KEY (`SUPER_EXEC_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ACT_RU_IDENTITYLINK` ( + `ID_` varchar(64) COLLATE utf8_bin NOT NULL, + `REV_` int(11) DEFAULT NULL, + `GROUP_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `TYPE_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `USER_ID_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `PROC_DEF_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + PRIMARY KEY (`ID_`), + KEY `ACT_IDX_IDENT_LNK_USER` (`USER_ID_`), + KEY `ACT_IDX_IDENT_LNK_GROUP` (`GROUP_ID_`), + KEY `ACT_IDX_ATHRZ_PROCEDEF` (`PROC_DEF_ID_`), + KEY `ACT_FK_TSKASS_TASK` (`TASK_ID_`), + KEY `ACT_FK_IDL_PROCINST` (`PROC_INST_ID_`), + CONSTRAINT `ACT_FK_ATHRZ_PROCEDEF` FOREIGN KEY (`PROC_DEF_ID_`) REFERENCES `ACT_RE_PROCDEF` (`ID_`), + CONSTRAINT `ACT_FK_IDL_PROCINST` FOREIGN KEY (`PROC_INST_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`), + CONSTRAINT `ACT_FK_TSKASS_TASK` FOREIGN KEY (`TASK_ID_`) REFERENCES `ACT_RU_TASK` (`ID_`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ACT_RU_JOB` ( + `ID_` varchar(64) COLLATE utf8_bin NOT NULL, + `REV_` int(11) DEFAULT NULL, + `TYPE_` varchar(255) COLLATE utf8_bin NOT NULL, + `LOCK_EXP_TIME_` timestamp(3) NULL DEFAULT NULL, + `LOCK_OWNER_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `EXCLUSIVE_` tinyint(1) DEFAULT NULL, + `EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `PROCESS_INSTANCE_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `PROC_DEF_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `RETRIES_` int(11) DEFAULT NULL, + `EXCEPTION_STACK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `EXCEPTION_MSG_` varchar(4000) COLLATE utf8_bin DEFAULT NULL, + `DUEDATE_` timestamp(3) NULL DEFAULT NULL, + `REPEAT_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `HANDLER_TYPE_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `HANDLER_CFG_` varchar(4000) COLLATE utf8_bin DEFAULT NULL, + `TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '', + PRIMARY KEY (`ID_`), + KEY `ACT_FK_JOB_EXCEPTION` (`EXCEPTION_STACK_ID_`), + CONSTRAINT `ACT_FK_JOB_EXCEPTION` FOREIGN KEY (`EXCEPTION_STACK_ID_`) REFERENCES `ACT_GE_BYTEARRAY` (`ID_`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ACT_RU_TASK` ( + `ID_` varchar(64) COLLATE utf8_bin NOT NULL, + `REV_` int(11) DEFAULT NULL, + `EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `PROC_DEF_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `NAME_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `PARENT_TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `DESCRIPTION_` varchar(4000) COLLATE utf8_bin DEFAULT NULL, + `TASK_DEF_KEY_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `OWNER_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `ASSIGNEE_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `DELEGATION_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `PRIORITY_` int(11) DEFAULT NULL, + `CREATE_TIME_` timestamp(3) NULL DEFAULT NULL, + `DUE_DATE_` datetime(3) DEFAULT NULL, + `CATEGORY_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + `SUSPENSION_STATE_` int(11) DEFAULT NULL, + `TENANT_ID_` varchar(255) COLLATE utf8_bin DEFAULT '', + `FORM_KEY_` varchar(255) COLLATE utf8_bin DEFAULT NULL, + PRIMARY KEY (`ID_`), + KEY `ACT_IDX_TASK_CREATE` (`CREATE_TIME_`), + KEY `ACT_FK_TASK_EXE` (`EXECUTION_ID_`), + KEY `ACT_FK_TASK_PROCINST` (`PROC_INST_ID_`), + KEY `ACT_FK_TASK_PROCDEF` (`PROC_DEF_ID_`), + CONSTRAINT `ACT_FK_TASK_EXE` FOREIGN KEY (`EXECUTION_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`), + CONSTRAINT `ACT_FK_TASK_PROCDEF` FOREIGN KEY (`PROC_DEF_ID_`) REFERENCES `ACT_RE_PROCDEF` (`ID_`), + CONSTRAINT `ACT_FK_TASK_PROCINST` FOREIGN KEY (`PROC_INST_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ACT_RU_VARIABLE` ( + `ID_` varchar(64) COLLATE utf8_bin NOT NULL, + `REV_` int(11) DEFAULT NULL, + `TYPE_` varchar(255) COLLATE utf8_bin NOT NULL, + `NAME_` varchar(255) COLLATE utf8_bin NOT NULL, + `EXECUTION_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `PROC_INST_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `TASK_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `BYTEARRAY_ID_` varchar(64) COLLATE utf8_bin DEFAULT NULL, + `DOUBLE_` double DEFAULT NULL, + `LONG_` bigint(20) DEFAULT NULL, + `TEXT_` varchar(4000) COLLATE utf8_bin DEFAULT NULL, + `TEXT2_` varchar(4000) COLLATE utf8_bin DEFAULT NULL, + PRIMARY KEY (`ID_`), + KEY `ACT_IDX_VARIABLE_TASK_ID` (`TASK_ID_`), + KEY `ACT_FK_VAR_EXE` (`EXECUTION_ID_`), + KEY `ACT_FK_VAR_PROCINST` (`PROC_INST_ID_`), + KEY `ACT_FK_VAR_BYTEARRAY` (`BYTEARRAY_ID_`), + CONSTRAINT `ACT_FK_VAR_BYTEARRAY` FOREIGN KEY (`BYTEARRAY_ID_`) REFERENCES `ACT_GE_BYTEARRAY` (`ID_`), + CONSTRAINT `ACT_FK_VAR_EXE` FOREIGN KEY (`EXECUTION_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`), + CONSTRAINT `ACT_FK_VAR_PROCINST` FOREIGN KEY (`PROC_INST_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; +GRANT ALL PRIVILEGES ON openbook.* TO openbook@'%' IDENTIFIED BY '{{ openbook_database_password }}'; +GRANT ALL PRIVILEGES ON openbook.* TO openbook@localhost IDENTIFIED BY '{{ openbook_database_password }}'; +USE `openbook`; +/*!50001 DROP TABLE IF EXISTS `v_all_charges`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`openbook`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `v_all_charges` AS select `t_invoice`.`invoice_id` AS `invoice_id`,`t_invoice`.`payer_id` AS `payer_id`,`t_invoice`.`payer_type` AS `payer_type`,`t_invoice`.`payer_name` AS `payer_name`,`t_invoice`.`invoice_number` AS `invoice_number`,`t_invoice`.`invoice_date` AS `invoice_date`,`t_invoice`.`period_begin` AS `period_begin`,`t_invoice`.`period_end` AS `period_end`,`t_invoice`.`invoice_amount` AS `invoice_amount`,`t_invoice`.`actual_charges` AS `actual_charges`,`t_invoice`.`invoice_currency` AS `invoice_currency`,`t_invoice`.`management_region_id` AS `management_region_id` from `t_invoice` union select `t_unbilled_charges`.`invoice_id` AS `invoice_id`,`t_unbilled_charges`.`payer_id` AS `payer_id`,`t_unbilled_charges`.`payer_type` AS `payer_type`,`t_unbilled_charges`.`payer_name` AS `payer_name`,`t_unbilled_charges`.`invoice_number` AS `invoice_number`,`t_unbilled_charges`.`invoice_date` AS `invoice_date`,`t_unbilled_charges`.`period_begin` AS `period_begin`,`t_unbilled_charges`.`period_end` AS `period_end`,`t_unbilled_charges`.`invoice_amount` AS `invoice_amount`,`t_unbilled_charges`.`actual_charges` AS `actual_charges`,`t_unbilled_charges`.`invoice_currency` AS `invoice_currency`,`t_unbilled_charges`.`management_region_id` AS `management_region_id` from `t_unbilled_charges` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `v_all_charges_detail`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`openbook`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `v_all_charges_detail` AS select `t_invoice_detail`.`invoice_id` AS `invoice_id`,`t_invoice_detail`.`customer_id` AS `customer_id`,`t_invoice_detail`.`customer_name` AS `customer_name`,`t_invoice_detail`.`service_region_id` AS `service_region_id`,`t_invoice_detail`.`rate` AS `rate`,`t_invoice_detail`.`rate_display` AS `rate_display`,`t_invoice_detail`.`rate_unit` AS `rate_unit`,`t_invoice_detail`.`rate_interval` AS `rate_interval`,`t_invoice_detail`.`rate_multiplier_percent` AS `rate_multiplier_percent`,`t_invoice_detail`.`units_billed` AS `units_billed`,`t_invoice_detail`.`units_billed_display` AS `units_billed_display`,`t_invoice_detail`.`item_invoice_amount` AS `item_invoice_amount`,`t_invoice_detail`.`item_category` AS `item_category`,`t_invoice_detail`.`item_group` AS `item_group`,`t_invoice_detail`.`item_type` AS `item_type`,`t_invoice_detail`.`item_detail` AS `item_detail`,`t_invoice_detail`.`tenant_id` AS `tenant_id`,`t_invoice_detail`.`tenant_name` AS `tenant_name` from `t_invoice_detail` union select `t_unbilled_charges_detail`.`invoice_id` AS `invoice_id`,`t_unbilled_charges_detail`.`customer_id` AS `customer_id`,`t_unbilled_charges_detail`.`customer_name` AS `customer_name`,`t_unbilled_charges_detail`.`service_region_id` AS `service_region_id`,`t_unbilled_charges_detail`.`rate` AS `rate`,`t_unbilled_charges_detail`.`rate_display` AS `rate_display`,`t_unbilled_charges_detail`.`rate_unit` AS `rate_unit`,`t_unbilled_charges_detail`.`rate_interval` AS `rate_interval`,`t_unbilled_charges_detail`.`rate_multiplier_percent` AS `rate_multiplier_percent`,`t_unbilled_charges_detail`.`units_billed` AS `units_billed`,`t_unbilled_charges_detail`.`units_billed_display` AS `units_billed_display`,`t_unbilled_charges_detail`.`item_invoice_amount` AS `item_invoice_amount`,`t_unbilled_charges_detail`.`item_category` AS `item_category`,`t_unbilled_charges_detail`.`item_group` AS `item_group`,`t_unbilled_charges_detail`.`item_type` AS `item_type`,`t_unbilled_charges_detail`.`item_detail` AS `item_detail`,`t_unbilled_charges_detail`.`tenant_id` AS `tenant_id`,`t_unbilled_charges_detail`.`tenant_name` AS `tenant_name` from `t_unbilled_charges_detail` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `v_current_host`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`openbook`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `v_current_host` AS select `h`.`host_id` AS `host_id`,`h`.`service_manager_id` AS `service_manager_id`,`sm`.`service_manager_name` AS `service_manager_name`,`h`.`service_region_id` AS `service_region_id`,`r`.`region_name` AS `region_name`,`h`.`host_foreign_id` AS `host_foreign_id`,`h`.`host_name` AS `host_name`,`h`.`hypervisor_type` AS `hypervisor_type`,`h`.`host_aggregate` AS `host_aggregate`,`h`.`add_date` AS `add_date`,`h`.`remove_date` AS `remove_date`,`h`.`cpu_allocation_ratio` AS `cpu_allocation_ratio`,`h`.`ram_allocation_ratio` AS `ram_allocation_ratio`,`h`.`disk_allocation_ratio` AS `disk_allocation_ratio`,`ha`.`update_date` AS `update_date`,`ha`.`ram_mb` AS `ram_mb`,`ha`.`ram_mb_used` AS `ram_mb_used`,`ha`.`disk_gb` AS `disk_gb`,`ha`.`disk_gb_used` AS `disk_gb_used`,`ha`.`vcpus` AS `vcpus`,`ha`.`vcpus_used` AS `vcpus_used`,`ha`.`vm_count` AS `vm_count`,`ha`.`socket_count` AS `socket_count` from (((`t_host` `h` join `v_current_host_attributes` `ha` on(`h`.`host_id` = `ha`.`host_id`)) join `t_service_manager` `sm` on(`h`.`service_manager_id` = `sm`.`service_manager_id`)) join `t_region` `r` on(`h`.`service_region_id` = `r`.`region_id`)) where `h`.`remove_date` > curdate() */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `v_current_host_attributes`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`openbook`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `v_current_host_attributes` AS select `tha1`.`host_id` AS `host_id`,`tha1`.`update_date` AS `update_date`,`tha1`.`ram_mb` AS `ram_mb`,`tha1`.`ram_mb_used` AS `ram_mb_used`,`tha1`.`disk_gb` AS `disk_gb`,`tha1`.`disk_gb_used` AS `disk_gb_used`,`tha1`.`vcpus` AS `vcpus`,`tha1`.`vcpus_used` AS `vcpus_used`,`tha1`.`vm_count` AS `vm_count`,`tha1`.`socket_count` AS `socket_count` from `t_host_attributes` `tha1` where `tha1`.`update_date` = (select max(`t_host_attributes`.`update_date`) from `t_host_attributes` where `t_host_attributes`.`host_id` = `tha1`.`host_id`) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `v_customer`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`openbook`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `v_customer` AS select `c`.`customer_id` AS `customer_id`,`c`.`customer_name` AS `customer_name`,`c`.`metadata` AS `metadata`,`c`.`tax_rate` AS `tax_rate`,`c`.`currency` AS `currency`,`c`.`discount_percent` AS `discount_percent`,`c`.`billing_frequency` AS `billing_frequency`,`c`.`last_bill_date` AS `last_bill_date`,`c`.`next_bill_date` AS `next_bill_date`,`c`.`is_active` AS `is_active`,`c`.`create_date` AS `create_date`,`c`.`activate_date` AS `activate_date`,`c`.`billing_start_date` AS `billing_start_date`,`c`.`last_payment_date` AS `last_payment_date`,`c`.`deactivate_date` AS `deactivate_date`,`c`.`description` AS `description`,`c`.`minimum_invoice_commitment` AS `minimum_invoice_commitment`,`c`.`invoicing_method` AS `invoicing_method`,`c`.`management_region_id` AS `management_region_id`,`c`.`billing_address_line_1` AS `billing_address_line_1`,`c`.`billing_address_line_2` AS `billing_address_line_2`,`c`.`billing_address_city` AS `billing_address_city`,`c`.`billing_address_region` AS `billing_address_region`,`c`.`billing_address_country` AS `billing_address_country`,`c`.`billing_address_postal_code` AS `billing_address_postal_code`,`c`.`payer_payment_details` AS `payer_payment_details`,`c`.`payment_method_confirmed` AS `payment_method_confirmed`,`c`.`balance_due` AS `balance_due`,`c`.`spend_soft_limit` AS `spend_soft_limit`,`c`.`spend_hard_limit` AS `spend_hard_limit`,`c`.`terms_and_conditions_2_accept_date` AS `terms_and_conditions_2_accept_date`,`c`.`tax_id` AS `tax_id`,`c`.`registration_number` AS `registration_number`,`r1`.`region_name` AS `management_region_name` from (`t_customer` `c` left join `t_region` `r1` on(`c`.`management_region_id` = `r1`.`region_id`)) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `v_metric`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`openbook`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `v_metric` AS select `m`.`metric_id` AS `metric_id`,`m`.`service_manager_type_id` AS `service_manager_type_id`,`m`.`metric_name` AS `metric_name`,`m`.`metric_label` AS `metric_label`,`m`.`metric_source` AS `metric_source`,`m`.`metric_type` AS `metric_type`,`m`.`metric_unit` AS `metric_unit`,`m`.`entity_resolution` AS `entity_resolution`,`m`.`time_resolution` AS `time_resolution`,`sm`.`service_manager_type` AS `service_manager_type` from (`t_metric` `m` left join `t_service_manager_type` `sm` on(`m`.`service_manager_type_id` = `sm`.`service_manager_type_id`)) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `v_promo_code_redemption`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`openbook`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `v_promo_code_redemption` AS select `p`.`management_region_id` AS `management_region_id`,`p`.`promo_code_id` AS `promo_code_id`,`p`.`promo_code` AS `promo_code`,`p`.`salesperson` AS `salesperson`,`p`.`discount_or_credit` AS `discount_or_credit`,`p`.`credit_amount` AS `credit_amount`,`p`.`credit_type` AS `credit_type`,`p`.`apply_to_charge_category` AS `apply_to_charge_category`,`p`.`trigger_charge_category` AS `trigger_charge_category`,`p`.`trigger_amount` AS `trigger_amount`,`p`.`discount_percent` AS `discount_percent`,`p`.`available_invoice_periods` AS `available_invoice_periods`,`p`.`expire_date` AS `expire_date`,`p`.`currency` AS `currency`,`r`.`redemption_date` AS `redemption_date`,`c`.`customer_id` AS `customer_id`,`c`.`customer_name` AS `customer_name` from ((`t_promo_code_redemption` `r` join `t_customer` `c`) join `t_promo_code` `p`) where `r`.`payer_type` = 'Customer' and `r`.`payer_id` = `c`.`customer_id` and `p`.`promo_code_id` = `r`.`promo_code_id` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `v_provider`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`openbook`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `v_provider` AS select `t_provider`.`provider_id` AS `provider_id`,`t_provider`.`provider_name` AS `provider_name`,`t_provider`.`provider_type` AS `provider_type`,`t_provider`.`metadata` AS `metadata`,`t_provider`.`tax_rate` AS `tax_rate`,`t_provider`.`currency` AS `currency`,`t_provider`.`discount_percent` AS `discount_percent`,`t_provider`.`billing_frequency` AS `billing_frequency`,`t_provider`.`last_bill_date` AS `last_bill_date`,`t_provider`.`next_bill_date` AS `next_bill_date`,`t_provider`.`last_payment_date` AS `last_payment_date`,`t_provider`.`is_active` AS `is_active`,`t_provider`.`create_date` AS `create_date`,`t_provider`.`activate_date` AS `activate_date`,`t_provider`.`billing_start_date` AS `billing_start_date`,`t_provider`.`deactivate_date` AS `deactivate_date`,`t_provider`.`description` AS `description`,`t_provider`.`minimum_invoice_commitment` AS `minimum_invoice_commitment`,`t_provider`.`invoicing_method` AS `invoicing_method`,`t_provider`.`invoice_processing_method` AS `invoice_processing_method`,`t_provider`.`billing_address_line_1` AS `billing_address_line_1`,`t_provider`.`billing_address_line_2` AS `billing_address_line_2`,`t_provider`.`billing_address_city` AS `billing_address_city`,`t_provider`.`billing_address_region` AS `billing_address_region`,`t_provider`.`billing_address_country` AS `billing_address_country`,`t_provider`.`billing_address_postal_code` AS `billing_address_postal_code`,`t_provider`.`legal_address_line_1` AS `legal_address_line_1`,`t_provider`.`legal_address_line_2` AS `legal_address_line_2`,`t_provider`.`legal_address_city` AS `legal_address_city`,`t_provider`.`legal_address_region` AS `legal_address_region`,`t_provider`.`legal_address_country` AS `legal_address_country`,`t_provider`.`legal_address_postal_code` AS `legal_address_postal_code`,`t_provider`.`payer_payment_details` AS `payer_payment_details`,`t_provider`.`payee_payment_details` AS `payee_payment_details`,`t_provider`.`public_url` AS `public_url`,`t_provider`.`management_region_id` AS `management_region_id`,`t_provider`.`balance_due` AS `balance_due`,`t_provider`.`openbook_processes_payments` AS `openbook_processes_payments`,`t_provider`.`openbook_processes_past_due_invoices` AS `openbook_processes_past_due_invoices`,`t_provider`.`openstack_tenant_id` AS `openstack_tenant_id`,`t_provider`.`tax_id` AS `tax_id`,`t_provider`.`registration_number` AS `registration_number`,`t_provider`.`os_service_manager_id` AS `os_service_manager_id`,`t_region`.`parent_region_id` AS `parent_management_region_id` from (`t_provider` left join `t_region` on(`t_region`.`region_id` = `t_provider`.`management_region_id`)) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `v_rate_plan_assignment`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `v_rate_plan_assignment` AS select `a`.`rate_plan_id` AS `rate_plan_id`,`a`.`assignee_id` AS `assignee_id`,`a`.`assignee_type` AS `assignee_type`,`a`.`assignment_start_date` AS `assignment_start_date`,`a`.`assignment_end_date` AS `assignment_end_date`,`a`.`assignment_type` AS `assignment_type`,`r`.`management_region_id` AS `management_region_id` from (`t_rate_plan_assignment` `a` left join `t_rate_plan` `r` on(`a`.`rate_plan_id` = `r`.`rate_plan_id`)) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `v_service`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`openbook`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `v_service` AS select `s`.`service_id` AS `service_id`,`s`.`service_type` AS `service_type`,`s`.`service_description` AS `service_description`,`s`.`service_manager_type_id` AS `service_manager_type_id`,`s`.`states` AS `states`,`s`.`externally_managed` AS `externally_managed`,`sm`.`service_manager_type` AS `service_manager_type` from (`t_service` `s` left join `t_service_manager_type` `sm` on(`s`.`service_manager_type_id` = `sm`.`service_manager_type_id`)) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `v_service_instance`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`openbook`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `v_service_instance` AS select `tsi`.`service_instance_id` AS `service_instance_id`,`tsi`.`service_id` AS `service_id`,`tsi`.`service_instance_name` AS `service_instance_name`,`tsi`.`service_manager_id` AS `service_manager_id`,`tsi`.`service_region_id` AS `service_region_id`,`tsi`.`service_instance_foreign_id` AS `service_instance_foreign_id`,`tsi`.`tenant_id` AS `tenant_id`,`tsi`.`current_attributes` AS `current_attributes`,`tt`.`tenant_name` AS `tenant_name`,`tt`.`tenant_foreign_id` AS `tenant_foreign_id`,`tt`.`customer_id` AS `customer_id`,`tc`.`customer_name` AS `customer_name`,`tc`.`management_region_id` AS `management_region_id`,`tsm`.`service_manager_name` AS `service_manager_name`,`tr`.`region_name` AS `service_region_name`,`tsmt`.`service_manager_type` AS `service_manager_type`,`ts`.`service_type` AS `service_type`,`tsis`.`start_date` AS `provisioned_date`,`tsis`.`end_date` AS `deprovisioned_date` from (((((((`t_service_instance` `tsi` left join `t_tenant` `tt` on(`tsi`.`tenant_id` = `tt`.`tenant_id`)) left join `t_customer` `tc` on(`tc`.`customer_id` = `tt`.`customer_id`)) left join `t_service` `ts` on(`tsi`.`service_id` = `ts`.`service_id`)) left join `t_service_manager_type` `tsmt` on(`ts`.`service_manager_type_id` = `tsmt`.`service_manager_type_id`)) left join `t_region` `tr` on(`tsi`.`service_region_id` = `tr`.`region_id`)) left join `t_service_manager` `tsm` on(`tsi`.`service_manager_id` = `tsm`.`service_manager_id`)) left join `t_service_instance_state` `tsis` on(`tsi`.`service_instance_id` = `tsis`.`service_instance_id` and `tsis`.`state` = 'In Existence')) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `v_service_instance_attributes`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`openbook`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `v_service_instance_attributes` AS select `tpsa`.`service_instance_id` AS `service_instance_id`,`tpsa`.`start_date` AS `start_date`,`tpsa`.`end_date` AS `end_date`,`tpsa`.`attributes` AS `attributes`,`tt`.`tenant_id` AS `tenant_id`,`tt`.`tenant_foreign_id` AS `tenant_foreign_id`,`tt`.`tenant_name` AS `tenant_name`,`tc`.`customer_id` AS `customer_id`,`tc`.`customer_name` AS `customer_name`,`tc`.`management_region_id` AS `management_region_id`,`tps`.`service_instance_name` AS `service_instance_name`,`tps`.`service_instance_foreign_id` AS `service_instance_foreign_id`,`tps`.`service_manager_id` AS `service_manager_id`,`tsm`.`service_manager_name` AS `service_manager_name`,`ts`.`service_id` AS `service_id`,`ts`.`service_type` AS `service_type`,`tsmt`.`service_manager_type` AS `service_manager_type`,`tr`.`region_id` AS `service_region_id`,`tr`.`region_name` AS `service_region_name` from (((((((`t_service_instance_attributes` `tpsa` left join `t_service_instance` `tps` on(`tps`.`service_instance_id` = `tpsa`.`service_instance_id`)) left join `t_service` `ts` on(`ts`.`service_id` = `tps`.`service_id`)) left join `t_service_manager` `tsm` on(`tsm`.`service_manager_id` = `tps`.`service_manager_id`)) left join `t_region` `tr` on(`tps`.`service_region_id` = `tr`.`region_id`)) left join `t_service_manager_type` `tsmt` on(`ts`.`service_manager_type_id` = `tsmt`.`service_manager_type_id`)) left join `t_tenant` `tt` on(`tps`.`tenant_id` = `tt`.`tenant_id`)) left join `t_customer` `tc` on(`tt`.`customer_id` = `tc`.`customer_id`)) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `v_service_instance_state`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`openbook`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `v_service_instance_state` AS select `tpss`.`service_instance_id` AS `service_instance_id`,`tpss`.`state` AS `state`,`tpss`.`start_date` AS `start_date`,`tpss`.`end_date` AS `end_date`,`tpss`.`interval_length_milliseconds` AS `interval_length_milliseconds`,`tt`.`tenant_id` AS `tenant_id`,`tt`.`tenant_foreign_id` AS `tenant_foreign_id`,`tt`.`tenant_name` AS `tenant_name`,`tc`.`customer_id` AS `customer_id`,`tc`.`customer_name` AS `customer_name`,`tc`.`management_region_id` AS `management_region_id`,`tps`.`service_instance_name` AS `service_instance_name`,`tps`.`service_instance_foreign_id` AS `service_instance_foreign_id`,`tps`.`service_manager_id` AS `service_manager_id`,`tsm`.`service_manager_name` AS `service_manager_name`,`ts`.`service_id` AS `service_id`,`ts`.`service_type` AS `service_type`,`tsmt`.`service_manager_type` AS `service_manager_type`,`tr`.`region_id` AS `service_region_id`,`tr`.`region_name` AS `service_region_name` from (((((((`t_service_instance_state` `tpss` left join `t_service_instance` `tps` on(`tps`.`service_instance_id` = `tpss`.`service_instance_id`)) left join `t_service` `ts` on(`ts`.`service_id` = `tps`.`service_id`)) left join `t_service_manager` `tsm` on(`tsm`.`service_manager_id` = `tps`.`service_manager_id`)) left join `t_region` `tr` on(`tps`.`service_region_id` = `tr`.`region_id`)) left join `t_service_manager_type` `tsmt` on(`ts`.`service_manager_type_id` = `tsmt`.`service_manager_type_id`)) left join `t_tenant` `tt` on(`tps`.`tenant_id` = `tt`.`tenant_id`)) left join `t_customer` `tc` on(`tt`.`customer_id` = `tc`.`customer_id`)) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `v_service_manager`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`openbook`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `v_service_manager` AS select `tsm`.`service_manager_id` AS `service_manager_id`,`tsm`.`service_manager_name` AS `service_manager_name`,`tsm`.`service_manager_description` AS `service_manager_description`,`tsm`.`metadata` AS `metadata`,`tsm`.`service_region_id` AS `service_region_id`,`tsm`.`service_manager_type_id` AS `service_manager_type_id`,`tsmt`.`service_manager_type` AS `service_manager_type` from (`t_service_manager` `tsm` left join `t_service_manager_type` `tsmt` on(`tsm`.`service_manager_type_id` = `tsmt`.`service_manager_type_id`)) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `v_tenant`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`openbook`@`%` SQL SECURITY DEFINER */ +/*!50001 VIEW `v_tenant` AS select `t`.`tenant_id` AS `tenant_id`,`t`.`tenant_name` AS `tenant_name`,`t`.`tenant_foreign_id` AS `tenant_foreign_id`,`t`.`create_date` AS `create_date`,`t`.`deactivate_date` AS `deactivate_date`,`t`.`customer_id` AS `customer_id`,`t`.`service_manager_id` AS `service_manager_id`,`t`.`is_active` AS `is_active`,`c`.`customer_name` AS `customer_name`,`c`.`management_region_id` AS `management_region_id`,`tsmt`.`service_manager_type` AS `service_manager_type` from (((`t_tenant` `t` left join `t_customer` `c` on(`t`.`customer_id` = `c`.`customer_id`)) left join `t_service_manager` `tsm` on(`t`.`service_manager_id` = `tsm`.`service_manager_id`)) left join `t_service_manager_type` `tsmt` on(`tsm`.`service_manager_type_id` = `tsmt`.`service_manager_type_id`)) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP TABLE IF EXISTS `v_users`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `v_users` AS select `u`.`user_id` AS `user_id`,`u`.`username` AS `username`,`u`.`first_name` AS `first_name`,`u`.`last_name` AS `last_name`,`u`.`email_address` AS `email_address`,`u`.`phone_number` AS `phone_number`,`u`.`password` AS `password`,`u`.`is_active` AS `is_active`,`u`.`password_change_token` AS `password_change_token`,`u`.`last_password_change_date` AS `last_password_change_date`,`u`.`password_change_token_expire_date` AS `password_change_token_expire_date`,`r`.`role_name` AS `role_name`,`r`.`role_context` AS `role_context` from (`t_users` `u` left join `t_user_roles` `r` on(`u`.`user_id` = `r`.`user_id`)) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +GRANT ALL PRIVILEGES ON openbook_jobs.* TO openbook_jobs@'%' IDENTIFIED BY '{{ openbook_database_password }}'; +GRANT ALL PRIVILEGES ON openbook_jobs.* TO openbook_jobs@localhost IDENTIFIED BY '{{ openbook_database_password }}'; +USE `openbook_jobs`; +GRANT ALL PRIVILEGES ON openbook_workflow.* TO openbook_workflow@'%' IDENTIFIED BY '{{ openbook_database_password }}'; +GRANT ALL PRIVILEGES ON openbook_workflow.* TO openbook_workflow@localhost IDENTIFIED BY '{{ openbook_database_password }}'; +USE `openbook_workflow`; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; +use openbook; +CALL p_preallocate_partitions('t_metric_values', 'metric_datetime', CURDATE(), 31); +CALL p_preallocate_partitions('t_metric_aggregate_resource_hourly', 'aggregate_datetime', CURDATE(), 31); +CALL p_preallocate_partitions('t_metric_aggregate_tenant_hourly', 'aggregate_datetime', CURDATE(), 31); +CALL p_preallocate_partitions('t_metric_aggregate_customer_hourly', 'aggregate_datetime', CURDATE(), 31); +CALL p_preallocate_partitions('t_metric_aggregate_resource_daily', 'aggregate_datetime', CURDATE(), 31); +CALL p_preallocate_partitions('t_metric_aggregate_tenant_daily', 'aggregate_datetime', CURDATE(), 31); +CALL p_preallocate_partitions('t_metric_aggregate_customer_daily', 'aggregate_datetime', CURDATE(), 31); diff --git a/templates/database/etc/openbook/database/debian.cnf b/templates/database/etc/openbook/database/debian.cnf new file mode 100644 index 0000000..c4c3297 --- /dev/null +++ b/templates/database/etc/openbook/database/debian.cnf @@ -0,0 +1,11 @@ +[client] +host = localhost +user = debian-sys-maint +password = {{ openbook_database_password }} +socket = /var/run/mysqld/mysqld.sock +[mysql_upgrade] +host = localhost +user = debian-sys-maint +password = {{ openbook_database_password }} +socket = /var/run/mysqld/mysqld.sock +basedir = /usr diff --git a/templates/database/root/.my.cnf b/templates/database/root/.my.cnf new file mode 100644 index 0000000..269e0ba --- /dev/null +++ b/templates/database/root/.my.cnf @@ -0,0 +1,6 @@ +[mysql] +user=root +password={{ openbook_database_password }} +[mysqldump] +user=root +password={{ openbook_database_password }} diff --git a/templates/database/run.sh b/templates/database/run.sh new file mode 100755 index 0000000..9a61648 --- /dev/null +++ b/templates/database/run.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# find other running nodes +other_nodes_found=1 +for i in $(echo "{{ openbook_gcomm_addresses }}" | sed -e 's|,| |g'); do + if [ "${i}" != "{{ ansible_default_ipv4.address }}" ]; then + nc ${i} 4567 </dev/null >/dev/null + if [ "${?}" == "0" ]; then + other_nodes_found=0 + fi + fi +done + +# bootstrap or cluster join depending on whether other nodes were found +if [ "${other_nodes_found}" == "0" ]; then + mysql_args="" +else + mysql_args="--wsrep-new-cluster" +fi + +docker run -d --rm --net=host -p 3306:3306 -p 4444:4444 -p 4567:4567 -p 4567:4567/udp -p 4568:4568 -p 9200:9200 -v /etc/openbook/database:/etc/mysql -v /var/lib/mysql:/var/lib/mysql -v /var/log/mysql:/var/log/mysql --name database openbook-docker-registry.verizoncloudplatform.com/openbook_database ${mysql_args} + +exit 0 diff --git a/templates/job_scheduler_server/etc/openbook/job-scheduler-server/job-scheduler-server.json b/templates/job_scheduler_server/etc/openbook/job-scheduler-server/job-scheduler-server.json new file mode 100644 index 0000000..59c1694 --- /dev/null +++ b/templates/job_scheduler_server/etc/openbook/job-scheduler-server/job-scheduler-server.json @@ -0,0 +1,19 @@ + +{% set ips = openbook_gcomm_addresses.split(",") %} +{% if ips|length > 1 %} +{% set failover = "failover:" %} +{% else %} +{% set failover = "" %} +{% endif %} + + +{ + "log.path": "/var/log/openbook/job-scheduler-server/job-scheduler-server.log" + +{% if "True" == openbook_install_job_scheduler_server|string() %} + ,"entityDS.url": "jdbc:mariadb:{{ failover }}//{{ openbook_gcomm_addresses }}/openbook" + ,"jobsDS.url": "jdbc:mariadb:{{ failover }}//{{ openbook_gcomm_addresses }}/openbook_jobs" + ,"cluster.interfaces": ["{{ ansible_default_ipv4.address }}"] +{% endif %} + +} diff --git a/templates/job_scheduler_server/run.sh b/templates/job_scheduler_server/run.sh new file mode 100755 index 0000000..25d5f60 --- /dev/null +++ b/templates/job_scheduler_server/run.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +docker run -d --rm --net=host -p 5701:5701 -p 5702:5702 -v /etc/openbook/job-scheduler-server:/etc/openbook/job-scheduler-server -v /var/log/openbook/job-scheduler-server:/var/log/openbook/job-scheduler-server --name job_scheduler_server_unstable openbook-docker-registry.verizoncloudplatform.com/openbook_job_scheduler_server_unstable +exit 0 diff --git a/templates/registry.conf b/templates/registry.conf new file mode 100644 index 0000000..e47e032 --- /dev/null +++ b/templates/registry.conf @@ -0,0 +1,39 @@ +upstream docker-registry { + server registry:5000; +} + +server { + listen 443; + server_name {{ cn }}; + + # SSL + ssl on; + ssl_certificate /etc/nginx/conf.d/{{ cn }}.crt; + ssl_certificate_key /etc/nginx/conf.d/{{ cn }}.key; + + # disable any limits to avoid HTTP 413 for large image uploads + client_max_body_size 0; + + # required to avoid HTTP 411: see Issue #1486 (https://github.com/docker/docker/issues/1486) + chunked_transfer_encoding on; + + location /v2/ { + # Do not allow connections from docker 1.5 and earlier + # docker pre-1.6.0 did not properly set the user agent on ping, catch "Go *" user agents + if ($http_user_agent ~ "^(docker\/1\.(3|4|5(?!\.[0-9]-dev))|Go ).*$" ) { + return 404; + } + + # To add basic authentication to v2 use auth_basic setting plus add_header + auth_basic "registry.localhost"; + auth_basic_user_file /etc/nginx/conf.d/registry.password; + add_header 'Docker-Distribution-Api-Version' 'registry/2.0' always; + + proxy_pass http://docker-registry; + proxy_set_header Host $http_host; # required for docker client's sake + proxy_set_header X-Real-IP $remote_addr; # pass on real client's IP + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_read_timeout 900; + } +} diff --git a/templates/workflow_server/etc/openbook/workflow-server/workflow-server.json b/templates/workflow_server/etc/openbook/workflow-server/workflow-server.json new file mode 100644 index 0000000..8ddd571 --- /dev/null +++ b/templates/workflow_server/etc/openbook/workflow-server/workflow-server.json @@ -0,0 +1,19 @@ + +{% set ips = openbook_gcomm_addresses.split(",") %} +{% if ips|length > 1 %} +{% set failover = "failover:" %} +{% else %} +{% set failover = "" %} +{% endif %} + + +{ + "log.path": "/var/log/openbook/workflow-server/workflow-server.log" + +{% if "True" == openbook_install_workflow_server|string() %} + ,"entityDS.url": "jdbc:mariadb:{{ failover }}//{{ openbook_gcomm_addresses }}/openbook" + ,"workflowDS.url": "jdbc:mariadb:{{ failover }}//{{ openbook_gcomm_addresses }}/openbook_workflow" + ,"cluster.interfaces": ["{{ ansible_default_ipv4.address }}"] +{% endif %} + +} diff --git a/templates/workflow_server/run.sh b/templates/workflow_server/run.sh new file mode 100755 index 0000000..e744cc9 --- /dev/null +++ b/templates/workflow_server/run.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +docker run -d --rm --net=host -p 5701:5701 -p 5702:5702 -v /etc/openbook/workflow-server:/etc/openbook/workflow-server -v /var/log/openbook/workflow-server:/var/log/openbook/workflow-server --name workflow_server_unstable openbook-docker-registry.verizoncloudplatform.com/openbook_workflow_server_unstable +exit 0 |
