summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/generic
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/api/handlers/generic')
-rw-r--r--pkg/api/handlers/generic/config.go9
-rw-r--r--pkg/api/handlers/generic/containers_create.go6
-rw-r--r--pkg/api/handlers/generic/swagger.go24
3 files changed, 34 insertions, 5 deletions
diff --git a/pkg/api/handlers/generic/config.go b/pkg/api/handlers/generic/config.go
new file mode 100644
index 000000000..f715d25eb
--- /dev/null
+++ b/pkg/api/handlers/generic/config.go
@@ -0,0 +1,9 @@
+package generic
+
+// ContainerCreateResponse is the response struct for creating a container
+type ContainerCreateResponse struct {
+ // ID of the container created
+ Id string `json:"Id"`
+ // Warnings during container creation
+ Warnings []string `json:"Warnings"`
+}
diff --git a/pkg/api/handlers/generic/containers_create.go b/pkg/api/handlers/generic/containers_create.go
index ef5337abd..f98872690 100644
--- a/pkg/api/handlers/generic/containers_create.go
+++ b/pkg/api/handlers/generic/containers_create.go
@@ -71,11 +71,7 @@ func CreateContainer(w http.ResponseWriter, r *http.Request) {
return
}
- type ctrCreateResponse struct {
- Id string `json:"Id"`
- Warnings []string `json:"Warnings"`
- }
- response := ctrCreateResponse{
+ response := ContainerCreateResponse{
Id: ctr.ID(),
Warnings: []string{}}
diff --git a/pkg/api/handlers/generic/swagger.go b/pkg/api/handlers/generic/swagger.go
new file mode 100644
index 000000000..8df961b94
--- /dev/null
+++ b/pkg/api/handlers/generic/swagger.go
@@ -0,0 +1,24 @@
+package generic
+
+// Create container
+// swagger:response ContainerCreateResponse
+type swagCtrCreateResponse struct {
+ // in:body
+ Body struct {
+ ContainerCreateResponse
+ }
+}
+
+// Wait container
+// swagger:response ContainerWaitResponse
+type swagCtrWaitResponse struct {
+ // in:body
+ Body struct {
+ // container exit code
+ StatusCode int
+ error message
+ Error struct {
+ Message string
+ }
+ }
+}