Resources¶
The ThreatConnect ™ TcEx Framework provides access to the ThreatConnect API using the tcex_resources
module. The Resource Classes can be accessed directly via the tcex.resources
property of the TcEx Framework or indirectly vi the tcex.resource()
method.
Direct Access
Important
The Direct Access method is not supported on Custom Indicator Types.
1 2 3 4 5 6 7 8 9 | tcex = TcEx()
resource = tcex.resources.Adversary(tcex)
# paginate over results
for result in resource:
print(result['status'])
print(result['data'])
tcex.exit()
|
Dynamic Access
1 2 3 4 5 6 7 8 9 | tcex = TcEx()
resource = tcex.resource('User Agent')
# paginate over results
for result in resource:
print(result['status'])
print(result['data'])
tcex.exit()
|
Note
For result sets that do not support pagination the resource.request()
method can be called directly.
Custom Metrics Resource¶
The TcEx Resource Module provides Access to the customMetric
API endpoint to create configurations and add data.
Important
Available in 5.4+ version of the ThreatConnect API.
Resource Type | Class |
---|---|
Custom Metrics | CustomMetric |
Examples¶
Data Store Resource¶
The TcEx Module provide CRUD (Create, Read, Update, and Delete) operations to the ThreatConnect DataStore. The DataStore provides access to three domains: Local; Organization; and System.
Db Method | Method |
---|---|
Create | create() |
Read | read() |
Update | update() |
Delete | delete() |
Examples¶
Group Resources¶
Resource Type | Class |
---|---|
Group (Base) | Group |
Adversary | Adversary |
Campaign | Campaign |
Document | Document |
Email |
|
Incident | Incident |
Signature | Signature |
Threat | Threat |
Indicator Resources¶
Resource Type | Class |
---|---|
Indicator (Base) | Indicator |
Address | Address |
EmailAddress | EmailAddress |
File | File |
Host | Host |
URL | URL |