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

Orion Convop POST /v1/ContextEntities doesn't create entities with type #684

Closed
anabelengp opened this issue Dec 5, 2014 · 2 comments
Closed
Assignees
Labels

Comments

@anabelengp
Copy link
Member

I tried to use the new convop to create entities passing the id in the body. Example: id=cc type=cc:

(curl '10.95.213.244:10026/v1/contextEntities' -H 'Accept: application/json' -H 'Fiware-Service: SmartValencia' -H 'Fiware-ServicePath: /Electricidad' -H 'Content-Type: application/json;charset=UTF-8' -d@- | python -mjson.tool)<<EOF
{
  "id": "cc",
  "attributes": [
    {
      "metadatas": [],
      "name": "aa",
      "type": "aa",
      "value": "aa"
    }
  ],
  "isPattern": false,
  "type": "cc"
}
EOF

200 OK:

{
    "contextResponses": [
        {
            "attributes": [
                {
                    "name": "aa",
                    "type": "aa",
                    "value": ""
                }
            ],
            "statusCode": {
                "code": "200",
                "reasonPhrase": "OK"
            }
        }
    ],
    "id": "cc",
    "isPattern": "false",
    "type": "cc"
}

Then we try to GET the entity by type:

(curl '10.95.213.244:10026/v1/contextEntities/type/cc/id/cc' -H 'Accept: application/json' -H 'Fiware-Service: SmartValencia' -H 'Fiware-ServicePath: /Electricidad' -H 'Content-Type: application/json;charset=UTF-8' | python -mjson.tool)
{
    "contextElement": {
        "id": "cc",
        "isPattern": "false",
        "type": "cc"
    },
    "statusCode": {
        "code": "404",
        "details": "Entity id: /cc/",
        "reasonPhrase": "No context element found"
    }
}

The entity doesn't seem to exist but, getting all the entities:

(curl '10.95.213.244:10026/v1/contextEntities?details=on&limit=15&offset=0' -H 'Accept: application/json' -H 'Fiware-Service: SmartValencia' -H 'Fiware-ServicePath: /Electricidad' -H 'Content-Type: application/json;charset=UTF-8' | python -mjson.tool)

{
    "contextResponses": [
        {
            "contextElement": {
                "attributes": [
                    {
                        "name": "aa",
                        "type": "aa",
                        "value": "aa"
                    }
                ],
                "id": "cc",
                "isPattern": "false",
                "type": ""
            },
            "statusCode": {
                "code": "200",
                "reasonPhrase": "OK"
            }
        }
    ],
    "errorCode": {
        "code": "200",
        "details": "Count: 1",
        "reasonPhrase": "OK"
    }
}

We can see that the entity has been created but without any type

@kzangeli kzangeli added the bug label Dec 5, 2014
@kzangeli kzangeli added this to the Release 0.18.0 milestone Dec 5, 2014
@kzangeli kzangeli self-assigned this Dec 5, 2014
@kzangeli
Copy link
Member

kzangeli commented Dec 5, 2014

This is clearly a bug (already found and possibly fixed it in the source code).
PR coming soon.

@fgalan
Copy link
Member

fgalan commented Dec 5, 2014

Fixed in PR #685

However, let's wait for @anabelengp to check if new version is ok. Ana, you can close the issue directly if the test is ok or tell Ken or me to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants