Map

The rediops map command provides the capability to map data from / to another metadata file to / from the rediOps (devops.json) file. This functionality is beneficial to organisations that already store metadata in existing files and which to use the expanded facilities of rediOps.

The mapping can be a once of activity or ongoing, triggered by updates to the file for example git actions. The trigger is not a functionality of qaskx-cli but could be performed by other tools such as git actions.

A mapping file is required to provide the input for the mapping rules. Only simle mapping from field A ins source file to field B in target file is supported.

The command help is shown below.

Usage: qaskx-cli rediops map (--to | --from | --generate) -a=<alternate file> -m=<map file> [-d=<devops file path>] [-v | --vv | --vvv | --silent] [-c=<conf file>] [--colourCLI] [--offline] [--env=<environment file>]

The rediOps maps command maps the alternate definition to / from the rediOps
definition file.  The function can be used to map existing data sources (YAML).

For more details see the documentation at https://docs.qaskx.one/qaskx-cli/cmd/rediops//map/ .

                    
Options:            
      --to          Map to rediOps file
      --from        Map from rediOps file
      --generate    Generate map configuration file
  -d, --devops      rediOps (devops.json) file path
  -a, --alternate   Alternate file for to/from
  -m, --map         Map configuration file name (env $QASKX_MAPPING_FILE)
  -v, --verbose     Verbose logging
      --vv          Verbose logging level 3
      --vvv         Verbose logging level 5
      --silent      Silent running
      --colourCLI   Colour terminal and command line (env $QASKX_COLOUR_CLI)
  -c, --conf        Configuration file (env $QASKX_CONFIG_FILE)
      --offline     Offline mode (env $QASKX_OFFLINE)
      --env         Environment file to use (default ".env")

Details

The mapping only works for JSON and YAML files. That is the rediOps file is a JSON file but the from file can be a JSON or YAML file.

The mapping is provided by a configuration file provided as an argument. The map configuration file is defined as YAML file and its structure is:

from:
  root_path: ""
  maps:
  - key: '*replace_f*'
    pair: Rediops.Asset.Id

and

to:
  root_path: ""
  maps:
  - key: '*replace_f*'
    pair: Rediops.Asset.Id

Example

qaskx-cli   rediops map --from -a xht.json -m mapping.json -d djkask.json -v
	      ______           ___           _______. __  ___ ___   ___ 
	     /  __  \         /   \         /       ||  |/  / \  \ /  / 
	    |  |  |  |       /  ^  \       |   (----`|  '  /   \  V  /  
	    |  |  |  |      /  /_\  \       \   \    |    <     >   <   
	    |  `--'  '--.  /  _____  \  .----)   |   |  .  \   /  .  \  
	     \_____\_____\/__/     \__\ |_______/    |__|\__\ /__/ \__\ 
																   															 
	
          qaskx-cli  - command line tool 
          version     - 0.0.5
          url         - https://docs.qaskx.one/qaskx-cli/
          copyright   - 2023 qaskx.one, usage license limited

QX>>> 2024/03/24 20:59:46 CreateFile djkask.json: The system cannot find the file specified.
QX>>> 2024/03/24 20:59:46 unable to find rediOps file 'djkask.json'.  Please specify an existing devops.json file location