共用方式為


Reports - List By Time

依時間列出報表記錄。

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byTime?$filter={$filter}&interval={interval}&api-version=2022-08-01
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byTime?$filter={$filter}&$top={$top}&$skip={$skip}&$orderby={$orderby}&interval={interval}&api-version=2022-08-01

URI 參數

名稱 位於 必要 類型 Description
resourceGroupName
path True

string

資源群組的名稱。 名稱不區分大小寫。

serviceName
path True

string

API 管理 服務的名稱。

Regex 模式: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$

subscriptionId
path True

string

目標訂用帳戶的標識碼。

$filter
query True

string

|欄位 |使用量 |支持的運算子 |支援的函式 |
|-------------|-------------|-------------|-------------|
|timestamp |篩選,選取 |ge, le | |
| interval | select | | | |
apiRegion |filter |eq | |
| userId | filter | eq | | |
productId |filter |eq | |
| subscriptionId | filter | eq | | |
apiId |filter |eq | |
| operationId | filter | eq | | |
callCountSuccess |選取 | | | |
| callCountBlocked | select | | | |
callCountFailed |選取 | | | |
| callCountOther | select | | | |
帶寬 |select, orderBy | | |
| cacheHitsCount | select | | | |
cacheMissCount |選取 | | | |
| apiTimeAvg | select | | | |
apiTimeMin |選取 | | | |
| apiTimeMax | select | | | |
serviceTimeAvg |選取 | | | |
| serviceTimeMin | select | | | |
serviceTimeMax |選取 | | | |

api-version
query True

string

用於此作業的 API 版本。

interval
query True

string

duration

依時間間隔。 間隔必須是15分鐘的倍數,而且可能不是零。 此值應以 ISO 8601 格式 (http://en.wikipedia.org/wiki/ISO_8601#Durations) 。此程式代碼可用來將 TimeSpan 轉換成有效的間隔字串:XmlConvert.ToString (新的 TimeSpan (小時、分鐘、秒) ) 。

$orderby
query

string

OData 排序依據查詢選項。

$skip
query

integer

int32

要略過的記錄數目。

$top
query

integer

int32

要傳回的記錄數目。

回應

名稱 類型 Description
200 OK

ReportCollection

列出報表記錄的集合。

Other Status Codes

ErrorResponse

描述作業失敗原因的錯誤回應。

安全性

azure_auth

Azure Active Directory OAuth2 Flow。

類型: oauth2
Flow: implicit
授權 URL: https://login.microsoftonline.com/common/oauth2/authorize

範圍

名稱 Description
user_impersonation 模擬您的用戶帳戶

範例

ApiManagementGetReportsByTime

範例要求

GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/reports/byTime?$filter=timestamp ge datetime'2017-06-01T00:00:00' and timestamp le datetime'2017-06-04T00:00:00'&interval=PT15M&api-version=2022-08-01

範例回覆

{
  "value": [
    {
      "timestamp": "2017-06-03T00:15:00Z",
      "interval": "PT15M",
      "callCountSuccess": 4,
      "callCountBlocked": 0,
      "callCountFailed": 0,
      "callCountOther": 0,
      "callCountTotal": 4,
      "bandwidth": 3243,
      "cacheHitCount": 0,
      "cacheMissCount": 0,
      "apiTimeAvg": 1337.46335,
      "apiTimeMin": 885.0839000000001,
      "apiTimeMax": 1819.2173,
      "serviceTimeAvg": 1255.917425,
      "serviceTimeMin": 882.8264,
      "serviceTimeMax": 1697.3612
    },
    {
      "timestamp": "2017-06-03T00:30:00Z",
      "interval": "PT15M",
      "callCountSuccess": 9,
      "callCountBlocked": 1,
      "callCountFailed": 0,
      "callCountOther": 0,
      "callCountTotal": 10,
      "bandwidth": 7776,
      "cacheHitCount": 0,
      "cacheMissCount": 0,
      "apiTimeAvg": 872.7818777777778,
      "apiTimeMin": 330.3206,
      "apiTimeMax": 1093.8407,
      "serviceTimeAvg": 824.2847111111112,
      "serviceTimeMin": 215.24,
      "serviceTimeMax": 973.2262000000001
    }
  ],
  "count": 2,
  "nextLink": ""
}

定義

名稱 Description
ErrorFieldContract

錯誤欄位合約。

ErrorResponse

錯誤回應。

ReportCollection

分頁報表記錄清單表示。

ReportRecordContract

報表數據。

ErrorFieldContract

錯誤欄位合約。

名稱 類型 Description
code

string

屬性層級錯誤碼。

message

string

人類可讀取的屬性層級錯誤表示法。

target

string

屬性名稱。

ErrorResponse

錯誤回應。

名稱 類型 Description
error.code

string

服務定義的錯誤碼。 此代碼會作為回應中指定之 HTTP 錯誤碼的子狀態。

error.details

ErrorFieldContract[]

要求中傳送無效欄位的清單,以防發生驗證錯誤。

error.message

string

人類可閱讀的錯誤表示法。

ReportCollection

分頁報表記錄清單表示。

名稱 類型 Description
count

integer

所有頁面的記錄計數總數。

nextLink

string

如果有的話,下一頁連結。

value

ReportRecordContract[]

頁面值。

ReportRecordContract

報表數據。

名稱 類型 Description
apiId

string

API 識別碼路徑。 /apis/{apiId}

apiRegion

string

API 地區識別碼。

apiTimeAvg

number

處理要求所需的平均時間。

apiTimeMax

number

處理要求所需的時間上限。

apiTimeMin

number

處理要求所需的時間下限。

bandwidth

integer

耗用的頻寬。

cacheHitCount

integer

從快取原則提供內容的次數。

cacheMissCount

integer

從後端擷取內容的次數。

callCountBlocked

integer

由於認證無效而封鎖的呼叫次數。 這包括傳回 HttpStatusCode.Unauthorized 和 HttpStatusCode.Forbidden 和 HttpStatusCode.TooManyRequests 的呼叫

callCountFailed

integer

因為閘道或後端錯誤而呼叫失敗。 這包括傳回 HttpStatusCode.BadRequest (400) 和 HttpStatusCode.InternalServerError 之間的任何程式代碼 (500) 和 600 之間的呼叫

callCountOther

integer

其他呼叫數目。

callCountSuccess

integer

成功的呼叫數。 這包括傳回 HttpStatusCode = 301 和 HttpStatusCode.NotModified <和 HttpStatusCode.TemporaryRedirect 的呼叫

callCountTotal

integer

呼叫總數。

country

string

此記錄數據相關的國家/地區。

interval

string

匯總期間長度。 間隔必須是15分鐘的倍數,而且可能不是零。 此值應以 ISO 8601 格式 (http://en.wikipedia.org/wiki/ISO_8601#Durations) 。

name

string

根據報表端點的名稱會指定產品、API、作業或開發人員名稱。

operationId

string

作業標識碼路徑。 /apis/{apiId}/operations/{operationId}

productId

string

產品識別碼路徑。 /products/{productId}

region

string

此記錄數據相關的國家/地區。

serviceTimeAvg

number

處理後端要求所需的平均時間。

serviceTimeMax

number

處理後端要求所需的時間上限。

serviceTimeMin

number

處理後端要求所需的時間下限。

subscriptionId

string

訂用帳戶標識碼路徑。 /subscriptions/{subscriptionId}

timestamp

string

匯總期間開始。 日期符合下列格式: yyyy-MM-ddTHH:mm:ssZ 如 ISO 8601 標準所指定。

userId

string

用戶識別碼路徑。 /users/{userId}

zip

string

此記錄數據相關的郵遞區號。