entity-attrs-spec.json 7.19 KB
Newer Older
canterafonsj's avatar
canterafonsj committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{
  "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": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
25
          "$ref": "http://localhost:8090/schema/common.json#/definitions/Name"
canterafonsj's avatar
canterafonsj committed
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
        }
      },
      "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",
Stefan Wiedemann's avatar
Stefan Wiedemann committed
47
        "tags": ["Context Information", "Entities"],
canterafonsj's avatar
canterafonsj committed
48
49
50
51
52
53
54
55
56
57
58
59
60
        "parameters": [
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/options"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json;application/ld+json": {
              "schema": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
61
                "$ref": "http://localhost:8090/schema/Entity.json#/definitions/EntityFragment"
canterafonsj's avatar
canterafonsj committed
62
63
64
65
66
67
68
69
70
71
72
73
74
              }
            }
          }
        },
        "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": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
75
                  "$ref": "http://localhost:8090/schema/UpdateResult.json#/definitions/UpdateResult"
canterafonsj's avatar
canterafonsj committed
76
77
78
79
80
81
82
83
84
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
85
                  "$ref": "http://localhost:8090/schema/common.json#/definitions/ProblemDetails"
canterafonsj's avatar
canterafonsj committed
86
87
88
89
90
91
92
93
94
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
95
                  "$ref": "http://localhost:8090/schema/common.json#/definitions/ProblemDetails"
canterafonsj's avatar
canterafonsj committed
96
97
98
99
100
101
102
103
104
                }
              }
            }
          }
        }
      },
      "patch": {
        "description": "Update existing Entity attributes within an NGSI-LD system",
        "operationId": "updateEntityAttrs",
Stefan Wiedemann's avatar
Stefan Wiedemann committed
105
        "tags": ["Context Information", "Entities"],
canterafonsj's avatar
canterafonsj committed
106
107
108
109
110
111
112
113
114
115
        "parameters": [
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json;application/ld+json": {
              "schema": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
116
                "$ref": "http://localhost:8090/schema/Entity.json#/definitions/EntityFragment"
canterafonsj's avatar
canterafonsj committed
117
118
119
120
121
122
123
124
125
126
127
128
129
              }
            }
          }
        },
        "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": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
130
                  "$ref": "http://localhost:8090/schema/UpdateResult.json#/definitions/UpdateResult"
canterafonsj's avatar
canterafonsj committed
131
132
133
134
135
136
137
138
139
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
140
                  "$ref": "http://localhost:8090/schema/common.json#/definitions/ProblemDetails"
canterafonsj's avatar
canterafonsj committed
141
142
143
144
145
146
147
148
149
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
150
                  "$ref": "http://localhost:8090/schema/common.json#/definitions/ProblemDetails"
canterafonsj's avatar
canterafonsj committed
151
152
153
154
155
156
157
158
159
160
161
                }
              }
            }
          }
        }
      }
    },
    "/entities/{entityId}/attrs/{attrId}": {
      "patch": {
        "description": "Update existing Entity attributes within an NGSI-LD system",
        "operationId": "partialAttrUpdate",
Stefan Wiedemann's avatar
Stefan Wiedemann committed
162
        "tags": ["Context Information", "Entities"],
canterafonsj's avatar
canterafonsj committed
163
164
165
166
167
168
169
170
171
172
173
174
175
        "parameters": [
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/attrId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json;application/ld+json": {
              "schema": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
176
                "$ref": "http://localhost:8090/schema/Entity.json#/definitions/EntityFragment"
canterafonsj's avatar
canterafonsj committed
177
178
179
180
181
182
183
184
185
186
187
188
189
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content."
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
190
                  "$ref": "http://localhost:8090/schema/common.json#/definitions/ProblemDetails"
canterafonsj's avatar
canterafonsj committed
191
192
193
194
195
196
197
198
199
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
200
                  "$ref": "http://localhost:8090/schema/common.json#/definitions/ProblemDetails"
canterafonsj's avatar
canterafonsj committed
201
202
203
204
205
206
207
208
209
                }
              }
            }
          }
        }
      },
      "delete": {
        "description": "Removes an existing Entity attribute within an NGSI-LD system",
        "operationId": "removeEntityAttr",
Stefan Wiedemann's avatar
Stefan Wiedemann committed
210
        "tags": ["Context Information", "Entities"],
canterafonsj's avatar
canterafonsj committed
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
        "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": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
228
                  "$ref": "http://localhost:8090/schema/common.json#/definitions/ProblemDetails"
canterafonsj's avatar
canterafonsj committed
229
230
231
232
233
234
235
236
237
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
238
                  "$ref": "http://localhost:8090/schema/common.json#/definitions/ProblemDetails"
canterafonsj's avatar
canterafonsj committed
239
240
241
242
243
244
245
246
247
                }
              }
            }
          }
        }
      }
    }
  }
}