mirror of
https://github.com/containers/podman.git
synced 2025-11-30 18:18:18 +08:00
42 lines
1.1 KiB
Go
42 lines
1.1 KiB
Go
package server
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/containers/podman/v2/pkg/api/handlers/libpod"
|
|
"github.com/gorilla/mux"
|
|
)
|
|
|
|
func (s *APIServer) registerGenerateHandlers(r *mux.Router) error {
|
|
// swagger:operation GET /libpod/generate/{name:.*}/kube libpod libpodGenerateKube
|
|
// ---
|
|
// tags:
|
|
// - containers
|
|
// - pods
|
|
// summary: Generate a Kubernetes YAML file.
|
|
// description: Generate Kubernetes YAML based on a pod or container.
|
|
// parameters:
|
|
// - in: path
|
|
// name: name:.*
|
|
// type: string
|
|
// required: true
|
|
// description: Name or ID of the container or pod.
|
|
// - in: query
|
|
// name: service
|
|
// type: boolean
|
|
// default: false
|
|
// description: Generate YAML for a Kubernetes service object.
|
|
// produces:
|
|
// - application/json
|
|
// responses:
|
|
// 200:
|
|
// description: no error
|
|
// schema:
|
|
// type: string
|
|
// format: binary
|
|
// 500:
|
|
// $ref: "#/responses/InternalError"
|
|
r.HandleFunc(VersionedPath("/libpod/generate/{name:.*}/kube"), s.APIHandler(libpod.GenerateKube)).Methods(http.MethodGet)
|
|
return nil
|
|
}
|