This script exports a summary count showing the quantities of each model of ONT provisioned on Altiplano. This is useful when aligning support contract details and planning for upgrades.
SELECT
REPLACE(REPLACE(REPLACE(REGEXP_SUBSTR(intent_config, '<ont-type>([^<]+)</ont-type>'), '<ont-type>', ''), '</ont-type>', ''), '_', '.') AS ont_type,
COUNT(*) AS count
FROM
ac.intent
WHERE
intent_type LIKE 'ont'
GROUP BY
ont_type;