Skip to content
subscriptions-spec.json 3.12 KiB
Newer Older
{
  "openapi": "3.0.1",
  "info": {
    "title": "NGSI-LD Subscriptions",
    "version": "latest"
  },
  "components": {
canterafonsj's avatar
canterafonsj committed
    "parameters": {
      "limit": {
        "name": "limit",
        "description": "Pagination limit",
        "in": "query",
        "required": false,
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      }
canterafonsj's avatar
canterafonsj committed
    }
  },
  "paths": {
    "/subscriptions/": {
      "get": {
        "description": "Retrieves the subscriptions available in an NGSI-LD system",
        "operationId": "retrieveSubscriptions",
canterafonsj's avatar
canterafonsj committed
        "tags":[
canterafonsj's avatar
canterafonsj committed
          "Context Subscription"
canterafonsj's avatar
canterafonsj committed
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/subscriptions/SubscriptionList.json#/definitions/SubscriptionList"
                },
                "examples": {
                  "simple": {
                    "externalValue": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/examples/SubscriptionList-example.json"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json;application/ld+json": {
                "schema": {
                  "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "description": "Creates a new Subscription within an NGSI-LD system",
        "operationId": "createSubscription",
canterafonsj's avatar
canterafonsj committed
        "tags":[
canterafonsj's avatar
canterafonsj committed
          "Context Subscription"
canterafonsj's avatar
canterafonsj committed
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json;application/ld+json": {
              "schema": {
                "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/subscriptions/Subscription.json#/definitions/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": "https://forge.etsi.org/rep/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/rep/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/ProblemDetails"