Commit 726dce2f authored by canterafonsj's avatar canterafonsj
Browse files

Csource Registrations

parent f0a137fe
Loading
Loading
Loading
Loading
+84 −59
Original line number Original line Diff line number Diff line
@@ -50,18 +50,10 @@
          "format": "date-time"
          "format": "date-time"
        }
        }
      }
      }
    }
    },
    },
    "ContextSourceRegistrationFragment": {
      "type": "object",
      "type": "object",
      "properties": {
      "properties": {
    "id": {
      "type": "string",
      "format": "uri"
    },
    "type": {
      "type": "string",
      "const": "ContextSourceRegistration"
    },
        "@context": {
        "@context": {
          "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/LdContext"
          "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/LdContext"
        },
        },
@@ -97,6 +89,33 @@
        "endpoint": {
        "endpoint": {
          "type": "string",
          "type": "string",
          "format": "uri"
          "format": "uri"
        }
      },
      "additionalProperties": {
        "type": [
          "string",
          "number",
          "boolean",
          "array",
          "object"
        ]
      }
    },
    "ContextSourceRegistration": {
      "allOf": [
        {
          "$ref": "#/definitions/ContextSourceRegistrationFragment"
        },
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "format": "uri"
            },
            "type": {
              "type": "string",
              "const": "ContextSourceRegistration"
            },
            },
            "createdAt": {
            "createdAt": {
              "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/createdAt"
              "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/createdAt"
@@ -105,9 +124,6 @@
              "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/modifiedAt"
              "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/modifiedAt"
            }
            }
          },
          },
  "additionalProperties": {
    "type": ["string", "number", "boolean", "array", "object"]
  },
          "required": [
          "required": [
            "id",
            "id",
            "type",
            "type",
@@ -115,3 +131,12 @@
            "information"
            "information"
          ]
          ]
        }
        }
      ]
    }
  },
  "allOf": [
    {
      "$ref": "#/definitions/ContextSourceRegistration"
    }
  ]
}
 No newline at end of file
+17 −0
Original line number Original line Diff line number Diff line
{
  "$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"
  }]
}
+2 −0
Original line number Original line Diff line number Diff line
@@ -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/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/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
ajv compile -s $SCHEMAS/BatchOperationResult.json -r $SCHEMAS/common.json
+90 −0
Original line number Original line Diff line number Diff line
{
  "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"
                }
              }
            }
          }
        }
      }
    }
  }
}