Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@yongtang
Copy link
Member

Size and RefCount have been added to types.Volumes (#26108) though some of the remote API docs were not updated.

This fix updates the related docs to add Size and RefCount to types.Volumes in sample output.

Signed-off-by: Yong Tang [email protected]

…utput.

This fix updates the related docs to add `Size` and `RefCount` to
`types.Volumes` in sample output, both were added in 26108.

Signed-off-by: Yong Tang <[email protected]>
@tonistiigi
Copy link
Member

@mlaventure Is exposing these fields by design? If I look at the implementation they don't seem to be filled.

@mlaventure
Copy link
Contributor

They are only filled by SystemDiskUsage() (for docker system df)

@yongtang
Copy link
Member Author

Below is the output against master:

ubuntu@ubuntu:~/docker$ curl --unix-socket /var/run/docker.sock -s http:/v1.25/volumes | jq .
{
  "Volumes": [
    {
      "Name": "8c0f3da291a8115e64c1806a59f26653f74f73dd0572013ff04e384f5833675a",
      "Driver": "local",
      "Mountpoint": "/var/lib/docker/volumes/8c0f3da291a8115e64c1806a59f26653f74f73dd0572013ff04e384f5833675a/_data",
      "Labels": null,
      "Scope": "local",
      "Size": -1,
      "RefCount": -1
    }
  ],
  "Warnings": null
}
ubuntu@ubuntu:~/docker$ vi data.json
ubuntu@ubuntu:~/docker$ curl --unix-socket /var/run/docker.sock -s http:/v1.25/volumes/create -X POST -H 'Content-Type: application/json' [email protected] | jq .
{
  "Name": "tardis",
  "Driver": "local",
  "Mountpoint": "/var/lib/docker/volumes/tardis/_data",
  "Labels": {
    "com.example.some-label": "some-value",
    "com.example.some-other-label": "some-other-value"
  },
  "Scope": "local",
  "Size": -1,
  "RefCount": -1
}

@thaJeztah
Copy link
Member

@mlaventure ^^

@mlaventure
Copy link
Contributor

mlaventure commented Oct 11, 2016

That's the expected output. The fields are initialized as -1 when the value is not available.

@thaJeztah
Copy link
Member

@mlaventure but that would imply there are two useless fields in that response; should we have a separate type so that they don't appear?

@mlaventure
Copy link
Contributor

@thaJeztah sgtm if you can find me a name to use for the new struct type 👼

@thaJeztah
Copy link
Member

if you can find me a name to use for the new struct type

Oh! Look at that, I have to pack my suitcase 👼

@thaJeztah
Copy link
Member

@yongtang thanks for starting this PR; @mlaventure fixed the type so that these properties are not returned when not needed (see #27294)

@yongtang
Copy link
Member Author

Thanks @mlaventure @thaJeztah @tonistiigi for taking care of it.

@yongtang yongtang deleted the 26108-docs-updates-volume-size-refcount branch October 11, 2016 22:23
@yongtang
Copy link
Member Author

@mlaventure @thaJeztah It seems that the docs needs to be updated after the change:

-                    "Size": 0,
-                    "RefCount": 0
+                    "UsageData": {
+                        "Size": 0,
+                        "RefCount": 0
+                    }

I just created a PR #27305 to update the docs related to UsageData change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants