Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task/include entity id and type as measures when ngsi payload #807

Merged

Conversation

AlvaroVega
Copy link
Member

@AlvaroVega AlvaroVega commented Jan 30, 2024

Continuation of PR #804

Given a ngsiv2 measure like:

curl -i -X POST 'http://localhost:7897/iot/json?i=test1&k=bryippqcmkxc8ncguqxejibts' -d'{
                "actionType": "append",
                "entities": [
                    {
                        "id": "urn:ngsiv2:Streetlight:Streetlight-Mylightpoint-2",
                        "type": "Streetlight",
                        "name": {
                            "type": "Text",
                            "value": "MyLightPoint-test1"
                        }
                    }
                ]
            }' -H 'content-type: application/json'

id and type from entity ( "id": "urn:ngsiv2:Streetlight:Streetlight-Mylightpoint-2" and "type": "Streetlight",) are progressing as measures to iotagent using prefix ngsiv2_id and ngsiv2_type respectively:

    "measure_id": {
        "type": "string",
        "value": "urn:ngsiv2:Streetlight:Streetlight-Mylightpoint-2"
    },
    "measure_type": {
        "type": "string",
        "value": "Streetlight"
    },

@AlvaroVega AlvaroVega marked this pull request as ready for review January 30, 2024 08:24
Copy link
Member

@mrutid mrutid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mrutid mrutid merged commit d9239e5 into master Jan 30, 2024
7 of 8 checks passed
@mrutid mrutid deleted the task/include_entity_id_and_type_as_measures_when_ngsi_payload branch January 30, 2024 08:38
valuesEntity.push({
name: constants.NGSI + k,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The NGSI constant should be removed from constant.js file, shouldn't it?

@AlvaroVega AlvaroVega restored the task/include_entity_id_and_type_as_measures_when_ngsi_payload branch January 30, 2024 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants