From 4189b196ffc256a53842964ae7e2647ea4a37f75 Mon Sep 17 00:00:00 2001 From: Marcus Olsson Date: Thu, 17 Sep 2020 13:19:40 +0200 Subject: [PATCH] Docs: Add missing properties to plugin metadata schema (#27445) * Update plugin metadata schema * Add missing properties to plugin schema * Fix review comments --- docs/sources/developers/plugins/metadata.md | 7 +++++-- docs/sources/developers/plugins/plugin.schema.json | 12 +++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/sources/developers/plugins/metadata.md b/docs/sources/developers/plugins/metadata.md index 2210aed9711..bf6be4baf88 100644 --- a/docs/sources/developers/plugins/metadata.md +++ b/docs/sources/developers/plugins/metadata.md @@ -21,10 +21,11 @@ The plugin.json file is required for all plugins. When Grafana starts, it scans | `info` | [object](#info) | **Yes** | Metadata for the plugin. Some fields are used on the plugins page in Grafana and others on grafana.com if the plugin is published. | | `name` | string | **Yes** | Human-readable name of the plugin that is shown to the user in the UI. | | `type` | string | **Yes** | Plugin type. Possible values are `app`, `datasource`, and `panel`. | +| `$schema` | string | No | Schema definition for the plugin.json file | | `alerting` | boolean | No | For data source plugins. If the plugin supports alerting. | | `annotations` | boolean | No | For data source plugins. If the plugin supports annotation queries. | | `backend` | boolean | No | If the plugin has a backend component. | -| `category` | string | No | Plugin category used on the Add data source page. Possible values are: `tsdb`, `logging`, `cloud`, `tracing`, and `sql`. | +| `category` | string | No | Plugin category used on the Add data source page. Possible values are: `tsdb`, `logging`, `cloud`, `tracing`, `sql`, `enterprise` and `other`. | | `executable` | string | No | The first part of the file name of the backend component executable. There can be multiple executables built for different operating system and architecture. Grafana will check for executables named `_<$GOOS>_<.exe for Windows>`, e.g. `plugin_linux_amd64`. Combination of $GOOS and $GOARCH can be found here: https://golang.org/doc/install/source#environment. | | `hiddenQueries` | boolean | No | | | `includes` | [object](#includes)[] | No | | @@ -33,10 +34,12 @@ The plugin.json file is required for all plugins. When Grafana starts, it scans | `mixed` | boolean | No | Not to be used by external plugins. Special property for the built-in mixed plugin. | | `module` | string | No | | | `partials` | [object](#partials) | No | | +| `preload` | boolean | No | Initialize plugin on startup. By default, the plugin initializes on first use. | | `queryOptions` | [object](#queryoptions) | No | For data source plugins. There is a query options section in the plugin's query editor and these options can be turned on if needed. | | `routes` | [object](#routes)[] | No | For data source plugins. Proxy routes used for plugin authentication and adding headers to HTTP requests made by the plugin. For more information, refer to [Authentication for data source plugins](https://grafana.com/docs/grafana/latest/developers/plugins/authentication/). | | `skipDataQuery` | boolean | No | For panel plugins. Hides the query editor. | | `sort` | number | No | Internal property for sorting. Cannot be used as will be overwritten by Grafana. | +| `state` | string | No | Marks a plugin as a pre-release. | | `staticRoot` | string | No | | | `streaming` | boolean | No | For data source plugins. If the plugin supports streaming. | | `tables` | boolean | No | | @@ -75,12 +78,12 @@ Metadata for the plugin. Some fields are used on the plugins page in Grafana and | Property | Type | Required | Description | |---------------|--------------------------|----------|-------------------------------------------------------------------------------------------------------------------------------| +| `keywords` | string[] | **Yes** | Array of plugin keywords. Used for search on grafana.com. | | `logos` | [object](#logos) | **Yes** | SVG images that are used as plugin icons. | | `updated` | string | **Yes** | Date when this plugin was built. | | `version` | string | **Yes** | Project version of this commit, e.g. `6.7.x`. | | `author` | [object](#author) | No | Information about the plugin author. | | `description` | string | No | Description of plugin. Used on the plugins page in Grafana and for search on grafana.com. | -| `keywords` | string[] | No | Array of plugin keywords. Used for search on grafana.com. | | `links` | [object](#links)[] | No | An array of link objects to be displayed on this plugin's project page in the form `{name: 'foo', url: 'http://example.com'}` | | `screenshots` | [object](#screenshots)[] | No | An array of screenshot objects in the form `{name: 'bar', path: 'img/screenshot.png'}` | diff --git a/docs/sources/developers/plugins/plugin.schema.json b/docs/sources/developers/plugins/plugin.schema.json index 2e443c797a6..fd9163766f0 100644 --- a/docs/sources/developers/plugins/plugin.schema.json +++ b/docs/sources/developers/plugins/plugin.schema.json @@ -46,6 +46,15 @@ "type": "string", "description": "The first part of the file name of the backend component executable. There can be multiple executables built for different operating system and architecture. Grafana will check for executables named `_<$GOOS>_<.exe for Windows>`, e.g. `plugin_linux_amd64`. Combination of $GOOS and $GOARCH can be found here: https://golang.org/doc/install/source#environment." }, + "preload": { + "type": "boolean", + "description": "Initialize plugin on startup. By default, the plugin initializes on first use." + }, + "state": { + "type": "string", + "description": "Marks a plugin as a pre-release.", + "enum": ["alpha", "beta"] + }, "includes": { "type": "array", "items": { @@ -99,7 +108,8 @@ "description": "Not to be used by external plugins. Special property for the built-in mixed plugin." }, "module": { - "type": "string" + "type": "string", + "description": "" }, "sort": { "type": "number",