All pages
Powered by GitBook
1 of 1

Loading...

Command

Send a command to a process

There are basically two commands you can give to a process: start or stop. This is the order for the process.

Additionally to these two commands are the commands restart which is sending a stop followed by a start command packed in one command, and reload which is the same as if you would update the process config with itself, e.g. in order to update references to another process.

  • start the process. If the process is already started, this won't have any effect.

  • stop the process. If the process is already stopped, this won't have any effect.

  • restart the process. If the process is not running, this won't have any effect.

  • reload the process. If the process was running, the reloaded process will start automatically.

Example:

Description:

curl http://127.0.0.1:8080/api/v3/process/test \
   -H 'accept: application/json' \
   -H 'Content-Type: application/json' \
   -X PUT \
   -d '{
         "command": "stop"
      }'
from core_client import Client

client = Client(
    base_url="http://127.0.0.1:8080"
)
client.login()

client.v3_process_put_command(
    id="test",
    command="stop"
)
import (
    "github.com/datarhei/core-client-go/v16"
)

client, _ := coreclient.New(coreclient.Config{
    Address: "https://127.0.0.1:8080",
})

err := client.ProcessCommand("test", "stop")
if err != nil {
    ...
}

Issue a command to a process

put

Issue a command to a process: start, stop, reload, restart

Authorizations
AuthorizationstringRequired
Path parameters
idstringRequired

Process ID

Body
commandstring · enumRequiredPossible values:
Responses
200

OK

application/json
400

Bad Request

application/json
404

Not Found

application/json
put
/api/v3/process/{id}/command
text
PUT /api/v3/process/{id}/command HTTP/1.1
Host: /
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 19

{
  "command": "start"
}