2020-11-12 18:42:50 +08:00
|
|
|
From 14c30632d33cdce2d3b0bb5072bf8af823003e63 Mon Sep 17 00:00:00 2001
|
|
|
|
|
From: WangFengTu <wangfengtu@huawei.com>
|
|
|
|
|
Date: Thu, 3 Sep 2020 10:46:38 +0800
|
2020-12-03 18:57:18 +08:00
|
|
|
Subject: [PATCH 1/7] support local volume
|
2020-11-12 18:42:50 +08:00
|
|
|
|
|
|
|
|
Signed-off-by: WangFengTu <wangfengtu@huawei.com>
|
|
|
|
|
---
|
|
|
|
|
src/json/schema/bind-options.json | 12 +++++++++
|
|
|
|
|
src/json/schema/container/config-v2.json | 3 +++
|
|
|
|
|
src/json/schema/container/inspect.json | 3 +++
|
|
|
|
|
src/json/schema/defs.json | 5 +++-
|
|
|
|
|
src/json/schema/docker/types/mount-point.json | 3 +++
|
|
|
|
|
src/json/schema/host-config.json | 9 +++++++
|
|
|
|
|
src/json/schema/mount_spec.json | 27 +++++++++++++++++++
|
|
|
|
|
.../schema/volume/list-volume-request.json | 6 +++++
|
|
|
|
|
.../schema/volume/list-volume-response.json | 18 +++++++++++++
|
|
|
|
|
src/json/schema/volume/options.json | 9 +++++++
|
|
|
|
|
.../schema/volume/prune-volume-request.json | 6 +++++
|
|
|
|
|
.../schema/volume/prune-volume-response.json | 18 +++++++++++++
|
|
|
|
|
.../schema/volume/remove-volume-request.json | 9 +++++++
|
|
|
|
|
.../schema/volume/remove-volume-response.json | 12 +++++++++
|
|
|
|
|
src/json/schema/volume/volume.json | 12 +++++++++
|
|
|
|
|
15 files changed, 151 insertions(+), 1 deletion(-)
|
|
|
|
|
create mode 100644 src/json/schema/bind-options.json
|
|
|
|
|
create mode 100644 src/json/schema/mount_spec.json
|
|
|
|
|
create mode 100644 src/json/schema/volume/list-volume-request.json
|
|
|
|
|
create mode 100644 src/json/schema/volume/list-volume-response.json
|
|
|
|
|
create mode 100644 src/json/schema/volume/options.json
|
|
|
|
|
create mode 100644 src/json/schema/volume/prune-volume-request.json
|
|
|
|
|
create mode 100644 src/json/schema/volume/prune-volume-response.json
|
|
|
|
|
create mode 100644 src/json/schema/volume/remove-volume-request.json
|
|
|
|
|
create mode 100644 src/json/schema/volume/remove-volume-response.json
|
|
|
|
|
create mode 100644 src/json/schema/volume/volume.json
|
|
|
|
|
|
|
|
|
|
diff --git a/src/json/schema/bind-options.json b/src/json/schema/bind-options.json
|
|
|
|
|
new file mode 100644
|
|
|
|
|
index 0000000..8900361
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/src/json/schema/bind-options.json
|
|
|
|
|
@@ -0,0 +1,12 @@
|
|
|
|
|
+{
|
|
|
|
|
+ "$schema": "http://json-schema.org/draft-04/schema#",
|
|
|
|
|
+ "type": "object",
|
|
|
|
|
+ "properties": {
|
|
|
|
|
+ "Propagation": {
|
|
|
|
|
+ "type": "string"
|
|
|
|
|
+ },
|
|
|
|
|
+ "selinux-opts": {
|
|
|
|
|
+ "type": "string"
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
diff --git a/src/json/schema/container/config-v2.json b/src/json/schema/container/config-v2.json
|
|
|
|
|
index ba97bd8..f299f01 100644
|
|
|
|
|
--- a/src/json/schema/container/config-v2.json
|
|
|
|
|
+++ b/src/json/schema/container/config-v2.json
|
|
|
|
|
@@ -55,6 +55,9 @@
|
|
|
|
|
".{1,}": {
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
+ "Type": {
|
|
|
|
|
+ "type": "string"
|
|
|
|
|
+ },
|
|
|
|
|
"Destination": {
|
|
|
|
|
"type": "string"
|
|
|
|
|
},
|
|
|
|
|
diff --git a/src/json/schema/container/inspect.json b/src/json/schema/container/inspect.json
|
|
|
|
|
index d1c6288..bf53a59 100644
|
|
|
|
|
--- a/src/json/schema/container/inspect.json
|
|
|
|
|
+++ b/src/json/schema/container/inspect.json
|
|
|
|
|
@@ -157,6 +157,9 @@
|
|
|
|
|
"Labels": {
|
|
|
|
|
"$ref": "../defs.json#/definitions/mapStringString"
|
|
|
|
|
},
|
|
|
|
|
+ "Volumes": {
|
|
|
|
|
+ "$ref": "../defs.json#/definitions/mapStringObject"
|
|
|
|
|
+ },
|
|
|
|
|
"Annotations": {
|
|
|
|
|
"$ref": "../defs.json#/definitions/mapStringString"
|
|
|
|
|
},
|
|
|
|
|
diff --git a/src/json/schema/defs.json b/src/json/schema/defs.json
|
|
|
|
|
index 9512caa..317cab4 100644
|
|
|
|
|
--- a/src/json/schema/defs.json
|
|
|
|
|
+++ b/src/json/schema/defs.json
|
|
|
|
|
@@ -192,6 +192,9 @@
|
|
|
|
|
"options": {
|
|
|
|
|
"$ref": "#/definitions/ArrayOfStrings"
|
|
|
|
|
},
|
|
|
|
|
+ "named": {
|
|
|
|
|
+ "type": "boolean"
|
|
|
|
|
+ },
|
|
|
|
|
"type": {
|
|
|
|
|
"type": "string"
|
|
|
|
|
}
|
|
|
|
|
@@ -1073,4 +1076,4 @@
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
-}
|
|
|
|
|
\ No newline at end of file
|
|
|
|
|
+}
|
|
|
|
|
diff --git a/src/json/schema/docker/types/mount-point.json b/src/json/schema/docker/types/mount-point.json
|
|
|
|
|
index 33b7768..f204cdc 100644
|
|
|
|
|
--- a/src/json/schema/docker/types/mount-point.json
|
|
|
|
|
+++ b/src/json/schema/docker/types/mount-point.json
|
|
|
|
|
@@ -2,6 +2,9 @@
|
|
|
|
|
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
+ "Type":{
|
|
|
|
|
+ "type":"string"
|
|
|
|
|
+ },
|
|
|
|
|
"Name":{
|
|
|
|
|
"type":"string"
|
|
|
|
|
},
|
|
|
|
|
diff --git a/src/json/schema/host-config.json b/src/json/schema/host-config.json
|
|
|
|
|
index ac54b40..eb99c87 100644
|
|
|
|
|
--- a/src/json/schema/host-config.json
|
|
|
|
|
+++ b/src/json/schema/host-config.json
|
|
|
|
|
@@ -2,9 +2,18 @@
|
|
|
|
|
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
+ "VolumesFrom": {
|
|
|
|
|
+ "$ref": "defs.json#/definitions/ArrayOfStrings"
|
|
|
|
|
+ },
|
|
|
|
|
"Binds": {
|
|
|
|
|
"$ref": "defs.json#/definitions/ArrayOfStrings"
|
|
|
|
|
},
|
|
|
|
|
+ "Mounts": {
|
|
|
|
|
+ "type": "array",
|
|
|
|
|
+ "items": {
|
|
|
|
|
+ "$ref": "mount_spec.json"
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
"NetworkMode": {
|
|
|
|
|
"type": "string"
|
|
|
|
|
},
|
|
|
|
|
diff --git a/src/json/schema/mount_spec.json b/src/json/schema/mount_spec.json
|
|
|
|
|
new file mode 100644
|
|
|
|
|
index 0000000..94aa5b3
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/src/json/schema/mount_spec.json
|
|
|
|
|
@@ -0,0 +1,27 @@
|
|
|
|
|
+{
|
|
|
|
|
+ "$schema": "http://json-schema.org/draft-04/schema#",
|
|
|
|
|
+ "type": "object",
|
|
|
|
|
+ "properties": {
|
|
|
|
|
+ "Type": {
|
|
|
|
|
+ "type": "string"
|
|
|
|
|
+ },
|
|
|
|
|
+ "Source": {
|
|
|
|
|
+ "type": "string"
|
|
|
|
|
+ },
|
|
|
|
|
+ "Target": {
|
|
|
|
|
+ "type": "string"
|
|
|
|
|
+ },
|
|
|
|
|
+ "Readonly": {
|
|
|
|
|
+ "type": "boolean"
|
|
|
|
|
+ },
|
|
|
|
|
+ "Consistency": {
|
|
|
|
|
+ "type": "string"
|
|
|
|
|
+ },
|
|
|
|
|
+ "BindOptions": {
|
|
|
|
|
+ "$ref": "bind-options.json"
|
|
|
|
|
+ },
|
|
|
|
|
+ "VolumeOptions": {
|
|
|
|
|
+ "$ref": "volume/options.json"
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
diff --git a/src/json/schema/volume/list-volume-request.json b/src/json/schema/volume/list-volume-request.json
|
|
|
|
|
new file mode 100644
|
|
|
|
|
index 0000000..8084880
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/src/json/schema/volume/list-volume-request.json
|
|
|
|
|
@@ -0,0 +1,6 @@
|
|
|
|
|
+{
|
|
|
|
|
+ "$schema": "http://json-schema.org/draft-04/schema#",
|
|
|
|
|
+ "type": "object",
|
|
|
|
|
+ "properties": {
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
diff --git a/src/json/schema/volume/list-volume-response.json b/src/json/schema/volume/list-volume-response.json
|
|
|
|
|
new file mode 100644
|
|
|
|
|
index 0000000..d89f4e2
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/src/json/schema/volume/list-volume-response.json
|
|
|
|
|
@@ -0,0 +1,18 @@
|
|
|
|
|
+{
|
|
|
|
|
+ "$schema": "http://json-schema.org/draft-04/schema#",
|
|
|
|
|
+ "type": "object",
|
|
|
|
|
+ "properties": {
|
|
|
|
|
+ "volumes": {
|
|
|
|
|
+ "type": "array",
|
|
|
|
|
+ "items": {
|
|
|
|
|
+ "$ref": "volume.json"
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ "cc": {
|
|
|
|
|
+ "type": "uint32"
|
|
|
|
|
+ },
|
|
|
|
|
+ "errmsg": {
|
|
|
|
|
+ "type": "string"
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
diff --git a/src/json/schema/volume/options.json b/src/json/schema/volume/options.json
|
|
|
|
|
new file mode 100644
|
|
|
|
|
index 0000000..57b3c34
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/src/json/schema/volume/options.json
|
|
|
|
|
@@ -0,0 +1,9 @@
|
|
|
|
|
+{
|
|
|
|
|
+ "$schema": "http://json-schema.org/draft-04/schema#",
|
|
|
|
|
+ "type": "object",
|
|
|
|
|
+ "properties": {
|
|
|
|
|
+ "NoCopy": {
|
|
|
|
|
+ "type": "boolean"
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
diff --git a/src/json/schema/volume/prune-volume-request.json b/src/json/schema/volume/prune-volume-request.json
|
|
|
|
|
new file mode 100644
|
|
|
|
|
index 0000000..8084880
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/src/json/schema/volume/prune-volume-request.json
|
|
|
|
|
@@ -0,0 +1,6 @@
|
|
|
|
|
+{
|
|
|
|
|
+ "$schema": "http://json-schema.org/draft-04/schema#",
|
|
|
|
|
+ "type": "object",
|
|
|
|
|
+ "properties": {
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
diff --git a/src/json/schema/volume/prune-volume-response.json b/src/json/schema/volume/prune-volume-response.json
|
|
|
|
|
new file mode 100644
|
|
|
|
|
index 0000000..064f839
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/src/json/schema/volume/prune-volume-response.json
|
|
|
|
|
@@ -0,0 +1,18 @@
|
|
|
|
|
+{
|
|
|
|
|
+ "$schema": "http://json-schema.org/draft-04/schema#",
|
|
|
|
|
+ "type": "object",
|
|
|
|
|
+ "properties": {
|
|
|
|
|
+ "volumes": {
|
|
|
|
|
+ "type": "array",
|
|
|
|
|
+ "items": {
|
|
|
|
|
+ "type": "string"
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ "cc": {
|
|
|
|
|
+ "type": "uint32"
|
|
|
|
|
+ },
|
|
|
|
|
+ "errmsg": {
|
|
|
|
|
+ "type": "string"
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
diff --git a/src/json/schema/volume/remove-volume-request.json b/src/json/schema/volume/remove-volume-request.json
|
|
|
|
|
new file mode 100644
|
|
|
|
|
index 0000000..788b40d
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/src/json/schema/volume/remove-volume-request.json
|
|
|
|
|
@@ -0,0 +1,9 @@
|
|
|
|
|
+{
|
|
|
|
|
+ "$schema": "http://json-schema.org/draft-04/schema#",
|
|
|
|
|
+ "type": "object",
|
|
|
|
|
+ "properties": {
|
|
|
|
|
+ "name": {
|
|
|
|
|
+ "type": "string"
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
diff --git a/src/json/schema/volume/remove-volume-response.json b/src/json/schema/volume/remove-volume-response.json
|
|
|
|
|
new file mode 100644
|
|
|
|
|
index 0000000..8c398e8
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/src/json/schema/volume/remove-volume-response.json
|
|
|
|
|
@@ -0,0 +1,12 @@
|
|
|
|
|
+{
|
|
|
|
|
+ "$schema": "http://json-schema.org/draft-04/schema#",
|
|
|
|
|
+ "type": "object",
|
|
|
|
|
+ "properties": {
|
|
|
|
|
+ "cc": {
|
|
|
|
|
+ "type": "uint32"
|
|
|
|
|
+ },
|
|
|
|
|
+ "errmsg": {
|
|
|
|
|
+ "type": "string"
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
diff --git a/src/json/schema/volume/volume.json b/src/json/schema/volume/volume.json
|
|
|
|
|
new file mode 100644
|
|
|
|
|
index 0000000..035451f
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/src/json/schema/volume/volume.json
|
|
|
|
|
@@ -0,0 +1,12 @@
|
|
|
|
|
+{
|
|
|
|
|
+ "$schema": "http://json-schema.org/draft-04/schema#",
|
|
|
|
|
+ "type": "object",
|
|
|
|
|
+ "properties": {
|
|
|
|
|
+ "driver": {
|
|
|
|
|
+ "type": "string"
|
|
|
|
|
+ },
|
|
|
|
|
+ "name": {
|
|
|
|
|
+ "type": "string"
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
--
|
2020-12-03 18:57:18 +08:00
|
|
|
2.25.1
|
2020-11-12 18:42:50 +08:00
|
|
|
|