code: def get_reservation_ports(session, reservation_id, model_name='Generic Traffic Generator Port'):
      
  
      reservation_ports = []
      reservation = session.GetReservationDetails(reservation_id).ReservationDescription
      for resource in reservation.Resources:
          if resource.ResourceModelName == model_name:
              reservation_ports.append(resource)
      return reservation_ports
docs: Get all Generic Traffic Generator Port in reservation.
  
      :return: list of all Generic Traffic Generator Port resource objects in reservation