Skip to content

Instantly share code, notes, and snippets.

@XavierVal
Created May 22, 2015 10:46
Show Gist options
  • Save XavierVal/48494b646b7463647206 to your computer and use it in GitHub Desktop.
Save XavierVal/48494b646b7463647206 to your computer and use it in GitHub Desktop.
# Valido
´´´
curl -X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "Fiware-Service: serv12" -H "Fiware-ServicePath: /sub12" -d '{
"entities": [
{
"id": "entity_.*",
"isPattern": "true",
"type": "entity_type"
}
]
}' http://192.168.xxx:1026/NGSI10/QueryContext
´´´
´´´
{
"contextResponses": [
{
"contextElement": {
"type": "entity_type",
"isPattern": "false",
"id": "entity_name",
"attributes": [
{
"name": "att_name",
"type": "string",
"value": "value",
"metadatas": [
{
"name": "TimeInstant",
"type": "ISO8601",
"value": "2015-05-22T08:54:29.088736Z"
}
]
},
{
"name": "r",
"type": "string",
"value": "255",
"metadatas": [
{
"name": "TimeInstant",
"type": "ISO8601",
"value": "2015-05-22T08:54:29.088079Z"
}
]
},
{
"name": "TimeInstant",
"type": "ISO8601",
"value": "2015-05-22T08:54:29.088079Z"
}
]
},
"statusCode": {
"code": "200",
"reasonPhrase": "OK"
}
}
]
}
´´´
´´´
curl -X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "Fiware-Service: serv12" -H "Fiware-ServicePath: /sub12" -d '{
"entities": [
{
"id": "entity_t.*",
"isPattern": "true",
"type": "entity_type"
}
]
}' http://192.168.xx.xx:1026/NGSI10/QueryContext
´´´
´´´
{
"errorCode": {
"code": "404",
"reasonPhrase": "No context element found"
}
}
´´´
# INVALIDO inline GET tb
´´´
curl -X GET -H "Content-Type: application/json" -H "Accept: application/json" -H "Fiware-Service: serv12" -H "Fiware-ServicePath: /sub12" -H "Cache-Control: no-cache" -H "Postman-Token: 61ca76c7-8e69-07cb-0268-7ad5062fa3fd" http://192.168.xx.xx:1026/v1/contextEntities/type/entity_name/id/device1
{
"contextElement": {
"type": "entity_name",
"isPattern": "false",
"id": "device1"
},
"statusCode": {
"code": "404",
"reasonPhrase": "No context element found",
"details": "Entity id: /device1/"
}
}
´´´
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment