def get_as_by_id(as_id): """Return an AS by id. Args: as_id: Id of AS """ try: as_ = Asn.get_by_pk(id=as_id) except AsnNotFoundError, e: raise exceptions.AsnDoesNotExistException(str(e))
def get_as_by_asn(asn_): """Return an AS by id. Args: asn: ASN """ try: as_ = Asn.get_by_asn(asn_) except AsnNotFoundError as e: raise exceptions.AsnDoesNotExistException(str(e)) return as_
def get_as_equipment_by_equip(equipment_id=None): """Return an ASEquipment by equipment id. Args: equipment_id: Id of Equipment """ try: as_equipment = list() for equip in equipment_id: as_equipment += AsnEquipment.get_by_pk(equipment=equip) except AsnNotFoundError as e: raise exceptions.AsnDoesNotExistException(str(e)) return as_equipment
def get_as_equipment_by_asn(asn_id=None): """Return an ASEquipment by asn id. Args: asn_id: Id of ASN """ try: as_equipment = list() for asn in asn_id: as_equipment += AsnEquipment.get_by_pk(asn=asn) except AsnNotFoundError as e: raise exceptions.AsnDoesNotExistException(str(e)) return as_equipment
def get_as_equipment_by_id(as_equipment_id=None): """Return an ASEquipment by id. Args: as_equipment_id: Id of ASEquipment """ try: as_equipment_list = list() for asn in as_equipment_id: as_equipment = AsnEquipment.get_by_pk(ids=asn) as_equipment_list.append(as_equipment) except AsnNotFoundError as e: raise exceptions.AsnDoesNotExistException(str(e)) return as_equipment_list