FastScore DevHub

The FastScore DevOps Hub

Welcome to the FastScore DevOps hub. You'll find comprehensive guides and documentation to help you start integrating FastScore microservices into your infrastructure and deploying analytics as quickly and repeatably as possible, as well as support if you get stuck. Let's jump right in!

You can also contact us by email: support@opendatagroup.com

Get Started
Suggest Edits

/swagger

Returns the present API specification

 
get/swagger
curl -k https://localhost:8003/1/swagger
A binary file was returned

You couldn't be authenticated

Try the API to see results
 
Suggest Edits

/health

A successful reply indicates that the service is healthy

 
get/health
curl --request GET \
  --url http://example.com/health
var request = require("request");

var options = { method: 'GET', url: 'http://example.com/health' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("http://example.com/health")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "http://example.com/health");

xhr.send(data);
import requests

url = "http://example.com/health"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "id": "<instance-id>",
  "release": "1.3",
  "built_on": "<build-date-and-time>"
}
 

returns a JSON object with the following fields:

Field

id

An instance identifier (for internal use)

release

The FastScore release ("1.3")

built_on

A date and time of the build (e.g. "Mon Jan 16 00:29:55 UTC 2017")

A 200 reply indicates that the microservice is healthy.

curl -k https://localhost:8003/1/health
Suggest Edits

/job/stream/in

Set the output stream descriptor

 
put/job/stream/in
curl -k https://localhost:8003/1/job/stream/in -X PUT -H "Content-Type: application/json" --data-binary @stream1.json
A binary file was returned

You couldn't be authenticated

Body Params

stream
mixed type
required

An output stream descriptor

 
Suggest Edits

/job/stream/out

Set the output stream descriptor

 
put/job/stream/out
curl -k https://localhost:8003/1/job/stream/out -X PUT -H "Content-Type: application/json" --data-binary @stream1.json
A binary file was returned

You couldn't be authenticated

<An error message>

Body Params

stream
mixed type
required

An output stream descriptor

 
Suggest Edits

/job/model

Add or update a model

 
put/job/model
curl --request PUT \
  --url http://example.com/job/model
var request = require("request");

var options = { method: 'PUT', url: 'http://example.com/job/model' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("http://example.com/job/model")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Put.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "http://example.com/job/model");

xhr.send(data);
import requests

url = "http://example.com/job/model"

response = requests.request("PUT", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

<An error message>

Body Params

model
mixed type
required

A model source (and attachments, if any)

 
Suggest Edits

/job

Stop the currently running model

 
delete/job
curl -k https://localhost:8003/1/job -X DELETE
A binary file was returned

You couldn't be authenticated

Try the API to see results
 
Suggest Edits

/job/scale

Set the number of instances for the model

 
post/job/scale
curl -k https://localhost:8003/1/job/scale?n=5 -X POST 
A binary file was returned

You couldn't be authenticated

<An error message>

Query Params

n
int32
required

The number of instances

 
Suggest Edits

/job/status

Get status information about the engine

 
get/job/status
curl -k https://localhost:8003/1/job/status
A binary file was returned

You couldn't be authenticated

{
  "input": {
  	"descriptor": ...
    "total_records": ...
    "total_bytes": ...
    "eof": ...
  },
  "output": {
    "descriptor": ...
    "total_records": ...
    "total_bytes": ...
  },
  "model": {
    "type": ...
    "source": ...
    "attachments: [ ... ]
  },
  "jets": [
    {
    	"pid": ...
      "sandbox": ...
      "total_consumed": ...
      "total_produced": ...
      "run_time": ...
      "memory": ...
      "busy": ...
    },
    ...
  ]
}    

Query Params

return
string
required

A comma-seperated list of field names to return (input, output, model, jets)

 
Suggest Edits

/job/statistics

Reset performance counters

 
delete/job/statistics
curl -k https://localhost:8003/1/job/statistics -X DELETE
A binary file was returned

You couldn't be authenticated

Try the API to see results
 
Suggest Edits

/job/input

Process a batch of records using a pigging transport

 
post/job/input
curl -k https://localhost:8003/1/job/input -X POST --data-binary @batch1.dat
A binary file was returned

You couldn't be authenticated

 
Suggest Edits

/job/sample/cpu

Compute CPU usage

 
post/job/sample/cpu
curl -k https://localhost:8003/1/job/sample/cpu?duration=30 -X POST
A binary file was returned

You couldn't be authenticated

{
  "duration: ...
  "input_bytes: ...
  "input_records: ...
  "output_bytes: ...
  "output_records: ...
  "user_time: ...
  "kernel_time: ...
  "op_times: [
    {
    	"unwrap_envelope": ...
      "unwrap_envelope_n": ...
      "wrap_envelope": ...
      "wrap_envelope_n": ...
      "decode_input_record": ...
      "decode_input_record_n": ...
      "type_check_input": ...
      "type_check_input_n": ...
    },
		...
  ],
  "jets": [
		{
    	"input_records: ...
      "output_records: ...
      "user_time: ...
      "kernel_time: ...
      "model_time: ...
    },
    ...
  ]
}
<An error message>

Query Params

duration
int32

The number of seconds to sample CPU usage for

 
Suggest Edits

/stream/sample

sample data from a stream

 
post/stream/sample
curl -k https://localhost:8003/1/stream/sample?n=20 -X POST -H "Content-Type: application/json" --data-binary @stream1.json
A binary file was returned

You couldn't be authenticated

<Sample data records>
<An error message>

Query Params

n
int32

a number of data items to get from the stream

Body Params

stream
string
required

A stream descriptor to get sample data from

 
Suggest Edits

/stream/rate

Calculate stream rate

 
post/stream/rate
curl -k https://localhost:8003/1/stream/rate -X POST -H "Content-Type: application/json" --data-binary @stream1.json
A binary file was returned

You couldn't be authenticated

[
  {
    "rps": <records-per-second>,
    "mbps": <megabytes-per-second>
  },
  ...
]
<An error message>

Body Params

stream
mixed type
required

A stream descriptor to measure data rate

 
Suggest Edits

/debug/output

Retrieves data from the output debug transport

 
get/debug/output
curl -k https://localhost:8003/1/debug/output
A binary file was returned

You couldn't be authenticated

[ ... <data-records> ... ]
 

returns a JSON object with the following fields:

Field

id

An instance identifier (for internal use)

release

The FastScore release ("1.3")

built_on

A date and time of the build (e.g. "Mon Jan 16 00:29:55 UTC 2017")

A 200 reply indicates that the microservice is healthy.

curl -k https://localhost:8003/1/health
Suggest Edits

/swagger

Returns the present API specification

 
get/swagger
curl -i -k https://localhost:8002/1/swagger
var request = require('request');

var options = {
    url: 'https://localhost:8002/1/swagger'
};

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);
require 'net/http'
require 'uri'

uri = URI.parse("https://localhost:8002/1/swagger")
response = Net::HTTP.get_response(uri)

# response.code
# response.body
-import (application, [start/1]).
-import (httpc, [request/1]).

init() ->
	application:start(asn1),
	application:start(crypto),
	application:start(public_key),
	application:start(ssl),
	application:start(inets).

get_modelmanage_health() ->
	{ok, Response} = httpc:request("https://localhost:8002/1/swagger").
requests.get('https://localhost:8002/1/swagger')
A binary file was returned

You couldn't be authenticated

Try the API to see results
 
Suggest Edits

/health

A successful reply confirm that Model Manage is healthy

 
get/health
curl -i -k https://localhost:8002/1/health
var request = require('request');

var options = {
    url: 'https://localhost:8002/1/health'
};

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);
require 'net/http'
require 'uri'

uri = URI.parse("https://localhost:8002/1/health")
response = Net::HTTP.get_response(uri)

# response.code
# response.body
-import (application, [start/1]).
-import (httpc, [request/1]).

init() ->
	application:start(asn1),
	application:start(crypto),
	application:start(public_key),
	application:start(ssl),
	application:start(inets).

get_modelmanage_health() ->
	{ok, Response} = httpc:request("https://localhost:8002/1/health").
requests.get('https://localhost:8002/1/health')
A binary file was returned

You couldn't be authenticated

{
  "id": "<instance-id>",
  "release": "1.3",
  "built_on": "<build-date-and-time>"
}
 
Suggest Edits

/model

returns a list of model names (or JSON objects if 'i' is set)

 
get/model
curl -i -k https://localhost:8002/1/model
var request = require('request');

var options = {
    url: 'https://localhost:8002/1/model'
};

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);
require 'net/http'
require 'uri'

uri = URI.parse("https://localhost:8002/1/model")
response = Net::HTTP.get_response(uri)

# response.code
# response.body
-import (application, [start/1]).
-import (httpc, [request/1]).

init() ->
	application:start(asn1),
	application:start(crypto),
	application:start(public_key),
	application:start(ssl),
	application:start(inets).

get_modelmanage_model() ->
	{ok, Response} = httpc:request("https://localhost:8002/1/model").
requests.get('https://localhost:8002/1/model')
A binary file was returned

You couldn't be authenticated

[ "model1", ... ]
  - or -
[
  {
		"name": "model1",
 		"metadata": ...
 		...
  },
  ...
]  
<An error message>

Query Params

return
string

a comma-separated list of fields (metadata, type, attachments)

 
Suggest Edits

/model/:model

Call to add a model

 
put/model/model
curl -k -H "Content-Type: application/vnd.fastscore.model-python" -X PUT --data-binary @model1.py https://localhost:8002/1/model/model1
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

model
string
required

The name of the model to add

 
Suggest Edits

/model/:model

returns the pfa model as JSON, Yaml, or ppfa

 
get/model/model
curl -k https://localhost:8002/1/model/model1
A binary file was returned

You couldn't be authenticated

def action(x):
  yield x*x*x

Path Params

model
string
required

The name of the model to retrieve

 
Suggest Edits

/model/:model

This is the call to delete a model

 
delete/model/model
curl -k -X DELETE https://localhost:8002/1/model/:model
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

model
string
required

The name of the model to delete

 
Suggest Edits

/model/:model/attachment

Returns a list of the attachments for the model

 
get/model/model/attachment
curl -k https://localhost:8002/1/model/model1/attachment
A binary file was returned

You couldn't be authenticated

[ "att1.zip", "att2.zip", ... ]
<An error message>

Path Params

model
string
required

The name of the model to list attachments

 
Suggest Edits

/model/:model/attachment/:attachment

retrieves an attachment

 
get/model/model/attachment/attachment
curl -k https://localhost:8002/1/model/model1/attachment/att1.zip -O
A binary file was returned

You couldn't be authenticated

<the contents of the attachment>
<An error message>

Path Params

model
string
required

The model name

attachment
string
required

The name of the attachment

 
Suggest Edits

/model/:model/attachment/:attachment

add or update an attachment

 
put/model/model/attachment/attachment
curl -k https://localhost:8002/1/model/model1/attachment/att1.zip -X PUT -H "Content-Type: application/zip" --data-binary @att1.zip
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

model
string
required

The model name

attachment
string
required

The name of the attachment

 
Suggest Edits

/model/:model/attachment/:attachment

deletes an attachment

 
delete/model/model/attachment/attachment
curl -k https://localhost:8002/1/model/model1/attachment/att1.zip -X DELETE
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

model
string
required

The name of the model

attachment
string
required

The name of the attachment

 
Suggest Edits

/stream

returns a list of stream descriptors

 
get/stream
curl -i -k https://localhost:8002/1/stream
var request = require('request');

var options = {
    url: 'https://localhost:8002/1/stream'
};

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);
require 'net/http'
require 'uri'

uri = URI.parse("https://localhost:8002/1/stream")
response = Net::HTTP.get_response(uri)

# response.code
# response.body
-import (application, [start/1]).
-import (httpc, [request/1]).

init() ->
	application:start(asn1),
	application:start(crypto),
	application:start(public_key),
	application:start(ssl),
	application:start(inets).

get_modelmanage_model() ->
	{ok, Response} = httpc:request("https://localhost:8002/1/stream").
requests.get('https://localhost:8002/1/stream')
A binary file was returned

You couldn't be authenticated

[ "stream1", ... ]
 
Suggest Edits

/stream/:stream

Returns the stream descriptor

 
get/stream/stream
curl -k https://localhost:8002/1/stream/:stream
A binary file was returned

You couldn't be authenticated

{
  "Description": "A sample stream descriptor",
  "Transport": {
  	"Type": "Kafka",
    ...
  },
  ...
}

Path Params

stream
string
required

The name of the stream

 
Suggest Edits

/stream/:stream

Adds (or updates) the stream descriptor

 
put/stream/stream
curl -k -H "Content-Type: application/json" -X PUT --data-binary @stream1.json https://localhost:8002/1/stream/stream1
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

stream
string
required

The name of the stream to add

 
Suggest Edits

/stream/:stream

removes a specific stream

 
delete/stream/stream
curl -k -X DELETE https://localhost:8002/1/stream/stream1
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

stream
string
required

The name of the stream to delete

 
Suggest Edits

/schema

Returns the list of registered schemas

 
get/schema
curl -k https://localhost:8002/1/schema
A binary file was returned

You couldn't be authenticated

[ "schema1", ... ]
 
Suggest Edits

/schema/:schema

retrieves a schema

 
get/schema/schema
curl -k https://localhost:8002/1/schema/schema1
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

schema
string
required

The name of the schema

 
Suggest Edits

/schema/:schema

Adds (or updates) a schema

 
put/schema/schema
curl -k https://localhost:8002/1/schema/schema1 -X PUT -H "Content-Type: application/json" --data-binary @schema1.json
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

schema
string
required

The name of the schema

 
Suggest Edits

/schema/:schema

Removes a specific schema

 
delete/schema/schema
curl -k -X DELETE https://localhost:8002/1/schema/schema1
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

schema
string
required

The name of the schema

 
Suggest Edits

/sensor

Returns the list of sensor descriptors

 
get/sensor
curl -k https://localhost:8002/1/sensor
A binary file was returned

You couldn't be authenticated

[ "sensor1", ... ]
 
Suggest Edits

/sensor/:sensor

Retrieves a sensor descriptor

 
get/sensor/sensor
curl -k https://localhost:8002/1/sensor/sensor1
A binary file was returned

You couldn't be authenticated

{
  "Tap": "sys.memory",
  ...
}

Path Params

sensor
string
required

The name of the sensor

 
Suggest Edits

/sensor/:sensor

Adds (or updates) a sensor descriptor

 
put/sensor/sensor
curl -k https://localhost:8002/1/sensor/sensor1 -X PUT -H "Content-Type: application/json" --data-binary @sensor1.json
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

sensor
string
required

The name of the sensor

 
Suggest Edits

/sensor/:sensor

Removes a sensor descriptor

 
delete/sensor/sensor
curl -k -X DELETE https://localhost:8002/1/sensor/sensor1
var request = require('request');

var options = {
    url: 'https://localhost:8002/1/stream/:sensor',
    method: 'DELETE'
};

function callback(error, response, body) {
    if (!error && response.statusCode == 204) {
        console.log(body);
    }
}

request(options, callback);
require 'net/http'
require 'uri'

uri = URI.parse("https://localhost:8002/1/sensor/:sensor")
request = Net::HTTP::Delete.new(uri)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

# response.code
# response.body
-import (application, [start/1]).
-import (httpc, [request/4]).
-import (file, [read_file/1]).

init() ->
	application:start(asn1),
	application:start(crypto),
	application:start(public_key),
	application:start(ssl),
	application:start(inets).

delete_modelmanage_stream() ->
	{ok, Response} = httpc:request(delete,
                                 { "https://localhost:8003/1/sensor/:sensor", [], [], [] },
                                 [], []).
requests.delete('https://localhost:8002/1/sensor/:sensor')
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

sensor
string
required

The name of the sensor to delete

 
Suggest Edits

/control/sensor

Returns a list of all attached sensors

 
get/control/sensor
curl -k https://localhost:8002/1/control/sensor
A binary file was returned

You couldn't be authenticated

[
  {
    "id": 3,
    "tap": "sys.memory",
    "active": true
  },
  ...
] 
 
Suggest Edits

/control/sensor/available

Returns a list of tapping points

 
get/control/sensor/available
curl -k https://localhost:8002/1/control/sensor/available
A binary file was returned

You couldn't be authenticated

[ "sys.memory", ... ]
 
Suggest Edits

/control/sensor/:id

Retrieves the attached sensor information

 
get/control/sensor/id
curl -k https://localhost:8002/1/control/sensor/3
A binary file was returned

You couldn't be authenticated

{
  "id": 3,
  "tap": "sys.memory",
  "permanent": false
}

Path Params

id
int32
required

The identifier of the attached sensor

 
Suggest Edits

/control/sensor

Attaches a sensor to a tapping point

 
post/control/sensor
curl -k https://localhost:8002/1/control/sensor -X POST -H "Content-Type: application/json" --data-binary @sensor1.json
A binary file was returned

You couldn't be authenticated

{ "id": 3 }
<An error message>
 
Suggest Edits

/swagger

Returns the present API specification

 
get/swagger
curl -i -k https://localhost:8001/1/swagger
var request = require('request');

var options = {
    url: 'https://localhost:8001/1/swagger'
};

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);
require 'net/http'
require 'uri'

uri = URI.parse("https://localhost:8001/1/swagger")
response = Net::HTTP.get_response(uri)

# response.code
# response.body
-import (application, [start/1]).
-import (httpc, [request/1]).

init() ->
	application:start(asn1),
	application:start(crypto),
	application:start(public_key),
	application:start(ssl),
	application:start(inets).

get_connect_health() ->
	{ok, Response} = httpc:request("https://localhost:8001/1/swagger").
requests.get('https://localhost:8001/1/swagger')
A binary file was returned

You couldn't be authenticated

Try the API to see results
 
Suggest Edits

/health

checks the health status of connect

 
get/health
curl -i -k https://localhost:8001/1/health
A binary file was returned

You couldn't be authenticated

{
  "id": "<instance-id>",
  "release": "1.3",
  "built_on": "<build-date-and-time>"
}
 
Suggest Edits

/config

retrieves the current configuration file for connect

 
get/config
curl -i -k https://localhost:8001/1/config
A binary file was returned

You couldn't be authenticated

"fastscore": 
  "fleet": 
    - 
      "api": "model-manage"
      "host": "127.0.0.1"
      "port": 8002
    - 
      "api": "engine"
      "host": "127.0.0.1"
      "port": 8003
    - 
      "api": "connect"
      "host": "127.0.0.1"
      "port": 8001
  "db": 
    "type": "mysql"
    "host": "127.0.0.1"
    "port": 3306
    "username": "root"
    "password": "root"

Query Params

q
string

The name of the section to retrieve, e.g. "pneumo"

 
Suggest Edits

/config

adds a configuration file to connect

 
put/config
curl -k -H "Content-Type: application/x-yaml" --data-binary @config.yaml -X PUT https://localhost:8001/1/config
var request = require('request');

var headers = {
    'Content-Type': 'application/x-yaml'
};

var dataString = '@input_config_file';

var options = {
    url: 'https://localhost:8001/1/config',
    method: 'PUT',
    headers: headers,
    body: dataString
};

function callback(error, response, body) {
    if (!error && (response.statusCode == 201 || response.statusCode == 204)) {
        console.log(body);
    }
}

request(options, callback);
require 'net/http'
require 'uri'

uri = URI.parse("https://localhost:8001/1/config")
request = Net::HTTP::Put.new(uri)
request.content_type = "application/x-yaml"
request.body = ""
request.body << File.read("input_config_file").delete("\r\n")

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

# response.code
# response.body
-import (application, [start/1]).
-import (httpc, [request/4]).
-import (file, [read_file/1]).

init() ->
	application:start(asn1),
	application:start(crypto),
	application:start(public_key),
	application:start(ssl),
	application:start(inets).

put_connect_config() ->
	{ok, File} = read_file("config_file"),

	HTTPOptions = [{body_format, binary}],

	{ok, Response} = httpc:request(post,
                                 { "https://localhost:8001/1/config", [], [], File },
                                 HTTPOptions, []).
headers = {
    'content-type': 'application/x-yaml',
}

data = open('input_config_file')
requests.put('https://localhost:8001/1/config', headers=headers, data=data)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Body Params

config
string

The FastScore configuration

 
Suggest Edits

/connect

Returns current information about the FastScore fleet

 
get/connect
curl -k https://localhost:8001/1/connect?api=model-manage&return=host,port
A binary file was returned

You couldn't be authenticated

<An error message>

Query Params

name
string

Return info for the named service only

api
string

Return only services providing the API

host
string

Return only services running on the host

port
int32

Return only services that use use the port

release
string

Return only services that run the release

health
string

Return only services with the health status

return
string

A comma-separated list of fields to return