export type UpdateApiV1SystemServiceServiceNameRunArgs = {service_name: string}; export type UpdateApiV1SystemServiceServiceNameRunOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Runs a specified service * * PUT /v1/system/service/{service_name}/run */ export const updateApiV1SystemServiceServiceNameRun = async (args: UpdateApiV1SystemServiceServiceNameRunArgs, options: UpdateApiV1SystemServiceServiceNameRunOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/v1/system/service/${encodeURIComponent(String(args.service_name))}/run${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };