Browse code

swagger: add missing container Health docs

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 9ae7196775dddeb49be5195e00572a55b3c4658a)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2020/01/06 19:00:08
Showing 1 changed files
... ...
@@ -618,6 +618,71 @@ definitions:
618 618
         description: "Start period for the container to initialize before starting health-retries countdown in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit."
619 619
         type: "integer"
620 620
 
621
+  Health:
622
+    description: |
623
+      Health stores information about the container's healthcheck results.
624
+    type: "object"
625
+    properties:
626
+      Status:
627
+        description: |
628
+          Status is one of `none`, `starting`, `healthy` or `unhealthy`
629
+
630
+          - "none"      Indicates there is no healthcheck
631
+          - "starting"  Starting indicates that the container is not yet ready
632
+          - "healthy"   Healthy indicates that the container is running correctly
633
+          - "unhealthy" Unhealthy indicates that the container has a problem
634
+        type: "string"
635
+        enum:
636
+          - "none"
637
+          - "starting"
638
+          - "healthy"
639
+          - "unhealthy"
640
+        example: "healthy"
641
+      FailingStreak:
642
+        description: "FailingStreak is the number of consecutive failures"
643
+        type: "integer"
644
+        example: 0
645
+      Log:
646
+        type: "array"
647
+        description: |
648
+          Log contains the last few results (oldest first)
649
+        items:
650
+          x-nullable: true
651
+          $ref: "#/definitions/HealthcheckResult"
652
+
653
+  HealthcheckResult:
654
+    description: |
655
+      HealthcheckResult stores information about a single run of a healthcheck probe
656
+    type: "object"
657
+    properties:
658
+      Start:
659
+        description: |
660
+          Date and time at which this check started in
661
+          [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.
662
+        type: "string"
663
+        format: "date-time"
664
+        example: "2020-01-04T10:44:24.496525531Z"
665
+      End:
666
+        description: |
667
+          Date and time at which this check ended in
668
+          [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.
669
+        type: "string"
670
+        format: "dateTime"
671
+        example: "2020-01-04T10:45:21.364524523Z"
672
+      ExitCode:
673
+        description: |
674
+          ExitCode meanings:
675
+
676
+          - `0` healthy
677
+          - `1` unhealthy
678
+          - `2` reserved (considered unhealthy)
679
+          - other values: error running probe
680
+        type: "integer"
681
+        example: 0
682
+      Output:
683
+        description: "Output from last check"
684
+        type: "string"
685
+
621 686
   HostConfig:
622 687
     description: "Container configuration that depends on the host we are running on"
623 688
     allOf:
... ...
@@ -3689,6 +3754,9 @@ definitions:
3689 3689
         description: "The time when this container last exited."
3690 3690
         type: "string"
3691 3691
         example: "2020-01-06T09:07:59.461876391Z"
3692
+      Health:
3693
+        x-nullable: true
3694
+        $ref: "#/definitions/Health"
3692 3695
 
3693 3696
   SystemInfo:
3694 3697
     type: "object"
... ...
@@ -4994,6 +5062,8 @@ paths:
4994 4994
                 Domainname: ""
4995 4995
                 Env:
4996 4996
                   - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
4997
+                Healthcheck:
4998
+                  Test: ["CMD-SHELL", "exit 0"]
4997 4999
                 Hostname: "ba033ac44011"
4998 5000
                 Image: "ubuntu"
4999 5001
                 Labels:
... ...
@@ -5105,6 +5175,14 @@ paths:
5105 5105
                 Error: ""
5106 5106
                 ExitCode: 9
5107 5107
                 FinishedAt: "2015-01-06T15:47:32.080254511Z"
5108
+                Health:
5109
+                  Status: "healthy"
5110
+                  FailingStreak: 0
5111
+                  Log:
5112
+                    - Start: "2019-12-22T10:59:05.6385933Z"
5113
+                      End: "2019-12-22T10:59:05.8078452Z"
5114
+                      ExitCode: 0
5115
+                      Output: ""
5108 5116
                 OOMKilled: false
5109 5117
                 Dead: false
5110 5118
                 Paused: false