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
KeyTypeDescriptionNote
guidStringReport template GUID36 characters
Request Body Parameters
KeyRequiredTypeDescriptionNote
nameOStringReport template nameMinimum 1 to maximum 50 characters
descriptionXStringReport template descriptionMaximum 2,000 characters
group_guidXStringParent report group GUID36 characters
sectionsOObject ArrayList of report sectionsSee 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 type value is one of hbar, hbar_stck, vbar, vbar_stck, line, area_stacked) Display dependent variable axis in log scale (Default: false).
  • percentage (Boolean): (When type value is one of hbar, 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 type value is pie) Output pie chart as donut shape (Default: false).
  • label (Boolean): (When type value is one of hbar, 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"
}