from cognite.client.data_classes.data_modeling import DataModelApply
data_models = [
DataModelApply(space="mySpace",external_id="myDataModel",version="v1"),
DataModelApply(space="mySpace",external_id="myOtherDataModel",version="v1")]
res = client.data_modeling.data_models.apply(data_models){
"items": [
{
"space": "<string>",
"externalId": "<string>",
"version": "<string>",
"createdTime": 1730204346000,
"lastUpdatedTime": 1730204346000,
"isGlobal": true,
"name": "<string>",
"description": "<string>",
"views": [
{
"type": "view",
"space": "<string>",
"externalId": "<string>",
"version": "<string>"
}
]
}
]
}Required capabilities:
DataModelsAcl:WRITE
Add or update (upsert) data models. For unchanged data model specifications, the operation completes without making any changes. We will not update the lastUpdatedTime value for models that remain unchanged.
from cognite.client.data_classes.data_modeling import DataModelApply
data_models = [
DataModelApply(space="mySpace",external_id="myDataModel",version="v1"),
DataModelApply(space="mySpace",external_id="myOtherDataModel",version="v1")]
res = client.data_modeling.data_models.apply(data_models){
"items": [
{
"space": "<string>",
"externalId": "<string>",
"version": "<string>",
"createdTime": 1730204346000,
"lastUpdatedTime": 1730204346000,
"isGlobal": true,
"name": "<string>",
"description": "<string>",
"views": [
{
"type": "view",
"space": "<string>",
"externalId": "<string>",
"version": "<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 data models to add
List of data models to create/update
1 - 100 elementsShow child attributes
List of data models
List of data models
Show child attributes
Was this page helpful?