// ImportGrafanaBoard takes raw Grafana board json and returns GrafanaBoard pointer for use in Meshery
ImportGrafanaBoard takes raw Grafana board json and returns GrafanaBoard pointer for use in Meshery
// ImportGrafanaBoard takes raw Grafana board json and returns GrafanaBoard pointer for use in Meshery
func (p *PrometheusClient) ImportGrafanaBoard(ctx context.Context, boardData []byte) (*models.GrafanaBoard, error) {
	board := &sdk.Board{}
	if err := json.Unmarshal(boardData, board); err != nil {
		msg := errors.New("unable to parse grafana board data")
		logrus.Error(errors.Wrap(err, msg.Error()))
		return nil, msg
	}
	return p.grafanaClient.ProcessBoard(board, &sdk.FoundBoard{
		Title: board.Title,
		URI:   board.Slug,
	})
}
func ( p * PrometheusClient ) ImportGrafanaBoard ( ctx context . Context , boardData [ ] byte ) ( * models . GrafanaBoard , error ) { board := & sdk . Board { } if err := json . Unmarshal ( boardData , board ) ; err != nil { msg := errors . New ( " " ) logrus . Error ( errors . Wrap ( err , msg . Error ( ) ) ) return nil , msg } return p . grafanaClient . ProcessBoard ( board , & sdk . FoundBoard { Title : board . Title , URI : board . Slug , } ) }
ImportGrafanaBoard takes raw Grafana board json and returns GrafanaBoard pointer for use in Meshery
ImportGrafanaBoard takes raw Grafana board json and returns GrafanaBoard pointer for use in Meshery