# 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
  database-commonkey:
    description: Database COMMON KEY
    type: string
    default: osm

  # Ingress options
  external-hostname:
    default: ""
    description: |
      The url that will be configured in the Kubernetes ingress.

      The easiest way of configuring the external-hostname without having the DNS setup is by using
      a Wildcard DNS like nip.io constructing the url like so:
        - nbi.127.0.0.1.nip.io (valid within the K8s cluster node)
        - nbi.<k8s-worker-ip>.nip.io (valid from outside the K8s cluster node)

      This option is only applicable when the Kubernetes cluster has nginx ingress configured
      and the charm is related to the nginx-ingress-integrator.
      See more: https://charmhub.io/nginx-ingress-integrator
    type: string
  max-body-size:
    default: 20
    description: Max allowed body-size (for file uploads) in megabytes, set to 0 to
      disable limits.
    source: default
    type: int
    value: 20
  tls-secret-name:
    description: TLS secret name to use for ingress.
    type: string

  # 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-nbi/configure#nbi-hostpath
        - https://charmhub.io/osm-nbi/configure#common-hostpath
    default: false
  nbi-hostpath:
    type: string
    description: |
      Set this config to the local path of the NBI module to persist the changes done during the
      debug-mode session.

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

      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 nbi common-hostpath=/home/ubuntu/common

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