(ctx context.Context, rc requestContext)
| 9 | ) |
| 10 | |
| 11 | func handleMountCreate(ctx context.Context, rc requestContext) (any, *apiError) { |
| 12 | req := &serverapi.MountSnapshotRequest{} |
| 13 | if err := json.Unmarshal(rc.body, req); err != nil { |
| 14 | return nil, requestError(serverapi.ErrorMalformedRequest, "malformed request body") |
| 15 | } |
| 16 | |
| 17 | oid, err := object.ParseID(req.Root) |
| 18 | if err != nil { |
| 19 | return nil, requestError(serverapi.ErrorMalformedRequest, "unable to parse OID") |
| 20 | } |
| 21 | |
| 22 | c, err := rc.srv.getMountController(ctx, rc.rep, oid, true) |
| 23 | if err != nil { |
| 24 | return nil, internalServerError(err) |
| 25 | } |
| 26 | |
| 27 | userLog(ctx).Debugf("mount for %v => %v", oid, c.MountPath()) |
| 28 | |
| 29 | return &serverapi.MountedSnapshot{ |
| 30 | Path: c.MountPath(), |
| 31 | Root: oid, |
| 32 | }, nil |
| 33 | } |
| 34 | |
| 35 | func handleMountGet(ctx context.Context, rc requestContext) (any, *apiError) { |
| 36 | oid, err := object.ParseID(rc.muxVar("rootObjectID")) |
nothing calls this directly
no test coverage detected