Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a command to import dashboard from org folders #77

Open
mohamednizar opened this issue Aug 12, 2020 · 1 comment
Open

Create a command to import dashboard from org folders #77

mohamednizar opened this issue Aug 12, 2020 · 1 comment
Assignees

Comments

@mohamednizar
Copy link
Member

Is your feature request related to a problem? Please describe.
Currently, we are importing dashboards, manually, to implement CI/CD we need this feature.

Describe the solution you'd like
php artisan dashboard:import ordName Filepath

@mohamednizar
Copy link
Member Author

@janithRS Here find an example method to update

public function updateUserOrg(Request $request, $data)
    {
        $header = [
            'Accept' => 'application/json',
            'Content-Type' => 'application/json',
        ];
        $client = new Client([
            'base_uri' => env('GRAFANA_URL'),
            'auth' => [env('GRAFANA_USER'), env('GRAFANA_PASSWORD')],
            'headers' =>  $header
        ]);
        try {
            $client->post("/api/orgs/{$data['orgId']}/users", [
                'json' => [
                    'role' => 'Viewer',
                    'loginOrEmail' => $data['user']['login']
                ]
            ]);
        } catch (\Throwable $th) {
        }
    }

Find the Dashboard API: https://grafana.com/docs/grafana/latest/http_api/dashboard/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants