client.data_modeling.instances.delete(nodes=("mySpace", "myNode"))
from cognite.client.data_classes.data_modeling import NodeId, EdgeId
client.data_modeling.instances.delete(NodeId('mySpace', 'myNode'), EdgeId('mySpace', 'myEdge'))
from cognite.client.data_classes.data_modeling import NodeId, EdgeId
my_view = client.data_modeling.views.retrieve(('mySpace', 'myView'))
my_nodes = client.data_modeling.instances.list(instance_type='node', sources=my_view, limit=None)
client.data_modeling.instances.delete(nodes=my_nodes.as_ids()){
"items": [
{
"instanceType": "node",
"externalId": "<string>",
"space": "<string>"
}
]
}Required capabilities:
DataModelsAcl:WRITE
Delete nodes and edges in a transaction. Limited to 1000 nodes/edges at a time.
When a node is selected for deletion, all connected incoming and outgoing edges that point to or from it are also deleted. However, please note that the operation might fail if the node has a high number of edge connections. If this is the case, consider deleting the edges connected to the node before deleting the node itself. Nodes and/or edges that do not exist in the graph when the delete request is processed will be ignored. The rationale for this is that the end-state will reflect the desired state regardless of the instance’s previous state. Note that attempting to delete something from a space that does not exist will be considered an invalid request, as the API does not affect spaces themselves, only graph nodes and edges.
client.data_modeling.instances.delete(nodes=("mySpace", "myNode"))
from cognite.client.data_classes.data_modeling import NodeId, EdgeId
client.data_modeling.instances.delete(NodeId('mySpace', 'myNode'), EdgeId('mySpace', 'myEdge'))
from cognite.client.data_classes.data_modeling import NodeId, EdgeId
my_view = client.data_modeling.views.retrieve(('mySpace', 'myView'))
my_nodes = client.data_modeling.instances.list(instance_type='node', sources=my_view, limit=None)
client.data_modeling.instances.delete(nodes=my_nodes.as_ids()){
"items": [
{
"instanceType": "node",
"externalId": "<string>",
"space": "<string>"
}
]
}Access token issued by the CDF project's configured identity provider. Access token must be an OpenID Connect token, and the project must be configured to accept OpenID Connect tokens. Use a header key of 'Authorization' with a value of 'Bearer $accesstoken'. The token can be obtained through any flow supported by the identity provider.
List of types, spaces, and external-ids for nodes and edges to delete.
1 - 1000 elementsShow child attributes
Nodes or edges that were deleted
List of deleted instances
1 - 1000 elementsShow child attributes
Was this page helpful?