Property Sets Introduction (Datacenter Design)
Property sets are data sets that define device properties. They work in conjunction with configlets and Analytics probes. (Config templates in Freeform blueprints also use property sets, but they're not related to property sets in the Design catalog, as discussed here.) Instead of embedding data directly into configlets or probes, you can store variable values in a property set, then refer to the property set from the configlet or probe. This gives you flexibility in case you want to change values later. After you create your blueprint, you'll import your configlets and property sets from the Design (global) catalog into the blueprint catalog.
But first, you need to write the property set (and the configlet or probe that'll use it). You can write it in JSON or YAML. You can use key-value pairs, lists, dictionaries, and any combination of these data structures by nesting them.
Below is an example of a property set and configlet that uses it to change the SNMP location field based on a provided list of system_name to location mapping.
Property Set
{ "created_at": "2023-08-26T13:20:04.488463+0000", "updated_at": "2023-08-28t18:57:41.169692+0000", "values_yaml": "PS_SNMP_Locations:\n leaf1: DC-Room1-Rack32\n leaf2: DC1-room1-Rack34\n leaf3: DC1-Room1-Rack33\n spine1: DC1-Room1-Rack30\n spine2: DC1-Room1-Rack31\n", "values": { "PS_SNMP_Locations": { "spine1": "DC1-Room1-Rack30", "spine2": "DC1-Room1-Rack31", "leaf1": "DC1-Room1-Rack32", "leaf3": "DC1-Room1-Rack33", "leaf2": "DC1-Room1-Rack34" } }, "label": "PS_SNMP_Locations", "id": "c4006bb8-f8f4-4aa7-82c3-8da5dfc03c43" }
You can enter property set details in any order, but when you open a property set after creating it, it will have been automatically sorted alphabetically (per the Python dictionary function). For example, if you create the property set above, it would be sorted as shown below.
{ "created_at": "2023-08-26T13:20:04.488463+0000", "id": "c4006bb8-f8f4-4aa7-82c3-8da5dfc03c43", "label": "PS_SNMP_Locations", "updated_at": "2023-08-28t18:57:41.169692+0000", "values": { "PS_SNMP_Locations": { "leaf1": "DC1-Room1-Rack32", "leaf2": "DC1-Room1-Rack34", "leaf3": "DC1-Room1-Rack33", "spine1": "DC1-Room1-Rack30", "spine2": "DC1-Room1-Rack31" } }, "values_yaml": "PS_SNMP_Locations:\n leaf1: DC-Room1-Rack32\n leaf2: DC1-room1-Rack34\n leaf3: DC1-Room1-Rack33\n spine1: DC1-Room1-Rack30\n spine2: DC1-Room1-Rack31\n" }
Configlet
{ "ref_archs": [ "two_stage_l3clos" ], "generators": [ { "config_style": "junos", "section": "system", "template_text": "{% if PS_SNMP_Locations[hostname] is defined %}\nsnmp {\n location \"{{PS_SNMP_Locations[hostname]}}\";\n}\n{5 endif %}\n", "negation_template_text": ::, "filename": "" } ], "created_at": "2022-08-26T13:23:57.2720142", "id": "b2739659-897d-4fa2-a8e9-2060ae1c045f", "last_modified_at": "2022-08-26T13:29:40.1924382", "display_name": "SNMP_location" }
From the left navigation menu, navigate to Design > Property Sets to go to property sets in the Design catalog. You can create, clone, edit and delete property sets.