github.com/smintz/nomad@v0.8.3/website/source/api/nodes.html.md (about)

     1  ---
     2  layout: api
     3  page_title: Nodes - HTTP API
     4  sidebar_current: api-nodes
     5  description: |-
     6    The /node endpoints are used to query for and interact with client nodes.
     7  ---
     8  
     9  # Nodes HTTP API
    10  
    11  The `/node` endpoints are used to query for and interact with client nodes.
    12  
    13  ### List Nodes
    14  
    15  This endpoint lists all nodes registered with Nomad.
    16  
    17  | Method | Path                      | Produces                   |
    18  | ------ | ------------------------- | -------------------------- |
    19  | `GET`  | `/v1/nodes`               | `application/json`         |
    20  
    21  The table below shows this endpoint's support for
    22  [blocking queries](/api/index.html#blocking-queries) and
    23  [required ACLs](/api/index.html#acls).
    24  
    25  | Blocking Queries | ACL Required |
    26  | ---------------- | ------------ |
    27  | `YES`            | `node:read`  |
    28  
    29  ### Parameters
    30  
    31  - `prefix` `(string: "")`- Specifies a string to filter nodes on based on an
    32    index prefix. This is specified as a querystring parameter.
    33  
    34  ### Sample Request
    35  
    36  ```text
    37  $ curl \
    38      http://localhost:4646/v1/nodes
    39  ```
    40  
    41  ```text
    42  $ curl \
    43      http://localhost:4646/v1/nodes?prefix=prod
    44  ```
    45  
    46  ### Sample Response
    47  
    48  ```json
    49  [
    50    {
    51      "Address": "10.138.0.5",
    52      "CreateIndex": 6,
    53      "Datacenter": "dc1",
    54      "Drain": false,
    55      "ID": "f7476465-4d6e-c0de-26d0-e383c49be941",
    56      "ModifyIndex": 2526,
    57      "Name": "nomad-4",
    58      "NodeClass": "",
    59      "SchedulingEligibility": "eligible",
    60      "Status": "ready",
    61      "StatusDescription": "",
    62      "Version": "0.8.0-rc1"
    63    }
    64  ]
    65  ```
    66  
    67  ## Read Node
    68  
    69  This endpoint queries the status of a client node.
    70  
    71  | Method | Path                      | Produces                   |
    72  | ------ | ------------------------- | -------------------------- |
    73  | `GET`  | `/v1/node/:node_id`       | `application/json`         |
    74  
    75  The table below shows this endpoint's support for
    76  [blocking queries](/api/index.html#blocking-queries) and
    77  [required ACLs](/api/index.html#acls).
    78  
    79  | Blocking Queries | ACL Required      |
    80  | ---------------- | ----------------- |
    81  | `YES`            | `node:read`       |
    82  
    83  ### Parameters
    84  
    85  - `:node_id` `(string: <required>)`- Specifies the ID of the node. This must be
    86    the full UUID, not the short 8-character one. This is specified as part of the
    87    path.
    88  
    89  ### Sample Request
    90  
    91  ```text
    92  $ curl \
    93      http://localhost:4646/v1/node/f7476465-4d6e-c0de-26d0-e383c49be941
    94  ```
    95  
    96  ### Sample Response
    97  
    98  ```json
    99  {
   100    "Attributes": {
   101      "driver.rkt": "1",
   102      "driver.docker.bridge_ip": "172.17.0.1",
   103      "unique.storage.volume": "/dev/sda1",
   104      "driver.exec": "1",
   105      "driver.rkt.volumes.enabled": "1",
   106      "os.signals": "SIGSTOP,SIGTTIN,SIGWINCH,SIGXCPU,SIGXFSZ,SIGIO,SIGKILL,SIGTTOU,SIGINT,SIGHUP,SIGTRAP,SIGALRM,SIGPIPE,SIGURG,SIGABRT,SIGSEGV,SIGIOT,SIGTERM,SIGBUS,SIGPROF,SIGQUIT,SIGTSTP,SIGUSR2,SIGFPE,SIGCONT,SIGILL,SIGSYS,SIGUSR1,SIGCHLD",
   107      "cpu.totalcompute": "2200",
   108      "driver.raw_exec": "1",
   109      "driver.java.version": "openjdk version \"1.8.0_162",
   110      "kernel.name": "linux",
   111      "unique.cgroup.mountpoint": "/sys/fs/cgroup",
   112      "driver.docker.volumes.enabled": "1",
   113      "cpu.frequency": "2200",
   114      "consul.datacenter": "dc1",
   115      "unique.storage.bytestotal": "31637520384",
   116      "unique.network.ip-address": "10.138.0.5",
   117      "os.version": "9.4",
   118      "unique.hostname": "nomad-4",
   119      "driver.rkt.version": "1.29.0",
   120      "driver.java.vm": "OpenJDK 64-Bit Server VM (build 25.162-b12, mixed mode)",
   121      "consul.server": "false",
   122      "kernel.version": "4.9.0-6-amd64",
   123      "cpu.numcores": "1",
   124      "driver.docker.version": "18.03.0-ce",
   125      "unique.consul.name": "nomad-4",
   126      "driver.java": "1",
   127      "consul.revision": "9a494b5f+CHANGES",
   128      "os.name": "debian",
   129      "consul.version": "1.0.6",
   130      "driver.java.runtime": "OpenJDK Runtime Environment (build 1.8.0_162-8u162-b12-1~deb9u1-b12)",
   131      "nomad.version": "0.8.0-rc1",
   132      "memory.totalbytes": "3883982848",
   133      "unique.storage.bytesfree": "26626150400",
   134      "driver.docker": "1",
   135      "cpu.modelname": "Intel(R) Xeon(R) CPU @ 2.20GHz",
   136      "cpu.arch": "amd64",
   137      "driver.rkt.appc.version": "0.8.11"
   138    },
   139    "ComputedClass": "v1:1652208824869124256",
   140    "CreateIndex": 6,
   141    "Datacenter": "dc1",
   142    "Drain": false,
   143    "DrainStrategy": null,
   144    "Drivers": {
   145      "java": {
   146        "Attributes": {
   147          "driver.java.runtime": "OpenJDK Runtime Environment (build 1.8.0_162-8u162-b12-1~deb9u1-b12)",
   148          "driver.java.vm": "OpenJDK 64-Bit Server VM (build 25.162-b12, mixed mode)",
   149          "driver.java.version": "openjdk version \"1.8.0_162"
   150        },
   151        "Detected": true,
   152        "HealthDescription": "",
   153        "Healthy": true,
   154        "UpdateTime": "2018-04-11T23:33:48.781948669Z"
   155      },
   156      "qemu": {
   157        "Attributes": null,
   158        "Detected": false,
   159        "HealthDescription": "",
   160        "Healthy": false,
   161        "UpdateTime": "2018-04-11T23:33:48.7819898Z"
   162      },
   163      "rkt": {
   164        "Attributes": {
   165          "driver.rkt.appc.version": "0.8.11",
   166          "driver.rkt.volumes.enabled": "1",
   167          "driver.rkt.version": "1.29.0"
   168        },
   169        "Detected": true,
   170        "HealthDescription": "Driver rkt is detected: true",
   171        "Healthy": true,
   172        "UpdateTime": "2018-04-11T23:34:48.81079772Z"
   173      },
   174      "docker": {
   175        "Attributes": {
   176          "driver.docker.bridge_ip": "172.17.0.1",
   177          "driver.docker.version": "18.03.0-ce",
   178          "driver.docker.volumes.enabled": "1"
   179        },
   180        "Detected": true,
   181        "HealthDescription": "Driver is available and responsive",
   182        "Healthy": true,
   183        "UpdateTime": "2018-04-11T23:34:48.713720323Z"
   184      },
   185      "exec": {
   186        "Attributes": {},
   187        "Detected": true,
   188        "HealthDescription": "Driver exec is detected: true",
   189        "Healthy": true,
   190        "UpdateTime": "2018-04-11T23:34:48.711026521Z"
   191      },
   192      "raw_exec": {
   193        "Attributes": {},
   194        "Detected": true,
   195        "HealthDescription": "",
   196        "Healthy": true,
   197        "UpdateTime": "2018-04-11T23:33:48.710448534Z"
   198      }
   199    },
   200    "Events": [
   201      {
   202        "CreateIndex": 0,
   203        "Details": null,
   204        "Message": "Node Registered",
   205        "Subsystem": "Cluster",
   206        "Timestamp": "2018-04-10T23:43:17Z"
   207      }
   208    ],
   209    "HTTPAddr": "10.138.0.5:4646",
   210    "ID": "f7476465-4d6e-c0de-26d0-e383c49be941",
   211    "Links": {
   212      "consul": "dc1.nomad-4"
   213    },
   214    "Meta": null,
   215    "ModifyIndex": 2526,
   216    "Name": "nomad-4",
   217    "NodeClass": "",
   218    "Reserved": {
   219      "CPU": 0,
   220      "DiskMB": 0,
   221      "IOPS": 0,
   222      "MemoryMB": 0,
   223      "Networks": null
   224    },
   225    "Resources": {
   226      "CPU": 2200,
   227      "DiskMB": 25392,
   228      "IOPS": 0,
   229      "MemoryMB": 3704,
   230      "Networks": [
   231        {
   232          "CIDR": "10.138.0.5/32",
   233          "Device": "eth0",
   234          "DynamicPorts": null,
   235          "IP": "10.138.0.5",
   236          "MBits": 1000,
   237          "ReservedPorts": null
   238        }
   239      ]
   240    },
   241    "SchedulingEligibility": "eligible",
   242    "SecretID": "",
   243    "Status": "ready",
   244    "StatusDescription": "",
   245    "StatusUpdatedAt": 1523552938,
   246    "TLSEnabled": false
   247  }
   248  ```
   249  
   250  ## List Node Allocations
   251  
   252  This endpoint lists all of the allocations for the given node. This can be used to 
   253  determine what allocations have been scheduled on the node, their current status,
   254  and the values of dynamically assigned resources, like ports.
   255  
   256  | Method  | Path                            | Produces                   |
   257  | ------- | ------------------------------- | -------------------------- |
   258  | `GET`   | `/v1/node/:node_id/allocations` | `application/json`         |
   259  
   260  The table below shows this endpoint's support for
   261  [blocking queries](/api/index.html#blocking-queries) and
   262  [required ACLs](/api/index.html#acls).
   263  
   264  | Blocking Queries | ACL Required                   |
   265  | ---------------- | ------------------------------ |
   266  | `YES`            | `node:read,namespace:read-job` |
   267  
   268  ### Parameters
   269  
   270  - `:node_id` `(string: <required>)`- Specifies the UUID of the node. This must
   271    be the full UUID, not the short 8-character one. This is specified as part of
   272    the path.
   273  
   274  ### Sample Request
   275  
   276  ```text
   277  $ curl \
   278      http://localhost:4646/v1/node/e02b6169-83bd-9df6-69bd-832765f333eb/allocations
   279  ```
   280  
   281  ### Sample Response
   282  
   283  ```json
   284  [
   285    {
   286      "AllocModifyIndex": 2555,
   287      "ClientDescription": "",
   288      "ClientStatus": "running",
   289      "CreateIndex": 2555,
   290      "CreateTime": 1523490066575461000,
   291      "DeploymentID": "",
   292      "DeploymentStatus": {
   293        "Healthy": true,
   294        "ModifyIndex": 0
   295      },
   296      "DesiredDescription": "",
   297      "DesiredStatus": "run",
   298      "DesiredTransition": {
   299        "Migrate": null
   300      },
   301      "EvalID": "5129bc74-9785-c39a-08da-bddc8aa778b1",
   302      "FollowupEvalID": "",
   303      "ID": "fefe81d0-08b2-4eca-fae6-6560cde46d31",
   304      "Job": {
   305        "AllAtOnce": false,
   306        "Constraints": null,
   307        "CreateIndex": 2553,
   308        "Datacenters": [
   309          "dc1"
   310        ],
   311        "ID": "webapp",
   312        "JobModifyIndex": 2553,
   313        "Meta": null,
   314        "ModifyIndex": 2554,
   315        "Name": "webapp",
   316        "Namespace": "default",
   317        "ParameterizedJob": null,
   318        "ParentID": "",
   319        "Payload": null,
   320        "Periodic": null,
   321        "Priority": 50,
   322        "Region": "global",
   323        "Stable": false,
   324        "Status": "pending",
   325        "StatusDescription": "",
   326        "Stop": false,
   327        "SubmitTime": 1523490066563405000,
   328        "TaskGroups": [
   329          {
   330            "Constraints": null,
   331            "Count": 9,
   332            "EphemeralDisk": {
   333              "Migrate": false,
   334              "SizeMB": 300,
   335              "Sticky": false
   336            },
   337            "Meta": null,
   338            "Migrate": {
   339              "HealthCheck": "checks",
   340              "HealthyDeadline": 300000000000,
   341              "MaxParallel": 2,
   342              "MinHealthyTime": 15000000000
   343            },
   344            "Name": "webapp",
   345            "ReschedulePolicy": {
   346              "Attempts": 0,
   347              "Delay": 30000000000,
   348              "DelayFunction": "exponential",
   349              "Interval": 0,
   350              "MaxDelay": 3600000000000,
   351              "Unlimited": true
   352            },
   353            "RestartPolicy": {
   354              "Attempts": 2,
   355              "Delay": 15000000000,
   356              "Interval": 1800000000000,
   357              "Mode": "fail"
   358            },
   359            "Tasks": [
   360              {
   361                "Artifacts": null,
   362                "Config": {
   363                  "args": [
   364                    "-text",
   365                    "ok4"
   366                  ],
   367                  "image": "hashicorp/http-echo:0.2.3",
   368                  "port_map": [
   369                    {
   370                      "http": 5678
   371                    }
   372                  ]
   373                },
   374                "Constraints": null,
   375                "DispatchPayload": null,
   376                "Driver": "docker",
   377                "Env": null,
   378                "KillSignal": "",
   379                "KillTimeout": 5000000000,
   380                "Leader": false,
   381                "LogConfig": {
   382                  "MaxFileSizeMB": 10,
   383                  "MaxFiles": 10
   384                },
   385                "Meta": null,
   386                "Name": "webapp",
   387                "Resources": {
   388                  "CPU": 100,
   389                  "DiskMB": 0,
   390                  "IOPS": 0,
   391                  "MemoryMB": 300,
   392                  "Networks": [
   393                    {
   394                      "CIDR": "",
   395                      "Device": "",
   396                      "DynamicPorts": [
   397                        {
   398                          "Label": "http",
   399                          "Value": 0
   400                        }
   401                      ],
   402                      "IP": "",
   403                      "MBits": 10,
   404                      "ReservedPorts": null
   405                    }
   406                  ]
   407                },
   408                "Services": [
   409                  {
   410                    "AddressMode": "auto",
   411                    "Checks": [
   412                      {
   413                        "AddressMode": "",
   414                        "Args": null,
   415                        "CheckRestart": null,
   416                        "Command": "",
   417                        "Header": null,
   418                        "InitialStatus": "",
   419                        "Interval": 10000000000,
   420                        "Method": "",
   421                        "Name": "http-ok",
   422                        "Path": "/",
   423                        "PortLabel": "",
   424                        "Protocol": "",
   425                        "TLSSkipVerify": false,
   426                        "Timeout": 2000000000,
   427                        "Type": "http"
   428                      }
   429                    ],
   430                    "Name": "webapp",
   431                    "PortLabel": "http",
   432                    "Tags": null
   433                  }
   434                ],
   435                "ShutdownDelay": 0,
   436                "Templates": null,
   437                "User": "",
   438                "Vault": null
   439              }
   440            ],
   441            "Update": null
   442          }
   443        ],
   444        "Type": "service",
   445        "Update": {
   446          "AutoRevert": false,
   447          "Canary": 0,
   448          "HealthCheck": "",
   449          "HealthyDeadline": 0,
   450          "MaxParallel": 0,
   451          "MinHealthyTime": 0,
   452          "Stagger": 0
   453        },
   454        "VaultToken": "",
   455        "Version": 0
   456      },
   457      "JobID": "webapp",
   458      "Metrics": {
   459        "AllocationTime": 63337,
   460        "ClassExhausted": null,
   461        "ClassFiltered": null,
   462        "CoalescedFailures": 0,
   463        "ConstraintFiltered": null,
   464        "DimensionExhausted": null,
   465        "NodesAvailable": {
   466          "dc1": 2
   467        },
   468        "NodesEvaluated": 2,
   469        "NodesExhausted": 0,
   470        "NodesFiltered": 0,
   471        "QuotaExhausted": null,
   472        "Scores": {
   473          "46f1c6c4-a0e5-21f6-fd5c-d76c3d84e806.binpack": 2.6950883117541586,
   474          "f7476465-4d6e-c0de-26d0-e383c49be941.binpack": 2.6950883117541586
   475        }
   476      },
   477      "ModifyIndex": 2567,
   478      "ModifyTime": 1523490089807324000,
   479      "Name": "webapp.webapp[0]",
   480      "Namespace": "default",
   481      "NextAllocation": "",
   482      "NodeID": "f7476465-4d6e-c0de-26d0-e383c49be941",
   483      "PreviousAllocation": "",
   484      "RescheduleTracker": null,
   485      "Resources": {
   486        "CPU": 100,
   487        "DiskMB": 300,
   488        "IOPS": 0,
   489        "MemoryMB": 300,
   490        "Networks": [
   491          {
   492            "CIDR": "",
   493            "Device": "eth0",
   494            "DynamicPorts": [
   495              {
   496                "Label": "http",
   497                "Value": 25920
   498              }
   499            ],
   500            "IP": "10.138.0.5",
   501            "MBits": 10,
   502            "ReservedPorts": null
   503          }
   504        ]
   505      },
   506      "SharedResources": {
   507        "CPU": 0,
   508        "DiskMB": 300,
   509        "IOPS": 0,
   510        "MemoryMB": 0,
   511        "Networks": null
   512      },
   513      "TaskGroup": "webapp",
   514      "TaskResources": {
   515        "webapp": {
   516          "CPU": 100,
   517          "DiskMB": 0,
   518          "IOPS": 0,
   519          "MemoryMB": 300,
   520          "Networks": [
   521            {
   522              "CIDR": "",
   523              "Device": "eth0",
   524              "DynamicPorts": [
   525                {
   526                  "Label": "http",
   527                  "Value": 25920
   528                }
   529              ],
   530              "IP": "10.138.0.5",
   531              "MBits": 10,
   532              "ReservedPorts": null
   533            }
   534          ]
   535        }
   536      },
   537      "TaskStates": {
   538        "webapp": {
   539          "Events": [
   540            {
   541              "Details": {},
   542              "DiskLimit": 0,
   543              "DisplayMessage": "Task received by client",
   544              "DownloadError": "",
   545              "DriverError": "",
   546              "DriverMessage": "",
   547              "ExitCode": 0,
   548              "FailedSibling": "",
   549              "FailsTask": false,
   550              "GenericSource": "",
   551              "KillError": "",
   552              "KillReason": "",
   553              "KillTimeout": 0,
   554              "Message": "",
   555              "RestartReason": "",
   556              "SetupError": "",
   557              "Signal": 0,
   558              "StartDelay": 0,
   559              "TaskSignal": "",
   560              "TaskSignalReason": "",
   561              "Time": 1523490066712543500,
   562              "Type": "Received",
   563              "ValidationError": "",
   564              "VaultError": ""
   565            },
   566            {
   567              "Details": {
   568                "message": "Building Task Directory"
   569              },
   570              "DiskLimit": 0,
   571              "DisplayMessage": "Building Task Directory",
   572              "DownloadError": "",
   573              "DriverError": "",
   574              "DriverMessage": "",
   575              "ExitCode": 0,
   576              "FailedSibling": "",
   577              "FailsTask": false,
   578              "GenericSource": "",
   579              "KillError": "",
   580              "KillReason": "",
   581              "KillTimeout": 0,
   582              "Message": "Building Task Directory",
   583              "RestartReason": "",
   584              "SetupError": "",
   585              "Signal": 0,
   586              "StartDelay": 0,
   587              "TaskSignal": "",
   588              "TaskSignalReason": "",
   589              "Time": 1523490066715208000,
   590              "Type": "Task Setup",
   591              "ValidationError": "",
   592              "VaultError": ""
   593            },
   594            {
   595              "Details": {},
   596              "DiskLimit": 0,
   597              "DisplayMessage": "Task started by client",
   598              "DownloadError": "",
   599              "DriverError": "",
   600              "DriverMessage": "",
   601              "ExitCode": 0,
   602              "FailedSibling": "",
   603              "FailsTask": false,
   604              "GenericSource": "",
   605              "KillError": "",
   606              "KillReason": "",
   607              "KillTimeout": 0,
   608              "Message": "",
   609              "RestartReason": "",
   610              "SetupError": "",
   611              "Signal": 0,
   612              "StartDelay": 0,
   613              "TaskSignal": "",
   614              "TaskSignalReason": "",
   615              "Time": 1523490068433051100,
   616              "Type": "Started",
   617              "ValidationError": "",
   618              "VaultError": ""
   619            }
   620          ],
   621          "Failed": false,
   622          "FinishedAt": "0001-01-01T00:00:00Z",
   623          "LastRestart": "0001-01-01T00:00:00Z",
   624          "Restarts": 0,
   625          "StartedAt": "2018-04-11T23:41:08.445128764Z",
   626          "State": "running"
   627        }
   628      }
   629    }
   630  ]
   631  ```
   632      
   633  ## Create Node Evaluation
   634  
   635  This endpoint creates a new evaluation for the given node. This can be used to
   636  force a run of the scheduling logic.
   637  
   638  | Method  | Path                         | Produces                   |
   639  | ------- | ---------------------------- | -------------------------- |
   640  | `POST`  | `/v1/node/:node_id/evaluate` | `application/json`         |
   641  
   642  The table below shows this endpoint's support for
   643  [blocking queries](/api/index.html#blocking-queries) and
   644  [required ACLs](/api/index.html#acls).
   645  
   646  | Blocking Queries | ACL Required       |
   647  | ---------------- | ------------------ |
   648  | `NO`             | `node:write`       |
   649  
   650  ### Parameters
   651  
   652  - `:node_id` `(string: <required>)`- Specifies the UUID of the node. This must
   653    be the full UUID, not the short 8-character one. This is specified as part of
   654    the path.
   655  
   656  ### Sample Request
   657  
   658  ```text
   659  $ curl \
   660      http://localhost:4646/v1/node/fb2170a8-257d-3c64-b14d-bc06cc94e34c/evaluate
   661  ```
   662  
   663  ### Sample Response
   664  
   665  ```json
   666  {
   667    "EvalCreateIndex": 3671,
   668    "EvalIDs": [
   669      "4dfc2db7-b481-c53b-3072-14479aa44be3"
   670    ],
   671    "HeartbeatTTL": 0,
   672    "Index": 3671,
   673    "KnownLeader": false,
   674    "LastContact": 0,
   675    "LeaderRPCAddr": "10.138.0.2:4647",
   676    "NodeModifyIndex": 0,
   677    "NumNodes": 3,
   678    "Servers": [
   679      {
   680        "Datacenter": "dc1",
   681        "RPCAdvertiseAddr": "10.138.0.2:4647",
   682        "RPCMajorVersion": 1,
   683        "RPCMinorVersion": 1
   684      },
   685      {
   686        "Datacenter": "dc1",
   687        "RPCAdvertiseAddr": "10.138.0.3:4647",
   688        "RPCMajorVersion": 1,
   689        "RPCMinorVersion": 1
   690      },
   691      {
   692        "Datacenter": "dc1",
   693        "RPCAdvertiseAddr": "10.138.0.4:4647",
   694        "RPCMajorVersion": 1,
   695        "RPCMinorVersion": 1
   696      }
   697    ]
   698  }
   699  
   700  ```
   701  
   702  ## Drain Node
   703  
   704  This endpoint toggles the drain mode of the node. When draining is enabled, no
   705  further allocations will be assigned to this node, and existing allocations will
   706  be migrated to new nodes. See the [Decommissioning Nodes
   707  guide](/guides/node-draining.html) for suggested usage.
   708  
   709  | Method  | Path                      | Produces                   |
   710  | ------- | ------------------------- | -------------------------- |
   711  | `POST`  | `/v1/node/:node_id/drain` | `application/json`         |
   712  
   713  The table below shows this endpoint's support for
   714  [blocking queries](/api/index.html#blocking-queries) and
   715  [required ACLs](/api/index.html#acls).
   716  
   717  | Blocking Queries | ACL Required       |
   718  | ---------------- | ------------------ |
   719  | `NO`             | `node:write`       |
   720  
   721  ### Parameters
   722  
   723  - `:node_id` `(string: <required>)`- Specifies the UUID of the node. This must
   724    be the full UUID, not the short 8-character one. This is specified as part of
   725    the path.
   726  
   727  - `DrainSpec` `(object: <optional>)` - Specifies if drain mode should be
   728    enabled. A missing or null value disables an existing drain.
   729  
   730    - `Deadline` `(int: <required>)` - Specifies how long to wait in nanoseconds
   731      for allocations to finish migrating before they are force stopped. This is
   732      also how long batch jobs are given to complete before being migrated.
   733  
   734    - `IgnoreSystemJobs` `(bool: false)` - Specifies whether or not to stop system
   735      jobs as part of a drain. By default system jobs will be stopped after all
   736      other allocations have migrated or the deadline is reached. Setting this to
   737      `true` means system jobs are always left running.
   738  
   739  - `MarkEligible` `(bool: false)` - Specifies whether to mark a node as eligible
   740    for scheduling again when _disabling_ a drain.
   741  
   742  ### Sample Payload
   743  
   744  ```json
   745  {
   746      "DrainSpec": {
   747           "Deadline": "3600000000000",
   748           "IgnoreSystemJobs": true
   749      }
   750  }
   751  ```
   752  
   753  ### Sample Request
   754  
   755  ```text
   756  $ curl \
   757      -XPOST \
   758      --data @drain.json \
   759      http://localhost:4646/v1/node/fb2170a8-257d-3c64-b14d-bc06cc94e34c/drain
   760  ```
   761  
   762  ### Sample Response
   763  
   764  ```json
   765  {
   766    "EvalCreateIndex": 0,
   767    "EvalIDs": null,
   768    "Index": 3742,
   769    "NodeModifyIndex": 3742
   770  }
   771  ```
   772  
   773  ## Purge Node
   774  
   775  This endpoint purges a node from the system. Nodes can still join the cluster if
   776  they are alive.
   777  
   778  | Method  | Path                      | Produces                   |
   779  | ------- | ------------------------- | -------------------------- |
   780  | `POST`  | `/v1/node/:node_id/purge` | `application/json`         |
   781  
   782  The table below shows this endpoint's support for
   783  [blocking queries](/api/index.html#blocking-queries) and
   784  [required ACLs](/api/index.html#acls).
   785  
   786  | Blocking Queries | ACL Required       |
   787  | ---------------- | ------------------ |
   788  | `NO`             | `node:write`       |
   789  
   790  ### Parameters
   791  
   792  - `:node_id` `(string: <required>)`- Specifies the UUID of the node. This must
   793    be the full UUID, not the short 8-character one. This is specified as part of
   794    the path.
   795  
   796  ### Sample Request
   797  
   798  ```text
   799  $ curl \
   800      -XPOST http://localhost:4646/v1/node/f7476465-4d6e-c0de-26d0-e383c49be941/purge
   801  ```
   802  
   803  ### Sample Response
   804  
   805  ```json
   806  {
   807    "EvalCreateIndex": 3817,
   808    "EvalIDs": [
   809      "71bad787-5ab1-9939-be02-4809441583cd"
   810    ],
   811    "HeartbeatTTL": 0,
   812    "Index": 3816,
   813    "KnownLeader": false,
   814    "LastContact": 0,
   815    "LeaderRPCAddr": "",
   816    "NodeModifyIndex": 3816,
   817    "NumNodes": 0,
   818    "Servers": null
   819  }
   820  ```
   821  
   822  #### Field Reference
   823  
   824  - Events - A list of the last 10 node events for this node. A node event is a
   825    high level concept of noteworthy events for a node.
   826  
   827    Each node event has the following fields:
   828  
   829    - `Message` - The specific message for the event, detailing what occurred.
   830  
   831    - `Subsystem` - The subsystem where the node event took place. Subsysystems
   832      include:
   833  
   834      - `Drain` - The Nomad server draining subsystem.
   835  
   836      - `Driver` - The Nomad client driver subsystem.
   837  
   838      - `Heartbeat` - Either Nomad client or server heartbeating subsystem.
   839  
   840      - `Cluster` - Nomad server cluster management subsystem.
   841  
   842    - `Details` - Any further details about the event, formatted as a key/value
   843      pair.
   844  
   845    - `Timestamp` - Each node event has an ISO 8601 timestamp.
   846  
   847    - `CreateIndex` - The Raft index at which the event was committed.