Pārlūkot izejas kodu

Merge pull request #19115 from cpuguy83/volume_plugin_docs_change.md

Add docs for volume plugin ls/get
moxiegirl 9 gadi atpakaļ
vecāks
revīzija
af6c6dbf87
1 mainītis faili ar 61 papildinājumiem un 10 dzēšanām
  1. 61 10
      docs/extend/plugins_volume.md

+ 61 - 10
docs/extend/plugins_volume.md

@@ -54,7 +54,7 @@ containers.
 ### /VolumeDriver.Create
 ### /VolumeDriver.Create
 
 
 **Request**:
 **Request**:
-```
+```json
 {
 {
     "Name": "volume_name",
     "Name": "volume_name",
     "Opts": {}
     "Opts": {}
@@ -67,7 +67,7 @@ volume on the filesystem yet (until Mount is called).
 Opts is a map of driver specific options passed through from the user request.
 Opts is a map of driver specific options passed through from the user request.
 
 
 **Response**:
 **Response**:
-```
+```json
 {
 {
     "Err": ""
     "Err": ""
 }
 }
@@ -78,7 +78,7 @@ Respond with a string error if an error occurred.
 ### /VolumeDriver.Remove
 ### /VolumeDriver.Remove
 
 
 **Request**:
 **Request**:
-```
+```json
 {
 {
     "Name": "volume_name"
     "Name": "volume_name"
 }
 }
@@ -87,7 +87,7 @@ Respond with a string error if an error occurred.
 Delete the specified volume from disk. This request is issued when a user invokes `docker rm -v` to remove volumes associated with a container.
 Delete the specified volume from disk. This request is issued when a user invokes `docker rm -v` to remove volumes associated with a container.
 
 
 **Response**:
 **Response**:
-```
+```json
 {
 {
     "Err": ""
     "Err": ""
 }
 }
@@ -98,7 +98,7 @@ Respond with a string error if an error occurred.
 ### /VolumeDriver.Mount
 ### /VolumeDriver.Mount
 
 
 **Request**:
 **Request**:
-```
+```json
 {
 {
     "Name": "volume_name"
     "Name": "volume_name"
 }
 }
@@ -110,7 +110,7 @@ more than once, the plugin may need to keep track of each new mount request and
 at the first mount request and deprovision at the last corresponding unmount request.
 at the first mount request and deprovision at the last corresponding unmount request.
 
 
 **Response**:
 **Response**:
-```
+```json
 {
 {
     "Mountpoint": "/path/to/directory/on/host",
     "Mountpoint": "/path/to/directory/on/host",
     "Err": ""
     "Err": ""
@@ -123,7 +123,7 @@ available, and/or a string error if an error occurred.
 ### /VolumeDriver.Path
 ### /VolumeDriver.Path
 
 
 **Request**:
 **Request**:
-```
+```json
 {
 {
     "Name": "volume_name"
     "Name": "volume_name"
 }
 }
@@ -132,7 +132,7 @@ available, and/or a string error if an error occurred.
 Docker needs reminding of the path to the volume on the host.
 Docker needs reminding of the path to the volume on the host.
 
 
 **Response**:
 **Response**:
-```
+```json
 {
 {
     "Mountpoint": "/path/to/directory/on/host",
     "Mountpoint": "/path/to/directory/on/host",
     "Err": ""
     "Err": ""
@@ -145,7 +145,7 @@ available, and/or a string error if an error occurred.
 ### /VolumeDriver.Unmount
 ### /VolumeDriver.Unmount
 
 
 **Request**:
 **Request**:
-```
+```json
 {
 {
     "Name": "volume_name"
     "Name": "volume_name"
 }
 }
@@ -156,7 +156,7 @@ per container stop.  Plugin may deduce that it is safe to deprovision it at
 this point.
 this point.
 
 
 **Response**:
 **Response**:
-```
+```json
 {
 {
     "Err": ""
     "Err": ""
 }
 }
@@ -164,3 +164,54 @@ this point.
 
 
 Respond with a string error if an error occurred.
 Respond with a string error if an error occurred.
 
 
+
+### /VolumeDriver.Get
+
+**Request**:
+```json
+{
+    "Name": "volume_name"
+}
+```
+
+Get the volume info.
+
+
+**Response**:
+```json
+{
+  "Volume": {
+    "Name": "volume_name",
+    "Mountpoint": "/path/to/directory/on/host",
+  },
+  "Err": ""
+}
+```
+
+Respond with a string error if an error occurred.
+
+
+### /VolumeDriver.List
+
+**Request**:
+```json
+{}
+```
+
+Get the list of volumes registered with the plugin.
+
+**Response**:
+```json
+{
+  "Volumes": [
+    {
+      "Name": "volume_name",
+      "Mountpoint": "/path/to/directory/on/host"
+    }
+  ],
+  "Err": ""
+}
+```
+
+Respond with a string error if an error occurred.
+