MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / baseRpcCall

Function baseRpcCall

vmm/ui/src/composables/useVmManager.ts:499–513  ·  view source on GitHub ↗
(pathname: string, params: Record<string, unknown> = {})

Source from the content-addressed store, hash-verified

497 }
498
499 async function baseRpcCall(pathname: string, params: Record<string, unknown> = {}) {
500 const response = await fetch(makeBaseUrl(pathname), {
501 method: 'POST',
502 headers: {
503 'Content-Type': 'application/json',
504 },
505 body: JSON.stringify(params),
506 });
507 if (!response.ok) {
508 const error = await response.text();
509 errorMessage.value = error;
510 throw new Error(error);
511 }
512 return response;
513 }
514
515 const guestRpcCall: JsonRpcCall = (method, params) => baseRpcCall(`/guest/${method}`, params);
516

Callers 5

guestRpcCallFunction · 0.85
loadSupervisorProcessesFunction · 0.85
svStopFunction · 0.85
svRemoveFunction · 0.85
svClearFunction · 0.85

Calls 1

makeBaseUrlFunction · 0.85

Tested by

no test coverage detected