Browse code

add creation timestamp to `docker network inspect`

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>

Akihiro Suda authored on 2016/08/30 13:53:16
Showing 5 changed files
... ...
@@ -159,6 +159,7 @@ func (n *networkRouter) buildNetworkResource(nw libnetwork.Network) *types.Netwo
159 159
 	info := nw.Info()
160 160
 	r.Name = nw.Name()
161 161
 	r.ID = nw.ID()
162
+	r.Created = info.Created()
162 163
 	r.Scope = info.Scope()
163 164
 	if n.clusterProvider.IsManager() {
164 165
 		if _, err := n.clusterProvider.GetNetwork(nw.Name()); err == nil {
... ...
@@ -470,6 +470,7 @@ type VolumeCreateRequest struct {
470 470
 type NetworkResource struct {
471 471
 	Name       string                      // Name is the requested name of the network
472 472
 	ID         string                      `json:"Id"` // ID uniquely identifies a network on a single machine
473
+	Created    time.Time                   // Created is the time the network created
473 474
 	Scope      string                      // Scope describes the level at which the network exists (e.g. `global` for cluster-wide or `local` for machine level)
474 475
 	Driver     string                      // Driver is the Driver name used to create the network (e.g. `bridge`, `overlay`)
475 476
 	EnableIPv6 bool                        // EnableIPv6 represents whether to enable IPv6
... ...
@@ -130,6 +130,7 @@ This section lists each version from latest to oldest.  Each listing includes a
130 130
   containers that are tasks (part of a service in swarm mode).
131 131
 * `POST /containers/create` now takes `StopTimeout` field.
132 132
 * `POST /services/create` and `POST /services/(id or name)/update` now accept `Monitor` and `MaxFailureRatio` parameters, which control the response to failures during service updates.
133
+* `GET /networks/(name)` now returns `Created`.
133 134
 
134 135
 ### v1.24 API changes
135 136
 
... ...
@@ -3528,6 +3528,7 @@ Content-Type: application/json
3528 3528
   {
3529 3529
     "Name": "bridge",
3530 3530
     "Id": "f2de39df4171b0dc801e8002d1d999b77256983dfc63041c0f34030aa3977566",
3531
+    "Created": "2016-10-19T06:21:00.416543526Z",
3531 3532
     "Scope": "local",
3532 3533
     "Driver": "bridge",
3533 3534
     "EnableIPv6": false,
... ...
@@ -3560,6 +3561,7 @@ Content-Type: application/json
3560 3560
   {
3561 3561
     "Name": "none",
3562 3562
     "Id": "e086a3893b05ab69242d3c44e49483a3bbbd3a26b46baa8f61ab797c1088d794",
3563
+    "Created": "0001-01-01T00:00:00Z",
3563 3564
     "Scope": "local",
3564 3565
     "Driver": "null",
3565 3566
     "EnableIPv6": false,
... ...
@@ -3574,6 +3576,7 @@ Content-Type: application/json
3574 3574
   {
3575 3575
     "Name": "host",
3576 3576
     "Id": "13e871235c677f196c4e1ecebb9dc733b9b2d2ab589e30c539efeda84a24215e",
3577
+    "Created": "0001-01-01T00:00:00Z",
3577 3578
     "Scope": "local",
3578 3579
     "Driver": "host",
3579 3580
     "EnableIPv6": false,
... ...
@@ -3619,6 +3622,7 @@ Content-Type: application/json
3619 3619
 {
3620 3620
   "Name": "net01",
3621 3621
   "Id": "7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99",
3622
+  "Created": "2016-10-19T04:33:30.360899459Z",
3622 3623
   "Scope": "local",
3623 3624
   "Driver": "bridge",
3624 3625
   "EnableIPv6": false,
... ...
@@ -41,6 +41,7 @@ $ sudo docker network inspect bridge
41 41
     {
42 42
         "Name": "bridge",
43 43
         "Id": "b2b1a2cba717161d984383fd68218cf70bbbd17d328496885f7c921333228b0f",
44
+        "Created": "2016-10-19T04:33:30.360899459Z",
44 45
         "Scope": "local",
45 46
         "Driver": "bridge",
46 47
         "IPAM": {
... ...
@@ -92,6 +93,7 @@ $ docker network inspect simple-network
92 92
     {
93 93
         "Name": "simple-network",
94 94
         "Id": "69568e6336d8c96bbf57869030919f7c69524f71183b44d80948bd3927c87f6a",
95
+        "Created": "2016-10-19T04:33:30.360899459Z",
95 96
         "Scope": "local",
96 97
         "Driver": "bridge",
97 98
         "IPAM": {