-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding j1 CLI documentation. #727
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1526,3 +1526,63 @@ immediately reflect that in the graph. | |
We hope to provide a good interface via this SDK for providing an interface for | ||
handling events via this SDK and providing commands/utilities for testing events | ||
to get an understanding of how they may affect the JupiterOne graph. | ||
|
||
## j1 CLI | ||
|
||
In addition to the `j1-integration` CLI, this project exposes a `j1` CLI for | ||
`import` and `export` processes. | ||
|
||
### Authentication | ||
|
||
For commands that require interaction with JupiterOne's API, the CLI will | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For commands that require interaction with JupiterOne's API, the CLI
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I actually copied this from the Authentication of |
||
provide ways of inputing credentials. To support that, all commands that | ||
interact with an API will accept an `--api-key` option. | ||
|
||
For convenience when developing locally, we will also look for a | ||
`JUPITERONE_API_KEY` environment variable for an API key to use. | ||
|
||
### Supported commands | ||
|
||
Currently, the CLI supports a limited interface consisting of only two commands: | ||
`export` and `import`. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might be nice to include the required options? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Required is a bit odd for these, since so many of them either have a default or will use .env values if provided that way. I think the only option truly flagged as a required one is the scope for the import command. I can get that added in a later PR |
||
#### Command `j1 export` | ||
|
||
``` | ||
Usage: j1 export [options] | ||
|
||
Exports account's entities/relationships into csv files | ||
|
||
Options: | ||
-d, --data-dir <relative_directory> The directory where entities/relationships will be downloaded (default: ".j1/export") | ||
--account <account> The JupiterOne account you are exporting entities/relationships from | ||
--api-key <key> The key used to initiate api calls with your instance of JupiterOne | ||
--include-entities Include entities in export (default: true) | ||
--include-relationships Include relationships in export (default: true) | ||
--include-deleted Include deleted entities/relationships in export (default: true) | ||
--no-include-entities Exclude entities in export | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might be nice to change --no-include-entities to --exclude-entities one day |
||
--no-include-relationships Exclude relationships in export | ||
--no-include-deleted Exclude deleted entities/relationships in export | ||
--api-base-url <url> The base URL used to initiate api calls with your instance of JupiterOne (defaults to `https://api.us.jupiterone.io`) | ||
-h, --help display help for command | ||
``` | ||
|
||
#### Command `j1 import` | ||
|
||
``` | ||
Usage: j1 import [options] | ||
|
||
Imports exported account entities/relationships into JupiterOne account | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are there any gotchas that we should make the user aware of? For example, what if a _key already exists? |
||
|
||
Options: | ||
-d --data-dir <relative_directory> The directory where entities and relationships can be found (default: ".j1/export") | ||
--scope <scope> A unique id that identifies the synchronization job that will be importing your assets, use any id of your choosing. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the default for scope? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No default. It will error if one isn't provided. |
||
--account <account> The JupiterOne account you are importing entities/relationships into | ||
--api-key <key> The key used to initiate api calls with your instance of JupiterOne | ||
--include-relationships Include relationships in import (default: true) | ||
--include-deleted Include deleted entities/relationships in import (default: true) | ||
--no-include-entities Exclude entities in import | ||
--no-include-relationships Exclude relationships in import | ||
--api-base-url <url> The base URL used to initiate api calls with your instance of JupiterOne (defaults to `https://api.us.jupiterone.io`) | ||
-h, --help display help for command | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be better to start on line 1490 with the other j1 cli info. Up to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, I went back and forth with putting it higher up starting at line 1490. My main reason for leaving it at the bottom is it felt like it was interrupting the
j1-integration
documentation too much when placed up there.I'll leave it where it is for now, but we can move it if we start to see its location confusing people.