Using the REST API

Introduction

This document describes the REST API of RAW services:

  • Executor service: responsible for executing queries, creating views, packages and tables.

  • Credentials service: responsible for managing credentials.

  • Kafka service: responsible for managing Kafka ingestion jobs.

Security

All RAW REST endpoints are protected by OAuth2 authorization. The caller must first obtain a valid OAuth2 token with the authorization service and then provide it in the “Authorization” header of the request.

Executor Service

Querying

Execute a query

Request:

POST /query

MediaType:

text/plain

Body contains the query in UTF-8 encoding, by default the result of the query will be in hjson format, to specify other formats see the table bellow “Optional HTTP headers”

Example:
curl -X POST http://localhost:54321/query \
    --header "Authorization: Bearer <access token>" \
    --data 'SELECT * FROM ["Hello", "World"]'

Optional HTTP headers:

Name

Type

Description

X-RAW-output-format

string

Output format of the query, accepted values are:
“json”, “hjson”, “csv”, “sqlite”,
“parquet-avro”, “parquet-raw”.
Default “hjson”.

X-RAW-windows-line-ending

boolean

If “true” output with windows line ending \n\r
if “false” output with unix line ending \n.
Default “false”.

X-RAW-max-bytes

int

Maximum number of bytes in the response

Response
200 OK:
HTTP/1.1 200 OK
Content-Type: text/plain; charset=utf-8

"Hello"
"World"
Query Invalid:

In case of semantic errors or runtime errors in the query, the server will return a 400 response, with a list of errors in the response.

HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{
   "validationErrors":[
      {
         "message":"bb is not declared",
         "positions":[{
            "begin":{ "line":1, "column":1 },
            "end":{ "line":1, "column":3 }
         }]
      }
   ],
   "runtimeError":null
}

Validate a query

Validates a query for syntax and semantic errors.

Request:

POST /query-validate

MediaType:

text/plain

Body contains the query in UTF-8 encoding.

Example:
curl -X POST http://localhost:54321/query-validate \
  --header "Authorization: Bearer <access token>" \
  --data 'SELECT * FROM ["Hello", "World"]'
Response
200 OK:

Returns a JSON object with the result type of the query.

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{"type":"collection(string)"}
Query invalid:

If the query is invalid, the server will return a 400 response, with a list of errors in the response.

HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{
   "validationErrors":[
      {
         "message":"bb is not declared",
         "positions":[{
            "begin":{ "line":1, "column":1 },
            "end":{ "line":1, "column":3 }
         }]
      }
   ],
   "runtimeError":null
}

Views

Create a new view

Request:

PUT /views/<name>

MediaType:

text/plain

Body contains the query in UTF-8 encoding.

Example:
curl -X PUT http://localhost:54321/views/helloworld \
  --header "Content-Type: text/plain" \
  --header "Authorization: Bearer <access token>" \
  --data 'SELECT * FROM ["Hello", "World"]'
Response
200 OK:

If the view is valid the server will return a json with the type of the view.

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{ "type": "collection(string)" }
Invalid view:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{
   "validationErrors":[
      {
         "message":"bb is not declared",
         "positions":[{
            "begin":{ "line":1, "column":1 },
            "end":{ "line":1, "column":3 }
         }]
      }
   ],
   "runtimeError":null
}
View name is invalid:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{ "code":"view_name_invalid", "message":"View name is invalid" }
View already exists:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{ "code":"view_already_exists", "message":"View already exists" }

List views

Request:

GET /views?pattern=<pattern>

Query parameters:
  • pattern - search pattern following the format used by the SQL LIKE operator (eg., % for zero or more characters, _ for single character)

Body:

empty

Example:
curl http://localhost:54321/views \
    --header "Authorization: Bearer <access token>" \
    -G --data-urlencode "pattern=hello%"
Response
200 OK:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

[
  {
    "name": "helloworld",
    "query": "SELECT * FROM [\"Hello\", \"World\"]",
    "createdAt": "2017-11-09T09:54:28.599"
  }
]

Retrieve details of a view

Request:

GET /views/<name>

Body:

empty

Example:
curl http://localhost:54321/views/helloworld \
  --header "Authorization: Bearer <access token>"
Response
200 OK:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "name": "helloworld",
  "query": "SELECT * FROM [\"Hello\", \"World\"]",
  "createdAt": [2017, 11, 09, 09, 54, 8, 599000],
  "updatedAt": null
}
View not found:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{ "code":"view_not_found", "message":"View not found" }

Delete a view

Request:

DELETE /views/<name>

Body:

empty

Example:
curl -X DELETE  http://localhost:54321/views/helloworld \
  --header "Authorization: Bearer <access token>"
Response
204 OK:

If the view was deleted the server responds with a 204 No Content.

HTTP/1.1 204 No Content
View not found:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{ "code":"view_not_found", "message":"View not found" }

Packages

Create a package

Request:

PUT /packages/<name>

MediaType:

text/plain

Body contains the package code in UTF-8 encoding.

Example:
curl -X PUT http://localhost:54321/packages/pkg1 \
  --header "Content-Type: text/plain" \
  --header "Authorization: Bearer token" \
  --data  'func1(a: int, b: int) := a + b;
           pkg_data := ["Hello", "World"];
           pkg_data'
Response
200 OK:
{"type":"collection(string)"}
Invalid package:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{
   "validationErrors":[
      {
         "message":"bb is not declared",
         "positions":[{
            "begin":{ "line":1, "column":1 },
            "end":{ "line":1, "column":3 }
         }]
      }
   ],
   "runtimeError":null
}
Package already exists:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{ "code":"package_already_exists", "message":"Package already exists" }
Package name is invalid:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{ "code":"package_name_invalid", "message":"Package name is invalid" }

List packages

Request:

GET /packages?pattern=<pattern>

Query parameters:
  • pattern - search pattern following the format used by the SQL LIKE operator (eg., % for zero or more characters, _ for single character)

Body:

empty

Example:
curl http://localhost:54321/packages \
    --header "Authorization: Bearer <access token>" \
    -G --data-urlencode "pattern=pk%"
Response
200 OK:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

[
  {
    "name": "pkg1",
    "query": "SELECT * FROM [\"Hello\", \"World\"]",
    "createdAt": "2017-11-09T09:54:28.599"
  }
]

Retrieve details of a package

Request:

GET /packages/<name>

Body:

empty

Example:
curl http://localhost:54321/packages/test \
  --header "Authorization: Bearer <access token>"
Response
200 OK:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "name": "helloworld",
  "query": "SELECT * FROM [\"Hello\", \"World\"]",
  "createdAt": [2017, 11, 09, 09, 54, 8, 599000],
  "updatedAt": null
}
Package not found:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{ "code":"package_not_found", "message":"Package not found" }

Delete a package

Request:

DELETE /packages/<name>

Body:

empty

Example:
curl -X DELETE  http://localhost:54321/packages/helloworld \
  --header "Authorization: Bearer <access token>"
Response
204 OK:

If the package was deleted the server responds with a 204 No Content.

HTTP/1.1 204 No Content
Package not found:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{ "code":"package_not_found", "message":"Package not found" }

OpenAPI

Get the OpenAPI json definition for all rest endpoints of a package.

Request:

GET /openapi/v3/package/<name>

Body:

empty

Example:
curl -X GET  http://localhost:54321//openapi/v3/package/pkg1 \
  --header "Authorization: Bearer <access token>"
Response
200 OK:

The server returns a json document describing the rest endpoints of the package following the as defined in the OpenAPI specification.

Package not found:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{ "code":"package_not_found", "message":"Package not found" }
Invalid package:
  • See Create Package -> Response -> Invalid package

Tables

Create a table

Request:

PUT /tables/<name>

MediaType:

application/json

Example:
curl -X PUT http://localhost:54321/tables/tbl1 \
   --header "Authorization: Bearer <access token>" \
   --header "Content-Type: application/json" \
   --data '{
             "type": "collection(record(a: int, b: string))",
             "indexes": [],
             "location": null
            }'
Response
200 OK:

the server returns an empty response

400 Error:

in case of errors the server will return 400 Bad Request with a json response with an error-code and an error-message.

Example:

HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{ "code": "table_name_invalid", "message":"Table name is invalid" }

list of possible error-codes in create table:

  • “table_name_invalid”

  • “table_type_invalid”

  • “table_already_exists”

  • “index_invalid”

  • “table_not_indexable”

List Tables

Request:

GET /tables?pattern=<pattern>

Query parameters:
  • pattern - search pattern following the format used by the SQL LIKE operator (eg., % for zero or more characters, _ for single character)

Body:

empty

Example:
curl http://localhost:54321/tables \
    --header "Authorization: Bearer <access token>" \
    -G --data-urlencode "pattern=tbl%"
Response
200 OK:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

[{
    "name": "tbl1",
    "type": "collection(record(a: int, b: string, c: double))",
    "location": "file://tmp/tbl_data",
    "createdAt" :[2019,11,15,17,19,54,809000000],
    "updatedAt": null
}]

Retrieve details of a table

Request:

GET /tables/<name>

Body:

empty

Example:
curl http://localhost:54321/tables/tbl1 \
  --header "Authorization: Bearer <access token>"
Response
200 OK:
 HTTP/1.1 200 OK
 Content-Type: application/json; charset=utf-8

{
     "name": "tbl1",
     "type": "collection(record(a: int, b: string))",
     "location": null,
     "createdAt": [2019,12,19,13,32,18,598000000],
     "updatedAt": null
}
Table not found:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{ "code":"Table_not_found", "message":"Table not found" }

Delete a table

Request:

DELETE /table/<name>

Body:

empty

Example:
curl -X DELETE  http://localhost:54321/table/helloworld \
  --header "Authorization: Bearer <access token>"
Response
204 OK:

If the table was deleted the server responds with a 204 No Content.

HTTP/1.1 204 No Content
Table not found:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{ "code":"table_not_found", "message":"Table not found" }

Optimize a table

Request:

GET /tables_optimize/<name>

Body:

empty

Example:
curl -X GET  http://localhost:54321/tables_optimize/tbl1 \
  --header "Authorization: Bearer <access token>"
Response
200 OK:

If the table was optimized the server returns 200 with an empty body.

HTTP/1.1 200 OK
Table not found:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{ "code":"table_not_found", "message":"Table not found" }
Concurrency error:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{ "code":"table_concurrency_error", "message":"Table concurrency error" }

Vacuum Table

Request:

GET /tables_vacuum/<name>

Body:

empty

Example:
curl -X GET  http://localhost:54321/tables_optimize/tbl1 \
  --header "Authorization: Bearer <access token>"
Response
200 OK:

If the table was vacuumed the server returns 200 with an empty body.

HTTP/1.1 200 OK
Table not found:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{ "code":"table_not_found", "message":"Table not found" }
Vacuum error:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{ "code":"vacuum_error", "message": <message> }

Credentials Service

S3 Buckets

Register a new S3 bucket

Request:

POST /s3buckets

Arguments:
  • name - Name of S3 bucket

  • credentials - Optional AWS credentials.
    • accessKey -

    • secretKey -

Example:
curl -X POST http://localhost:54322/s3buckets \
  --header "Authorization: Bearer <access token>" \
  --header "Content-Type: application/json" \
  --data '{
  "name": "acme-logs",
  "region": "eu-west-1",
  "credentials": {
    "accessKey": "<access key>",
    "secretKey": "<secret key>"
  }
}'
Response
201 Created:

empty

S3 credentials already exists:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{"code":"s3_credentials_already_exists","message":"S3 credentials already exists"}

List registered S3 buckets

Request:

GET /s3buckets

Example:
curl http://localhost:54322/s3buckets \
  --header "Authorization: Bearer <access token>"

Response

200 OK:
["acme-logs","raw-tutorial"]

Retrieve details of a S3 bucket

Request:

GET /s3buckets/<bucketName>

Example:
curl http://localhost:54322/s3buckets/acme-logs \
  --header "Authorization: Bearer <access token>"
Response
200 OK:
{
  "name": "acme-logs",
  "credentials": {
    "accessKey": "<access key>",
    "secretKey": "<secret key>"
  }
}
S3 credentials not found:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{"code":"s3_credentials_not_found","message":"S3 credentials not found"}

Delete a S3 bucket

Request:

DELETE /s3buckets/<bucketName>

Example:
curl -X DELETE http://localhost:54322/s3buckets/acme-logs \
  --header "Authorization: Bearer <access token>"
Response
204 No Content:

empty

S3 credentials not found:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{"code":"s3_credentials_not_found","message":"S3 credentials not found"}

RDBMS Servers

Register a new RDBMS server databases

Request:

POST /rdbmsservers

Arguments:
  • name - Unique name used to refer to the database within raw.

  • vendor - Database vendor. Currently only postgresql is supported.

  • host - Host name of the database server.

  • port - The port of the database server.

  • database - Name of the database

  • username - [Optional] Used for authenticating with the database server.

  • password - [Optional]

Example:
curl -X POST http://localhost:54322/rdbmsservers \
  --header "Authorization: Bearer <access token>" \
  --header "Content-Type: application/json" \
  --data '{
  "name": "db1",
  "vendor": "postgresql",
  "host": "localhost",
  "port": 5432,
  "database": "db",
  "username": "john",
  "password": "1234"
}'
Response
201 Created:

empty

Database already exists:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{"code":"database_credentials_already_exists","message":"database credentials already exists"}

List registered RDBMS databases

Request:

GET /rdbmsservers

Example:
curl http://localhost:54322/rdbmsservers \
  --header "Authorization: Bearer <access token>"
Response
200 OK:
["db1", "db2"]

Retrieve details of a RDBMS databases

Request:

GET /rdbmsservers/<dbName>

Example:
curl http://localhost:54322/rdbmsservers/db1 \
  --header "Authorization: Bearer <access token>"
Response
200 OK:
{
     "type": "postgresql",
     "host":"localhost","
     port":1234,
     "database":"db",
     "username":"user",
     "password":"passwd"
 }
Database not found:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{"code":"database_credentials_not_found","message":"database credentials not found"}

Delete a RDBMS Server

Request:

DELETE /rdbmsservers/<serverName>

Example:
curl -X DELETE http://localhost:54322/rdbmsservers/db1 \
  --header "Authorization: Bearer <access token>"
Response
204 No Content:

empty

Database not found:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{"code":"database_credentials_not_found","message":"database credentials not found"}

Dropbox tokens

Register dropbox token

Registers a dropbox token, failing if a token is already registered. The token should have been obtained from calling the /oauth2/token endpoint of the Dropbox API.

Request:

POST /dropbox-tokens

Arguments:
  • accessToken - The access token.

  • tokenType - Always “bearer”.

  • uid - The user id.

Example:
curl -X POST http://localhost:54322/dropbox-tokens \
  --header "Authorization: Bearer <access token>" \
  --header "Content-Type: application/json" \
  --data '{
  "accessToken": "n5HcoSK_1pUAAAAAAAAMpeqUU5Cuzlm9M0kA3eG4HDNrsgKSFHtyzyrG4Eymz5_W",
  "tokenType": "bearer",
  "uid":"246215797"
}'
Response
201 Created:

empty

Dropbox token already exists:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{"code":"dropbox_token_already_exists","message":"dropbox token already exists"}

Get dropbox token

Request:

GET /dropbox-tokens

Body:

empty

Example:
curl http://localhost:54322/dropbox-tokens \
  --header "Authorization: Bearer <access token>"
Response
200 OK:
{
  "accessToken": "n5HcoSK_1pUAAAAAAAAMpeqUU5Cuzlm9M0kA3eG4HDNrsgKSFHtyzyrG4Eymz5_W",
  "tokenType": "bearer",
  "uid": "246215797"
}
Dropbox token not found:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{"code":"dropbox_token_not_found","message":"dropbox token not found"}

Delete dropbox token

Request:

DELETE /dropbox-tokens

Example:
curl -X DELETE http://localhost:54322/dropbox-tokens \
  --header "Authorization: Bearer <access token>"
Response
204 No Content:

empty

Dropbox token not found:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{"code":"dropbox_token_not_found","message":"dropbox token not found"}

Protected HTTP urls

Register a new HTTP credentials

Request:

POST /http-creds

Arguments:
  • prefixUrl - base protected url.

  • credentials - format depends of the type of credentials to register (see table bellow).

Example:
curl -X POST http://localhost:54322/http-creds \
  --header "Authorization: Bearer <access token>" \
  --header "Content-Type: application/json" \
  --data '{
            "prefixUrl": "http://www.protected.com",
            "credentials": {
                "type": "oauth-token",
                "token": "my-token"
            }
         }'

Supported credentials:

Type

Parameters

Name

Description

Example

Basic Auth

type

Defines type of credentials,
basic-auth for basic auth credentials

“basic-auth”

user

User name

“john_doe”

password

Password

“my_password”

Oauth client

type

oauth-client for oauth client credentials

“oauth-client”

clientId

client id

“my_client_id”

clientSecret

client secret

“my_secret”

tokenUrl

url to get oauth token

http://oauth.validate

useBasicAuth

Use basic auth style authentication
in get-token flow(optional)

true

Oauth token

type

oauth-token for oauth token credentials

“oauth-token”

token

Oauth token

“my_token”

refreshToken

Refresh token (optional)

“my_refresh_token”

tokenUrl

url to refresh token (optional)

http://oauth.validate

Response
201 Created:

empty

HTTP credentials already exists:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{"code":"http_credentials_already_exists","message":"HTTP credentials already exists"}

List registered HTTP credentials

Request:

GET /http-creds/

Example:
curl http://localhost:54322/http-creds \
  --header "Authorization: Bearer <access token>"
Response
200 OK:
["http://www.protected.com"]

Retrieve details of HTTP credentials

Request:

GET /http-creds?name=<name>

Example:
curl http://localhost:54322/http-creds?name=http%3A%2F%2Fwww.protected.com \
  --header "Authorization: Bearer <access token>"
Response
200 OK:
{
     "prefixUrl":"http://www.protected.com",
     "credentials":{
         "type": "oauth-token",
         "token": "token",
         "refreshToken":null,
         "tokenUrl": null
     }
 }
HTTP credentials not found:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{"code":"http_credentials_not_found","message":"HTTP credentials not found"}

Delete HTTP Credentials

Request:

DELETE /http-creds?name=<name>

Example:
curl -X DELETE  http://localhost:54322/http-creds?name=http%3A%2F%2Fwww.protected.com \
  --header "Authorization: Bearer <access token>"
Response
204 No Content:

empty

HTTP credentials not found:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{"code":"http_credentials_not_found","message":"HTTP credentials not found"

Kafka Service

Create a new kafka table

Request:

POST /kafka/<name>

Arguments:
  • name - Name of the kafka table to create.

  • host - Host name of the kafka server.

  • port - The port of the kafka server.

  • topic - Kafka topic for the data.

  • transform - Transformation function on the kafka stream.

  • intervalMillis - Polling interval for kafka events.

  • indexes - List of indexes to create on the table.

  • location - Url where the table will be stored.

Example:
curl -X POST http://localhost:54324/kafka/data1 \
  --header "Authorization: Bearer <access token>" \
  --header "Content-Type: application/json" \
  --data '{
  "host": "localhost",
  "port": 9092,
  "topic": "test",
  "transform": "<raw transformation code>",
  "indexes": [],
  "intervalMillis": 1000,
  "location": "hdfs://namenode/user/test"
}'

Note

The transform parameter has to be a function with the following prototype:

\(key: binary, value: binary, topic: string, partitionNo: int, offset: long, timestamp: timestamp, timestampType: int)

and the output type of the function has to be a record.

Example of a transformation function:
\(key: binary, value: binary, topic: string, partitionNo: int, offset: long, timestamp: timestamp, timestampType: int) -> {
    typealias person := record(name: string, age: int);
    parse_json[person](decode_string(value, "utf8"))
}

Response

200 OK:

empty

400 Error:

in case of errors the server will return 400 Bad Request with a json response with an error-code and an error-message.

Example:

HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{ "code": "kafka_already_exists", "message":"Kafka table already exists" }

list of possible error-codes in create kafka ingestion process:

  • “kafka_already_exists”

  • “kafka_name_invalid”

  • “kafka_error”

List kafka tables

Request:

GET /kafka

Example:
curl http://localhost:54324/kafka \
  --header "Authorization: Bearer <access token>"

Response

200 OK:
[
    {"tableName": "Kafka1", "createdAt": "2017-11-09T09:54:28.599" },
    {"tableName": "Kafka2", "createdAt": "2016-05-11T09:00:00.234" }
]

Retrieve details of a kafka table

Request:

GET /kafka/<name>

Example:
curl http://localhost:54324/kafka/kafka1 \
  --header "Authorization: Bearer <access token>"

Response

200 OK:
[
    {"name": "data", "state": "running", "detail": "table data job is running"},
    {"name": "index 1", "state": "preparing", "detail": "table index job is preparing"},
    {"name": "index 2", "state": "failed", "detail": "an error occurred"}
]
400 Error:

in case of errors the server will return 400 Bad Request with a json response with an error-code and an error-message.

Example:

HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{ "code": "kafka_not_found", "message":"Kafka table not found" }

list of possible error-codes in get kafka ingestion process details:

  • “kafka_not_found”

  • “kafka_job_not_found”

Delete a kafka table

Request:

DELETE /kafka/<name>

Arguments:
  • force - Force delete the ingestion process.

Example:
curl -X DELETE http://localhost:54324/kafka/kafka1?force=true \
  --header "Authorization: Bearer <access token>"

Response

204 No Content:

empty

kafka table not found:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{"code":"kafka_not_found","message":"Kafka table not found"}

Kill all jobs of a kafka table

Request:

POST /kafka/<name>/kill

Example:
curl -X POST http://localhost:54324/kafka/kafka1/kill \
  --header "Authorization: Bearer <access token>"

Response

200 OK:

empty

kafka table not found:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{"code":"kafka_not_found","message":"Kafka table not found"}

Get logs from a job of a kafka table

Request:

POST /kafka/<name>/logs/<job>

Example:
curl http://localhost:54324/kafka/kafka1/logs/data \
  --header "Authorization: Bearer <access token>"

Response

200 OK:
15:55:06.081  INFO starting job
15:55:06.084  DEBUG receiving kafka events from topic "test"
15:55:06.088  DEBUG storing data in location hdfs://server1:4050/user1/tables/test
15:57:54.129  WARN data quota is approaching limit
15:57:16.070  INFO data compaction service started
kafka table not found:
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=utf-8

{"code":"kafka_not_found","message":"Kafka table not found"}