Skip to content

Commit f075a37

Browse files
authored
Merge pull request #43 from remnawave:development
Update routes and add profile support for modifications
2 parents 36fa00b + 32d99f3 commit f075a37

35 files changed

+572
-68
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ pip install git+https://github.com/remnawave/python-sdk.git@development
5050

5151
| Contract Version | Remnawave Panel Version |
5252
| ---------------- | ----------------------- |
53+
| 2.6.1 | >=2.6.0 |
5354
| 2.4.4 | >=2.4.0 |
5455
| 2.3.2 | >=2.3.0, <2.4.0 |
5556
| 2.3.0 | >=2.3.0, <2.3.2 |

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.4.4"
4-
description = "A Python SDK for interacting with the Remnawave API v2.4.4."
3+
version = "2.6.1"
4+
description = "A Python SDK for interacting with the Remnawave API v2.6.1."
55
authors = [
66
{name = "Artem",email = "dev@forestsnet.com"}
77
]

remnawave/controllers/bandwidthstats.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
class BandWidthStatsController(BaseController):
2121
# ============ Legacy Endpoints (Deprecated) ============
2222

23-
@get("/bandwidth-stats/users/{user_uuid}/legacy-old", response_class=GetUserUsageByRangeResponseDto)
23+
@get("/bandwidth-stats/users/{userUuid}/legacy", response_class=GetUserUsageByRangeResponseDto)
2424
async def get_user_usage_legacy_old(
2525
self,
2626
user_uuid: Annotated[str, Path(description="UUID of the user", alias="userUuid")],
@@ -30,7 +30,7 @@ async def get_user_usage_legacy_old(
3030
"""Get User Usage by Range (Legacy - Deprecated)"""
3131
...
3232

33-
@get("/bandwidth-stats/nodes/{node_uuid}/users/legacy-old", response_class=GetNodeUserUsageByRangeResponseDto)
33+
@get("/bandwidth-stats/nodes/{nodeUuid}/users/legacy", response_class=GetNodeUserUsageByRangeResponseDto)
3434
async def get_node_user_usage_legacy_old(
3535
self,
3636
node_uuid: Annotated[str, Path(description="UUID of the node", alias="nodeUuid")],

remnawave/controllers/config_profiles.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
GetAllInboundsResponseDto,
1212
GetConfigProfileByUuidResponseDto,
1313
GetInboundsByProfileUuidResponseDto,
14+
ReorderConfigProfilesRequestDto,
15+
ReorderConfigProfilesResponseDto,
1416
UpdateConfigProfileRequestDto,
1517
UpdateConfigProfileResponseDto,
1618
)
@@ -68,6 +70,14 @@ async def delete_config_profile_by_uuid(
6870
"""Delete config profile"""
6971
...
7072

73+
@post("/config-profiles/actions/reorder", response_class=ReorderConfigProfilesResponseDto)
74+
async def reorder_config_profiles(
75+
self,
76+
body: Annotated[ReorderConfigProfilesRequestDto, PydanticBody()],
77+
) -> ReorderConfigProfilesResponseDto:
78+
"""Reorder config profiles"""
79+
...
80+
7181
# Get computed config profile by uuid​
7282
@get("/config-profiles/{uuid}/computed-config", response_class=GetConfigProfileByUuidResponseDto)
7383
async def get_computed_config_profile_by_uuid(

remnawave/controllers/external_squads.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
GetExternalSquadByUuidResponseDto,
1111
GetExternalSquadsResponseDto,
1212
RemoveUsersFromExternalSquadResponseDto,
13+
ReorderExternalSquadsRequestDto,
14+
ReorderExternalSquadsResponseDto,
1315
UpdateExternalSquadRequestDto,
1416
UpdateExternalSquadResponseDto,
1517
)
@@ -70,4 +72,11 @@ async def remove_users_from_external_squad(
7072
uuid: str,
7173
) -> RemoveUsersFromExternalSquadResponseDto:
7274
"""Delete users from external squad"""
75+
...
76+
@post("/external-squads/actions/reorder", response_class=ReorderExternalSquadsResponseDto)
77+
async def reorder_external_squads(
78+
self,
79+
body: Annotated[ReorderExternalSquadsRequestDto, PydanticBody()],
80+
) -> ReorderExternalSquadsResponseDto:
81+
"""Reorder external squads"""
7382
...

remnawave/controllers/internal_squads.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
DeleteUsersFromInternalSquadResponseDto,
1414
GetAllInternalSquadsResponseDto,
1515
GetInternalSquadByUuidResponseDto,
16+
ReorderInternalSquadsRequestDto,
17+
ReorderInternalSquadsResponseDto,
1618
UpdateInternalSquadRequestDto,
1719
UpdateInternalSquadResponseDto,
1820
GetInternalSquadAccessibleNodesResponseDto,
@@ -90,3 +92,11 @@ async def get_accessible_nodes(
9092
) -> GetInternalSquadAccessibleNodesResponseDto:
9193
"""Get accessible nodes for internal squad"""
9294
...
95+
96+
@post("/internal-squads/actions/reorder", response_class=ReorderInternalSquadsResponseDto)
97+
async def reorder_internal_squads(
98+
self,
99+
body: Annotated[ReorderInternalSquadsRequestDto, PydanticBody()],
100+
) -> ReorderInternalSquadsResponseDto:
101+
"""Reorder internal squads"""
102+
...

remnawave/controllers/nodes.py

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,33 @@
1010
DisableNodeResponseDto,
1111
EnableNodeResponseDto,
1212
GetAllNodesResponseDto,
13+
GetAllNodesTagsResponseDto,
1314
GetOneNodeResponseDto,
1415
ReorderNodeRequestDto,
1516
ReorderNodeResponseDto,
1617
RestartAllNodesResponseDto,
1718
RestartNodeResponseDto,
1819
UpdateNodeRequestDto,
1920
UpdateNodeResponseDto,
20-
RestartAllNodesRequestBodyDto,
21+
RestartAllNodesRequestBodyDto,
2122
ResetNodeTrafficRequestDto,
22-
ResetNodeTrafficResponseDto
23+
ResetNodeTrafficResponseDto,
24+
ProfileModificationRequestDto,
25+
ProfileModificationResponseDto,
26+
NodesBulkActionsRequestDto,
27+
NodesBulkActionsResponseDto,
2328
)
2429
from remnawave.rapid import BaseController, delete, get, patch, post
2530

2631

2732
class NodesController(BaseController):
33+
@get("/nodes/tags", response_class=GetAllNodesTagsResponseDto)
34+
async def get_all_nodes_tags(
35+
self,
36+
) -> GetAllNodesTagsResponseDto:
37+
"""Get all nodes tags"""
38+
...
39+
2840
@post("/nodes", response_class=CreateNodeResponseDto)
2941
async def create_node(
3042
self,
@@ -103,11 +115,35 @@ async def reorder_nodes(
103115
) -> ReorderNodeResponseDto:
104116
"""Reorder Nodes"""
105117
...
118+
119+
@post("/nodes/{uuid}/actions/reset-traffic", response_class=ResetNodeTrafficResponseDto)
120+
async def reset_node_traffic(
121+
self,
122+
uuid: Annotated[str, Path(description="UUID of the node")],
123+
) -> ResetNodeTrafficResponseDto:
124+
"""Reset traffic for individual node"""
125+
...
106126

107127
@post("/nodes/actions/reset-traffic", response_class=ResetNodeTrafficResponseDto)
108128
async def reset_traffic_all_nodes(
109129
self,
110130
body: Annotated[ResetNodeTrafficRequestDto, PydanticBody()],
111131
) -> ResetNodeTrafficResponseDto:
112132
"""Reset Traffic All Nodes"""
133+
...
134+
135+
@post("/nodes/bulk-actions/profile-modification", response_class=ProfileModificationResponseDto)
136+
async def profile_modification(
137+
self,
138+
body: Annotated[ProfileModificationRequestDto, PydanticBody()],
139+
) -> ProfileModificationResponseDto:
140+
"""Modify Inbounds & Profile for many nodes"""
141+
...
142+
143+
@post("/nodes/bulk-actions", response_class=NodesBulkActionsResponseDto)
144+
async def nodes_bulk_actions(
145+
self,
146+
body: Annotated[NodesBulkActionsRequestDto, PydanticBody()],
147+
) -> NodesBulkActionsResponseDto:
148+
"""Perform actions for many nodes (ENABLE, DISABLE, RESTART, RESET_TRAFFIC)"""
113149
...

remnawave/controllers/passkeys.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
DeletePasskeyResponseDto,
88
GetAllPasskeysResponseDto,
99
GetPasskeyRegistrationOptionsResponseDto,
10+
UpdatePasskeyRequestDto,
11+
UpdatePasskeyResponseDto,
1012
VerifyPasskeyRegistrationRequestDto,
1113
VerifyPasskeyRegistrationResponseDto,
1214
)
13-
from remnawave.rapid import BaseController, delete, get, post
15+
from remnawave.rapid import BaseController, delete, get, patch, post
1416

1517

1618
class PasskeysController(BaseController):
@@ -42,4 +44,12 @@ async def delete_passkey(
4244
body: Annotated[DeletePasskeyRequestDto, PydanticBody()],
4345
) -> DeletePasskeyResponseDto:
4446
"""Delete a passkey by ID"""
47+
...
48+
49+
@patch("/passkeys", response_class=UpdatePasskeyResponseDto)
50+
async def update_passkey(
51+
self,
52+
body: Annotated[UpdatePasskeyRequestDto, PydanticBody()],
53+
) -> UpdatePasskeyResponseDto:
54+
"""Update a passkey name"""
4555
...

remnawave/controllers/subscriptions_controller.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
from typing import Annotated
22

33
from rapid_api_client import Path, Query
4+
from rapid_api_client.annotations import PydanticBody
45

56
from remnawave.enums import ClientType
67
from remnawave.models.subscription import GetRawSubscriptionByShortUuidResponseDto
78
from remnawave.rapid import BaseController, get
8-
from remnawave.models import GetAllSubscriptionsResponseDto, GetSubscriptionByUsernameResponseDto, GetSubscriptionByShortUUIDResponseDto, GetSubscriptionByUUIDResponseDto
9+
from remnawave.models import (
10+
GetAllSubscriptionsResponseDto,
11+
GetSubscriptionByUsernameResponseDto,
12+
GetSubscriptionByShortUUIDResponseDto,
13+
GetSubscriptionByUUIDResponseDto,
14+
GetSubpageConfigByShortUuidRequestBodyDto,
15+
GetSubpageConfigByShortUuidResponseDto,
16+
)
917

1018

1119
class SubscriptionsController(BaseController):
@@ -47,6 +55,15 @@ async def get_subscription_by_uuid(
4755
"""None"""
4856
...
4957

58+
@get("/subscriptions/subpage-config/{short_uuid}", response_class=GetSubpageConfigByShortUuidResponseDto)
59+
async def get_subpage_config(
60+
self,
61+
short_uuid: Annotated[str, Path(description="Short UUID of the subscription")],
62+
body: Annotated[GetSubpageConfigByShortUuidRequestBodyDto, PydanticBody()],
63+
) -> GetSubpageConfigByShortUuidResponseDto:
64+
"""Get subscription page config by short UUID"""
65+
...
66+
5067
@get("/subscriptions/by-short-uuid/{short_uuid}/raw", response_class=GetRawSubscriptionByShortUuidResponseDto)
5168
async def get_raw_subscription(
5269
self,

remnawave/controllers/subscriptions_template.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
DeleteSubscriptionTemplateResponseDto,
1010
GetTemplateResponseDto,
1111
GetTemplatesResponseDto,
12+
ReorderSubscriptionTemplatesRequestDto,
13+
ReorderSubscriptionTemplatesResponseDto,
1214
UpdateTemplateRequestDto,
1315
UpdateTemplateResponseDto,
1416
)
@@ -51,4 +53,11 @@ async def delete_template(
5153
uuid: Annotated[str, Path(description="Template UUID")],
5254
) -> DeleteSubscriptionTemplateResponseDto:
5355
"""Delete subscription template"""
56+
...
57+
@post("/subscription-templates/actions/reorder", response_class=ReorderSubscriptionTemplatesResponseDto)
58+
async def reorder_templates(
59+
self,
60+
body: Annotated[ReorderSubscriptionTemplatesRequestDto, PydanticBody()],
61+
) -> ReorderSubscriptionTemplatesResponseDto:
62+
"""Reorder subscription templates"""
5463
...

0 commit comments

Comments
 (0)