Updates one or more sequences. Fields outside of the request remain unchanged.
Patch definition
required | Array of Select by Id (object) or Select by ExternalId (object) (SequencesUpdate) [ 1 .. 1000 ] items |
Response with the updated sequences.
res = client.sequences.retrieve(id=1) res.description = "New description" res = client.sequences.update(res) from cognite.client.data_classes import SequenceUpdate my_update = SequenceUpdate(id=1).description.set("New description").metadata.add({"key": "value"}) res = client.sequences.update(my_update) from cognite.client.data_classes import SequenceUpdate, SequenceColumn my_update = SequenceUpdate(id=1).columns.add(SequenceColumn(value_type ="String",external_id="user", description ="some description")) res = client.sequences.update(my_update) from cognite.client.data_classes import SequenceUpdate, SequenceColumn column_def = [ SequenceColumn(value_type ="String",external_id="user", description ="some description"), SequenceColumn(value_type="Double", external_id="amount")] my_update = SequenceUpdate(id=1).columns.add(column_def) res = client.sequences.update(my_update) from cognite.client.data_classes import SequenceUpdate my_update = SequenceUpdate(id=1).columns.remove("col_external_id1") res = client.sequences.update(my_update) from cognite.client.data_classes import SequenceUpdate my_update = SequenceUpdate(id=1).columns.remove(["col_external_id1","col_external_id2"]) res = client.sequences.update(my_update) from cognite.client.data_classes import SequenceUpdate, SequenceColumnUpdate column_updates = [ SequenceColumnUpdate(external_id="col_external_id_1").external_id.set("new_col_external_id"), SequenceColumnUpdate(external_id="col_external_id_2").description.set("my new description"), ] my_update = SequenceUpdate(id=1).columns.modify(column_updates) res = client.sequences.update(my_update)
{- "items": [
- {
- "id": 1,
- "name": "Any relevant name",
- "description": "Optional description",
- "assetId": 1221123111,
- "externalId": "my.known.id",
- "metadata": {
- "extracted-by": "cognite"
}, - "columns": [
- {
- "name": "depth",
- "externalId": "DPS1",
- "description": "Optional description",
- "valueType": "STRING",
- "metadata": {
- "extracted-by": "cognite"
}, - "createdTime": 100000000000,
- "lastUpdatedTime": 100000000000
}
], - "createdTime": 100000000000,
- "lastUpdatedTime": 100000000000,
- "dataSetId": 2718281828459
}
]
}