Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit 2415854

Browse files
[client-python] Allow deletion of stix core objects (#720)
1 parent 8db3240 commit 2415854

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

pycti/entities/opencti_stix_core_object.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1681,3 +1681,26 @@ def reports(self, **kwargs):
16811681
else:
16821682
self.opencti.app_logger.error("Missing parameters: id")
16831683
return None
1684+
1685+
"""
1686+
Delete a Stix-Core-Object object
1687+
1688+
:param id: the Stix-Core-Object id
1689+
:return void
1690+
"""
1691+
1692+
def delete(self, **kwargs):
1693+
id = kwargs.get("id", None)
1694+
if id is not None:
1695+
self.opencti.app_logger.info("Deleting stix_core_object", {"id": id})
1696+
query = """
1697+
mutation StixCoreObjectEdit($id: ID!) {
1698+
stixCoreObjectEdit(id: $id) {
1699+
delete
1700+
}
1701+
}
1702+
"""
1703+
self.opencti.query(query, {"id": id})
1704+
else:
1705+
self.opencti.app_logger.error("[stix_core_object] Missing parameters: id")
1706+
return None

0 commit comments

Comments
 (0)