Skip to content

User - OLT/ONU

Base URL: https://your-domain.com

Admin endpoints for managing OLT devices and ONU information. All endpoints require admin/staff authentication.


Fetch All OLTs

Retrieve all OLT devices configured in the system.

PropertyValue
EndpointFetch All OLTs
MethodGET
URL/api/v1/olts
AuthenticationBearer Token

Request Headers:

HeaderValueRequired
Acceptapplication/jsonYes
AuthorizationBearer your-auth-tokenYes

Request Body: None

Success Response (200 OK):

json
{
    "success": true,
    "data": [
        {
            "id": 1,
            "name": "OLT-Main",
            "ip_address": "192.168.1.1",
            "type": "huawei",
            "status": "online",
            "onu_count": 150,
            "last_sync": "2024-01-15 10:30:00"
        }
    ]
}

Error Response (401 Unauthorized):

json
{
    "success": false,
    "message": "Unauthenticated"
}

Get OLT By Id

Retrieve details of a specific OLT device.

PropertyValue
EndpointGet OLT By Id
MethodGET
URL/api/v1/olts/{id}
AuthenticationBearer Token

Path Parameters:

ParameterTypeRequiredDescription
idintegerYesOLT ID

Success Response (200 OK):

json
{
    "success": true,
    "data": {
        "id": 1,
        "name": "OLT-Main",
        "ip_address": "192.168.1.1",
        "port": 23,
        "username": "admin",
        "type": "huawei",
        "status": "online",
        "onu_count": 150,
        "created_at": "2024-01-01 00:00:00"
    }
}

Error Response (404 Not Found):

json
{
    "success": false,
    "message": "OLT not found"
}

Test OLT Connection

Test connectivity to an OLT device.

PropertyValue
EndpointTest OLT Connection
MethodPOST
URL/api/v1/olts/{id}/test-connection
AuthenticationBearer Token

Path Parameters:

ParameterTypeRequiredDescription
idintegerYesOLT ID

Request Body: None

Success Response (200 OK):

json
{
    "success": true,
    "message": "Connection successful",
    "data": {
        "latency_ms": 25,
        "status": "online"
    }
}

Error Response (500 Server Error):

json
{
    "success": false,
    "message": "Connection failed: Timeout"
}

Discover ONUs On OLT

Discover and sync ONUs connected to an OLT.

PropertyValue
EndpointDiscover ONUs
MethodPOST
URL/api/v1/olts/{id}/discover-onus
AuthenticationBearer Token

Path Parameters:

ParameterTypeRequiredDescription
idintegerYesOLT ID

Success Response (200 OK):

json
{
    "success": true,
    "message": "Discovery completed",
    "data": {
        "total_onus": 150,
        "new_onus": 5,
        "updated_onus": 145
    }
}

Fetch All ONUs

Retrieve all ONUs with optional pagination.

PropertyValue
EndpointFetch All ONUs
MethodGET
URL/api/v1/onus
AuthenticationBearer Token

Query Parameters:

ParameterTypeRequiredDescription
per_pageintegerNoResults per page (default: 50)
olt_idintegerNoFilter by OLT
statusstringNoFilter by status (online, offline, critical)

Success Response (200 OK):

json
{
    "success": true,
    "data": {
        "onus": [
            {
                "id": 1,
                "serial_number": "HWTC12345678",
                "olt_id": 1,
                "subscriber_id": 1,
                "subscriber_name": "John Doe",
                "rx_power": -18.5,
                "tx_power": 2.1,
                "status": "online",
                "last_seen": "2024-01-15 10:30:00"
            }
        ],
        "total": 150
    }
}

Fetch Critical ONUs

Retrieve ONUs with critical signal levels or issues.

PropertyValue
EndpointFetch Critical ONUs
MethodGET
URL/api/v1/onus/critical
AuthenticationBearer Token

Success Response (200 OK):

json
{
    "success": true,
    "data": [
        {
            "id": 5,
            "serial_number": "HWTC87654321",
            "subscriber_name": "Jane Doe",
            "rx_power": -28.5,
            "issue": "Low RX Power",
            "status": "critical"
        }
    ]
}

Get ONU By Id

Retrieve details of a specific ONU.

PropertyValue
EndpointGet ONU By Id
MethodGET
URL/api/v1/onus/{id}
AuthenticationBearer Token

Path Parameters:

ParameterTypeRequiredDescription
idintegerYesONU ID

Success Response (200 OK):

json
{
    "success": true,
    "data": {
        "id": 1,
        "serial_number": "HWTC12345678",
        "olt_id": 1,
        "olt_name": "OLT-Main",
        "subscriber_id": 1,
        "subscriber_name": "John Doe",
        "rx_power": -18.5,
        "tx_power": 2.1,
        "temperature": 45,
        "voltage": 3.3,
        "status": "online",
        "uptime": "15 days",
        "last_seen": "2024-01-15 10:30:00"
    }
}

Get ONU Signal History

Retrieve signal history for an ONU over a specified time period.

PropertyValue
EndpointGet ONU Signal History
MethodGET
URL/api/v1/onus/{id}/signal-history
AuthenticationBearer Token

Path Parameters:

ParameterTypeRequiredDescription
idintegerYesONU ID

Query Parameters:

ParameterTypeRequiredDescription
hoursintegerNoHours of history (default: 24)

Success Response (200 OK):

json
{
    "success": true,
    "data": [
        {
            "timestamp": "2024-01-15 10:00:00",
            "rx_power": -18.5,
            "tx_power": 2.1
        },
        {
            "timestamp": "2024-01-15 09:00:00",
            "rx_power": -18.3,
            "tx_power": 2.0
        }
    ]
}

Refresh ONU Metrics

Refresh metrics for a single ONU.

PropertyValue
EndpointRefresh ONU Metrics
MethodPOST
URL/api/v1/onus/{id}/refresh-metrics
AuthenticationBearer Token

Path Parameters:

ParameterTypeRequiredDescription
idintegerYesONU ID

Success Response (200 OK):

json
{
    "success": true,
    "message": "Metrics refreshed",
    "data": {
        "rx_power": -18.5,
        "tx_power": 2.1,
        "status": "online"
    }
}

Bulk Refresh ONU Metrics

Refresh metrics for multiple ONUs at once.

PropertyValue
EndpointBulk Refresh ONU Metrics
MethodPOST
URL/api/v1/onus/bulk-refresh
AuthenticationBearer Token

Request Headers:

HeaderValueRequired
Content-Typeapplication/jsonYes
Acceptapplication/jsonYes
AuthorizationBearer your-auth-tokenYes

Request Body:

json
{
    "onu_ids": [1, 2, 3]
}
ParameterTypeRequiredDescription
onu_idsarrayYesArray of ONU IDs to refresh

Success Response (200 OK):

json
{
    "success": true,
    "message": "Bulk refresh completed",
    "data": {
        "refreshed": 3,
        "failed": 0
    }
}

www.onezeroart.com