github.com/containers/libpod@v1.9.4-0.20220419124438-4284fd425507/pkg/api/server/register_containers.go (about) 1 package server 2 3 import ( 4 "net/http" 5 6 "github.com/containers/libpod/pkg/api/handlers/compat" 7 "github.com/containers/libpod/pkg/api/handlers/libpod" 8 "github.com/gorilla/mux" 9 ) 10 11 func (s *APIServer) registerContainersHandlers(r *mux.Router) error { 12 // swagger:operation POST /containers/create compat createContainer 13 // --- 14 // summary: Create a container 15 // tags: 16 // - containers (compat) 17 // produces: 18 // - application/json 19 // parameters: 20 // - in: query 21 // name: name 22 // type: string 23 // description: container name 24 // responses: 25 // 201: 26 // $ref: "#/responses/ContainerCreateResponse" 27 // 400: 28 // $ref: "#/responses/BadParamError" 29 // 404: 30 // $ref: "#/responses/NoSuchContainer" 31 // 409: 32 // $ref: "#/responses/ConflictError" 33 // 500: 34 // $ref: "#/responses/InternalError" 35 r.HandleFunc(VersionedPath("/containers/create"), s.APIHandler(compat.CreateContainer)).Methods(http.MethodPost) 36 // Added non version path to URI to support docker non versioned paths 37 r.HandleFunc("/containers/create", s.APIHandler(compat.CreateContainer)).Methods(http.MethodPost) 38 // swagger:operation GET /containers/json compat listContainers 39 // --- 40 // tags: 41 // - containers (compat) 42 // summary: List containers 43 // description: Returns a list of containers 44 // parameters: 45 // - in: query 46 // name: all 47 // type: boolean 48 // default: false 49 // description: Return all containers. By default, only running containers are shown 50 // - in: query 51 // name: limit 52 // description: Return this number of most recently created containers, including non-running ones. 53 // type: integer 54 // - in: query 55 // name: size 56 // type: boolean 57 // default: false 58 // description: Return the size of container as fields SizeRw and SizeRootFs. 59 // - in: query 60 // name: filters 61 // type: string 62 // description: | 63 // Returns a list of containers. 64 // - ancestor=(<image-name>[:<tag>], <image id>, or <image@digest>) 65 // - before=(<container id> or <container name>) 66 // - expose=(<port>[/<proto>]|<startport-endport>/[<proto>]) 67 // - exited=<int> containers with exit code of <int> 68 // - health=(starting|healthy|unhealthy|none) 69 // - id=<ID> a container's ID 70 // - is-task=(true|false) 71 // - label=key or label="key=value" of a container label 72 // - name=<name> a container's name 73 // - network=(<network id> or <network name>) 74 // - publish=(<port>[/<proto>]|<startport-endport>/[<proto>]) 75 // - since=(<container id> or <container name>) 76 // - status=(created|restarting|running|removing|paused|exited|dead) 77 // - volume=(<volume name> or <mount point destination>) 78 // produces: 79 // - application/json 80 // responses: 81 // 200: 82 // $ref: "#/responses/DocsListContainer" 83 // 400: 84 // $ref: "#/responses/BadParamError" 85 // 500: 86 // $ref: "#/responses/InternalError" 87 r.HandleFunc(VersionedPath("/containers/json"), s.APIHandler(compat.ListContainers)).Methods(http.MethodGet) 88 // Added non version path to URI to support docker non versioned paths 89 r.HandleFunc("/containers/json", s.APIHandler(compat.ListContainers)).Methods(http.MethodGet) 90 // swagger:operation POST /containers/prune compat pruneContainers 91 // --- 92 // tags: 93 // - containers (compat) 94 // summary: Delete stopped containers 95 // description: Remove containers not in use 96 // parameters: 97 // - in: query 98 // name: filters 99 // type: string 100 // description: | 101 // Filters to process on the prune list, encoded as JSON (a `map[string][]string`). Available filters: 102 // - `until=<timestamp>` Prune containers created before this timestamp. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. 103 // - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune containers with (or without, in case `label!=...` is used) the specified labels. 104 // produces: 105 // - application/json 106 // responses: 107 // 200: 108 // $ref: "#/responses/DocsContainerPruneReport" 109 // 500: 110 // $ref: "#/responses/InternalError" 111 r.HandleFunc(VersionedPath("/containers/prune"), s.APIHandler(compat.PruneContainers)).Methods(http.MethodPost) 112 // Added non version path to URI to support docker non versioned paths 113 r.HandleFunc("/containers/prune", s.APIHandler(compat.PruneContainers)).Methods(http.MethodPost) 114 // swagger:operation DELETE /containers/{name} compat removeContainer 115 // --- 116 // tags: 117 // - containers (compat) 118 // summary: Remove a container 119 // parameters: 120 // - in: path 121 // name: name 122 // type: string 123 // required: true 124 // description: the name or ID of the container 125 // - in: query 126 // name: force 127 // type: boolean 128 // default: false 129 // description: If the container is running, kill it before removing it. 130 // - in: query 131 // name: v 132 // type: boolean 133 // default: false 134 // description: Remove the volumes associated with the container. 135 // - in: query 136 // name: link 137 // type: boolean 138 // description: not supported 139 // produces: 140 // - application/json 141 // responses: 142 // 204: 143 // description: no error 144 // 400: 145 // $ref: "#/responses/BadParamError" 146 // 404: 147 // $ref: "#/responses/NoSuchContainer" 148 // 409: 149 // $ref: "#/responses/ConflictError" 150 // 500: 151 // $ref: "#/responses/InternalError" 152 r.HandleFunc(VersionedPath("/containers/{name}"), s.APIHandler(compat.RemoveContainer)).Methods(http.MethodDelete) 153 // Added non version path to URI to support docker non versioned paths 154 r.HandleFunc("/containers/{name}", s.APIHandler(compat.RemoveContainer)).Methods(http.MethodDelete) 155 // swagger:operation GET /containers/{name}/json compat getContainer 156 // --- 157 // tags: 158 // - containers (compat) 159 // summary: Inspect container 160 // description: Return low-level information about a container. 161 // parameters: 162 // - in: path 163 // name: name 164 // type: string 165 // required: true 166 // description: the name or id of the container 167 // - in: query 168 // name: size 169 // type: boolean 170 // default: false 171 // description: include the size of the container 172 // produces: 173 // - application/json 174 // responses: 175 // 200: 176 // $ref: "#/responses/DocsContainerInspectResponse" 177 // 404: 178 // $ref: "#/responses/NoSuchContainer" 179 // 500: 180 // $ref: "#/responses/InternalError" 181 r.HandleFunc(VersionedPath("/containers/{name}/json"), s.APIHandler(compat.GetContainer)).Methods(http.MethodGet) 182 // Added non version path to URI to support docker non versioned paths 183 r.HandleFunc("/containers/{name}/json", s.APIHandler(compat.GetContainer)).Methods(http.MethodGet) 184 // swagger:operation POST /containers/{name}/kill compat killContainer 185 // --- 186 // tags: 187 // - containers (compat) 188 // summary: Kill container 189 // description: Signal to send to the container as an integer or string (e.g. SIGINT) 190 // parameters: 191 // - in: path 192 // name: name 193 // type: string 194 // required: true 195 // description: the name or ID of the container 196 // - in: query 197 // name: signal 198 // type: string 199 // default: TERM 200 // description: signal to be sent to container 201 // default: SIGKILL 202 // produces: 203 // - application/json 204 // responses: 205 // 204: 206 // description: no error 207 // 404: 208 // $ref: "#/responses/NoSuchContainer" 209 // 409: 210 // $ref: "#/responses/ConflictError" 211 // 500: 212 // $ref: "#/responses/InternalError" 213 r.HandleFunc(VersionedPath("/containers/{name}/kill"), s.APIHandler(compat.KillContainer)).Methods(http.MethodPost) 214 // Added non version path to URI to support docker non versioned paths 215 r.HandleFunc("/containers/{name}/kill", s.APIHandler(compat.KillContainer)).Methods(http.MethodPost) 216 // swagger:operation GET /containers/{name}/logs compat logsFromContainer 217 // --- 218 // tags: 219 // - containers (compat) 220 // summary: Get container logs 221 // description: Get stdout and stderr logs from a container. 222 // parameters: 223 // - in: path 224 // name: name 225 // type: string 226 // required: true 227 // description: the name or ID of the container 228 // - in: query 229 // name: follow 230 // type: boolean 231 // description: Keep connection after returning logs. 232 // - in: query 233 // name: stdout 234 // type: boolean 235 // description: Return logs from stdout 236 // - in: query 237 // name: stderr 238 // type: boolean 239 // description: Return logs from stderr 240 // - in: query 241 // name: since 242 // type: string 243 // description: Only return logs since this time, as a UNIX timestamp 244 // - in: query 245 // name: until 246 // type: string 247 // description: Only return logs before this time, as a UNIX timestamp 248 // - in: query 249 // name: timestamps 250 // type: boolean 251 // default: false 252 // description: Add timestamps to every log line 253 // - in: query 254 // name: tail 255 // type: string 256 // description: Only return this number of log lines from the end of the logs 257 // default: all 258 // produces: 259 // - application/json 260 // responses: 261 // 200: 262 // description: logs returned as a stream in response body. 263 // 404: 264 // $ref: "#/responses/NoSuchContainer" 265 // 500: 266 // $ref: "#/responses/InternalError" 267 r.HandleFunc(VersionedPath("/containers/{name}/logs"), s.APIHandler(compat.LogsFromContainer)).Methods(http.MethodGet) 268 // Added non version path to URI to support docker non versioned paths 269 r.HandleFunc("/containers/{name}/logs", s.APIHandler(compat.LogsFromContainer)).Methods(http.MethodGet) 270 // swagger:operation POST /containers/{name}/pause compat pauseContainer 271 // --- 272 // tags: 273 // - containers (compat) 274 // summary: Pause container 275 // description: Use the cgroups freezer to suspend all processes in a container. 276 // parameters: 277 // - in: path 278 // name: name 279 // type: string 280 // required: true 281 // description: the name or ID of the container 282 // produces: 283 // - application/json 284 // responses: 285 // 204: 286 // description: no error 287 // 404: 288 // $ref: "#/responses/NoSuchContainer" 289 // 500: 290 // $ref: "#/responses/InternalError" 291 r.HandleFunc(VersionedPath("/containers/{name}/pause"), s.APIHandler(compat.PauseContainer)).Methods(http.MethodPost) 292 // Added non version path to URI to support docker non versioned paths 293 r.HandleFunc("/containers/{name}/pause", s.APIHandler(compat.PauseContainer)).Methods(http.MethodPost) 294 r.HandleFunc(VersionedPath("/containers/{name}/rename"), s.APIHandler(compat.UnsupportedHandler)).Methods(http.MethodPost) 295 // Added non version path to URI to support docker non versioned paths 296 r.HandleFunc("/containers/{name}/rename", s.APIHandler(compat.UnsupportedHandler)).Methods(http.MethodPost) 297 // swagger:operation POST /containers/{name}/restart compat restartContainer 298 // --- 299 // tags: 300 // - containers (compat) 301 // summary: Restart container 302 // parameters: 303 // - in: path 304 // name: name 305 // type: string 306 // required: true 307 // description: the name or ID of the container 308 // - in: query 309 // name: t 310 // type: integer 311 // description: timeout before sending kill signal to container 312 // produces: 313 // - application/json 314 // responses: 315 // 204: 316 // description: no error 317 // 404: 318 // $ref: "#/responses/NoSuchContainer" 319 // 500: 320 // $ref: "#/responses/InternalError" 321 r.HandleFunc(VersionedPath("/containers/{name}/restart"), s.APIHandler(compat.RestartContainer)).Methods(http.MethodPost) 322 // Added non version path to URI to support docker non versioned paths 323 r.HandleFunc("/containers/{name}/restart", s.APIHandler(compat.RestartContainer)).Methods(http.MethodPost) 324 // swagger:operation POST /containers/{name}/start compat startContainer 325 // --- 326 // tags: 327 // - containers (compat) 328 // summary: Start a container 329 // parameters: 330 // - in: path 331 // name: name 332 // type: string 333 // required: true 334 // description: the name or ID of the container 335 // - in: query 336 // name: detachKeys 337 // type: string 338 // description: "Override the key sequence for detaching a container. Format is a single character [a-Z] or ctrl-<value> where <value> is one of: a-z, @, ^, [, , or _." 339 // default: ctrl-p,ctrl-q 340 // produces: 341 // - application/json 342 // responses: 343 // 204: 344 // description: no error 345 // 304: 346 // $ref: "#/responses/ContainerAlreadyStartedError" 347 // 404: 348 // $ref: "#/responses/NoSuchContainer" 349 // 500: 350 // $ref: "#/responses/InternalError" 351 r.HandleFunc(VersionedPath("/containers/{name}/start"), s.APIHandler(compat.StartContainer)).Methods(http.MethodPost) 352 // Added non version path to URI to support docker non versioned paths 353 r.HandleFunc("/containers/{name}/start", s.APIHandler(compat.StartContainer)).Methods(http.MethodPost) 354 // swagger:operation GET /containers/{name}/stats compat statsContainer 355 // --- 356 // tags: 357 // - containers (compat) 358 // summary: Get stats for a container 359 // description: This returns a live stream of a container’s resource usage statistics. 360 // parameters: 361 // - in: path 362 // name: name 363 // type: string 364 // required: true 365 // description: the name or ID of the container 366 // - in: query 367 // name: stream 368 // type: boolean 369 // default: true 370 // description: Stream the output 371 // produces: 372 // - application/json 373 // responses: 374 // 200: 375 // description: OK 376 // 404: 377 // $ref: "#/responses/NoSuchContainer" 378 // 500: 379 // $ref: "#/responses/InternalError" 380 r.HandleFunc(VersionedPath("/containers/{name}/stats"), s.APIHandler(compat.StatsContainer)).Methods(http.MethodGet) 381 // Added non version path to URI to support docker non versioned paths 382 r.HandleFunc("/containers/{name}/stats", s.APIHandler(compat.StatsContainer)).Methods(http.MethodGet) 383 // swagger:operation POST /containers/{name}/stop compat stopContainer 384 // --- 385 // tags: 386 // - containers (compat) 387 // summary: Stop a container 388 // description: Stop a container 389 // parameters: 390 // - in: path 391 // name: name 392 // type: string 393 // required: true 394 // description: the name or ID of the container 395 // - in: query 396 // name: t 397 // type: integer 398 // description: number of seconds to wait before killing container 399 // produces: 400 // - application/json 401 // responses: 402 // 204: 403 // description: no error 404 // 304: 405 // $ref: "#/responses/ContainerAlreadyStoppedError" 406 // 404: 407 // $ref: "#/responses/NoSuchContainer" 408 // 500: 409 // $ref: "#/responses/InternalError" 410 r.HandleFunc(VersionedPath("/containers/{name}/stop"), s.APIHandler(compat.StopContainer)).Methods(http.MethodPost) 411 // Added non version path to URI to support docker non versioned paths 412 r.HandleFunc("/containers/{name}/stop", s.APIHandler(compat.StopContainer)).Methods(http.MethodPost) 413 // swagger:operation GET /containers/{name}/top compat topContainer 414 // --- 415 // tags: 416 // - containers (compat) 417 // summary: List processes running inside a container 418 // parameters: 419 // - in: path 420 // name: name 421 // type: string 422 // required: true 423 // description: the name or ID of the container 424 // - in: query 425 // name: ps_args 426 // type: string 427 // description: arguments to pass to ps such as aux. Requires ps(1) to be installed in the container if no ps(1) compatible AIX descriptors are used. 428 // produces: 429 // - application/json 430 // responses: 431 // 200: 432 // $ref: "#/responses/DocsContainerTopResponse" 433 // 404: 434 // $ref: "#/responses/NoSuchContainer" 435 // 500: 436 // $ref: "#/responses/InternalError" 437 r.HandleFunc(VersionedPath("/containers/{name}/top"), s.APIHandler(compat.TopContainer)).Methods(http.MethodGet) 438 // Added non version path to URI to support docker non versioned paths 439 r.HandleFunc("/containers/{name}/top", s.APIHandler(compat.TopContainer)).Methods(http.MethodGet) 440 // swagger:operation POST /containers/{name}/unpause compat unpauseContainer 441 // --- 442 // tags: 443 // - containers (compat) 444 // summary: Unpause container 445 // description: Resume a paused container 446 // parameters: 447 // - in: path 448 // name: name 449 // type: string 450 // required: true 451 // description: the name or ID of the container 452 // produces: 453 // - application/json 454 // responses: 455 // 204: 456 // description: no error 457 // 404: 458 // $ref: "#/responses/NoSuchContainer" 459 // 500: 460 // $ref: "#/responses/InternalError" 461 r.HandleFunc(VersionedPath("/containers/{name}/unpause"), s.APIHandler(compat.UnpauseContainer)).Methods(http.MethodPost) 462 // Added non version path to URI to support docker non versioned paths 463 r.HandleFunc("/containers/{name}/unpause", s.APIHandler(compat.UnpauseContainer)).Methods(http.MethodPost) 464 // swagger:operation POST /containers/{name}/wait compat waitContainer 465 // --- 466 // tags: 467 // - containers (compat) 468 // summary: Wait on a container 469 // description: Block until a container stops or given condition is met. 470 // parameters: 471 // - in: path 472 // name: name 473 // type: string 474 // required: true 475 // description: the name or ID of the container 476 // - in: query 477 // name: condition 478 // type: string 479 // description: | 480 // wait until container is to a given condition. default is stopped. valid conditions are: 481 // - configured 482 // - created 483 // - exited 484 // - paused 485 // - running 486 // - stopped 487 // produces: 488 // - application/json 489 // responses: 490 // 200: 491 // $ref: "#/responses/ContainerWaitResponse" 492 // 404: 493 // $ref: "#/responses/NoSuchContainer" 494 // 500: 495 // $ref: "#/responses/InternalError" 496 r.HandleFunc(VersionedPath("/containers/{name}/wait"), s.APIHandler(compat.WaitContainer)).Methods(http.MethodPost) 497 // Added non version path to URI to support docker non versioned paths 498 r.HandleFunc("/containers/{name}/wait", s.APIHandler(compat.WaitContainer)).Methods(http.MethodPost) 499 // swagger:operation POST /containers/{name}/attach compat attachContainer 500 // --- 501 // tags: 502 // - containers (compat) 503 // summary: Attach to a container 504 // description: Hijacks the connection to forward the container's standard streams to the client. 505 // parameters: 506 // - in: path 507 // name: name 508 // type: string 509 // required: true 510 // description: the name or ID of the container 511 // - in: query 512 // name: detachKeys 513 // required: false 514 // type: string 515 // description: keys to use for detaching from the container 516 // - in: query 517 // name: logs 518 // required: false 519 // type: boolean 520 // description: Stream all logs from the container across the connection. Happens before streaming attach (if requested). At least one of logs or stream must be set 521 // - in: query 522 // name: stream 523 // required: false 524 // type: boolean 525 // default: true 526 // description: Attach to the container. If unset, and logs is set, only the container's logs will be sent. At least one of stream or logs must be set 527 // - in: query 528 // name: stdout 529 // required: false 530 // type: boolean 531 // description: Attach to container STDOUT 532 // - in: query 533 // name: stderr 534 // required: false 535 // type: boolean 536 // description: Attach to container STDERR 537 // - in: query 538 // name: stdin 539 // required: false 540 // type: boolean 541 // description: Attach to container STDIN 542 // produces: 543 // - application/json 544 // responses: 545 // 101: 546 // description: No error, connection has been hijacked for transporting streams. 547 // 400: 548 // $ref: "#/responses/BadParamError" 549 // 404: 550 // $ref: "#/responses/NoSuchContainer" 551 // 500: 552 // $ref: "#/responses/InternalError" 553 r.HandleFunc(VersionedPath("/containers/{name}/attach"), s.APIHandler(compat.AttachContainer)).Methods(http.MethodPost) 554 // Added non version path to URI to support docker non versioned paths 555 r.HandleFunc("/containers/{name}/attach", s.APIHandler(compat.AttachContainer)).Methods(http.MethodPost) 556 // swagger:operation POST /containers/{name}/resize compat resizeContainer 557 // --- 558 // tags: 559 // - containers (compat) 560 // summary: Resize a container's TTY 561 // description: Resize the terminal attached to a container (for use with Attach). 562 // parameters: 563 // - in: path 564 // name: name 565 // type: string 566 // required: true 567 // description: the name or ID of the container 568 // - in: query 569 // name: h 570 // type: integer 571 // required: false 572 // description: Height to set for the terminal, in characters 573 // - in: query 574 // name: w 575 // type: integer 576 // required: false 577 // description: Width to set for the terminal, in characters 578 // produces: 579 // - application/json 580 // responses: 581 // 200: 582 // $ref: "#/responses/ok" 583 // 404: 584 // $ref: "#/responses/NoSuchContainer" 585 // 500: 586 // $ref: "#/responses/InternalError" 587 r.HandleFunc(VersionedPath("/containers/{name}/resize"), s.APIHandler(compat.ResizeContainer)).Methods(http.MethodPost) 588 // Added non version path to URI to support docker non versioned paths 589 r.HandleFunc("/containers/{name}/resize", s.APIHandler(compat.ResizeContainer)).Methods(http.MethodPost) 590 // swagger:operation GET /containers/{name}/export compat exportContainer 591 // --- 592 // tags: 593 // - containers (compat) 594 // summary: Export a container 595 // description: Export the contents of a container as a tarball. 596 // parameters: 597 // - in: path 598 // name: name 599 // type: string 600 // required: true 601 // description: the name or ID of the container 602 // produces: 603 // - application/json 604 // responses: 605 // 200: 606 // description: tarball is returned in body 607 // 404: 608 // $ref: "#/responses/NoSuchContainer" 609 // 500: 610 // $ref: "#/responses/InternalError" 611 r.HandleFunc(VersionedPath("/containers/{name}/export"), s.APIHandler(compat.ExportContainer)).Methods(http.MethodGet) 612 r.HandleFunc("/containers/{name}/export", s.APIHandler(compat.ExportContainer)).Methods(http.MethodGet) 613 614 /* 615 libpod endpoints 616 */ 617 618 // swagger:operation POST /libpod/containers/create libpod libpodCreateContainer 619 // --- 620 // summary: Create a container 621 // tags: 622 // - containers 623 // produces: 624 // - application/json 625 // parameters: 626 // - in: body 627 // name: create 628 // description: attributes for creating a container 629 // schema: 630 // $ref: "#/definitions/SpecGenerator" 631 // responses: 632 // 201: 633 // $ref: "#/responses/ContainerCreateResponse" 634 // 400: 635 // $ref: "#/responses/BadParamError" 636 // 404: 637 // $ref: "#/responses/NoSuchContainer" 638 // 409: 639 // $ref: "#/responses/ConflictError" 640 // 500: 641 // $ref: "#/responses/InternalError" 642 r.HandleFunc(VersionedPath("/libpod/containers/create"), s.APIHandler(libpod.CreateContainer)).Methods(http.MethodPost) 643 // swagger:operation GET /libpod/containers/json libpod libpodListContainers 644 // --- 645 // tags: 646 // - containers 647 // summary: List containers 648 // description: Returns a list of containers 649 // parameters: 650 // - in: query 651 // name: all 652 // type: boolean 653 // default: false 654 // description: Return all containers. By default, only running containers are shown 655 // - in: query 656 // name: limit 657 // description: Return this number of most recently created containers, including non-running ones. 658 // type: integer 659 // - in: query 660 // name: namespace 661 // type: boolean 662 // description: Include namespace information 663 // default: false 664 // - in: query 665 // name: pod 666 // type: boolean 667 // default: false 668 // description: Include Pod ID and Name if applicable 669 // - in: query 670 // name: size 671 // type: boolean 672 // default: false 673 // description: Return the size of container as fields SizeRw and SizeRootFs. 674 // - in: query 675 // name: sync 676 // type: boolean 677 // default: false 678 // description: Sync container state with OCI runtime 679 // - in: query 680 // name: filters 681 // type: string 682 // description: | 683 // A JSON encoded value of the filters (a `map[string][]string`) to process on the containers list. Available filters: 684 // - `ancestor`=(`<image-name>[:<tag>]`, `<image id>`, or `<image@digest>`) 685 // - `before`=(`<container id>` or `<container name>`) 686 // - `expose`=(`<port>[/<proto>]` or `<startport-endport>/[<proto>]`) 687 // - `exited=<int>` containers with exit code of `<int>` 688 // - `health`=(`starting`, `healthy`, `unhealthy` or `none`) 689 // - `id=<ID>` a container's ID 690 // - `is-task`=(`true` or `false`) 691 // - `label`=(`key` or `"key=value"`) of an container label 692 // - `name=<name>` a container's name 693 // - `network`=(`<network id>` or `<network name>`) 694 // - `publish`=(`<port>[/<proto>]` or `<startport-endport>/[<proto>]`) 695 // - `since`=(`<container id>` or `<container name>`) 696 // - `status`=(`created`, `restarting`, `running`, `removing`, `paused`, `exited` or `dead`) 697 // - `volume`=(`<volume name>` or `<mount point destination>`) 698 // produces: 699 // - application/json 700 // responses: 701 // 200: 702 // $ref: "#/responses/ListContainers" 703 // 400: 704 // $ref: "#/responses/BadParamError" 705 // 500: 706 // $ref: "#/responses/InternalError" 707 r.HandleFunc(VersionedPath("/libpod/containers/json"), s.APIHandler(libpod.ListContainers)).Methods(http.MethodGet) 708 // swagger:operation POST /libpod/containers/prune libpod libpodPruneContainers 709 // --- 710 // tags: 711 // - containers 712 // summary: Delete stopped containers 713 // description: Remove containers not in use 714 // parameters: 715 // - in: query 716 // name: filters 717 // type: string 718 // description: | 719 // Filters to process on the prune list, encoded as JSON (a `map[string][]string`). Available filters: 720 // - `until=<timestamp>` Prune containers created before this timestamp. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. 721 // - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune containers with (or without, in case `label!=...` is used) the specified labels. 722 // produces: 723 // - application/json 724 // responses: 725 // 200: 726 // $ref: "#/responses/DocsLibpodPruneResponse" 727 // 500: 728 // $ref: "#/responses/InternalError" 729 r.HandleFunc(VersionedPath("/libpod/containers/prune"), s.APIHandler(compat.PruneContainers)).Methods(http.MethodPost) 730 // swagger:operation GET /libpod/containers/showmounted libpod libpodShowMountedContainers 731 // --- 732 // tags: 733 // - containers 734 // summary: Show mounted containers 735 // description: Lists all mounted containers mount points 736 // produces: 737 // - application/json 738 // responses: 739 // 200: 740 // description: mounted containers 741 // schema: 742 // type: object 743 // additionalProperties: 744 // type: string 745 // 500: 746 // $ref: "#/responses/InternalError" 747 r.HandleFunc(VersionedPath("/libpod/containers/showmounted"), s.APIHandler(libpod.ShowMountedContainers)).Methods(http.MethodGet) 748 // swagger:operation DELETE /libpod/containers/{name} libpod libpodRemoveContainer 749 // --- 750 // tags: 751 // - containers 752 // summary: Delete container 753 // description: Delete container 754 // parameters: 755 // - in: path 756 // name: name 757 // type: string 758 // required: true 759 // description: the name or ID of the container 760 // - in: query 761 // name: force 762 // type: boolean 763 // description: need something 764 // - in: query 765 // name: v 766 // type: boolean 767 // description: delete volumes 768 // produces: 769 // - application/json 770 // responses: 771 // 204: 772 // description: no error 773 // 400: 774 // $ref: "#/responses/BadParamError" 775 // 404: 776 // $ref: "#/responses/NoSuchContainer" 777 // 409: 778 // $ref: "#/responses/ConflictError" 779 // 500: 780 // $ref: "#/responses/InternalError" 781 r.HandleFunc(VersionedPath("/libpod/containers/{name}"), s.APIHandler(compat.RemoveContainer)).Methods(http.MethodDelete) 782 // swagger:operation GET /libpod/containers/{name}/json libpod libpodGetContainer 783 // --- 784 // tags: 785 // - containers 786 // summary: Inspect container 787 // description: Return low-level information about a container. 788 // parameters: 789 // - in: path 790 // name: name 791 // type: string 792 // required: true 793 // description: the name or ID of the container 794 // - in: query 795 // name: size 796 // type: boolean 797 // description: display filesystem usage 798 // produces: 799 // - application/json 800 // responses: 801 // 200: 802 // $ref: "#/responses/LibpodInspectContainerResponse" 803 // 404: 804 // $ref: "#/responses/NoSuchContainer" 805 // 500: 806 // $ref: "#/responses/InternalError" 807 r.HandleFunc(VersionedPath("/libpod/containers/{name}/json"), s.APIHandler(libpod.GetContainer)).Methods(http.MethodGet) 808 // swagger:operation POST /libpod/containers/{name}/kill libpod libpodKillContainer 809 // --- 810 // tags: 811 // - containers 812 // summary: Kill container 813 // description: send a signal to a container, defaults to killing the container 814 // parameters: 815 // - in: path 816 // name: name 817 // type: string 818 // required: true 819 // description: the name or ID of the container 820 // - in: query 821 // name: signal 822 // type: string 823 // default: TERM 824 // description: signal to be sent to container, either by integer or SIG_ name 825 // produces: 826 // - application/json 827 // responses: 828 // 204: 829 // description: no error 830 // 404: 831 // $ref: "#/responses/NoSuchContainer" 832 // 409: 833 // $ref: "#/responses/ConflictError" 834 // 500: 835 // $ref: "#/responses/InternalError" 836 r.HandleFunc(VersionedPath("/libpod/containers/{name}/kill"), s.APIHandler(compat.KillContainer)).Methods(http.MethodPost) 837 // swagger:operation POST /libpod/containers/{name}/mount libpod libpodMountContainer 838 // --- 839 // tags: 840 // - containers 841 // summary: Mount a container 842 // description: Mount a container to the filesystem 843 // parameters: 844 // - in: path 845 // name: name 846 // type: string 847 // required: true 848 // description: the name or ID of the container 849 // produces: 850 // - application/json 851 // responses: 852 // 200: 853 // description: mounted container 854 // schema: 855 // description: id 856 // type: string 857 // example: /var/lib/containers/storage/overlay/f3f693bd88872a1e3193f4ebb925f4c282e8e73aadb8ab3e7492754dda3a02a4/merged 858 // 404: 859 // $ref: "#/responses/NoSuchContainer" 860 // 500: 861 // $ref: "#/responses/InternalError" 862 r.HandleFunc(VersionedPath("/libpod/containers/{name}/mount"), s.APIHandler(libpod.MountContainer)).Methods(http.MethodPost) 863 // swagger:operation POST /libpod/containers/{name}/unmount libpod libpodUnmountContainer 864 // --- 865 // tags: 866 // - containers 867 // summary: Unmount a container 868 // description: Unmount a container from the filesystem 869 // produces: 870 // - application/json 871 // parameters: 872 // - in: path 873 // name: name 874 // type: string 875 // required: true 876 // description: the name or ID of the container 877 // responses: 878 // 204: 879 // description: ok 880 // 404: 881 // $ref: "#/responses/NoSuchContainer" 882 // 500: 883 // $ref: "#/responses/InternalError" 884 r.HandleFunc(VersionedPath("/libpod/containers/{name}/unmount"), s.APIHandler(libpod.UnmountContainer)).Methods(http.MethodPost) 885 // swagger:operation GET /libpod/containers/{name}/logs libpod libpodLogsFromContainer 886 // --- 887 // tags: 888 // - containers 889 // summary: Get container logs 890 // description: Get stdout and stderr logs from a container. 891 // parameters: 892 // - in: path 893 // name: name 894 // type: string 895 // required: true 896 // description: the name or ID of the container 897 // - in: query 898 // name: follow 899 // type: boolean 900 // description: Keep connection after returning logs. 901 // - in: query 902 // name: stdout 903 // type: boolean 904 // description: Return logs from stdout 905 // - in: query 906 // name: stderr 907 // type: boolean 908 // description: Return logs from stderr 909 // - in: query 910 // name: since 911 // type: string 912 // description: Only return logs since this time, as a UNIX timestamp 913 // - in: query 914 // name: until 915 // type: string 916 // description: Only return logs before this time, as a UNIX timestamp 917 // - in: query 918 // name: timestamps 919 // type: boolean 920 // default: false 921 // description: Add timestamps to every log line 922 // - in: query 923 // name: tail 924 // type: string 925 // description: Only return this number of log lines from the end of the logs 926 // default: all 927 // produces: 928 // - application/json 929 // responses: 930 // 200: 931 // description: logs returned as a stream in response body. 932 // 404: 933 // $ref: "#/responses/NoSuchContainer" 934 // 500: 935 // $ref: "#/responses/InternalError" 936 r.HandleFunc(VersionedPath("/libpod/containers/{name}/logs"), s.APIHandler(compat.LogsFromContainer)).Methods(http.MethodGet) 937 // swagger:operation POST /libpod/containers/{name}/pause libpod libpodPauseContainer 938 // --- 939 // tags: 940 // - containers 941 // summary: Pause a container 942 // description: Use the cgroups freezer to suspend all processes in a container. 943 // parameters: 944 // - in: path 945 // name: name 946 // type: string 947 // required: true 948 // description: the name or ID of the container 949 // produces: 950 // - application/json 951 // responses: 952 // 204: 953 // description: no error 954 // 404: 955 // "$ref": "#/responses/NoSuchContainer" 956 // 500: 957 // "$ref": "#/responses/InternalError" 958 r.HandleFunc(VersionedPath("/libpod/containers/{name:..*}/pause"), s.APIHandler(compat.PauseContainer)).Methods(http.MethodPost) 959 // swagger:operation POST /libpod/containers/{name}/restart libpod libpodRestartContainer 960 // --- 961 // tags: 962 // - containers 963 // summary: Restart a container 964 // parameters: 965 // - in: path 966 // name: name 967 // type: string 968 // required: true 969 // description: the name or ID of the container 970 // - in: query 971 // name: t 972 // type: integer 973 // description: timeout before sending kill signal to container 974 // produces: 975 // - application/json 976 // responses: 977 // 204: 978 // description: no error 979 // 404: 980 // $ref: "#/responses/NoSuchContainer" 981 // 500: 982 // $ref: "#/responses/InternalError" 983 r.HandleFunc(VersionedPath("/libpod/containers/{name}/restart"), s.APIHandler(compat.RestartContainer)).Methods(http.MethodPost) 984 // swagger:operation POST /libpod/containers/{name}/start libpod libpodStartContainer 985 // --- 986 // tags: 987 // - containers 988 // summary: Start a container 989 // parameters: 990 // - in: path 991 // name: name 992 // type: string 993 // required: true 994 // description: the name or ID of the container 995 // - in: query 996 // name: detachKeys 997 // type: string 998 // description: "Override the key sequence for detaching a container. Format is a single character [a-Z] or ctrl-<value> where <value> is one of: a-z, @, ^, [, , or _." 999 // default: ctrl-p,ctrl-q 1000 // produces: 1001 // - application/json 1002 // responses: 1003 // 204: 1004 // description: no error 1005 // 304: 1006 // $ref: "#/responses/ContainerAlreadyStartedError" 1007 // 404: 1008 // $ref: "#/responses/NoSuchContainer" 1009 // 500: 1010 // $ref: "#/responses/InternalError" 1011 r.HandleFunc(VersionedPath("/libpod/containers/{name}/start"), s.APIHandler(compat.StartContainer)).Methods(http.MethodPost) 1012 // swagger:operation GET /libpod/containers/{name}/stats libpod libpodStatsContainer 1013 // --- 1014 // tags: 1015 // - containers 1016 // summary: Get stats for a container 1017 // description: This returns a live stream of a container’s resource usage statistics. 1018 // parameters: 1019 // - in: path 1020 // name: name 1021 // type: string 1022 // required: true 1023 // description: the name or ID of the container 1024 // - in: query 1025 // name: stream 1026 // type: boolean 1027 // default: true 1028 // description: Stream the output 1029 // produces: 1030 // - application/json 1031 // responses: 1032 // 200: 1033 // description: no error 1034 // 404: 1035 // $ref: "#/responses/NoSuchContainer" 1036 // 500: 1037 // $ref: "#/responses/InternalError" 1038 r.HandleFunc(VersionedPath("/libpod/containers/{name}/stats"), s.APIHandler(compat.StatsContainer)).Methods(http.MethodGet) 1039 // swagger:operation GET /libpod/containers/{name}/top libpod libpodTopContainer 1040 // --- 1041 // tags: 1042 // - containers 1043 // summary: List processes 1044 // description: List processes running inside a container 1045 // parameters: 1046 // - in: path 1047 // name: name 1048 // type: string 1049 // required: true 1050 // description: | 1051 // Name of container to query for processes 1052 // (As of version 1.xx) 1053 // - in: query 1054 // name: stream 1055 // type: boolean 1056 // default: true 1057 // description: Stream the output 1058 // - in: query 1059 // name: ps_args 1060 // type: string 1061 // default: -ef 1062 // description: arguments to pass to ps such as aux. Requires ps(1) to be installed in the container if no ps(1) compatible AIX descriptors are used. 1063 // produces: 1064 // - application/json 1065 // responses: 1066 // 200: 1067 // $ref: "#/responses/DocsContainerTopResponse" 1068 // 404: 1069 // $ref: "#/responses/NoSuchContainer" 1070 // 500: 1071 // $ref: "#/responses/InternalError" 1072 r.HandleFunc(VersionedPath("/libpod/containers/{name}/top"), s.APIHandler(compat.TopContainer)).Methods(http.MethodGet) 1073 // swagger:operation POST /libpod/containers/{name}/unpause libpod libpodUnpauseContainer 1074 // --- 1075 // tags: 1076 // - containers 1077 // summary: Unpause Container 1078 // parameters: 1079 // - in: path 1080 // name: name 1081 // type: string 1082 // required: true 1083 // description: the name or ID of the container 1084 // produces: 1085 // - application/json 1086 // responses: 1087 // 204: 1088 // description: no error 1089 // 404: 1090 // $ref: "#/responses/NoSuchContainer" 1091 // 500: 1092 // $ref: "#/responses/InternalError" 1093 r.HandleFunc(VersionedPath("/libpod/containers/{name}/unpause"), s.APIHandler(compat.UnpauseContainer)).Methods(http.MethodPost) 1094 // swagger:operation POST /libpod/containers/{name}/wait libpod libpodWaitContainer 1095 // --- 1096 // tags: 1097 // - containers 1098 // summary: Wait on a container 1099 // description: Wait on a container to met a given condition 1100 // parameters: 1101 // - in: path 1102 // name: name 1103 // type: string 1104 // required: true 1105 // description: the name or ID of the container 1106 // - in: query 1107 // name: condition 1108 // type: string 1109 // description: | 1110 // wait until container is to a given condition. default is stopped. valid conditions are: 1111 // - configured 1112 // - created 1113 // - exited 1114 // - paused 1115 // - running 1116 // - stopped 1117 // produces: 1118 // - application/json 1119 // responses: 1120 // 200: 1121 // $ref: "#/responses/ContainerWaitResponse" 1122 // 404: 1123 // $ref: "#/responses/NoSuchContainer" 1124 // 500: 1125 // $ref: "#/responses/InternalError" 1126 r.HandleFunc(VersionedPath("/libpod/containers/{name}/wait"), s.APIHandler(libpod.WaitContainer)).Methods(http.MethodPost) 1127 // swagger:operation GET /libpod/containers/{name}/exists libpod libpodContainerExists 1128 // --- 1129 // tags: 1130 // - containers 1131 // summary: Check if container exists 1132 // description: Quick way to determine if a container exists by name or ID 1133 // parameters: 1134 // - in: path 1135 // name: name 1136 // type: string 1137 // required: true 1138 // description: the name or ID of the container 1139 // produces: 1140 // - application/json 1141 // responses: 1142 // 204: 1143 // description: container exists 1144 // 404: 1145 // $ref: "#/responses/NoSuchContainer" 1146 // 500: 1147 // $ref: "#/responses/InternalError" 1148 r.HandleFunc(VersionedPath("/libpod/containers/{name}/exists"), s.APIHandler(libpod.ContainerExists)).Methods(http.MethodGet) 1149 // swagger:operation POST /libpod/containers/{name}/stop libpod libpodStopContainer 1150 // --- 1151 // tags: 1152 // - containers 1153 // summary: Stop a container 1154 // parameters: 1155 // - in: path 1156 // name: name 1157 // type: string 1158 // required: true 1159 // description: the name or ID of the container 1160 // - in: query 1161 // name: t 1162 // type: integer 1163 // description: number of seconds to wait before killing container 1164 // produces: 1165 // - application/json 1166 // responses: 1167 // 204: 1168 // description: no error 1169 // 304: 1170 // $ref: "#/responses/ContainerAlreadyStoppedError" 1171 // 404: 1172 // $ref: "#/responses/NoSuchContainer" 1173 // 500: 1174 // $ref: "#/responses/InternalError" 1175 r.HandleFunc(VersionedPath("/libpod/containers/{name}/stop"), s.APIHandler(compat.StopContainer)).Methods(http.MethodPost) 1176 // swagger:operation POST /libpod/containers/{name}/attach libpod libpodAttachContainer 1177 // --- 1178 // tags: 1179 // - containers 1180 // summary: Attach to a container 1181 // description: Hijacks the connection to forward the container's standard streams to the client. 1182 // parameters: 1183 // - in: path 1184 // name: name 1185 // type: string 1186 // required: true 1187 // description: the name or ID of the container 1188 // - in: query 1189 // name: detachKeys 1190 // required: false 1191 // type: string 1192 // description: keys to use for detaching from the container 1193 // - in: query 1194 // name: logs 1195 // required: false 1196 // type: boolean 1197 // description: Stream all logs from the container across the connection. Happens before streaming attach (if requested). At least one of logs or stream must be set 1198 // - in: query 1199 // name: stream 1200 // required: false 1201 // type: boolean 1202 // default: true 1203 // description: Attach to the container. If unset, and logs is set, only the container's logs will be sent. At least one of stream or logs must be set 1204 // - in: query 1205 // name: stdout 1206 // required: false 1207 // type: boolean 1208 // description: Attach to container STDOUT 1209 // - in: query 1210 // name: stderr 1211 // required: false 1212 // type: boolean 1213 // description: Attach to container STDERR 1214 // - in: query 1215 // name: stdin 1216 // required: false 1217 // type: boolean 1218 // description: Attach to container STDIN 1219 // produces: 1220 // - application/json 1221 // responses: 1222 // 101: 1223 // description: No error, connection has been hijacked for transporting streams. 1224 // 400: 1225 // $ref: "#/responses/BadParamError" 1226 // 404: 1227 // $ref: "#/responses/NoSuchContainer" 1228 // 500: 1229 // $ref: "#/responses/InternalError" 1230 r.HandleFunc(VersionedPath("/libpod/containers/{name}/attach"), s.APIHandler(compat.AttachContainer)).Methods(http.MethodPost) 1231 // swagger:operation POST /libpod/containers/{name}/resize libpod libpodResizeContainer 1232 // --- 1233 // tags: 1234 // - containers 1235 // summary: Resize a container's TTY 1236 // description: Resize the terminal attached to a container (for use with Attach). 1237 // parameters: 1238 // - in: path 1239 // name: name 1240 // type: string 1241 // required: true 1242 // description: the name or ID of the container 1243 // - in: query 1244 // name: h 1245 // type: integer 1246 // required: false 1247 // description: Height to set for the terminal, in characters 1248 // - in: query 1249 // name: w 1250 // type: integer 1251 // required: false 1252 // description: Width to set for the terminal, in characters 1253 // produces: 1254 // - application/json 1255 // responses: 1256 // 200: 1257 // $ref: "#/responses/ok" 1258 // 404: 1259 // $ref: "#/responses/NoSuchContainer" 1260 // 500: 1261 // $ref: "#/responses/InternalError" 1262 r.HandleFunc(VersionedPath("/libpod/containers/{name}/resize"), s.APIHandler(compat.ResizeContainer)).Methods(http.MethodPost) 1263 // swagger:operation GET /libpod/containers/{name}/export libpod libpodExportContainer 1264 // --- 1265 // tags: 1266 // - containers 1267 // summary: Export a container 1268 // description: Export the contents of a container as a tarball. 1269 // parameters: 1270 // - in: path 1271 // name: name 1272 // type: string 1273 // required: true 1274 // description: the name or ID of the container 1275 // produces: 1276 // - application/json 1277 // responses: 1278 // 200: 1279 // description: tarball is returned in body 1280 // 404: 1281 // $ref: "#/responses/NoSuchContainer" 1282 // 500: 1283 // $ref: "#/responses/InternalError" 1284 r.HandleFunc(VersionedPath("/libpod/containers/{name}/export"), s.APIHandler(compat.ExportContainer)).Methods(http.MethodGet) 1285 // swagger:operation GET /libpod/containers/{name}/checkout libpod libpodCheckpointContainer 1286 // --- 1287 // tags: 1288 // - containers 1289 // summary: Checkpoint a container 1290 // parameters: 1291 // - in: path 1292 // name: name 1293 // type: string 1294 // required: true 1295 // description: the name or ID of the container 1296 // - in: query 1297 // name: keep 1298 // type: boolean 1299 // description: keep all temporary checkpoint files 1300 // - in: query 1301 // name: leaveRunning 1302 // type: boolean 1303 // description: leave the container running after writing checkpoint to disk 1304 // - in: query 1305 // name: tcpEstablished 1306 // type: boolean 1307 // description: checkpoint a container with established TCP connections 1308 // - in: query 1309 // name: export 1310 // type: boolean 1311 // description: export the checkpoint image to a tar.gz 1312 // - in: query 1313 // name: ignoreRootFS 1314 // type: boolean 1315 // description: do not include root file-system changes when exporting 1316 // produces: 1317 // - application/json 1318 // responses: 1319 // 200: 1320 // description: tarball is returned in body if exported 1321 // 404: 1322 // $ref: "#/responses/NoSuchContainer" 1323 // 500: 1324 // $ref: "#/responses/InternalError" 1325 r.HandleFunc(VersionedPath("/libpod/containers/{name}/checkpoint"), s.APIHandler(libpod.Checkpoint)).Methods(http.MethodPost) 1326 // swagger:operation GET /libpod/containers/{name} restore libpod libpodRestoreContainer 1327 // --- 1328 // tags: 1329 // - containers 1330 // summary: Restore a container 1331 // description: Restore a container from a checkpoint. 1332 // parameters: 1333 // - in: path 1334 // name: name 1335 // type: string 1336 // required: true 1337 // description: the name or id of the container 1338 // - in: query 1339 // name: name 1340 // type: string 1341 // description: the name of the container when restored from a tar. can only be used with import 1342 // - in: query 1343 // name: keep 1344 // type: boolean 1345 // description: keep all temporary checkpoint files 1346 // - in: query 1347 // name: leaveRunning 1348 // type: boolean 1349 // description: leave the container running after writing checkpoint to disk 1350 // - in: query 1351 // name: tcpEstablished 1352 // type: boolean 1353 // description: checkpoint a container with established TCP connections 1354 // - in: query 1355 // name: import 1356 // type: boolean 1357 // description: import the restore from a checkpoint tar.gz 1358 // - in: query 1359 // name: ignoreRootFS 1360 // type: boolean 1361 // description: do not include root file-system changes when exporting 1362 // - in: query 1363 // name: ignoreStaticIP 1364 // type: boolean 1365 // description: ignore IP address if set statically 1366 // - in: query 1367 // name: ignoreStaticMAC 1368 // type: boolean 1369 // description: ignore MAC address if set statically 1370 // produces: 1371 // - application/json 1372 // responses: 1373 // 200: 1374 // description: tarball is returned in body if exported 1375 // 404: 1376 // $ref: "#/responses/NoSuchContainer" 1377 // 500: 1378 // $ref: "#/responses/InternalError" 1379 r.HandleFunc(VersionedPath("/libpod/containers/{name}/restore"), s.APIHandler(libpod.Restore)).Methods(http.MethodPost) 1380 // swagger:operation GET /containers/{name}/changes libpod libpodChangesContainer 1381 // swagger:operation GET /libpod/containers/{name}/changes compat changesContainer 1382 // --- 1383 // tags: 1384 // - containers 1385 // - containers (compat) 1386 // summary: Report on changes to container's filesystem; adds, deletes or modifications. 1387 // description: | 1388 // Returns which files in a container's filesystem have been added, deleted, or modified. The Kind of modification can be one of: 1389 // 1390 // 0: Modified 1391 // 1: Added 1392 // 2: Deleted 1393 // parameters: 1394 // - in: path 1395 // name: name 1396 // type: string 1397 // required: true 1398 // description: the name or id of the container 1399 // responses: 1400 // 200: 1401 // description: Array of Changes 1402 // content: 1403 // application/json: 1404 // schema: 1405 // $ref: "#/responses/Changes" 1406 // 404: 1407 // $ref: "#/responses/NoSuchContainer" 1408 // 500: 1409 // $ref: "#/responses/InternalError" 1410 r.HandleFunc(VersionedPath("/containers/{name}/changes"), s.APIHandler(compat.Changes)) 1411 r.HandleFunc("/containers/{name}/changes", s.APIHandler(compat.Changes)) 1412 r.HandleFunc(VersionedPath("/libpod/containers/{name}/changes"), s.APIHandler(compat.Changes)) 1413 // swagger:operation POST /libpod/containers/{name}/init libpod libpodInitContainer 1414 // --- 1415 // tags: 1416 // - containers 1417 // summary: Initialize a container 1418 // description: Performs all tasks necessary for initializing the container but does not start the container. 1419 // parameters: 1420 // - in: path 1421 // name: name 1422 // type: string 1423 // required: true 1424 // description: the name or ID of the container 1425 // produces: 1426 // - application/json 1427 // responses: 1428 // 204: 1429 // description: no error 1430 // 304: 1431 // description: container already initialized 1432 // 404: 1433 // $ref: "#/responses/NoSuchContainer" 1434 // 500: 1435 // $ref: "#/responses/InternalError" 1436 r.HandleFunc(VersionedPath("/libpod/containers/{name}/init"), s.APIHandler(libpod.InitContainer)).Methods(http.MethodPost) 1437 return nil 1438 }