Conversation
# By Mihir Vala # Via Mihir Vala (6) and GitHub (1) * main: chore: bump version to 0.37.0 and update changelog chore: skipping integration tests for 401 code chore: integration tests refactoring chore: client integration test fix. docs: add comprehensive case management documentation and API mapping chore: updated to use v1beta endpoint chore: refactor integration tests chore: added integration tests chore: fixed unit tests chore: minor improvements and refactoring. chore: lint fixes refactor: improve case management methods, example and tests. chore: linting and formatting chore: added example. added unit tests feat: added case management methods
|
Just a thought. |
|
It's a big design decision, but I was thinking something similar when I was putting this together. The more that gets added, the bigger ChronicleClient is going to get. There are going to be other design decisions made at some point I guess as the project grows, such as can the documentation live in the README Fow now, there will be other implications with helpers, documentation etc. as well Do you want me to put something together and refactor these functions into it to see what it looks like? |
Another approach I see to reduce burden from ChronicleClient is to have SOAR namespace. And SOAR service (namespace) will have all soar methods. below is example: And user can access soar method as : |
|
I agree that this is probably the best appraoch, and avoids having users create a new client. I've refactored this PR into a |
Implement All Integration Management Functions - Pt 1: Integration functions & Helpers
Summary
Part of a larger PR to implement all SOAR integration management capabilities to the SecOps SDK. This PR includes:
New SDK Modules (
src/secops/chronicle/integration/)integrations.pyintegration_instances.pymarketplace_integrations.pyNew Utility Helpers (
src/secops/chronicle/utils/)New helpers added for consistency and deduplication:
format_utils.pyformat_resource_id()— Extracts the final ID segment from a full Chronicle resource path (e.g.projects/.../instances/.../abc123→abc123). Safely passes through plain IDs.parse_json_list()— Accepts either alist[dict]or a JSON string and returns a parsed list. Used for parameter inputs (e.g.--parameters '[{"name":"p1"}]').build_patch_body()— Builds a PATCH request body andupdateMaskquery param from a list of(api_key, mask_key, value)tuples. Auto-generates the update mask from non-None fields, or accepts an explicit override.request_utils.pychronicle_request_bytes()— New helper for endpoints that return raw bytes (used bydownload_integrationanddownload_integration_dependency).New Data Models (
src/secops/chronicle/models.py)Enums:
PythonVersion—V2_7,V3_7,V3_11DiffType—COMMERCIAL,PRODUCTION,STAGINGTargetMode—PRODUCTION,STAGINGIntegrationType—RESPONSE,EXTENSIONIntegrationParamType—BOOLEAN,INT,STRING,PASSWORD,IP,URL,DOMAIN,EMAIL,VALUES_LIST, etc.ActionParamType—STRING,BOOLEAN,WFS_REPOSITORY,USER_REPOSITORY,STAGES_REPOSITORYActionType—PING,CONNECTOR,JOB, etc.ParamType— For connector parametersConnectorParamMode—REQUIRED,OPTIONAL, etc.ConnectorRuleType— Rule types for connector definitionsScheduleType—ONE_TIME,DAILY,WEEKLY,MONTHLY,ADVANCEDDayOfWeek—MONDAYthroughSUNDAYIntegrationParameterType— For integration instance parametersConnectorConnectivityStatus—CONNECTED,DISCONNECTED, etc.TransformerType— Transformer definition typesLogicalOperatorType— Logical operator definition typesDataclasses:
IntegrationParam— Integration-level parameter definitionActionParameter— Action parameter with type and validationConnectorParameter— Connector parameter with mode and rulesConnectorRule— Connector rule definitionIntegrationJobInstanceParameter— Job instance parameterDate,TimeOfDay— Date/time components for schedulingOneTimeScheduleDetails,DailyScheduleDetails,WeeklyScheduleDetails,MonthlyScheduleDetails— Schedule configurationAdvancedConfig— Advanced scheduling (cron-like)JobParameter— Job definition parameterIntegrationInstanceParameter— Integration instance parameterConnectorInstanceParameter— Connector instance parameterTransformerDefinitionParameter— Transformer parameterIntegrationLogicalOperatorParameter— Logical operator parameterCLI Commands (
src/secops/cli/commands/integration/)Added a complete
secops integrationCLI command tree with 21 subcommand modules, all registered viaintegration_client.py:secops integration integrationslist,get,create,delete,download,download-dependency,export-items,get-affected-items,get-agent,get-diff,get-dependencies,get-restricted-agents,transition,update,update-customsecops integration instanceslist,get,create,update,delete,test,get-affected-items,get-defaultsecops integration marketplacelist,get,diff,install,uninstallTests
Unit Tests - SDK Modules (
tests/chronicle/integration/)test_integrations.pytest_integration_instances.pytest_marketplace_integrations.pyUnit Tests - Utility Helpers (
tests/chronicle/utils/)test_format_utils.py-Tests forformat_resource_id,parse_json_list,build_patch_bodytest_request_utils.py- Tests forchronicle_request_bytesand updated request helpersDocumentation Updates
README.mdSDK usage examples for every new module, following the established format:
CLI.mdCLI usage documentation with bash examples for all integration subcommands, including workflow examples for revision-based safe updates.
api_module_mapping.mdChronicleClientUpdatesclient.py- All new integration module functions added asChronicleClientmethods with full docstrings__init__.py- All new functions exported in__all__and publicly importable fromsecops.chronicleAPI Version Support
All integration modules support both v1beta (default) and v1alpha via the
api_versionparameter