HTTP endpoint source¶
This is a special data source that registers an HTTP receiver endpoint that one can post entities to. Entities posted here will be written to the pipe’s sink.
A pipe that references the HTTP endpoint
source will not pump any
entities, in practice this means that a pump is not configured for the
pipe; the only way for entities to flow through the pipe is by posting
them to the HTTP endpoint.
It exposes two URLs:
URL |
Description |
---|---|
|
JSON Push endpoint |
|
SDShare Push receiver endpoint |
JSON Push protocol¶
The JSON Push protocol is described in additional detail in the JSON Push Protocol document. The serialisation of entities as JSON is described in more detail here. Both individual entities and lists of entities can be posted. This endpoint is compatible with The JSON push sink.
The JSON Push endpoint supports HTTP POST of
both a single JSON object and a list of JSON objects. The HTTP request’s content-type
header element must be set to application/json
in this case.
Prototype¶
{
"type": "http_endpoint"
}
Properties¶
Property |
Type |
Description |
Default |
Req |
---|---|---|---|---|
|
Boolean |
If true (the default) the sink dataset will be marked as populated initially. This property can only be
specified if the sink is of type |
|
No |
|
Boolean |
If true (the default) numbers with a decimal point will be stored as the |
|
No |
|
Boolean |
If true (the default) numbers where all the digits after the decimal point is zero will be stored as the
|
|
No |
|
Boolean or Object |
This can be set to |
|
No |
|
Boolean |
If the |
|
No |
|
Integer |
If the |
600 |
No |
|
Integer |
If the |
100 |
No |
|
Boolean |
If the |
|
No |
|
Integer |
If the |
100 |
No |
|
String |
This property allows custom request validation for receiver endpoints. This is particularly useful when clients cannot use JWT tokens for authentication. The string must be a Jinja template. The Jinja template is rendered for each incoming request. If it renders as an empty string then the request is accepted, otherwise the rendered string will be reported as an error in the response. The context allows using the Note It is assumed that the receiver pipe has granted the |
No |
Completeness¶
When entities are posted to the HTTP endpoint source, the completeness value of the sink dataset will by default be set to the current time. But it is also possible to explicitly specify the completeness value by adding a ‘X-Dataset-Completeness’ header in the POST-request. This value must be a positive integer. It is recommended to use microseconds since the epoch, since this is what Sesam does by default. Example:
curl -H "X-Dataset-Completeness: 1633934725921188" ...
Continuation support¶
See the section on continuation support for more information.
Property |
Value |
---|---|
|
|
|
|
|
|
Example configuration¶
The pipe configuration given below will expose the
my-entities
receiver endpoint and write any data it receives
into the my-entities
dataset:
{
"_id": "my-entities",
"type": "pipe",
"source": {
"type": "http_endpoint"
}
}