-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into is6556/api-metadata-wrong-return
- Loading branch information
Showing
38 changed files
with
665 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from typing import Final | ||
|
||
from pydantic import parse_obj_as | ||
|
||
from ..rabbitmq_basic_types import RPCNamespace | ||
|
||
DYNAMIC_SIDECAR_RPC_NAMESPACE: Final[RPCNamespace] = parse_obj_as( | ||
RPCNamespace, "dynamic-sidecar" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
22 changes: 22 additions & 0 deletions
22
...ages/service-library/src/servicelib/rabbitmq/rpc_interfaces/dynamic_sidecar/disk_usage.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import logging | ||
|
||
from models_library.api_schemas_dynamic_sidecar import DYNAMIC_SIDECAR_RPC_NAMESPACE | ||
from models_library.api_schemas_dynamic_sidecar.telemetry import DiskUsage | ||
from models_library.rabbitmq_basic_types import RPCMethodName | ||
from pydantic import parse_obj_as | ||
from servicelib.logging_utils import log_decorator | ||
from servicelib.rabbitmq import RabbitMQRPCClient | ||
|
||
_logger = logging.getLogger(__name__) | ||
|
||
|
||
@log_decorator(_logger, level=logging.DEBUG) | ||
async def update_disk_usage( | ||
rabbitmq_rpc_client: RabbitMQRPCClient, *, usage: dict[str, DiskUsage] | ||
) -> None: | ||
result = await rabbitmq_rpc_client.request( | ||
DYNAMIC_SIDECAR_RPC_NAMESPACE, | ||
parse_obj_as(RPCMethodName, "update_disk_usage"), | ||
usage=usage, | ||
) | ||
assert result is None # nosec |
3 changes: 0 additions & 3 deletions
3
services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/api/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +0,0 @@ | ||
from ._routing import get_main_router | ||
|
||
__all__: tuple[str, ...] = ("get_main_router",) | ||
3 changes: 3 additions & 0 deletions
3
services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/api/rest/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from ._routing import get_main_router | ||
|
||
__all__: tuple[str, ...] = ("get_main_router",) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...mcore_service_dynamic_sidecar/api/disk.py → ..._service_dynamic_sidecar/api/rest/disk.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
12 changes: 12 additions & 0 deletions
12
services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/api/rpc/_disk_usage.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from fastapi import FastAPI | ||
from models_library.api_schemas_dynamic_sidecar.telemetry import DiskUsage | ||
from servicelib.rabbitmq import RPCRouter | ||
|
||
from ...modules.system_monitor import get_disk_usage_monitor | ||
|
||
router = RPCRouter() | ||
|
||
|
||
@router.expose() | ||
async def update_disk_usage(app: FastAPI, *, usage: dict[str, DiskUsage]) -> None: | ||
get_disk_usage_monitor(app).set_disk_usage_for_path(usage) |
Oops, something went wrong.