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:
strThe 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:
strThe ID of your Incydr API Client - api_client_secret:
strThe 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>")
settingsProperty returning an IncydrSettings object that contains the configuration for this client.
sessionProperty 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_historyProperty 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]
actorsProperty returning an ActorsClient for interacting with /v*/actors API endpoints.
Usage: >>> clients.actors.v1.get_page()
agentsProperty 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_rulesProperty 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_logProperty returning an AuditLogClient for interacting with
/v*/audit API endpoints.
Usage:
>>> client.audit_log.v1.get_page()
casesProperty returning a CasesClient for interacting with /v*/cases API endpoints.
Usage:
>>> client.cases.v1.create(name="Test", description="My Description")
customerProperty returning a CustomerClient for interacting with /v*/customer API endpoints.
Usage:
>>> client.customer.v1.get()
departmentsProperty returning a DepartmentsClient for interacting with /v*/departments API endpoints.
Usage:
>>> client.departments.v1.get_page()
devicesProperty returning a DevicesClient for interacting with /v*/devices API endpoints.
Usage:
>>> client.devices.v1.get_page(active=True)
directory_groupsProperty returning a DirectoryGroupsClient for interacting with /v*/directory-groups API endpoints.
Usage:
>>> client.directory_groups.v1.get_page()
file_eventsProperty 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)
sessionsProperty returning a SessionsClient for interacting with /v*/sessions API endpoints.
Usage:
>>> client.items.v1.get_page(has_alerts=True)
trusted_activitiesProperty returning a TrustedActivitiesClient for interacting with
/v*/trusted-activities API endpoints.
Usage:
>>> client.trusted_activities.v2.get_page()
usersProperty returning a UsersClient for interacting with /v*/users API endpoints.
Usage:
>>> client.users.v1.get_page(active=True)
risk_profilesProperty returning a RiskProfilesClient for interacting with
/v*/user_risk_profiles API endpoints.
Usage:
>>> client.risk_profiles.v1.get_risk_profile("23")
watchlistsProperty returning a WatchlistsClient for interacting with /v*/watchlists API endpoints.
Usage:
>>> client.watchlists.v1.get_page()