user2677744
user2677744

Reputation: 57

How can delete or edit an entity orion context broker

We have an entity alredy created in Orion Context Broker, and we need to add one attribute tag. The structure is something like:

<?xml version="1.0" encoding="UTF-8"?>
<updateContextRequest>
  <contextElementList>
    <contextElement>
      <entityId type="entity_id" isPattern="false">
        <id>entity_id</id>
      </entityId>
      <contextAttributeList>
        <contextAttribute>
          <name>param1_name</name>
          <type>param1_type</type>
          <contextValue>param1_</contextValue>
        </contextAttribute>
        <contextAttribute>
          <name>param2_name</name>
          <type>param2_type</type>
          <contextValue>param2_value</contextValue>
        </contextAttribute>
      </contextAttributeList>
    </contextElement>
  </contextElementList>
  <updateAction>APPEND</updateAction>
</updateContextRequest>

We need to remove the entity and recreate it with new attributes, or you can add an attribute without having to remove it?

How is the procedure to delete and edit it? (edit if it's possible)

Regards, Ismael

Upvotes: 0

Views: 767

Answers (1)

fgalan
fgalan

Reputation: 12312

If you want to change the attributes associated to an entity, you don't need to delete and re-create the entity. The section on Adding and removing attributes with APPEND and DELETE in updateContext in the Orion user manual explains how to dynamically remove and add attributes to existing entities.

Regarding the entity ID and type, they are inmutable fields. They are "intristic" parts of the entity definition, thus changing them equal to destroying the entity and create it again. Entity deletion is described in the user manual at section on Deleting entities.

Finally, current version (Orion 0.18.1) doesn't allow to change the service and/or serivePath to which one entity belong, but probably the API will be evolved in the future to allow that.

Upvotes: 0

Related Questions