Skip to content

Commit

Permalink
address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
stehessel committed Jun 23, 2024
1 parent c14e84b commit 0550178
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
34 changes: 34 additions & 0 deletions vulnerability-management/export-workloads/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,40 @@ The following sections provide use case examples utilizing either the shell or P

See `export-workloads.sh` for a shell script example based on `curl` and `jq`.

* Export all workloads.
```shell
export-workloads.sh
```
* Export all workloads from the cluster `prod`.
```shell
export-workloads.sh "Cluster%3Aprod"
```
* Export all workloads matching the query `Deployment:app Namespace:default`.
```shell
export-workloads.sh "Deployment%3Aapp%2BNamespace%3Adefault"
```
* Export all workloads with a timeout of 60 seconds.
```shell
export-workloads.sh "" 60
```

## Python script

See `export-workloads.py` for a python script example.

* Export all workloads.
```shell
export-workloads.py
```
* Export all workloads from the cluster `prod`.
```shell
export-workloads.py --query="Cluster%3Aprod"
```
* Export all workloads matching the query `Deployment:app Namespace:default`.
```shell
export-workloads.py --query="Deployment%3Aapp%2BNamespace%3Adefault"
```
* Export all workloads with a timeout of 60 seconds.
```shell
export-workloads.py --timeout=60
```
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# Further processing may be done on the parsed objects.
#
# Requires ROX_ENDPOINT and ROX_API_TOKEN environment variables.
# The API token requires at least analyst access in Central.
# The API token requires read access on images and deployments.

import argparse
import json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
# ]
#
# Requires ROX_ENDPOINT and ROX_API_TOKEN environment variables.
# The API token requires at least analyst access in Central.
# The API token requires read access on images and deployments.

set -euo pipefail

case $1 in
*help)
Expand Down

0 comments on commit 0550178

Please sign in to comment.