Skip to content

Commit 6e3abc3

Browse files
kvapsclaude
andcommitted
feat(rest): 501 stub for /v1/actions/snapshot/multi
golinstor uses this for atomic multi-RD group snapshots. Cozystack runs PVCs as independent RDs with independent snapshot lifecycles, so the multi-RD consistency point isn't needed. Returning 501 keeps the contract honest and lets the client fall back to per-RD snapshots without ambiguity. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
1 parent 8a1421c commit 6e3abc3

2 files changed

Lines changed: 38 additions & 0 deletions

File tree

pkg/rest/server.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ func (s *Server) buildMux() *http.ServeMux {
121121
s.registerSOSReport(mux)
122122
s.registerRemotes(mux)
123123
s.registerNodeConnections(mux)
124+
s.registerSnapshotMulti(mux)
124125

125126
return mux
126127
}

pkg/rest/snapshot_multi.go

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
Copyright 2026 Cozystack contributors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package rest
18+
19+
import (
20+
"net/http"
21+
)
22+
23+
// registerSnapshotMulti wires `POST /v1/actions/snapshot/multi`. golinstor
24+
// uses this to take an atomic group snapshot across several
25+
// ResourceDefinitions in a single call. Cozystack does not run multi-RD
26+
// applications that require a single consistency point on the LINSTOR
27+
// side (each PVC is its own RD with its own snapshot lifecycle), so this
28+
// is intentionally out-of-scope. Returning 501 keeps the contract clean
29+
// and lets clients fall back to per-RD snapshots.
30+
func (s *Server) registerSnapshotMulti(mux *http.ServeMux) {
31+
mux.HandleFunc("POST /v1/actions/snapshot/multi", handleSnapshotMultiNotImplemented)
32+
}
33+
34+
func handleSnapshotMultiNotImplemented(w http.ResponseWriter, _ *http.Request) {
35+
writeError(w, http.StatusNotImplemented,
36+
"multi-resource snapshot is not implemented; take per-RD snapshots instead")
37+
}

0 commit comments

Comments
 (0)