Rob's Blog

This is stuff.

Nokia Altiplano – Database query to retrieve l2-user details from intent

This snippet exports a list of all l2-user details including intent name, network state, active state, UNI interface, VLAN and service profile. This is useful for backup purposes or in preparing import scripts for a Altiplano migration.

SQL
SELECT 
    target AS name,
    required_network_state,
    REPLACE(REPLACE(REPLACE(REGEXP_SUBSTR(intent_config, '<user-device-name>([^<]+)</user-device-name>'), '<user-device-name>', ''), '</user-device-name>', ''), '_', '.') AS ont,
    REPLACE(REPLACE(REPLACE(REGEXP_SUBSTR(intent_config, '<uni-id>([^<]+)</uni-id>'), '<uni-id>', ''), '</uni-id>', ''), '_', '.') AS uni_id,
    REPLACE(REPLACE(REPLACE(REGEXP_SUBSTR(intent_config, '<q-vlan-id>([^<]+)</q-vlan-id>'), '<q-vlan-id>', ''), '</q-vlan-id>', ''), '_', '.') AS q_vlan_id,
    REPLACE(REPLACE(REPLACE(REGEXP_SUBSTR(intent_config, '<service-profile>([^<]+)</service-profile>'), '<service-profile>', ''), '</service-profile>', ''), '_', '.') AS service_profile
FROM 
    ac.intent
WHERE 
    intent_type LIKE 'l2-user';
    Leave a Reply

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

    © 2025 Rob's Blog