Update plugin metadata schema (#26720)

* Update plugin metadata schema

* Update docs/sources/developers/plugins/metadata.md

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
This commit is contained in:
Marcus Olsson 2020-08-05 17:37:51 +02:00 committed by GitHub
parent e26745368e
commit 5a58f2b4c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 11 deletions

View File

@ -48,8 +48,9 @@ Plugin dependencies.
### Properties ### Properties
| Property | Type | Required | Description | | Property | Type | Required | Description |
|------------------|----------|----------|------------------------------------------------------------------------------------------------------------------| |---------------------|----------|----------|-------------------------------------------------------------------------------------------------------------------------------|
| `grafanaVersion` | string | **Yes** | Required Grafana version for this plugin, e.g. `6.x.x 7.x.x` to denote plugin requires Grafana v6.x.x or v7.x.x. | | `grafanaDependency` | string | **Yes** | Required Grafana version for this plugin, e.g. `>=7.0.0` to denote plugin requires Grafana 7.0.0 or later. |
| `grafanaVersion` | string | No | (Deprecated) Required Grafana version for this plugin, e.g. `6.x.x 7.x.x` to denote plugin requires Grafana v6.x.x or v7.x.x. |
| `plugins` | string[] | No | An array of required plugins on which this plugin depends. | | `plugins` | string[] | No | An array of required plugins on which this plugin depends. |
## includes ## includes
@ -183,4 +184,3 @@ For data source plugins. Parameters for the token authentication request.
| `grant_type` | string | No | For data source plugins. OAuth grant type. | | `grant_type` | string | No | For data source plugins. OAuth grant type. |
| `resource` | string | No | For data source plugins. OAuth resource. | | `resource` | string | No | For data source plugins. OAuth resource. |

View File

@ -10,7 +10,7 @@
"id": { "id": {
"type": "string", "type": "string",
"description": "Unique name of the plugin. If the plugin is published on grafana.com, then the plugin id has to follow the naming conventions.", "description": "Unique name of the plugin. If the plugin is published on grafana.com, then the plugin id has to follow the naming conventions.",
"pattern": "^[0-9a-z\\-]+$" "pattern": "^[0-9a-z]+\\-([0-9a-z]+\\-)?(app|panel|datasource)$"
}, },
"type": { "type": {
"type": "string", "type": "string",
@ -117,13 +117,18 @@
"dependencies": { "dependencies": {
"type": "object", "type": "object",
"description": "Plugin dependencies.", "description": "Plugin dependencies.",
"required": ["grafanaVersion"], "required": ["grafanaDependency"],
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {
"grafanaVersion": { "grafanaVersion": {
"type": "string", "type": "string",
"description": "Required Grafana version for this plugin, e.g. `6.x.x 7.x.x` to denote plugin requires Grafana v6.x.x or v7.x.x.", "description": "(Deprecated) Required Grafana version for this plugin, e.g. `6.x.x 7.x.x` to denote plugin requires Grafana v6.x.x or v7.x.x.",
"pattern": "^([0-9x]+\\.[0-9x]+\\.*[0-9x]*\\s*)+$" "pattern": "^([0-9]+)(\\.[0-9x]+)?(\\.[0-9x])?$"
},
"grafanaDependency": {
"type": "string",
"description": "Required Grafana version for this plugin, e.g. `>=7.0.0` to denote plugin requires Grafana 7.0.0 or later",
"pattern": "^(>=|<|>|<=)?([0-9]+)(\\.[0-9]+)?(\\.[0-9])?$"
}, },
"plugins": { "plugins": {
"type": "array", "type": "array",
@ -270,8 +275,7 @@
}, },
"url": { "url": {
"type": "string", "type": "string",
"description": "For data source plugins. Route URL is where the request is proxied to.", "description": "For data source plugins. Route URL is where the request is proxied to."
"format": "uri"
}, },
"reqSignedIn": { "reqSignedIn": {
"type": "boolean" "type": "boolean"