tcex.tcex_args module

TcEx Framework

class tcex.tcex_args.TcExArgs(tcex)[source]

Bases: object

Module for handling args passed to App from CLI, SecureParams, and AOT

_load_secure_params()[source]

Load secure params from the API.

# API Response:

1
2
3
4
5
6
7
8
{
    "inputs":
        {
            "tc_playbook_db_type": "Redis",
            "fail_on_error": true,
            "api_default_org": "TCI"
        }
}
Returns:Parameters (“inputs”) from the TC API.
Return type:dict
_results_tc_args()[source]

Read data from results_tc file from previous run of app.

This method is only required when not running from the with the TcEX platform and is only intended for testing apps locally.

Returns:A dictionary of values written to results_tc.
Return type:(dictionary)
_unknown_args(args)[source]

Log argparser unknown arguments.

Parameters:args (list) – List of unknown arguments
args()[source]

Parse args if they have not already been parsed and return the Namespace for args.

Note

Accessing args should only be done directly in the App.

Returns:ArgParser parsed arguments.
Return type:(namespace)
default_args

Parse args and return default args.

inject_params(params)[source]

Inject params into sys.argv from secureParams API, AOT, or user provided.

Parameters:params (dict) – A dictionary containing all parameters that need to be injected as args.
resolved_args()[source]

Parse args if they have not already been parsed and return the Namespace for args.

Note

Accessing args should only be done directly in the App.

Returns:ArgParser parsed arguments with Playbook variables automatically resolved.
Return type:(namespace)
tc_bool_args

A list of default ThreatConnect Args that are booleans.

tc_reserved_args

A list of all ThreatConnect reserved arg values.