MCPcopy Create free account
hub / github.com/calfonso/rusternetes / k8sCreate

Function k8sCreate

console/src/engine/query.ts:77–87  ·  view source on GitHub ↗
(
  apiPath: string,
  resource: Partial<T>,
)

Source from the content-addressed store, hash-verified

75
76/** Create a resource. */
77export async function k8sCreate<T extends K8sResource>(
78 apiPath: string,
79 resource: Partial<T>,
80): Promise<T> {
81 const res = await fetch(`${apiBase()}${apiPath}`, {
82 method: "POST",
83 headers: { ...headers(), "Content-Type": "application/json" },
84 body: JSON.stringify(resource),
85 });
86 return handleResponse(res);
87}
88
89/** Update (PUT) a resource. */
90export async function k8sUpdate<T extends K8sResource>(

Callers 3

handleQuickDeployFunction · 0.90
handleYamlCreateFunction · 0.90
handleCreateFunction · 0.90

Calls 3

apiBaseFunction · 0.85
headersFunction · 0.85
handleResponseFunction · 0.85

Tested by

no test coverage detected