Rob's Blog

This is stuff.

Nokia Altiplano – Database query to retrieve ONT details from intent

This snippet exports a list of all ONT intents, including the intent name, fiber name, ONT model, serial number and active status. This is helpful for backup purposes or to prepare import scripts for a Altiplano migration.

SQL
SELECT 
    target,
    intent_type,
    required_network_state,
    REPLACE(REPLACE(REPLACE(REGEXP_SUBSTR(intent_config, '<fiber-name>([^<]+)</fiber-name>'), '<fiber-name>', ''), '</fiber-name>', ''), '_', '.') AS fiber_name,
    REPLACE(REPLACE(REPLACE(REGEXP_SUBSTR(intent_config, '<ont-type>([^<]+)</ont-type>'), '<ont-type>', ''), '</ont-type>', ''), '_', '.') AS ont_type,
    REPLACE(REPLACE(REPLACE(REGEXP_SUBSTR(intent_config, '<expected-serial-number>([^<]+)</expected-serial-number>'), '<expected-serial-number>', ''), '</expected-serial-number>', ''), '_', '.') AS expected_serial_number
FROM 
    intent
WHERE 
    intent_type LIKE 'ont';
    Leave a Reply

    Your email address will not be published. Required fields are marked *

    © 2025 Rob's Blog