Поддержка JSON

Для решения задач автоматизации более удобным может оказаться просмотр и задание настроек полисинга в формате JSON

Вывод настроек полисинга тарифного плана TEST в формате JSON:

fdpi_ctrl list profile --policing --profile.name TEST --outformat json

Загрузка настроек полисинга тарифного плана TEST в формате JSON:

Сокращенный формат (burst,cburst вычисляются автоматически):

fdpi_ctrl load profile --policing --profile.name TEST --profile.json '{ "type":"HTB", "outbound":{ "root_rate":"20mbit","root_ceil":"20mbit", "classes" : [ {"class":0, "rate":"8bit", "ceil":"20mbit"},{"class":1, "rate":"8bit", "ceil":"20mbit"},{"class":2, "rate":"8bit", "ceil":"20mbit"},{"class":3, "rate":"8bit", "ceil":"20mbit"},{"class":4, "rate":"8bit", "ceil":"20mbit"},{"class":5, "rate":"8bit", "ceil":"20mbit"},{"class":6, "rate":"8bit", "ceil":"20mbit"},{"class":7, "rate":"8bit", "ceil":"20mbit"} ]}, "inbound":{ "root_rate":"20mbit","root_ceil":"20mbit", "classes" : [ {"class":0, "rate":"8bit", "ceil":"20mbit"},{"class":1, "rate":"8bit", "ceil":"20mbit"},{"class":2, "rate":"8bit", "ceil":"20mbit"},{"class":3, "rate":"8bit", "ceil":"20mbit"},{"class":4, "rate":"8bit", "ceil":"20mbit"},{"class":5, "rate":"8bit", "ceil":"20mbit"},{"class":6, "rate":"8bit", "ceil":"20mbit"},{"class":7, "rate":"8bit", "ceil":"20mbit"} ]}}'

Полный формат:

fdpi_ctrl load profile --policing --profile.name TEST --profile.json '{ "type":"HTB", "outbound":{ "root_rate":"20mbit","root_ceil":"20mbit","root_burst":"10mbit","root_cburst":"10mbit" , "classes" : [ {"class":0, "rate":"8bit", "ceil":"20mbit","burst":"8bit","cburst":"10mbit" },{"class":1, "rate":"8bit", "ceil":"20mbit","burst":"8bit","cburst":"10mbit" },{"class":2, "rate":"8bit", "ceil":"20mbit","burst":"8bit","cburst":"10mbit" },{"class":3, "rate":"8bit", "ceil":"20mbit","burst":"8bit","cburst":"10mbit" },{"class":4, "rate":"8bit", "ceil":"20mbit","burst":"8bit","cburst":"10mbit" },{"class":5, "rate":"8bit", "ceil":"20mbit","burst":"8bit","cburst":"10mbit" },{"class":6, "rate":"8bit", "ceil":"20mbit","burst":"8bit","cburst":"10mbit" },{"class":7, "rate":"8bit", "ceil":"20mbit","burst":"8bit","cburst":"10mbit" } ]}, "inbound":{ "root_rate":"20mbit","root_ceil":"20mbit","root_burst":"10mbit","root_cburst":"10mbit" , "classes" : [ {"class":0, "rate":"8bit", "ceil":"20mbit","burst":"8bit","cburst":"10mbit" },{"class":1, "rate":"8bit", "ceil":"20mbit","burst":"8bit","cburst":"10mbit" },{"class":2, "rate":"8bit", "ceil":"20mbit","burst":"8bit","cburst":"10mbit" },{"class":3, "rate":"8bit", "ceil":"20mbit","burst":"8bit","cburst":"10mbit" },{"class":4, "rate":"8bit", "ceil":"20mbit","burst":"8bit","cburst":"10mbit" },{"class":5, "rate":"8bit", "ceil":"20mbit","burst":"8bit","cburst":"10mbit" },{"class":6, "rate":"8bit", "ceil":"20mbit","burst":"8bit","cburst":"10mbit" },{"class":7, "rate":"8bit", "ceil":"20mbit","burst":"8bit","cburst":"10mbit" } ]}}'