"Fossies" - the Fresh Open Source Software Archive

Member "zun-4.0.2/api-ref/source/containers.inc" (1 Feb 2021, 24735 Bytes) of package /linux/misc/openstack/zun-4.0.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) fasm source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "containers.inc" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 4.0.1_vs_4.0.2.

    1 .. -*- rst -*-
    2 
    3 ===================
    4  Manage Containers
    5 ===================
    6 
    7 Lists, creates, shows details for, stats, updates, deletes, starts, resizes,
    8 stops, pauses, unpauses, restarts, renames, commits, kills, attaches to containers,
    9 gets archive from container, puts archive to container, and adds security group
   10 for specified container, executes command in a running container, gets logs
   11 of a container, displays the running processes in a container, resizes
   12 the tty session used by the exec, list actions and action detail for a container.
   13 
   14 Create new container
   15 ====================
   16 
   17 .. rest_method:: POST /v1/containers/
   18 
   19 Create new container.
   20 
   21 Response Codes
   22 --------------
   23 
   24 .. rest_status_code:: success status.yaml
   25 
   26    - 202
   27 
   28 .. rest_status_code:: error status.yaml
   29 
   30    - 400
   31    - 401
   32    - 403
   33    - 404
   34 
   35 Request
   36 -------
   37 
   38 .. rest_parameters:: parameters.yaml
   39 
   40   - name: name-request
   41   - image: image
   42   - command: command-request
   43   - cpu: cpu-request
   44   - memory: memory-request
   45   - workdir: workdir-request
   46   - labels: labels-request
   47   - environment: environment-request
   48   - restart_policy: restart_policy-request
   49   - interactive: interactive-request
   50   - tty: tty-request
   51   - image_driver: image_driver-request
   52   - security_groups: security_groups-request
   53   - nets: nets
   54   - runtime: runtime
   55   - hostname: hostname-request
   56   - auto_remove: auto_remove-request
   57   - auto_heal: auto_heal-request
   58   - availability_zone: container_availability_zone
   59   - hints: hints
   60   - mounts: mounts
   61   - privileged: privileged-request
   62   - healthcheck: healthcheck-request
   63   - exposed_ports: exposed_ports
   64 
   65 Request Example
   66 ----------------
   67 
   68 .. literalinclude:: samples/container-create-req.json
   69    :language: javascript
   70 
   71 Response
   72 --------
   73 
   74 .. rest_parameters:: parameters.yaml
   75 
   76   - links: links
   77   - addresses: addresses
   78   - name: name
   79   - image: image
   80   - labels: labels
   81   - image_driver: image_driver
   82   - security_groups: security_groups
   83   - command: command
   84   - cpu: cpu
   85   - memory: memory
   86   - workdir: workdir
   87   - environment: environment
   88   - restart_policy: restart_policy
   89   - interactive: interactive
   90   - tty: tty
   91   - uuid: uuid
   92   - hostname: hostname
   93   - status: status
   94   - status_detail: status_detail
   95   - host: host
   96   - task_state: task_state
   97   - status_reason: status_reason
   98   - ports: ports
   99   - auto_remove: auto_remove
  100   - auto_heal: auto_heal
  101   - privileged: privileged
  102   - healthcheck: healthcheck
  103   - user_id: user_id
  104   - project_id: project_id
  105   - disk: disk
  106   - registry_id: registry_id
  107   - cpu_policy: cpu_policy
  108 
  109 
  110 Response Example
  111 ----------------
  112 
  113 .. literalinclude:: samples/container-create-resp.json
  114    :language: javascript
  115 
  116 List all containers
  117 ===================
  118 
  119 .. rest_method:: GET /v1/containers/
  120 
  121 List all available containers in Zun.
  122 
  123 Response Codes
  124 --------------
  125 
  126 .. rest_status_code:: success status.yaml
  127 
  128    - 200
  129 
  130 .. rest_status_code:: error status.yaml
  131 
  132    - 401
  133    - 403
  134 
  135 Request
  136 -------
  137 
  138 .. rest_parameters:: parameters.yaml
  139 
  140   - name: name_query
  141   - image: image_query
  142   - project_id: project_id_query
  143   - user_id: user_id_query
  144   - memory: memory_query
  145   - host: host_query
  146   - task_state: task_state_query
  147   - status: status_query
  148   - auto_remove: auto_remove_query
  149 
  150 Response
  151 --------
  152 
  153 .. rest_parameters:: parameters.yaml
  154 
  155   - containers: container_list
  156   - links: links
  157   - addresses: addresses
  158   - name: name
  159   - image: image
  160   - labels: labels
  161   - image_driver: image_driver
  162   - security_groups: security_groups
  163   - command: command
  164   - cpu: cpu
  165   - memory: memory
  166   - workdir: workdir
  167   - environment: environment
  168   - restart_policy: restart_policy
  169   - interactive: interactive
  170   - tty: tty
  171   - uuid: uuid
  172   - hostname: hostname
  173   - status: status
  174   - status_detail: status_detail
  175   - host: host
  176   - task_state: task_state
  177   - status_reason: status_reason
  178   - ports: ports
  179   - privileged: privileged
  180   - healthcheck: healthcheck
  181   - user_id: user_id
  182   - project_id: project_id
  183   - disk: disk
  184   - registry_id: registry_id
  185   - cpu_policy: cpu_policy
  186 
  187 Response Example
  188 ----------------
  189 
  190 .. literalinclude:: samples/container-get-all-resp.json
  191    :language: javascript
  192 
  193 Show details of a container
  194 ===========================
  195 
  196 .. rest_method:: GET /v1/containers/{container_ident}
  197 
  198 Get all information of a container in Zun.
  199 
  200 Response Codes
  201 --------------
  202 
  203 .. rest_status_code:: success status.yaml
  204 
  205    - 200
  206 
  207 .. rest_status_code:: error status.yaml
  208 
  209    - 401
  210    - 403
  211    - 404
  212 
  213 Request
  214 -------
  215 
  216 .. rest_parameters:: parameters.yaml
  217 
  218   - container_ident: container_ident
  219 
  220 Response
  221 --------
  222 
  223 .. rest_parameters:: parameters.yaml
  224 
  225   - links: links
  226   - addresses: addresses
  227   - name: name
  228   - image: image
  229   - labels: labels
  230   - image_driver: image_driver
  231   - security_groups: security_groups
  232   - command: command
  233   - cpu: cpu
  234   - memory: memory
  235   - workdir: workdir
  236   - environment: environment
  237   - restart_policy: restart_policy
  238   - interactive: interactive
  239   - tty: tty
  240   - uuid: uuid
  241   - hostname: hostname
  242   - status: status
  243   - status_detail: status_detail
  244   - host: host
  245   - task_state: task_state
  246   - status_reason: status_reason
  247   - ports: ports
  248   - privileged: privileged
  249   - healthcheck: healthcheck
  250   - user_id: user_id
  251   - project_id: project_id
  252   - disk: disk
  253   - registry_id: registry_id
  254   - cpu_policy: cpu_policy
  255 
  256 Response Example
  257 ----------------
  258 
  259 .. literalinclude:: samples/container-show-resp.json
  260    :language: javascript
  261 
  262 Delete a container
  263 ==================
  264 
  265 .. rest_method:: DELETE /v1/containers/{container_ident}
  266 
  267 Delete a container. To delete a container in `Creating` or `Running`
  268 state, request to /v1/containers/{container_ident}?force=True
  269 To stop and delete a container, request to /v1/containers/{container
  270 _ident}?stop=True
  271 
  272 Response Codes
  273 --------------
  274 
  275 .. rest_status_code:: success status.yaml
  276 
  277    - 204
  278 
  279 .. rest_status_code:: error status.yaml
  280 
  281    - 401
  282    - 403
  283    - 404
  284    - 409
  285 
  286 Request
  287 -------
  288 
  289 .. rest_parameters:: parameters.yaml
  290 
  291   - container_ident: container_ident
  292   - force: force
  293   - stop: stop
  294 
  295 Response
  296 --------
  297 
  298 This request does not return anything in the response body.
  299 
  300 .. rest_parameters:: parameters.yaml
  301 
  302   - X-Openstack-Request-Id: request_id
  303 
  304 
  305 Kill a container
  306 ================
  307 
  308 .. rest_method:: POST /v1/containers/{container_ident}/kill
  309 
  310 Kill a running container.
  311 
  312 Response Codes
  313 --------------
  314 
  315 .. rest_status_code:: success status.yaml
  316 
  317    - 202
  318 
  319 .. rest_status_code:: error status.yaml
  320 
  321    - 400
  322    - 401
  323    - 403
  324    - 404
  325    - 409
  326 
  327 Request
  328 -------
  329 
  330 .. rest_parameters:: parameters.yaml
  331 
  332   - container_ident: container_ident
  333   - signal: signal
  334 
  335 Response
  336 --------
  337 
  338 This request does not return anything in the response body.
  339 
  340 .. rest_parameters:: parameters.yaml
  341 
  342   - X-Openstack-Request-Id: request_id
  343 
  344 
  345 Display stats of a container
  346 ============================
  347 
  348 .. rest_method:: GET /v1/containers/{container_ident}/stats
  349 
  350 Display stats of a container.
  351 
  352 Response Codes
  353 --------------
  354 
  355 .. rest_status_code:: success status.yaml
  356 
  357    - 200
  358 
  359 .. rest_status_code:: error status.yaml
  360 
  361    - 401
  362    - 403
  363    - 404
  364    - 409
  365 
  366 Request
  367 -------
  368 
  369 .. rest_parameters:: parameters.yaml
  370 
  371   - container_ident: container_ident
  372 
  373 Response
  374 --------
  375 
  376 .. rest_parameters:: parameters.yaml
  377 
  378   - stats_info: stats_info
  379 
  380 Response Example
  381 ----------------
  382 
  383 .. literalinclude:: samples/container-stats-resp.json
  384    :language: javascript
  385 
  386 
  387 Update information of container
  388 ===============================
  389 
  390 .. rest_method:: PATCH /v1/containers/{container_ident}
  391 
  392 Update information of one container attributes. Currently only `cpu`, name and
  393 `memory` can be updated.
  394 
  395 Response Codes
  396 --------------
  397 
  398 .. rest_status_code:: success status.yaml
  399 
  400    - 200
  401 
  402 .. rest_status_code:: error status.yaml
  403 
  404    - 400
  405    - 401
  406    - 403
  407    - 404
  408 
  409 Request
  410 -------
  411 
  412 .. rest_parameters:: parameters.yaml
  413 
  414   - container_ident: container_ident
  415   - memory: memory
  416   - cpu: cpu
  417   - name: name
  418 
  419 Request Example
  420 ----------------
  421 
  422 .. literalinclude:: samples/container-update-req.json
  423    :language: javascript
  424 
  425 Response
  426 --------
  427 
  428 Return new container with updated attributes.
  429 
  430 .. rest_parameters:: parameters.yaml
  431 
  432   - links: links
  433   - addresses: addresses
  434   - name: name
  435   - image: image
  436   - labels: labels
  437   - image_driver: image_driver
  438   - security_groups: security_groups
  439   - command: command
  440   - cpu: cpu
  441   - memory: memory
  442   - workdir: workdir
  443   - environment: environment
  444   - restart_policy: restart_policy
  445   - interactive: interactive
  446   - tty: tty
  447   - uuid: uuid
  448   - hostname: hostname
  449   - status: status
  450   - status_detail: status_detail
  451   - host: host
  452   - task_state: task_state
  453   - status_reason: status_reason
  454   - ports: ports
  455   - privileged: privileged
  456   - healthcheck: healthcheck
  457   - user_id: user_id
  458   - project_id: project_id
  459   - disk: disk
  460   - registry_id: registry_id
  461   - cpu_policy: cpu_policy
  462 
  463 Response Example
  464 ----------------
  465 
  466 .. literalinclude:: samples/container-update-resp.json
  467    :language: javascript
  468 
  469 Start a container
  470 =================
  471 
  472 .. rest_method:: POST /v1/containers/{container_ident}/start
  473 
  474 Start a container.
  475 
  476 Response Codes
  477 --------------
  478 
  479 .. rest_status_code:: success status.yaml
  480 
  481    - 202
  482 
  483 .. rest_status_code:: error status.yaml
  484 
  485    - 401
  486    - 403
  487    - 404
  488    - 409
  489 
  490 Request
  491 -------
  492 
  493 .. rest_parameters:: parameters.yaml
  494 
  495   - container_ident: container_ident
  496 
  497 Response
  498 --------
  499 
  500 This request does not return anything in the response body.
  501 
  502 .. rest_parameters:: parameters.yaml
  503 
  504   - X-Openstack-Request-Id: request_id
  505 
  506 Stop a container
  507 ================
  508 
  509 .. rest_method:: POST /v1/containers/{container_ident}/stop
  510 
  511 Stop a container.
  512 
  513 Response Codes
  514 --------------
  515 
  516 .. rest_status_code:: success status.yaml
  517 
  518    - 202
  519 
  520 .. rest_status_code:: error status.yaml
  521 
  522    - 401
  523    - 403
  524    - 404
  525    - 409
  526 
  527 Request
  528 -------
  529 
  530 .. rest_parameters:: parameters.yaml
  531 
  532   - container_ident: container_ident
  533   - timeout: timeout
  534 
  535 Response
  536 --------
  537 
  538 This request does not return anything in the response body.
  539 
  540 .. rest_parameters:: parameters.yaml
  541 
  542   - X-Openstack-Request-Id: request_id
  543 
  544 Pause a container
  545 =================
  546 
  547 .. rest_method:: POST /v1/containers/{container_ident}/pause
  548 
  549 Pause a container.
  550 
  551 Response Codes
  552 --------------
  553 
  554 .. rest_status_code:: success status.yaml
  555 
  556    - 202
  557 
  558 .. rest_status_code:: error status.yaml
  559 
  560    - 401
  561    - 403
  562    - 404
  563    - 409
  564 
  565 Request
  566 -------
  567 
  568 .. rest_parameters:: parameters.yaml
  569 
  570   - container_ident: container_ident
  571 
  572 Response
  573 --------
  574 
  575 This request does not return anything in the response body.
  576 
  577 .. rest_parameters:: parameters.yaml
  578 
  579   - X-Openstack-Request-Id: request_id
  580 
  581 Unpause a container
  582 ===================
  583 
  584 .. rest_method:: POST /v1/containers/{container_ident}/unpause
  585 
  586 Unpause a container.
  587 
  588 Response Codes
  589 --------------
  590 
  591 .. rest_status_code:: success status.yaml
  592 
  593    - 202
  594 
  595 .. rest_status_code:: error status.yaml
  596 
  597    - 401
  598    - 403
  599    - 404
  600    - 409
  601 
  602 Request
  603 -------
  604 
  605 .. rest_parameters:: parameters.yaml
  606 
  607   - container_ident: container_ident
  608 
  609 Response
  610 --------
  611 
  612 This request does not return anything in the response body.
  613 
  614 .. rest_parameters:: parameters.yaml
  615 
  616   - X-Openstack-Request-Id: request_id
  617 
  618 Rebuild a container
  619 ===================
  620 
  621 .. rest_method:: POST /v1/containers/{container_ident}/rebuild
  622 
  623 Rebuild a container.
  624 
  625 Response Codes
  626 --------------
  627 
  628 .. rest_status_code:: success status.yaml
  629 
  630    - 202
  631 
  632 .. rest_status_code:: error status.yaml
  633 
  634    - 401
  635    - 403
  636    - 404
  637 
  638 Request
  639 -------
  640 
  641 .. rest_parameters:: parameters.yaml
  642 
  643    - container_ident: container_ident
  644    - image: image
  645    - image_driver: image_driver
  646 
  647 Response
  648 --------
  649 
  650 This request does not return anything in the response body.
  651 
  652 .. rest_parameters:: parameters.yaml
  653 
  654    - X-Openstack-Request-Id: request_id
  655 
  656 
  657 
  658 Restart a container
  659 ===================
  660 
  661 .. rest_method:: POST /v1/containers/{container_ident}/reboot
  662 
  663 Restart a container.
  664 
  665 Response Codes
  666 --------------
  667 
  668 .. rest_status_code:: success status.yaml
  669 
  670    - 202
  671 
  672 .. rest_status_code:: error status.yaml
  673 
  674    - 401
  675    - 403
  676    - 404
  677    - 409
  678 
  679 Request
  680 -------
  681 
  682 .. rest_parameters:: parameters.yaml
  683 
  684   - container_ident: container_ident
  685   - timeout: timeout
  686 
  687 Response
  688 --------
  689 
  690 This request does not return anything in the response body.
  691 
  692 .. rest_parameters:: parameters.yaml
  693 
  694   - X-Openstack-Request-Id: request_id
  695 
  696 
  697 Rename a container
  698 ==================
  699 
  700 .. rest_method:: POST /v1/containers/{container_ident}/rename
  701 
  702 Rename a container.
  703 
  704 Response Codes
  705 --------------
  706 
  707 .. rest_status_code:: success status.yaml
  708 
  709    - 200
  710 
  711 .. rest_status_code:: error status.yaml
  712 
  713    - 401
  714    - 403
  715    - 404
  716    - 409
  717 
  718 Request
  719 -------
  720 
  721 .. rest_parameters:: parameters.yaml
  722 
  723   - container_ident: container_ident
  724   - new_name: new_name
  725 
  726 Response
  727 --------
  728 
  729 .. rest_parameters:: parameters.yaml
  730 
  731   - links: links
  732   - addresses: addresses
  733   - name: name
  734   - image: image
  735   - labels: labels
  736   - image_driver: image_driver
  737   - security_groups: security_groups
  738   - command: command
  739   - cpu: cpu
  740   - memory: memory
  741   - workdir: workdir
  742   - environment: environment
  743   - restart_policy: restart_policy
  744   - interactive: interactive
  745   - tty: tty
  746   - uuid: uuid
  747   - hostname: hostname
  748   - status: status
  749   - status_detail: status_detail
  750   - host: host
  751   - task_state: task_state
  752   - status_reason: status_reason
  753   - ports: ports
  754   - user_id: user_id
  755   - project_id: project_id
  756   - disk: disk
  757   - registry_id: registry_id
  758   - cpu_policy: cpu_policy
  759 
  760 Response Example
  761 ----------------
  762 
  763 .. literalinclude:: samples/container-rename-resp.json
  764    :language: javascript
  765 
  766 
  767 Get archive from  a container
  768 =============================
  769 
  770 .. rest_method:: GET /v1/containers/{container_ident}/get_archive
  771 
  772 Get a tar archive of a resource in the filesystem of a container.
  773 
  774 Response Codes
  775 --------------
  776 
  777 .. rest_status_code:: success status.yaml
  778 
  779    - 200
  780 
  781 .. rest_status_code:: error status.yaml
  782 
  783    - 401
  784    - 403
  785    - 404
  786    - 409
  787 
  788 Request
  789 -------
  790 
  791 .. rest_parameters:: parameters.yaml
  792 
  793   - container_ident: container_ident
  794   - source_path: source_path
  795 
  796 Response
  797 --------
  798 
  799 .. rest_parameters:: parameters.yaml
  800 
  801   - data: data
  802   - stat: stat
  803 
  804 Response Example
  805 ----------------
  806 
  807 .. literalinclude:: samples/container-get-archive-resp.json
  808    :language: javascript
  809 
  810 Put archive to a container
  811 ==========================
  812 
  813 .. rest_method:: POST /v1/containers/{container_ident}/put_archive
  814 
  815 Upload a tar archive to be extracted to a path in the filesystem of container.
  816 
  817 Response Codes
  818 --------------
  819 
  820 .. rest_status_code:: success status.yaml
  821 
  822    - 200
  823 
  824 .. rest_status_code:: error status.yaml
  825 
  826    - 401
  827    - 403
  828    - 404
  829    - 409
  830 
  831 Request
  832 -------
  833 
  834 .. rest_parameters:: parameters.yaml
  835 
  836   - container_ident: container_ident
  837   - destination_path: destination_path
  838   - data: data
  839 
  840 Request Example
  841 ----------------
  842 
  843 .. literalinclude:: samples/container-put-archive-req.json
  844    :language: javascript
  845 
  846 Response
  847 --------
  848 
  849 This request does not return anything in the response body.
  850 
  851 .. rest_parameters:: parameters.yaml
  852 
  853   - X-Openstack-Request-Id: request_id
  854 
  855 
  856 Add security group for specified container
  857 ==========================================
  858 
  859 .. rest_method:: POST /v1/containers/{container_ident}/add_securtiy_group
  860 
  861 Add security group for specified container.
  862 
  863 Response Codes
  864 --------------
  865 
  866 .. rest_status_code:: success status.yaml
  867 
  868    - 202
  869 
  870 .. rest_status_code:: error status.yaml
  871 
  872    - 401
  873    - 403
  874    - 404
  875    - 409
  876 
  877 Request
  878 -------
  879 
  880 .. rest_parameters:: parameters.yaml
  881 
  882   - container_ident: container_ident
  883   - security_group: security_group_query
  884 
  885 Response
  886 --------
  887 
  888 This request does not return anything in the response body.
  889 
  890 .. rest_parameters:: parameters.yaml
  891 
  892   - X-Openstack-Request-Id: request_id
  893 
  894 
  895 Commit a container
  896 ==================
  897 
  898 .. rest_method:: POST /v1/containers/{container_ident}/commit
  899 
  900 Create a new image from a container's changes.
  901 
  902 Response Codes
  903 --------------
  904 
  905 .. rest_status_code:: success status.yaml
  906 
  907    - 202
  908 
  909 .. rest_status_code:: error status.yaml
  910 
  911    - 401
  912    - 403
  913    - 404
  914    - 409
  915 
  916 Request
  917 -------
  918 
  919 .. rest_parameters:: parameters.yaml
  920 
  921   - container_ident: container_ident
  922   - repository: repository
  923   - tag: tag
  924 
  925 Response
  926 --------
  927 
  928 .. rest_parameters:: parameters.yaml
  929 
  930   - image: image
  931 
  932 Response Example
  933 ----------------
  934 
  935 .. literalinclude:: samples/container-commit-resp.json
  936    :language: javascript
  937 
  938 
  939 Attach to a container
  940 =====================
  941 
  942 .. rest_method:: GET /v1/containers/{container_ident}/attach
  943 
  944 Attach to a running container.
  945 
  946 Response Codes
  947 --------------
  948 
  949 .. rest_status_code:: success status.yaml
  950 
  951    - 200
  952 
  953 .. rest_status_code:: error status.yaml
  954 
  955    - 400
  956    - 401
  957    - 403
  958    - 404
  959    - 409
  960 
  961 Request
  962 -------
  963 
  964 .. rest_parameters:: parameters.yaml
  965 
  966   - container_ident: container_ident
  967 
  968 Response
  969 --------
  970 
  971 This request returns websocket url as a response, which is
  972 not in json format.
  973 
  974 
  975 Detach a network from a container
  976 =================================
  977 
  978 .. rest_method:: POST /v1/containers/{container_ident}/network_detach
  979 
  980 Detach a network from a container.
  981 
  982 Response Codes
  983 --------------
  984 
  985 .. rest_status_code:: success status.yaml
  986 
  987    - 202
  988 
  989 .. rest_status_code:: error status.yaml
  990 
  991    - 401
  992    - 403
  993    - 404
  994 
  995 Request
  996 -------
  997 
  998 .. rest_parameters:: parameters.yaml
  999 
 1000    - container_ident: container_ident
 1001    - network: network-query
 1002    - port: port-query
 1003 
 1004 Response
 1005 --------
 1006 
 1007 This request does not return anything in the response body.
 1008 
 1009 .. rest_parameters:: parameters.yaml
 1010 
 1011   - X-Openstack-Request-Id: request_id
 1012 
 1013 
 1014 Resize a container
 1015 ==================
 1016 
 1017 .. rest_method:: POST /v1/containers/{container_ident}/resize
 1018 
 1019 Resize tty to a container
 1020 
 1021 .. warning::
 1022    This API is primarily designed to be used by zunclient or Zun-UI.
 1023    The point of this API is to coordinate between client-side tools and
 1024    Zun to adjust the size of the TTY for the container.
 1025    Unless you are writing client-side tools you **should not** be using
 1026    this API.
 1027 
 1028 Response Codes
 1029 --------------
 1030 
 1031 .. rest_status_code:: success status.yaml
 1032 
 1033    - 200
 1034 
 1035 .. rest_status_code:: error status.yaml
 1036 
 1037    - 401
 1038    - 403
 1039    - 404
 1040    - 409
 1041 
 1042 Request
 1043 -------
 1044 
 1045 .. rest_parameters:: parameters.yaml
 1046 
 1047   - container_ident: container_ident
 1048   - width: width
 1049   - height: height
 1050 
 1051 Response
 1052 --------
 1053 
 1054 This request does not return anything in the response body.
 1055 
 1056 .. rest_parameters:: parameters.yaml
 1057 
 1058   - X-Openstack-Request-Id: request_id
 1059 
 1060 
 1061 Attach a network to a container
 1062 ===============================
 1063 
 1064 .. rest_method:: POST /v1/containers/{container_ident}/network_attach
 1065 
 1066 Attach a network to a container.
 1067 
 1068 Response Codes
 1069 --------------
 1070 
 1071 .. rest_status_code:: success status.yaml
 1072 
 1073    - 202
 1074 
 1075 .. rest_status_code:: error status.yaml
 1076 
 1077    - 401
 1078    - 403
 1079    - 404
 1080 
 1081 Request
 1082 -------
 1083 
 1084 .. rest_parameters:: parameters.yaml
 1085 
 1086    - container_ident: container_ident
 1087    - network: network-query
 1088    - port: port-query
 1089    - fixed_ip: fixed_ip-query
 1090 
 1091 Response
 1092 --------
 1093 
 1094 This request does not return anything in the response body.
 1095 
 1096 .. rest_parameters:: parameters.yaml
 1097 
 1098   - X-Openstack-Request-Id: request_id
 1099 
 1100 
 1101 Execute command in a running container
 1102 ======================================
 1103 
 1104 .. rest_method:: POST /v1/containers/{container_ident}/execute
 1105 
 1106 Execute command in a running container.
 1107 
 1108 Response Codes
 1109 --------------
 1110 
 1111 .. rest_status_code:: success status.yaml
 1112 
 1113    - 200
 1114 
 1115 .. rest_status_code:: error status.yaml
 1116 
 1117    - 400
 1118    - 401
 1119    - 403
 1120    - 404
 1121 
 1122 Request
 1123 -------
 1124 
 1125 .. rest_parameters:: parameters.yaml
 1126 
 1127    - container_ident: container_ident
 1128    - command: exec_command
 1129    - run: exec_run
 1130    - interactive: exec_interactive
 1131 
 1132 Response
 1133 --------
 1134 
 1135 .. rest_parameters:: parameters.yaml
 1136 
 1137   - output: exec_output
 1138   - exit_code: exec_exit_code
 1139   - exec_id: exec_id
 1140   - url: exec_url
 1141 
 1142 .. note::
 1143 
 1144    If the run parameter is set to true, the output will be
 1145    {"output": "...", "exit_code": "...", "exec_id": None, "url": None}.
 1146    Otherwise, the output will be
 1147    {"output": None, "exit_code": None, "exec_id": "...", "url": "..."}.
 1148 
 1149 Response Example
 1150 ----------------
 1151 
 1152 .. literalinclude:: samples/container-execute-resp.json
 1153    :language: javascript
 1154 
 1155 .. literalinclude:: samples/container-execute-resp-2.json
 1156    :language: javascript
 1157 
 1158 
 1159 Resize tty when execute command in a container
 1160 ==============================================
 1161 
 1162 .. rest_method:: POST /v1/containers/{container_ident}/execute_resize
 1163 
 1164 Resize tty when execute command in a container.
 1165 
 1166 Response Codes
 1167 --------------
 1168 
 1169 .. rest_status_code:: success status.yaml
 1170 
 1171    - 200
 1172 
 1173 .. rest_status_code:: error status.yaml
 1174 
 1175    - 400
 1176    - 401
 1177    - 403
 1178    - 404
 1179 
 1180 Request
 1181 -------
 1182 
 1183 .. rest_parameters:: parameters.yaml
 1184 
 1185    - container_ident: container_ident
 1186    - height: height
 1187    - exec_id: exec_resize_id
 1188    - width: width
 1189 
 1190 Response
 1191 --------
 1192 
 1193 .. rest_parameters:: parameters.yaml
 1194 
 1195   - exec_resize_output: exec_resize_output
 1196 
 1197 Response Example
 1198 ----------------
 1199 
 1200 .. literalinclude:: samples/container-execute-resize-resp.json
 1201    :language: javascript
 1202 
 1203 
 1204 Get logs of a container
 1205 =======================
 1206 
 1207 .. rest_method:: GET /v1/containers/{container_ident}/logs
 1208 
 1209 Get logs of a container.
 1210 
 1211 Response Codes
 1212 --------------
 1213 
 1214 .. rest_status_code:: success status.yaml
 1215 
 1216    - 200
 1217 
 1218 .. rest_status_code:: error status.yaml
 1219 
 1220    - 400
 1221    - 401
 1222    - 403
 1223    - 404
 1224 
 1225 Request
 1226 -------
 1227 
 1228 .. rest_parameters:: parameters.yaml
 1229 
 1230    - container_ident: container_ident
 1231    - timestamps: timestamps
 1232    - tail: tail
 1233    - stderr: stderr
 1234    - stdout: stdout
 1235    - since: since
 1236 
 1237 Request Example
 1238 ----------------
 1239 
 1240 .. literalinclude:: samples/container-logs-req.json
 1241    :language: javascript
 1242 
 1243 Response
 1244 --------
 1245 
 1246 This request returns logs string as a response, which is
 1247 not in json format.
 1248 
 1249 
 1250 Display the running processes in a container
 1251 ============================================
 1252 
 1253 .. rest_method:: GET /v1/containers/{container_ident}/top
 1254 
 1255 Display the running processes in a container.
 1256 
 1257 Response Codes
 1258 --------------
 1259 
 1260 .. rest_status_code:: success status.yaml
 1261 
 1262    - 200
 1263 
 1264 .. rest_status_code:: error status.yaml
 1265 
 1266    - 400
 1267    - 401
 1268    - 403
 1269    - 404
 1270 
 1271 Request
 1272 -------
 1273 
 1274 .. rest_parameters:: parameters.yaml
 1275 
 1276    - container_ident: container_ident
 1277    - ps_args: ps_args
 1278 
 1279 Response
 1280 --------
 1281 
 1282 .. rest_parameters:: parameters.yaml
 1283 
 1284   - ps_output: ps_output
 1285 
 1286 Response Example
 1287 ----------------
 1288 
 1289 .. literalinclude:: samples/container-top-resp.json
 1290    :language: javascript
 1291 
 1292 
 1293 List networks on a container
 1294 ============================
 1295 
 1296 .. rest_method:: GET /v1/containers/{container_ident}/network_list
 1297 
 1298 List networks on a container
 1299 
 1300 Response Codes
 1301 --------------
 1302 
 1303 .. rest_status_code:: success status.yaml
 1304 
 1305    - 200
 1306 
 1307 .. rest_status_code:: error status.yaml
 1308 
 1309    - 401
 1310    - 403
 1311    - 404
 1312 
 1313 Request
 1314 -------
 1315 
 1316 .. rest_parameters:: parameters.yaml
 1317 
 1318    - container_ident: container_ident
 1319 
 1320 Response
 1321 --------
 1322 
 1323 .. rest_parameters:: parameters.yaml
 1324 
 1325    - net_id: net_id
 1326    - subnet_id: subnet_id
 1327    - port_id: port_id
 1328    - version: version
 1329    - ip_address: ip_address
 1330    - fixed_ips: fixed_ips
 1331 
 1332 Response Example
 1333 ----------------
 1334 
 1335 .. literalinclude:: samples/container-network-list-resp.json
 1336    :language: javascript
 1337 
 1338 List Actions For Container
 1339 ==========================
 1340 
 1341 .. rest_method:: GET /v1/containers/{container_ident}/container_actions
 1342 
 1343 List actions for a container
 1344 
 1345 Response Codes
 1346 --------------
 1347 
 1348 .. rest_status_code:: success status.yaml
 1349 
 1350     - 200
 1351 
 1352 .. rest_status_code:: error status.yaml
 1353 
 1354     - 401
 1355     - 403
 1356     - 404
 1357 
 1358 Request
 1359 -------
 1360 
 1361 .. rest_parameters:: parameters.yaml
 1362 
 1363     - container_ident: container_ident
 1364 
 1365 Response
 1366 --------
 1367 
 1368 .. rest_parameters:: parameters.yaml
 1369 
 1370     - action: action
 1371     - container_uuid: uuid
 1372     - message: message
 1373     - request_id: request_id_body
 1374     - start_time: start_time
 1375     - project_id: project_id_container_action
 1376     - user_id: user_id
 1377 
 1378 **Example List Actions For Container: JSON response**
 1379 
 1380 .. literalinclude:: samples/container-actions-list-resp.json
 1381     :language: javascript
 1382 
 1383 
 1384 Show Container Action Details
 1385 =============================
 1386 
 1387 .. rest_method:: GET /v1/containers/{container_ident}/container_actions/{request_ident}
 1388 
 1389 Show details for a container action.
 1390 
 1391 Response Codes
 1392 --------------
 1393 
 1394 .. rest_status_code:: success status.yaml
 1395 
 1396     - 200
 1397 
 1398 .. rest_status_code:: error status.yaml
 1399 
 1400     - 401
 1401     - 403
 1402     - 404
 1403 
 1404 Request
 1405 -------
 1406 
 1407 .. rest_parameters:: parameters.yaml
 1408 
 1409     - container_ident: container_ident
 1410     - request_ident: request_ident
 1411 
 1412 Response
 1413 --------
 1414 
 1415 .. rest_parameters:: parameters.yaml
 1416 
 1417     - action: action
 1418     - container_uuid: uuid
 1419     - message: message
 1420     - project_id: project_id_container_action
 1421     - request_id: request_id_body
 1422     - start_time: start_time
 1423     - user_id: user_id
 1424     - events: container_action_events
 1425     - events.event: event
 1426     - events.start_time: event_start_time
 1427     - events.finish_time: event_finish_time
 1428     - events.result: event_result
 1429     - events.traceback: event_traceback
 1430 
 1431 **Example Show Container Action Details: JSON response**
 1432 
 1433 .. literalinclude:: samples/container-action-get-resp.json
 1434     :language: javascript