Pipeline¶
This index stores all the incoming pipelines.
Schema¶
Field |
Type |
Required |
Readonly |
Auto Managed |
Example |
|
---|---|---|---|---|---|---|
|
String |
True |
True |
False |
dsalkasdioi232382yieyqwuiy |
|
|
Timestamp |
False |
False |
False |
1617278285 |
|
|
Timestamp |
True |
True |
False |
1617278285 |
|
|
String |
False |
False |
False |
test pipeline guard-vdpi ud |
|
|
String |
True |
False |
False |
started |
|
|
String |
False |
False |
False |
Minds & Sparks |
Warning
It is not possible to update readonly fields.
it is not possible to set the Auto managed fields.
Note
id
is required but it is auto-generated if not provided. It is recommended to provide a friendly for simplify the retrieve of connected date in other indices.
Create¶
To create a new pipeline use the following REST call:
- POST /pipeline/(string: id)¶
with the request body in JSON format:
POST /pipeline HTTP/1.1 Host: cb-manager.example.com Content-Type: application/json { "id": "<pipeline-id>", "created_at": 1617278285, "updated_at": 1617278340, "name": "test pipeline guard-vdpi udt", "user": "Minds & Sparks", "status": "started" }
- Parameters
id – optional pipeline id.
- Request Headers
Authorization – JWT Authentication.
Content-Type – application/json
- Response Headers
Content-Type – application/json
- Status Codes
201 Created – Pipeline correctly created.
204 No Content – No content to create pipeline based on the request.
400 Bad Request – Request not valid.
401 Unauthorized – Authentication failed.
406 Not Acceptable – Request validation failed.
415 Unsupported Media Type – Media type not supported.
422 Unprocessable Entity – Not possible to create ore or more pipelines based on the request.
500 Internal Server Error – Server not available to satisfy the request.
Replace the data with the correct values, for example <pipeline-id> with
alert-attack
.Note
It is possible to add additional data.
If the creation is correctly executed the response is:
HTTP/1.1 201 Created Content-Type: application/json [ { "status": "Created", "code": 201, "error": false, "message": "Pipeline with id=<pipeline-id> correctly created" } ]
Otherwise, if, for example, an pipeline with the given
id
is already found, this is the response:HTTP/1.1 406 Not Acceptable Content-Type: application/json [ { "status": "Not Acceptable", "code": 406, "error": true, "message": "Id already found" } ]
Read¶
To get the list of pipelines:
- GET /pipeline/(string: id)¶
The response includes all the pipelines created.
It is possible to filter the results using the following request body:
GET /pipeline HTTP/1.1 Host: cb-manager.example.com Content-Type: application/json { "select": [ "id" ], "where": { "equals": { "target": "id", "expr": "<pipeline-id>" } } }
- Parameters
id – optional pipeline id.
- Request Headers
Authorization – JWT Authentication.
Content-Type – application/json
- Response Headers
Content-Type – application/json
- Status Codes
200 OK – List of pipelines filtered by the query in the request body.
400 Bad Request – Request not valid.
401 Unauthorized – Authentication failed.
404 Not Found – Pipeline based on the request query not found.
406 Not Acceptable – Request validation failed.
415 Unsupported Media Type – Media type not supported.
422 Unprocessable Entity – Not possible to get pipelines with the request query.
500 Internal Server Error – Server not available to satisfy the request.
In this way, it will be returned only the
id
of the pipeline withid
= “<pipeline-id>”.
Update¶
To update an pipeline, use:
- PUT /pipeline/(string: id)¶
PUT /pipeline HTTP/1.1 Host: cb-manager.example.com Content-Type: application/json { "id": "<pipeline-id>", "source": "<ip-address>" }
- Parameters
id – optional pipeline id.
- Request Headers
Authorization – JWT Authentication.
Content-Type – application/json
- Response Headers
Content-Type – application/json
- Status Codes
200 OK – All pipelines correctly updated.
204 No Content – No content to update pipelines based on the request.
304 Not Modified – Update for one or more pipelines not necessary.
400 Bad Request – Request not valid.
401 Unauthorized – Authentication failed.
406 Not Acceptable – Request validation failed.
415 Unsupported Media Type – Media type not supported.
422 Unprocessable Entity – Not possible to update one or more pipelines based on the request.
500 Internal Server Error – Server not available to satisfy the request.
This example add a new field
source
for the pipeline withid
= “<pipeline-id>”.A possible response is:
HTTP/1.1 200 OK Content-Type: application/json [ { "status": "OK", "code": 200, "error": false, "message": "Pipeline with id=<pipeline-id> correctly updated" } ]
Instead, if the are not changes the response is:
HTTP/1.1 304 Not Modified Content-Type: application/json [ { "status": "Not Modified", "code": 304, "error": false, "message": "Update for pipeline with id=<pipeline-id> not necessary" } ]
Delete¶
To delete pipelines, use:
- DELETE /pipeline/(string: id)¶
DELETE /pipeline HTTP/1.1 Host: cb-manager.example.com Content-Type: application/json { "where": { "equals": { "target": "id", "expr": "<pipeline-id>" } } }
- Parameters
id – optional pipeline id.
- Request Headers
Authorization – JWT Authentication.
Content-Type – application/json
- Response Headers
Content-Type – application/json
- Status Codes
205 Reset Content – All pipelines correctly deleted.
400 Bad Request – Request not valid.
401 Unauthorized – Authentication failed.
404 Not Found – Pipeline based on the request query not found.
406 Not Acceptable – Request validation failed.
415 Unsupported Media Type – Media type not supported.
422 Unprocessable Entity – Not possible to delete one or more pipelines based on the request query.
500 Internal Server Error – Server not available to satisfy the request.
This request removes the pipeline with
id
= “<pipeline-id>”.This is a possible response:
HTTP/1.1 205 Reset Content Content-Type: application/json [ { "status": "Reset Content", "code": 200, "error": false, "message": "Pipeline with id=<pipeline-id> correctly deleted" } ]
Caution
Without request body, it removes all the pipelines.