Run Commands (Automata Workflows)
Overview
The netapi run command group provides access to automata workflows - multi-vendor orchestration routines for common operational tasks.
Emergency Response
emergency-block
Block an endpoint across ISE, switch, and firewall for immediate threat containment. Uses ANC (Adaptive Network Control) policy by default for proper quarantine handling.
# Dry run - show what would be done
netapi run emergency-block --mac 00:14:D1:B0:50:D4 --dry-run
# Block using ANC policy (default - recommended)
netapi run emergency-block --mac 00:14:D1:B0:50:D4 --anc-policy Quarantine
# Use custom ANC policy
netapi run emergency-block --mac 00:14:D1:B0:50:D4 -a ANC-Malware-Quarantine
# Fall back to group assignment (no ANC)
netapi run emergency-block --mac 00:14:D1:B0:50:D4 --no-anc --group Blacklist
# Full multi-vendor block (ISE + switch + firewall)
netapi run emergency-block --mac 00:14:D1:B0:50:D4 --switch --firewall --ip 10.1.1.100
Options:
| Option | Description | Default |
|---|---|---|
|
MAC address to block (required) |
- |
|
ANC policy name |
Quarantine |
|
Use ANC policy (recommended) |
True |
|
ISE group if not using ANC |
Blacklist |
|
Also block on switch |
False |
|
Also block on firewall |
False |
|
IP address for firewall block |
- |
|
Show what would be done |
False |
emergency-unblock
Remove an endpoint from quarantine. Clears ANC policy by default.
# Dry run
netapi run emergency-unblock --mac 00:14:D1:B0:50:D4 --dry-run
# Clear ANC policy (default - recommended)
netapi run emergency-unblock --mac 00:14:D1:B0:50:D4
# Fall back to group assignment (no ANC clear)
netapi run emergency-unblock --mac 00:14:D1:B0:50:D4 --no-anc --group Profiled
Options:
| Option | Description | Default |
|---|---|---|
|
MAC address to unblock (required) |
- |
|
Clear ANC policy (recommended) |
True |
|
ISE group if not using ANC |
Profiled |
|
Show what would be done |
False |
Health Checks
morning-checks
Daily infrastructure health verification routine.
# Run ISE checks only (default)
netapi run morning-checks
# Include all checks
netapi run morning-checks --ise --switches --firewalls --dns
# Verbose output with details
netapi run morning-checks --verbose
Options:
| Option | Description | Default |
|---|---|---|
|
Include ISE checks |
True |
|
Include switch checks |
False |
|
Include firewall checks |
False |
|
Include DNS/IPAM checks |
False |
|
Show detailed output |
False |
Checks Performed:
-
ISE MnT API connectivity and version
-
ISE active session count
-
ISE ERS API connectivity
-
(Planned) Core switch status
-
(Planned) Firewall status
-
(Planned) DNS/IPAM status
Workflow Architecture
The automata module follows a multi-vendor orchestration pattern:
netapi/automata/
├── __init__.py
└── workflows/
├── __init__.py
├── emergency.py # Incident response workflows
└── health.py # Health check workflows
Extending Workflows
Workflows can be used programmatically:
from netapi.automata.workflows import emergency, health
# Run emergency block with ANC (recommended)
result = emergency.block_endpoint(
mac="00:14:D1:B0:50:D4",
anc_policy="ANC-Malware-Quarantine",
use_anc=True,
dry_run=True
)
# Run emergency block with group assignment (fallback)
result = emergency.block_endpoint(
mac="00:14:D1:B0:50:D4",
use_anc=False,
fallback_group="Blacklist",
dry_run=True
)
# Run health checks
results = health.morning_checks(
include_ise=True,
include_switches=True,
verbose=True
)
print(f"Passed: {results.total_passed}, Failed: {results.total_failed}")