Skip to content

Commit 331b484

Browse files
feat: ✨ add ecos _disk_usage submodule
1 parent 3499347 commit 331b484

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

pyedgeconnect/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,6 +1328,7 @@ def __init__(
13281328
self.logger.addHandler(self.console_handler)
13291329

13301330
# Imported methods
1331+
from .ecos._disk_usage import get_appliance_disk_usage
13311332
from .ecos._dns import get_appliance_dns_config, set_appliance_dns_config
13321333
from .ecos._gms import assign_orchestrator, get_orchestrator
13331334
from .ecos._interfaces import get_appliance_interfaces

pyedgeconnect/ecos/_disk_usage.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# MIT License
2+
# (C) Copyright 2022 Hewlett Packard Enterprise Development LP.
3+
#
4+
# diskUsage : Available disk space
5+
6+
7+
def get_appliance_disk_usage(
8+
self,
9+
) -> dict:
10+
"""Get the disk usage of the appliance
11+
12+
.. list-table::
13+
:header-rows: 1
14+
15+
* - Swagger Section
16+
- Method
17+
- Endpoint
18+
* - diskUsage
19+
- GET
20+
- /diskUsage
21+
22+
:return: Returns dictionary of current appliance disk usage \n
23+
* keyword **<directory name>** (`dict`): Directory disk
24+
utilization, e.g. ``/`` or ``/dev`` etc. \n
25+
* keyword **1k-blocks** (`int`): The number of 1k-blocks
26+
* keyword **used** (`int`): Size of used space, KB
27+
* keyword **available** (`int`): Size of available space, KB
28+
* keyword **usedpercent** (`int`): Percent of used space
29+
* keyword **filesystem** (`str`): Name of the filesystem
30+
:rtype: dict
31+
"""
32+
return self._get("/diskUsage")

0 commit comments

Comments
 (0)