PADAS Engine REST Docs

Overview

HTTP verbs & CRUD

RESTful notes tries to adhere as closely as possible to standard HTTP and REST conventions in its use of HTTP verbs and related CRUD (Create, Read, Update, and Delete) operations.

Resource Endpoint Verb Usage

/api/{resource}

GET

Used to retrieve all available resources (Read all)

/api/{resource}/{id}

GET

Used to retrieve a resource (Read one)

/api/{resource}

POST

Used to create a new resource (Create)

/api/{resource}/{id}

PUT

Used to update an existing resource (Update one)

/api/{resource}/{id}

DELETE

Used to delete an existing resource (Delete one)

Note: By default, Padas Engine listens on https://localhost:8999

HTTP status codes

RESTful notes tries to adhere as closely as possible to standard HTTP and REST conventions in its use of HTTP status codes.

Status code Usage

200 OK

The request completed successfully

201 Created

A new resource has been created successfully. The resource’s URI is available from the response’s Location header

204 No Content

An update to an existing resource has been applied successfully

400 Bad Request

The request was malformed. The response body will include an error providing further information

401 Unauthorized

The request lacks valid authentication credentials

403 Forbidden

The request lacks valid authorization credentials (e.g. invalid tokens or role)

404 Not Found

The requested resource did not exist

409 Conflict

The request could not be completed due to a conflict with the current state of the resource

ERROR Messages

401 Unauthorized and 403 Forbidden responses do NOT contain any error messages. For all others, response body contains error information.

Table 1. error fields
Field Name Description

status

Response status

message

Resource related error message

debugMessage

Endpoint specific message details for debugging

Following table provides information on error message

error response example
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 119

{
  "status" : "NOT_FOUND",
  "message" : "Resource not found",
  "debugMessage" : "Provided username does not exist"
}

REST Endpoints

Init

This REST endpoint provides status and initial user creation functionality.

Create: POST /api/init

Initialize with a new user. This can be only performed 1 time. Consecutive requests should result in error.

Table 2. request fields
Path Type Description

name

String

Display name for user

username

String

Unique user name

email

String

Email address associated with this user

password

String

Password for this user

roles

Array

An array of roles

roles.[].name

String

Name of the role.

Table 3. response fields
Path Type Description

name

String

Display name for user

username

String

Unique user name

email

String

Email address associated with this user

roles

Array

An array of roles

roles.[].id

Number

Id for role

roles.[].name

String

Name of the role.

request example (success)
POST /api/init HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 156
Host: localhost:8999

{
  "name" : "New User",
  "username" : "newuser",
  "email" : "newuser@padas.io",
  "password" : "password123",
  "roles" : [ {
    "name" : "user"
  } ]
}
response example (success)
HTTP/1.1 201 Created
Location: https://localhost:8999/init
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 140

{
  "name" : "New User",
  "username" : "newuser",
  "email" : "newuser@padas.io",
  "roles" : [ {
    "id" : 7,
    "name" : "user"
  } ]
}
request example (failure)
POST /api/init HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 156
Host: localhost:8999

{
  "name" : "New User",
  "username" : "newuser",
  "email" : "newuser@padas.io",
  "password" : "password123",
  "roles" : [ {
    "name" : "user"
  } ]
}
response example (failure)
HTTP/1.1 409 Conflict
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 129

{
  "status" : "CONFLICT",
  "message" : "Resource already exists",
  "debugMessage" : "API and users are already initialized."
}

Read: GET /api/init

Read initial status of the endpoints. true means we have users initialized already.

Table 4. response fields
Path Type Description

initialized

Boolean

Shows status. Value is true if initialized, false if this is the first time accessing the api

request example (success)
GET /api/init HTTP/1.1
Host: localhost:8999
response example (success)
HTTP/1.1 200 OK
Content-Type: text/plain;charset=UTF-8
Content-Length: 26
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY

{
  "initialized" : true
}
request example (failure)
GET /api/init HTTP/1.1
Host: localhost:8999
response example (failure)
HTTP/1.1 200 OK
Content-Type: text/plain;charset=UTF-8
Content-Length: 27
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY

{
  "initialized" : false
}

Authentication & Authorization

A username and password authentication scheme is provided by default. A POST request is used to perform login action.

Important Note: Any request to a protected resource (i.e. /api/* URLs), other than login (/api/login), must have a valid access_token within Authorization header as a Bearer token. Example:

GET /api/some-resource-goes-here HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsInJvbGVzIjpbImFkbWluIl0sImlzcyI6Imh0dHA6Ly9sb2NhbGhvc3Q6ODA4MC9hcGkvbG9naW4iLCJleHAiOjE2NDc3OTk2MTZ9.yBxgcrvYzOLJK_tkQz0ItocRDBLntrVpSX6i3XMLN7w
...

Login: POST /api/login

Upon successful login tokens are generated: use access_token for accessing any resource and refresh_token when access_token is no longer valid. A failed login returns 401 response code.

Table 5. request fields
Path Type Description

username

String

Username to login.

password

String

Password for the user.

Table 6. response fields
Path Type Description

access_token

String

Authorization (JWT) token to access protected API resources.

refresh_token

String

This token can be used to obtain additional access token when existing one expires.

request example (success)
POST /api/login HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 57
Host: localhost:8999

{
  "username" : "testadmin",
  "password" : "password"
}
response example (success)
HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 441

{
  "access_token" : "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTM3NH0.LkBrQWAKEqkXaohVNjDDeoUiss9qvtFpdUmKR6c51do",
  "refresh_token" : "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA2MjM3NH0.cIiI1eQY3MgM6Bo_oJXLsXy2kZ0xGT0AU1poaEvXGjM"
}
request example (failure)
POST /api/login HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 62
Host: localhost:8999

{
  "username" : "testadmin",
  "password" : "nosuchpassxxx"
}
response example (failure)
HTTP/1.1 401 Unauthorized
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY

Refresh Token: GET /api/token/refresh

When access_token is no longer valid (receiving 403 responses due to expiration) this endpoint can be utilized to obtain a new one. A failed access attempt returns 403 response code.

Table 7. request headers
Name Description

Authorization

Contains Bearer refresh token for getting a fresh access token.

Table 8. response fields
Path Type Description

access_token

String

Authorization (JWT) token to access protected API resources.

refresh_token

String

This token can be used to obtain additional access token when existing one expires.

request example (success)
GET /api/token/refresh HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA2MjM4NX0.6kuFoPmJGCpsEekCwnuCUB0m7r7TOnmzSDZqSzMYHHI
Host: localhost:8999
response example (success)
HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 452

{
  "access_token" : "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS90b2tlbi9yZWZyZXNoIiwiZXhwIjoxNjc2MDU5Mzg1fQ.mhTH3QhmQoNajINGXQ2Vtqdo6b198CzX2Th7XmjCyTc",
  "refresh_token" : "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA2MjM4NX0.6kuFoPmJGCpsEekCwnuCUB0m7r7TOnmzSDZqSzMYHHI"
}
request example (failure)
GET /api/token/refresh HTTP/1.1
Authorization: Bearer some_invalid_refresh_token
Host: localhost:8999
response example (failure)
HTTP/1.1 403 Forbidden
ERROR: JWT verification error.
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 49

{
  "error_message" : "JWT verification error."
}

Engine

This REST endpoint provides functionality for reading state, stop, and start actions for stream engine.

State: GET /api/engine/state

Table 9. request headers
Name Description

Authorization

Contains Bearer access token.

Table 10. response fields
Path Type Description

state

String

Current state of the stream engine according to https://docs.confluent.io/platform/current/streams/javadocs/javadoc/org/apache/kafka/streams/KafkaStreams.State.html

request example (success)
GET /api/engine/state HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTQwMH0.TilFReg-6gp_RbGsMeGEHoqNUm2_RSP6jVYAf_WYUTE
Host: localhost:8999
response example (success)
HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 29

{
  "state" : "REBALANCING"
}

Stop: POST /api/engine/stop

Stop the engine. If it’s already stopped it should return the same result.

Table 11. request headers
Name Description

Authorization

Contains Bearer access token.

Table 12. response fields
Path Type Description

state

String

Current state of the stream engine according to https://docs.confluent.io/platform/current/streams/javadocs/javadoc/org/apache/kafka/streams/KafkaStreams.State.html

request example (success)
POST /api/engine/stop HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTQwMH0.TilFReg-6gp_RbGsMeGEHoqNUm2_RSP6jVYAf_WYUTE
Host: localhost:8999
response example (success)
HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 29

{
  "state" : "NOT_RUNNING"
}
request example (failure)
POST /api/engine/stop HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTQwMH0.TilFReg-6gp_RbGsMeGEHoqNUm2_RSP6jVYAf_WYUTE
Host: localhost:8999
response example (failure)
HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 29

{
  "state" : "NOT_RUNNING"
}

Start: POST /api/engine/start

Start the engine. The engine must be in NOT_RUNNING state.

Table 13. request headers
Name Description

Authorization

Contains Bearer access token.

Table 14. response fields
Path Type Description

state

String

Current state of the stream engine according to https://docs.confluent.io/platform/current/streams/javadocs/javadoc/org/apache/kafka/streams/KafkaStreams.State.html

request example (success)
POST /api/engine/start HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTQwMH0.TilFReg-6gp_RbGsMeGEHoqNUm2_RSP6jVYAf_WYUTE
Host: localhost:8999
response example (success)
HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 29

{
  "state" : "REBALANCING"
}
request example (failure)
POST /api/engine/start HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTQwMH0.TilFReg-6gp_RbGsMeGEHoqNUm2_RSP6jVYAf_WYUTE
Host: localhost:8999
response example (failure)
HTTP/1.1 400 Bad Request
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 171

{
  "status" : "BAD_REQUEST",
  "message" : "Resource validation failed",
  "debugMessage" : "Unable to start engine, please stop it properly.  Current state is RUNNING"
}

Topics

This REST endpoint provides functionality for Create (once) and Read operations on topics resource.

Create: POST /api/topics

Create topics. Since the topics are created only once, this endpoint is provided as a convenience more than a necessity. It is best to consult your Kafka Administrator prior to creating these topics for optimal partition and replication counts.

Table 15. request headers
Name Description

Authorization

Contains Bearer access token.

Table 16. request fields
Path Type Description

[].name

String

Topic name

[].numberOfPartitions

Number

Number of partitions for the topic. This can not be changed after creation.

[].replicationFactor

Number

Number of data replicas for this topic

[].compact

Boolean

true if this topic has log compaction enabled, false otherwise

Table 17. response fields
Path Type Description

[].result

String

success or failure

[].name

String

Topic name

[].message

String

Error message

request example (success)
POST /api/topics HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvYXBpL2xvZ2luIiwiZXhwIjoxNjQ3ODkxNTcyfQ.n_ML9TDv6ggpDELJreQmiMMzgzyqHtcIMyc-GqCcOTo
Content-Length: 156
Host: localhost:8080

[
    {
        "name": "padas_nodes",
        "numberOfPartitions": 1,
        "replicationFactor": 1,
        "compact": true
    },
    {
        "name": "padas_rules",
        "numberOfPartitions": 1,
        "replicationFactor": 1,
        "compact": true
    },
    {
        "name": "padas_tasks",
        "numberOfPartitions": 2,
        "replicationFactor": 1,
        "compact": true
    },
    {
        "name": "padas_pipelines",
        "numberOfPartitions": 1,
        "replicationFactor": 1,
        "compact": true
    },
    {
        "name": "padas_topologies",
        "numberOfPartitions": 1,
        "replicationFactor": 1,
        "compact": true
    }
]
response example (success)
HTTP/1.1 201 Created
Location: http://localhost:8080/api/topics
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

[
    {
        "result": "success",
        "name": "padas_nodes"
    },
    {
        "result": "success",
        "name": "padas_rules"
    },
    {
        "result": "success",
        "name": "padas_tasks"
    },
    {
        "result": "success",
        "name": "padas_pipelines"
    },
    {
        "result": "failure",
        "message": "org.apache.kafka.common.errors.TopicExistsException: Topic 'padas_topologies' already exists."
    }
]

Read ALL: GET /api/topics

Read all topics.

Table 18. request headers
Name Description

Authorization

Contains Bearer access token.

Table 19. response fields
Path Type Description

[].name

String

Topic name

[].numberOfPartitions

Number

Number of partitions for the topic. This can not be changed after creation.

[].replicationFactor

Number

Number of data replicas for this topic

[].compact

Boolean

true if this topic has log compaction enabled, false otherwise

request example (success)
GET /api/topics HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvYXBpL2xvZ2luIiwiZXhwIjoxNjQ3ODkxNTcyfQ.n_ML9TDv6ggpDELJreQmiMMzgzyqHtcIMyc-GqCcOTo
Host: localhost:8080
response example (success)
HTTP/1.1 200 OK
Location: http://localhost:8080/api/topics
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

[
    {
        "name": "padas_rules",
        "numberOfPartitions": 1,
        "replicationFactor": 1,
        "compact": true
    },
    {
        "name": "padas_nodes",
        "numberOfPartitions": 1,
        "replicationFactor": 1,
        "compact": true
    },
    {
        "name": "padas_tasks",
        "numberOfPartitions": 2,
        "replicationFactor": 1,
        "compact": true
    },
    {
        "name": "padas_pipelines",
        "numberOfPartitions": 1,
        "replicationFactor": 1,
        "compact": true
    },
    {
        "name": "padas_topologies",
        "numberOfPartitions": 1,
        "replicationFactor": 1,
        "compact": true
    }
]

List ALL: GET /api/topics/list

Read all available topics from the Kafka cluster.

Table 20. request headers
Name Description

Authorization

Contains Bearer access token.

request example (success)
GET /api/topics/list HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvYXBpL2xvZ2luIiwiZXhwIjoxNjQ3ODkxNTcyfQ.n_ML9TDv6ggpDELJreQmiMMzgzyqHtcIMyc-GqCcOTo
Host: localhost:8080
response example (success)
HTTP/1.1 200 OK
Location: http://localhost:8080/api/topics/list
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

["topic1","topic2","topic3"]

Users

This REST endpoint provides functionality for CRUD (Create, Read, Update, and Delete) operations on users resource.

Create: POST /api/users

Create a new user.

Table 21. request headers
Name Description

Authorization

Contains Bearer access token.

Table 22. request fields
Path Type Description

name

String

Display name for user

username

String

Unique user name

email

String

Email address associated with this user

password

String

Password for this user

roles

Array

An array of roles

roles.[].name

String

Name of the role.

Table 23. response fields
Path Type Description

name

String

Display name for user

username

String

Unique user name

email

String

Email address associated with this user

roles

Array

An array of roles

roles.[].id

Number

Id for role

roles.[].name

String

Name of the role.

request example (success)
POST /api/users HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTcxM30.4a-W4-LScm8pw-3QbVGs_lg_IH4HomGnxtuFEsGhc5g
Content-Length: 156
Host: localhost:8999

{
  "name" : "New User",
  "username" : "newuser",
  "email" : "newuser@padas.io",
  "password" : "password123",
  "roles" : [ {
    "name" : "user"
  } ]
}
response example (success)
HTTP/1.1 201 Created
Location: https://localhost:8999/api/users
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 141

{
  "name" : "New User",
  "username" : "newuser",
  "email" : "newuser@padas.io",
  "roles" : [ {
    "id" : 20,
    "name" : "user"
  } ]
}
request example (failure)
POST /api/users HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTcxM30.4a-W4-LScm8pw-3QbVGs_lg_IH4HomGnxtuFEsGhc5g
Content-Length: 156
Host: localhost:8999

{
  "name" : "New User",
  "username" : "newuser",
  "email" : "newuser@padas.io",
  "password" : "password123",
  "roles" : [ {
    "name" : "user"
  } ]
}
response example (failure)
HTTP/1.1 409 Conflict
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 172

{
  "status" : "CONFLICT",
  "message" : "Resource already exists",
  "debugMessage" : "User already exists, can not create a new one.  Please use update (PUT) endpoint."
}

Read ALL: GET /api/users

Read all users.

Table 24. request headers
Name Description

Authorization

Contains Bearer access token.

Table 25. response fields
Path Type Description

[]

Array

An array of users

[].name

String

Display name for user

[].username

String

Unique user name

[].email

String

Email address associated with this user

[].roles

Array

An array of roles

[].roles.[].id

Number

Id for role

[].roles.[].name

String

Name of the role.

request example (success)
GET /api/users HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTcxM30.4a-W4-LScm8pw-3QbVGs_lg_IH4HomGnxtuFEsGhc5g
Host: localhost:8999
response example (success)
HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 151

[ {
  "name" : "Test Admin",
  "username" : "testadmin",
  "email" : "testadmin@padas.io",
  "roles" : [ {
    "id" : 2,
    "name" : "admin"
  } ]
} ]

Read: GET /api/users/{username}

Read one user information.

Table 26. request headers
Name Description

Authorization

Contains Bearer access token.

Table 27. /api/users/{username}
Parameter Description

username

Username to fetch

Table 28. response fields
Path Type Description

name

String

Display name for user

username

String

Unique user name

email

String

Email address associated with this user

roles

Array

An array of roles

roles.[].id

Number

Id for role

roles.[].name

String

Name of the role.

request example (success)
GET /api/users/testadmin HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTcxM30.4a-W4-LScm8pw-3QbVGs_lg_IH4HomGnxtuFEsGhc5g
Host: localhost:8999
response example (success)
HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 147

{
  "name" : "Test Admin",
  "username" : "testadmin",
  "email" : "testadmin@padas.io",
  "roles" : [ {
    "id" : 2,
    "name" : "admin"
  } ]
}
request example (failure)
GET /api/users/nosuchuserxxx HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTcxM30.4a-W4-LScm8pw-3QbVGs_lg_IH4HomGnxtuFEsGhc5g
Host: localhost:8999
response example (failure)
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 119

{
  "status" : "NOT_FOUND",
  "message" : "Resource not found",
  "debugMessage" : "Provided username does not exist"
}

Update: PUT /api/users/{username}

Update a specific user.

Table 29. request headers
Name Description

Authorization

Contains Bearer access token.

Table 30. /api/users/{username}
Parameter Description

username

Username to udpate

Table 31. request fields
Path Type Description

name

String

Display name for user

username

String

Unique user name

email

String

Email address associated with this user

password

String

Password for this user, can be left empty to skip update

roles

Array

An array of roles

roles.[].name

String

Name of the role.

Table 32. response fields
Path Type Description

name

String

Display name for user

username

String

Unique user name

email

String

Email address associated with this user

roles

Array

An array of roles

roles.[].id

Number

Id for role

roles.[].name

String

Name of the role.

request example (success)
PUT /api/users/newuser HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTcxM30.4a-W4-LScm8pw-3QbVGs_lg_IH4HomGnxtuFEsGhc5g
Content-Length: 157
Host: localhost:8999

{
  "name" : "New User2",
  "username" : "newuser",
  "email" : "newuser@padas.io",
  "password" : "password123",
  "roles" : [ {
    "name" : "user"
  } ]
}
response example (success)
HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 142

{
  "name" : "New User2",
  "username" : "newuser",
  "email" : "newuser@padas.io",
  "roles" : [ {
    "id" : 23,
    "name" : "user"
  } ]
}
request example (failure)
PUT /api/users/newuser HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTcxM30.4a-W4-LScm8pw-3QbVGs_lg_IH4HomGnxtuFEsGhc5g
Content-Length: 157
Host: localhost:8999

{
  "name" : "New User2",
  "username" : "newuser",
  "email" : "newuser@padas.io",
  "password" : "password123",
  "roles" : [ {
    "name" : "user"
  } ]
}
response example (failure)
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 119

{
  "status" : "NOT_FOUND",
  "message" : "Resource not found",
  "debugMessage" : "Provided username does not exist"
}

Delete: DELETE /api/users/{username}

Delete a specific user.

Table 33. /api/users/{username}
Parameter Description

username

Username to delete

request example (success)
DELETE /api/users/newuser HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTcxM30.4a-W4-LScm8pw-3QbVGs_lg_IH4HomGnxtuFEsGhc5g
Host: localhost:8999
response example (success)
HTTP/1.1 204 No Content
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
request example (failure)
DELETE /api/users/testadmin HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTcxM30.4a-W4-LScm8pw-3QbVGs_lg_IH4HomGnxtuFEsGhc5g
Host: localhost:8999
response example (failure)
HTTP/1.1 400 Bad Request
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 148

{
  "status" : "BAD_REQUEST",
  "message" : "Resource validation failed",
  "debugMessage" : "Authenticated user is not allowed to delete herself"
}

Nodes

This REST endpoint provides functionality for Read and Delete operations on nodes resource.

Read ALL: GET /api/nodes

Read all nodes.

Table 34. request headers
Name Description

Authorization

Contains Bearer access token.

Table 35. response fields
Path Type Description

[]

Array

An array of nodes

[].uuid

String

UUID of registered Padas Engine node

[].host

String

Hostname of the node

[].rest

String

REST URL for the node

[].group

String

Group name for this node in order to distribute certain topologies

request example (success)
GET /api/nodes HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTU4M30.UOdVMsvM2kA8u599sjrabb7F44JS03Gosriv6K8hHKY
Host: localhost:8999
response example (success)
HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 1477

[ {
  "uuid" : "06932443-fb2a-4b48-a171-11337a349a81",
  "host" : "myhost",
  "rest" : "https://myhost:8999",
  "group" : "default"
}, {
  "uuid" : "0f28fee3-1c1b-4c11-ac83-e706f56ef8d6",
  "host" : "myhost",
  "rest" : "https://myhost:8999",
  "group" : "default"
}, {
  "uuid" : "2932dbd1-3ab9-423a-abce-92885e423554",
  "host" : "myhost",
  "rest" : "https://myhost:8999",
  "group" : "default"
}, {
  "uuid" : "4b69ef65-a568-4b6e-963f-b8b8da40e7cb",
  "host" : "myhost",
  "rest" : "https://myhost:8999",
  "group" : "default"
}, {
  "uuid" : "53d8e219-70a2-4c30-b420-1d65753704c6",
  "host" : "myhost",
  "rest" : "https://myhost:8999",
  "group" : "default"
}, {
  "uuid" : "544433ae-f0a2-4edb-a0be-0df083e72a38",
  "host" : "seynur.local",
  "rest" : "https://seynur.local:8999",
  "group" : "default"
}, {
  "uuid" : "6a754496-9e88-4c76-88ab-017bf0961b10",
  "host" : "myhost",
  "rest" : "https://myhost:8999",
  "group" : "default"
}, {
  "uuid" : "6e496086-dd79-47ec-b5f5-952b7bf77798",
  "host" : "myhost",
  "rest" : "https://myhost:8999",
  "group" : "default"
}, {
  "uuid" : "a074cc97-ef4f-49cf-ab29-b825f5b043ac",
  "host" : "myhost",
  "rest" : "https://myhost:8999",
  "group" : "default"
}, {
  "uuid" : "bf93c3aa-503c-449b-8e19-ab5a2e8921a6",
  "host" : "myhost",
  "rest" : "https://myhost:8999",
  "group" : "default"
}, {
  "uuid" : "c7fc00b9-2308-4b0c-9ac6-f07d6839d11f",
  "host" : "myhost",
  "rest" : "https://myhost:8999",
  "group" : "default"
} ]

Read: GET /api/nodes/{id}

Read one user information.

Table 36. request headers
Name Description

Authorization

Contains Bearer access token.

Table 37. /api/nodes/{id}
Parameter Description

id

UUID of the node to fetch

Table 38. response fields
Path Type Description

uuid

String

UUID of registered Padas Engine node

host

String

Hostname of the node

rest

String

REST URL for the node

group

String

Group name for this node in order to distribute certain topologies

request example (success)
GET /api/nodes/544433ae-f0a2-4edb-a0be-0df083e72a38 HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTU4M30.UOdVMsvM2kA8u599sjrabb7F44JS03Gosriv6K8hHKY
Host: localhost:8999
response example (success)
HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 143

{
  "uuid" : "544433ae-f0a2-4edb-a0be-0df083e72a38",
  "host" : "seynur.local",
  "rest" : "https://seynur.local:8999",
  "group" : "default"
}
request example (failure)
GET /api/nodes/d891784c-76e3-4335-af9b-cd6c09aae85e HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTU4M30.UOdVMsvM2kA8u599sjrabb7F44JS03Gosriv6K8hHKY
Host: localhost:8999
response example (failure)
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 116

{
  "status" : "NOT_FOUND",
  "message" : "Resource not found",
  "debugMessage" : "Requested node does not exist"
}

Delete: DELETE /api/nodes/{id}

Delete a specific node. The ID must match the UUID of the node that is receiving the request.

Table 39. /api/nodes/{id}
Parameter Description

id

UUID of the node to fetch

request example (success)
DELETE /api/nodes/544433ae-f0a2-4edb-a0be-0df083e72a38 HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTU4M30.UOdVMsvM2kA8u599sjrabb7F44JS03Gosriv6K8hHKY
Host: localhost:8999
response example (success)
HTTP/1.1 204 No Content
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
request example (failure)
DELETE /api/nodes/544433ae-f0a2-4edb-a0be-0df083e72a38 HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTU4M30.UOdVMsvM2kA8u599sjrabb7F44JS03Gosriv6K8hHKY
Host: localhost:8999
response example (failure)
HTTP/1.1 400 Bad Request
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 183

{
  "status" : "BAD_REQUEST",
  "message" : "Resource validation failed",
  "debugMessage" : "Unable to remove node.  In order to remove properly the node state must be NOT_RUNNING"
}

Tasks

This REST endpoint provides functionality for CRUD (Create, Read, Update, and Delete) operations on tasks resource.

Create: POST /api/tasks

Create a new task.

Table 40. request headers
Name Description

Authorization

Contains Bearer access token.

Table 41. request fields
Path Type Description

id

Number

ID for this task

name

String

Unique task name

description

String

Description of this task

function

String

Predefined functionality for the task, refer to schema definition

definition

Object

JSON object representing function parameters

Table 42. response fields
Path Type Description

id

Number

ID for this task

name

String

Unique task name

description

String

Description of this task

function

String

Predefined functionality for the task, refer to schema definition

definition

Object

JSON object representing function parameters

request example (success)
POST /api/tasks HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY2NX0.38l1UT1vgtZygZn5xWSvDVdNJMokEAnlwOWP8yWLVAo
Content-Length: 200
Host: localhost:8999

{
  "id" : 100,
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "function" : "TIMESTAMP",
  "definition" : {
    "field" : "somefield",
    "format" : "%H%M%S"
  }
}
response example (success)
HTTP/1.1 201 Created
Location: https://localhost:8999/api/tasks
Content-Type: application/json
Content-Length: 200
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY

{
  "id" : 100,
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "function" : "TIMESTAMP",
  "definition" : {
    "field" : "somefield",
    "format" : "%H%M%S"
  }
}
request example (failure)
POST /api/tasks HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY2NX0.38l1UT1vgtZygZn5xWSvDVdNJMokEAnlwOWP8yWLVAo
Content-Length: 200
Host: localhost:8999

{
  "id" : 100,
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "function" : "TIMESTAMP",
  "definition" : {
    "field" : "somefield",
    "format" : "%H%M%S"
  }
}
response example (failure)
HTTP/1.1 409 Conflict
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 172

{
  "status" : "CONFLICT",
  "message" : "Resource already exists",
  "debugMessage" : "Task already exists, can not create a new one.  Please use update (PUT) endpoint."
}

Read ALL: GET /api/tasks

Read all tasks.

Table 43. request headers
Name Description

Authorization

Contains Bearer access token.

Table 44. response fields
Path Type Description

[].id

Number

ID for this task

[].name

String

Unique task name

[].description

String

Description of this task

[].function

String

Predefined functionality for the task, refer to schema definition

[].definition

Object

JSON object representing function parameters

request example (success)
GET /api/tasks HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY2NX0.38l1UT1vgtZygZn5xWSvDVdNJMokEAnlwOWP8yWLVAo
Host: localhost:8999
response example (success)
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 945
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY

[ {
  "id" : 100,
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "function" : "TIMESTAMP",
  "definition" : {
    "field" : "somefield",
    "format" : "%H%M%S"
  }
}, {
  "id" : 102,
  "name" : "MyTest name3",
  "description" : "MyTest description text goes here",
  "function" : "FILTER",
  "definition" : {
    "type" : "regex",
    "value" : "dest",
    "action" : "keep"
  }
}, {
  "id" : 103,
  "name" : "transform:endpoint:process exec name",
  "description" : "Rename extracted process and parent process exec fields for EndpointProcess",
  "function" : "EVAL",
  "definition" : {
    "eval" : [ {
      "condition" : "ProcessExec=\"*\"",
      "action" : "rename",
      "field" : "ProcessExec",
      "value" : "process_exec"
    }, {
      "condition" : "ParentProcessExec=\"*\"",
      "action" : "rename",
      "field" : "ParentProcessExec",
      "value" : "parent_process_exec"
    } ]
  }
} ]

Read: GET /api/tasks/{id}

Read one task information.

Table 45. request headers
Name Description

Authorization

Contains Bearer access token.

Table 46. /api/tasks/{id}
Parameter Description

id

ID of the task to fetch

Table 47. response fields
Path Type Description

id

Number

ID for this task

name

String

Unique task name

description

String

Description of this task

function

String

Predefined functionality for the task, refer to schema definition

definition

Object

JSON object representing function parameters

request example (success)
GET /api/tasks/100 HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY2NX0.38l1UT1vgtZygZn5xWSvDVdNJMokEAnlwOWP8yWLVAo
Host: localhost:8999
response example (success)
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 200
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY

{
  "id" : 100,
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "function" : "TIMESTAMP",
  "definition" : {
    "field" : "somefield",
    "format" : "%H%M%S"
  }
}
request example (failure)
GET /api/tasks/109 HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY2NX0.38l1UT1vgtZygZn5xWSvDVdNJMokEAnlwOWP8yWLVAo
Host: localhost:8999
response example (failure)
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 116

{
  "status" : "NOT_FOUND",
  "message" : "Resource not found",
  "debugMessage" : "Requested task does not exist"
}

Update: PUT /api/tasks/{id}

Update a specific task.

Table 48. request headers
Name Description

Authorization

Contains Bearer access token.

path parameters

Unresolved directive in src/main/asciidoc/_includes/tasks.adoc - include::/Users/selim/dev/padas/padas-engine/app/build/snippets/api-tasks-id-put-success/path-parameters.adoc[]

Table 49. request fields
Path Type Description

id

Number

ID for this task

name

String

Unique task name

description

String

Description of this task

function

String

Predefined functionality for the task, refer to schema definition

definition

Object

JSON object representing function parameters

Table 50. response fields
Path Type Description

id

Number

ID for this task

name

String

Unique task name

description

String

Description of this task

function

String

Predefined functionality for the task, refer to schema definition

definition

Object

JSON object representing function parameters

request example (success)
PUT /api/tasks/100 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY2NX0.38l1UT1vgtZygZn5xWSvDVdNJMokEAnlwOWP8yWLVAo
Content-Length: 207
Host: localhost:8999

{
  "id" : 100,
  "name" : "MyUpdatedTest name",
  "description" : "MyTest description text goes here",
  "function" : "TIMESTAMP",
  "definition" : {
    "field" : "somefield",
    "format" : "%H%M%S"
  }
}
response example (success)
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 207
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY

{
  "id" : 100,
  "name" : "MyUpdatedTest name",
  "description" : "MyTest description text goes here",
  "function" : "TIMESTAMP",
  "definition" : {
    "field" : "somefield",
    "format" : "%H%M%S"
  }
}
request example (failure)
PUT /api/tasks/109 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY2NX0.38l1UT1vgtZygZn5xWSvDVdNJMokEAnlwOWP8yWLVAo
Content-Length: 200
Host: localhost:8999

{
  "id" : 109,
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "function" : "TIMESTAMP",
  "definition" : {
    "field" : "somefield",
    "format" : "%H%M%S"
  }
}
response example (failure)
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 152

{
  "status" : "NOT_FOUND",
  "message" : "Resource not found",
  "debugMessage" : "Task to update does not exist. Please use create (POST) endpoint."
}

Delete: DELETE /api/tasks/{id}

Delete a specific task.

Table 51. /api/tasks/{id}
Parameter Description

id

ID of the task to fetch

request example (success)
DELETE /api/tasks/100 HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY2NX0.38l1UT1vgtZygZn5xWSvDVdNJMokEAnlwOWP8yWLVAo
Host: localhost:8999
response example (success)
HTTP/1.1 204 No Content
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
request example (failure)
DELETE /api/tasks/109 HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY2NX0.38l1UT1vgtZygZn5xWSvDVdNJMokEAnlwOWP8yWLVAo
Host: localhost:8999
response example (failure)
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 117

{
  "status" : "NOT_FOUND",
  "message" : "Resource not found",
  "debugMessage" : "Task to delete does not exist."
}

Bulk Update/Create: POST /api/bulk/tasks

Bulk update/create a list of tasks.

Table 52. request headers
Name Description

Authorization

Contains Bearer access token.

Table 53. request fields
Path Type Description

[].id

Number

ID for this task

[].name

String

Unique task name

[].description

String

Description of this task

[].function

String

Predefined functionality for the task, refer to schema definition

[].definition

Object

JSON object representing function parameters

Table 54. response fields
Path Type Description

[].id

Number

ID for this task

[].name

String

Unique task name

[].description

String

Description of this task

[].function

String

Predefined functionality for the task, refer to schema definition

[].definition

Object

JSON object representing function parameters

request example (success)
POST /api/bulk/tasks HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY2NX0.38l1UT1vgtZygZn5xWSvDVdNJMokEAnlwOWP8yWLVAo
Content-Length: 353
Host: localhost:8999

[ {
  "id" : 100,
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "function" : "TIMESTAMP",
  "definition" : {
    "field" : "somefield",
    "format" : "%H%M%S"
  }
}, {
  "id" : 101,
  "name" : "MyTest name2",
  "description" : "MyTest description text goes here",
  "function" : "PARSE_KV",
  "definition" : { }
} ]
response example (success)
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1094
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY

[ {
  "id" : 100,
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "function" : "TIMESTAMP",
  "definition" : {
    "field" : "somefield",
    "format" : "%H%M%S"
  }
}, {
  "id" : 101,
  "name" : "MyTest name2",
  "description" : "MyTest description text goes here",
  "function" : "PARSE_KV",
  "definition" : { }
}, {
  "id" : 102,
  "name" : "MyTest name3",
  "description" : "MyTest description text goes here",
  "function" : "FILTER",
  "definition" : {
    "type" : "regex",
    "value" : "dest",
    "action" : "keep"
  }
}, {
  "id" : 103,
  "name" : "transform:endpoint:process exec name",
  "description" : "Rename extracted process and parent process exec fields for EndpointProcess",
  "function" : "EVAL",
  "definition" : {
    "eval" : [ {
      "condition" : "ProcessExec=\"*\"",
      "action" : "rename",
      "field" : "ProcessExec",
      "value" : "process_exec"
    }, {
      "condition" : "ParentProcessExec=\"*\"",
      "action" : "rename",
      "field" : "ParentProcessExec",
      "value" : "parent_process_exec"
    } ]
  }
} ]
request example (failure)
POST /api/bulk/tasks HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY2NX0.38l1UT1vgtZygZn5xWSvDVdNJMokEAnlwOWP8yWLVAo
Content-Length: 412
Host: localhost:8999

[ {
  "id" : 100,
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "function" : "TIMESTAMP",
  "definition" : {
    "field" : "somefield",
    "format" : "%H%M%S"
  }
}, {
  "id" : 101,
  "name" : "MyTest name2",
  "description" : "MyTest description text goes here",
  "function" : "PARSE_KV",
  "definition" : { }
}, {
  "someInvalidSchema" : "field value",
  "someId" : 4
} ]
response example (failure)
HTTP/1.1 400 Bad Request
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 146

{
  "status" : "BAD_REQUEST",
  "message" : "Resource validation failed",
  "debugMessage" : "Unable to bulk update tasks due to invalid input."
}

Pipelines

This REST endpoint provides functionality for CRUD (Create, Read, Update, and Delete) operations on pipelines resource.

Create: POST /api/pipelines

Create a new pipeline.

Table 55. request headers
Name Description

Authorization

Contains Bearer access token.

Table 56. request fields
Path Type Description

id

Number

ID for this pipeline

name

String

Unique pipeline name

description

String

Description of this pipeline

tasks

Array

An array of ordered Task IDs

Table 57. response fields
Path Type Description

id

Number

ID for this pipeline

name

String

Unique pipeline name

description

String

Description of this pipeline

tasks

Array

An array of ordered Task IDs

request example (success)
POST /api/pipelines HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY0MH0.O0WJdVpsi-WyqskKJ-RPVfbFNQv3R41EtFYehd_ls4k
Content-Length: 120
Host: localhost:8999

{
  "id" : 1,
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "tasks" : [ 1, 3, 5 ]
}
response example (success)
HTTP/1.1 201 Created
Location: https://localhost:8999/api/pipelines
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 120

{
  "id" : 1,
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "tasks" : [ 1, 3, 5 ]
}
request example (failure)
POST /api/pipelines HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY0MH0.O0WJdVpsi-WyqskKJ-RPVfbFNQv3R41EtFYehd_ls4k
Content-Length: 120
Host: localhost:8999

{
  "id" : 1,
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "tasks" : [ 1, 3, 5 ]
}
response example (failure)
HTTP/1.1 409 Conflict
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 176

{
  "status" : "CONFLICT",
  "message" : "Resource already exists",
  "debugMessage" : "Pipeline already exists, can not create a new one.  Please use update (PUT) endpoint."
}

Read ALL: GET /api/pipelines

Read all pipelines.

Table 58. request headers
Name Description

Authorization

Contains Bearer access token.

Table 59. response fields
Path Type Description

[].id

Number

ID for this pipeline

[].name

String

Unique pipeline name

[].description

String

Description of this pipeline

[].tasks

Array

An array of ordered Task IDs

request example (success)
GET /api/pipelines HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY0MH0.O0WJdVpsi-WyqskKJ-RPVfbFNQv3R41EtFYehd_ls4k
Host: localhost:8999
response example (success)
HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 249

[ {
  "id" : 1,
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "tasks" : [ 1, 3, 5 ]
}, {
  "id" : 100,
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "tasks" : [ 101, 100 ]
} ]

Read: GET /api/pipelines/{id}

Read one pipeline information.

Table 60. request headers
Name Description

Authorization

Contains Bearer access token.

Table 61. /api/pipelines/{id}
Parameter Description

id

ID of the pipeline to fetch

Table 62. response fields
Path Type Description

id

Number

ID for this pipeline

name

String

Unique pipeline name

description

String

Description of this pipeline

tasks

Array

An array of ordered Task IDs

request example (success)
GET /api/pipelines/1 HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY0MH0.O0WJdVpsi-WyqskKJ-RPVfbFNQv3R41EtFYehd_ls4k
Host: localhost:8999
response example (success)
HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 120

{
  "id" : 1,
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "tasks" : [ 1, 3, 5 ]
}
request example (failure)
GET /api/pipelines/109 HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY0MH0.O0WJdVpsi-WyqskKJ-RPVfbFNQv3R41EtFYehd_ls4k
Host: localhost:8999
response example (failure)
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 120

{
  "status" : "NOT_FOUND",
  "message" : "Resource not found",
  "debugMessage" : "Requested pipeline does not exist"
}

Update: PUT /api/pipelines/{id}

Update a specific pipeline.

Table 63. request headers
Name Description

Authorization

Contains Bearer access token.

path parameters

Unresolved directive in src/main/asciidoc/_includes/pipelines.adoc - include::/Users/selim/dev/padas/padas-engine/app/build/snippets/api-pipelines-id-put-success/path-parameters.adoc[]

Table 64. request fields
Path Type Description

id

Number

ID for this pipeline

name

String

Unique pipeline name

description

String

Description of this pipeline

tasks

Array

An array of ordered Task IDs

Table 65. response fields
Path Type Description

id

Number

ID for this pipeline

name

String

Unique pipeline name

description

String

Description of this pipeline

tasks

Array

An array of ordered Task IDs

request example (success)
PUT /api/pipelines/1 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY0MH0.O0WJdVpsi-WyqskKJ-RPVfbFNQv3R41EtFYehd_ls4k
Content-Length: 127
Host: localhost:8999

{
  "id" : 1,
  "name" : "MyUpdatedTest name",
  "description" : "MyTest description text goes here",
  "tasks" : [ 1, 3, 5 ]
}
response example (success)
HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 127

{
  "id" : 1,
  "name" : "MyUpdatedTest name",
  "description" : "MyTest description text goes here",
  "tasks" : [ 1, 3, 5 ]
}
request example (failure)
PUT /api/pipelines/109 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY0MH0.O0WJdVpsi-WyqskKJ-RPVfbFNQv3R41EtFYehd_ls4k
Content-Length: 122
Host: localhost:8999

{
  "id" : 109,
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "tasks" : [ 1, 3, 5 ]
}
response example (failure)
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 156

{
  "status" : "NOT_FOUND",
  "message" : "Resource not found",
  "debugMessage" : "Pipeline to update does not exist. Please use create (POST) endpoint."
}

Delete: DELETE /api/pipelines/{id}

Delete a specific pipeline.

Table 66. /api/pipelines/{id}
Parameter Description

id

ID of the pipeline to fetch

request example (success)
DELETE /api/pipelines/1 HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY0MH0.O0WJdVpsi-WyqskKJ-RPVfbFNQv3R41EtFYehd_ls4k
Host: localhost:8999
response example (success)
HTTP/1.1 204 No Content
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
request example (failure)
DELETE /api/pipelines/109 HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY0MH0.O0WJdVpsi-WyqskKJ-RPVfbFNQv3R41EtFYehd_ls4k
Host: localhost:8999
response example (failure)
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 121

{
  "status" : "NOT_FOUND",
  "message" : "Resource not found",
  "debugMessage" : "Pipeline to delete does not exist."
}

Bulk Update/Create: POST /api/bulk/pipelines

Bulk update/create a list of pipelines.

Table 67. request headers
Name Description

Authorization

Contains Bearer access token.

Table 68. request fields
Path Type Description

[].id

Number

ID for this pipeline

[].name

String

Unique pipeline name

[].description

String

Description of this pipeline

[].tasks

Array

An array of ordered Task IDs

Table 69. response fields
Path Type Description

[].id

Number

ID for this pipeline

[].name

String

Unique pipeline name

[].description

String

Description of this pipeline

[].tasks

Array

An array of ordered Task IDs

request example (success)
POST /api/bulk/pipelines HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY0MH0.O0WJdVpsi-WyqskKJ-RPVfbFNQv3R41EtFYehd_ls4k
Content-Length: 245
Host: localhost:8999

[ {
  "id" : 1,
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "tasks" : [ 1, 3, 5 ]
}, {
  "id" : 2,
  "name" : "MyTest name2",
  "description" : "MyTest description text goes here2",
  "tasks" : [ 1, 5 ]
} ]
response example (success)
HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 249

[ {
  "id" : 1,
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "tasks" : [ 1, 3, 5 ]
}, {
  "id" : 100,
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "tasks" : [ 101, 100 ]
} ]
request example (failure)
POST /api/bulk/pipelines HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY0MH0.O0WJdVpsi-WyqskKJ-RPVfbFNQv3R41EtFYehd_ls4k
Content-Length: 304
Host: localhost:8999

[ {
  "id" : 1,
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "tasks" : [ 1, 3, 5 ]
}, {
  "id" : 2,
  "name" : "MyTest name2",
  "description" : "MyTest description text goes here2",
  "tasks" : [ 1, 5 ]
}, {
  "someInvalidSchema" : "field value",
  "someId" : 4
} ]
response example (failure)
HTTP/1.1 400 Bad Request
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 150

{
  "status" : "BAD_REQUEST",
  "message" : "Resource validation failed",
  "debugMessage" : "Unable to bulk update pipelines due to invalid input."
}

Topologies

This REST endpoint provides functionality for CRUD (Create, Read, Update, and Delete) operations on topologies resource.

Create: POST /api/topologies

Create a new topology.

Table 70. request headers
Name Description

Authorization

Contains Bearer access token.

Table 71. request fields
Path Type Description

id

Number

ID for this topology

name

String

Unique topology name

description

String

Description of this topology

pipelines

Array

An array of ordered Pipeline IDs

enabled

Boolean

Determines whether this topology is enabled or not, default is true

group

String

Group determines the instances where this topology should run, default is “default”

input

String

Input topic name for this topology

output

Array

An array of output topics where results will be sent

Table 72. response fields
Path Type Description

id

Number

ID for this topology

name

String

Unique topology name

description

String

Description of this topology

pipelines

Array

An array of ordered Pipeline IDs

enabled

Boolean

Determines whether this topology is enabled or not, default is true

group

String

Group determines the instances where this topology should run, default is “default”

input

String

Input topic name for this topology

output

Array

An array of output topics where results will be sent

request example (success)
POST /api/topologies HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTcwMn0.EUePuSw0V3-6dStW-K23ValhfpTTQkHlIUMKntw86s4
Content-Length: 225
Host: localhost:8999

{
  "id" : 1,
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "pipelines" : [ 1, 3, 5 ],
  "enabled" : true,
  "group" : "default",
  "input" : "test_input",
  "output" : [ "test_output" ]
}
response example (success)
HTTP/1.1 201 Created
Location: https://localhost:8999/api/topologies
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 225

{
  "id" : 1,
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "pipelines" : [ 1, 3, 5 ],
  "enabled" : true,
  "group" : "default",
  "input" : "test_input",
  "output" : [ "test_output" ]
}
request example (failure)
POST /api/topologies HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTcwMn0.EUePuSw0V3-6dStW-K23ValhfpTTQkHlIUMKntw86s4
Content-Length: 225
Host: localhost:8999

{
  "id" : 1,
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "pipelines" : [ 1, 3, 5 ],
  "enabled" : true,
  "group" : "default",
  "input" : "test_input",
  "output" : [ "test_output" ]
}
response example (failure)
HTTP/1.1 409 Conflict
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 176

{
  "status" : "CONFLICT",
  "message" : "Resource already exists",
  "debugMessage" : "Topology already exists, can not create a new one.  Please use update (PUT) endpoint."
}

Read ALL: GET /api/topologies

Read all topologies.

Table 73. request headers
Name Description

Authorization

Contains Bearer access token.

Table 74. response fields
Path Type Description

[].id

Number

ID for this topology

[].name

String

Unique topology name

[].description

String

Description of this topology

[].pipelines

Array

An array of ordered Pipeline IDs

[].enabled

Boolean

Determines whether this topology is enabled or not, default is true

[].group

String

Group determines the instances where this topology should run, default is “default”

[].input

String

Input topic name for this topology

[].output

Array

An array of output topics where results will be sent

request example (success)
GET /api/topologies HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTcwMn0.EUePuSw0V3-6dStW-K23ValhfpTTQkHlIUMKntw86s4
Host: localhost:8999
response example (success)
HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 466

[ {
  "id" : 1,
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "pipelines" : [ 1, 3, 5 ],
  "enabled" : true,
  "group" : "default",
  "input" : "test_input",
  "output" : [ "test_output" ]
}, {
  "id" : 1099,
  "name" : "MyUpdatedTest name",
  "description" : "MyTest description text goes here",
  "pipelines" : [ 1, 3, 5 ],
  "enabled" : true,
  "group" : "default",
  "input" : "test_input",
  "output" : [ "test_output" ]
} ]

Read: GET /api/topologies/{id}

Read one topology information.

Table 75. request headers
Name Description

Authorization

Contains Bearer access token.

Table 76. /api/topologies/{id}
Parameter Description

id

ID of the topology to fetch

Table 77. response fields
Path Type Description

id

Number

ID for this topology

name

String

Unique topology name

description

String

Description of this topology

pipelines

Array

An array of ordered Pipeline IDs

enabled

Boolean

Determines whether this topology is enabled or not, default is true

group

String

Group determines the instances where this topology should run, default is “default”

input

String

Input topic name for this topology

output

Array

An array of output topics where results will be sent

request example (success)
GET /api/topologies/1 HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTcwMn0.EUePuSw0V3-6dStW-K23ValhfpTTQkHlIUMKntw86s4
Host: localhost:8999
response example (success)
HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 225

{
  "id" : 1,
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "pipelines" : [ 1, 3, 5 ],
  "enabled" : true,
  "group" : "default",
  "input" : "test_input",
  "output" : [ "test_output" ]
}
request example (failure)
GET /api/topologies/222 HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTcwMn0.EUePuSw0V3-6dStW-K23ValhfpTTQkHlIUMKntw86s4
Host: localhost:8999
response example (failure)
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 120

{
  "status" : "NOT_FOUND",
  "message" : "Resource not found",
  "debugMessage" : "Requested topology does not exist"
}

Update: PUT /api/topologies/{id}

Update a specific topology.

Table 78. request headers
Name Description

Authorization

Contains Bearer access token.

path parameters

Unresolved directive in src/main/asciidoc/_includes/topologies.adoc - include::/Users/selim/dev/padas/padas-engine/app/build/snippets/api-topologies-id-put-success/path-parameters.adoc[]

Table 79. request fields
Path Type Description

id

Number

ID for this topology

name

String

Unique topology name

description

String

Description of this topology

pipelines

Array

An array of ordered Pipeline IDs

enabled

Boolean

Determines whether this topology is enabled or not, default is true

group

String

Group determines the instances where this topology should run, default is “default”

input

String

Input topic name for this topology

output

Array

An array of output topics where results will be sent

Table 80. response fields
Path Type Description

id

Number

ID for this topology

name

String

Unique topology name

description

String

Description of this topology

pipelines

Array

An array of ordered Pipeline IDs

enabled

Boolean

Determines whether this topology is enabled or not, default is true

group

String

Group determines the instances where this topology should run, default is “default”

input

String

Input topic name for this topology

output

Array

An array of output topics where results will be sent

request example (success)
PUT /api/topologies/1 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTcwMn0.EUePuSw0V3-6dStW-K23ValhfpTTQkHlIUMKntw86s4
Content-Length: 232
Host: localhost:8999

{
  "id" : 1,
  "name" : "MyUpdatedTest name",
  "description" : "MyTest description text goes here",
  "pipelines" : [ 1, 3, 5 ],
  "enabled" : true,
  "group" : "default",
  "input" : "test_input",
  "output" : [ "test_output" ]
}
response example (success)
HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 232

{
  "id" : 1,
  "name" : "MyUpdatedTest name",
  "description" : "MyTest description text goes here",
  "pipelines" : [ 1, 3, 5 ],
  "enabled" : true,
  "group" : "default",
  "input" : "test_input",
  "output" : [ "test_output" ]
}
request example (failure)
PUT /api/topologies/222 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTcwMn0.EUePuSw0V3-6dStW-K23ValhfpTTQkHlIUMKntw86s4
Content-Length: 234
Host: localhost:8999

{
  "id" : 222,
  "name" : "MyUpdatedTest name",
  "description" : "MyTest description text goes here",
  "pipelines" : [ 1, 3, 5 ],
  "enabled" : true,
  "group" : "default",
  "input" : "test_input",
  "output" : [ "test_output" ]
}
response example (failure)
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 156

{
  "status" : "NOT_FOUND",
  "message" : "Resource not found",
  "debugMessage" : "Topology to update does not exist. Please use create (POST) endpoint."
}

Delete: DELETE /api/topologies/{id}

Delete a specific topology.

Table 81. /api/topologies/{id}
Parameter Description

id

ID of the topology to fetch

request example (success)
DELETE /api/topologies/1 HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTcwMn0.EUePuSw0V3-6dStW-K23ValhfpTTQkHlIUMKntw86s4
Host: localhost:8999
response example (success)
HTTP/1.1 204 No Content
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
request example (failure)
DELETE /api/topologies/222 HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTcwMn0.EUePuSw0V3-6dStW-K23ValhfpTTQkHlIUMKntw86s4
Host: localhost:8999
response example (failure)
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 121

{
  "status" : "NOT_FOUND",
  "message" : "Resource not found",
  "debugMessage" : "Topology to delete does not exist."
}

Bulk Update/Create: POST /api/bulk/topologies

Bulk update/create a list of topologies.

Table 82. request headers
Name Description

Authorization

Contains Bearer access token.

Table 83. request fields
Path Type Description

[].id

Number

ID for this topology

[].name

String

Unique topology name

[].description

String

Description of this topology

[].pipelines

Array

An array of ordered Pipeline IDs

[].enabled

Boolean

Determines whether this topology is enabled or not, default is true

[].group

String

Group determines the instances where this topology should run, default is “default”

[].input

String

Input topic name for this topology

[].output

Array

An array of output topics where results will be sent

Table 84. response fields
Path Type Description

[].id

Number

ID for this topology

[].name

String

Unique topology name

[].description

String

Description of this topology

[].pipelines

Array

An array of ordered Pipeline IDs

[].enabled

Boolean

Determines whether this topology is enabled or not, default is true

[].group

String

Group determines the instances where this topology should run, default is “default”

[].input

String

Input topic name for this topology

[].output

Array

An array of output topics where results will be sent

request example (success)
POST /api/bulk/topologies HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTcwMn0.EUePuSw0V3-6dStW-K23ValhfpTTQkHlIUMKntw86s4
Content-Length: 465
Host: localhost:8999

[ {
  "id" : 1,
  "name" : "MyUpdatedTest name",
  "description" : "MyTest description text goes here",
  "pipelines" : [ 1, 3, 5 ],
  "enabled" : true,
  "group" : "default",
  "input" : "test_input",
  "output" : [ "test_output" ]
}, {
  "id" : 2,
  "name" : "MyTest name2",
  "description" : "MyTest description text goes here2",
  "pipelines" : [ 1, 3, 5 ],
  "enabled" : true,
  "group" : "default",
  "input" : "test_input",
  "output" : [ "test_output" ]
} ]
response example (success)
HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 473

[ {
  "id" : 1,
  "name" : "MyUpdatedTest name",
  "description" : "MyTest description text goes here",
  "pipelines" : [ 1, 3, 5 ],
  "enabled" : true,
  "group" : "default",
  "input" : "test_input",
  "output" : [ "test_output" ]
}, {
  "id" : 1099,
  "name" : "MyUpdatedTest name",
  "description" : "MyTest description text goes here",
  "pipelines" : [ 1, 3, 5 ],
  "enabled" : true,
  "group" : "default",
  "input" : "test_input",
  "output" : [ "test_output" ]
} ]
request example (failure)
POST /api/bulk/topologies HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTcwMn0.EUePuSw0V3-6dStW-K23ValhfpTTQkHlIUMKntw86s4
Content-Length: 524
Host: localhost:8999

[ {
  "id" : 1,
  "name" : "MyUpdatedTest name",
  "description" : "MyTest description text goes here",
  "pipelines" : [ 1, 3, 5 ],
  "enabled" : true,
  "group" : "default",
  "input" : "test_input",
  "output" : [ "test_output" ]
}, {
  "id" : 2,
  "name" : "MyTest name2",
  "description" : "MyTest description text goes here2",
  "pipelines" : [ 1, 3, 5 ],
  "enabled" : true,
  "group" : "default",
  "input" : "test_input",
  "output" : [ "test_output" ]
}, {
  "someInvalidSchema" : "field value",
  "someId" : 4
} ]
response example (failure)
HTTP/1.1 400 Bad Request
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 151

{
  "status" : "BAD_REQUEST",
  "message" : "Resource validation failed",
  "debugMessage" : "Unable to bulk update topologies due to invalid input."
}

Rules

This REST endpoint provides functionality for CRUD (Create, Read, Update, and Delete) operations on rules resource.

Create: POST /api/rules

Create a new rule.

Table 85. request headers
Name Description

Authorization

Contains Bearer access token.

Table 86. request fields
Path Type Description

id

String

ID for this rule

name

String

Unique rule name

description

String

Description of this rule

datamodel

String

Datamodel where this rule will be applicable

pdl

String

PDL query to match against events according to the Datamodel

annotations

Array

An array of annotations regarding this rule, such as MITRE ATT&CK Technique IDs

enabled

Boolean

Determines whether this rule is active

Table 87. response fields
Path Type Description

id

String

ID for this rule

name

String

Unique rule name

description

String

Description of this rule

datamodel

String

Datamodel where this rule will be applicable

pdl

String

PDL query to match against events according to the Datamodel

annotations

Array

An array of annotations regarding this rule, such as MITRE ATT&CK Technique IDs

enabled

Boolean

Determines whether this rule is active

request example (success)
POST /api/rules HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY1MX0.ZMjIEu-aRnkXBQOphC6euBe10HQTMvTMh-vSF__SZj8
Content-Length: 239
Host: localhost:8999

{
  "id" : "100",
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "datamodel" : "endpoint",
  "pdl" : "src=mysource AND dest=some.dest.ip",
  "annotations" : [ "T1001", "T1059.001" ],
  "enabled" : true
}
response example (success)
HTTP/1.1 201 Created
Location: https://localhost:8999/api/rules
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 239

{
  "id" : "100",
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "datamodel" : "endpoint",
  "pdl" : "src=mysource AND dest=some.dest.ip",
  "annotations" : [ "T1001", "T1059.001" ],
  "enabled" : true
}
request example (failure)
POST /api/rules HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY1MX0.ZMjIEu-aRnkXBQOphC6euBe10HQTMvTMh-vSF__SZj8
Content-Length: 239
Host: localhost:8999

{
  "id" : "100",
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "datamodel" : "endpoint",
  "pdl" : "src=mysource AND dest=some.dest.ip",
  "annotations" : [ "T1001", "T1059.001" ],
  "enabled" : true
}
response example (failure)
HTTP/1.1 409 Conflict
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 172

{
  "status" : "CONFLICT",
  "message" : "Resource already exists",
  "debugMessage" : "Rule already exists, can not create a new one.  Please use update (PUT) endpoint."
}

Read ALL: GET /api/rules

Read all rules.

Table 88. request headers
Name Description

Authorization

Contains Bearer access token.

Table 89. response fields
Path Type Description

[].id

String

ID for this rule

[].name

String

Unique rule name

[].description

String

Description of this rule

[].datamodel

String

Datamodel where this rule will be applicable

[].pdl

String

PDL query to match against events according to the Datamodel

[].annotations

Array

An array of annotations regarding this rule, such as MITRE ATT&CK Technique IDs

[].enabled

Boolean

Determines whether this rule is active

request example (success)
GET /api/rules HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY1MX0.ZMjIEu-aRnkXBQOphC6euBe10HQTMvTMh-vSF__SZj8
Host: localhost:8999
response example (success)
HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 1155

[ {
  "id" : "some_test_rule:myyour123",
  "name" : "Some Test Rule:MyYour123",
  "description" : "",
  "datamodel" : "",
  "pdl" : "a=b",
  "annotations" : [ ],
  "enabled" : false
}, {
  "id" : "100",
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "datamodel" : "endpoint",
  "pdl" : "src=mysource AND dest=some.dest.ip",
  "annotations" : [ "T1001", "T1059.001" ],
  "enabled" : true
}, {
  "id" : "myrule_2",
  "name" : "MyRuleTest",
  "description" : "",
  "datamodel" : "",
  "pdl" : "a=bc",
  "annotations" : [ ],
  "enabled" : false
}, {
  "id" : "new_rule:_with_punct,etc.",
  "name" : "New rule: With Punct,Etc.",
  "description" : "",
  "datamodel" : "",
  "pdl" : "xxx=yyy",
  "annotations" : [ ],
  "enabled" : false
}, {
  "id" : "newrule_123",
  "name" : "NewRuleWith Different ID 123",
  "description" : "some description",
  "datamodel" : "",
  "pdl" : "asdf=123",
  "annotations" : [ ],
  "enabled" : false
}, {
  "id" : "some_rule_123",
  "name" : "some rule 123",
  "description" : "",
  "datamodel" : "",
  "pdl" : "asdf=12 AND asdf=\"adsf\"",
  "annotations" : [ "T1101" ],
  "enabled" : false
} ]

Read: GET /api/rules/{id}

Read one rule information.

Table 90. request headers
Name Description

Authorization

Contains Bearer access token.

Table 91. /api/rules/{id}
Parameter Description

id

ID of the rule to fetch

Table 92. response fields
Path Type Description

id

String

ID for this rule

name

String

Unique rule name

description

String

Description of this rule

datamodel

String

Datamodel where this rule will be applicable

pdl

String

PDL query to match against events according to the Datamodel

annotations

Array

An array of annotations regarding this rule, such as MITRE ATT&CK Technique IDs

enabled

Boolean

Determines whether this rule is active

request example (success)
GET /api/rules/100 HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY1MX0.ZMjIEu-aRnkXBQOphC6euBe10HQTMvTMh-vSF__SZj8
Host: localhost:8999
response example (success)
HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 239

{
  "id" : "100",
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "datamodel" : "endpoint",
  "pdl" : "src=mysource AND dest=some.dest.ip",
  "annotations" : [ "T1001", "T1059.001" ],
  "enabled" : true
}
request example (failure)
GET /api/rules/x1099 HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY1MX0.ZMjIEu-aRnkXBQOphC6euBe10HQTMvTMh-vSF__SZj8
Host: localhost:8999
response example (failure)
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 116

{
  "status" : "NOT_FOUND",
  "message" : "Resource not found",
  "debugMessage" : "Requested rule does not exist"
}

Update: PUT /api/rules/{id}

Update a specific rule.

Table 93. request headers
Name Description

Authorization

Contains Bearer access token.

path parameters

Unresolved directive in src/main/asciidoc/_includes/rules.adoc - include::/Users/selim/dev/padas/padas-engine/app/build/snippets/api-rules-id-put-success/path-parameters.adoc[]

Table 94. request fields
Path Type Description

id

String

ID for this rule

name

String

Unique rule name

description

String

Description of this rule

datamodel

String

Datamodel where this rule will be applicable

pdl

String

PDL query to match against events according to the Datamodel

annotations

Array

An array of annotations regarding this rule, such as MITRE ATT&CK Technique IDs

enabled

Boolean

Determines whether this rule is active

Table 95. response fields
Path Type Description

id

String

ID for this rule

name

String

Unique rule name

description

String

Description of this rule

datamodel

String

Datamodel where this rule will be applicable

pdl

String

PDL query to match against events according to the Datamodel

annotations

Array

An array of annotations regarding this rule, such as MITRE ATT&CK Technique IDs

enabled

Boolean

Determines whether this rule is active

request example (success)
PUT /api/rules/100 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY1MX0.ZMjIEu-aRnkXBQOphC6euBe10HQTMvTMh-vSF__SZj8
Content-Length: 246
Host: localhost:8999

{
  "id" : "100",
  "name" : "MyUpdatedTest name",
  "description" : "MyTest description text goes here",
  "datamodel" : "endpoint",
  "pdl" : "src=mysource AND dest=some.dest.ip",
  "annotations" : [ "T1001", "T1059.001" ],
  "enabled" : true
}
response example (success)
HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 246

{
  "id" : "100",
  "name" : "MyUpdatedTest name",
  "description" : "MyTest description text goes here",
  "datamodel" : "endpoint",
  "pdl" : "src=mysource AND dest=some.dest.ip",
  "annotations" : [ "T1001", "T1059.001" ],
  "enabled" : true
}
request example (failure)
PUT /api/rules/x1099 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY1MX0.ZMjIEu-aRnkXBQOphC6euBe10HQTMvTMh-vSF__SZj8
Content-Length: 241
Host: localhost:8999

{
  "id" : "x1099",
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "datamodel" : "endpoint",
  "pdl" : "src=mysource AND dest=some.dest.ip",
  "annotations" : [ "T1001", "T1059.001" ],
  "enabled" : true
}
response example (failure)
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 152

{
  "status" : "NOT_FOUND",
  "message" : "Resource not found",
  "debugMessage" : "Rule to update does not exist. Please use create (POST) endpoint."
}

Delete: DELETE /api/rules/{id}

Delete a specific rule.

Table 96. /api/rules/{id}
Parameter Description

id

ID of the rule to fetch

request example (success)
DELETE /api/rules/100 HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY1MX0.ZMjIEu-aRnkXBQOphC6euBe10HQTMvTMh-vSF__SZj8
Host: localhost:8999
response example (success)
HTTP/1.1 204 No Content
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
request example (failure)
DELETE /api/rules/x1099 HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY1MX0.ZMjIEu-aRnkXBQOphC6euBe10HQTMvTMh-vSF__SZj8
Host: localhost:8999
response example (failure)
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 117

{
  "status" : "NOT_FOUND",
  "message" : "Resource not found",
  "debugMessage" : "Rule to delete does not exist."
}

Bulk Update/Create: POST /api/bulk/rules

Bulk update/create a list of rules.

Table 97. request headers
Name Description

Authorization

Contains Bearer access token.

Table 98. request fields
Path Type Description

[].id

String

ID for this rule

[].name

String

Unique rule name

[].description

String

Description of this rule

[].datamodel

String

Datamodel where this rule will be applicable

[].pdl

String

PDL query to match against events according to the Datamodel

[].annotations

Array

An array of annotations regarding this rule, such as MITRE ATT&CK Technique IDs

[].enabled

Boolean

Determines whether this rule is active

Table 99. response fields
Path Type Description

[].id

String

ID for this rule

[].name

String

Unique rule name

[].description

String

Description of this rule

[].datamodel

String

Datamodel where this rule will be applicable

[].pdl

String

PDL query to match against events according to the Datamodel

[].annotations

Array

An array of annotations regarding this rule, such as MITRE ATT&CK Technique IDs

[].enabled

Boolean

Determines whether this rule is active

request example (success)
POST /api/bulk/rules HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY1MX0.ZMjIEu-aRnkXBQOphC6euBe10HQTMvTMh-vSF__SZj8
Content-Length: 488
Host: localhost:8999

[ {
  "id" : "100",
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "datamodel" : "endpoint",
  "pdl" : "src=mysource AND dest=some.dest.ip",
  "annotations" : [ "T1001", "T1059.001" ],
  "enabled" : true
}, {
  "id" : "1001",
  "name" : "MyTest name2",
  "description" : "MyTest description text goes here2",
  "datamodel" : "endpoint",
  "pdl" : "src=mysource AND dest=some.dest.ip",
  "annotations" : [ "T1001", "T1059.001" ],
  "enabled" : false
} ]
response example (success)
HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 1400

[ {
  "id" : "some_test_rule:myyour123",
  "name" : "Some Test Rule:MyYour123",
  "description" : "",
  "datamodel" : "",
  "pdl" : "a=b",
  "annotations" : [ ],
  "enabled" : false
}, {
  "id" : "100",
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "datamodel" : "endpoint",
  "pdl" : "src=mysource AND dest=some.dest.ip",
  "annotations" : [ "T1001", "T1059.001" ],
  "enabled" : true
}, {
  "id" : "1001",
  "name" : "MyTest name2",
  "description" : "MyTest description text goes here2",
  "datamodel" : "endpoint",
  "pdl" : "src=mysource AND dest=some.dest.ip",
  "annotations" : [ "T1001", "T1059.001" ],
  "enabled" : false
}, {
  "id" : "myrule_2",
  "name" : "MyRuleTest",
  "description" : "",
  "datamodel" : "",
  "pdl" : "a=bc",
  "annotations" : [ ],
  "enabled" : false
}, {
  "id" : "new_rule:_with_punct,etc.",
  "name" : "New rule: With Punct,Etc.",
  "description" : "",
  "datamodel" : "",
  "pdl" : "xxx=yyy",
  "annotations" : [ ],
  "enabled" : false
}, {
  "id" : "newrule_123",
  "name" : "NewRuleWith Different ID 123",
  "description" : "some description",
  "datamodel" : "",
  "pdl" : "asdf=123",
  "annotations" : [ ],
  "enabled" : false
}, {
  "id" : "some_rule_123",
  "name" : "some rule 123",
  "description" : "",
  "datamodel" : "",
  "pdl" : "asdf=12 AND asdf=\"adsf\"",
  "annotations" : [ "T1101" ],
  "enabled" : false
} ]
request example (failure)
POST /api/bulk/rules HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY1MX0.ZMjIEu-aRnkXBQOphC6euBe10HQTMvTMh-vSF__SZj8
Content-Length: 547
Host: localhost:8999

[ {
  "id" : "100",
  "name" : "MyTest name",
  "description" : "MyTest description text goes here",
  "datamodel" : "endpoint",
  "pdl" : "src=mysource AND dest=some.dest.ip",
  "annotations" : [ "T1001", "T1059.001" ],
  "enabled" : true
}, {
  "id" : "1001",
  "name" : "MyTest name2",
  "description" : "MyTest description text goes here2",
  "datamodel" : "endpoint",
  "pdl" : "src=mysource AND dest=some.dest.ip",
  "annotations" : [ "T1001", "T1059.001" ],
  "enabled" : false
}, {
  "someInvalidSchema" : "field value",
  "someId" : 4
} ]
response example (failure)
HTTP/1.1 400 Bad Request
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 146

{
  "status" : "BAD_REQUEST",
  "message" : "Resource validation failed",
  "debugMessage" : "Unable to bulk update rules due to invalid input."
}

Tests

This REST endpoint provides functionality for testing a rule, a task, or a pipeline. Request body contains the payload for the given test. For example, for a Rule test it must be JSON but depending on the task and/or pipeline it can be plain text (e.g. raw event data)

Testing a Rule: POST /api/test/rules/{id}

id represents the rule to be tested for the given payload.

Table 100. request headers
Name Description

Authorization

Contains Bearer access token.

Table 101. response fields
Path Type Description

result

Boolean

Result of this test as JSON value. It is set to either <code>true</code> or <code>false</code> for rule matching.

request example (success)
POST /api/test/rules/myruleid1 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY5MX0.vxiLR9tLNYDk9kqKb63GFzhOqcxMQCR7HjdzwLUJRIE
Content-Length: 68
Host: localhost:8999

{
  "src" : "my_source",
  "dest" : "10.20.30.40",
  "bytes" : 456
}
response example (success)
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 21
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY

{
  "result" : true
}
request example (failure)
POST /api/test/rules/myruleid1 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY5MX0.vxiLR9tLNYDk9kqKb63GFzhOqcxMQCR7HjdzwLUJRIE
Content-Length: 72
Host: localhost:8999

{
  "src" : "no_such_value",
  "dest" : "10.20.30.40",
  "bytes" : 456
}
response example (failure)
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 22
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY

{
  "result" : false
}

Testing a Task: POST /api/test/tasks/{id}

id represents the task to be tested for the given payload.

Table 102. request headers
Name Description

Authorization

Contains Bearer access token.

Table 103. response fields
Path Type Description

result

Object

Result of this test as JSON value.

request example (success)
POST /api/test/tasks/100 HTTP/1.1
Content-Type: text/plain;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY5MX0.vxiLR9tLNYDk9kqKb63GFzhOqcxMQCR7HjdzwLUJRIE
Content-Length: 81
Host: localhost:8999

{
  "mytime" : "20-05-2022 11:45:09",
  "dest" : "10.20.30.40",
  "bytes" : 456
}
response example (success)
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 135
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY

{
  "result" : {
    "mytime" : "20-05-2022 11:45:09",
    "dest" : "10.20.30.40",
    "bytes" : 456,
    "_time" : 1653047109000
  }
}
request example (failure)
POST /api/test/tasks/100 HTTP/1.1
Content-Type: text/plain;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY5MX0.vxiLR9tLNYDk9kqKb63GFzhOqcxMQCR7HjdzwLUJRIE
Content-Length: 88
Host: localhost:8999

{
  "no_such_field" : "20-05-2022 11:45:09",
  "dest" : "10.20.30.40",
  "bytes" : 456
}
response example (failure)
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 142
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY

{
  "result" : {
    "no_such_field" : "20-05-2022 11:45:09",
    "dest" : "10.20.30.40",
    "bytes" : 456,
    "_time" : 1676059091258
  }
}

Testing a Pipeline: POST /api/test/pipelines/{id}

id represents the pipeline to be tested for the given payload.

Table 104. request headers
Name Description

Authorization

Contains Bearer access token.

Table 105. response fields
Path Type Description

result

Object

Result of this test as JSON value.

request example (success)
POST /api/test/pipelines/100 HTTP/1.1
Content-Type: text/plain;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY5MX0.vxiLR9tLNYDk9kqKb63GFzhOqcxMQCR7HjdzwLUJRIE
Content-Length: 57
Host: localhost:8999

mytime="20-05-2022 11:45:09", dest=10.20.30.40, bytes=456
response example (success)
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 213
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY

{
  "result" : {
    "mytime" : "20-05-2022 11:45:09",
    "dest" : "10.20.30.40",
    "bytes" : "456",
    "_raw" : "mytime=\"20-05-2022 11:45:09\", dest=10.20.30.40, bytes=456",
    "_time" : 1653047109000
  }
}
request example (failure)
POST /api/test/pipelines/177 HTTP/1.1
Content-Type: text/plain;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY5MX0.vxiLR9tLNYDk9kqKb63GFzhOqcxMQCR7HjdzwLUJRIE
Content-Length: 57
Host: localhost:8999

mytime="20-05-2022 11:45:09", dest=10.20.30.40, bytes=456
response example (failure)
HTTP/1.1 404 Not Found
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Length: 120

{
  "status" : "NOT_FOUND",
  "message" : "Resource not found",
  "debugMessage" : "Requested pipeline does not exist"
}

Testing a PDL: POST /api/test/pdl

Table 106. request headers
Name Description

Authorization

Contains Bearer access token.

Table 107. response fields
Path Type Description

result

Boolean

Result of this test as JSON value.

request example (success)
POST /api/test/pdl HTTP/1.1
Content-Type: text/plain;charset=UTF-8
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZXN0YWRtaW4iLCJyb2xlcyI6WyJhZG1pbiJdLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo4OTk5L2FwaS9sb2dpbiIsImV4cCI6MTY3NjA1OTY5MX0.vxiLR9tLNYDk9kqKb63GFzhOqcxMQCR7HjdzwLUJRIE
Content-Length: 83
Host: localhost:8999

{
  "pdl" : "bytes > 400",
  "data" : "{\"dest\":\"10.20.30.40\", \"bytes\":456}"
}
response example (success)
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 21
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY

{
  "result" : true
}

End

End of document