Update Report Template
Updates the specified report template.
HTTP Request
PUT /api/sonar/report-templates/:guid
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
-d name="Report template" \
-d description="Report template description" \
-d group_guid="b5bc3133-b53e-4b61-96b5-8857015a0ede" \
-d 'sections=[{"type":"PARAGRAPH","title":"Overview","query":"json \"{}\" | eval line=concat(\"The query execution history from\"$(\" from\"), \" to \", $(\"to\")","visible":true,"ordinal":0},{"type":"GRID","title":"Query execution per hour","query":"table from=$(\"from\") to=$(\"to\") araqne_query_logs | search isnotnull(duration) | timechart span=1h count","visible":true,"ordinal":1}]' \
-X PUT \
https://HOSTNAME/api/sonar/report-templates/e2fad16d-8076-4c91-9d69-9419c5e6d300
Request Parameters
Path Parameters
| Key | Type | Description | Note |
|---|---|---|---|
| guid | String | Report template GUID | 36 characters |
Request Body Parameters
| Key | Required | Type | Description | Note |
|---|---|---|---|---|
| name | O | String | Report template name | Minimum 1 to maximum 50 characters |
| description | X | String | Report template description | Maximum 2,000 characters |
| group_guid | X | String | Parent report group GUID | 36 characters |
| sections | O | Object Array | List of report sections | See sections object attributes below. |
sections object attributes
- type (String): Section type. One of
paragraph(paragraph),memo(memo),grid(grid),hbar(horizontal bar chart),hbar_stck(stacked horizontal bar chart),vbar(vertical bar chart),vbar_stck(stacked vertical bar chart),line(line chart),area_stacked(stacked area chart),pie(pie chart) - options (Map): Section options. See options object attributes below.
- title (String): Section title
- query (String): Query to return value for the section
- visible (Boolean): Visibility status
- ordinal (32-bit Integer): Section order
options object attributes
- log_scale (Boolean): (When
typevalue is one ofhbar,hbar_stck,vbar,vbar_stck,line,area_stacked) Display dependent variable axis in log scale (Default:false). - percentage (Boolean): (When
typevalue is one ofhbar,hbar_stck,vbar,vbar_stck,line,area_stacked) Set minimum and maximum values of dependent variable axis to 0 and 100 respectively (Default:false). - pie_donut (Boolean): (When
typevalue ispie) Output pie chart as donut shape (Default:false). - label (Boolean): (When
typevalue is one ofhbar,hbar_stck,vbar,vbar_stck,pie) Display labels on chart (Default:false).
Success Response
{}
Error Responses
Required argument is missing
HTTP status code 400
{
"error_code": "null-argument",
"error_msg": "name should be not null"
}
Invalid argument length
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "'name' must be shorter than or equal to 50 characters."
}
Identifier is not in valid GUID format
HTTP status code 400
{
"error_code": "invalid-param-type",
"error_msg": "guid should be guid type."
}
'sections' parameter is not in valid JSON format
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "'sections' parameter should follow valid JSON syntax"
}
Invalid section type
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "invalid report section type: ABC"
}
No privilege to update a report template
HTTP status code 500
{
"error_code": "illegal-state",
"error_msg": "no-permission"
}