MCPcopy Index your code
hub / github.com/1Panel-dev/KubePi / createWorkLoad

Function createWorkLoad

web/dashboard/src/api/workloads.js:124–141  ·  view source on GitHub ↗
(cluster_name, type, namespace, data)

Source from the content-addressed store, hash-verified

122}
123
124export function createWorkLoad (cluster_name, type, namespace, data) {
125 switch (type) {
126 case "deployments":
127 case "statefulsets":
128 case "daemonsets":
129 return post(`${appsV1UrlWithNsUrl(cluster_name, type, namespace)}`, data)
130 case "cronjobs":
131 return post(
132 `${batchV1WithNsUrl(cluster_name, type, namespace)}`,
133 data
134 )
135 case "pods":
136 case "services":
137 return post(`${apiV1UrlWithNsUrl(cluster_name, type, namespace)}`, data)
138 case "jobs":
139 return post(`${batchV1WithNsUrl(cluster_name, type, namespace)}`, data)
140 }
141}
142
143export function updateWorkLoad (cluster_name, type, namespace, name, data) {
144 switch (type) {

Callers

nothing calls this directly

Calls 4

postFunction · 0.90
appsV1UrlWithNsUrlFunction · 0.85
batchV1WithNsUrlFunction · 0.85
apiV1UrlWithNsUrlFunction · 0.85

Tested by

no test coverage detected