feat: обновить версию SDK до 2.1.4 и добавить поддержку запроса перезапуска всех узлов

This commit is contained in:
Artem 2025-08-27 00:27:29 +02:00
parent 9d7f1ab0d9
commit f9d9af7f27
6 changed files with 23 additions and 5 deletions

View file

@ -63,7 +63,8 @@ pip install git+https://github.com/remnawave/python-sdk.git@development
| Contract Version | Remnawave Panel Version |
| ---------------- | ----------------------- |
| 2.1.1. | >=2.1.1 |
| 2.1.4 | >=2.1.4 |
| 2.1.1 | >=2.1.1, <2.1.4 |
| 2.0.0 | >=2.0.0,<2.1.0 |
| 1.1.3 | >=1.6.12,<2.0.0 |
| 1.1.2 | >=1.6.3,<=1.6.11 |

View file

@ -1,7 +1,7 @@
[project]
name = "remnawave"
version = "2.1.1"
description = "A Python SDK for interacting with the Remnawave API v2.1.1."
version = "2.1.4"
description = "A Python SDK for interacting with the Remnawave API v2.1.4."
authors = [
{name = "Artem",email = "dev@forestsnet.com"}
]

View file

@ -17,6 +17,7 @@ from remnawave.models import (
RestartNodeResponseDto,
UpdateNodeRequestDto,
UpdateNodeResponseDto,
RestartAllNodesRequestDto,
)
from remnawave.rapid import BaseController, delete, get, patch, post
@ -44,7 +45,7 @@ class NodesController(BaseController):
) -> GetOneNodeResponseDto:
"""Get One Node"""
...
@delete("/nodes/{uuid}", response_class=DeleteNodeResponseDto)
async def delete_node(
self,
@ -52,7 +53,7 @@ class NodesController(BaseController):
) -> DeleteNodeResponseDto:
"""Delete Node"""
...
@patch("/nodes", response_class=UpdateNodeResponseDto)
async def update_node(
self,
@ -88,6 +89,7 @@ class NodesController(BaseController):
@post("/nodes/actions/restart-all", response_class=RestartAllNodesResponseDto)
async def restart_all_nodes(
self,
body: Annotated[RestartAllNodesRequestDto, PydanticBody()],
) -> RestartAllNodesResponseDto:
"""Restart All Nodes"""
...

View file

@ -151,6 +151,7 @@ from .nodes import (
RestartNodeResponseDto,
UpdateNodeRequestDto,
UpdateNodeResponseDto,
RestartAllNodesRequestDto,
)
from .nodes_usage_history import (
GetNodeUserUsageByRangeResponseDto,
@ -256,6 +257,9 @@ __all__ = [
"RestartNodeResponseDto",
"UpdateNodeRequestDto",
"UpdateNodeResponseDto",
"NodeConfigProfileDto",
"NodeConfigProfileRequestDto",
"RestartAllNodesRequestDto",
# Hosts models
"CreateHostRequestDto",
"CreateHostResponseDto",
@ -269,7 +273,11 @@ __all__ = [
"UpdateHostRequestDto",
"UpdateHostResponseDto",
"GetAllHostTagsResponseDto",
"CreateHostInboundData",
"HostInboundData",
"ReorderHostItem",
# Inbounds models
"AllInboundsData",
"FullInboundResponseDto",
"FullInboundStatistic",
"FullInboundsResponseDto",
@ -278,6 +286,7 @@ __all__ = [
"InboundResponseDto",
"InboundsResponseDto", # Legacy alias
"GetInternalSquadAccessibleNodesResponseDto",
"InboundsByProfileData",
# Keygen models
"GetPubKeyResponseDto",
"PubKeyResponseDto", # Legacy alias
@ -405,6 +414,7 @@ __all__ = [
"InboundDto",
"UpdateConfigProfileRequestDto",
"UpdateConfigProfileResponseDto",
"GetAllConfigProfilesResponsePaginated",
# Infra billing models
"CreateInfraBillingNodeRequestDto",
"CreateInfraBillingNodeResponseDto",

View file

@ -13,6 +13,7 @@ class InboundResponseDto(BaseModel):
security: Optional[str] = None
port: Optional[float] = None
raw_inbound: Optional[Any] = Field(None, alias="rawInbound")
active_squads: Optional[list[UUID]] = Field(None, alias="activeSquads")
class AllInboundsData(BaseModel):

View file

@ -192,3 +192,7 @@ class DeleteNodeResponseDto(BaseModel):
def __bool__(self):
return self.is_deleted
class RestartAllNodesRequestDto(BaseModel):
force_restart: bool = Field(default=False, alias="forceRestart")