Skip to content

Commit 84b1b51

Browse files
feat: ✨ add ecos _memory submodule
1 parent 2f87ad6 commit 84b1b51

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

pyedgeconnect/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,6 +1332,7 @@ def __init__(
13321332
from .ecos._interfaces import get_appliance_interfaces
13331333
from .ecos._license import is_reboot_required
13341334
from .ecos._login import login, logout
1335+
from .ecos._memory import get_appliance_memory
13351336
from .ecos._network_interfaces import (
13361337
get_appliance_network_interfaces,
13371338
modify_network_interfaces,

pyedgeconnect/ecos/_memory.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# MIT License
2+
# (C) Copyright 2022 Hewlett Packard Enterprise Development LP.
3+
#
4+
# memory : Get memory related information
5+
6+
7+
def get_appliance_memory(
8+
self,
9+
) -> dict:
10+
"""Get appliance memory related information
11+
12+
.. list-table::
13+
:header-rows: 1
14+
15+
* - Swagger Section
16+
- Method
17+
- Endpoint
18+
* - memory
19+
- GET
20+
- /memory
21+
22+
:return: Returns dictionary of current memory utilization on
23+
appliance, all units in bytes \n
24+
* keyword **total*** (`int`): Total memory
25+
* keyword **free*** (`int`): Free memory
26+
* keyword **buffers*** (`int`): Buffers memory
27+
* keyword **cached*** (`int`): Cached memory
28+
* keyword **used*** (`int`): Used memory
29+
* keyword **swapTotal*** (`int`): Swap total memory
30+
* keyword **swapFree*** (`int`): Swap free memory
31+
* keyword **swapUsed*** (`int`): Swap used memory
32+
:rtype: dict
33+
"""
34+
return self._get("/memory")

0 commit comments

Comments
 (0)