summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-08-03 10:05:07 -0400
committerGitHub <noreply@github.com>2020-08-03 10:05:07 -0400
commit70c75bc113a0031b1f4adc95ebe09d32cc740dfe (patch)
tree5f623134344e2d48d51c0245201ddd8bb951a92e
parentaf3676f77229040031656b032c1835a155074b34 (diff)
parent4dbfac6cde9ab4fab9a044cb2eff35f3ffc9491b (diff)
downloadpodman-70c75bc113a0031b1f4adc95ebe09d32cc740dfe.tar.gz
podman-70c75bc113a0031b1f4adc95ebe09d32cc740dfe.tar.bz2
podman-70c75bc113a0031b1f4adc95ebe09d32cc740dfe.zip
Merge pull request #7097 from QiWang19/usagedate
[CI:DOCS] apiv2 fix volumes not included field
-rw-r--r--pkg/api/server/register_volumes.go2
-rw-r--r--pkg/domain/entities/volumes.go56
2 files changed, 51 insertions, 7 deletions
diff --git a/pkg/api/server/register_volumes.go b/pkg/api/server/register_volumes.go
index b509a332a..8f7848ed4 100644
--- a/pkg/api/server/register_volumes.go
+++ b/pkg/api/server/register_volumes.go
@@ -128,7 +128,7 @@ func (s *APIServer) registerVolumeHandlers(r *mux.Router) error {
// The boolean `dangling` filter is not yet implemented for this endpoint.
// responses:
// '200':
- // "$ref": "#/responses/DockerVolumeList"
+ // "$ref": "#/responses/VolumeListResponse"
// '500':
// "$ref": "#/responses/InternalError"
r.Handle(VersionedPath("/volumes"), s.APIHandler(compat.ListVolumes)).Methods(http.MethodGet)
diff --git a/pkg/domain/entities/volumes.go b/pkg/domain/entities/volumes.go
index 2311d1f25..53d30ffdf 100644
--- a/pkg/domain/entities/volumes.go
+++ b/pkg/domain/entities/volumes.go
@@ -59,6 +59,42 @@ type VolumeConfigResponse struct {
Anonymous bool `json:"Anonymous"`
}
+// VolumeInfo Volume list response
+// swagger:model VolumeInfo
+type VolumeInfo struct {
+
+ // Date/Time the volume was created.
+ CreatedAt string `json:"CreatedAt,omitempty"`
+
+ // Name of the volume driver used by the volume. Only supports local driver
+ // Required: true
+ Driver string `json:"Driver"`
+
+ // User-defined key/value metadata.
+ // Always included
+ Labels map[string]string `json:"Labels"`
+
+ // Mount path of the volume on the host.
+ // Required: true
+ Mountpoint string `json:"Mountpoint"`
+
+ // Name of the volume.
+ // Required: true
+ Name string `json:"Name"`
+
+ // The driver specific options used when creating the volume.
+ // Required: true
+ Options map[string]string `json:"Options"`
+
+ // The level at which the volume exists.
+ // Libpod does not implement volume scoping, and this is provided solely for
+ // Docker compatibility. The value is only "local".
+ // Required: true
+ Scope string `json:"Scope"`
+
+ // TODO: We don't include the volume `Status` for now
+}
+
type VolumeRmOptions struct {
All bool
Force bool
@@ -94,17 +130,25 @@ type VolumeListReport struct {
VolumeConfigResponse
}
-/*
- * Docker API compatibility types
- */
-// swagger:response DockerVolumeList
-type SwagDockerVolumeListResponse struct {
+// VolumeListBody Volume list response
+// swagger:model VolumeListBody
+type VolumeListBody struct {
+ Volumes []*VolumeInfo
+}
+
+// Volume list response
+// swagger:response VolumeListResponse
+type SwagVolumeListResponse struct {
// in:body
Body struct {
- docker_api_types_volume.VolumeListOKBody
+ VolumeListBody
}
}
+/*
+ * Docker API compatibility types
+ */
+
// swagger:model DockerVolumeCreate
type DockerVolumeCreate docker_api_types_volume.VolumeCreateBody