openapi: 3.2.0 info: description: 'The Grafana backend exposes an HTTP API, the same API is used by the frontend to do everything from saving dashboards, creating users and updating data sources.' title: Grafana HTTP API. Convert Prometheus API contact: name: Grafana Labs url: https://grafana.com email: hello@grafana.com version: 0.0.1 servers: - url: /api security: - basic: [] - api_key: [] tags: - name: convert_prometheus paths: /convert/api/prom/rules: get: tags: - convert_prometheus summary: Gets all Grafana-managed alert rules that were imported from… operationId: RouteConvertPrometheusCortexGetRules responses: '200': description: PrometheusNamespace content: application/yaml: schema: $ref: '#/components/schemas/PrometheusNamespace' '403': description: ForbiddenError content: application/yaml: schema: $ref: '#/components/schemas/ForbiddenError' '404': description: NotFound content: application/yaml: schema: $ref: '#/components/schemas/NotFound' post: tags: - convert_prometheus summary: Converts the submitted rule groups into Grafana-Managed Rules operationId: RouteConvertPrometheusCortexPostRuleGroups responses: '202': description: ConvertPrometheusResponse content: application/json: schema: $ref: '#/components/schemas/ConvertPrometheusResponse' '403': description: ForbiddenError content: application/json: schema: $ref: '#/components/schemas/ForbiddenError' /convert/api/prom/rules/{NamespaceTitle}: get: tags: - convert_prometheus summary: Gets Grafana-managed alert rules that were imported from Prometheus-compatible… operationId: RouteConvertPrometheusCortexGetNamespace parameters: - name: NamespaceTitle in: path required: true schema: type: string responses: '200': description: PrometheusNamespace content: application/yaml: schema: $ref: '#/components/schemas/PrometheusNamespace' '403': description: ForbiddenError content: application/yaml: schema: $ref: '#/components/schemas/ForbiddenError' '404': description: NotFound content: application/yaml: schema: $ref: '#/components/schemas/NotFound' post: description: 'If the group already exists and was not imported from a Prometheus-compatible source initially, it will not be replaced and an error will be returned.' tags: - convert_prometheus summary: Converts a Prometheus rule group into a Grafana rule group and creates or… operationId: RouteConvertPrometheusCortexPostRuleGroup parameters: - name: NamespaceTitle in: path required: true schema: type: string - name: x-grafana-alerting-datasource-uid in: header schema: type: string - name: x-grafana-alerting-recording-rules-paused in: header schema: type: boolean - name: x-grafana-alerting-alert-rules-paused in: header schema: type: boolean - name: x-grafana-alerting-target-datasource-uid in: header schema: type: string - name: x-grafana-alerting-folder-uid in: header schema: type: string - name: x-grafana-alerting-notification-settings in: header schema: type: string responses: '202': description: ConvertPrometheusResponse content: application/json: schema: $ref: '#/components/schemas/ConvertPrometheusResponse' '403': description: ForbiddenError content: application/json: schema: $ref: '#/components/schemas/ForbiddenError' x-raw-request: 'true' requestBody: content: application/yaml: schema: $ref: '#/components/schemas/PrometheusRuleGroup' delete: tags: - convert_prometheus summary: Deletes all rule groups that were imported from Prometheus-compatible sources… operationId: RouteConvertPrometheusCortexDeleteNamespace parameters: - name: NamespaceTitle in: path required: true schema: type: string responses: '202': description: ConvertPrometheusResponse content: application/json: schema: $ref: '#/components/schemas/ConvertPrometheusResponse' '403': description: ForbiddenError content: application/json: schema: $ref: '#/components/schemas/ForbiddenError' /convert/api/prom/rules/{NamespaceTitle}/{Group}: get: tags: - convert_prometheus summary: Gets a single rule group in Prometheus-compatible format if it was imported… operationId: RouteConvertPrometheusCortexGetRuleGroup parameters: - name: NamespaceTitle in: path required: true schema: type: string - name: Group in: path required: true schema: type: string responses: '200': description: PrometheusRuleGroup content: application/yaml: schema: $ref: '#/components/schemas/PrometheusRuleGroup' '403': description: ForbiddenError content: application/yaml: schema: $ref: '#/components/schemas/ForbiddenError' '404': description: NotFound content: application/yaml: schema: $ref: '#/components/schemas/NotFound' delete: tags: - convert_prometheus summary: Deletes a specific rule group if it was imported from a Prometheus-compatible… operationId: RouteConvertPrometheusCortexDeleteRuleGroup parameters: - name: NamespaceTitle in: path required: true schema: type: string - name: Group in: path required: true schema: type: string responses: '202': description: ConvertPrometheusResponse content: application/json: schema: $ref: '#/components/schemas/ConvertPrometheusResponse' '403': description: ForbiddenError content: application/json: schema: $ref: '#/components/schemas/ForbiddenError' /convert/prometheus/config/v1/rules: get: tags: - convert_prometheus summary: Gets all Grafana-managed alert rules that were imported from… operationId: RouteConvertPrometheusGetRules responses: '200': description: PrometheusNamespace content: application/yaml: schema: $ref: '#/components/schemas/PrometheusNamespace' '403': description: ForbiddenError content: application/yaml: schema: $ref: '#/components/schemas/ForbiddenError' '404': description: NotFound content: application/yaml: schema: $ref: '#/components/schemas/NotFound' post: tags: - convert_prometheus summary: Converts the submitted rule groups into Grafana-Managed Rules operationId: RouteConvertPrometheusPostRuleGroups responses: '202': description: ConvertPrometheusResponse content: application/json: schema: $ref: '#/components/schemas/ConvertPrometheusResponse' '403': description: ForbiddenError content: application/json: schema: $ref: '#/components/schemas/ForbiddenError' /convert/prometheus/config/v1/rules/{NamespaceTitle}: get: tags: - convert_prometheus summary: Gets Grafana-managed alert rules that were imported from Prometheus-compatible… operationId: RouteConvertPrometheusGetNamespace parameters: - name: NamespaceTitle in: path required: true schema: type: string responses: '200': description: PrometheusNamespace content: application/yaml: schema: $ref: '#/components/schemas/PrometheusNamespace' '403': description: ForbiddenError content: application/yaml: schema: $ref: '#/components/schemas/ForbiddenError' '404': description: NotFound content: application/yaml: schema: $ref: '#/components/schemas/NotFound' post: description: 'If the group already exists and was not imported from a Prometheus-compatible source initially, it will not be replaced and an error will be returned.' tags: - convert_prometheus summary: Converts a Prometheus rule group into a Grafana rule group and creates or… operationId: RouteConvertPrometheusPostRuleGroup parameters: - name: NamespaceTitle in: path required: true schema: type: string - name: x-grafana-alerting-datasource-uid in: header schema: type: string - name: x-grafana-alerting-recording-rules-paused in: header schema: type: boolean - name: x-grafana-alerting-alert-rules-paused in: header schema: type: boolean - name: x-grafana-alerting-target-datasource-uid in: header schema: type: string - name: x-grafana-alerting-folder-uid in: header schema: type: string - name: x-grafana-alerting-notification-settings in: header schema: type: string responses: '202': description: ConvertPrometheusResponse content: application/json: schema: $ref: '#/components/schemas/ConvertPrometheusResponse' '403': description: ForbiddenError content: application/json: schema: $ref: '#/components/schemas/ForbiddenError' x-raw-request: 'true' requestBody: content: application/yaml: schema: $ref: '#/components/schemas/PrometheusRuleGroup' delete: tags: - convert_prometheus summary: Deletes all rule groups that were imported from Prometheus-compatible sources… operationId: RouteConvertPrometheusDeleteNamespace parameters: - name: NamespaceTitle in: path required: true schema: type: string responses: '202': description: ConvertPrometheusResponse content: application/json: schema: $ref: '#/components/schemas/ConvertPrometheusResponse' '403': description: ForbiddenError content: application/json: schema: $ref: '#/components/schemas/ForbiddenError' /convert/prometheus/config/v1/rules/{NamespaceTitle}/{Group}: get: tags: - convert_prometheus summary: Gets a single rule group in Prometheus-compatible format if it was imported… operationId: RouteConvertPrometheusGetRuleGroup parameters: - name: NamespaceTitle in: path required: true schema: type: string - name: Group in: path required: true schema: type: string responses: '200': description: PrometheusRuleGroup content: application/yaml: schema: $ref: '#/components/schemas/PrometheusRuleGroup' '403': description: ForbiddenError content: application/yaml: schema: $ref: '#/components/schemas/ForbiddenError' '404': description: NotFound content: application/yaml: schema: $ref: '#/components/schemas/NotFound' delete: tags: - convert_prometheus summary: Deletes a specific rule group if it was imported from a Prometheus-compatible… operationId: RouteConvertPrometheusDeleteRuleGroup parameters: - name: NamespaceTitle in: path required: true schema: type: string - name: Group in: path required: true schema: type: string responses: '202': description: ConvertPrometheusResponse content: application/json: schema: $ref: '#/components/schemas/ConvertPrometheusResponse' '403': description: ForbiddenError content: application/json: schema: $ref: '#/components/schemas/ForbiddenError' components: schemas: PrometheusRuleGroup: type: object properties: interval: $ref: '#/components/schemas/Duration' labels: type: object additionalProperties: type: string limit: type: integer format: int64 name: type: string query_offset: type: string rules: type: array items: $ref: '#/components/schemas/PrometheusRule' Duration: description: 'A Duration represents the elapsed time between two instants as an int64 nanosecond count. The representation limits the largest representable duration to approximately 290 years.' type: integer format: int64 NotFound: type: object ForbiddenError: type: object properties: body: $ref: '#/components/schemas/PublicError' ConvertPrometheusResponse: type: object properties: error: type: string errorType: type: string status: type: string PrometheusNamespace: type: object properties: Body: description: 'in: body' type: object additionalProperties: type: array items: $ref: '#/components/schemas/PrometheusRuleGroup' PrometheusRule: type: object properties: alert: type: string annotations: type: object additionalProperties: type: string expr: type: string for: type: string keep_firing_for: type: string labels: type: object additionalProperties: type: string record: type: string PublicError: description: 'PublicError is derived from Error and only contains information available to the end user.' type: object properties: extra: type: object additionalProperties: {} message: type: string messageId: type: string statusCode: type: integer format: int64 securitySchemes: api_key: type: apiKey name: Authorization in: header basic: type: http scheme: basic