# -*- encoding: utf-8 -*-

KEY_ROOT_PATH = 'ROOT_PATH'
KEY_PROJECT_NAME = 'aimaestro'
TABLE_NAME_TASKS = 'task_list'
TABLE_NAME_USERS = 'user_list'
TABLE_NAME_NODES = 'server_list'
TABLE_NAME_SERVICES = 'service_list'

TABLE_NAME_DIALOGUES = 'dialogues'
TABLE_NAME_DIALOGUE_MESSAGE = 'dialogue_message'

KEY_LOGS_PATH = 'logs'
KEY_LOGS_FILENAME = 'filename'

KEY_RPC_PROXY_NAME = 'rpc'
KEY_RPC_METHOD_NAME = 'call'

KEY_RABBITMQ_URI = 'AMQP_URI'
KEY_RABBITMQ_CONFIG = 'RABBITMQ_CONFIG'
KEY_SYSTEM_SERVICE_NAME = 'proxy_system_server'

KEY_MONGO_CONFIG = 'MONGODB_CONFIG'

KEY_TASK_BODY = 'body'
KEY_TASK_ID = 'task_id'
KEY_TASK_WEIGHT = 'weight'
KEY_TASK_STATUS = 'status'
KEY_TASK_SOURCE_ID = 'source_id'
KEY_TASK_QUEUE_NAME = 'queue_name'
KEY_TASK_IS_SUB_TASK = 'is_subtask'
KEY_TASK_IS_SUB_TASK_ALL_FINISH = 'is_subtask_all_finish'

KEY_TASK_WAIT_STATUS = 'wait'
KEY_TASK_SEND_STATUS = 'send'
KEY_TASK_STOP_STATUS = 'stop'
KEY_TASK_ERROR_STATUS = 'error'
KEY_TASK_RUN_STATUS = 'running'
KEY_TASK_SUCCESS_STATUS = 'success'
KEY_TASK_ERROR_MESSAGE = 'error_message'

KEY_TASK_END_TIME = 'end_time'
KEY_TASK_START_TIME = 'start_time'
KEY_TASK_CREATE_TIME = 'create_time'

KEY_NAME = 'name'
KEY_SERVICE_PID = 'service_pid'
KEY_SERVICE_NAME = 'service_name'
KEY_SERVICE_IPADDR = 'service_ipaddr'
KEY_SERVICE_VERSION = 'service_version'
KEY_SERVICE_FUNCTIONS = 'service_functions'

KEY_WORKER_PID = 'worker_pid'
KEY_WORKER_NAME = 'worker_name'
KEY_WORKER_IPADDR = 'worker_ipaddr'
KEY_WORKER_VERSION = 'worker_version'
KEY_WORKER_FUNCTIONS = 'worker_functions'
KEY_WORKER_MAX_PROCESS = 'worker_max_process'
KEY_WORKER_RUN_PROCESS = 'worker_run_process'

KEY_NODE_IPADDR = 'ipaddr'

KEY_ADMIN_USERNAME = 'ADMIN_USERNAME'
KEY_ADMIN_PASSWORD = 'ADMIN_PASSWORD'
KEY_HTTP_SERVER_FORK = 'HTTP_SERVER_FORK'

KEY_DEFAULT_SCHEDULE_TIME = 'DEFAULT_SCHEDULE_TIME'

KEY_FUNCTION_SELF = 'self'
KEY_FUNCTION_RPC = 'RpcFunction'
KEY_FUNCTION_WORKER = 'WorkerFunction'
KEY_FUNCTION_PARAM_NAME = 'param_name'
KEY_FUNCTION_PARAM_DEFAULT_VALUE = 'default_value'

KEY_CIPHER_CIPHERTEXT = 'CIPHERTEXT'
KEY_CIPHER_PRIVATE_KEY = 'PRIVATE_KEY'
KEY_CIPHER_PUBLIC_KEY = 'PUBLIC_KEY'

KEY_RPC_CALL_TIMEOUT = 'RPC_CALL_TIMEOUT'

SOCKET_BIND_PORT = 80
SOCKET_BIND_IP = '8.8.8.8'
SOCKET_SHUTDOWN_SLEEP = 2

DEFAULT_VALUE_TIMEZONE = 'Asia/Shanghai'
DEFAULT_VALUE_TIME_FMT = '%Y%m%d%H%M%S'

DEFAULT_VALUE_LOGS_SUFFIX = "%Y-%m-%d.log"
DEFAULT_VALUE_LOGS_FMT = '%(asctime)s - %(levelname)s - [%(filename)s:%(lineno)d] %(message)s'

DEFAULT_VALUE_TASK_WEIGHT = 1
DEFAULT_VALUE_HTTP_SERVER_FORK = False

DEFAULT_VALUE_USERNAME = 'scheduleAdmin'
DEFAULT_VALUE_PASSWORD = 'scheduleAdminPassword'

DEFAULT_VALUE_SCHEDULE_TIME = 10
DEFAULT_VALUE_RPC_CALL_TIMEOUT = 30
DEFAULT_VALUE_RABBITMQ_URI = 'amqp://scheduleAdmin:scheduleAdminPassword@127.0.0.1:5672'
DEFAULT_VALUE_MONGODB_URI = 'mongodb://scheduleAdmin:scheduleAdminPassword@127.0.0.1:27017'
