Commit 726dce2f authored by canterafonsj's avatar canterafonsj

Csource Registrations

parent f0a137fe
......@@ -50,68 +50,93 @@
"format": "date-time"
}
}
}
},
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uri"
},
"type": {
"type": "string",
"const": "ContextSourceRegistration"
},
"@context": {
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/LdContext"
},
"information": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/definitions/RegistrationInfo"
}
},
"timestamp": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/definitions/TimeInterval"
"ContextSourceRegistrationFragment": {
"type": "object",
"properties": {
"@context": {
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/LdContext"
},
"information": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/definitions/RegistrationInfo"
}
},
"timestamp": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/definitions/TimeInterval"
}
},
"location": {
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/geometry-schema.json#"
},
"expires": {
"type": "string",
"format": "date-time"
},
"name": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string",
"minLength": 1
},
"endpoint": {
"type": "string",
"format": "uri"
}
},
"additionalProperties": {
"type": [
"string",
"number",
"boolean",
"array",
"object"
]
}
},
"location": {
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/geometry-schema.json#"
},
"expires": {
"type": "string",
"format": "date-time"
},
"name": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string",
"minLength": 1
},
"endpoint": {
"type": "string",
"format": "uri"
},
"createdAt": {
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/createdAt"
},
"modifiedAt": {
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/modifiedAt"
"ContextSourceRegistration": {
"allOf": [
{
"$ref": "#/definitions/ContextSourceRegistrationFragment"
},
{
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uri"
},
"type": {
"type": "string",
"const": "ContextSourceRegistration"
},
"createdAt": {
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/createdAt"
},
"modifiedAt": {
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/modifiedAt"
}
},
"required": [
"id",
"type",
"endpoint",
"information"
]
}
]
}
},
"additionalProperties": {
"type": ["string", "number", "boolean", "array", "object"]
},
"required": [
"id",
"type",
"endpoint",
"information"
"allOf": [
{
"$ref": "#/definitions/ContextSourceRegistration"
}
]
}
}
\ No newline at end of file
{
"$schema": "http://json-schema.org/schema#",
"id": "https://uri.etsi.org/ngsi-ld/schema/ContextSourceRegistrationList.json",
"title": "NGSI-LD Registration List",
"description": "NGSI-LD Registration List",
"definitions": {
"ContextSourceRegistrationList": {
"type": "array",
"items": {
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/registrations/ContextSourceRegistration.json#/definitions/ContextSourceRegistration"
}
}
},
"allOf": [{
"$ref": "#/definitions/ContextSourceRegistrationList"
}]
}
......@@ -16,6 +16,8 @@ ajv compile -s $SCHEMAS/EntityList.json -r $SCHEMAS/common.json -r $SCHEMAS/geom
ajv compile -s $SCHEMAS/subscriptions/SubscriptionList.json -r $SCHEMAS/common.json -r $SCHEMAS/geometry-schema.json -r $SCHEMAS/subscriptions/Subscription.json
ajv compile -s $SCHEMAS/registrations/ContextSourceRegistrationList.json -r $SCHEMAS/common.json -r $SCHEMAS/geometry-schema.json -r $SCHEMAS/registrations/ContextSourceRegistration.json
ajv compile -s $SCHEMAS/temporal/EntityTemporalList.json -r $SCHEMAS/temporal/EntityTemporal.json -r $SCHEMAS/Entity.json -r $SCHEMAS/common.json -r $SCHEMAS/geometry-schema.json
ajv compile -s $SCHEMAS/BatchOperationResult.json -r $SCHEMAS/common.json
......
{
"openapi": "3.0.1",
"info": {
"title": "NGSI-LD Registrations",
"version": "latest"
},
"components": {
"parameters": {
}
},
"paths": {
"/csourceRegistrations/": {
"get": {
"description": "Retrieve a set of context sources which matches a specific query from an NGSI-LD system",
"operationId": "queryCsources",
"parameters": [
{
"$ref": "#/components/parameters/limit"
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json;application/ld+json": {
"schema": {
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/registrations/ContextSourceRegistrationList.json#/definitions/ContextSourceRegistrationList"
},
"examples": {
"simple": {
"externalValue": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/examples/ContextSourceRegistrationList-example.json"
}
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json;application/ld+json": {
"schema": {
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/ProblemDetails"
}
}
}
}
}
},
"post": {
"description": "Registers a new context source within an NGSI-LD system",
"operationId": "registerCsource",
"requestBody": {
"required": true,
"content": {
"application/json;application/ld+json": {
"schema": {
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/registrations/ContextSourceRegistration.json#/definitions/ContextSourceRegistration"
}
}
}
},
"responses": {
"201": {
"description": "Created. Contains the resource URI of the created Registration"
},
"400": {
"description": "Bad request",
"content": {
"application/json;application/ld+json": {
"schema": {
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/ProblemDetails"
}
}
}
},
"409": {
"description": "Already exists",
"content": {
"application/json;application/ld+json": {
"schema": {
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/ProblemDetails"
}
}
}
}
}
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment