API Calls

Name Description Shortcut
GET: List reports or single report This method can be used to retrieve a list of existing reports Description
POST: Create a new report This method can be used to create a new report. Description
PUT: Update an existing report This method can be used to update an existing report. Description
DELETE: Delete an existing Report This method can be used to delete an existing report. Description

[GET]: List Reports

This method can be used to retrieve a list of existing reports or a single report according to its ID.

Input

URL

/reports
or
/reports/{id}

Request headers

x-api-key: shared_key_value
Accept: application/json

Response

Headers: Status: 200 OK

Response body

Json Response

{
    "status": {
        "message": "Success",
        "code": "200"
    },
    "data": [
        {
            "id": "eba61a9e-22e9-4521-9e47-ecaa4a494364",
            "tenant": "TenantA",
            "disabled": false,
            "info": {
                "name": "Report_A",
                "description": "report aaaaa",
                "created": "2015-9-10 13:43:00",
                "updated": "2015-10-11 13:43:00"
            },
            "topology_schema": {
                "group": {
                    "type": "NGI",
                    "group": {
                        "type": "SITE"
                    }
                }
            },
            "thresholds": {
                "availability": 80.00,
                "reliability": 85.00,
                "uptime": 80.00,
                "unknown": 10.00,
                "downtime": 10.00
            },
            "profiles": [
                {
                    "id": "6ac7d684-1f8e-4a02-a502-720e8f11e50b",
                    "name": "profile1",
                    "type": "metric"
                },
                {
                    "id": "6ac7d684-1f8e-4a02-a502-720e8f11e523",
                    "name": "profile2",
                    "type": "operations"
                },
                {
                    "id": "6ac7d684-1f8e-4a02-a502-720e8f11e50q",
                    "name": "profile3",
                    "type": "aggregation"
                }
            ],
            "filter_tags": [
                {
                    "name": "name1",
                    "value": "value1",
                    "context": ""
                },
                {
                    "name": "name2",
                    "value": "value2",
                    "context": ""
                }
            ]
        }
    ]
}

[POST]: Create a new report

This method can be used to create a new report

Input

URL

POST /reports

Request headers

x-api-key: shared_key_value
Accept: application/json

Request Body

{
    "info": {
        "name": "Report_A",
        "description": "report aaaaa"
    },
    "topology_schema": {
        "group": {
            "type": "ngi",
            "group": {
                "type": "site"
            }
        }
    },
    "thresholds": {
        "availability": 80.00,
        "reliability": 85.00,
        "uptime": 80.00,
        "unknown": 10.00,
        "downtime": 10.00
    },
    "profiles": [
        {
            "id":"422985a7-6386-4964-bc99-5ebd5d7b0aef",
            "type": "metric"
        },
        {
            "id": "1aa74849-2310-4bbc-b63a-8995ac7888ea",
            "type": "aggregation"
        },
        {
            "id": "1eafbdd1-1bbc-4861-b849-65394840762",
            "type": "operations"
        }
    ],
    "filter_tags": [
        {
            "name": "production",
            "value": "N"
        },
        {
            "name": "monitored",
            "value": "Y"
        }
    ]
}

Response

Headers: Status: 201 Created

Response Body

{
    "status": {
        "message": "Successfully Created Report",
        "code": "201"
    },
    "data": {
        "id": "eba61a9e-22e9-4521-9e47-ecaa4a494360",
        "links": {
            "self": "https://myapi.test.com/api/v2/reports/eba61a9e-22e9-4521-9e47-ecaa4a494360"
        }
    }
}

[PUT]: Update an existing report

This method can be used to update an existing report. This will replace all the fields in the record so all the old fields that need to be kept must be included in the json of the update request body

Input

URL

/reports/{id}

Request headers

x-api-key: shared_key_value
Accept: application/json

Request Body

{
    "disabled": true,
    "weight": "hepspec",
    "info": {
        "name": "newname",
        "description": "newdescription",
    },
    "topology_schema": {
        "group": {
            "type": "ngi",
            "group": {
                "type": "fight"
            }
        }
    },
    "thresholds": {
        "availability": 90.00,
        "reliability": 95.00,
        "uptime": 90.00,
        "unknown": 15.00,
        "downtime": 15.00
    },
    "profiles": [
        {
            "id": "6ac7d684-1f8e-4a02-a502-720e8f11e50b",
            "type": "metric",
            "name": "profile1"
        },
        {
            "id": "6ac7d684-1f8e-4a02-a502-720e8f11e523",
            "type": "operations",
            "name": "profile2"
        },
        {
            "id": "6ac7d684-1f8e-4a02-a502-720e8f11e50bq",
            "type": "aggregation",
            "name": "profile3"
        }
    ],
    "filter_tags": [
        {
            "name": "production",
            "value": "N"
        },
        {
            "name": "monitored",
            "value": "N"
        }
    ]
}

Response

Headers: Status: 200 OK

Response Body

{
    "status": {
        "message": "Report was successfully updated",
        "code": "200"
    }
}

[DELETE]: Delete an existing report

This method can be used to update an existing report

Input

URL

DELETE /reports/{id}

Request headers

x-api-key: shared_key_value
Accept: application/json

Response

Headers: Status: 200 OK

Response Body

{
    "status": {
        "message": "Report was successfully deleted",
        "code": "200"
    }
}