Skip to main content
POST
/
api
/
services
/
{domain}
/
{service}
/
restart
Restart Service
curl --request POST \
  --url https://api.example.com/api/services/{domain}/{service}/restart \
  --header 'Content-Type: application/json' \
  --data '
{
  "config": "<string>"
}
'
{
  "200": {},
  "404": {},
  "500": {},
  "status": "<string>"
}

Endpoint

POST /api/services/{domain}/{service}/restart

Path Parameters

domain
string
required
The domain/namespace of the service
service
string
required
The service name to restart

Request Body

config
bytes
Optional new configuration data to apply when restarting the service.The format depends on the service’s expected configuration format (JSON, TOML, binary, etc.)

Response

status
string
Status message indicating restart success or failure

Examples

Restart Without Configuration

curl -X POST http://localhost:9481/api/services/example/hello/restart
Response
{
  "status": "Service restarted successfully"
}

Restart With New Configuration

curl -X POST http://localhost:9481/api/services/ai/txt2img/restart \
  -H "Content-Type: application/json" \
  -d '{"model": "stable-diffusion-v2", "device": "cuda"}'
Response
{
  "status": "Service restarted with new configuration"
}

Use Cases

Update Model Configuration

Restart an AI service to load a different model:
curl -X POST http://localhost:9481/api/services/ai/inference/restart \
  -H "Content-Type: application/json" \
  -d '{"model_path": "/models/llama-3-70b.gguf"}'

Apply Resource Limits

Restart with updated resource constraints:
curl -X POST http://localhost:9481/api/services/data/processor/restart \
  -H "Content-Type: application/json" \
  -d '{"max_memory_mb": 2048, "max_threads": 4}'

Reload Configuration File

Restart service to pick up configuration file changes:
curl -X POST http://localhost:9481/api/services/example/myservice/restart

Status Codes

200
Success
Service restarted successfully
404
Not Found
Service not found
500
Internal Server Error
Service restart failed

Notes

  • Restarting a service will interrupt any ongoing requests
  • The service may take a few seconds to become available after restart
  • Configuration format depends on the service implementation
  • Use Quiesce for graceful shutdown before restart if needed
  • Restart does not reload the component from the repository; use Reload for that

See Also