{
  "$schema": "https://raw.githubusercontent.com/grafana/grafana/main/docs/sources/developers/plugins/plugin.schema.json",
  "type": "app",
  "name": "Grafana OnCall",
  "id": "grafana-oncall-app",
  "preload": true,
  "backend": true,
  "executable": "gpx_grafana_oncall_app",
  "info": {
    "description": "Collect and analyze alerts, escalate based on schedules and deliver them to Slack, Phone Calls, SMS and others",
    "author": {
      "name": "Grafana Labs",
      "url": "https://grafana.com"
    },
    "keywords": ["oncall", "irm", "incident", "response"],
    "logos": {
      "small": "assets/img/logo.svg",
      "large": "assets/img/logo.svg"
    },
    "links": [
      {
        "name": "Website",
        "url": "https://github.com/grafana/oncall"
      },
      {
        "name": "License",
        "url": "https://github.com/grafana/oncall/blob/main/LICENSE"
      }
    ],
    "screenshots": [{ "name": "Escalation chain", "path": "assets/img/screenshot.png" }],
    "version": "%VERSION%",
    "updated": "%TODAY%"
  },
  "includes": [
    {
      "type": "page",
      "name": "Home",
      "path": "/a/grafana-oncall-app",
      "role": "Viewer",
      "action": "grafana-oncall-app.alert-groups:read",
      "defaultNav": true,
      "addToNav": true
    },
    {
      "type": "page",
      "name": "Alert groups",
      "path": "/a/grafana-oncall-app/alert-groups",
      "role": "Viewer",
      "action": "grafana-oncall-app.alert-groups:read",
      "addToNav": true
    },
    {
      "type": "page",
      "name": "Users",
      "path": "/a/grafana-oncall-app/users",
      "role": "Viewer",
      "action": "grafana-oncall-app.user-settings:read",
      "addToNav": true
    },
    {
      "type": "page",
      "name": "Integrations",
      "path": "/a/grafana-oncall-app/integrations?tab=monitoring-systems",
      "role": "Viewer",
      "action": "grafana-oncall-app.integrations:read",
      "addToNav": true
    },
    {
      "type": "page",
      "name": "Escalation chains",
      "path": "/a/grafana-oncall-app/escalations",
      "role": "Viewer",
      "action": "grafana-oncall-app.escalation-chains:read",
      "addToNav": true
    },
    {
      "type": "page",
      "name": "Schedules",
      "path": "/a/grafana-oncall-app/schedules",
      "role": "Viewer",
      "action": "grafana-oncall-app.schedules:read",
      "addToNav": true
    },
    {
      "type": "page",
      "name": "Outgoing webhooks",
      "path": "/a/grafana-oncall-app/outgoing_webhooks",
      "role": "Viewer",
      "action": "grafana-oncall-app.outgoing-webhooks:read",
      "addToNav": true
    },
    {
      "type": "page",
      "name": "Insights",
      "path": "/a/grafana-oncall-app/insights",
      "role": "Viewer",
      "action": "grafana-oncall-app.other-settings:read",
      "addToNav": true
    },
    {
      "type": "page",
      "name": "Settings",
      "path": "/a/grafana-oncall-app/settings",
      "role": "Viewer",
      "action": "grafana-oncall-app.other-settings:read",
      "addToNav": true
    },
    {
      "type": "dashboard",
      "path": "dashboards/oncall_metrics_dashboard.json",
      "name": "OnCall Insights"
    }
  ],
  "routes": [
    {
      "path": "api/internal/v1/*",
      "method": "*",
      "url": "{{ .JsonData.onCallApiUrl }}/api/internal/v1/",
      "headers": [
        {
          "name": "X-Instance-Context",
          "content": "{ \"stack_id\": \"{{ printf \"%.0f\" .JsonData.stackId }}\", \"org_id\": \"{{ printf \"%.0f\" .JsonData.orgId }}\", \"grafana_token\": \"{{ .SecureJsonData.grafanaToken }}\" }"
        },
        {
          "name": "Authorization",
          "content": "{{ .SecureJsonData.onCallApiToken }}"
        }
      ]
    }
  ],
  "roles": [
    {
      "role": {
        "name": "Admin",
        "description": "Read/write access to everything in OnCall",
        "permissions": [
          { "action": "plugins.app:access", "scope": "plugins:id:grafana-oncall-app" },

          { "action": "grafana-oncall-app.alert-groups:read" },
          { "action": "grafana-oncall-app.alert-groups:write" },
          { "action": "grafana-oncall-app.alert-groups:direct-paging" },

          { "action": "grafana-oncall-app.integrations:read" },
          { "action": "grafana-oncall-app.integrations:write" },
          { "action": "grafana-oncall-app.integrations:test" },

          { "action": "grafana-oncall-app.escalation-chains:read" },
          { "action": "grafana-oncall-app.escalation-chains:write" },

          { "action": "grafana-oncall-app.schedules:read" },
          { "action": "grafana-oncall-app.schedules:write" },
          { "action": "grafana-oncall-app.schedules:export" },

          { "action": "grafana-oncall-app.chatops:read" },
          { "action": "grafana-oncall-app.chatops:write" },
          { "action": "grafana-oncall-app.chatops:update-settings" },

          { "action": "grafana-oncall-app.outgoing-webhooks:read" },
          { "action": "grafana-oncall-app.outgoing-webhooks:write" },

          { "action": "grafana-oncall-app.maintenance:read" },
          { "action": "grafana-oncall-app.maintenance:write" },

          { "action": "grafana-oncall-app.api-keys:read" },
          { "action": "grafana-oncall-app.api-keys:write" },

          { "action": "grafana-oncall-app.notifications:read" },

          { "action": "grafana-oncall-app.notification-settings:read" },
          { "action": "grafana-oncall-app.notification-settings:write" },

          { "action": "grafana-oncall-app.user-settings:read" },
          { "action": "grafana-oncall-app.user-settings:write" },
          { "action": "grafana-oncall-app.user-settings:admin" },

          { "action": "grafana-oncall-app.other-settings:read" },
          { "action": "grafana-oncall-app.other-settings:write" },

          { "action": "grafana-oncall-app.admin:admin" }
        ]
      },
      "grants": ["Grafana Admin", "Admin"]
    },
    {
      "role": {
        "name": "Editor",
        "description": "Similar to the Admin role, minus the abilities to: create Integrations, create Escalation Chains, create Outgoing Webhooks, update ChatOps settings, update other user's settings, and update general OnCall setings.",
        "permissions": [
          { "action": "plugins.app:access", "scope": "plugins:id:grafana-oncall-app" },

          { "action": "grafana-oncall-app.alert-groups:read" },
          { "action": "grafana-oncall-app.alert-groups:write" },
          { "action": "grafana-oncall-app.alert-groups:direct-paging" },

          { "action": "grafana-oncall-app.integrations:read" },
          { "action": "grafana-oncall-app.integrations:test" },

          { "action": "grafana-oncall-app.escalation-chains:read" },

          { "action": "grafana-oncall-app.schedules:read" },
          { "action": "grafana-oncall-app.schedules:write" },
          { "action": "grafana-oncall-app.schedules:export" },

          { "action": "grafana-oncall-app.chatops:read" },
          { "action": "grafana-oncall-app.chatops:write" },

          { "action": "grafana-oncall-app.outgoing-webhooks:read" },

          { "action": "grafana-oncall-app.maintenance:read" },
          { "action": "grafana-oncall-app.maintenance:write" },

          { "action": "grafana-oncall-app.notifications:read" },

          { "action": "grafana-oncall-app.notification-settings:read" },
          { "action": "grafana-oncall-app.notification-settings:write" },

          { "action": "grafana-oncall-app.user-settings:read" },
          { "action": "grafana-oncall-app.user-settings:write" },

          { "action": "grafana-oncall-app.other-settings:read" }
        ]
      },
      "grants": ["Editor"]
    },
    {
      "role": {
        "name": "Reader",
        "description": "Read-only access to everything in OnCall",
        "permissions": [
          { "action": "plugins.app:access", "scope": "plugins:id:grafana-oncall-app" },

          { "action": "grafana-oncall-app.alert-groups:read" },
          { "action": "grafana-oncall-app.integrations:read" },
          { "action": "grafana-oncall-app.escalation-chains:read" },
          { "action": "grafana-oncall-app.schedules:read" },
          { "action": "grafana-oncall-app.chatops:read" },
          { "action": "grafana-oncall-app.outgoing-webhooks:read" },
          { "action": "grafana-oncall-app.maintenance:read" },
          { "action": "grafana-oncall-app.notification-settings:read" },
          { "action": "grafana-oncall-app.user-settings:read" },
          { "action": "grafana-oncall-app.other-settings:read" }
        ]
      },
      "grants": ["Viewer"]
    },
    {
      "role": {
        "name": "Notifications Receiver",
        "description": "Grants the ability to receive OnCall alert notifications. By virtue, also grants the user the ability to edit their own OnCall settings.",
        "permissions": [
          { "action": "plugins.app:access", "scope": "plugins:id:grafana-oncall-app" },
          { "action": "grafana-oncall-app.notifications:read" },
          { "action": "grafana-oncall-app.user-settings:read" },
          { "action": "grafana-oncall-app.user-settings:write" }
        ]
      },
      "grants": []
    },
    {
      "role": {
        "name": "OnCaller",
        "description": "Grants read access to everything in OnCall. In addition, grants edit access to Alert Groups, Schedules and own settings",
        "permissions": [
          { "action": "plugins.app:access", "scope": "plugins:id:grafana-oncall-app" },

          { "action": "grafana-oncall-app.alert-groups:read" },
          { "action": "grafana-oncall-app.alert-groups:write" },
          { "action": "grafana-oncall-app.alert-groups:direct-paging" },

          { "action": "grafana-oncall-app.integrations:read" },
          { "action": "grafana-oncall-app.escalation-chains:read" },

          { "action": "grafana-oncall-app.schedules:read" },
          { "action": "grafana-oncall-app.schedules:write" },

          { "action": "grafana-oncall-app.chatops:read" },
          { "action": "grafana-oncall-app.outgoing-webhooks:read" },
          { "action": "grafana-oncall-app.maintenance:read" },
          { "action": "grafana-oncall-app.notifications:read" },
          { "action": "grafana-oncall-app.notification-settings:read" },
          { "action": "grafana-oncall-app.user-settings:read" },
          { "action": "grafana-oncall-app.user-settings:write" },
          { "action": "grafana-oncall-app.other-settings:read" }
        ]
      },
      "grants": []
    },
    {
      "role": {
        "name": "Alert Groups Reader",
        "description": "Read-only access to OnCall Alert Groups",
        "permissions": [
          { "action": "plugins.app:access", "scope": "plugins:id:grafana-oncall-app" },
          { "action": "grafana-oncall-app.alert-groups:read" }
        ]
      },
      "grants": []
    },
    {
      "role": {
        "name": "Alert Groups Editor",
        "description": "Read access to OnCall Alert Groups + ability to act on Alert Groups (ie. ack, resolve, etc)",
        "permissions": [
          { "action": "plugins.app:access", "scope": "plugins:id:grafana-oncall-app" },
          { "action": "grafana-oncall-app.alert-groups:read" },
          { "action": "grafana-oncall-app.alert-groups:write" }
        ]
      },
      "grants": []
    },
    {
      "role": {
        "name": "Alert Groups Direct Paging",
        "description": "Grants the ability to be able to manually create new Alert Groups (aka Direct Paging)",
        "permissions": [
          { "action": "plugins.app:access", "scope": "plugins:id:grafana-oncall-app" },
          { "action": "grafana-oncall-app.alert-groups:direct-paging" }
        ]
      },
      "grants": []
    },
    {
      "role": {
        "name": "Integrations Reader",
        "description": "Read-only access to OnCall Integrations",
        "permissions": [
          { "action": "plugins.app:access", "scope": "plugins:id:grafana-oncall-app" },
          { "action": "grafana-oncall-app.integrations:read" }
        ]
      },
      "grants": []
    },
    {
      "role": {
        "name": "Integrations Editor",
        "description": "Read/write access to OnCall Integrations",
        "permissions": [
          { "action": "plugins.app:access", "scope": "plugins:id:grafana-oncall-app" },
          { "action": "grafana-oncall-app.integrations:read" },
          { "action": "grafana-oncall-app.integrations:write" },
          { "action": "grafana-oncall-app.integrations:test" }
        ]
      },
      "grants": []
    },
    {
      "role": {
        "name": "Escalation Chains Reader",
        "description": "Read-only access to OnCall Escalation Chains",
        "permissions": [
          { "action": "plugins.app:access", "scope": "plugins:id:grafana-oncall-app" },
          { "action": "grafana-oncall-app.escalation-chains:read" }
        ]
      },
      "grants": []
    },
    {
      "role": {
        "name": "Escalation Chains Editor",
        "description": "Read/write access to OnCall Escalation Chains",
        "permissions": [
          { "action": "plugins.app:access", "scope": "plugins:id:grafana-oncall-app" },
          { "action": "grafana-oncall-app.escalation-chains:read" },
          { "action": "grafana-oncall-app.escalation-chains:write" }
        ]
      },
      "grants": []
    },
    {
      "role": {
        "name": "Schedules Reader",
        "description": "Read-only access to OnCall Schedules",
        "permissions": [
          { "action": "plugins.app:access", "scope": "plugins:id:grafana-oncall-app" },
          { "action": "grafana-oncall-app.schedules:read" }
        ]
      },
      "grants": []
    },
    {
      "role": {
        "name": "Schedules Editor",
        "description": "Read/write access to OnCall Schedules",
        "permissions": [
          { "action": "plugins.app:access", "scope": "plugins:id:grafana-oncall-app" },
          { "action": "grafana-oncall-app.schedules:read" },
          { "action": "grafana-oncall-app.schedules:write" },
          { "action": "grafana-oncall-app.schedules:export" }
        ]
      },
      "grants": []
    },
    {
      "role": {
        "name": "ChatOps Reader",
        "description": "Read-only access to OnCall ChatOps",
        "permissions": [
          { "action": "plugins.app:access", "scope": "plugins:id:grafana-oncall-app" },
          { "action": "grafana-oncall-app.chatops:read" }
        ]
      },
      "grants": []
    },
    {
      "role": {
        "name": "ChatOps Editor",
        "description": "Read/write access to OnCall ChatOps",
        "permissions": [
          { "action": "plugins.app:access", "scope": "plugins:id:grafana-oncall-app" },
          { "action": "grafana-oncall-app.chatops:read" },
          { "action": "grafana-oncall-app.chatops:write" },
          { "action": "grafana-oncall-app.chatops:update-settings" }
        ]
      },
      "grants": []
    },
    {
      "role": {
        "name": "Outgoing Webhooks Reader",
        "description": "Read-only access to OnCall Outgoing Webhooks",
        "permissions": [
          { "action": "plugins.app:access", "scope": "plugins:id:grafana-oncall-app" },
          { "action": "grafana-oncall-app.outgoing-webhooks:read" }
        ]
      },
      "grants": []
    },
    {
      "role": {
        "name": "Outgoing Webhooks Editor",
        "description": "Read/write access to OnCall Outgoing Webhooks",
        "permissions": [
          { "action": "plugins.app:access", "scope": "plugins:id:grafana-oncall-app" },
          { "action": "grafana-oncall-app.outgoing-webhooks:read" },
          { "action": "grafana-oncall-app.outgoing-webhooks:write" }
        ]
      },
      "grants": []
    },
    {
      "role": {
        "name": "Maintenance Reader",
        "description": "Read-only access to OnCall Maintenance",
        "permissions": [
          { "action": "plugins.app:access", "scope": "plugins:id:grafana-oncall-app" },
          { "action": "grafana-oncall-app.maintenance:read" }
        ]
      },
      "grants": []
    },
    {
      "role": {
        "name": "Maintenance Editor",
        "description": "Read/write access to OnCall Maintenance",
        "permissions": [
          { "action": "plugins.app:access", "scope": "plugins:id:grafana-oncall-app" },
          { "action": "grafana-oncall-app.maintenance:read" },
          { "action": "grafana-oncall-app.maintenance:write" }
        ]
      },
      "grants": []
    },
    {
      "role": {
        "name": "API Keys Reader",
        "description": "Read-only access to OnCall API Keys",
        "permissions": [
          { "action": "plugins.app:access", "scope": "plugins:id:grafana-oncall-app" },
          { "action": "grafana-oncall-app.api-keys:read" }
        ]
      },
      "grants": []
    },
    {
      "role": {
        "name": "API Keys Editor",
        "description": "Read/write access to OnCall API Keys. Also grants access to be able to consume the API.",
        "permissions": [
          { "action": "plugins.app:access", "scope": "plugins:id:grafana-oncall-app" },
          { "action": "grafana-oncall-app.api-keys:read" },
          { "action": "grafana-oncall-app.api-keys:write" }
        ]
      },
      "grants": []
    },
    {
      "role": {
        "name": "Notification Settings Reader",
        "description": "Read-only access to OnCall Notification Settings",
        "permissions": [
          { "action": "plugins.app:access", "scope": "plugins:id:grafana-oncall-app" },
          { "action": "grafana-oncall-app.notification-settings:read" }
        ]
      },
      "grants": []
    },
    {
      "role": {
        "name": "Notification Settings Editor",
        "description": "Read/write access to OnCall Notification Settings",
        "permissions": [
          { "action": "plugins.app:access", "scope": "plugins:id:grafana-oncall-app" },
          { "action": "grafana-oncall-app.notification-settings:read" },
          { "action": "grafana-oncall-app.notification-settings:write" }
        ]
      },
      "grants": []
    },
    {
      "role": {
        "name": "User Settings Reader",
        "description": "Read-only access to own OnCall User Settings",
        "permissions": [
          { "action": "plugins.app:access", "scope": "plugins:id:grafana-oncall-app" },
          { "action": "grafana-oncall-app.user-settings:read" }
        ]
      },
      "grants": []
    },
    {
      "role": {
        "name": "User Settings Editor",
        "description": "Read/write access to own OnCall User Settings + ability to view basic information about other OnCall users",
        "permissions": [
          { "action": "plugins.app:access", "scope": "plugins:id:grafana-oncall-app" },
          { "action": "grafana-oncall-app.user-settings:read" },
          { "action": "grafana-oncall-app.user-settings:write" }
        ]
      },
      "grants": []
    },
    {
      "role": {
        "name": "User Settings Admin",
        "description": "Read/write access to your own, plus other's OnCall User Settings",
        "permissions": [
          { "action": "plugins.app:access", "scope": "plugins:id:grafana-oncall-app" },
          { "action": "grafana-oncall-app.user-settings:read" },
          { "action": "grafana-oncall-app.user-settings:write" },
          { "action": "grafana-oncall-app.user-settings:admin" }
        ]
      },
      "grants": []
    },
    {
      "role": {
        "name": "Settings Reader",
        "description": "Read-only access to OnCall Settings",
        "permissions": [
          { "action": "plugins.app:access", "scope": "plugins:id:grafana-oncall-app" },
          { "action": "grafana-oncall-app.other-settings:read" }
        ]
      },
      "grants": []
    },
    {
      "role": {
        "name": "Settings Editor",
        "description": "Read/write access to OnCall Settings",
        "permissions": [
          { "action": "plugins.app:access", "scope": "plugins:id:grafana-oncall-app" },
          { "action": "grafana-oncall-app.other-settings:read" },
          { "action": "grafana-oncall-app.other-settings:write" }
        ]
      },
      "grants": []
    }
  ],
  "iam": {
    "permissions": [
      {
        "action": "alert.notifications:read"
      },
      {
        "action": "alert.notifications:write"
      },
      {
        "action": "dashboards:create",
        "scope": "folders:*"
      },
      {
        "action": "dashboards:read",
        "scope": "dashboards:*"
      },
      {
        "action": "dashboards:write",
        "scope": "dashboards:*"
      },
      {
        "action": "datasources:read",
        "scope": "datasources:*"
      },
      {
        "action": "folders:read",
        "scope": "folders:*"
      },
      {
        "action": "folders:write",
        "scope": "folders:*"
      },
      {
        "action": "org.users:read",
        "scope": "users:*"
      },
      {
        "action": "orgs:read"
      },
      {
        "action": "plugins.app:access",
        "scope": "plugins:id:grafana-oncall-app"
      },
      {
        "action": "plugins.app:access",
        "scope": "plugins:id:grafana-incident-app"
      },
      {
        "action": "plugins.app:access",
        "scope": "plugins:id:grafana-labels-app"
      },
      {
        "action": "plugins.app:access",
        "scope": "plugins:id:grafana-ml-app"
      },
      {
        "action": "plugins:write",
        "scope": "plugins:id:grafana-oncall-app"
      },
      {
        "action": "roles:read",
        "scope": "roles:*"
      },
      {
        "action": "status:accesscontrol",
        "scope": "services:accesscontrol"
      },
      {
        "action": "serviceaccounts:create"
      },
      {
        "action": "serviceaccounts:delete",
        "scope": "serviceaccounts:*"
      },
      {
        "action": "serviceaccounts:permissions:read",
        "scope": "serviceaccounts:*"
      },
      {
        "action": "serviceaccounts:permissions:write",
        "scope": "serviceaccounts:*"
      },
      {
        "action": "serviceaccounts:read",
        "scope": "serviceaccounts:*"
      },
      {
        "action": "serviceaccounts:write",
        "scope": "serviceaccounts:*"
      },
      {
        "action": "teams:read",
        "scope": "teams:*"
      },
      {
        "action": "teams.permissions:read",
        "scope": "teams:*"
      },
      {
        "action": "teams.roles:read",
        "scope": "teams:*"
      },
      {
        "action": "users:read",
        "scope": "global.users:*"
      },
      {
        "action": "users.permissions:read",
        "scope": "users:id:*"
      },
      {
        "action": "users.roles:read",
        "scope": "users:*"
      },
      { "action": "grafana-labels-app.label:read" },
      { "action": "grafana-labels-app.label:write" },
      { "action": "grafana-labels-app.label:create" },
      { "action": "grafana-labels-app.label:delete" }
    ]
  },
  "dependencies": {
    "grafanaDependency": ">=10.2.5",
    "plugins": []
  },
  "extensions": [
    {
      "extensionPointId": "grafana/user/profile/tab",
      "title": "IRM",
      "description": "IRM settings",
      "type": "component"
    }
  ]
}
