Skip to content

Commit cd024a7

Browse files
authored
Merge pull request #1 from remnawave/development
Updated to be fully compatible with Remnawave API v2.1.1 with new endpoints, extended host functionality and simplified validations.
2 parents 9a3dff1 + 94a1368 commit cd024a7

File tree

15 files changed

+201
-250
lines changed

15 files changed

+201
-250
lines changed

MIGRATION_V2.md

Lines changed: 0 additions & 197 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ pip install git+https://github.com/remnawave/python-sdk.git@development
6363

6464
| Contract Version | Remnawave Panel Version |
6565
| ---------------- | ----------------------- |
66-
| 2.0.0 | >=2.0.0 |
66+
| 2.1.1. | >=2.1.1 |
67+
| 2.0.0 | >=2.0.0,<2.1.0 |
6768
| 1.1.3 | >=1.6.12,<2.0.0 |
6869
| 1.1.2 | >=1.6.3,<=1.6.11 |
6970
| 1.1.1 | 1.6.1, 1.6.2 |

debug_hosts.py

Whitespace-only changes.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "remnawave"
3-
version = "2.0.0"
4-
description = "A Python SDK for interacting with the Remnawave API v2.0.0."
3+
version = "2.1.1"
4+
description = "A Python SDK for interacting with the Remnawave API v2.1.1."
55
authors = [
66
{name = "Artem",email = "dev@forestsnet.com"}
77
]

remnawave/controllers/hosts.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
ReorderHostResponseDto,
1414
UpdateHostRequestDto,
1515
UpdateHostResponseDto,
16+
GetAllHostTagsResponseDto,
1617
)
1718
from remnawave.rapid import AttributeBody, BaseController, delete, get, post, patch
1819

@@ -40,7 +41,14 @@ async def get_all_hosts(
4041
) -> GetAllHostsResponseDto:
4142
"""Get All Hosts"""
4243
...
43-
44+
45+
@get("/hosts/tags", response_class=GetAllHostTagsResponseDto)
46+
async def get_hosts_tags(
47+
self,
48+
) -> GetAllHostTagsResponseDto:
49+
"""Get Hosts Tags"""
50+
...
51+
4452
@delete("/hosts/{uuid}", response_class=DeleteHostResponseDto)
4553
async def delete_host(
4654
self,

remnawave/controllers/internal_squads.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
GetInternalSquadByUuidResponseDto,
1616
UpdateInternalSquadRequestDto,
1717
UpdateInternalSquadResponseDto,
18+
GetInternalSquadAccessibleNodesResponseDto,
1819
)
1920
from remnawave.rapid import BaseController, delete, get, patch, post
2021

@@ -57,18 +58,35 @@ async def delete_internal_squad(
5758
"""Delete internal squad"""
5859
...
5960

60-
@post("/internal-squads/{uuid}/bulk-actions/add-users", response_class=AddUsersToInternalSquadResponseDto)
61+
@post(
62+
"/internal-squads/{uuid}/bulk-actions/add-users",
63+
response_class=AddUsersToInternalSquadResponseDto,
64+
)
6165
async def add_users_to_internal_squad(
6266
self,
6367
uuid: Annotated[str, Path(description="UUID of the internal squad")],
6468
) -> AddUsersToInternalSquadResponseDto:
6569
"""Add users to internal squad"""
6670
...
6771

68-
@delete("/internal-squads/{uuid}/bulk-actions/remove-users", response_class=DeleteUsersFromInternalSquadResponseDto)
72+
@delete(
73+
"/internal-squads/{uuid}/bulk-actions/remove-users",
74+
response_class=DeleteUsersFromInternalSquadResponseDto,
75+
)
6976
async def remove_users_from_internal_squad(
7077
self,
7178
uuid: Annotated[str, Path(description="UUID of the internal squad")],
7279
) -> DeleteUsersFromInternalSquadResponseDto:
7380
"""Delete users from internal squad"""
7481
...
82+
83+
@get(
84+
"/internal-squads/{uuid}/accessible-nodes",
85+
response_class=GetInternalSquadAccessibleNodesResponseDto,
86+
)
87+
async def get_accessible_nodes(
88+
self,
89+
uuid: Annotated[str, Path(description="UUID of the internal squad")],
90+
) -> GetInternalSquadAccessibleNodesResponseDto:
91+
"""Get accessible nodes for internal squad"""
92+
...

remnawave/controllers/system.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
GetBandwidthStatsResponseDto,
33
GetNodesStatisticsResponseDto,
44
GetStatsResponseDto,
5+
GetNodesMetricsResponseDto,
6+
GetRemnawaveHealthResponseDto,
57
)
68
from remnawave.rapid import BaseController, get
79

@@ -27,3 +29,17 @@ async def get_nodes_statistics(
2729
) -> GetNodesStatisticsResponseDto:
2830
"""Get Nodes Statistics"""
2931
...
32+
33+
@get("/system/health", response_class=GetRemnawaveHealthResponseDto)
34+
async def get_health(
35+
self,
36+
) -> GetRemnawaveHealthResponseDto:
37+
"""Get System Health"""
38+
...
39+
40+
@get("/system/nodes/metrics", response_class=GetNodesMetricsResponseDto)
41+
async def get_nodes_metrics(
42+
self,
43+
) -> GetNodesMetricsResponseDto:
44+
"""Get Nodes Metrics"""
45+
...

0 commit comments

Comments
 (0)