Dashboard APIs


This topic describes the REST APIs for all the dashboard widgets.

The base URL for the Dashboard API is: https://<serverName>/api/v1

POST/api/v1/violations/reports/severity/summary

Impacted assets by severity.

Request body: No parameters

Sample request 

{
  "filters": [
    {
      "severity": [
        "0",
        "1",
        "2",
        "3",
        "4",
        "5"
      ]
    },
    {
      "os": [
        "Windows"
      ]
    },
    {
      "policy": "d41cedbb-a981-4a46-b658-1111"
    },
    {
      "violation_type": "patch"
    }
  ]
}


Responses

Code

Description

200

OK

204

No Impacted Targets

500

Internal Server Error


Sample response

{
  "summary": [
    {
      "severity": 1,
      "count": 100
    }
  ],
  "total": 100
}

POST/api/v1/violations/reports/severity/detail

Details for impacted assets by severity.

Request body: No parameters

Sample request 

{
  "filters": [
    {
      "severity": [
        "0",
        "1",
        "2",
        "3",
        "4",
        "5"
      ]
    },
    {
      "os": [
        "Windows"
      ]
    },
    {
      "asset_name": "clm-pun-05.bmc.com"
    },
    {
      "policy": "d41cedbb-a981-4a46-b658-1111"
    },
    {
      "violation_type": "patch"
    }
  ],
  "pagesize": 1,
  "limit": 100
}

Responses

Code

Description

200

OK

204

No Impacted Targets

500

Internal Server Error


Sample response

{
  "details": [
    {
      "asset_name": "asset_1",
      "platform": "Windows",
      "count": 100
    }
  ],
  "total_record": 100
}

POST/api/v1/violations/reports/patch-compliance/summary

Patch compliance

Request body: No parameters

Sample request 

{
  "filters": [
    {
      "severity": [
        "0",
        "1",
        "2",
        "3",
        "4",
        "5"
      ]
    },
    {
      "os": [
        "Windows"
      ]
    },
    {
      "policy": "d41cedbb-a981-4a46-b658-1111"
    },
    {
      "violation_type": "patch"
    }
  ]
}

Responses

Code

Description

200

OK

204

No Impacted Targets

500

Internal Error


Sample response

[
  {
    "missing_count": 0,
    "os_type": "windows|linux"
  }
]

POST/api/v1/violations/reports/patch-compliance/detail

Details for patch compliance.

Request body: No parameters

Sample request 

{
  "filters": [
    {
      "severity": [
        "0",
        "1",
        "2",
        "3",
        "4",
        "5"
      ]
    },
    {
      "os": [
        "Windows"
      ]
    },
    {
      "policy": "d41cedbb-a981-4a46-b658-1111"
    },
    {
      "violation_type": "patch"
    }
  ]
}

Responses

Code

Description

200

OK

204

No Impacted Targets

500

Internal Error


Sample response

[
  {
    "policy_id": "d41cedbb-a981-4a46-b658-29a5a38370c9",
    "missing_count": 0
  }
]

POST/api/v1/violations/reports/sla/summary

Impacted assets by SLA (sla) and unique missing patches by age (age)

Request body

Parameter

Description

type

Specifies the name of the summary type.

Available values: sla, age

Sample request 

{
  "sla": [
    {
      "deadline": 30,
      "threshold": 24,
      "severity": "Valid values 5,4,3,2,1"
    }
  ],
  "filters": [
    {
      "os": [
        "Windows"
      ]
    },
    {
      "policy": "d41cedbb-a981-4a46-b658-1111"
    },
    {
      "violation_type": "patch"
    }
  ]
}

Responses

Code

Description

200

OK

204


401

Unauthorized

500

Internal Error


Sample response

[
  {
    "name": "exceeding / exceeding_others / approaching / within",
    "count": 10
  }
]

POST/api/v1/violations/reports/sla/detail

Details for impacted assets by SLA.

Request body: No parameters

Sample request 

{
  "sla": {
    "sla_config": [
      {
        "deadline": 30,
        "threshold": 24,
        "severity": "Valid values 5,4,3,2,1"
      }
    ]
  },
  "sla_type": "Valid values exceeding, exceeding_others, within, approaching",
  "pagesize": 0,
  "limit": 0
}

Responses

Code

Description

200

OK

204


401


500

Internal Error


Sample response

{
  "total": "1000",
  "details": [
    {
      "asset_name": "asset_name_1",
      "platform": "windows",
      "missing_patches": 10,
      "sla_type": "exceeding / exceeding_others / approaching / within"
    }
  ]
}

POST/api/v1/violations/reports/trends/weeks

Remediation trend

Request body: No parameters

Sample request 

{
  "type": "VIOLATION | REMEDIATION",
  "start": 1,
  "end": 52,
  "filters": [
    {
      "severity": [
        "0",
        "1",
        "2",
        "3",
        "4",
        "5"
      ]
    },
    {
      "os": [
        "Windows"
      ]
    },
    {
      "violation_type": "patch"
    }
  ]
}

Responses

Code

Description

200

OK

204


400

Bad Request

500

Internal Error


Sample response

[
  {
    "count": 100,
    "week": 20
  }
]

POST/api/v1/violations/reports/trends/weeks/detail

Details for remediation trial.

Request body: No parameters

Sample request 

{
  "type": "VIOLATION | REMEDIATION",
  "week_number": 1,
  "year": 2019,
  "filters": [
    {
      "severity": [
        "0",
        "1",
        "2",
        "3",
        "4",
        "5"
      ]
    },
    {
      "os": [
        "Windows"
      ]
    },
    {
      "violation_type": "patch"
    }
  ]
}

Responses

Code

Description

200

OK

204


400

Bad Request

500

Internal Error


Sample response

[
  {
    "violation_name": "Red Hat Update for procmail (RHSA-2014-1172)",
    "impacted_targets": "40",
    "cve_ids": "CVE-2014-3596, CVE-2014-3593",
    "severity": "1,2,3,4,5",
    "classification": "security",
    "violation_age": "30"
  }
]

POST/api/v1/violations/reports/states/average-days/weeks

Stage change average-days in a specific week.

Request body: No parameters

Sample request 

{
  "week": 52,
  "fromState": "UNMAPPED",
  "toState": "CLOSED"
}

Responses

Code

Description

200

OK

204


400

Bad Request

500

Internal Error


Sample response

{
  "average-days": 100
}


POST
/api/v1/violations/reports/rank/violations

top 10 missing patches.

Request body: No parameters

Sample request 

{
  "limit": "2 ( Default is 10 )",
  "sla": [
    {
      "deadline": 30,
      "threshold": 24,
      "severity": "Valid values 5,4,3,2,1"
    }
  ],
  "filters": [
    {
      "policy": "d41cedbb-a981-4a46-b658-1111"
    },
    {
      "os": [
        "Windows"
      ]
    },
    {
      "violation_type": "patch"
    }
  ]
}

Responses

Code

Description

200

OK

204


400

Bad Request

500

Internal Error


Sample response

[
  {
    "name": "Violation / Target Name",
    "count": 10,
    "exceeding_sla_count": 5,
    "within_sla_count": 3,
    "approaching_sla_count": 2
  }
]

POST/api/v1/violations/reports/rank/violations/detail

details for top 10 missing patches

Request body: No parameters

Sample request 

{
  "sla": [
    {
      "deadline": 30,
      "threshold": 24,
      "severity": "Valid values 5,4,3,2,1"
    }
  ],
  "patchName": "string",
  "pagesize": 1,
  "limit": 100,
  "filters": [
    {
      "policy": "d41cedbb-a981-4a46-b658-1111"
    },
    {
      "os": [
        "Windows"
      ]
    },
    {
      "violation_type": "patch"
    }
  ]
}

Responses

Code

Description

200

OK

204


401

Unauthorized

500

Internal Error


Sample response

{
  "details": [
    {
      "asset_name": "Target Name",
      "platform": "linux"
    }
  ],
  "total": 100
}

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

Helix Automation Console 19.11