Macro Examples - List Macro

Syntax for List macros is between {# #}. The results are in a list format: comma separated results and between [ ] All fields in Countries model.

{# data.Countries.* #}

[{u'cli_on_prefix': u'',
  u'country_name': u'Australia',
  u'data_type_': u'data/Countries',
  u'default_user_locale': u'English United States',
  u'emergency_access_prefix': u'000',
  u'international_access_prefix': u'011',
  u'international_dial_code': u'61',
  u'iso_country_code': u'AUS',
  u'national_trunk_prefix': u'0',
  u'network_locale': u'United States',
  u'premium_access_prefix': u'8',
  u'pstn_access_prefix': u'9',
  u'service_access_prefix': u'13'},
 {u'cli_on_prefix': u'',
  u'country_name': u'Bahrain',
  u'data_type_': u'data/Countries',
  u'default_user_locale': u'English United States',
  u'emergency_access_prefix': u'999',
  u'international_access_prefix': u'00',
  u'international_dial_code': u'973',
  u'iso_country_code': u'BHR',
  u'national_trunk_prefix': u'',
  u'network_locale': u'United States',
  u'premium_access_prefix': u'',
  u'pstn_access_prefix': u'9',
  u'service_access_prefix': u''},
.........]

Selected fields in Countries model.

{# data.Countries.country_name, iso_country_code #}

[{u'country_name': u'Australia',
  u'iso_country_code': u'AUS'},
 {u'country_name': u'Bahrain',
  u'iso_country_code': u'BHR'},
 {u'country_name': u'Canada',
  u'iso_country_code': u'CAN'},
 {u'country_name': u'Denmark',
  u'iso_country_code': u'DNK'},
 ...
 ...
 {u'country_name': u'United States of America',
  u'iso_country_code': u'USA'}
]

Specifying one field in the list will return only a list of values and not a key-value pair list.

{# data.Countries.country_name #}

[u'Australia',
 u'Bahrain',
 u'Canada',
 ...
 ...
 u'United States of America']

Device types: a list of all line patterns in the null partition.

{# device.cucm.Line.pattern,routePartitionName | routePartitionName:'NullPartition'#}

[{u'pattern': u'55554444',
  u'routePartitionName': u'NullPartition'},
 {u'pattern': u'8100240105',
  u'routePartitionName': u'NullPartition'},
 {u'pattern': u'5544332211',
  u'routePartitionName': u'NullPartition'},
 {u'pattern': u'55667722',
  u'routePartitionName': u'NullPartition'},
 {u'pattern': u'8765653',
  u'routePartitionName': u'NullPartition'},
 {u'pattern': u'66776767',
  u'routePartitionName': u'NullPartition'},
 {u'pattern': u'3009',
  u'routePartitionName': u'NullPartition'},
 {u'pattern': u'656574747',
  u'routePartitionName': u'NullPartition'},
 ...
 ...  ]

Nested structures.

{# device.cucm.Css.* | name: 'PSTN-CSS-Cape-Town'#}

[{u'clause': u'PHONES-PT-Cape-Town:PSTN-PT-Cape-Town:
               Pickup-PT-Cape-Town:CallPark-PT-Cape-Town',
  u'hierarchy': u'5171010ecc2e19483c11291b',
  u'members': {u'member': [{u'index': 1,
                            u'routePartitionName': u'PHONES-PT-Cape-Town',
                            u'uuid': u'{7AF255DC-3A05-A1B4-9E5E-95CD48C3C95F}'},
                           {u'index': 2,
                            u'routePartitionName': u'PSTN-PT-Cape-Town',
                            u'uuid': u'{5FA76732-0074-108A-3A91-23D7C6CAC2E1}'},
                           {u'index': 3,
                            u'routePartitionName': u'Pickup-PT-Cape-Town',
                            u'uuid': u'{F789964F-C95D-4095-F6C7-48E587CBFAD8}'},
                           {u'index': 4,
                            u'routePartitionName': u'CallPark-PT-Cape-Town',
                            u'uuid': u'{B4817113-0F32-6E7F-67B2-20645CFC4509}'}]},
   u'name': u'PSTN-CSS-Cape-Town',
   u'partitionUsage': u'General',
   u'uuid': u'{E678A23E-866A-7CE8-AD0F-8AF138E10A18}'}]
{# device.cucm.Css.name,members | name: 'PSTN-CSS-Cape-Town'#}

[{u'members': {u'member': [{u'index': 1,
                            u'routePartitionName': u'PHONES-PT-Cape-Town',
                            u'uuid': u'{7AF255DC-3A05-A1B4-9E5E-95CD48C3C95F}'},
                           {u'index': 2,
                            u'routePartitionName': u'PSTN-PT-Cape-Town',
                            u'uuid': u'{5FA76732-0074-108A-3A91-23D7C6CAC2E1}'},
                           {u'index': 3,
                            u'routePartitionName': u'Pickup-PT-Cape-Town',
                            u'uuid': u'{F789964F-C95D-4095-F6C7-48E587CBFAD8}'},
                           {u'index': 4,
                            u'routePartitionName': u'CallPark-PT-Cape-Town',
                            u'uuid': u'{B4817113-0F32-6E7F-67B2-20645CFC4509}'}]},
  u'name': u'PSTN-CSS-Cape-Town'}]
{# device.cucm.Css.name,members.member | name: 'PSTN-CSS-Cape-Town'#}

[{u'members.member': [{u'index': 1,
                       u'routePartitionName': u'PHONES-PT-Cape-Town',
                       u'uuid': u'{7AF255DC-3A05-A1B4-9E5E-95CD48C3C95F}'},
                      {u'index': 2,
                       u'routePartitionName': u'PSTN-PT-Cape-Town',
                       u'uuid': u'{5FA76732-0074-108A-3A91-23D7C6CAC2E1}'},
                      {u'index': 3,
                       u'routePartitionName': u'Pickup-PT-Cape-Town',
                       u'uuid': u'{F789964F-C95D-4095-F6C7-48E587CBFAD8}'},
                      {u'index': 4,
                       u'routePartitionName': u'CallPark-PT-Cape-Town',
                       u'uuid': u'{B4817113-0F32-6E7F-67B2-20645CFC4509}'}],
  u'name': u'PSTN-CSS-Cape-Town'}]
{# device.cucm.Css.name,members.member.2 | name: 'PSTN-CSS-Cape-Town'#}

[{u'members.member.2': {u'index': 3,
                        u'routePartitionName': u'Pickup-PT-Cape-Town',
                        u'uuid': u'{F789964F-C95D-4095-F6C7-48E587CBFAD8}'},
  u'name': u'PSTN-CSS-Cape-Town'}]
{# device.cucm.Css.name,members.member.2.routePartitionName | name:
  'PSTN-CSS-Cape-Town'#}

[{u'members.member.2.routePartitionName': u'Pickup-PT-Cape-Town',
  u'name': u'PSTN-CSS-Cape-Town'}]