Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pycti/api/opencti_api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,20 +751,21 @@ def send_bundle_to_api(self, **kwargs):
"""

connector_id = kwargs.get("connector_id", None)
work_id = kwargs.get("work_id", None)
bundle = kwargs.get("bundle", None)

if connector_id is not None and bundle is not None:
self.app_logger.info(
"Pushing a bundle to queue through API", {connector_id}
)
mutation = """
mutation StixBundlePush($connectorId: String!, $bundle: String!) {
stixBundlePush(connectorId: $connectorId, bundle: $bundle)
mutation StixBundlePush($connectorId: String!, $bundle: String!, $work_id: String) {
stixBundlePush(connectorId: $connectorId, bundle: $bundle, work_id: $work_id)
}
"""
return self.query(
mutation,
{"connectorId": connector_id, "bundle": bundle},
{"connectorId": connector_id, "bundle": bundle, "work_id": work_id},
)
else:
self.app_logger.error(
Expand Down
1 change: 1 addition & 0 deletions pycti/api/opencti_api_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def list(self) -> Dict:
}
listen
listen_exchange
listen_callback_uri
push
push_exchange
push_routing
Expand Down
3 changes: 3 additions & 0 deletions pycti/connector/opencti_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def __init__(
auto: bool,
only_contextual: bool,
playbook_compatible: bool,
listen_callback_uri=None,
):
self.id = connector_id
self.name = connector_name
Expand All @@ -56,6 +57,7 @@ def __init__(
self.auto = auto
self.only_contextual = only_contextual
self.playbook_compatible = playbook_compatible
self.listen_callback_uri = listen_callback_uri

def to_input(self) -> dict:
"""connector input to use in API query
Expand All @@ -72,5 +74,6 @@ def to_input(self) -> dict:
"auto": self.auto,
"only_contextual": self.only_contextual,
"playbook_compatible": self.playbook_compatible,
"listen_callback_uri": self.listen_callback_uri,
}
}
Loading