xsoar-cli 2.3.0__tar.gz → 2.4.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/CHANGELOG.md +29 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/PKG-INFO +1 -1
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/_version.py +2 -2
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/pyproject.toml +4 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/case/README.md +47 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/case/commands.py +106 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/content/README.md +36 -8
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/content/commands.py +69 -16
- xsoar_cli-2.4.1/src/xsoar_cli/utilities/content.py +303 -0
- xsoar_cli-2.4.1/src/xsoar_cli/utilities/output.py +262 -0
- xsoar_cli-2.4.1/src/xsoar_cli/xsoar_client/cases.py +78 -0
- xsoar_cli-2.4.1/src/xsoar_cli/xsoar_client/constants.py +8 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/xsoar_client/content.py +82 -6
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/xsoar_client/execution.py +2 -5
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/cli/conftest.py +76 -6
- xsoar_cli-2.4.1/tests/cli/test_case.py +123 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/cli/test_content.py +193 -0
- xsoar_cli-2.4.1/tests/unit/test_case_commands.py +39 -0
- xsoar_cli-2.4.1/tests/unit/test_cases.py +353 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/unit/test_config_file.py +1 -3
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/unit/test_content_domain.py +170 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/unit/test_content_filters.py +252 -31
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/unit/test_content_handlers.py +0 -1
- xsoar_cli-2.4.1/tests/unit/test_output.py +130 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/unit/test_validators.py +3 -4
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/unit/test_version_check.py +0 -1
- xsoar_cli-2.3.0/src/xsoar_cli/utilities/content.py +0 -210
- xsoar_cli-2.3.0/src/xsoar_cli/xsoar_client/cases.py +0 -25
- xsoar_cli-2.3.0/src/xsoar_cli/xsoar_client/constants.py +0 -4
- xsoar_cli-2.3.0/tests/cli/test_case.py +0 -56
- xsoar_cli-2.3.0/tests/unit/test_cases.py +0 -175
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/.github/workflows/main.yml +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/.github/workflows/pull-request-open.yml +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/.github/workflows/release.yml +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/.github/workflows/update-changelog.yml +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/.gitignore +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/CLAUDE.md +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/CONTRIBUTING.md +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/LICENSE.txt +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/README.md +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/__init__.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/cli.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/__init__.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/case/__init__.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/completions/README.md +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/completions/__init__.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/completions/commands.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/config/README.md +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/config/__init__.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/config/commands.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/content/__init__.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/execute/README.md +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/execute/__init__.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/execute/commands.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/graph/README.md +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/graph/__init__.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/graph/commands.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/integration/README.md +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/integration/__init__.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/integration/commands.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/manifest/README.md +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/manifest/__init__.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/manifest/commands.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/pack/README.md +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/pack/__init__.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/pack/commands.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/plugins/README.md +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/plugins/__init__.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/plugins/commands.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/rbac/README.md +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/rbac/__init__.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/commands/rbac/commands.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/configuration.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/error_handling/__init__.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/error_handling/connection.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/error_handling/http.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/log.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/plugins/README.md +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/plugins/__init__.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/plugins/manager.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/utilities/__init__.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/utilities/config_file.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/utilities/download_content_handlers.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/utilities/manifest.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/utilities/validators.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/utilities/version_check.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/xsoar_client/__init__.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/xsoar_client/artifact_providers/__init__.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/xsoar_client/artifact_providers/azure.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/xsoar_client/artifact_providers/base.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/xsoar_client/artifact_providers/s3.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/xsoar_client/client.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/xsoar_client/integrations.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/xsoar_client/packs.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/src/xsoar_cli/xsoar_client/rbac.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/__init__.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/cli/__init__.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/cli/test_base.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/cli/test_completions.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/cli/test_config.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/cli/test_execute.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/cli/test_graph.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/cli/test_manifest.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/cli/test_pack.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/cli/test_plugins.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/conftest.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/fixtures/cases/create.json +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/fixtures/cases/get.json +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/fixtures/content/automation_search.json +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/fixtures/content/playbook_search.json +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/fixtures/content/user_commands.json +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/fixtures/integrations/instances.json +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/fixtures/manifest/manifest_base.json +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/fixtures/manifest/manifest_invalid.json +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/fixtures/manifest/manifest_with_pack_not_on_server.json +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/fixtures/manifest/server_base_response.json +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/fixtures/manifest/server_base_response_missing_one_pack.json +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/fixtures/manifest/server_base_response_with_updates.json +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/fixtures/manifest/server_base_response_with_updates_and_one_extra.json +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/fixtures/packs/installed.json +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/fixtures/packs/installed_expired.json +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/fixtures/rbac/roles.json +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/fixtures/rbac/user_groups.json +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/fixtures/rbac/users.json +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Download/playbook-empty.yml +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_CommonPlaybooks/.pack-ignore +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_CommonPlaybooks/.secrets-ignore +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_CommonPlaybooks/Author_image.png +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_CommonPlaybooks/Playbooks/GenericPlaybook.yml +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_CommonPlaybooks/README.md +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_CommonPlaybooks/pack_metadata.json +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_CommonScripts/.pack-ignore +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_CommonScripts/.secrets-ignore +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_CommonScripts/Author_image.png +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_CommonScripts/README.md +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_CommonScripts/Scripts/GenericScript/GenericScript.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_CommonScripts/Scripts/GenericScript/GenericScript.yml +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_CommonScripts/Scripts/GenericScript/README.md +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_CommonScripts/pack_metadata.json +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_EDR/.pack-ignore +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_EDR/.secrets-ignore +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_EDR/Author_image.png +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_EDR/Playbooks/EDR_InitialTriage.yml +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_EDR/README.md +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_EDR/Scripts/EDR_FetchFile/EDR_FetchFile.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_EDR/Scripts/EDR_FetchFile/EDR_FetchFile.yml +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_EDR/Scripts/EDR_FetchFile/README.md +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_EDR/Scripts/EDR_Triage/EDR_Triage.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_EDR/Scripts/EDR_Triage/EDR_Triage.yml +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_EDR/Scripts/EDR_Triage/README.md +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_EDR/Scripts/LegacyItem/LegacyItem.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_EDR/Scripts/LegacyItem/LegacyItem.yml +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_EDR/Scripts/LegacyItem/README.md +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_EDR/Scripts/LegacyItem/test_data/basescript-dummy.json +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_EDR/pack_metadata.json +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_Layouts/.pack-ignore +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_Layouts/.secrets-ignore +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_Layouts/Author_image.png +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_Layouts/Layouts/layoutscontainer-GenericLayout.json +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_Layouts/README.md +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/MyOrg_Layouts/pack_metadata.json +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/mock_content/Packs/Not_applicable/Playbooks/Empty.yml +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/unit/__init__.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/unit/conftest.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/unit/test_artifact_azure.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/unit/test_artifact_base.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/unit/test_artifact_s3.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/unit/test_client.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/unit/test_error_handling.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/unit/test_execution.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/unit/test_integrations.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/unit/test_main.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/unit/test_manifest_utils.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/unit/test_packs.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/unit/test_plugin_manager.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/tests/unit/test_rbac.py +0 -0
- {xsoar_cli-2.3.0 → xsoar_cli-2.4.1}/uv.lock +0 -0
|
@@ -6,6 +6,35 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [2.4.0] - 2026-06-17
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- `content get-detached --type all` queries both scripts and playbooks and displays results for each type.
|
|
14
|
+
- `content list --output-format` option (choices: `table`, `json`, `plain`, default: `table`). `table` is human-readable aligned columns, `json` is machine-readable, and `plain` is tab-separated values suitable for piping to tools like `grep`.
|
|
15
|
+
- `content list --search TERM` option. Filters the listed items with a case-insensitive substring match against each item's id, name, and description. Content types and integration brands with no matching items are omitted, and a `No content matching '<term>' found.` message is shown when nothing matches.
|
|
16
|
+
- `content describe --type [script|playbook|command] NAME` command. Shows a single content item in detail: description, arguments, and inputs/outputs. Commands also show the integration brand and its configured instances (name and state). Supports `--output-format [table|json]` (default: `table`). See the [content README](src/xsoar_cli/commands/content/README.md) for details.
|
|
17
|
+
- `case get-context CASENUMBER` command. Retrieves the investigation context tree for a case as JSON, matching `demisto.context()` at runtime. The incident record is not merged in. See the [case README](src/xsoar_cli/commands/case/README.md) for details.
|
|
18
|
+
- `case get-entry ENTRY_ID` command. Retrieves a single War Room entry by its full ID (e.g. `112@153483`) as JSON. The case ID is derived from the entry ID. Exits non-zero with a clear message when the entry ID is malformed or the entry is not found. See the [case README](src/xsoar_cli/commands/case/README.md) for details.
|
|
19
|
+
- `case get-entries CASENUMBER` command. Retrieves all War Room entries for a case as a JSON array, or an empty array when the case has no entries. See the [case README](src/xsoar_cli/commands/case/README.md) for details.
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- `content get-detached` now prints a human-readable summary instead of raw JSON. Output is a count followed by one line per item in the form `<name> (ID: <id>)`, or `No detached <type> found` when there are none.
|
|
24
|
+
- **Breaking:** `content list` now defaults to a human-readable table instead of JSON. Use `--output-format json` for machine-readable output.
|
|
25
|
+
- `content list` playbook output now shows the playbook ID and description (read from the `comment` field) instead of the name and ID.
|
|
26
|
+
- `content list` command output now shows the command name and description and no longer includes the integration brand. The summary-level JSON structure for commands is now a list of `{name, description}` objects instead of plain command-name strings.
|
|
27
|
+
|
|
28
|
+
### Removed
|
|
29
|
+
|
|
30
|
+
- **Breaking:** `content list --detail-level` option, along with its `short`, `extended`, and `full` levels. `content list` now always produces a curated summary. Per-item detail (arguments, inputs, outputs) is available through the `content describe` command.
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
|
|
34
|
+
- `content get-detached` now returns only the content items that are actually detached. The previous query returned all system items, so the command reported every system script (or playbook) as detached instead of just the detached ones. Results are now filtered on each item's `detached` field.
|
|
35
|
+
|
|
36
|
+
## [2.3.0] - 2026-06-04
|
|
37
|
+
|
|
9
38
|
### Added
|
|
10
39
|
|
|
11
40
|
- `execute command NAME [ARGS]...` runs an automation script or integration command against XSOAR, in the user's playground by default or a specific case with `--case-id`. See the [execute README](src/xsoar_cli/commands/execute/README.md) for details.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xsoar-cli
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4.1
|
|
4
4
|
Summary: A command-line interface for managing Palo Alto Networks XSOAR (Cortex XSOAR)
|
|
5
5
|
Project-URL: Documentation, https://github.com/tlium/xsoar-cli#readme
|
|
6
6
|
Project-URL: Issues, https://github.com/tlium/xsoar-cli/issues
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '2.
|
|
22
|
-
__version_tuple__ = version_tuple = (2,
|
|
21
|
+
__version__ = version = '2.4.1'
|
|
22
|
+
__version_tuple__ = version_tuple = (2, 4, 1)
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|
|
@@ -68,6 +68,10 @@ exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"]
|
|
|
68
68
|
[tool.pytest.ini_options]
|
|
69
69
|
testpaths = ["tests"]
|
|
70
70
|
|
|
71
|
+
[tool.ruff]
|
|
72
|
+
line-length = 140
|
|
73
|
+
extend-exclude = ["tests/mock_content"]
|
|
74
|
+
|
|
71
75
|
[dependency-groups]
|
|
72
76
|
dev = [
|
|
73
77
|
"pytest>=9.0.2",
|
|
@@ -17,6 +17,53 @@ xsoar-cli case get 312412
|
|
|
17
17
|
xsoar-cli case get --environment prod 312412
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
+
## Get Context
|
|
21
|
+
|
|
22
|
+
Retrieve the investigation context tree for a single case. Output is the raw context tree as JSON, matching `demisto.context()` at runtime. The incident record is not merged in.
|
|
23
|
+
|
|
24
|
+
**Syntax:** `xsoar-cli case get-context [OPTIONS] CASENUMBER`
|
|
25
|
+
|
|
26
|
+
**Options:**
|
|
27
|
+
- `--environment TEXT` - Target environment (default: uses default environment from config)
|
|
28
|
+
|
|
29
|
+
**Examples:**
|
|
30
|
+
```
|
|
31
|
+
xsoar-cli case get-context 153483
|
|
32
|
+
xsoar-cli case get-context --environment prod 153483
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Get Entry
|
|
36
|
+
|
|
37
|
+
Retrieve a single War Room entry by its full ID. Output is the raw entry as JSON. The command exits non-zero with a clear message when no entry with that ID exists in the case.
|
|
38
|
+
|
|
39
|
+
`ENTRY_ID` is the full entry ID as shown in the GUI, in the form `<n>@<case-id>` (e.g. `112@153483`). The case ID is taken from the entry ID, so it does not need to be supplied separately.
|
|
40
|
+
|
|
41
|
+
**Syntax:** `xsoar-cli case get-entry [OPTIONS] ENTRY_ID`
|
|
42
|
+
|
|
43
|
+
**Options:**
|
|
44
|
+
- `--environment TEXT` - Target environment (default: uses default environment from config)
|
|
45
|
+
|
|
46
|
+
**Examples:**
|
|
47
|
+
```
|
|
48
|
+
xsoar-cli case get-entry 112@153483
|
|
49
|
+
xsoar-cli case get-entry --environment prod 112@153483
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Get Entries
|
|
53
|
+
|
|
54
|
+
Retrieve all War Room entries for a single case. Output is the full list of entries as a JSON array, or an empty array when the case has no entries.
|
|
55
|
+
|
|
56
|
+
**Syntax:** `xsoar-cli case get-entries [OPTIONS] CASENUMBER`
|
|
57
|
+
|
|
58
|
+
**Options:**
|
|
59
|
+
- `--environment TEXT` - Target environment (default: uses default environment from config)
|
|
60
|
+
|
|
61
|
+
**Examples:**
|
|
62
|
+
```
|
|
63
|
+
xsoar-cli case get-entries 153483
|
|
64
|
+
xsoar-cli case get-entries --environment prod 153483
|
|
65
|
+
```
|
|
66
|
+
|
|
20
67
|
## Clone
|
|
21
68
|
|
|
22
69
|
Clone a case from one environment to another. Useful for copying production cases to development environment for testing.
|
|
@@ -25,6 +25,19 @@ def parse_string_to_dict(input_string: str | None, delimiter: str) -> dict:
|
|
|
25
25
|
return {key.strip(): value.strip() for key, value in valid_pairs}
|
|
26
26
|
|
|
27
27
|
|
|
28
|
+
def parse_entry_id(entry_id: str) -> int:
|
|
29
|
+
"""Extract the numeric case ID from a full entry ID of the form '<n>@<case-id>'.
|
|
30
|
+
|
|
31
|
+
Raises ValueError if the entry ID is not in that form.
|
|
32
|
+
"""
|
|
33
|
+
parts = entry_id.split("@")
|
|
34
|
+
expected_parts = 2
|
|
35
|
+
if len(parts) != expected_parts or not parts[0].isdigit() or not parts[1].isdigit():
|
|
36
|
+
msg = f"invalid entry id '{entry_id}', expected the form <n>@<case-id> (e.g. 112@153483)"
|
|
37
|
+
raise ValueError(msg)
|
|
38
|
+
return int(parts[1])
|
|
39
|
+
|
|
40
|
+
|
|
28
41
|
@click.group()
|
|
29
42
|
def case() -> None:
|
|
30
43
|
"""Create, retrieve, and clone cases"""
|
|
@@ -210,6 +223,99 @@ def create( # noqa: PLR0913
|
|
|
210
223
|
click.echo(f"Created XSOAR case {case_id}")
|
|
211
224
|
|
|
212
225
|
|
|
226
|
+
@click.command(name="get-context")
|
|
227
|
+
@click.argument("casenumber", type=int)
|
|
228
|
+
@click.option("--environment", default=None, help="Default environment set in config file.")
|
|
229
|
+
@click.pass_context
|
|
230
|
+
@load_config
|
|
231
|
+
@validate_xsoar_connectivity
|
|
232
|
+
def get_context(ctx: click.Context, casenumber: int, environment: str | None) -> None:
|
|
233
|
+
"""Retrieve the investigation context tree for a single case.
|
|
234
|
+
|
|
235
|
+
CASENUMBER is the numeric case ID to look up. Output is the raw context
|
|
236
|
+
tree as JSON, matching demisto.context() at runtime.
|
|
237
|
+
|
|
238
|
+
Usage examples:
|
|
239
|
+
|
|
240
|
+
xsoar-cli case get-context 153483
|
|
241
|
+
"""
|
|
242
|
+
config = get_xsoar_config(ctx)
|
|
243
|
+
xsoar_client: Client = config.get_client(environment)
|
|
244
|
+
try:
|
|
245
|
+
response = xsoar_client.cases.get_context(casenumber)
|
|
246
|
+
except HTTPError as ex:
|
|
247
|
+
handler = HTTPErrorHandler()
|
|
248
|
+
click.echo(f"Error: {handler.get_message(ex, context='case')}")
|
|
249
|
+
ctx.exit(1)
|
|
250
|
+
click.echo(json.dumps(response, indent=4))
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
@click.command(name="get-entry")
|
|
254
|
+
@click.argument("entry_id", type=str)
|
|
255
|
+
@click.option("--environment", default=None, help="Default environment set in config file.")
|
|
256
|
+
@click.pass_context
|
|
257
|
+
@load_config
|
|
258
|
+
@validate_xsoar_connectivity
|
|
259
|
+
def get_entry(ctx: click.Context, entry_id: str, environment: str | None) -> None:
|
|
260
|
+
"""Retrieve a single War Room entry by its full ID.
|
|
261
|
+
|
|
262
|
+
ENTRY_ID is the full entry ID as shown in the GUI, in the form
|
|
263
|
+
<n>@<case-id> (e.g. 112@153483). The case ID is taken from the entry ID, so
|
|
264
|
+
it does not need to be supplied separately. Output is the raw entry as JSON.
|
|
265
|
+
|
|
266
|
+
Usage examples:
|
|
267
|
+
|
|
268
|
+
xsoar-cli case get-entry 112@153483
|
|
269
|
+
"""
|
|
270
|
+
try:
|
|
271
|
+
casenumber = parse_entry_id(entry_id)
|
|
272
|
+
except ValueError as ex:
|
|
273
|
+
click.echo(f"Error: {ex}")
|
|
274
|
+
ctx.exit(1)
|
|
275
|
+
config = get_xsoar_config(ctx)
|
|
276
|
+
xsoar_client: Client = config.get_client(environment)
|
|
277
|
+
try:
|
|
278
|
+
response = xsoar_client.cases.get_entry(casenumber, entry_id)
|
|
279
|
+
except HTTPError as ex:
|
|
280
|
+
handler = HTTPErrorHandler()
|
|
281
|
+
click.echo(f"Error: {handler.get_message(ex, context='case')}")
|
|
282
|
+
ctx.exit(1)
|
|
283
|
+
except ValueError as ex:
|
|
284
|
+
click.echo(f"Error: {ex}")
|
|
285
|
+
ctx.exit(1)
|
|
286
|
+
click.echo(json.dumps(response, indent=4))
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
@click.command(name="get-entries")
|
|
290
|
+
@click.argument("casenumber", type=int)
|
|
291
|
+
@click.option("--environment", default=None, help="Default environment set in config file.")
|
|
292
|
+
@click.pass_context
|
|
293
|
+
@load_config
|
|
294
|
+
@validate_xsoar_connectivity
|
|
295
|
+
def get_entries(ctx: click.Context, casenumber: int, environment: str | None) -> None:
|
|
296
|
+
"""Retrieve all War Room entries for a single case.
|
|
297
|
+
|
|
298
|
+
CASENUMBER is the numeric case ID. Output is the full list of entries as a
|
|
299
|
+
JSON array, or an empty array when the case has no entries.
|
|
300
|
+
|
|
301
|
+
Usage examples:
|
|
302
|
+
|
|
303
|
+
xsoar-cli case get-entries 153483
|
|
304
|
+
"""
|
|
305
|
+
config = get_xsoar_config(ctx)
|
|
306
|
+
xsoar_client: Client = config.get_client(environment)
|
|
307
|
+
try:
|
|
308
|
+
response = xsoar_client.cases.get_entries(casenumber)
|
|
309
|
+
except HTTPError as ex:
|
|
310
|
+
handler = HTTPErrorHandler()
|
|
311
|
+
click.echo(f"Error: {handler.get_message(ex, context='case')}")
|
|
312
|
+
ctx.exit(1)
|
|
313
|
+
click.echo(json.dumps(response, indent=4))
|
|
314
|
+
|
|
315
|
+
|
|
213
316
|
case.add_command(get)
|
|
214
317
|
case.add_command(clone)
|
|
215
318
|
case.add_command(create)
|
|
319
|
+
case.add_command(get_context)
|
|
320
|
+
case.add_command(get_entry)
|
|
321
|
+
case.add_command(get_entries)
|
|
@@ -4,42 +4,70 @@ Inspect and manage content items on your XSOAR server.
|
|
|
4
4
|
|
|
5
5
|
## Get Detached
|
|
6
6
|
|
|
7
|
-
List detached content items. Detached items are content items that
|
|
7
|
+
List detached content items. Detached items are content items that have been modified on the server and are no longer in sync with the installed content pack.
|
|
8
|
+
|
|
9
|
+
The output is a human-readable summary: a count followed by one line per item in the form `<name> (ID: <id>)`. When no detached items are found, the output is `No detached <type> found` (for example `No detached scripts found`). This applies to both `--type scripts` and `--type playbooks`.
|
|
8
10
|
|
|
9
11
|
**Syntax:** `xsoar-cli content get-detached [OPTIONS]`
|
|
10
12
|
|
|
11
13
|
**Options:**
|
|
12
14
|
- `--environment TEXT` - Target environment (default: uses default environment from config)
|
|
13
|
-
- `--type [scripts|playbooks|all]` - Type of content items to retrieve (
|
|
15
|
+
- `--type [scripts|playbooks|all]` - Type of content items to retrieve (required)
|
|
14
16
|
|
|
15
17
|
**Examples:**
|
|
16
18
|
```
|
|
17
|
-
xsoar-cli content get-detached
|
|
18
|
-
xsoar-cli content get-detached --environment prod
|
|
19
19
|
xsoar-cli content get-detached --type scripts
|
|
20
|
-
xsoar-cli content get-detached --type playbooks
|
|
20
|
+
xsoar-cli content get-detached --type playbooks
|
|
21
|
+
xsoar-cli content get-detached --type all
|
|
22
|
+
xsoar-cli content get-detached --type scripts --environment prod
|
|
21
23
|
```
|
|
22
24
|
|
|
23
25
|
## List
|
|
24
26
|
|
|
25
|
-
List available content items. Enumerates commands, playbooks and scripts available on the server.
|
|
27
|
+
List available content items. Enumerates commands, playbooks and scripts available on the server. Designed for discovery: a quick, scannable overview of what content exists, primarily to help humans and AI agents identify relevant items before working with them.
|
|
28
|
+
|
|
29
|
+
By default the output is a human-readable table. Use `--output-format json` for machine-readable output, or `--output-format plain` for tab-separated values that are easy to pipe to tools like `grep`.
|
|
26
30
|
|
|
27
31
|
**Syntax:** `xsoar-cli content list [OPTIONS]`
|
|
28
32
|
|
|
29
33
|
**Options:**
|
|
30
34
|
- `--environment TEXT` - Target environment (default: uses default environment from config)
|
|
31
35
|
- `--type [scripts|playbooks|commands|all]` - Type of content items to list (default: all)
|
|
32
|
-
- `--
|
|
36
|
+
- `--search TEXT` - Case-insensitive substring filter on item id, name, and description
|
|
37
|
+
- `--output-format [table|json|plain]` - Output format (default: table)
|
|
33
38
|
|
|
34
39
|
**Examples:**
|
|
35
40
|
```
|
|
36
41
|
xsoar-cli content list
|
|
37
42
|
xsoar-cli content list --environment prod
|
|
38
43
|
xsoar-cli content list --type commands
|
|
39
|
-
xsoar-cli content list --type commands --
|
|
44
|
+
xsoar-cli content list --type commands --search slack
|
|
45
|
+
xsoar-cli content list --type commands --output-format json
|
|
46
|
+
xsoar-cli content list --type scripts --output-format plain
|
|
40
47
|
xsoar-cli content list --type playbooks --environment dev
|
|
41
48
|
```
|
|
42
49
|
|
|
50
|
+
## Describe
|
|
51
|
+
|
|
52
|
+
Describe a single content item in detail. Looks up one script, playbook, or command by name and shows its description, arguments, and inputs/outputs. Commands also show the integration brand and its configured instances (name and state). Use this after `content list` to get the detail needed to actually use an item.
|
|
53
|
+
|
|
54
|
+
The lookup is case-insensitive. Scripts match on id, playbooks match on id or name (so a custom playbook with a UUID id resolves by its human-readable name), and commands match on the command name.
|
|
55
|
+
|
|
56
|
+
**Syntax:** `xsoar-cli content describe --type TYPE NAME`
|
|
57
|
+
|
|
58
|
+
**Options:**
|
|
59
|
+
- `--environment TEXT` - Target environment (default: uses default environment from config)
|
|
60
|
+
- `--type [script|playbook|command]` - Type of content item to describe (required)
|
|
61
|
+
- `--output-format [table|json]` - Output format (default: table)
|
|
62
|
+
|
|
63
|
+
**Examples:**
|
|
64
|
+
```
|
|
65
|
+
xsoar-cli content describe --type command servicenow-get-record
|
|
66
|
+
xsoar-cli content describe --type script AddDNBHostIndicatorToCase
|
|
67
|
+
xsoar-cli content describe --type playbook "Phishing Investigation - Generic v2"
|
|
68
|
+
xsoar-cli content describe --type command servicenow-get-record --output-format json
|
|
69
|
+
```
|
|
70
|
+
|
|
43
71
|
## Download
|
|
44
72
|
|
|
45
73
|
Download a content item by name from the XSOAR server.
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import json
|
|
2
1
|
import logging
|
|
3
2
|
import pathlib
|
|
4
3
|
import subprocess
|
|
@@ -7,8 +6,9 @@ from typing import TYPE_CHECKING
|
|
|
7
6
|
import click
|
|
8
7
|
|
|
9
8
|
from xsoar_cli.utilities.config_file import get_xsoar_config, load_config
|
|
10
|
-
from xsoar_cli.utilities.content import
|
|
9
|
+
from xsoar_cli.utilities.content import describe_item, filter_content, format_detached_summary, search_content
|
|
11
10
|
from xsoar_cli.utilities.download_content_handlers import HANDLERS, resolve_output_path
|
|
11
|
+
from xsoar_cli.utilities.output import DESCRIBE_OUTPUT_FORMATS, OUTPUT_FORMATS, format_content_output, format_describe
|
|
12
12
|
from xsoar_cli.utilities.validators import validate_xsoar_connectivity
|
|
13
13
|
|
|
14
14
|
if TYPE_CHECKING:
|
|
@@ -28,7 +28,7 @@ def content() -> None:
|
|
|
28
28
|
@click.option(
|
|
29
29
|
"--type",
|
|
30
30
|
"content_type",
|
|
31
|
-
type=click.Choice(["scripts", "playbooks"], case_sensitive=False),
|
|
31
|
+
type=click.Choice(["scripts", "playbooks", "all"], case_sensitive=False),
|
|
32
32
|
required=True,
|
|
33
33
|
help="Type of content items to retrieve.",
|
|
34
34
|
)
|
|
@@ -39,9 +39,13 @@ def get_detached(ctx: click.Context, environment: str | None, content_type: str)
|
|
|
39
39
|
"""List detached content items."""
|
|
40
40
|
config = get_xsoar_config(ctx)
|
|
41
41
|
xsoar_client: Client = config.get_client(environment)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
|
|
43
|
+
types = ["scripts", "playbooks"] if content_type == "all" else [content_type]
|
|
44
|
+
sections = []
|
|
45
|
+
for t in types:
|
|
46
|
+
items = xsoar_client.content.get_detached(t)
|
|
47
|
+
sections.append(format_detached_summary(items, t))
|
|
48
|
+
click.echo("\n\n".join(sections))
|
|
45
49
|
|
|
46
50
|
|
|
47
51
|
# We name the command in the decorator here to avoid shadowing the builtin list.
|
|
@@ -56,16 +60,21 @@ def get_detached(ctx: click.Context, environment: str | None, content_type: str)
|
|
|
56
60
|
help="Type of content items to list.",
|
|
57
61
|
)
|
|
58
62
|
@click.option(
|
|
59
|
-
"--
|
|
60
|
-
|
|
61
|
-
|
|
63
|
+
"--search",
|
|
64
|
+
default=None,
|
|
65
|
+
help="Case-insensitive substring filter on item id, name, and description.",
|
|
66
|
+
)
|
|
67
|
+
@click.option(
|
|
68
|
+
"--output-format",
|
|
69
|
+
type=click.Choice(OUTPUT_FORMATS, case_sensitive=False),
|
|
70
|
+
default="table",
|
|
62
71
|
show_default=True,
|
|
63
|
-
help="
|
|
72
|
+
help="Output format. Use 'json' for machine-readable output.",
|
|
64
73
|
)
|
|
65
74
|
@click.pass_context
|
|
66
75
|
@load_config
|
|
67
76
|
@validate_xsoar_connectivity
|
|
68
|
-
def list_content(ctx: click.Context, environment: str | None, content_type: str,
|
|
77
|
+
def list_content(ctx: click.Context, environment: str | None, content_type: str, search: str | None, output_format: str) -> None:
|
|
69
78
|
"""
|
|
70
79
|
List available content items. Enumerates commands, playbooks and scripts
|
|
71
80
|
available on the server, primarily to facilitate better AI generated
|
|
@@ -73,16 +82,59 @@ def list_content(ctx: click.Context, environment: str | None, content_type: str,
|
|
|
73
82
|
config = get_xsoar_config(ctx)
|
|
74
83
|
xsoar_client: Client = config.get_client(environment)
|
|
75
84
|
json_blob = xsoar_client.content.list(content_type)
|
|
76
|
-
if detail_level == "full":
|
|
77
|
-
click.echo(json.dumps(json_blob, indent=4))
|
|
78
|
-
ctx.exit(0)
|
|
79
85
|
|
|
80
86
|
# Individual type calls return a bare list, normalize to dict for filter_content.
|
|
81
87
|
if isinstance(json_blob, list):
|
|
82
88
|
json_blob = {content_type: json_blob}
|
|
83
89
|
|
|
84
|
-
filtered = filter_content(json_blob
|
|
85
|
-
|
|
90
|
+
filtered = filter_content(json_blob)
|
|
91
|
+
if search:
|
|
92
|
+
filtered = search_content(filtered, search)
|
|
93
|
+
if not filtered:
|
|
94
|
+
click.echo(f"No content matching '{search}' found.")
|
|
95
|
+
return
|
|
96
|
+
|
|
97
|
+
click.echo(format_content_output(filtered, output_format=output_format))
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
@click.command()
|
|
101
|
+
@click.option("--environment", default=None, help="Default environment set in config file.")
|
|
102
|
+
@click.option(
|
|
103
|
+
"--type",
|
|
104
|
+
"content_type",
|
|
105
|
+
type=click.Choice(["script", "playbook", "command"], case_sensitive=False),
|
|
106
|
+
required=True,
|
|
107
|
+
help="Type of content item to describe.",
|
|
108
|
+
)
|
|
109
|
+
@click.option(
|
|
110
|
+
"--output-format",
|
|
111
|
+
type=click.Choice(DESCRIBE_OUTPUT_FORMATS, case_sensitive=False),
|
|
112
|
+
default="table",
|
|
113
|
+
show_default=True,
|
|
114
|
+
help="Output format. Use 'json' for machine-readable output.",
|
|
115
|
+
)
|
|
116
|
+
@click.argument("name", type=str)
|
|
117
|
+
@click.pass_context
|
|
118
|
+
@load_config
|
|
119
|
+
@validate_xsoar_connectivity
|
|
120
|
+
def describe(ctx: click.Context, environment: str | None, content_type: str, output_format: str, name: str) -> None:
|
|
121
|
+
"""Describe a single content item in detail.
|
|
122
|
+
|
|
123
|
+
Looks up one script, playbook, or command by name and shows its
|
|
124
|
+
description, arguments, and inputs/outputs. Commands also show the
|
|
125
|
+
integration brand and its configured instances. Use this after
|
|
126
|
+
'content list' to get the detail needed to actually use an item.
|
|
127
|
+
"""
|
|
128
|
+
config = get_xsoar_config(ctx)
|
|
129
|
+
xsoar_client: Client = config.get_client(environment)
|
|
130
|
+
raw = xsoar_client.content.describe(content_type, name)
|
|
131
|
+
if raw is None:
|
|
132
|
+
click.echo(f"Error: {content_type} '{name}' not found")
|
|
133
|
+
ctx.exit(1)
|
|
134
|
+
return
|
|
135
|
+
|
|
136
|
+
item = describe_item(content_type, raw)
|
|
137
|
+
click.echo(format_describe(content_type, item, output_format=output_format))
|
|
86
138
|
|
|
87
139
|
|
|
88
140
|
@click.command()
|
|
@@ -175,4 +227,5 @@ def download(ctx: click.Context, environment: str | None, content_type: str, out
|
|
|
175
227
|
|
|
176
228
|
content.add_command(get_detached)
|
|
177
229
|
content.add_command(list_content)
|
|
230
|
+
content.add_command(describe)
|
|
178
231
|
content.add_command(download)
|