Open Context Protocol is live! 🚀 Read the launch post

getAllGadgets

Get gadgets

Details

  • Method: GET
  • Path: /rest/api/3/dashboard/{dashboardId}/gadget
  • Operation ID: getAllGadgets

Parameters

{
  "dashboardId": {
    "description": "The ID of the dashboard.",
    "required": true,
    "location": "path",
    "type": "integer",
    "format": "int64"
  },
  "moduleKey": {
    "description": "The list of gadgets module keys. To include multiple module keys, separate module keys with ampersand: `moduleKey=key:one&moduleKey=key:two`.",
    "required": false,
    "location": "query",
    "type": "array"
  },
  "uri": {
    "description": "The list of gadgets URIs. To include multiple URIs, separate URIs with ampersand: `uri=/rest/example/uri/1&uri=/rest/example/uri/2`.",
    "required": false,
    "location": "query",
    "type": "array"
  },
  "gadgetId": {
    "description": "The list of gadgets IDs. To include multiple IDs, separate IDs with ampersand: `gadgetId=10000&gadgetId=10001`.",
    "required": false,
    "location": "query",
    "type": "array"
  }
}

Response Schema

{
  "additionalProperties": false,
  "description": "The list of gadgets on the dashboard.",
  "properties": {
    "gadgets": {
      "description": "The list of gadgets.",
      "items": {
        "additionalProperties": false,
        "description": "Details of a gadget.",
        "properties": {
          "color": {
            "description": "The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`.",
            "enum": [
              "blue",
              "red",
              "yellow",
              "green",
              "cyan",
              "purple",
              "gray",
              "white"
            ],
            "readOnly": true,
            "type": "string"
          },
          "id": {
            "description": "The ID of the gadget instance.",
            "format": "int64",
            "readOnly": true,
            "type": "integer"
          },
          "moduleKey": {
            "description": "The module key of the gadget type.",
            "readOnly": true,
            "type": "string"
          },
          "position": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DashboardGadgetPosition"
              }
            ],
            "description": "The position of the gadget.",
            "readOnly": true
          },
          "title": {
            "description": "The title of the gadget.",
            "readOnly": true,
            "type": "string"
          },
          "uri": {
            "description": "The URI of the gadget type.",
            "readOnly": true,
            "type": "string"
          }
        },
        "required": [
          "color",
          "id",
          "position",
          "title"
        ],
        "type": "object"
      },
      "readOnly": true,
      "type": "array"
    }
  },
  "required": [
    "gadgets"
  ],
  "type": "object"
}

Usage

from ocp_agent import OCPAgent

agent = OCPAgent()
await agent.register_api('jira')

# Call this tool
result = await agent.call_tool('getAllGadgets', {
    # Add required parameters here
})