Update sequences

Updates one or more sequences. Fields outside of the request remain unchanged.

Securityoidc-token or oauth2-client-credentials or oauth2-open-industrial-data or oauth2-auth-code
Request
Request Body schema: application/json
required

Patch definition

required
Array of Select by Id (object) or Select by ExternalId (object) (SequencesUpdate) [ 1 .. 1000 ] items
Responses
200

Response with the updated sequences.

post/sequences/update
Request samples
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)
Response samples
application/json
{
  • "items": [
    • {
      }
    ]
}