# Copyright 2022 Canonical Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# For those usages not covered by the Apache License, Version 2.0 please
# contact: legal@canonical.com
#
# To get in touch with the maintainers, please contact:
# osm-charmers@lists.launchpad.net
#
#
# This file populates the Configure tab on Charmhub.
# See https://juju.is/docs/some-url-to-be-determined/ for a checklist and guidance.

options:
  log-level:
    default: "INFO"
    description: |
      Set the Logging Level.

      Options:
        - TRACE
        - DEBUG
        - INFO
        - WARN
        - ERROR
        - FATAL
    type: string
  mysql-uri:
    type: string
    description: |
      Mysql URI with the following format:
        mysql://<user>:<password>@<mysql_host>:<mysql_port>/<database>

      This should be removed after the mysql-integrator charm is made.

      If provided, this config will override the mysql relation.

  # Debug-mode options
  debug-mode:
    type: boolean
    description: |
      Great for OSM Developers! (Not recommended for production deployments)

      This action activates the Debug Mode, which sets up the container to be ready for debugging.
      As part of the setup, SSH is enabled and a VSCode workspace file is automatically populated.

      After enabling the debug-mode, execute the following command to get the information you need
      to start debugging:
        `juju run-action <unit name> get-debug-mode-information --wait`

      The previous command returns the command you need to execute, and the SSH password that was set.

      See also:
        - https://charmhub.io/osm-pol/configure#pol-hostpath
        - https://charmhub.io/osm-pol/configure#common-hostpath
    default: false

  pol-hostpath:
    type: string
    description: |
      Set this config to the local path of the POL module to persist the changes done during the
      debug-mode session.

      Example:
        $ git clone "https://osm.etsi.org/gerrit/osm/POL" /home/ubuntu/POL
        $ juju config pol pol-hostpath=/home/ubuntu/POL

      This configuration only applies if option `debug-mode` is set to true.

  common-hostpath:
    type: string
    description: |
      Set this config to the local path of the common module to persist the changes done during the
      debug-mode session.

      Example:
        $ git clone "https://osm.etsi.org/gerrit/osm/common" /home/ubuntu/common
        $ juju config pol common-hostpath=/home/ubuntu/common

      This configuration only applies if option `debug-mode` is set to true.
