Primary State on a Datanode

It is possible to set a Datanode as Primary, if the Instance Type configuration allows it.

When Enforce Primary toggling on Datatree Level is set to a specific level other than None, the Primary toggling will be enforced within that datatree level.

:information_source: Enabling primary toggling on an Instance Type
Information Elements and Entities can all be configured to support Primary Toggling. This is done by configuring the Datanode Instance Type using the Enforce Primary Toggling on Datatree Level setting in the ADMIN portal.

Initial state when a Datanode is created

When a Datanode is created, the initial state of the isPrimary property will always be set to false (if toggling is enabled in the configuration) or NULL (if toggling is disabled in the configuration).

:warning: Primary state CANNOT be set during create or update
It is not possible to set a Datanode as Primary during creation or update of the Datanode. So even though the isPrimary property is provided in the payload, it will be ignored. The only way to set a Datanode to Primary, is to call the dedicated API call.

Datatree Levels

None
When None is configured in the Core Configuration Framework for the specific IE/Entity Instance Type, it is not allowed to set the Datanode Instance Type to Primary.

Parent
When Parent is configured in the Core Configuration Framework for the specific IE/Entity Instance Type, Primary toggling will be enforced within the range of other Datanodes of the same Instance Type that have the same Parent Datanode.

Scope
When Scope is configured in the Core Configuration Framework for the specific IE/Entity Instance Type, Primary toggling will be enforced within the range of other Datanodes of the same Instance Type that have the same Scope Datanode.

Root
When Root is configured in the Core Configuration Framework for the specific IE/Entity Instance Type, Primary toggling will be enforced within the range of other Datanodes of the same Instance Type that have the same Root Datanode.

See Data Hierarchy for more information.

Marking a Datanode as Primary

Setting a Datanode as the Primary Datanode of that Instance Type within the configured Datatree Level can be done by using the SetAsPrimary API call. If another Datanode of the same Instance Type within the same Datatree Level, that have already been set to Primary, is present, the system will update this Datanode as well, switching it back to isPrimary=false. This means that other Datanodes than the one being marked as Primary can be altered during the SetAsPrimary API call.

:warning: Check the Instance Type Configuration
Be aware that trying to set a Datanode as Primary using the API call will fail with a bad request, if the Instance Type Configuration is not allowing Primary Toggling.