enconnect.ubiquiti package#

Subpackages#

Submodules#

enconnect.ubiquiti.params module#

Functions and routines associated with Enasis Network Remote Connect.

This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.

pydantic model enconnect.ubiquiti.params.RouterParams[source]#

Bases: BaseModel

Process and validate the class configuration parameters.

Show JSON schema
{
   "title": "RouterParams",
   "description": "Process and validate the class configuration parameters.",
   "type": "object",
   "properties": {
      "server": {
         "description": "Server address for connection",
         "minLength": 1,
         "title": "Server",
         "type": "string"
      },
      "timeout": {
         "default": 30,
         "description": "Timeout connecting to server",
         "maximum": 300,
         "minimum": 1,
         "title": "Timeout",
         "type": "integer"
      },
      "username": {
         "description": "Parameter for the integration",
         "minLength": 1,
         "title": "Username",
         "type": "string"
      },
      "password": {
         "description": "Parameter for the integration",
         "minLength": 1,
         "title": "Password",
         "type": "string"
      },
      "site": {
         "default": "default",
         "description": "Parameter for the integration",
         "minLength": 1,
         "title": "Site",
         "type": "string"
      },
      "ssl_verify": {
         "default": true,
         "description": "Verify the ceritifcate valid",
         "title": "Ssl Verify",
         "type": "boolean"
      },
      "ssl_capem": {
         "anyOf": [
            {
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Verify the ceritifcate valid",
         "title": "Ssl Capem"
      }
   },
   "additionalProperties": false,
   "required": [
      "server",
      "username",
      "password"
   ]
}

Config:
  • extra: str = forbid

Fields:
field password: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])] [Required]#

Parameter for the integration

Constraints:
  • min_length = 1

field server: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Server address for connection', metadata=[MinLen(min_length=1)])] [Required]#

Server address for connection

Constraints:
  • min_length = 1

field site: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='default', description='Parameter for the integration', metadata=[MinLen(min_length=1)])] = 'default'#

Parameter for the integration

Constraints:
  • min_length = 1

field ssl_capem: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Verify the ceritifcate valid', metadata=[MinLen(min_length=1)])] = None#

Verify the ceritifcate valid

Constraints:
  • min_length = 1

field ssl_verify: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=True, description='Verify the ceritifcate valid')] = True#

Verify the ceritifcate valid

field timeout: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=30, description='Timeout connecting to server', metadata=[Ge(ge=1), Le(le=300)])] = 30#

Timeout connecting to server

Constraints:
  • ge = 1

  • le = 300

field username: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])] [Required]#

Parameter for the integration

Constraints:
  • min_length = 1

enconnect.ubiquiti.router module#

Functions and routines associated with Enasis Network Remote Connect.

This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.

class enconnect.ubiquiti.router.Router(params: RouterParams)[source]#

Bases: object

Interact with the local service API with various methods.

Parameters:

params – Parameters used to instantiate the class.

property client: HTTPClient#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property params: RouterParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

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.

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.

Establish new session obtaining cookie for authorization.

Returns:

Response from upstream request to the server.

Module contents#

Functions and routines associated with Enasis Network Remote Connect.

This file is part of Enasis Network software eco-system. Distribution is permitted, for more information consult the project license file.

class enconnect.ubiquiti.Router(params: RouterParams)[source]#

Bases: object

Interact with the local service API with various methods.

Parameters:

params – Parameters used to instantiate the class.

property client: HTTPClient#

Return the value for the attribute from class instance.

Returns:

Value for the attribute from class instance.

property params: RouterParams#

Return the Pydantic model containing the configuration.

Returns:

Pydantic model containing the configuration.

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.

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.

Establish new session obtaining cookie for authorization.

Returns:

Response from upstream request to the server.

pydantic model enconnect.ubiquiti.RouterParams[source]#

Bases: BaseModel

Process and validate the class configuration parameters.

Show JSON schema
{
   "title": "RouterParams",
   "description": "Process and validate the class configuration parameters.",
   "type": "object",
   "properties": {
      "server": {
         "description": "Server address for connection",
         "minLength": 1,
         "title": "Server",
         "type": "string"
      },
      "timeout": {
         "default": 30,
         "description": "Timeout connecting to server",
         "maximum": 300,
         "minimum": 1,
         "title": "Timeout",
         "type": "integer"
      },
      "username": {
         "description": "Parameter for the integration",
         "minLength": 1,
         "title": "Username",
         "type": "string"
      },
      "password": {
         "description": "Parameter for the integration",
         "minLength": 1,
         "title": "Password",
         "type": "string"
      },
      "site": {
         "default": "default",
         "description": "Parameter for the integration",
         "minLength": 1,
         "title": "Site",
         "type": "string"
      },
      "ssl_verify": {
         "default": true,
         "description": "Verify the ceritifcate valid",
         "title": "Ssl Verify",
         "type": "boolean"
      },
      "ssl_capem": {
         "anyOf": [
            {
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Verify the ceritifcate valid",
         "title": "Ssl Capem"
      }
   },
   "additionalProperties": false,
   "required": [
      "server",
      "username",
      "password"
   ]
}

Config:
  • extra: str = forbid

Fields:
field password: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])] [Required]#

Parameter for the integration

Constraints:
  • min_length = 1

field server: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Server address for connection', metadata=[MinLen(min_length=1)])] [Required]#

Server address for connection

Constraints:
  • min_length = 1

field site: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='default', description='Parameter for the integration', metadata=[MinLen(min_length=1)])] = 'default'#

Parameter for the integration

Constraints:
  • min_length = 1

field ssl_capem: Annotated[str | None, FieldInfo(annotation=NoneType, required=False, default=None, description='Verify the ceritifcate valid', metadata=[MinLen(min_length=1)])] = None#

Verify the ceritifcate valid

Constraints:
  • min_length = 1

field ssl_verify: Annotated[bool, FieldInfo(annotation=NoneType, required=False, default=True, description='Verify the ceritifcate valid')] = True#

Verify the ceritifcate valid

field timeout: Annotated[int, FieldInfo(annotation=NoneType, required=False, default=30, description='Timeout connecting to server', metadata=[Ge(ge=1), Le(le=300)])] = 30#

Timeout connecting to server

Constraints:
  • ge = 1

  • le = 300

field username: Annotated[str, FieldInfo(annotation=NoneType, required=True, description='Parameter for the integration', metadata=[MinLen(min_length=1)])] [Required]#

Parameter for the integration

Constraints:
  • min_length = 1