enconnect.ubiquiti package#
Submodules#
enconnect.ubiquiti.params module#
- class enconnect.ubiquiti.params.RouterParams[source]#
Bases:
BaseModelProcess and validate the class configuration parameters.
Fields# Field
Type
Required
Default
Constraints
Yes
min_length=1
Yes
min_length=1
No
'default'min_length=1
No
Nonemin_length=1
No
TrueNo
30ge=1, le=300
Yes
min_length=1
- server: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Server address for connection', metadata=[MinLen(min_length=1)])]#
- timeout: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=30, description='Timeout connecting to server', metadata=[Ge(ge=1), Le(le=300)])]#
- username: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
- password: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
- site: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='default', description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
enconnect.ubiquiti.router module#
- class enconnect.ubiquiti.router.Router(params: RouterParams)[source]#
Bases:
objectInteract with the local service API with various methods.
- Parameters:
params – Parameters used to instantiate the class.
- property params: RouterParams#
Return the Pydantic model containing the configuration.
- Returns:
Pydantic model containing the configuration.
- property client: HTTPClient#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- request_cookie() Response[source]#
Establish new session obtaining cookie for authorization.
- Returns:
Response from upstream request to the server.
- request(method: Literal['delete', 'get', 'post', 'patch', 'put'], path: str, params: dict[str, Any] | None = None, json: dict[str, Any] | None = None, *, timeout: int | None = None) Response[source]#
Return the response for upstream request to the server.
- Parameters:
method – Method for operation with the API server.
path – Path for the location to upstream endpoint.
params – Optional parameters included in request.
json – Optional JSON payload included in request.
timeout – Timeout waiting for the server response. This will override the default client instantiated.
- Returns:
Response from upstream request to the server.
- reqroxy(method: Literal['delete', 'get', 'post', 'patch', 'put'], path: str, params: dict[str, Any] | None = None, json: dict[str, Any] | None = None, *, timeout: int | None = None) Response[source]#
Return the response for upstream request to the server.
Note
Most endpoints on Ubiquiti routers are prefixed with not only the site but also /proxy/network/api. The method will handle concatenating the values for you. It will also handle authenticating if not already.
- Parameters:
method – Method for operation with the API server.
path – Path for the location to upstream endpoint.
params – Optional parameters included in request.
json – Optional JSON payload included in request.
timeout – Timeout waiting for the server response. This will override the default client instantiated.
- Returns:
Response from upstream request to the server.
Module contents#
- class enconnect.ubiquiti.Router(params: RouterParams)[source]#
Bases:
objectInteract with the local service API with various methods.
- Parameters:
params – Parameters used to instantiate the class.
- property params: RouterParams#
Return the Pydantic model containing the configuration.
- Returns:
Pydantic model containing the configuration.
- property client: HTTPClient#
Return the value for the attribute from class instance.
- Returns:
Value for the attribute from class instance.
- request_cookie() Response[source]#
Establish new session obtaining cookie for authorization.
- Returns:
Response from upstream request to the server.
- request(method: Literal['delete', 'get', 'post', 'patch', 'put'], path: str, params: dict[str, Any] | None = None, json: dict[str, Any] | None = None, *, timeout: int | None = None) Response[source]#
Return the response for upstream request to the server.
- Parameters:
method – Method for operation with the API server.
path – Path for the location to upstream endpoint.
params – Optional parameters included in request.
json – Optional JSON payload included in request.
timeout – Timeout waiting for the server response. This will override the default client instantiated.
- Returns:
Response from upstream request to the server.
- reqroxy(method: Literal['delete', 'get', 'post', 'patch', 'put'], path: str, params: dict[str, Any] | None = None, json: dict[str, Any] | None = None, *, timeout: int | None = None) Response[source]#
Return the response for upstream request to the server.
Note
Most endpoints on Ubiquiti routers are prefixed with not only the site but also /proxy/network/api. The method will handle concatenating the values for you. It will also handle authenticating if not already.
- Parameters:
method – Method for operation with the API server.
path – Path for the location to upstream endpoint.
params – Optional parameters included in request.
json – Optional JSON payload included in request.
timeout – Timeout waiting for the server response. This will override the default client instantiated.
- Returns:
Response from upstream request to the server.
- class enconnect.ubiquiti.RouterParams[source]#
Bases:
BaseModelProcess and validate the class configuration parameters.
Fields# Field
Type
Required
Default
Constraints
Yes
min_length=1
Yes
min_length=1
No
'default'min_length=1
No
Nonemin_length=1
No
TrueNo
30ge=1, le=300
Yes
min_length=1
- server: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Server address for connection', metadata=[MinLen(min_length=1)])]#
- timeout: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=30, description='Timeout connecting to server', metadata=[Ge(ge=1), Le(le=300)])]#
- username: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
- password: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#
- site: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='default', description='Parameter for the integration', metadata=[MinLen(min_length=1)])]#