tcex.tcex_argparser module

TcEx Common Arg Handler

class tcex.tcex_argparser.TcExArgParser(**kwargs)[source]

Bases: argparse.ArgumentParser

Overload of the ArgumentParser class.

Adding common arguments for TcEx apps.

_api_arguments()[source]

Argument specific to working with TC API.

--tc_token token
 Token provided by ThreatConnect for app Authorization.
--tc_token_expires token_expires
 Expiration time for the passed Token.
--api_access_id access_id
 Access ID used for HMAC Authorization.
--api_secret_key secret_key
 Secret Key used for HMAC Authorization.
_batch_arguments()[source]

Arguments specific to Batch API writes.

--batch_action action
 Action for the batch job [‘Create’, ‘Delete’].
--batch_chunk number
 The maximum number of indicator per batch job.
--batch_halt_on_error
 Flag to indicate that the batch job should halt on error.
--batch_poll_interval seconds
 Seconds between batch status polls.
--batch_interval_max seconds
 Seconds before app should time out waiting on batch job completion.
--batch_write_type type
 Write type for Indicator attributes [‘Append’, ‘Replace’].
_playbook_arguments()[source]

Argument specific to playbook apps.

These arguments will be passed to every playbook app by default.

--tc_playbook_db_type type
 The DB type (currently on Redis is supported).
--tc_playbook_db_context context
 The playbook context provided by TC.
--tc_playbook_db_path path
 The DB path or server name.
--tc_playbook_db_port port
 The DB port when required.
--tc_playbook_out_variables vars
 The output variable requested by downstream apps.
_standard_arguments()[source]

These are the standard args passed to every TcEx App.

--api_default_org org
 The TC API user default organization.
--tc_api_path path
 The TC API path (e.g https://api.threatconnect.com).
--tc_in_path path
 The app in path.
--tc_log_file filename
 The app log file name.
--tc_log_path path
 The app log path.
--tc_out_path path
 The app out path.
--tc_secure_params bool
 Flag to indicator secure params is supported.
--tc_temp_path path
 The app temp path.
--tc_user_id id
 The user id of user running the job.
--tc_proxy_host host
 The proxy host.
--tc_proxy_port port
 The proxy port.
--tc_proxy_username user
 The proxy username.
--tc_proxy_password pass
 The proxy password.
--tc_proxy_external
 Flag to indicate external communications requires the use of a proxy.
--tc_proxy_tc Flag to indicate TC communications requires the use of a proxy.
--tc_log_to_api
 Flag to indicate that app should log to API.
--tc_log_level The logging level for the app.
--logging level
 Alias for tc_log_level.