Browse code

Merge pull request #34186 from thaJeztah/api-update-example-data

Improve API docs for UsageData

Sebastiaan van Stijn authored on 2017/07/20 16:38:28
Showing 2 changed files
... ...
@@ -1089,17 +1089,27 @@ definitions:
1089 1089
           type: "string"
1090 1090
       UsageData:
1091 1091
         type: "object"
1092
+        x-nullable: true
1092 1093
         required: [Size, RefCount]
1094
+        description: |
1095
+          Usage details about the volume. This information is used by the
1096
+          `GET /system/df` endpoint, and omitted in other endpoints.
1093 1097
         properties:
1094 1098
           Size:
1095 1099
             type: "integer"
1096
-            description: "The disk space used by the volume (local driver only)"
1097 1100
             default: -1
1101
+            description: |
1102
+              Amount of disk space used by the volume (in bytes). This information
1103
+              is only available for volumes created with the `"local"` volume
1104
+              driver. For volumes created with other volume drivers, this field
1105
+              is set to `-1` ("not available")
1098 1106
             x-nullable: false
1099 1107
           RefCount:
1100 1108
             type: "integer"
1101 1109
             default: -1
1102
-            description: "The number of containers referencing this volume."
1110
+            description: |
1111
+              The number of containers referencing this volume. This field
1112
+              is set to `-1` if the reference-count is not available.
1103 1113
             x-nullable: false
1104 1114
 
1105 1115
     example:
... ...
@@ -5949,13 +5959,13 @@ paths:
5949 5949
                 -
5950 5950
                   Name: "my-volume"
5951 5951
                   Driver: "local"
5952
-                  Mountpoint: ""
5952
+                  Mountpoint: "/var/lib/docker/volumes/my-volume/_data"
5953 5953
                   Labels: null
5954
-                  Scope: ""
5954
+                  Scope: "local"
5955 5955
                   Options: null
5956 5956
                   UsageData:
5957
-                    Size: 0
5958
-                    RefCount: 0
5957
+                    Size: 10920104
5958
+                    RefCount: 2
5959 5959
         500:
5960 5960
           description: "server error"
5961 5961
           schema:
... ...
@@ -47,15 +47,23 @@ type Volume struct {
47 47
 	UsageData *VolumeUsageData `json:"UsageData,omitempty"`
48 48
 }
49 49
 
50
-// VolumeUsageData volume usage data
50
+// VolumeUsageData Usage details about the volume. This information is used by the
51
+// `GET /system/df` endpoint, and omitted in other endpoints.
52
+//
51 53
 // swagger:model VolumeUsageData
52 54
 type VolumeUsageData struct {
53 55
 
54
-	// The number of containers referencing this volume.
56
+	// The number of containers referencing this volume. This field
57
+	// is set to `-1` if the reference-count is not available.
58
+	//
55 59
 	// Required: true
56 60
 	RefCount int64 `json:"RefCount"`
57 61
 
58
-	// The disk space used by the volume (local driver only)
62
+	// Amount of disk space used by the volume (in bytes). This information
63
+	// is only available for volumes created with the `"local"` volume
64
+	// driver. For volumes created with other volume drivers, this field
65
+	// is set to `-1` ("not available")
66
+	//
59 67
 	// Required: true
60 68
 	Size int64 `json:"Size"`
61 69
 }