@@ -274,6 +274,7 @@ def __init__(self, opencti):
274274 """
275275
276276 def list (self , ** kwargs ):
277+ element_id = kwargs .get ("elementId" , None )
277278 from_id = kwargs .get ("fromId" , None )
278279 from_types = kwargs .get ("fromTypes" , None )
279280 to_id = kwargs .get ("toId" , None )
@@ -305,8 +306,8 @@ def list(self, **kwargs):
305306 )
306307 query = (
307308 """
308- query StixCoreRelationships($fromId: String, $fromTypes: [String], $toId: String, $toTypes: [String], $relationship_type: String, $startTimeStart: DateTime, $startTimeStop: DateTime, $stopTimeStart: DateTime, $stopTimeStop: DateTime, $filters: [StixCoreRelationshipsFiltering], $first: Int, $after: ID, $orderBy: StixCoreRelationshipsOrdering, $orderMode: OrderingMode) {
309- stixCoreRelationships(fromId: $fromId, fromTypes: $fromTypes, toId: $toId, toTypes: $toTypes, relationship_type: $relationship_type, startTimeStart: $startTimeStart, startTimeStop: $startTimeStop, stopTimeStart: $stopTimeStart, stopTimeStop: $stopTimeStop, filters: $filters, first: $first, after: $after, orderBy: $orderBy, orderMode: $orderMode) {
309+ query StixCoreRelationships($elementId: String, $ fromId: String, $fromTypes: [String], $toId: String, $toTypes: [String], $relationship_type: String, $startTimeStart: DateTime, $startTimeStop: DateTime, $stopTimeStart: DateTime, $stopTimeStop: DateTime, $filters: [StixCoreRelationshipsFiltering], $first: Int, $after: ID, $orderBy: StixCoreRelationshipsOrdering, $orderMode: OrderingMode) {
310+ stixCoreRelationships(elementId: $elementId, fromId: $fromId, fromTypes: $fromTypes, toId: $toId, toTypes: $toTypes, relationship_type: $relationship_type, startTimeStart: $startTimeStart, startTimeStop: $startTimeStop, stopTimeStart: $stopTimeStart, stopTimeStop: $stopTimeStop, filters: $filters, first: $first, after: $after, orderBy: $orderBy, orderMode: $orderMode) {
310311 edges {
311312 node {
312313 """
@@ -328,6 +329,7 @@ def list(self, **kwargs):
328329 result = self .opencti .query (
329330 query ,
330331 {
332+ "element_id" : element_id ,
331333 "fromId" : from_id ,
332334 "fromTypes" : from_types ,
333335 "toId" : to_id ,
@@ -352,6 +354,7 @@ def list(self, **kwargs):
352354 Read a stix_core_relationship object
353355
354356 :param id: the id of the stix_core_relationship
357+ :param elementId: the id of the entity of the relation
355358 :param fromId: the id of the source entity of the relation
356359 :param toId: the id of the target entity of the relation
357360 :param relationship_type: the relation type
@@ -364,6 +367,7 @@ def list(self, **kwargs):
364367
365368 def read (self , ** kwargs ):
366369 id = kwargs .get ("id" , None )
370+ element_id = kwargs .get ("elementId" , None )
367371 from_id = kwargs .get ("fromId" , None )
368372 to_id = kwargs .get ("toId" , None )
369373 relationship_type = kwargs .get ("relationship_type" , None )
@@ -395,6 +399,7 @@ def read(self, **kwargs):
395399 )
396400 elif from_id is not None and to_id is not None :
397401 result = self .list (
402+ elementId = element_id ,
398403 fromId = from_id ,
399404 toId = to_id ,
400405 relationship_type = relationship_type ,
0 commit comments