Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
NGSI Linked Data
NGSI-LD
Commits
c4f887f1
Commit
c4f887f1
authored
Nov 21, 2018
by
canterafonsj
Browse files
Subscriptions OAS first stab
parent
bb5216fd
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
examples/SubscriptionList-example.json
0 → 100644
View file @
c4f887f1
[
{
"id"
:
"urn:ngsi-ld:Subscription:mySubscription"
,
"type"
:
"Subscription"
,
"entities"
:
[
{
"type"
:
"Vehicle"
}
],
"watchedAttributes"
:
[
"speed"
],
"q"
:
"speed>50"
,
"geoQ"
:
{
"georel"
:
"near;maxDistance==2000"
,
"geometry"
:
"Point"
,
"coordinates"
:
[
-1
,
100
]
},
"notification"
:
{
"attributes"
:
[
"speed"
],
"format"
:
"keyValues"
,
"endpoint"
:
{
"uri"
:
"http://my.endpoint.org/notify"
,
"accept"
:
"application/json"
}
},
"@context"
:
[
"https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/coreContext/ngsi-ld-core-context.json"
,
"http://example.org/cim/vehicle.jsonld"
]
}
]
schema/subscriptions/Subscription.json
View file @
c4f887f1
...
...
@@ -68,106 +68,125 @@
"$ref"
:
"https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/geometry"
}
}
}
},
"type"
:
"object"
,
"properties"
:
{
"id"
:
{
"type"
:
"string"
,
"format"
:
"uri"
},
"type"
:
{
"type"
:
"string"
,
"const"
:
"Subscription"
},
"@context"
:
{
"$ref"
:
"https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/LdContext"
},
"entities"
:
{
"type"
:
"array"
,
"items"
:
{
"$ref"
:
"https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/EntityInfo"
},
"minItems"
:
1
},
"name"
:
{
"type"
:
"string"
,
"minLength"
:
1
},
"description"
:
{
"type"
:
"string"
,
"minLength"
:
1
},
"notification"
:
{
"$ref"
:
"#/definitions/NotificationParams"
},
"watchedAttributes"
:
{
"type"
:
"array"
,
"minItems"
:
1
,
"items"
:
{
"$ref"
:
"https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/Name"
},
"uniqueItems"
:
true
},
"timeInterval"
:
{
"type"
:
"number"
,
"minimum"
:
0
},
"expires"
:
{
"type"
:
"string"
,
"format"
:
"date-time"
},
"status"
:
{
"type"
:
"string"
,
"enum"
:
[
"active"
,
"paused"
,
"expired"
]
},
"isActive"
:
{
"type"
:
"boolean"
},
"throttling"
:
{
"type"
:
"number"
,
"minimum"
:
1
},
"q"
:
{
"type"
:
"string"
},
"geoQ"
:
{
"$ref"
:
"#/definitions/GeoQuery"
},
"csf"
:
{
"type"
:
"string"
}
},
"createdAt"
:
{
"$ref"
:
"https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/createdAt"
},
"modifiedAt"
:
{
"$ref"
:
"https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/modifiedAt"
},
"allOf"
:
[
{
"required"
:
[
"id"
,
"type"
]
"SubscriptionFragment"
:
{
"type"
:
"object"
,
"properties"
:
{
"@context"
:
{
"$ref"
:
"https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/LdContext"
},
"entities"
:
{
"type"
:
"array"
,
"items"
:
{
"$ref"
:
"https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/EntityInfo"
},
"minItems"
:
1
},
"name"
:
{
"type"
:
"string"
,
"minLength"
:
1
},
"description"
:
{
"type"
:
"string"
,
"minLength"
:
1
},
"watchedAttributes"
:
{
"type"
:
"array"
,
"minItems"
:
1
,
"items"
:
{
"$ref"
:
"https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/Name"
},
"uniqueItems"
:
true
},
"timeInterval"
:
{
"type"
:
"number"
,
"minimum"
:
0
},
"expires"
:
{
"type"
:
"string"
,
"format"
:
"date-time"
},
"isActive"
:
{
"type"
:
"boolean"
},
"throttling"
:
{
"type"
:
"number"
,
"minimum"
:
1
},
"q"
:
{
"type"
:
"string"
},
"geoQ"
:
{
"$ref"
:
"#/definitions/GeoQuery"
},
"csf"
:
{
"type"
:
"string"
}
}
},
{
"a
ny
Of"
:
[
"Subscription"
:
{
"a
ll
Of"
:
[
{
"required"
:
[
"entities"
]
"$ref"
:
"#/definitions/SubscriptionFragment"
},
{
"required"
:
[
"watchedAttributes"
"type"
:
"object"
,
"properties"
:
{
"id"
:
{
"type"
:
"string"
,
"format"
:
"uri"
},
"type"
:
{
"type"
:
"string"
,
"const"
:
"Subscription"
},
"notification"
:
{
"$ref"
:
"#/definitions/NotificationParams"
},
"status"
:
{
"type"
:
"string"
,
"enum"
:
[
"active"
,
"paused"
,
"expired"
]
},
"createdAt"
:
{
"$ref"
:
"https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/createdAt"
},
"modifiedAt"
:
{
"$ref"
:
"https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/modifiedAt"
}
},
"allOf"
:
[
{
"required"
:
[
"id"
,
"type"
]
},
{
"anyOf"
:
[
{
"required"
:
[
"entities"
]
},
{
"required"
:
[
"watchedAttributes"
]
}
]
}
]
}
]
}
},
"allOf"
:
[
{
"$ref"
:
"#/definitions/Subscription"
}
]
}
schema/subscriptions/SubscriptionList.json
0 → 100644
View file @
c4f887f1
{
"$schema"
:
"http://json-schema.org/schema#"
,
"id"
:
"https://uri.etsi.org/ngsi-ld/schema/SubscriptionList.json"
,
"title"
:
"NGSI-LD Subscription List"
,
"description"
:
"NGSI-LD Subscription List"
,
"definitions"
:
{
"SubscriptionList"
:
{
"type"
:
"array"
,
"items"
:
{
"$ref"
:
"https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/Subscription.json#/definitions/Subscription"
}
}
},
"allOf"
:
[{
"$ref"
:
"#/definitions/SubscriptionList"
}]
}
spec/updated/full_api.json
View file @
c4f887f1
This diff is collapsed.
Click to expand it.
spec/updated/subscriptions-spec.json
0 → 100644
View file @
c4f887f1
{
"openapi"
:
"3.0.1"
,
"info"
:
{
"title"
:
"NGSI-LD Subscriptions"
,
"version"
:
"latest"
},
"components"
:
{
"parameters"
:
[
"limit"
:
{
"name"
:
"limit"
,
"description"
:
"Pagination limit"
,
"in"
:
"query"
,
"required"
:
false
,
"schema"
:
{
"type"
:
"integer"
,
"minimum"
:
1
}
}
]
},
"paths"
:
{
"/subscriptions/"
:
{
"get"
:
{
"description"
:
"Retrieves the subscriptions available in an NGSI-LD system"
,
"operationId"
:
"retrieveSubscriptions"
,
"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/subscriptions/SubscriptionList.json#/definitions/SubscriptionList"
},
"examples"
:
{
"simple"
:
{
"externalValue"
:
"https://forge.etsi.org/gitlab/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/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/ProblemDetails"
}
}
}
}
}
},
"post"
:
{
"description"
:
"Creates a new Subscription within an NGSI-LD system"
,
"operationId"
:
"createSubscription"
,
"requestBody"
:
{
"required"
:
true
,
"content"
:
{
"application/json;application/ld+json"
:
{
"schema"
:
{
"$ref"
:
"https://forge.etsi.org/gitlab/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/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"
}
}
}
}
}
}
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment