Is there a way to enable plugin using HTTP API?

Is there a way to enable plugin using HTTP API? I’d like to find something like
POST data
orgId:
plugin:
action:
I’ve found endpoint /api/plugins (https://grafana.com/api/plugins) but it seems there’s no way to POST data. Also i’ve not found any notices about it in official documentation.
Any considerations will be great

Hi @robertahmetzyanov1,

Welcome to the :grafana: community support forums !!

We are excited that you joined our OSS community. Please read about some of the FAQs in the community :slight_smile:

Please review the submission template and include more details:

  • What Grafana version and what operating system are you using?
  • Did you follow any online instructions OR any reference link where you found this endpoint? If so, what is the URL?

Thank you for answer! Grafana version is 9.1 and the operating systems is Ubuntu 20.04.4.
No, as I told before, I haven’t found any online instructions about /api/plugins endpoint

Thanks for the quick reply.

Sounds to me like we need to improve the docs if an endpoint exists (but that can be told in more detail by the Engineers).

I do know that there is a command line tool for CLI which do support plugin management:

But not sure about any API.

Therefore, we would appreciate it if you can open a bug report about this in our official GitHub repository using this link.

Provide all the information (you can simply copy/paste your data + screenshot from here to there).

Lastly, paste the link to your GitHub issue here in this post so that all other community users can also track it. I will also add more additional information to it :+1:

Thank you!
I also found that url https://grafana.com/api/plugins that shows all the plugins, but the output from my grafana instance is different:

{
            "category": "",
            "defaultNavUrl": "/plugins/alexanderzobnin-zabbix-triggers-panel/",
            "dependencies": {
                "grafanaDependency": "",
                "grafanaVersion": "*",
                "plugins": []
            },
            "enabled": true,
            "hasUpdate": false,
            "id": "alexanderzobnin-zabbix-triggers-panel",
            "info": {
                "author": {
                    "name": "Alexander Zobnin",
                    "url": "https://github.com/alexanderzobnin/grafana-zabbix"
                },
                "build": {},
                "description": "",
                "links": null,
                "logos": {
                    "large": "public/plugins/alexanderzobnin-zabbix-triggers-panel/img/icn-zabbix-problems-panel.svg",
                    "small": "public/plugins/alexanderzobnin-zabbix-triggers-panel/img/icn-zabbix-problems-panel.svg"
                },
                "screenshots": null,
                "updated": "",
                "version": ""
            },
            "latestVersion": "",
            "name": "Zabbix Problems",
            "pinned": false,
            "signature": "valid",
            "signatureOrg": "Alexander Zobnin",
            "signatureType": "community",
            "state": "",
            "type": "panel"
        }

That the part from the output with zabbix plugin. I’ve tried to enable Zabbix from the following ansible playbook:

    - name: Enable zabbix plugin
      uri:
        url: "{{ grafana_base_url }}/plugins"
        method: PUT
        user: "{{ grafana_admin_user }}"
        password: "{{ grafana_admin_password }}"
        force_basic_auth: true
        headers:
          Content-Type: "application/json"
        body_format: json
        body: 
          orgId: 10
          id: "alexanderzobnin-zabbix-app"
          enabled: true
      register: post_output

But the output is

        "json": {
            "message": "Not found"
        },

So would be great, if anyone have suggestions how to enable plugin using API.
Also you noticed grafana-cli, is there a way to enable plugin using it? Seems there’s only possiblity to install or update plugins

As said earlier :slight_smile:

Therefore, we would appreciate it if you can open a bug report about this in our official GitHub repository using this link.

Provide all the information (you can simply copy/paste your data + screenshot from here to there).

Lastly, paste the link to your GitHub issue here in this post so that all other community users can also track it. I will also add more additional information to it :+1:

I stumble upon this thread trying to do the exact same thing. Finally solved it by watching chrome’s network logs.

- name: Enable zabbix plugin
  register: zbx
  uri:
    body_format: json
    force_basic_auth: true
    url_username: "admin"
    url_password: "{{ user.grafana.admin_pass }}"
    method: POST
    url: "https://example.com/api/plugins/alexanderzobnin-zabbix-app/settings"
    body:
      enabled: true
      pinned: true
      jsonData: null
1 Like