def from_name(cls, name):
        """Retrieve vlan id associated to a name."""
        result = cls.list()
        vlans = {}
        for vlan in result:
            vlans[vlan['name']] = vlan['id']

        return vlans.get(name)
def from_name ( cls , name ) : result = cls . list ( ) vlans = { } for vlan in result : vlans [ vlan [ 'name' ] ] = vlan [ 'id' ] return vlans . get ( name )
Retrieve vlan id associated to a name.