superset-service-configuration-file

Description

n/a

Variables

Name Type Default Description

db_name

string --

The db name (or absolute path, in case of sqlite). Required

db_type

string --

The type of db to use. Required

path

string --

The path to the file. Required

db_host_ip

string 127.0.0.1

The db host.

db_password

string --

The db user password.

db_user

string --

The db user name.

group

string --

The group of the file.

mode

string --

The permissions of the file.

owner

string --

The owner of the file.

Code

args:
  db_type:
    doc:
      short_help: The type of db to use.
    type: string
    allowed:
    - sqlite
    - postgresql
    - mariadb
    - mysql
  db_user:
    doc:
      short_help: The db user name.
    type: string
    required: false
  db_password:
    doc:
      short_help: The db user password.
    type: string
    required: false
  db_host_ip:
    doc:
      short_help: The db host.
    type: string
    default: 127.0.0.1
  db_name:
    doc:
      short_help: The db name (or absolute path, in case of sqlite).
    type: string
    required: true
  _import:
  - file-with-content
frecklets:
- file-with-content:
    path: '{{:: path ::}}'
    group: '{{:: group ::}}'
    owner: '{{:: owner ::}}'
    mode: '{{:: mode ::}}'
    content: |-
      {%:: if db_type == "sqlite" ::%}
      SQLALCHEMY_DATABASE_URI = 'sqlite:///{{:: db_name ::}}'
      {%:: elif db_type == "postgresql" ::%}
      SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://{{:: db_user ::}}:{{:: db_password ::}}@{{:: db_host_ip ::}}/{{:: db_name ::}}'
      {%:: elif db_type == "mariadb" or db_type == "mysql" ::%}
      SQLALCHEMY_DATABASE_URI = 'mysql://{{:: db_user ::}}:{{:: db_password ::}}@{{:: db_host_ip ::}}/{{:: db_name ::}}'
      {%:: endif ::%}
frecklecute superset-service-configuration-file --help

Usage: frecklecute superset-service-configuration-file [OPTIONS] PATH

  n/a

Options:
  --db-name DB_NAME          The db name (or absolute path, in case of
                             sqlite).  [required]
  --db-type DB_TYPE          The type of db to use.  [required]
  --db-host-ip DB_HOST_IP    The db host.
  --db-password DB_PASSWORD  The db user password.
  --db-user DB_USER          The db user name.
  --group GROUP              The group of the file.
  --mode MODE                The permissions of the file.
  --owner USER               The owner of the file.
  --help                     Show this message and exit.
# -*- coding: utf-8 -*-


#
# module path: pycklets.superset_service_configuration_file.SupersetServiceConfigurationFile
#


from dataclasses import dataclass
from pyckles import AutoPycklet
from typing import *    # noqa

@dataclass
class SupersetServiceConfigurationFile(AutoPycklet):
    """No documentation available.

       Args:
         db_host_ip: The db host.
         db_name: The db name (or absolute path, in case of sqlite).
         db_password: The db user password.
         db_type: The type of db to use.
         db_user: The db user name.
         group: The group of the file.
         mode: The permissions of the file.
         owner: The owner of the file.
         path: The path to the file.

    """

    FRECKLET_ID = "superset-service-configuration-file"

    db_host_ip: str = None
    db_name: str = None
    db_password: str = None
    db_type: str = None
    db_user: str = None
    group: str = None
    mode: str = None
    owner: str = None
    path: str = None


    def __post_init__(self):
        super(SupersetServiceConfigurationFile, self).__init__(var_names=["db_host_ip", "db_name", "db_password", "db_type", "db_user", "group", "mode", "owner", "path"])


frecklet_class = SupersetServiceConfigurationFile
# -*- coding: utf-8 -*-


#
# module path: pycklets.superset_service_configuration_file.SupersetServiceConfigurationFile
#


from pyckles import AutoPycklet

class SupersetServiceConfigurationFile(AutoPycklet):
    """No documentation available.

       Args:
         db_host_ip: The db host.
         db_name: The db name (or absolute path, in case of sqlite).
         db_password: The db user password.
         db_type: The type of db to use.
         db_user: The db user name.
         group: The group of the file.
         mode: The permissions of the file.
         owner: The owner of the file.
         path: The path to the file.

    """

    FRECKLET_ID = "superset-service-configuration-file"

    def __init__(self, db_host_ip="127.0.0.1", db_name=None, db_password=None, db_type=None, db_user=None, group=None, mode=None, owner=None, path=None):

        super(SupersetServiceConfigurationFile, self).__init__(var_names=["db_host_ip", "db_name", "db_password", "db_type", "db_user", "group", "mode", "owner", "path"])
        self._db_host_ip = db_host_ip
        self._db_name = db_name
        self._db_password = db_password
        self._db_type = db_type
        self._db_user = db_user
        self._group = group
        self._mode = mode
        self._owner = owner
        self._path = path

    @property
    def db_host_ip(self):
        return self._db_host_ip

    @db_host_ip.setter
    def db_host_ip(self, db_host_ip):
        self._db_host_ip = db_host_ip

    @property
    def db_name(self):
        return self._db_name

    @db_name.setter
    def db_name(self, db_name):
        self._db_name = db_name

    @property
    def db_password(self):
        return self._db_password

    @db_password.setter
    def db_password(self, db_password):
        self._db_password = db_password

    @property
    def db_type(self):
        return self._db_type

    @db_type.setter
    def db_type(self, db_type):
        self._db_type = db_type

    @property
    def db_user(self):
        return self._db_user

    @db_user.setter
    def db_user(self, db_user):
        self._db_user = db_user

    @property
    def group(self):
        return self._group

    @group.setter
    def group(self, group):
        self._group = group

    @property
    def mode(self):
        return self._mode

    @mode.setter
    def mode(self, mode):
        self._mode = mode

    @property
    def owner(self):
        return self._owner

    @owner.setter
    def owner(self, owner):
        self._owner = owner

    @property
    def path(self):
        return self._path

    @path.setter
    def path(self, path):
        self._path = path



frecklet_class = SupersetServiceConfigurationFile