gtm-availability

The following shows how to generate the gtm-availability report using either the Reporting API's Generate a report POST operation or the Get a cacheable report GET operation. Details about each report's supported products, metrics, filters, and available data intervals are also available dynamically by running the API's Get a report type operation, also shown below. See also other available reports.

Report definition

This report allows you to configure the aggregation interval for each data record.

This report allows you to configure the aggregation interval for each data record. Available interval values are: HOUR, DAY, FIVE_MINUTES.

Business object: contracts

Data available for: 90 days

Available metrics

MetricDescription
Data metrics
avail_pctAvailability percentage.
Summary metrics
avg_avail_pctAverage availability percentage.
max_avail_pctMaximum (peak) availability percentage.
min_avail_pctMinimum availability percentage

POST request

POST /reporting-api/v1/reports/gtm-availability/versions/1/report-data{?start,‚Äčend,‚Äčinterval}

Sample: /reporting-api/v1/reports/gtm-availability/versions/1/report-data?start‚Äč=2020-06-26T13%3A40%3A00Z‚Äč&end‚Äč=2020-06-26T14%3A00%3A00Z‚Äč&interval‚Äč=FIVE_MINUTES

Query parameters

ParameterTypeSampleDescription
Required
startString2020-06-26T13:40:00ZSpecifies the start of the reported period as an ISO-8601 timestamp with optional time zone. The report includes data that matches the start value's timestamp.
endString2020-06-26T14:00:00ZSpecifies the end of the reported period as an ISO-8601 timestamp with optional time zone. The report excludes any data that matches the end value's timestamp.
intervalEnumerationFIVE_MINUTESThe duration of each data record. Available values: HOUR, DAY, FIVE_MINUTES.

JSON request members

MemberTypeDescription
objectIdsArraySpecifies the set of contracts values you want to report on.
objectIdsEnumerationAs an alternative to an array of ID values, specify all as a string for unfiltered data. Either way, objectIds is required.
metricsArrayThe set of desired metrics. If omitted, the report includes all available metrics.

Request body:

{
    "objectIds": [
        "55232",
        "23433",
        "32433"
    ],
    "metrics": [
        "avail_pct",
        "avg_avail_pct",
        "max_avail_pct",
        "min_avail_pct"
    ]
}

GET request

GET /reporting-api/v1/reports/gtm-availability/versions/1/report-data{?start,‚Äčend,‚Äčinterval,‚ÄčobjectIds,‚ÄčallObjectIds,‚Äčmetrics}

Sample: /reporting-api/v1/reports/gtm-availability/versions/1/report-data?start‚Äč=2020-06-26T13%3A40%3A00Z‚Äč&end‚Äč=2020-06-26T14%3A00%3A00Z‚Äč&interval‚Äč=FIVE_MINUTES‚Äč&objectIds‚Äč=55232,‚Äč23433,‚Äč32433‚Äč&metrics‚Äč=avail_pct%2Cavg_avail_pct

Query parameters

ParameterTypeSampleDescription
Required
startString2022-06-23T13:55:00ZSpecifies the start of the reported period as an ISO-8601 timestamp with optional time zone. The report includes data that matches the start value’s timestamp.
endString2022-06-23T14:15:00ZSpecifies the end of the reported period as an ISO-8601 timestamp with optional time zone. The report excludes any data that matches the end value’s timestamp.
intervalEnumerationFIVE_MINUTESThe duration of each data record. Available values: HOUR, DAY, FIVE_MINUTES.
Optional
allObjectIdsBooleantrueAs an alternative to objectIds, enabling this generates a report that includes all IDs available for the contracts objectType. This parameter is ignored if the request also specifies a set of objectIds.
objectIdsString55232,‚Äč23433,‚Äč32433As an alternative to allObjectIds, specifies the set of unique IDs for the contracts objectType you want to report on, formatted as a comma-delimited list.
metricsStringavail_pct,‚Äčavg_avail_pctSpecifies a comma-separated list of metrics to include in the report, otherwise all metrics if omitted. The set of available metrics depends on the type of report. URL-encode the entire value in the GET request.

JSON response

Status 200 application/json

Response body:

{
    "metadata": {
        "name": "gtm-availability",
        "version": "1",
        "outputType": "FLAT",
        "groupBy": [
            "startdatetime"
        ],
        "interval": "FIVE_MINUTES",
        "start": "2020-06-26T13:40:00Z",
        "end": "2020-06-26T14:00:00Z",
        "availableDataEnds": null,
        "suggestedRetryTime": null,
        "rowCount": 4,
        "filters": [],
        "columns": [
            {
                "name": "groupBy",
                "label": "startdatetime"
            },
            {
                "name": "avail_pct",
                "label": "Availability %"
            }
        ],
        "objectType": "contracts",
        "objectIds": [
            "55232",
            "23433",
            "32433"
        ]
    },
    "data": [
        {
            "startdatetime": "2020-06-26T13:40:00Z",
            "avail_pct": "2859"
        },
        {
            "startdatetime": "2020-06-26T13:45:00Z",
            "avail_pct": "4661"
        },
        {
            "startdatetime": "2020-06-26T13:50:00Z",
            "avail_pct": "2556"
        },
        {
            "startdatetime": "2020-06-26T13:55:00Z",
            "avail_pct": "1063"
        }
    ],
    "summaryStatistics": {
        "avg_avail_pct": {
            "value": "1658",
            "details": {}
        },
        "max_avail_pct": {
            "value": "888",
            "details": {}
        },
        "min_avail_pct": {
            "value": "2886",
            "details": {}
        }
    }
}

CSV response

Status 200 text/csv

Response Body:

#METADATA_START
name,‚Äčgtm-availability
version,‚Äč1
source,‚Äčgtm-availability/versions/1
groupBy,‚Äčstartdatetime
start,‚Äč2020-06-26T13:40:00Z
end,‚Äč2020-06-26T14:00:00Z
interval,`FIVE_MINUTES`
availableDataEnds,
suggestedRetryTime,
rowCount,‚Äč4
objectType,‚Äčcontracts
objectIds,‚Äč55232,‚Äč23433,‚Äč32433
#METADATA_END

#SUMMARYSTATISTICS_START
avg_avail_pct,‚Äč1658
max_avail_pct,‚Äč888
min_avail_pct,‚Äč2886
#SUMMARYSTATISTICS_END

#COLUMNS_START
startdatetime,‚Äčavail_pct
#COLUMNS_END

#DATA_START
2020-06-26T13:40:00Z,2859
2020-06-26T13:45:00Z,4661
2020-06-26T13:50:00Z,2556
2020-06-26T13:55:00Z,1063
#DATA_END

Get report details

This sample Get a report type operation gets the same information you need to run the gtm-availability report as provided in this reference documentation, but available dynamically to your API client application.

GET /reporting-api/v1/reports/gtm-availability/versions/1

Status 200 application/json

Response body:

{
    "name": "gtm-availability",
    "description": "This report allows you to configure the aggregation interval for each data record.",
    "businessObjectName": "contracts",
    "version": 1,
    "status": "PUBLISHED",
    "deprecated": false,
    "timeBased": true,
    "outputType": "FLAT",
    "available": true,
    "metrics": [
        {
            "name": "avail_pct",
            "description": "Availability percentage.",
            "label": "Availability %",
            "unit": "COUNT",
            "summaryStatistic": false
        },
        {
            "name": "avg_avail_pct",
            "description": "Average availability percentage.",
            "label": "Average Availability %",
            "unit": "COUNT",
            "summaryStatistic": true
        },
        {
            "name": "max_avail_pct",
            "description": "Maximum (peak) availability percentage.",
            "label": "Maximum Availability %",
            "unit": "COUNT",
            "summaryStatistic": true
        },
        {
            "name": "min_avail_pct",
            "description": "Minimum availability percentage",
            "label": "Minimum Availability %",
            "unit": "COUNT",
            "summaryStatistic": true
        }
    ],
    "groupOutlyingValues": {
        "enabled": false
    },
    "groupBy": [
        "startdatetime"
    ],
    "intervals": [
        "HOUR",
        "DAY",
        "FIVE_MINUTES"
    ],
    "dataRetentionDays": 90,
    "links": [
        {
            "rel": "self",
            "href": "/reporting-api/v1/reports/gtm-availability/versions/1"
        },
        {
            "rel": "versions",
            "href": "/reporting-api/v1/reports/gtm-availability/versions"
        },
        {
            "rel": "all-reports",
            "href": "/reporting-api/v1/reports"
        },
        {
            "rel": "execute-report",
            "href": "/reporting-api/v1/reports/gtm-availability/versions/1/report-data"
        }
    ]
}