diff --git a/controllers/workspace.go b/controllers/workspace.go index 837c05e..ed460fd 100644 --- a/controllers/workspace.go +++ b/controllers/workspace.go @@ -57,9 +57,19 @@ func (o *WorkspaceController) Put() { // @Success 200 {workspace} models.workspace // @router / [post] func (o *WorkspaceController) Post() { + var paths = map[string]map[tools.METHOD]string{ + utils.PEER.String(): { // paths to call to status of peers + tools.POST: oclib.GetPath(oclib.LibDataEnum(oclib.PEER)) + "/oc", + }, + utils.WORKSPACE.String(): { // paths to call to delete/update workspace on peer destination + tools.PUT: oclib.GetPath(oclib.LibDataEnum(oclib.WORKFLOW)) + "/oc/workspace/:id", + tools.DELETE: oclib.GetPath(oclib.LibDataEnum(oclib.WORKFLOW)) + "/oc/workspace/:id", + }, + } + caller := tools.NewHTTPCaller(paths) // generate a http caller to send to peer shared workspace var res map[string]interface{} json.Unmarshal(o.Ctx.Input.CopyBody(10000), &res) - o.Data["json"] = oclib.StoreOne(oclib.LibDataEnum(oclib.WORKSPACE), res) + o.Data["json"] = oclib.StoreOne(oclib.LibDataEnum(oclib.WORKSPACE), res, caller) o.ServeJSON() }