From 472993b69534899f3b1b772a9488d09f3d5efa1f Mon Sep 17 00:00:00 2001 From: Jose Manuel Cantera Date: Tue, 20 Nov 2018 10:20:14 +0100 Subject: [PATCH] Entity By Attributes --- spec/updated/entity-attrs-spec.json | 243 ++++++++++++++++++++++++++++ 1 file changed, 243 insertions(+) create mode 100644 spec/updated/entity-attrs-spec.json diff --git a/spec/updated/entity-attrs-spec.json b/spec/updated/entity-attrs-spec.json new file mode 100644 index 0000000..c0efc41 --- /dev/null +++ b/spec/updated/entity-attrs-spec.json @@ -0,0 +1,243 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "NGSI-LD Entity Attributes", + "version": "latest" + }, + "components": { + "parameters": { + "entityId": { + "name": "entityId", + "description": "Entity Id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uri" + } + }, + "attrId": { + "name": "attrId", + "description": "Attribute Id", + "in": "path", + "required": true, + "schema": { + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/Name" + } + }, + "options": { + "name": "options", + "description": "Indicates that no attribute overwrite shall be performed", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "noOverwrite" + ] + } + } + } + }, + "paths": { + "/entities/{entityId}/attrs/": { + "post": { + "description": "Append new Entity attributes to an existing Entity within an NGSI-LD system", + "operationId": "appendEntityAttrs", + "parameters": [ + { + "$ref": "#/components/parameters/entityId" + }, + { + "$ref": "#/components/parameters/options" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json;application/ld+json": { + "schema": { + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/Entity.json#" + } + } + } + }, + "responses": { + "204": { + "description": "No Content" + }, + "207": { + "description": "Partial Success. Only the attributes included in the response payload were successfully appended", + "content": { + "application/json;application/ld+json": { + "schema": { + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/UpdateResult.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" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json;application/ld+json": { + "schema": { + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/ProblemDetails" + } + } + } + } + } + }, + "patch": { + "description": "Update existing Entity attributes within an NGSI-LD system", + "operationId": "updateEntityAttrs", + "parameters": [ + { + "$ref": "#/components/parameters/entityId" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json;application/ld+json": { + "schema": { + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/Entity.json#" + } + } + } + }, + "responses": { + "204": { + "description": "No Content." + }, + "207": { + "description": "Partial Success. Only the attributes included in the response payload were successfully updated", + "content": { + "application/json;application/ld+json": { + "schema": { + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/UpdateResult.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" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json;application/ld+json": { + "schema": { + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/ProblemDetails" + } + } + } + } + } + } + }, + "/entities/{entityId}/attrs/{attrId}": { + "patch": { + "description": "Update existing Entity attributes within an NGSI-LD system", + "operationId": "partialAttrUpdate", + "parameters": [ + { + "$ref": "#/components/parameters/entityId" + }, + { + "$ref": "#/components/parameters/attrId" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json;application/ld+json": { + "schema": { + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/Entity.json#" + } + } + } + }, + "responses": { + "204": { + "description": "No Content." + }, + "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" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json;application/ld+json": { + "schema": { + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/ProblemDetails" + } + } + } + } + } + }, + "delete": { + "description": "Removes an existing Entity attribute within an NGSI-LD system", + "operationId": "removeEntityAttr", + "parameters": [ + { + "$ref": "#/components/parameters/entityId" + }, + { + "$ref": "#/components/parameters/attrId" + } + ], + "responses": { + "204": { + "description": "No Content." + }, + "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" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json;application/ld+json": { + "schema": { + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/ProblemDetails" + } + } + } + } + } + } + } + } +} -- GitLab