full_api.json 80.1 KB
Newer Older
Stefan Wiedemann's avatar
Stefan Wiedemann committed
{
  "openapi": "3.0.3",
  "info": {
    "description": "This OAS file describes the NGSI-LD API defined by the ETSI ISG CIM group. This Cross-domain Context Information Management API allows to provide, consume and subscribe to context information in multiple scenarios and involving multiple stakeholders",
    "version": "latest",
    "title": "ETSI ISG CIM / NGSI-LD API",
    "contact": {
      "email": "NGSI-LD@etsi.org"
    }
  },
  "externalDocs": {
    "description": "Find out more about the ETSI ISG Context Information Management",
    "url": "https://portal.etsi.org/tb.aspx?tbid=854&SubTB=854"
  },
  "tags": [
    {
      "name": "ETSI",
      "description": "European Telecommunications Standards Institute",
      "externalDocs": {
        "description": "Find out more",
        "url": "http://www.etsi.org"
      }
    },
    {
      "name": "CIM",
      "description": "Context Information Management",
      "externalDocs": {
        "description": "Find out more",
        "url": "https://portal.etsi.org/tb.aspx?tbid=854&SubTB=854"
      }
    },
    {
      "name": "JSON-LD",
      "description": "JSON for Linked Data",
      "externalDocs": {
        "description": "Find out more",
        "url": "https://json-ld.org/"
      }
    },
    {
      "name": "NGSI-LD API",
      "description": "API defined by the ETSI ISG CIM",
      "externalDocs": {
        "description": "Preliminary Specification",
        "url": "http://www.etsi.org/deliver/etsi_gs/CIM/001_099/004/01.01.01_60/gs_CIM004v010101p.pdf"
      }
    }
  ],
  "paths": {
    "/entities/": {
      "get": {
        "description": "Retrieve a set of entities which matches a specific query from an NGSI-LD system",
        "operationId": "queryEntities",
        "tags": [
          "Context Information",
          "Entities"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          },
          {
            "$ref": "#/components/parameters/idPattern"
          },
          {
            "$ref": "#/components/parameters/type"
          },
          {
            "$ref": "#/components/parameters/attrs"
          },
          {
            "$ref": "#/components/parameters/q"
          },
          {
            "$ref": "#/components/parameters/georel"
          },
          {
            "$ref": "#/components/parameters/geometry"
          },
          {
            "$ref": "#/components/parameters/coordinates"
          },
          {
            "$ref": "#/components/parameters/geoproperty"
          },
          {
            "$ref": "#/components/parameters/csf"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/options"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/EntityList"
                },
                "examples": {
                  "simple": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
                    "externalValue": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/examples/EntityList-example.json"
Stefan Wiedemann's avatar
Stefan Wiedemann committed
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "description": "Create a new Entity within an NGSI-LD system",
        "operationId": "createEntity",
        "tags": [
          "Context Information",
          "Entities"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json;application/ld+json": {
              "schema": {
                "$ref": "#/components/schemas/Entity"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created. Contains the resource URI of the created Entity"
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Already exists",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/entities/{entityId}": {
      "get": {
        "description": "Retrieve an specific Entity from an NGSI-LD system. It's possible to specify the Entity attributes to be retrieved by using query parameters",
        "operationId": "retrieveEntityById",
        "tags": [
          "Context Information",
          "Entities"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/attrs"
          },
          {
            "$ref": "#/components/parameters/parameters-type"
          },
          {
            "$ref": "#/components/parameters/options"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/Entity"
                },
                "examples": {
                  "simple": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
                    "externalValue": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/examples/Entity-example.json"
Stefan Wiedemann's avatar
Stefan Wiedemann committed
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "description": "Removes an specific Entity from an NGSI-LD system",
        "operationId": "removeEntityById",
        "tags": [
          "Context Information",
          "Entities"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/parameters-type"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content. The entity was removed successfully"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/entities/{entityId}/attrs/": {
      "post": {
        "description": "Append new Entity attributes to an existing Entity within an NGSI-LD system",
        "operationId": "appendEntityAttrs",
        "tags": [
          "Context Information",
          "Entities"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/parameters-options"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json;application/ld+json": {
              "schema": {
                "$ref": "#/components/schemas/EntityFragment"
              }
            }
          }
        },
        "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": "#/components/schemas/UpdateResult"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "patch": {
        "description": "Update existing Entity attributes within an NGSI-LD system",
        "operationId": "updateEntityAttrs",
        "tags": [
          "Context Information",
          "Entities"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/entityId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json;application/ld+json": {
              "schema": {
                "$ref": "#/components/schemas/EntityFragment"
              }
            }
          }
        },
        "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": "#/components/schemas/UpdateResult"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/entities/{entityId}/attrs/{attrId}": {
      "patch": {
        "description": "Update existing Entity attributes within an NGSI-LD system",
        "operationId": "partialAttrUpdate",
        "tags": [
          "Context Information",
          "Entities"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/entityId"
          },
          {
            "$ref": "#/components/parameters/attrId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json;application/ld+json": {
              "schema": {
                "$ref": "#/components/schemas/EntityFragment"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content."
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "description": "Removes an existing Entity attribute within an NGSI-LD system",
        "operationId": "removeEntityAttr",
        "tags": [
          "Context Information",
          "Entities"
        ],
        "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": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/subscriptions/": {
      "get": {
        "description": "Retrieves the subscriptions available in an NGSI-LD system",
        "operationId": "retrieveSubscriptions",
        "tags": [
          "Context Subscription",
          "Subscriptions"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionList"
                },
                "examples": {
                  "simple": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
                    "externalValue": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/examples/SubscriptionList-example.json"
Stefan Wiedemann's avatar
Stefan Wiedemann committed
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "description": "Creates a new Subscription within an NGSI-LD system",
        "operationId": "createSubscription",
        "tags": [
          "Context Subscription",
          "Subscriptions"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json;application/ld+json": {
              "schema": {
                "$ref": "#/components/schemas/Subscription"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created. Contains the resource URI of the created Subscription"
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Already exists",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/subscriptions/{subscriptionId}": {
      "get": {
        "description": "Retrieves a specific Subscription from an NGSI-LD system",
        "operationId": "retrieveSubscriptionById",
        "tags": [
          "Context Subscription",
          "Subscriptions"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/subscriptionId"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/Subscription"
                },
                "examples": {
                  "simple": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
                    "externalValue": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/examples/Subscription-example_C.4.json"
Stefan Wiedemann's avatar
Stefan Wiedemann committed
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "patch": {
        "description": "Updates a specific Subscription within an NGSI-LD system",
        "operationId": "updateSubscription",
        "tags": [
          "Context Subscription",
          "Subscriptions"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/subscriptionId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json;application/ld+json": {
              "schema": {
                "$ref": "#/components/schemas/SubscriptionFragment"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content. The Subscription was updated successfully"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "description": "Removes a specific Subscription from an NGSI-LD system",
        "operationId": "removeSubscription",
        "tags": [
          "Context Subscription",
          "Subscriptions"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/subscriptionId"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content. The Subscription was removed successfully"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/csourceRegistrations/": {
      "get": {
        "description": "Retrieve a set of context sources which matches a specific query from an NGSI-LD system",
        "operationId": "queryCsources",
        "tags": [
          "Context Sources",
          "CSourceRegistrations"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          },
          {
            "$ref": "#/components/parameters/idPattern"
          },
          {
            "$ref": "#/components/parameters/type"
          },
          {
            "$ref": "#/components/parameters/attrs"
          },
          {
            "$ref": "#/components/parameters/q"
          },
          {
            "$ref": "#/components/parameters/georel"
          },
          {
            "$ref": "#/components/parameters/geometry"
          },
          {
            "$ref": "#/components/parameters/coordinates"
          },
          {
            "$ref": "#/components/parameters/geoproperty"
          },
          {
            "$ref": "#/components/parameters/limit"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ContextSourceRegistrationList"
                },
                "examples": {
                  "simple": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
                    "externalValue": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/examples/ContextSourceRegistrationList-example.json"
Stefan Wiedemann's avatar
Stefan Wiedemann committed
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "description": "Registers a new context source within an NGSI-LD system",
        "operationId": "registerCsource",
        "tags": [
          "Context Sources",
          "CSourceRegistrations"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json;application/ld+json": {
              "schema": {
                "$ref": "#/components/schemas/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": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Already exists",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/csourceRegistrations/{registrationId}": {
      "get": {
        "description": "Retrieves a specific context source registration from an NGSI-LD system",
        "operationId": "retrieveCsource",
        "tags": [
          "Context Sources",
          "CSourceRegistrations"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/registrationId"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ContextSourceRegistration"
                },
                "examples": {
                  "simple": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
                    "externalValue": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/examples/"
Stefan Wiedemann's avatar
Stefan Wiedemann committed
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "description": "Removes an specific context source registration within an NGSI-LD system",
        "operationId": "removeCsource",
        "tags": [
          "Context Sources",
          "CSourceRegistrations"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/registrationId"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content. The Registration was removed successfully"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/csourceSubscriptions/": {
      "get": {
        "description": "Retrieves the context source discovery subscriptions available in an NGSI-LD system",
        "operationId": "retrieveCSourceSubscriptions",
        "tags": [
          "Context Sources",
          "CSourceSubscriptions"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionList"
                },
                "examples": {
                  "simple": {
Stefan Wiedemann's avatar
Stefan Wiedemann committed
                    "externalValue": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/examples/SubscriptionList-example.json"
Stefan Wiedemann's avatar
Stefan Wiedemann committed
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "description": "Creates a context source discovery Subscription within an NGSI-LD system",
        "operationId": "createCSourceSubscription",
        "tags": [
          "Context Sources",
          "CSourceSubscriptions"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json;application/ld+json": {
              "schema": {
                "$ref": "#/components/schemas/Subscription"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created. Contains the resource URI of the created Subscription"
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Already exists",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }