summaryrefslogtreecommitdiff
path: root/pkg/api
diff options
context:
space:
mode:
authorOndra Machacek <omachace@redhat.com>2021-12-02 13:44:35 +0100
committerOndra Machacek <omachace@redhat.com>2021-12-03 12:11:28 +0100
commitc9ad1da51c6b1aa7eb531a2f9951aa853bdea109 (patch)
tree8e94a4877172747dbfa308d5db2099ddc80dd9ad /pkg/api
parenta6d1220ac08456dcc075b85b168def3ffeadb58d (diff)
downloadpodman-c9ad1da51c6b1aa7eb531a2f9951aa853bdea109.tar.gz
podman-c9ad1da51c6b1aa7eb531a2f9951aa853bdea109.tar.bz2
podman-c9ad1da51c6b1aa7eb531a2f9951aa853bdea109.zip
Add restart-sec option to systemd generate
Signed-off-by: Ondra Machacek <omachace@redhat.com>
Diffstat (limited to 'pkg/api')
-rw-r--r--pkg/api/handlers/libpod/generate.go2
-rw-r--r--pkg/api/server/register_generate.go5
2 files changed, 7 insertions, 0 deletions
diff --git a/pkg/api/handlers/libpod/generate.go b/pkg/api/handlers/libpod/generate.go
index 1411c680e..88fd69d45 100644
--- a/pkg/api/handlers/libpod/generate.go
+++ b/pkg/api/handlers/libpod/generate.go
@@ -22,6 +22,7 @@ func GenerateSystemd(w http.ResponseWriter, r *http.Request) {
NoHeader bool `schema:"noHeader"`
TemplateUnitFile bool `schema:"templateUnitFile"`
RestartPolicy *string `schema:"restartPolicy"`
+ RestartSec uint `schema:"restartSec"`
StopTimeout uint `schema:"stopTimeout"`
StartTimeout uint `schema:"startTimeout"`
ContainerPrefix string `schema:"containerPrefix"`
@@ -53,6 +54,7 @@ func GenerateSystemd(w http.ResponseWriter, r *http.Request) {
ContainerPrefix: query.ContainerPrefix,
PodPrefix: query.PodPrefix,
Separator: query.Separator,
+ RestartSec: &query.RestartSec,
}
report, err := containerEngine.GenerateSystemd(r.Context(), utils.GetName(r), options)
diff --git a/pkg/api/server/register_generate.go b/pkg/api/server/register_generate.go
index 0e36394cf..65340bf56 100644
--- a/pkg/api/server/register_generate.go
+++ b/pkg/api/server/register_generate.go
@@ -67,6 +67,11 @@ func (s *APIServer) registerGenerateHandlers(r *mux.Router) error {
// type: string
// default: "-"
// description: Systemd unit name separator between name/id and prefix.
+ // - in: query
+ // name: restartSec
+ // type: integer
+ // default: 0
+ // description: Configures the time to sleep before restarting a service.
// produces:
// - application/json
// responses: