Skip to content

Commit

Permalink
Merge ff16c07 into 81fafaf
Browse files Browse the repository at this point in the history
  • Loading branch information
yaakovpraisler committed Feb 7, 2024
2 parents 81fafaf + ff16c07 commit 91ea097
Show file tree
Hide file tree
Showing 14 changed files with 1,910 additions and 13 deletions.
4 changes: 4 additions & 0 deletions .changelog/3992.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
changes:
- description: Added the **graph get-dependencies** command.
type: feature
pr_number: 3992
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ references:
neo4j_conf_file="/etc/neo4j/neo4j.conf"
sudo echo "dbms.security.procedures.unrestricted=apoc.*" >> $neo4j_conf_file
sudo echo "dbms.security.procedures.allowlist=apoc.*" >> $neo4j_conf_file
sudo echo "dbms.memory.transaction.total.max=600m" >> $neo4j_conf_file
sudo echo "dbms.memory.transaction.total.max=2000m" >> $neo4j_conf_file
apoc_conf_file="/etc/neo4j/apoc.conf"
sudo echo "apoc.export.file.enabled=true" > $apoc_conf_file
Expand Down
4 changes: 4 additions & 0 deletions demisto_sdk/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
parse_marketplace_kwargs,
)
from demisto_sdk.commands.content_graph.commands.create import create
from demisto_sdk.commands.content_graph.commands.get_dependencies import (
get_dependencies,
)
from demisto_sdk.commands.content_graph.commands.get_relationships import (
get_relationships,
)
Expand Down Expand Up @@ -3699,6 +3702,7 @@ def pre_commit(
graph_cmd_group.command("create", no_args_is_help=False)(create)
graph_cmd_group.command("update", no_args_is_help=False)(update)
graph_cmd_group.command("get-relationships", no_args_is_help=True)(get_relationships)
graph_cmd_group.command("get-dependencies", no_args_is_help=True)(get_dependencies)
main.add_command(typer.main.get_command(graph_cmd_group), "graph")


Expand Down
74 changes: 74 additions & 0 deletions demisto_sdk/commands/content_graph/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,77 @@ demisto-sdk graph get-relationships Packs/SplunkPy/Integrations/SplunkPy/SplunkP
```
demisto-sdk graph get-relationships Packs/Jira -d 5 --relationship depends_on --mandatory-only --direction targets
```

### get-dependencies
Returns dependencies of a given content pack.

#### Arguments
* **pack**

The ID of the pack to check dependencies for. [required]

* **-sr, --show-reasons**

This flag prints all of the relationships between the given content pack and its dependencies. The default is not to print these relationships.

* **-d, --dependency**

A specific dependency pack ID to get the data for.

* **-mp, --marketplace**

The marketplace to generate the graph for. The default value is xsoar. Other options are marketplacev2, xpanse, xsoar_saas, xsoar_on_prem.

* **-m, --mandatory-only**

If provided, returns only mandatory dependencies in the result.

* **-ald, --all-level-dependencies**

If provided, will retrieve all level of dependencies.

* **--include-test-dependencies**

If provided, includes test dependencies in result.

* **--include-hidden**

If provided, includes hidden packs dependencies in result.

* **-dir, --direction**

Specifies whether to return only sources, only targets or both sides of dependencies [Default is only targets].

* **-nu, --no-update-graph**

If provided, does not run an update on the graph before querying. If you do not include this argument, the update is run.

* **-o, --output**

A path to a directory in which to dump the outputs to.

* **-clt, --console_log_threshold**

Minimum logging threshold for the console logger.

* **-flt, --file_log_threshold**

Minimum logging threshold for the file logger.

* **-lp, --log_file_path**

Path to store all levels of logs.

#### Examples
```
demisto-sdk graph get-dependencies SplunkPy -sr
```
```
demisto-sdk graph get-dependencies Campaign -sr --include-test-dependencies --include-hidden -ald -m
```
```
demisto-sdk graph get-dependencies Campaign -sr -ald -m -dir both
```
```
demisto-sdk graph get-dependencies Campaign -sr -dir both -d Phishing
```

0 comments on commit 91ea097

Please sign in to comment.