MCPcopy Create free account
hub / github.com/OpenSN-Library/OpenSN-Library / UpdateWebShellRequest

Function UpdateWebShellRequest

daemon/pkg/synchronizer/webshell.go:13–29  ·  view source on GitHub ↗
(nodeIndex int, webShellRequest *model.WebShellAllocRequest)

Source from the content-addressed store, hash-verified

11)
12
13func UpdateWebShellRequest(nodeIndex int, webShellRequest *model.WebShellAllocRequest) error {
14 webShellRequestKeyBase := fmt.Sprintf(key.NodeWebshellRequestKeyTemplate, nodeIndex)
15 webShellRequestKey := fmt.Sprintf("%s/%s", webShellRequestKeyBase, webShellRequest.WebShellID)
16 webShellRequestSeq, err := json.Marshal(webShellRequest)
17 if err != nil {
18 return fmt.Errorf("update webshell request error: %s", err.Error())
19 }
20 _, err = utils.EtcdClient.Put(
21 context.Background(),
22 webShellRequestKey,
23 string(webShellRequestSeq),
24 )
25 if err != nil {
26 return fmt.Errorf("update webshell request error: %s", err.Error())
27 }
28 return nil
29}
30
31func UpdateGetWebshellInfo(nodeIndex int, webShellID string, info *model.WebShellAllocInfo) error {
32 info.WebShellID = webShellID

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected