26 lines
685 B
JavaScript
26 lines
685 B
JavaScript
import { apiRequest } from "./request.js";
|
|
|
|
export function listServices(query) {
|
|
return apiRequest("/v1/services", { query });
|
|
}
|
|
|
|
export function getService(id) {
|
|
return apiRequest(`/v1/services/${id}`);
|
|
}
|
|
|
|
export function createService(payload) {
|
|
return apiRequest("/v1/services", { body: payload });
|
|
}
|
|
|
|
export function updateService(id, payload) {
|
|
return apiRequest(`/v1/services/${id}`, { method: "PATCH", body: payload });
|
|
}
|
|
|
|
export function updateServiceStatus(id, status) {
|
|
return apiRequest(`/v1/services/${id}/status`, { method: "PATCH", body: { status } });
|
|
}
|
|
|
|
export function restartService(id) {
|
|
return apiRequest(`/v1/services/${id}/restart`, { body: {} });
|
|
}
|