Skip to content

Some errors in updates of distributed entities attributes using PATCH methods #1673

@ravaga

Description

@ravaga

I have 2 instances of Orion-LD, and I created 2 CSR in the Broker 1 pointing to Broker 2

{
    "type": "ContextSourceRegistration",
    "id": "urn:aeros:federation:Domain02:infrastructure",
    "information": [
        {
            "entities": [
                {
                    "type": "Domain"
                },
                {
                    "type": "LowLevelOrchestrator"
                },
                {
                    "type": "InfrastructureElement"
                }
            ]
        }
    ],
    "contextSourceInfo": [
        {
            "key": "Authorization",
            "value": "urn:ngsi-ld:request"
        }
    ],
    "mode": "inclusive",
    "operations": [
        "retrieveOps"
    ],
    "hostAlias": "Domain02",
    "management": {
        "localOnly": true
    },
    "endpoint": "192.168.1.25:1026",
    "status": "active",
    "aerosDomain": "Domain02",
    "aerosDomainFederation": true,
    "origin": "cache"
}
{
    "type": "ContextSourceRegistration",
    "id": "urn:aeros:federation:Domain02:services",
    "information": [
        {
            "entities": [
                {
                    "type": "Service"
                },
                {
                    "type": "ServiceComponent"
                },
                {
                    "type": "NetworkPort"
                },
                {
                    "type": "InfrastructureElementRequirements"
                }
            ]
        }
    ],
    "contextSourceInfo": [
        {
            "key": "Authorization",
            "value": "urn:ngsi-ld:request"
        }
    ],
    "mode": "inclusive",
    "operations": [
        "retrieveOps",
        "updateOps",
        "deleteEntity"
    ],
    "hostAlias": "Domain02",
    "management": {
        "localOnly": true
    },
    "endpoint": "192.168.1.25:1026",
    "status": "active",
    "aerosDomain": "Domain02",
    "aerosDomainFederation": true,
    "origin": "cache"
}

According to the defined operations, when I send a HTTP PATCH to /entities/urn:ngsi-ld:Domain:2 or /entities/urn:ngsi-ld:Domain:2/attrs/name to update the name attribute, it shouldn't be updated as only retrieveOps is configured. However, the entity is updated.

Taking a closer look to the logs, it seems that the "urn:aeros:federation:Domain02:services registration, which includes the updateOps operation, is matched.

image

However, if I send a GET /entities?type=Domain, the proper registration is matched

image

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions