Skip to content

Commit a6677f7

Browse files
author
Andrei Neagu
committed
updated descriptions and docs
1 parent 8a625ae commit a6677f7

File tree

6 files changed

+61
-67
lines changed

6 files changed

+61
-67
lines changed

services/dynamic-sidecar/openapi.json

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@
164164
"tags": [
165165
"containers"
166166
],
167-
"summary": "Starts the containers as defined in ContainerCreate by:\n- cleaning up resources from previous runs if any\n- starting the containers\n\nProgress may be obtained through URL\nProcess may be cancelled through URL",
167+
"summary": "Create Containers",
168+
"description": "Starts the containers as defined in ContainerCreate by:\n- cleaning up resources from previous runs if any\n- starting the containers\n\nProgress may be obtained through URL\nProcess may be cancelled through URL",
168169
"operationId": "create_containers_v1_containers_post",
169170
"requestBody": {
170171
"required": true,
@@ -336,7 +337,8 @@
336337
"tags": [
337338
"containers"
338339
],
339-
"summary": "Enable/disable ports i/o",
340+
"summary": "Toggle Ports Io",
341+
"description": "Enable/disable ports i/o",
340342
"operationId": "toggle_ports_io_v1_containers_ports_io_patch",
341343
"requestBody": {
342344
"content": {
@@ -370,7 +372,8 @@
370372
"tags": [
371373
"containers"
372374
],
373-
"summary": "Creates the output directories declared by the docker images's labels. It is more convenient to pass the labels from director-v2, since it already has all the machinery to call into director-v0 to retrieve them.",
375+
"summary": "Create Output Dirs",
376+
"description": "Creates the output directories declared by the docker images's labels.\nIt is more convenient to pass the labels from director-v2,\nsince it already has all the machinery to call into director-v0\nto retrieve them.",
374377
"operationId": "create_output_dirs_v1_containers_ports_outputs_dirs_post",
375378
"requestBody": {
376379
"content": {
@@ -404,7 +407,8 @@
404407
"tags": [
405408
"containers"
406409
],
407-
"summary": "attach container to a network, if not already attached",
410+
"summary": "Attach Container To Network",
411+
"description": "attach container to a network, if not already attached",
408412
"operationId": "attach_container_to_network_v1_containers__id__networks_attach_post",
409413
"parameters": [
410414
{
@@ -449,7 +453,8 @@
449453
"tags": [
450454
"containers"
451455
],
452-
"summary": "detach container from a network, if not already detached",
456+
"summary": "Detach Container From Network",
457+
"description": "detach container from a network, if not already detached",
453458
"operationId": "detach_container_from_network_v1_containers__id__networks_detach_post",
454459
"parameters": [
455460
{
@@ -494,7 +499,8 @@
494499
"tags": [
495500
"containers"
496501
],
497-
"summary": "Pulls all the docker container images for the user services",
502+
"summary": "Pull Container Images",
503+
"description": "Pulls all the docker container images for the user services",
498504
"operationId": "pull_container_images_v1_containers_images_pull_post",
499505
"responses": {
500506
"202": {
@@ -516,7 +522,8 @@
516522
"tags": [
517523
"containers"
518524
],
519-
"summary": "Remove the previously started containers",
525+
"summary": "Down Containers",
526+
"description": "Remove the previously started containers",
520527
"operationId": "down_containers_v1_containers_down_post",
521528
"responses": {
522529
"202": {
@@ -538,7 +545,8 @@
538545
"tags": [
539546
"containers"
540547
],
541-
"summary": "Restores the state of the dynamic service",
548+
"summary": "Restore Containers State Paths",
549+
"description": "Restores the state of the dynamic service",
542550
"operationId": "restore_containers_state_paths_v1_containers_state_restore_post",
543551
"responses": {
544552
"202": {
@@ -560,7 +568,8 @@
560568
"tags": [
561569
"containers"
562570
],
563-
"summary": "Stores the state of the dynamic service",
571+
"summary": "Save Containers State Paths",
572+
"description": "Stores the state of the dynamic service",
564573
"operationId": "save_containers_state_paths_v1_containers_state_save_post",
565574
"responses": {
566575
"202": {
@@ -582,7 +591,8 @@
582591
"tags": [
583592
"containers"
584593
],
585-
"summary": "Pull input ports data",
594+
"summary": "Pull Container Port Inputs",
595+
"description": "Pull input ports data",
586596
"operationId": "pull_container_port_inputs_v1_containers_ports_inputs_pull_post",
587597
"requestBody": {
588598
"content": {
@@ -634,7 +644,8 @@
634644
"tags": [
635645
"containers"
636646
],
637-
"summary": "Pull output ports data",
647+
"summary": "Pull Container Port Outputs",
648+
"description": "Pull output ports data",
638649
"operationId": "pull_container_port_outputs_v1_containers_ports_outputs_pull_post",
639650
"requestBody": {
640651
"content": {
@@ -686,7 +697,8 @@
686697
"tags": [
687698
"containers"
688699
],
689-
"summary": "Push output ports data",
700+
"summary": "Push Container Port Outputs",
701+
"description": "Push output ports data",
690702
"operationId": "push_container_port_outputs_v1_containers_ports_outputs_push_post",
691703
"responses": {
692704
"202": {
@@ -708,7 +720,8 @@
708720
"tags": [
709721
"containers"
710722
],
711-
"summary": "Restarts previously started user services",
723+
"summary": "Restart Containers",
724+
"description": "Restarts previously started user services",
712725
"operationId": "restart_containers_v1_containers_restart_post",
713726
"responses": {
714727
"202": {
@@ -730,7 +743,8 @@
730743
"tags": [
731744
"volumes"
732745
],
733-
"summary": "Updates the state of the volume",
746+
"summary": "Put Volume State",
747+
"description": "Updates the state of the volume",
734748
"operationId": "put_volume_state_v1_volumes__id__put",
735749
"parameters": [
736750
{
@@ -774,7 +788,8 @@
774788
"tags": [
775789
"disk"
776790
],
777-
"summary": "Frees up reserved disk space",
791+
"summary": "Free Reserved Disk Space",
792+
"description": "Frees up reserved disk space",
778793
"operationId": "free_reserved_disk_space_v1_disk_reserved_free_post",
779794
"responses": {
780795
"204": {

services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/api/rest/containers.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# pylint: disable=too-many-arguments
2-
3-
import logging
41
from typing import Any
52

63
from fastapi import APIRouter, HTTPException
@@ -20,9 +17,6 @@
2017
MissingDockerComposeDownSpecError,
2118
)
2219

23-
_logger = logging.getLogger(__name__)
24-
25-
2620
router = APIRouter()
2721

2822

services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/api/rest/containers_extension.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ class DetachContainerFromNetworkItem(_BaseNetworkItem):
3939

4040
@router.patch(
4141
"/containers/ports/io",
42-
summary="Enable/disable ports i/o",
4342
response_class=Response,
4443
status_code=status.HTTP_204_NO_CONTENT,
4544
)
4645
async def toggle_ports_io(
4746
patch_ports_io_item: PatchPortsIOItem,
4847
app: Annotated[FastAPI, Depends(get_application)],
4948
) -> None:
49+
"""Enable/disable ports i/o"""
5050
await container_extensions.toggle_ports_io(
5151
app,
5252
enable_outputs=patch_ports_io_item.enable_outputs,
@@ -56,27 +56,26 @@ async def toggle_ports_io(
5656

5757
@router.post(
5858
"/containers/ports/outputs/dirs",
59-
summary=(
60-
"Creates the output directories declared by the docker images's labels. "
61-
"It is more convenient to pass the labels from director-v2, "
62-
"since it already has all the machinery to call into director-v0 "
63-
"to retrieve them."
64-
),
6559
response_class=Response,
6660
status_code=status.HTTP_204_NO_CONTENT,
6761
)
6862
async def create_output_dirs(
6963
request_mode: CreateDirsRequestItem,
7064
app: Annotated[FastAPI, Depends(get_application)],
7165
) -> None:
66+
"""
67+
Creates the output directories declared by the docker images's labels.
68+
It is more convenient to pass the labels from director-v2,
69+
since it already has all the machinery to call into director-v0
70+
to retrieve them.
71+
"""
7272
await container_extensions.create_output_dirs(
7373
app, outputs_labels=request_mode.outputs_labels
7474
)
7575

7676

7777
@router.post(
7878
"/containers/{id}/networks:attach",
79-
summary="attach container to a network, if not already attached",
8079
response_class=Response,
8180
status_code=status.HTTP_204_NO_CONTENT,
8281
)
@@ -85,6 +84,7 @@ async def attach_container_to_network(
8584
item: AttachContainerToNetworkItem,
8685
container_id: Annotated[str, PathParam(..., alias="id")],
8786
) -> None:
87+
"""attach container to a network, if not already attached"""
8888
assert request # nosec
8989
await container_extensions.attach_container_to_network(
9090
container_id=container_id,
@@ -95,14 +95,14 @@ async def attach_container_to_network(
9595

9696
@router.post(
9797
"/containers/{id}/networks:detach",
98-
summary="detach container from a network, if not already detached",
9998
response_class=Response,
10099
status_code=status.HTTP_204_NO_CONTENT,
101100
)
102101
async def detach_container_from_network(
103102
item: DetachContainerFromNetworkItem,
104103
container_id: Annotated[str, PathParam(..., alias="id")],
105104
) -> None:
105+
"""detach container from a network, if not already detached"""
106106
await container_extensions.detach_container_from_network(
107107
container_id=container_id,
108108
network_id=item.network_id,

0 commit comments

Comments
 (0)