Client¶
incydr.Client
(url=None, api_client_id=None, api_client_secret=None, skip_auth=False, **settings_kwargs)An HTTP client for interacting with the Code42 Incydr API.
Parameters:
- url:
str
The url of your Incydr API gateway. See the developer getting started guide to find your API domain based on your console login URL. - api_client_id:
str
The ID of your Incydr API Client - api_client_secret:
str
The Secret for your Incydr API Client.
Usage example:
>>> import incydr
>>> client = incydr.Client(url="<api_domain>", api_client_id="<client_id>", api_client_secret="<client_secret>")
settings
Property returning an IncydrSettings
object that contains the configuration for this client.
session
Property returning the core requests.Session
used to make all
HTTP requests.
Contains a hook that prepends the base url of the Code42 API gateway to each request url.
Usage:
>>> response = client.session.get("/v1/users")
>>> response
<Response [200]>
>>> response.url
'https://api.us.code42.com/v1/users'
request_history
Property returning a list of the last n
number of requests.Response
objects received, where n
equals the client.settings.max_response_history
value (default=5).
The most recent request is the first item in the list: client.request_history[0]
actors
Property returning an ActorsClient
for interacting with /v*/actors
API endpoints.
Usage: >>> clients.actors.v1.get_page()
agents
Property returning an AgentsClient
for interacting with
/v*/agents
API endpoints.
Usage:
>>> client.agents.v1.get_page()
alerts
(DEPRECATED) Property returning an AlertsClient
for interacting with
/v*/alerts
API endpoints.
Usage:
>>> client.alerts.v1.get_page()
alert_rules
Property returning a AlertRules
for interacting with /v*/alert-rules
and `/v/alerts/rules API endpoints.
Usage:
>>> client.alert_rules.v1.add_users(rule_id='test', users=['user-id-1', 'user-id-2'])
audit_log
Property returning an AuditLogClient
for interacting with
/v*/audit
API endpoints.
Usage:
>>> client.audit_log.v1.get_page()
cases
Property returning a CasesClient
for interacting with /v*/cases
API endpoints.
Usage:
>>> client.cases.v1.create(name="Test", description="My Description")
customer
Property returning a CustomerClient
for interacting with /v*/customer
API endpoints.
Usage:
>>> client.customer.v1.get()
departments
Property returning a DepartmentsClient
for interacting with /v*/departments
API endpoints.
Usage:
>>> client.departments.v1.get_page()
devices
Property returning a DevicesClient
for interacting with /v*/devices
API endpoints.
Usage:
>>> client.devices.v1.get_page(active=True)
directory_groups
Property returning a DirectoryGroupsClient
for interacting with /v*/directory-groups
API endpoints.
Usage:
>>> client.directory_groups.v1.get_page()
file_events
Property returning a FileEventsClient
for interacting with /v*/file-events
API endpoints.
Usage:
>>> from incydr import EventQuery
>>> query = EventQuery(start_date='P30D').equals('file.category', 'Document')
>>> client.file_events.v2.search(query)
sessions
Property returning a SessionsClient
for interacting with /v*/sessions
API endpoints.
Usage:
>>> client.items.v1.get_page(has_alerts=True)
trusted_activities
Property returning a TrustedActivitiesClient
for interacting with
/v*/trusted-activities
API endpoints.
Usage:
>>> client.trusted_activities.v2.get_page()
users
Property returning a UsersClient
for interacting with /v*/users
API endpoints.
Usage:
>>> client.users.v1.get_page(active=True)
risk_profiles
Property returning a RiskProfilesClient
for interacting with
/v*/user_risk_profiles
API endpoints.
Usage:
>>> client.risk_profiles.v1.get_risk_profile("23")
watchlists
Property returning a WatchlistsClient
for interacting with /v*/watchlists
API endpoints.
Usage:
>>> client.watchlists.v1.get_page()