Skip to main content

reports

Creates, updates, deletes, gets or lists a reports resource.

Overview

Namereports
TypeResource
Idazure.api_management.reports

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringName depending on report endpoint specifies product, API, operation or developer name.
apiIdstringAPI identifier path. /apis/{apiId}.
apiRegionstringAPI region identifier.
apiTimeAvgnumberAverage time it took to process request.
apiTimeMaxnumberMaximum time it took to process request.
apiTimeMinnumberMinimum time it took to process request.
bandwidthintegerBandwidth consumed.
cacheHitCountintegerNumber of times when content was served from cache policy.
cacheMissCountintegerNumber of times content was fetched from backend.
callCountBlockedintegerNumber of calls blocked due to invalid credentials. This includes calls returning HttpStatusCode.Unauthorized and HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests.
callCountFailedintegerNumber of calls failed due to gateway or backend errors. This includes calls returning HttpStatusCode.BadRequest(400) and any Code between HttpStatusCode.InternalServerError (500) and 600.
callCountOtherintegerNumber of other calls.
callCountSuccessintegerNumber of successful calls. This includes calls returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect.
callCountTotalintegerTotal number of calls.
countrystringCountry to which this record data is related.
intervalstringLength of aggregation period. Interval must be multiple of 15 minutes and may not be zero. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations _).
operationIdstringOperation identifier path. /apis/{apiId}/operations/{operationId}.
productIdstringProduct identifier path. /products/{productId}.
regionstringCountry region to which this record data is related.
serviceTimeAvgnumberAverage time it took to process request on backend.
serviceTimeMaxnumberMaximum time it took to process request on backend.
serviceTimeMinnumberMinimum time it took to process request on backend.
subscriptionIdstringSubscription identifier path. /subscriptions/{subscriptionId}.
timestampstring (date-time)Start of aggregation period. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.
userIdstringUser identifier path. /users/{userId}.
zipstringZip code to which this record data is related.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_by_timeselectresource_group_name, service_name, subscription_id, $filter, interval$top, $skip, $orderbyLists report records by Time.
list_by_apiselectresource_group_name, service_name, subscription_id, $filter$top, $skip, $orderbyLists report records by API.
list_by_userexecresource_group_name, service_name, subscription_id, $filter$top, $skip, $orderbyLists report records by User.
list_by_operationexecresource_group_name, service_name, subscription_id, $filter$top, $skip, $orderbyLists report records by API Operations.
list_by_productexecresource_group_name, service_name, subscription_id, $filter$top, $skip, $orderbyLists report records by Product.
list_by_geoexecresource_group_name, service_name, subscription_id, $filter$top, $skipLists report records by geography.
list_by_subscriptionexecresource_group_name, service_name, subscription_id, $filter$top, $skip, $orderbyLists report records by subscription.
list_by_requestexecresource_group_name, service_name, subscription_id, $filter$top, $skipLists report records by Request.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
$filterstring| Field | Usage | Supported operators | Supported functions ||-------------|-------------|-------------|-------------|| timestamp | filter | ge, le | | | apiId | filter | eq | | | operationId | filter | eq | | | productId | filter | eq | | | userId | filter | eq | | | apiRegion | filter | eq | | | subscriptionId | filter | eq | | . Required.
intervalstringBy time interval. Interval must be multiple of 15 minutes and may not be zero. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This _ code can be used to convert TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)). Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
service_namestringThe name of the API Management service. Required.
subscription_idstring
$orderbystringOData order by query option. Default value is None.
$skipintegerNumber of records to skip. Default value is None.
$topintegerNumber of records to return. Default value is None.

SELECT examples

Lists report records by Time.

SELECT
name,
apiId,
apiRegion,
apiTimeAvg,
apiTimeMax,
apiTimeMin,
bandwidth,
cacheHitCount,
cacheMissCount,
callCountBlocked,
callCountFailed,
callCountOther,
callCountSuccess,
callCountTotal,
country,
interval,
operationId,
productId,
region,
serviceTimeAvg,
serviceTimeMax,
serviceTimeMin,
subscriptionId,
timestamp,
userId,
zip
FROM azure.api_management.reports
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND service_name = '{{ service_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $filter = '{{ $filter }}' -- required
AND interval = '{{ interval }}' -- required
AND $top = '{{ $top }}'
AND $skip = '{{ $skip }}'
AND $orderby = '{{ $orderby }}'
;

Lifecycle Methods

Lists report records by User.

EXEC azure.api_management.reports.list_by_user 
@resource_group_name='{{ resource_group_name }}' --required,
@service_name='{{ service_name }}' --required,
@subscription_id='{{ subscription_id }}' --required,
@$filter='{{ $filter }}' --required,
@$top='{{ $top }}',
@$skip='{{ $skip }}',
@$orderby='{{ $orderby }}'
;