You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Release 1.7.6
Bug Fix: Removed the requirement for an admin token to connect
Bug Fix: Added sensor paginated query
Library update: Updated version of lxml library
Copy file name to clipboardexpand all lines: README.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Python bindings for Carbon Black REST API
2
2
3
-
**Latest Version: 1.7.5**
3
+
**Latest Version: 1.7.6**
4
4
5
5
_**Notice**:_
6
6
* The Carbon Black Cloud portion of CBAPI has moved to https://github.com/carbonblack/carbon-black-cloud-sdk-python. Any future development and bug fixes for Carbon Black Cloud APIs will be made there. Carbon Black EDR and App Control will remain supported at CBAPI
Copy file name to clipboardexpand all lines: docs/getting-started.rst
+4-2
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,8 @@ Getting Started
4
4
First, let's make sure that your API authentication tokens have been imported into cbapi. Once that's done, then read
5
5
on for the key concepts that will explain how to interact with Carbon Black APIs via cbapi.
6
6
7
-
Feel free to follow along with this document or watch the `Development Environment Setup video <https://developer.carbonblack.com/guide/enterprise-response/development-environment-video/>`_
7
+
Feel free to follow along with this document or watch the
8
+
`Development Environment Setup video <https://developer.carbonblack.com/guide/enterprise-response/development-environment-video/>`_
8
9
on the Developer Network website.
9
10
10
11
API Authentication
@@ -36,7 +37,8 @@ Alternatively, if you're using Windows (change ``c:\python27`` if Python is inst
36
37
This configuration script will walk you through entering your API credentials and will save them to your current user's
37
38
credential file location, which is located in the ``.carbonblack`` directory in your user's home directory.
38
39
39
-
If using cbapi-psc, you will also be asked to provide an org key. An org key is required to access the Carbon Black Cloud, and can be found in the console under Settings -> API Keys.
40
+
If using cbapi-psc, you will also be asked to provide an org key. An org key is required to access the Carbon Black
41
+
Cloud, and can be found in the console under Settings -> API Keys.
Copy file name to clipboardexpand all lines: docs/livequery-examples.rst
+12-7
Original file line number
Diff line number
Diff line change
@@ -14,14 +14,14 @@ Now that we've imported the necessary libraries, we can perform some queries on
14
14
Create a Query Run
15
15
----------------------------------
16
16
17
-
Let's create a Query Run. First, we specify which profile to use for authentication from our credentials.psc file and create the LiveQuery object.
17
+
Let's create a Query Run. First, we specify which profile to use for authentication from our credentials.psc file and
18
+
create the LiveQuery object.
18
19
19
20
>>> profile ="default'
20
21
>>> cb = CbLiveQueryAPI(profile=profile)
21
22
22
23
Now, we specify the SQL query that we want to run, name of the run, device IDs, and device types.
23
24
24
-
25
25
>>> sql ='select * from logged_in_users;'
26
26
>>> name_of_run ='Selecting all logged in users'
27
27
>>> device_ids ='1234567'
@@ -41,7 +41,8 @@ Finally, we submit the query and print the results.
41
41
42
42
This query should return all logged in Windows endpoints with a ``device_id`` of ``1234567``.
43
43
44
-
The same query can be executed with the example script `manage_run.py <https://github.com/carbonblack/cbapi-python/blob/master/examples/livequery/manage_run.py>`_. ::
44
+
The same query can be executed with the example script
python manage_run.py --profile default create --sql 'select * from logged_in_users;' --name 'Selecting all logged in users' --device_ids '1234567' --device_types 'WINDOWS'
47
48
@@ -50,7 +51,8 @@ Other possible arguments to ``manage_run.py`` include ``--notify`` and ``--polic
50
51
Get Query Run Status
51
52
---------------------
52
53
53
-
Now that we've created a Query Run, let's check the status. If we haven't already authenticated with a credentials profile, we begin by specifying which profile to authenticate with.
54
+
Now that we've created a Query Run, let's check the status. If we haven't already authenticated with a credentials
55
+
profile, we begin by specifying which profile to authenticate with.
54
56
55
57
>>> profile ='default'
56
58
>>> cb = CbLiveQueryAPI(profile=profile)
@@ -61,11 +63,13 @@ Next, we select the run with the unique run ID.
61
63
>>> run = cb.select(Run, run_id)
62
64
>>> print(run)
63
65
64
-
This can also be accomplished with the example script `manage_run.py <https://github.com/carbonblack/cbapi-python/blob/master/examples/livequery/manage_run.py>`_::
66
+
This can also be accomplished with the example script
In addition, you can specify which order you want results returned. To change from the default ascending order, use the flag ``-d`` or ``--descending_results``::
71
+
In addition, you can specify which order you want results returned. To change from the default ascending order, use
@@ -105,6 +109,7 @@ Finally, we print the results.
105
109
... print(result)
106
110
107
111
108
-
You can also retrieve run results with the example script `run_search.py <https://github.com/carbonblack/cbapi-python/blob/master/examples/livequery/run_search.py>`_::
112
+
You can also retrieve run results with the example script
0 commit comments