Skip to content

Commit

Permalink
Merge pull request containers#11271 from jwhonce/issues/8577
Browse files Browse the repository at this point in the history
Clean up swagger
  • Loading branch information
openshift-merge-robot authored Aug 19, 2021
2 parents aed232b + 0897946 commit a3f4fbd
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 41 deletions.
10 changes: 0 additions & 10 deletions pkg/api/handlers/compat/swagger.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package compat

import (
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/containers/storage/pkg/archive"
"github.com/docker/docker/api/types"
)

Expand All @@ -28,15 +27,6 @@ type swagCtrWaitResponse struct {
}
}

// Object Changes
// swagger:response Changes
type swagChangesResponse struct {
// in:body
Body struct {
Changes []archive.Change
}
}

// Network inspect
// swagger:response CompatNetworkInspect
type swagCompatNetworkInspect struct {
Expand Down
16 changes: 0 additions & 16 deletions pkg/api/handlers/swagger/swagger.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,6 @@ type swagPodTopResponse struct {
}
}

// List processes in pod
// swagger:response DocsPodStatsResponse
type swagPodStatsResponse struct {
// in:body
Body []*entities.PodStatsReport
}

// Inspect container
// swagger:response LibpodInspectContainerResponse
type swagLibpodInspectContainerResponse struct {
Expand All @@ -183,12 +176,3 @@ type swagInspectPodResponse struct {
define.InspectPodData
}
}

// Inspect volume
// swagger:response InspectVolumeResponse
type swagInspectVolumeResponse struct {
// in:body
Body struct {
define.InspectVolumeData
}
}
1 change: 1 addition & 0 deletions pkg/api/handlers/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ type ContainerWaitOKBody struct {
}

// CreateContainerConfig used when compatible endpoint creates a container
// swagger:model CreateContainerConfig
type CreateContainerConfig struct {
Name string // container name
dockerContainer.Config // desired container configuration
Expand Down
6 changes: 6 additions & 0 deletions pkg/api/server/register_containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// name: name
// type: string
// description: container name
// - in: body
// name: body
// description: Container to create
// schema:
// $ref: "#/definitions/CreateContainerConfig"
// required: true
// responses:
// 201:
// $ref: "#/responses/ContainerCreateResponse"
Expand Down
35 changes: 28 additions & 7 deletions pkg/api/server/register_images.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// produces:
// - application/json
// parameters:
// - in: header
// name: X-Registry-Auth
// type: string
// description: A base64-encoded auth configuration.
// - in: query
// name: fromImage
// type: string
Expand All @@ -49,13 +53,8 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// name: platform
// type: string
// description: Platform in the format os[/arch[/variant]]
// default: ""
// - in: header
// name: X-Registry-Auth
// type: string
// description: A base64-encoded auth configuration.
// - in: body
// name: request
// name: inputImage
// schema:
// type: string
// format: binary
Expand Down Expand Up @@ -472,6 +471,14 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// summary: Create image
// description: Build an image from the given Dockerfile(s)
// parameters:
// - in: header
// name: Content-Type
// type: string
// default: application/x-tar
// enum: ["application/x-tar"]
// - in: header
// name: X-Registry-Config
// type: string
// - in: query
// name: dockerfile
// type: string
Expand Down Expand Up @@ -653,6 +660,14 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// description: |
// output configuration TBD
// (As of version 1.xx)
// - in: body
// name: inputStream
// description: |
// A tar archive compressed with one of the following algorithms:
// identity (no compression), gzip, bzip2, xz.
// schema:
// type: string
// format: binary
// produces:
// - application/json
// responses:
Expand Down Expand Up @@ -852,6 +867,11 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// summary: Import image
// description: Import a previously exported tarball as an image.
// parameters:
// - in: header
// name: Content-Type
// type: string
// default: application/x-tar
// enum: ["application/x-tar"]
// - in: query
// name: changes
// description: "Apply the following possible instructions to the created image: CMD | ENTRYPOINT | ENV | EXPOSE | LABEL | STOPSIGNAL | USER | VOLUME | WORKDIR. JSON encoded string"
Expand All @@ -875,7 +895,8 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// required: true
// description: tarball for imported image
// schema:
// type: "string"
// type: string
// format: binary
// produces:
// - application/json
// consumes:
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/server/register_pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (s *APIServer) registerPodsHandlers(r *mux.Router) error {
// responses:
// 201:
// schema:
// $ref: "#/definitions/IdResponse"
// $ref: "#/definitions/IDResponse"
// 400:
// $ref: "#/responses/BadParamError"
// 409:
Expand Down
7 changes: 0 additions & 7 deletions pkg/api/server/swagger.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,6 @@ type swagImageSummary struct {
Body []entities.ImageSummary
}

// Registries summary
// swagger:response DocsRegistriesList
type swagRegistriesList struct {
// in:body
Body entities.ListRegistriesReport
}

// List Containers
// swagger:response DocsListContainer
type swagListContainers struct {
Expand Down

0 comments on commit a3f4fbd

Please sign in to comment.