Process Manager

Process Manager

Documentation
Introduction

Welcome to the SIGMA Process Manager API.

The Process Manager API allows you to manage processes in the intranet partitions.

The API documentation will start with a general overview about the design and technology that has been implemented, followed by reference information about specific endpoints.

Requests

Any tool that is fluent in HTTP can communicate with the API simply by requesting the correct URI. Requests should be made using the HTTPS protocol so that traffic is encrypted. The interface responds to different methods depending on the action required.

Method Usage
GET For simple retrieval of information about processes and their status, you should use the GET method. The information you request will be returned to you as a JSON object. The attributes defined by the JSON object can be used to form additional requests. Any request using the GET method is read-only and will not affect any of the objects you are querying.
DELETE To destroy a process and remove it from the partition, the DELETE method should be used. This will remove the specified object if it is found. If it is not found, the operation will return a response indicating that the object was not found. This idempotency means that you do not have to check for a resource’s availability prior to issuing a delete command, the final state will be the same regardless of its existence.
PUT To update the information about a process in its partitions, the PUT method is available. Like the DELETE Method, the PUT method is idempotent. It sets the state of the target using the provided values, regardless of their current values. Requests using the PUT method do not need to check the current attributes of the object. This method is thought to perform operations defined in Perform an operation on a process,
POST To create a new process, your request should specify the POST method. The POST request includes all of the attributes necessary to create a new object. When you wish to create a new object, send a POST request to the target endpoint.
Responses

When a request is successful, a response body will typically be sent back in the form of a JSON object. An exception to this is when a DELETE request is processed, which will result in a successful HTTP 204 status and an empty response body.

Inside of this JSON object, the resource root that was the target of the request will be set as the key. This will be always be a plural form of the word, for operations on both single object and their collection.

RESPONSE FOR A GET ON /processes and /processes/{id}

{
    "processes": [
        {
            "id": 1,
            "name": "fibonacci"
            . . .
        },
        {
            "id": 10
            "name": "motors_checkup"
        }
    ]
}

PUT method is allowed on a specific process in order to perform some predefined operations. It returns:

  • 404 if the process does not actually exist, 400
  • 400 if the request is not well formed
  • 200 if the request is well formed - a RequestOperationResult JSON object is returned in this case
API Methods
Processes
GET /processes
POST /processes
GET /processes/{id}
DELETE /processes/{id}
Get all processes
GET /processes

Get a list of all processes on the node and relevant information related to them.

Request parameters

process_name
string optional

If it is specified, the corresponding process is returned (if it exists).

Responses

200 OK
Body
Object
Processes
Array
Object
id
integer
name
string
priority
integer
path
string
status
One of
integer
Enumeration:
0

DORMANT

1

WAITING

2

READY

3

RUNNING

4

SUSPENDEND

type
One of
integer
Enumeration:
0

ONE_SHOT

1

PERIODIC

period
integer

Period duration in milliseconds

404 Not Found

It process_name param is given and no corresponding process exists, this is the response.

Create new process
POST /processes

Create a new process.

Request body

Object
id
integer
name
string
priority
integer
path
string
status
One of
integer
Enumeration:
0

DORMANT

1

WAITING

2

READY

3

RUNNING

4

SUSPENDEND

type
One of
integer
Enumeration:
0

ONE_SHOT

1

PERIODIC

period
integer

Period duration in milliseconds

Responses

201 Created
400 Bad Request
Get a specific process
GET /processes/{id}

Get the specified process.

Path variables

id
integer required

Responses

200 OK
Body
Object
id
integer
name
string
priority
integer
path
string
status
One of
integer
Enumeration:
0

DORMANT

1

WAITING

2

READY

3

RUNNING

4

SUSPENDEND

type
One of
integer
Enumeration:
0

ONE_SHOT

1

PERIODIC

period
integer

Period duration in milliseconds

404 Not Found
Perform an operation on a process
PUT /processes/{id}

Perform an operation on the specified process. Start, suspend, resume and stop are supported operations. RequestOperationType

Path variables

id
string required

Request body

Object
process_id
integer required
name
string
operation
One of required
integer
Enumeration:
0

START

1

SUSPEND

2

RESUME

3

STOP

Responses

200 OK
Body
One of
integer
Enumeration:
0

OK

1

FAILED

Delete a process
DELETE /processes/{id}

Delete the identified process.

Path variables

id
string required

Responses

204 No Content
404 Not Found
Data reference
Process

This object contains all relevant information about a process.

Object
id
integer
name
string
priority
integer
path
string
status
One of
integer
Enumeration:
0

DORMANT

1

WAITING

2

READY

3

RUNNING

4

SUSPENDEND

type
One of
integer
Enumeration:
0

ONE_SHOT

1

PERIODIC

period
integer

Period duration in milliseconds

ProcessStatus

It is an enumeration for the status a process can be found in.

One of
integer
Enumeration:
0

DORMANT

1

WAITING

2

READY

3

RUNNING

4

SUSPENDEND

ProcessType

It is an enumeration for the types of processes that can be allocated.

One of
integer
Enumeration:
0

ONE_SHOT

1

PERIODIC

Request

This is a representation of what requests body consists of.

Object
process_id
integer required
name
string
operation
One of required
integer
Enumeration:
0

START

1

SUSPEND

2

RESUME

3

STOP

RequestOperationResult
One of
integer
Enumeration:
0

OK

1

FAILED

RequestOperationType
One of
integer
Enumeration:
0

START

1

SUSPEND

2

RESUME

3

STOP

Response

This is a representation of what responses to operations requests consist of.

Object
process_id
integer
process_name
string
process_status
One of
integer
Enumeration:
0

DORMANT

1

WAITING

2

READY

3

RUNNING

4

SUSPENDEND

operation_result
One of
integer
Enumeration:
0

OK

1

FAILED

description
string
Parameters
process_name
string optional

Used for retrieving a process whose id id not known. (Get all processes) If a process with the specified name exists, it is returned.

Example:
fibonacci
Headers
Content-Type
string required
Example:
application/json
Responses
200 No Content
404 Not Found
201 Created

Used when a process is created successfully. (Create new process)