5.20.3 Add dashboard definition
- Description
-
This API creates a new dashboard with the dashboard definition object specified in the parameter.
Dashboard definition objects can be get in the Get Dashboard Definition API and the definitions can optionally be edited before specifying them in the parameters. For example, if you are restoring a definition from another host, you might need to modify SID included in the definition.
Id and owner members of the dashboard definition object are not used when specified. The value of ID (the value of id member) is newly numbered in JP1/IM - Manager and the owner (the value of owner member) is JP1 username that performed the additional dashboard-definition API. In addition, the dashboard refresh date and time is the date and time when you performed the Add Dashboard Definition API.
For details about dashboard definition objects, see 7.2.6(1) Dashboard Definition Object.
- Execution permissions
-
-
JP1_Console_Admin
-
JP1_Console_Operator
-
JP1_Console_User
-
- API version
-
v1
- Format
-
- Request line
POST /application/component/apiVersion/dashboard/uis httpVersion
- Request header
-
Follow the request header in 5.2.3 Request format.
- Request message body
dashboard-definition-object
- Response message body
dashboard-definition-object
- Parameters
-
For details about the dashboard definition object for the message body of a request, see 7.2.6(1) Dashboard Definition Object.
- Status codes
-
The following table lists the status codes returned in response to requests.
Status code
Messages that are output
Description
200
--
API operation was successful.
400
KAJY12009-E
The specified dashboard definition is invalid.
500
KAJY12010-E
Failed to add dashboard.
- Return values
-
-
When the status code is 200
For details about the dashboard definition object for the message body of the response, see 7.2.6(1) Dashboard Definition Object.
-
When the status code is other than 200
The exception object in the response format described in 5.2.6 Error response message is returned in the message body of the response.
-
- Examples
-
- Request:
POST http://immhost01:20703/im/api/v1/dashboard/uis { "id": 1, "title": "Weekly Report", "memo": "{\"sid\":\"_ROOT_AllSystems/_HOST_HISOL8150143/_CATEGORY_otherApplications/_OBJECT_JP1BASETRAP\"}", "data": "{\"cols\":4, \"panels\":[{\"title\":\"CPU usage\",\"type\":\"trend\",\"options\":{\"y\":{\"sidPattern\":[\"_ROOT_AllSystems/_SYSTEM_systemA/_HOST_HISOL8152841/_CATEGORY_platform/_OBJECT_JP1PC-AWindows%20metric%20collector%28Windows%20exporter%29\"],\"metric\":\"cpu_used_rate\",\"type\":\"line\",\"legend\":\"bottom\",\"fill\":false,\"stacked\":false,\"grid\":true,\"min\":null,\"max\":null,\"pointRadius\":1,\"plot\":60,\"approximate\":true}},\"id\":\"3568cefa-b672-4b14-b847-263d7d065506\",\"x\":0,\"y\":0,\"w\":1,\"h\":1,\"i\":\"0\",\"moved\":false,\"static\":false}]}", "owner": "jp1test", "scope": "protected", "createTime": 1710566717, "updateTime": 1711679379 }- Response:
< HTTP/1.1 200 OK < Content-Type: application/json { "id": 20, "title": "Weekly Report", "memo": "{\"sid\":\"_ROOT_AllSystems/_HOST_HISOL8150143/_CATEGORY_otherApplications/_OBJECT_JP1BASETRAP\"}", "data": "{\"cols\":4, \"panels\":[{\"title\":\"CPU usage\",\"type\":\"trend\",\"options\":{\"y\":{\"sidPattern\":[\"_ROOT_AllSystems/_SYSTEM_systemA/_HOST_HISOL8152841/_CATEGORY_platform/_OBJECT_JP1PC-AWindows%20metric%20collector%28Windows%20exporter%29\"],\"metric\":\"cpu_used_rate\",\"type\":\"line\",\"legend\":\"bottom\",\"fill\":false,\"stacked\":false,\"grid\":true,\"min\":null,\"max\":null,\"pointRadius\":1,\"plot\":60,\"approximate\":true}},\"id\":\"3568cefa-b672-4b14-b847-263d7d065506\",\"x\":0,\"y\":0,\"w\":1,\"h\":1,\"i\":\"0\",\"moved\":false,\"static\":false}]}", "owner": "jp1user1", "scope": "protected", "createTime": 1711870802, "updateTime": 1711870802 }