Ejemplo n.º 1
0
func GetDevice(c *gin.Context) {
	device_name := c.Params.ByName("device_name")
	var device tf.Device
	device.Device_name = device_name
	if device, err := device.GetDevice(); err != nil {
		c.String(http.StatusInternalServerError, fmt.Sprintf("Failed to get device %s", device_name))
	} else {
		c.JSON(http.StatusOK, device)
	}
}