PHP code example of fulgerx2007 / grafana-api

1. Go to this page and download the library: Download fulgerx2007/grafana-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

fulgerx2007 / grafana-api example snippets


$login = 'admin';
$password = 'admin';
$grafana_url = 'http://localhost:3000';

$grafana  = new FulgerX2007\Grafana\Grafana($login, $password, $grafana_url);

$team_title = 'Marketing';
$team_email = 'marketing@@company.org'; // is optional
$team_org_id = 1; // by default is 1

$team = new \FulgerX2007\Grafana\Entity\Team($team_title, $team_email, $team_org_id);

$response = $grafana->team()->add($team);