Creating a custom report

You can modify predefined reports with custom parameters in IBM Spectrum Protect Plus and save the customized reports.

Method and URI

To create a custom report, use a POST method with a URI:

POST    https://{hostname|IPv4}/api/endeavour/report

Parameters

None.

Data

Data 1: name

The name of the custom report.

  • Example value: vSnapStorageUtilization-Dallas1

  • Restriction: Report names can include alphanumeric characters and the following symbols:

$-_.+!*'()

Spaces are not permitted.

  • Type: String. Required. Available in the web user interface.

Data 2: description

The description of the custom report.

  • Example value: A report about storage utilization for vSnap Dallas1

  • Type: String. Available in the web user interface.

Data 3: paramValues

The options of the custom report. The available options depend on the original predefined report. For details, follow the instructions in Report parameters.

  • Example value: The following value defines example options that are available in the predefined report, vSnap Storage Utilization, and custom reports based on it:

{
    "vSnap":              ["(All)"],
    "IncludeReplicaVols": false,
    "VMsPerStorage":      false
}
  • Type: JSON object. Required. Available in the web user interface.

Data 4: parentIid

The {reportIdStr} of the original predefined report.

  • Example value: 1013

  • Type: String. Required. Available in the web user interface.

Tip

To get a {reportIdStr} by the report name, follow the instructions in Getting a {reportIdStr}.

Example: Create a custom report

Assume that you want to create the following custom report:

  • Name: vSnapStorageUtilization-Dallas1

  • Description: A report about storage utilization for vSnap Dallas1

  • Options:

    • Exclude Replica Destination Volume: true

    • Show Resources protected per vSnap Storage: true

    • vSnap server: 10.0.1.1 ({vSnapId} 2000)

  • Original predefined report: vSnap Storage Utilization ({reportIdStr} 1013)

A Python snippet that is similar to the following example can be used to create a custom report based on the vSnap Storage Utilization report:

_data = f'''{{
    "name":        "vSnapStorageUtilization-Dallas1",
    "description": "A report of storage utilization for vSnap Dallas1",
    "paramValues": {{
        "vSnap":              ["2000"],
        "IncludeReplicaVols": true,
        "VMsPerStorage":      true
    }},
    "parentId":"1013"
}}'''

requests.post(sppUrl + '/api/endeavour/report',
     headers=...,  data=_data, verify=...)
_images/reference_report_create02.png

Figure 66 The same action can be taken in the IBM Spectrum Protect Plus web user interface: Click the Reports tab. Click Create Custom Report for the predefined report that you want to use to create a custom report. Configure the parameters.

The request prompts a response that is structured as shown, with the HTTP status of 201 (Created). Review the response to ensure that the custom report was added.

{
    "links": {...},
    "name": "vSnapStorageUtilization-Dallas1",
    "displayName": "vSnapStorageUtilization-Dallas1",
    "description": "A report of storage utilization for vSnap Dallas1",
    "categoryDisplayName": "Backup Storage Utilization",
    "langType": "EN_US",
    "custom": true,
    "creationTime": 1577082702705,
    "paramValues": {
        "vSnap": [
            "2000"
        ],
        "IncludeReplicaVols": true,
        "VMsPerStorage": true
    },
    "parentId": "1013",
    "parentName": "vSnap",
    "rbacPath": "root:0/report:0/reportcategory:BackupStorageUtilizationCategory
↪Name/report:1101",
    "id": "1101"
}