Retrieve Device Rendered ConfigurationsΒΆ
Once you’ve completed the build out of the Blueprint parameters, you can retrieve the actual equipment vendor specific configuration that AOS will deploy onto the device. The structure and format of the device configuration will be specific to the equipment+NOS. The following example is part of the configuration for an Arista EOS device. In this example, the “spine_1” device happens to be an Arista. The aos-pyez library does not a convenient method to retrieve the configuration, so we need to use the Session.api.requests technique. The AOS-Server API reference page for the required request is:
And the code example to invoke this API for the “spine_1” node:
>>> got = blueprint.api.requests.get("%s/nodes/spine_1/config-rendering" % blueprint.url)
>>> body = got.json()
>>> body.keys()
[u'config']
>>>
>>> print body['config']
service interface inactive expose
!
hostname spine-1
interface Ethernet1
description facing_router-A:
no switchport
ip address 1.1.1.0/31
no shutdown
exit
!
interface Ethernet2
description facing_leaf_1:swp6
no switchport
ip address 172.20.0.0/31
no shutdown
exit
!
# ... clipped ...