aboutsummaryrefslogtreecommitdiff
path: root/pkg/api/handlers/swagger/errors.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-05-20 07:16:35 -0400
committerGitHub <noreply@github.com>2022-05-20 07:16:35 -0400
commit916d8231c52eb89fae9982c63a956388fca648c2 (patch)
tree335652b32332e57e092a1bbf80914517190f136e /pkg/api/handlers/swagger/errors.go
parent1916fe22a932183e0847e9f7b087f6ece4d7c48c (diff)
parent5b79cf15a0226dc3dad5053615ee652823376cd3 (diff)
downloadpodman-916d8231c52eb89fae9982c63a956388fca648c2.tar.gz
podman-916d8231c52eb89fae9982c63a956388fca648c2.tar.bz2
podman-916d8231c52eb89fae9982c63a956388fca648c2.zip
Merge pull request #14297 from jwhonce/wip/swagger
Swagger refactor/cleanup
Diffstat (limited to 'pkg/api/handlers/swagger/errors.go')
-rw-r--r--pkg/api/handlers/swagger/errors.go116
1 files changed, 116 insertions, 0 deletions
diff --git a/pkg/api/handlers/swagger/errors.go b/pkg/api/handlers/swagger/errors.go
new file mode 100644
index 000000000..28e11c9fb
--- /dev/null
+++ b/pkg/api/handlers/swagger/errors.go
@@ -0,0 +1,116 @@
+//nolint:deadcode,unused // these types are used to wire generated swagger to API code
+package swagger
+
+import (
+ "github.com/containers/podman/v4/pkg/errorhandling"
+)
+
+// Error model embedded in swagger:response to aid in documentation generation
+
+// No such image
+// swagger:response
+type imageNotFound struct {
+ // in:body
+ Body errorhandling.ErrorModel
+}
+
+// No such container
+// swagger:response
+type containerNotFound struct {
+ // in:body
+ Body errorhandling.ErrorModel
+}
+
+// No such network
+// swagger:response
+type networkNotFound struct {
+ // in:body
+ Body errorhandling.ErrorModel
+}
+
+// No such exec instance
+// swagger:response
+type execSessionNotFound struct {
+ // in:body
+ Body errorhandling.ErrorModel
+}
+
+// No such volume
+// swagger:response
+type volumeNotFound struct {
+ // in:body
+ Body errorhandling.ErrorModel
+}
+
+// No such pod
+// swagger:response
+type podNotFound struct {
+ // in:body
+ Body errorhandling.ErrorModel
+}
+
+// No such manifest
+// swagger:response
+type manifestNotFound struct {
+ // in:body
+ Body errorhandling.ErrorModel
+}
+
+// Internal server error
+// swagger:response
+type internalError struct {
+ // in:body
+ Body errorhandling.ErrorModel
+}
+
+// Conflict error in operation
+// swagger:response
+type conflictError struct {
+ // in:body
+ Body errorhandling.ErrorModel
+}
+
+// Bad parameter in request
+// swagger:response
+type badParamError struct {
+ // in:body
+ Body errorhandling.ErrorModel
+}
+
+// Container already started
+// swagger:response
+type containerAlreadyStartedError struct {
+ // in:body
+ Body errorhandling.ErrorModel
+}
+
+// Container already stopped
+// swagger:response
+type containerAlreadyStoppedError struct {
+ // in:body
+ Body errorhandling.ErrorModel
+}
+
+// Pod already started
+// swagger:response
+type podAlreadyStartedError struct {
+ // in:body
+ Body errorhandling.ErrorModel
+}
+
+// Pod already stopped
+// swagger:response
+type podAlreadyStoppedError struct {
+ // in:body
+ Body errorhandling.ErrorModel
+}
+
+// Success
+// swagger:response
+type ok struct {
+ // in:body
+ Body struct {
+ // example: OK
+ ok string
+ }
+}