Docs: sync plugin JSON info in the different files (first part) (#63750)

This commit is contained in:
Andres Martinez Gotor
2023-03-07 09:14:51 +01:00
committed by GitHub
parent bceb1bb96d
commit c67bb07968
4 changed files with 184 additions and 178 deletions

View File

@ -16,12 +16,12 @@ The plugin.json file is required for all plugins. When Grafana starts, it scans
| Property | Type | Required | Description |
| -------------------- | ----------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `dependencies` | [object](#dependencies) | **Yes** | Dependencies needed by the plugin. |
| `id` | string | **Yes** | Unique name of the plugin. If the plugin is published on grafana.com, then the plugin id has to follow the naming conventions. |
| `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. |
| `id` | string | **Yes** | Unique name of the plugin. If the plugin is published on grafana.com, then the plugin `id` should follow the Grafana naming convention. |
| `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`, `panel`. |
| `$schema` | string | No | Schema definition for the plugin.json file. |
| `type` | string | **Yes** | Plugin type. Possible values are: `app`, `datasource`, `panel`, `renderer`, `secretsmanager`. |
| `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. |
| `dependencies` | [object](#dependencies) | **Yes** | Dependency information related to Grafana and other plugins. |
| `$schema` | string | No | Schema definition for the plugin.json file. Used primarily for schema validation. |
| `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. |
| `autoEnabled` | boolean | No | Set to true for app plugins that should be enabled by default in all orgs |

View File

@ -7,24 +7,68 @@
"required": ["type", "name", "id", "info", "dependencies"],
"additionalProperties": false,
"properties": {
"$schema": {
"type": "string",
"description": "Schema definition for the plugin.json file."
},
"id": {
"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]+\\-([0-9a-z]+\\-)?(app|panel|datasource|secretsmanager)$"
},
"type": {
"type": "string",
"description": "Plugin type.",
"enum": ["app", "datasource", "panel", "secretsmanager"]
"enum": ["app", "datasource", "panel", "renderer", "secretsmanager"]
},
"name": {
"type": "string",
"description": "Human-readable name of the plugin that is shown to the user in the UI."
},
"dependencies": {
"type": "object",
"description": "Dependency information related to Grafana and other plugins.",
"required": ["grafanaDependency"],
"additionalProperties": false,
"properties": {
"grafanaVersion": {
"type": "string",
"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-9]+)(\\.[0-9x]+)?(\\.[0-9x])?$"
},
"grafanaDependency": {
"type": "string",
"description": "Required Grafana version for this plugin. Validated using https://github.com/npm/node-semver.",
"pattern": "^(<=|>=|<|>|=|~|\\^)?([0-9]+)(\\.[0-9x\\*]+)(\\.[0-9x\\*]+)?(\\s(<=|>=|<|=>)?([0-9]+)(\\.[0-9x]+)(\\.[0-9x]+))?$"
},
"plugins": {
"type": "array",
"description": "An array of required plugins on which this plugin depends.",
"additionalItems": false,
"items": {
"type": "object",
"description": "Plugin dependency. Used to display information about plugin dependencies in the Grafana UI.",
"required": ["id", "name", "type", "version"],
"properties": {
"id": {
"type": "string",
"pattern": "^[0-9a-z]+\\-([0-9a-z]+\\-)?(app|panel|datasource|secretsmanager)$"
},
"type": {
"type": "string",
"enum": ["app", "datasource", "panel", "secretsmanager"]
},
"name": {
"type": "string"
},
"version": {
"type": "string"
}
}
}
}
}
},
"$schema": {
"type": "string",
"description": "Schema definition for the plugin.json file. Used primarily for schema validation."
},
"category": {
"type": "string",
"description": "Plugin category used on the Add data source page.",
@ -133,50 +177,6 @@
"type": "boolean",
"description": "Set to true for app plugins that should be enabled by default in all orgs"
},
"dependencies": {
"type": "object",
"description": "Dependencies needed by the plugin.",
"required": ["grafanaDependency"],
"additionalProperties": false,
"properties": {
"grafanaVersion": {
"type": "string",
"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-9]+)(\\.[0-9x]+)?(\\.[0-9x])?$"
},
"grafanaDependency": {
"type": "string",
"description": "Required Grafana version for this plugin. Validated using https://github.com/npm/node-semver.",
"pattern": "^(<=|>=|<|>|=|~|\\^)?([0-9]+)(\\.[0-9x\\*]+)(\\.[0-9x\\*]+)?(\\s(<=|>=|<|=>)?([0-9]+)(\\.[0-9x]+)(\\.[0-9x]+))?$"
},
"plugins": {
"type": "array",
"description": "An array of required plugins on which this plugin depends.",
"additionalItems": false,
"items": {
"type": "object",
"description": "Plugin dependency. Used to display information about plugin dependencies in the Grafana UI.",
"required": ["id", "name", "type", "version"],
"properties": {
"id": {
"type": "string",
"pattern": "^[0-9a-z]+\\-([0-9a-z]+\\-)?(app|panel|datasource|secretsmanager)$"
},
"type": {
"type": "string",
"enum": ["app", "datasource", "panel", "secretsmanager"]
},
"name": {
"type": "string"
},
"version": {
"type": "string"
}
}
}
}
}
},
"info": {
"type": "object",
"description": "Metadata for the plugin. Some fields are used on the plugins page in Grafana and others on grafana.com if the plugin is published.",