6 Netbox running: https://github.com/netbox-community/netbox-docker
8 NETCONF capable device (JUNOS use in this example, but templates could be changed for another OS)
10 Blueprint processor micro-service runnint
12 CDS SQL database, populated with reference data as bellow:
15 `id` text DEFAULT NULL,
16 `value` text DEFAULT NULL
19 INSERT INTO `demo` VALUES ('1','vsn'),('2','vpg'),('3','vfw');
23 Bellow a table of the resource used within this example, and how this resource
25 The resources are used in the context of device configuration. These shouldn't be
26 confused with SDC model resources.
28 name | resolve through
29 ------------------------------------------------------
31 vfw_interface_ip | rest (through Netbox)
33 vf-module-number | default
34 vf-module-type | database
36 interface-name | input
37 interface-description | capability (python script)
43 Ability to resolve templates with their mappings and provide the result as output.
44 Example provide one templates: vf-module-1
48 Nothing specific to pass as input to the request. The resolution will use SQL and script to
49 resolve all the parameters.
54 "resource-assignment-response": {
56 "vf-module-1": "<interface>\n <description>This is the Virtual Firewall entity</description>\n <vfw>10.10.10.69/24</vfw>\n</interface>"
61 config-assign (dry-run)
63 Ability to resolve templates with their mappings and provide the result as output.
64 Example provide one templates: hostname
66 This action uses the same functionality as resource-assignment, and in addition,
67 store the resulting meshed-template to be used later.
71 resolution-key: To identify the configlet saved in the DB
72 hostname: Value defined to be result trough input in the hostname mapping file
73 interface-name: Name of the interface to configure
74 unit-number: Unit to configure for the interface
77 "config-assign-request": {
78 "resolution-key": "config-assign-demo-123",
79 "config-assign-properties": {
81 "interface-name": "ge-0/0/7",
89 "config-assign-response": {
91 "hostname": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<configuration xmlns:junos=\"http://xml.juniper.net/junos/17.4R1/junos\">\n <system xmlns=\"http://yang.juniper.net/junos-qfx/conf/system\">\n <host-name operation=\"delete\" />\n <host-name operation=\"create\">blah</host-name>\n </system>\n</configuration>\n",
92 "vfw-interface": "<configuration>\n <interfaces>\n <interface>\n <name>ge-0/0/7</name>\n <unit operation=\"create\">\n <name>0</name>\n <description>This is the Virtual Firewall entity</description>\n <family>\n <inet>\n <address>\n <name>10.0.101.17/24</name>\n </address>\n </inet>\n </family>\n </unit>\n </interface>\n </interfaces>\n</configuration>"
98 This action will run a python script that will retrieved the resolved template
99 from previous step using the resolution-key.
100 This action will push these resolved templates into a device (JUNOS) using NETCONF.
101 The python script will make use of utilities classes provided by the platform:
102 resolution helper and netconf client.
104 Information about the device is modelled as a requirement of this action, specifying that
105 username, password and ip of the device should be provided as input.
106 Note: you could resolve those information using the resource resolution framework, if need be.
110 resolution-key: To identify the configlet saved in the DB in previous step
111 username: NETCONF device user
112 password: NETCONF device password
113 ip: NETCONF device ip
117 "config-deploy-request": {
118 "resolution-key": "config-assign-demo-123",
120 "password": "passwd",
127 No specific output beside success or failure.
131 This action will rollback the last committed config on the device, using NETCONF and device
132 specific RPC. To do so, a python script will be used, similar as in previous action, to dynamically
133 resolve the rollback template payload, and send the RPC to the device.
135 Information about the NETCONF device is provided in a similar fashion as previous step.
139 username: NETCONF device user
140 password: NETCONF device password
141 ip: NETCONF device ip
144 "rollback-request": {
146 "password": "passwd",
148 "rollback-properties": {
156 No specific output beside success or failure.
159 Postman collection used for this example. 5 requests are provided one per workflow to execute, and 1 to load the CBA in the runtime environment.
161 https://www.getpostman.com/collections/d68b12a60fd6ed336059