mirror of
https://github.com/containers/podman.git
synced 2025-09-11 00:54:42 +08:00
@ -414,7 +414,7 @@ func Prune(w http.ResponseWriter, r *http.Request) {
|
|||||||
type response struct {
|
type response struct {
|
||||||
NetworksDeleted []string
|
NetworksDeleted []string
|
||||||
}
|
}
|
||||||
var prunedNetworks []string //nolint
|
prunedNetworks := []string{}
|
||||||
for _, pr := range pruneReports {
|
for _, pr := range pruneReports {
|
||||||
if pr.Error != nil {
|
if pr.Error != nil {
|
||||||
logrus.Error(pr.Error)
|
logrus.Error(pr.Error)
|
||||||
|
@ -77,10 +77,3 @@ type swagCompatNetworkDisconnectRequest struct {
|
|||||||
// in:body
|
// in:body
|
||||||
Body struct{ types.NetworkDisconnect }
|
Body struct{ types.NetworkDisconnect }
|
||||||
}
|
}
|
||||||
|
|
||||||
// Network prune
|
|
||||||
// swagger:response NetworkPruneResponse
|
|
||||||
type swagCompatNetworkPruneResponse struct {
|
|
||||||
// in:body
|
|
||||||
Body []string
|
|
||||||
}
|
|
||||||
|
@ -190,5 +190,8 @@ func Prune(w http.ResponseWriter, r *http.Request) {
|
|||||||
utils.Error(w, "Something went wrong.", http.StatusInternalServerError, err)
|
utils.Error(w, "Something went wrong.", http.StatusInternalServerError, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if pruneReports == nil {
|
||||||
|
pruneReports = []*entities.NetworkPruneReport{}
|
||||||
|
}
|
||||||
utils.WriteResponse(w, http.StatusOK, pruneReports)
|
utils.WriteResponse(w, http.StatusOK, pruneReports)
|
||||||
}
|
}
|
||||||
|
@ -119,6 +119,13 @@ type swagNetworkCreateReport struct {
|
|||||||
Body entities.NetworkCreateReport
|
Body entities.NetworkCreateReport
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Network prune
|
||||||
|
// swagger:response NetworkPruneResponse
|
||||||
|
type swagNetworkPruneResponse struct {
|
||||||
|
// in:body
|
||||||
|
Body []entities.NetworkPruneReport
|
||||||
|
}
|
||||||
|
|
||||||
func ServeSwagger(w http.ResponseWriter, r *http.Request) {
|
func ServeSwagger(w http.ResponseWriter, r *http.Request) {
|
||||||
path := DefaultPodmanSwaggerSpec
|
path := DefaultPodmanSwaggerSpec
|
||||||
if p, found := os.LookupEnv("PODMAN_SWAGGER_SPEC"); found {
|
if p, found := os.LookupEnv("PODMAN_SWAGGER_SPEC"); found {
|
||||||
|
@ -180,9 +180,12 @@ func (s *APIServer) registerNetworkHandlers(r *mux.Router) error {
|
|||||||
// 200:
|
// 200:
|
||||||
// description: OK
|
// description: OK
|
||||||
// schema:
|
// schema:
|
||||||
// type: array
|
// type: object
|
||||||
// items:
|
// properties:
|
||||||
// type: string
|
// NetworksDeleted:
|
||||||
|
// type: array
|
||||||
|
// items:
|
||||||
|
// type: string
|
||||||
// 500:
|
// 500:
|
||||||
// $ref: "#/responses/InternalError"
|
// $ref: "#/responses/InternalError"
|
||||||
r.HandleFunc(VersionedPath("/networks/prune"), s.APIHandler(compat.Prune)).Methods(http.MethodPost)
|
r.HandleFunc(VersionedPath("/networks/prune"), s.APIHandler(compat.Prune)).Methods(http.MethodPost)
|
||||||
|
Reference in New Issue
Block a user