Home | API

Process

Get PM2 process list

Method

process.list

Parameters

Name Type Description Required
id string / number The identifier of the request. Yes
jsonrpc string The protocol version. Yes
method string The method name. Yes
params object The parameters of the request. Yes

Result

Name Type Description Required
id string / number The identifier of the request. Yes
jsonrpc string The protocol version. Yes
result array Result. Yes
result.pid number Process ID. Yes
result.name number Process name. Yes
result.pm_id number PM2 process ID. Yes
result.status string PM2 process status. Yes
result.monit.memory number Used memory. (KB) Yes
result.monit.cpu number Used processor. (%) Yes

Request

{
    "id": "unique-request-id",
	"jsonrpc": "2.0",
	"method": "process.list",
	"params": {}
}

Response

{
    "id": "unique-request-id",
    "jsonrpc": "2.0",
    "result": [
        {
            "pid": 57255,
            "name": "ark-core",
            "pm_id": 0,
            "monit": {
                "memory": 109600,
                "cpu": 0.5
            },
            "status": "online"
        }
    ]
}

Stop pm2 process

Method

process.stop

Parameters

Name Type Description Required
id string / number The identifier of the request. Yes
jsonrpc string The protocol version. Yes
method string The method name. Yes
params object The parameters of the request. Yes
params.name string PM2 process name / ID. Yes

Result

Name Type Description Required
id string / number The identifier of the request. Yes
jsonrpc string The protocol version. Yes
result object Result. Yes
result.name string PM2 process name. Yes
result.status string PM2 process new status. Yes

Request

{
    "id": "unique-request-id",
	"jsonrpc": "2.0",
	"method": "process.stop",
	"params": { "name": "ark-core" }
}

Response

{
    "id": "unique-request-id",
    "jsonrpc": "2.0",
    "result": {
        "name": "ark-core",
        "status": "stopped"
    }
}

Start core process

Method

process.start

Parameters

Name Type Description Required
id string / number The identifier of the request. Yes
jsonrpc string The protocol version. Yes
method string The method name. Yes
params object The parameters of the request. Yes
params.name string Core process name (core, relay, forger). Yes
params.args string Process arguments. Yes

Result

Name Type Description Required
id string / number The identifier of the request. Yes
jsonrpc string The protocol version. Yes
result object Result. Yes

Request

{
    "id": "unique-request-id",
	"jsonrpc": "2.0",
	"method": "process.start",
	"params": { "name": "core", "args": "--network=testnet --env=test" }
}

Response

{
    "id": "unique-request-id",
    "jsonrpc": "2.0",
    "result": {}
}

Restart PM2 process

Method

process.restart

Parameters

Name Type Description Required
id string / number The identifier of the request. Yes
jsonrpc string The protocol version. Yes
method string The method name. Yes
params object The parameters of the request. Yes
params.name string PM2 process name. Yes

Result

Name Type Description Required
id string / number The identifier of the request. Yes
jsonrpc string The protocol version. Yes
result object Result. Yes
result.name string PM2 process name. Yes
result.status string PM2 process status. Yes

Request

{
    "id": "unique-request-id",
	"jsonrpc": "2.0",
	"method": "process.restart",
	"params": { "name": "ark-core" }
}

Response

{
    "id": "unique-request-id",
    "jsonrpc": "2.0",
    "result": {
        "name": "ark-core",
        "status": "online"
    }
}
2020 © ARK.io | All rights reserved An ARK.io Product