Skip to content

Commit e009618

Browse files
committed
update docs with .env and build
1 parent ccd58e3 commit e009618

1 file changed

Lines changed: 25 additions & 6 deletions

File tree

README.md

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,24 @@ python -m lists.v1alpha.get_list -h
6666
python -m lists.v1alpha.patch_list -h
6767
```
6868

69-
## Using the SDK CLI Wrapper
69+
## Installing the Chronicle REST API SDK
70+
71+
Install the SDK from source
72+
```
73+
python setup.py install
74+
```
75+
76+
Alternatively, install the SDK from source using make
77+
```
78+
make install
79+
```
80+
81+
Build the wheel file
82+
```
83+
make dist
84+
```
85+
86+
## Using the Chronicle REST API SDK
7087

7188
The SDK provides a unified command-line interface for Chronicle APIs. The CLI follows this pattern:
7289
```
@@ -94,7 +111,9 @@ CHRONICLE_INSTANCE=your-instance-id
94111
CHRONICLE_REGION=your-region
95112
```
96113

97-
The SDK will automatically load these values from your `.env` file. Command-line options take precedence over environment variables.
114+
The SDK will use values from the `.env` file provided with the --env-file flag.
115+
(It has trouble finding your local .env due to SDK Path issues, which we are working to resolve.)
116+
Command-line options take precedence over environment variables.
98117

99118
### Command Groups
100119

@@ -165,16 +184,16 @@ Available commands:
165184
Using environment variables (after setting up .env):
166185
```bash
167186
# Get an alert
168-
chronicle detect alerts get --alert-id ABC123
187+
chronicle detect alerts get --alert-id ABC123 --env-file=.env
169188

170189
# Create a list
171-
chronicle lists create --name "blocklist" --description "Blocked IPs" --lines '["1.1.1.1", "2.2.2.2"]'
190+
chronicle lists create --name "blocklist" --description "Blocked IPs" --lines '["1.1.1.1", "2.2.2.2"]' --env-file=.env
172191

173192
# Search for events
174-
chronicle search find-raw-logs --filter "timestamp.seconds > 1600000000"
193+
chronicle search find-raw-logs --filter "timestamp.seconds > 1600000000" --env-file=.env
175194

176195
# Override a specific environment variable
177-
chronicle --region us-central1 detect alerts get --alert-id ABC123
196+
chronicle --region us-central1 detect alerts get --alert-id ABC123 --env-file=.env
178197
```
179198

180199
## Running Individual Scripts

0 commit comments

Comments
 (0)