github.com/diptanu/nomad@v0.5.7-0.20170516172507-d72e86cbe3d9/website/source/docs/http/node.html.md (about) 1 --- 2 layout: "http" 3 page_title: "HTTP API: /v1/node" 4 sidebar_current: "docs-http-node-" 5 description: |- 6 The '/1/node-' endpoint is used to query a specific client node. 7 --- 8 9 # /v1/node 10 11 The `node` endpoint is used to query the a specific client node. 12 By default, the agent's local region is used; another region can 13 be specified using the `?region=` query parameter. 14 15 ## GET 16 17 <dl> 18 <dt>Description</dt> 19 <dd> 20 Query the status of a client node registered with Nomad. 21 </dd> 22 23 <dt>Method</dt> 24 <dd>GET</dd> 25 26 <dt>URL</dt> 27 <dd>`/v1/node/<ID>`</dd> 28 29 <dt>Parameters</dt> 30 <dd> 31 None 32 </dd> 33 34 <dt>Blocking Queries</dt> 35 <dd> 36 [Supported](/docs/http/index.html#blocking-queries) 37 </dd> 38 39 <dt>Returns</dt> 40 <dd> 41 42 ```javascript 43 { 44 "ID": "c9972143-861d-46e6-df73-1d8287bc3e66", 45 "Datacenter": "dc1", 46 "Name": "Armons-MacBook-Air.local", 47 "Attributes": { 48 "arch": "amd64", 49 "cpu.frequency": "1300.000000", 50 "cpu.modelname": "Intel(R) Core(TM) i5-4250U CPU @ 1.30GHz", 51 "cpu.numcores": "2", 52 "cpu.totalcompute": "2600.000000", 53 "driver.exec": "1", 54 "driver.java": "1", 55 "driver.java.runtime": "Java(TM) SE Runtime Environment (build 1.8.0_05-b13)", 56 "driver.java.version": "1.8.0_05", 57 "driver.java.vm": "Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)", 58 "hostname": "Armons-MacBook-Air.local", 59 "kernel.name": "darwin", 60 "kernel.version": "14.4.0", 61 "memory.totalbytes": "8589934592", 62 "network.ip-address": "127.0.0.1", 63 "os.name": "darwin", 64 "os.version": "14.4.0", 65 "storage.bytesfree": "35888713728", 66 "storage.bytestotal": "249821659136", 67 "storage.volume": "/dev/disk1" 68 }, 69 "Resources": { 70 "CPU": 2600, 71 "MemoryMB": 8192, 72 "DiskMB": 34226, 73 "IOPS": 0, 74 "Networks": null 75 }, 76 "Reserved": { 77 "CPU": 0, 78 "MemoryMB": 0, 79 "DiskMB": 0, 80 "IOPS": 0, 81 "Networks": null 82 }, 83 "Links": {}, 84 "Meta": {}, 85 "NodeClass": "", 86 "Drain": false, 87 "Status": "ready", 88 "StatusDescription": "", 89 "CreateIndex": 3, 90 "ModifyIndex": 4 91 } 92 ``` 93 94 </dd> 95 </dl> 96 97 <dl> 98 <dt>Description</dt> 99 <dd> 100 Query the allocations belonging to a single node. 101 </dd> 102 103 <dt>Method</dt> 104 <dd>GET</dd> 105 106 <dt>URL</dt> 107 <dd>`/v1/node/<ID>/allocations`</dd> 108 109 <dt>Parameters</dt> 110 <dd> 111 None 112 </dd> 113 114 <dt>Blocking Queries</dt> 115 <dd> 116 [Supported](/docs/http/index.html#blocking-queries) 117 </dd> 118 119 <dt>Returns</dt> 120 <dd> 121 122 ```javascript 123 [ 124 { 125 "ID": "203266e5-e0d6-9486-5e05-397ed2b184af", 126 "EvalID": "e68125ed-3fba-fb46-46cc-291addbc4455", 127 "Name": "example.cache[0]", 128 "NodeID": "e02b6169-83bd-9df6-69bd-832765f333eb", 129 "JobID": "example", 130 "ModifyIndex": 9, 131 "Resources": { 132 "Networks": [ 133 { 134 "DynamicPorts": [ 135 { 136 "Value": 20802, 137 "Label": "db" 138 } 139 ], 140 "ReservedPorts": null, 141 "MBits": 10, 142 "IP": "", 143 "CIDR": "", 144 "Device": "" 145 } 146 ], 147 "IOPS": 0, 148 "DiskMB": 0, 149 "MemoryMB": 256, 150 "CPU": 500 151 }, 152 "TaskGroup": "cache", 153 "Job": { 154 "ModifyIndex": 5, 155 "CreateIndex": 5, 156 "StatusDescription": "", 157 "Status": "", 158 "Meta": null, 159 "Update": { 160 "MaxParallel": 1, 161 "Stagger": 1e+10 162 }, 163 "TaskGroups": [ 164 { 165 "Meta": null, 166 "Tasks": [ 167 { 168 "Meta": null, 169 "Resources": { 170 "Networks": [ 171 { 172 "DynamicPorts": [ 173 { 174 "Value": 20802, 175 "Label": "db" 176 } 177 ], 178 "ReservedPorts": null, 179 "MBits": 0, 180 "IP": "127.0.0.1", 181 "CIDR": "", 182 "Device": "lo" 183 } 184 ], 185 "IOPS": 0, 186 "DiskMB": 0, 187 "MemoryMB": 256, 188 "CPU": 500 189 }, 190 "Constraints": null, 191 "Services": [ 192 { 193 "Checks": [ 194 { 195 "Timeout": 2e+09, 196 "Interval": 1e+10, 197 "Protocol": "", 198 "Http": "", 199 "Script": "", 200 "Type": "tcp", 201 "Name": "alive", 202 "Id": "" 203 } 204 ], 205 "PortLabel": "db", 206 "Tags": [ 207 "global", 208 "cache" 209 ], 210 "Name": "example-cache-redis", 211 "Id": "" 212 } 213 ], 214 "Env": null, 215 "Config": { 216 "port_map": [ 217 { 218 "db": 6379 219 } 220 ], 221 "image": "redis:latest" 222 }, 223 "Driver": "docker", 224 "Name": "redis" 225 } 226 ], 227 "RestartPolicy": { 228 "Delay": 2.5e+10, 229 "Interval": 3e+11, 230 "Attempts": 10 231 }, 232 "Constraints": null, 233 "Count": 1, 234 "Name": "cache" 235 } 236 ], 237 "Region": "global", 238 "ID": "example", 239 "Name": "example", 240 "Type": "service", 241 "Priority": 50, 242 "AllAtOnce": false, 243 "Datacenters": [ 244 "dc1" 245 ], 246 "Constraints": [ 247 { 248 "Operand": "=", 249 "RTarget": "linux", 250 "LTarget": "${attr.kernel.name}" 251 } 252 ] 253 }, 254 "TaskResources": { 255 "redis": { 256 "Networks": [ 257 { 258 "DynamicPorts": [ 259 { 260 "Value": 20802, 261 "Label": "db" 262 } 263 ], 264 "ReservedPorts": null, 265 "MBits": 0, 266 "IP": "127.0.0.1", 267 "CIDR": "", 268 "Device": "lo" 269 } 270 ], 271 "IOPS": 0, 272 "DiskMB": 0, 273 "MemoryMB": 256, 274 "CPU": 500 275 } 276 }, 277 "Metrics": { 278 "CoalescedFailures": 0, 279 "AllocationTime": 1590406, 280 "NodesEvaluated": 1, 281 "NodesFiltered": 0, 282 "ClassFiltered": null, 283 "ConstraintFiltered": null, 284 "NodesExhausted": 0, 285 "ClassExhausted": null, 286 "DimensionExhausted": null, 287 "Scores": { 288 "e02b6169-83bd-9df6-69bd-832765f333eb.binpack": 6.133651487695705 289 } 290 }, 291 "DesiredStatus": "run", 292 "DesiredDescription": "", 293 "ClientStatus": "running", 294 "ClientDescription": "", 295 "TaskStates": { 296 "redis": { 297 "Events": [ 298 { 299 "KillError": "", 300 "Message": "", 301 "Signal": 0, 302 "ExitCode": 0, 303 "DriverError": "", 304 "Time": 1447806038427841000, 305 "Type": "Started" 306 } 307 ], 308 "State": "running" 309 } 310 }, 311 "CreateIndex": 7 312 }, 313 ... 314 ] 315 ``` 316 317 </dd> 318 </dl> 319 320 ## PUT / POST 321 322 <dl> 323 <dt>Description</dt> 324 <dd> 325 Creates a new evaluation for the given node. This can be used to force 326 run the scheduling logic if necessary. 327 </dd> 328 329 <dt>Method</dt> 330 <dd>PUT or POST</dd> 331 332 <dt>URL</dt> 333 <dd>`/v1/node/<ID>/evaluate`</dd> 334 335 <dt>Parameters</dt> 336 <dd> 337 None 338 </dd> 339 340 <dt>Returns</dt> 341 <dd> 342 343 ```javascript 344 { 345 "EvalIDs": ["d092fdc0-e1fd-2536-67d8-43af8ca798ac"], 346 "EvalCreateIndex": 35, 347 "NodeModifyIndex": 34 348 } 349 ``` 350 351 </dd> 352 </dl> 353 354 <dl> 355 <dt>Description</dt> 356 <dd> 357 Toggle the drain mode of the node. When enabled, no further 358 allocations will be assigned and existing allocations will be 359 migrated. 360 </dd> 361 362 <dt>Method</dt> 363 <dd>PUT or POST</dd> 364 365 <dt>URL</dt> 366 <dd>`/v1/node/<ID>/drain`</dd> 367 368 <dt>Parameters</dt> 369 <dd> 370 <ul> 371 <li> 372 <span class="param">enable</span> 373 <span class="param-flags">required</span> 374 Boolean value provided as a query parameter to either set 375 enabled to true or false. 376 </li> 377 </ul> 378 </dd> 379 380 <dt>Returns</dt> 381 <dd> 382 383 ```javascript 384 { 385 "EvalID": "d092fdc0-e1fd-2536-67d8-43af8ca798ac", 386 "EvalCreateIndex": 35, 387 "NodeModifyIndex": 34 388 } 389 ``` 390 391 </dd> 392 </dl>