export type GetApiApiV1betaWorkloadsNameProxyLogsArgs = {name: string}; export type GetApiApiV1betaWorkloadsNameProxyLogsOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Get proxy logs for a specific workload * * GET /api/v1beta/workloads/{name}/proxy-logs */ export const getApiApiV1betaWorkloadsNameProxyLogs = async (args: GetApiApiV1betaWorkloadsNameProxyLogsArgs, options: GetApiApiV1betaWorkloadsNameProxyLogsOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "text/plain") const url = `${baseUrl.replace(/\/+$/, '')}/api/v1beta/workloads/${encodeURIComponent(String(args.name))}/proxy-logs${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.text() };