33import json
44
55
6- class XOpenCTIIncident :
6+ class Incident :
77 def __init__ (self , opencti ):
88 self .opencti = opencti
99 self .properties = """
@@ -127,8 +127,8 @@ def list(self, **kwargs):
127127 )
128128 query = (
129129 """
130- query XOpenCTIIncidents ($filters: [XOpenCTIIncidentsFiltering ], $search: String, $first: Int, $after: ID, $orderBy: XOpenCTIIncidentsOrdering , $orderMode: OrderingMode) {
131- xOpenCTIIncidents (filters: $filters, search: $search, first: $first, after: $after, orderBy: $orderBy, orderMode: $orderMode) {
130+ query Incidents ($filters: [IncidentsFiltering ], $search: String, $first: Int, $after: ID, $orderBy: IncidentsOrdering , $orderMode: OrderingMode) {
131+ incidents (filters: $filters, search: $search, first: $first, after: $after, orderBy: $orderBy, orderMode: $orderMode) {
132132 edges {
133133 node {
134134 """
@@ -159,7 +159,7 @@ def list(self, **kwargs):
159159 },
160160 )
161161 return self .opencti .process_multiple (
162- result ["data" ]["xOpenCTIIncidents " ], with_pagination
162+ result ["data" ]["incidents " ], with_pagination
163163 )
164164
165165 """
@@ -178,8 +178,8 @@ def read(self, **kwargs):
178178 self .opencti .log ("info" , "Reading Incident {" + id + "}." )
179179 query = (
180180 """
181- query XOpenCTIIncident ($id: String!) {
182- xOpenCTIIncident (id: $id) {
181+ query Incident ($id: String!) {
182+ incident (id: $id) {
183183 """
184184 + (
185185 custom_attributes
@@ -192,9 +192,7 @@ def read(self, **kwargs):
192192 """
193193 )
194194 result = self .opencti .query (query , {"id" : id })
195- return self .opencti .process_multiple_fields (
196- result ["data" ]["xOpenCTIIncident" ]
197- )
195+ return self .opencti .process_multiple_fields (result ["data" ]["incident" ])
198196 elif filters is not None :
199197 result = self .list (filters = filters )
200198 if len (result ) > 0 :
@@ -236,8 +234,8 @@ def create(self, **kwargs):
236234 if name is not None and description is not None :
237235 self .opencti .log ("info" , "Creating Incident {" + name + "}." )
238236 query = """
239- mutation XOpenCTIIncidentAdd ($input: XOpenCTIIncidentAddInput ) {
240- xOpenCTIIncidentAdd (input: $input) {
237+ mutation IncidentAdd ($input: IncidentAddInput ) {
238+ incidentAdd (input: $input) {
241239 id
242240 standard_id
243241 entity_type
@@ -269,9 +267,7 @@ def create(self, **kwargs):
269267 }
270268 },
271269 )
272- return self .opencti .process_multiple_fields (
273- result ["data" ]["xOpenCTIIncidentAdd" ]
274- )
270+ return self .opencti .process_multiple_fields (result ["data" ]["incidentAdd" ])
275271 else :
276272 self .opencti .log ("error" , "Missing parameters: name and description" )
277273
0 commit comments