Skip to content

Commit

Permalink
[CI:DOCS] Set all operation id to be compatibile
Browse files Browse the repository at this point in the history
Libpod operation id's changed to better match compatibile id

Builds on containers#9123 and corrects
a duplicated ID.

Signed-off-by: Jhon Honce <[email protected]>
  • Loading branch information
jwhonce authored and jmguzik committed Apr 26, 2021
1 parent 359663c commit 83e0f63
Show file tree
Hide file tree
Showing 20 changed files with 135 additions and 159 deletions.
12 changes: 6 additions & 6 deletions pkg/api/server/docs.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package api Provides a container compatible interface.
// Package api Provides an API for the Libpod library
//
// This documentation describes the Podman v2.0 RESTful API.
// It replaces the Podman v1.0 API and was initially delivered
Expand All @@ -21,22 +21,22 @@
//
// 'podman info'
//
// curl --unix-socket /run/podman/podman.sock http://d/v1.0.0/libpod/info
// curl --unix-socket /run/podman/podman.sock http://d/v3.0.0/libpod/info
//
// 'podman pull quay.io/containers/podman'
//
// curl -XPOST --unix-socket /run/podman/podman.sock -v 'http://d/v1.0.0/images/create?fromImage=quay.io%2Fcontainers%2Fpodman'
// curl -XPOST --unix-socket /run/podman/podman.sock -v 'http://d/v3.0.0/images/create?fromImage=quay.io%2Fcontainers%2Fpodman'
//
// 'podman list images'
//
// curl --unix-socket /run/podman/podman.sock -v 'http://d/v1.0.0/libpod/images/json' | jq
// curl --unix-socket /run/podman/podman.sock -v 'http://d/v3.0.0/libpod/images/json' | jq
//
// Terms Of Service:
//
// Schemes: http, https
// Host: podman.io
// BasePath: /
// Version: 0.0.1
// Version: 3.2.0
// License: Apache-2.0 https://opensource.org/licenses/Apache-2.0
// Contact: Podman <[email protected]> https://podman.io/community/
//
Expand All @@ -47,8 +47,8 @@
//
// Produces:
// - application/json
// - application/octet-stream
// - text/plain
// - text/html
//
// Consumes:
// - application/json
Expand Down
4 changes: 2 additions & 2 deletions pkg/api/server/register_archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (s *APIServer) registerArchiveHandlers(r *mux.Router) error {
Libpod
*/

// swagger:operation PUT /libpod/containers/{name}/archive libpod libpodPutArchive
// swagger:operation PUT /libpod/containers/{name}/archive libpod PutContainerArchiveLibpod
// ---
// summary: Copy files into a container
// description: Copy a tar archive of files into a container
Expand Down Expand Up @@ -132,7 +132,7 @@ func (s *APIServer) registerArchiveHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"

// swagger:operation GET /libpod/containers/{name}/archive libpod libpodGetArchive
// swagger:operation GET /libpod/containers/{name}/archive libpod ContainerArchiveLibpod
// ---
// summary: Copy files from a container
// description: Copy a tar archive of files from a container
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/server/register_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

func (s *APIServer) registerAuthHandlers(r *mux.Router) error {
// swagger:operation POST /auth compat auth
// swagger:operation POST /auth compat SystemAuth
// ---
// summary: Check auth configuration
// tags:
Expand Down
58 changes: 29 additions & 29 deletions pkg/api/server/register_containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
libpod endpoints
*/

// swagger:operation POST /libpod/containers/create libpod libpodCreateContainer
// swagger:operation POST /libpod/containers/create libpod ContainerCreateLibpod
// ---
// summary: Create a container
// tags:
Expand All @@ -687,7 +687,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/create"), s.APIHandler(libpod.CreateContainer)).Methods(http.MethodPost)
// swagger:operation GET /libpod/containers/json libpod libpodListContainers
// swagger:operation GET /libpod/containers/json libpod ContainerListLibpod
// ---
// tags:
// - containers
Expand Down Expand Up @@ -752,7 +752,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/json"), s.APIHandler(libpod.ListContainers)).Methods(http.MethodGet)
// swagger:operation POST /libpod/containers/prune libpod libpodPruneContainers
// swagger:operation POST /libpod/containers/prune libpod ContainerPruneLibpod
// ---
// tags:
// - containers
Expand All @@ -774,7 +774,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/prune"), s.APIHandler(compat.PruneContainers)).Methods(http.MethodPost)
// swagger:operation GET /libpod/containers/showmounted libpod libpodShowMountedContainers
// swagger:operation GET /libpod/containers/showmounted libpod ShowMountedContainersLibpod
// ---
// tags:
// - containers
Expand All @@ -792,7 +792,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/showmounted"), s.APIHandler(libpod.ShowMountedContainers)).Methods(http.MethodGet)
// swagger:operation DELETE /libpod/containers/{name} libpod libpodRemoveContainer
// swagger:operation DELETE /libpod/containers/{name} libpod ContainerDeleteLibpod
// ---
// tags:
// - containers
Expand Down Expand Up @@ -826,7 +826,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}"), s.APIHandler(compat.RemoveContainer)).Methods(http.MethodDelete)
// swagger:operation GET /libpod/containers/{name}/json libpod libpodGetContainer
// swagger:operation GET /libpod/containers/{name}/json libpod ContainerInspectLibpod
// ---
// tags:
// - containers
Expand All @@ -852,7 +852,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/json"), s.APIHandler(libpod.GetContainer)).Methods(http.MethodGet)
// swagger:operation POST /libpod/containers/{name}/kill libpod libpodKillContainer
// swagger:operation POST /libpod/containers/{name}/kill libpod ContainerKillLibpod
// ---
// tags:
// - containers
Expand Down Expand Up @@ -881,7 +881,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/kill"), s.APIHandler(compat.KillContainer)).Methods(http.MethodPost)
// swagger:operation POST /libpod/containers/{name}/mount libpod libpodMountContainer
// swagger:operation POST /libpod/containers/{name}/mount libpod ContainerMountLibpod
// ---
// tags:
// - containers
Expand All @@ -907,7 +907,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/mount"), s.APIHandler(libpod.MountContainer)).Methods(http.MethodPost)
// swagger:operation POST /libpod/containers/{name}/unmount libpod libpodUnmountContainer
// swagger:operation POST /libpod/containers/{name}/unmount libpod ContainerUnmountLibpod
// ---
// tags:
// - containers
Expand All @@ -929,7 +929,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/unmount"), s.APIHandler(libpod.UnmountContainer)).Methods(http.MethodPost)
// swagger:operation GET /libpod/containers/{name}/logs libpod libpodLogsFromContainer
// swagger:operation GET /libpod/containers/{name}/logs libpod ContainerLogsLibpod
// ---
// tags:
// - containers
Expand Down Expand Up @@ -981,7 +981,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/logs"), s.APIHandler(compat.LogsFromContainer)).Methods(http.MethodGet)
// swagger:operation POST /libpod/containers/{name}/pause libpod libpodPauseContainer
// swagger:operation POST /libpod/containers/{name}/pause libpod ContainerPauseLibpod
// ---
// tags:
// - containers
Expand All @@ -1003,7 +1003,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// "$ref": "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/pause"), s.APIHandler(compat.PauseContainer)).Methods(http.MethodPost)
// swagger:operation POST /libpod/containers/{name}/restart libpod libpodRestartContainer
// swagger:operation POST /libpod/containers/{name}/restart libpod ContainerRestartLibpod
// ---
// tags:
// - containers
Expand All @@ -1028,7 +1028,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/restart"), s.APIHandler(compat.RestartContainer)).Methods(http.MethodPost)
// swagger:operation POST /libpod/containers/{name}/start libpod libpodStartContainer
// swagger:operation POST /libpod/containers/{name}/start libpod ContainerStartLibpod
// ---
// tags:
// - containers
Expand Down Expand Up @@ -1056,7 +1056,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/start"), s.APIHandler(compat.StartContainer)).Methods(http.MethodPost)
// swagger:operation GET /libpod/containers/{name}/stats libpod libpodStatsContainer
// swagger:operation GET /libpod/containers/{name}/stats libpod ContainerStatsLibpod
// ---
// tags:
// - containers
Expand All @@ -1083,7 +1083,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/stats"), s.APIHandler(compat.StatsContainer)).Methods(http.MethodGet)
// swagger:operation GET /libpod/containers/stats libpod libpodStatsContainers
// swagger:operation GET /libpod/containers/stats libpod ContainersStatsAllLibpod
// ---
// tags:
// - containers
Expand Down Expand Up @@ -1112,7 +1112,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/stats"), s.APIHandler(libpod.StatsContainer)).Methods(http.MethodGet)

// swagger:operation GET /libpod/containers/{name}/top libpod libpodTopContainer
// swagger:operation GET /libpod/containers/{name}/top libpod ContainerTopLibpod
// ---
// tags:
// - containers
Expand Down Expand Up @@ -1146,7 +1146,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/top"), s.APIHandler(compat.TopContainer)).Methods(http.MethodGet)
// swagger:operation POST /libpod/containers/{name}/unpause libpod libpodUnpauseContainer
// swagger:operation POST /libpod/containers/{name}/unpause libpod ContainerUnpauseLibpod
// ---
// tags:
// - containers
Expand All @@ -1167,7 +1167,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/unpause"), s.APIHandler(compat.UnpauseContainer)).Methods(http.MethodPost)
// swagger:operation POST /libpod/containers/{name}/wait libpod libpodWaitContainer
// swagger:operation POST /libpod/containers/{name}/wait libpod ContainerWaitLibpod
// ---
// tags:
// - containers
Expand Down Expand Up @@ -1204,7 +1204,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/wait"), s.APIHandler(libpod.WaitContainer)).Methods(http.MethodPost)
// swagger:operation GET /libpod/containers/{name}/exists libpod libpodContainerExists
// swagger:operation GET /libpod/containers/{name}/exists libpod ContainerExistsLibpod
// ---
// tags:
// - containers
Expand All @@ -1226,7 +1226,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/exists"), s.APIHandler(libpod.ContainerExists)).Methods(http.MethodGet)
// swagger:operation POST /libpod/containers/{name}/stop libpod libpodStopContainer
// swagger:operation POST /libpod/containers/{name}/stop libpod ContainerStopLibpod
// ---
// tags:
// - containers
Expand Down Expand Up @@ -1264,7 +1264,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/stop"), s.APIHandler(compat.StopContainer)).Methods(http.MethodPost)
// swagger:operation POST /libpod/containers/{name}/attach libpod libpodAttachContainer
// swagger:operation POST /libpod/containers/{name}/attach libpod ContainerAttachLibpod
// ---
// tags:
// - containers
Expand Down Expand Up @@ -1319,7 +1319,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/attach"), s.APIHandler(compat.AttachContainer)).Methods(http.MethodPost)
// swagger:operation POST /libpod/containers/{name}/resize libpod libpodResizeContainer
// swagger:operation POST /libpod/containers/{name}/resize libpod ContainerResizeLibpod
// ---
// tags:
// - containers
Expand Down Expand Up @@ -1351,7 +1351,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/resize"), s.APIHandler(compat.ResizeTTY)).Methods(http.MethodPost)
// swagger:operation GET /libpod/containers/{name}/export libpod libpodExportContainer
// swagger:operation GET /libpod/containers/{name}/export libpod ContainerExportLibpod
// ---
// tags:
// - containers
Expand All @@ -1373,7 +1373,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/export"), s.APIHandler(compat.ExportContainer)).Methods(http.MethodGet)
// swagger:operation POST /libpod/containers/{name}/checkpoint libpod libpodCheckpointContainer
// swagger:operation POST /libpod/containers/{name}/checkpoint libpod ContainerCheckpointLibpod
// ---
// tags:
// - containers
Expand Down Expand Up @@ -1414,7 +1414,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/checkpoint"), s.APIHandler(libpod.Checkpoint)).Methods(http.MethodPost)
// swagger:operation POST /libpod/containers/{name}/restore libpod libpodRestoreContainer
// swagger:operation POST /libpod/containers/{name}/restore libpod ContainerRestoreLibpod
// ---
// tags:
// - containers
Expand Down Expand Up @@ -1468,8 +1468,8 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/restore"), s.APIHandler(libpod.Restore)).Methods(http.MethodPost)
// swagger:operation GET /containers/{name}/changes libpod ContainerChanges
// swagger:operation GET /libpod/containers/{name}/changes compat changesContainer
// swagger:operation GET /containers/{name}/changes libpod ContainerChangesLibpod
// swagger:operation GET /libpod/containers/{name}/changes compat ContainerChanges
// ---
// tags:
// - containers
Expand Down Expand Up @@ -1501,7 +1501,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
r.HandleFunc(VersionedPath("/containers/{name}/changes"), s.APIHandler(compat.Changes)).Methods(http.MethodGet)
r.HandleFunc("/containers/{name}/changes", s.APIHandler(compat.Changes)).Methods(http.MethodGet)
r.HandleFunc(VersionedPath("/libpod/containers/{name}/changes"), s.APIHandler(compat.Changes)).Methods(http.MethodGet)
// swagger:operation POST /libpod/containers/{name}/init libpod libpodInitContainer
// swagger:operation POST /libpod/containers/{name}/init libpod ContainerInitLibpod
// ---
// tags:
// - containers
Expand All @@ -1525,7 +1525,7 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/containers/{name}/init"), s.APIHandler(libpod.InitContainer)).Methods(http.MethodPost)
// swagger:operation POST /libpod/containers/{name}/rename libpod libpodRenameContainer
// swagger:operation POST /libpod/containers/{name}/rename libpod ContainerRenameLibpod
// ---
// tags:
// - containers
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/server/register_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (s *APIServer) registerEventsHandlers(r *mux.Router) error {
r.Handle(VersionedPath("/events"), s.APIHandler(compat.GetEvents)).Methods(http.MethodGet)
// Added non version path to URI to support docker non versioned paths
r.Handle("/events", s.APIHandler(compat.GetEvents)).Methods(http.MethodGet)
// swagger:operation GET /libpod/events system libpodGetEvents
// swagger:operation GET /libpod/events system SystemEventsLibpod
// ---
// tags:
// - system
Expand Down
10 changes: 5 additions & 5 deletions pkg/api/server/register_exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (s *APIServer) registerExecHandlers(r *mux.Router) error {
// type: boolean
// description: Allocate a pseudo-TTY. Presently ignored.
// produces:
// - application/json
// - application/octet-stream
// responses:
// 200:
// description: no error
Expand Down Expand Up @@ -182,7 +182,7 @@ func (s *APIServer) registerExecHandlers(r *mux.Router) error {
libpod api follows
*/

// swagger:operation POST /libpod/containers/{name}/exec libpod libpodCreateExec
// swagger:operation POST /libpod/containers/{name}/exec libpod ContainerExecLibpod
// ---
// tags:
// - exec
Expand Down Expand Up @@ -249,7 +249,7 @@ func (s *APIServer) registerExecHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/containers/{name}/exec"), s.APIHandler(compat.ExecCreateHandler)).Methods(http.MethodPost)
// swagger:operation POST /libpod/exec/{id}/start libpod libpodStartExec
// swagger:operation POST /libpod/exec/{id}/start libpod ExecStartLibpod
// ---
// tags:
// - exec
Expand Down Expand Up @@ -285,7 +285,7 @@ func (s *APIServer) registerExecHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/exec/{id}/start"), s.APIHandler(compat.ExecStartHandler)).Methods(http.MethodPost)
// swagger:operation POST /libpod/exec/{id}/resize libpod libpodResizeExec
// swagger:operation POST /libpod/exec/{id}/resize libpod ExecResizeLibpod
// ---
// tags:
// - exec
Expand Down Expand Up @@ -316,7 +316,7 @@ func (s *APIServer) registerExecHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/exec/{id}/resize"), s.APIHandler(compat.ResizeTTY)).Methods(http.MethodPost)
// swagger:operation GET /libpod/exec/{id}/json libpod libpodInspectExec
// swagger:operation GET /libpod/exec/{id}/json libpod ExecInspectLibpod
// ---
// tags:
// - exec
Expand Down
4 changes: 2 additions & 2 deletions pkg/api/server/register_generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

func (s *APIServer) registerGenerateHandlers(r *mux.Router) error {
// swagger:operation GET /libpod/generate/{name:.*}/systemd libpod libpodGenerateSystemd
// swagger:operation GET /libpod/generate/{name:.*}/systemd libpod GenerateSystemdLibpod
// ---
// tags:
// - containers
Expand Down Expand Up @@ -75,7 +75,7 @@ func (s *APIServer) registerGenerateHandlers(r *mux.Router) error {
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/libpod/generate/{name:.*}/systemd"), s.APIHandler(libpod.GenerateSystemd)).Methods(http.MethodGet)

// swagger:operation GET /libpod/generate/kube libpod libpodGenerateKube
// swagger:operation GET /libpod/generate/kube libpod GenerateKubeLibpod
// ---
// tags:
// - containers
Expand Down
Loading

0 comments on commit 83e0f63

Please sign in to comment.