Skip to content
Marcin Przepiorowski edited this page Feb 5, 2019 · 7 revisions

Overview

Dxtoolkit for masking is a command line script to manipulate Delphix Masking Engine and it is delivered by Delphix professional services team. Dxmc script is a single command with parameters and arguments delivered as executable file with libraries. Dxm is written in Python, but no knowledge of Python is required unless you want to extend it. In fact, no programming experience whatsoever is required to use the Dxtoolkit for masking.

Working with Dxm

Arguments

Dxm is a single executable and argument and options ones to control different regions of Delphix Masking Engine. First argument after command name is a "group". The following groups are supported now:

  • algorithms Algorithm group allow to control Algorithm
  • application Application group allow to control...
  • column Column group allow to control inventory
  • connector Connector group allow to control environments
  • engine engine is a group of command to add, delete...
  • environment Environment group allow to control...
  • fileformat Filetype group allow to control file types
  • job Job group allow to control job
  • meta Algorithm group allow to control Algorithm
  • ruleset Ruleset group allow to control rulesets
  • sync Sync group allow to export / import objects

List of groups can be display using help option without any group name.

dxmc --help
Usage: dxmc [OPTIONS] COMMAND [ARGS]...

  dxmc is a Delphix Masking Toolkit command line interface This command can
  be used to run all applications

  If option --engine is not specified, dxm will run all actions against
  masking engines configured with default option set to Y.

  To run command on all engines configured for this toolkit use all as a
  engine_name

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  algorithms   Algorithm group allow to control Algorithm
  application  Application group allow to control...
  column       Column group allow to control inventory
  connector    Connector group allow to control environments
  engine       engine is a group of command to add, delete...
  environment  Environment group allow to control...
  fileformat   Filetype group allow to control file types
  job          Job group allow to control job
  meta         Algorithm group allow to control Algorithm
  ruleset      Ruleset group allow to control rulesets

Second argument is a action and list of actions depend on group. Ones can access a list of actions by running command with group name and help option, ex: list of actions for connector group

dxmc connector --help
Usage: dxmc connector [OPTIONS] COMMAND [ARGS]...

  Connector group allow to control environments

Options:
  --format [fixed|csv|json]  Output format
  --engine TEXT              Engine name
  --debug                    Enables debug mode.
  --logfile TEXT             Logfile path and name
  --help                     Show this message and exit.

Commands:
  add         Add connector to Masking Engine.
  delete      Delete command will remove connector from...
  fetch_meta  Fetch_meta command will display a list of...
  list        List connectors configured inside Masking...
  test        Test command will test connector on Masking...

Options

Each actions have a different set of options and some of them can be mandatory for run an action. Ones can access a list of options for particular action using help options. Ex. list of options for adding a connector.

dxmc connector add --help
Usage: dxmc connector add [OPTIONS]

  Add connector to Masking Engine. List of required parameters depend on
  connector type:

      - database connectors:
          connectorname,
          envname,
          connectortype,
          host,
          port,
          username,
          schemaname,
      - database depended options:
          sid,
          instancename,
          databasename

      - file connectors:
          connectorname,
          envname,
          connectortype,
          host,
          username,
          path,
          servertype

  Exit code will be set to 0 if environment was added and to non-zero value
  if there was an error

Options:
  --connectorname TEXT            Connector name to add  [required]
  --envname TEXT                  Environment name where connector will be
                                  added  [required]
  --connectortype [oracle|sybase|mssql|delimited|excel|fixed_width|xml]
                                  Type of the connector  [required]
  --host TEXT                     Host where connector will be pointed
                                  [required]
  --port INTEGER                  Port used by database connector  [required]
  --username TEXT                 Username (login) of database (for database
                                  connectors)or host user (for file
                                  connectors)  [required]
  --schemaname TEXT               Schema name used for ruleset for database
                                  connectors  [required]
  --password TEXT                 Connector password for specified user. If
                                  you want to hide input dont specify this
                                  parameter and you will be propted
  --sid TEXT                      Oracle SID of database for Oracle connector
                                  type
  --instancename TEXT             MSSQL instance name for MSSQL connector type
  --databasename TEXT             Database name for MSSQL or SYBASE connector
                                  type
  --path TEXT                     Path of files for FILE connector type
  --servertype [sftp|ftp]         Server type for FILE connector type
  --format [fixed|csv|json]       Output format
  --engine TEXT                   Engine name
  --debug                         Enables debug mode.
  --logfile TEXT                  Logfile path and name
  --help                          Show this message and exit.

Configuration

Dxm keep a configuration using SQLLite database and it's creating a configuration file (dxmtoolkit.db) when a first engine is added. When Dxm is started it will execute an action against Masking engine specified in option (--engine) or against engine configured as default one. By default a session key is keep inside SQLLite database and it's used for all executions. If session is expired or forced to logout, a new session will be automatically created.

Configure a masking engine using the following steps:

  • add engine and set it as default
dxmc engine engine add --engine testeng --ip testeng.foo.com --username delphix_admin --default Y
Password:
Repeat for confirmation:
Engine added to configuration
  • list all engines from configuration
dxmc engine list

Engine name                     IP                              username                        protocol  port   default
==============================  ==============================  ==============================  ========  =====  =======
testeng                         testeng.foo.com                 delphix_admin                   http      8282   Y       

  • update an existing engine, ex. set as non-default
dxmc engine update --engine testeng --default N
Configuration for engine testeng updated in database
  • update an existing engine, ex. change password. If password is provided it will be set without prompting. If empty string is provided '', dxmc will prompt for a new password
dxmc engine update --engine testeng --password newpassword
Configuration for engine testeng updated in database

dxmc engine update --engine testeng --password ''
Please enter a password:
Repeat for confirmation:
Configuration for engine testeng updated in database
  • logout dxmc session
dxmc engine logout --engine testeng

Connecting to Delphix Masking engines

DXM can run an operation on one or all engines configured in configuration database:

  • no engine parameter Run command for Delphix Masking Engine marked as default in configuration database
  • --engine name Run command for one Delphix Masking Engine specified by name
  • --engine all Run command for all Delphix Masking Engines defined in configuration database

Working with an environment

DXM is supporting the following actions on the environment object:

  • adding a new environment
dxmc environment add --envname "Production App" --appname "test app 2"
Environment Production App added
  • deleting an existing environment
dxmc environment delete --envname "Production App"
Environment Production App deleted
  • listing environments
dxmc environment list

Engine name                     Environment name                Application name
==============================  ==============================  ==============================
testeng                         env test 1                      test app 2

Working with a connector

DXM is supporting the following actions on the connector object:

  • adding a new connector
dxmc connector add --connectorname Ora121conn --envname "env test 1" --connectortype oracle --host 172.16.180.129 --port 1521 --schemaname scott --username scott --sid test121
Password:
Repeat for confirmation:
Connector Ora121conn added
  • testing a connector
dxmc connector test --connectorname Ora121conn
Connector test Ora121conn succeeded
  • fetching a list of tables from connector
dxmc connector fetch_meta --connectorname Ora121conn

Engine name                     Connector name                  Table name
==============================  ==============================  ========================================
testeng                         Ora121conn                      BONUS
testeng                         Ora121conn                      DEPT
testeng                         Ora121conn                      EMP
testeng                         Ora121conn                      SALGRADE
  • deleting an existing connector
dxmc connector delete --connectorname Ora121conn
Connector Ora121conn deleted
  • listing environments
dxmc connector list

Engine name                     Environment name                Connector name                  Connector type
==============================  ==============================  ==============================  ==============================
testeng                         env test 1                      fc1                             DELIMITED
testeng                         env test 1                      maskingtest                     MSSQL
testeng                         env test 1                      Ora121conn                      ORACLE

Common parameters

  • --version Display version
  • --debug Enable debug mode
  • --help Display help
  • --format Format ( [fixed] | csv | json )

Working with jobs

DXM supports the following actions for jobs:

  • starting a job
dxmc job start --engine dbw-k --envname SQLServer --jobname Cust5a_1tbl1col
Waiting for job Cust5a_1tbl1col to start processing rows
Job Cust5a_1tbl1col is processing rows
Masking job Cust5a_1tbl1col finished.
5000000 rows masked