Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc20a024

Browse files
committed
change doc 1
1 parent9ecff56 commitc20a024

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

‎_docs/kb/articles/retrieve-usage-data-api.md‎

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ This guide shows how to programmatically access usage-related analytics through
1717

1818
>**Goal:** Pull usage metrics (e.g., credit consumption, pipeline credit consumption, active committers) for monitoring or reporting.
1919
20+
**Disclaimer:**
21+
This API is used for data visualization in the user interface. It does not provide raw analytical data, but rather pre-aggregated data in the form of OLAP cubes intended for rendering graphical charts in the interface. There are currently no plans to standardize or version this API, so the data structure may change at any time without backward compatibility or public notice.
22+
2023
##Prerequisites
2124

2225
- A Codefresh**API key** with permission to access Analytics.
@@ -79,7 +82,7 @@ curl -s -H "Authorization: $API_KEY" "https://g.codefresh.io/api/analytics/repor
7982
curl -s -H "Authorization: $API_KEY" "https://g.codefresh.io/api/analytics/reports/activeCommiters?granularity=month&dateRange=${START_DATE}&dateRange=${END_DATE}" | jq .
8083
```
8184

82-
###Suggested script
85+
##Suggested script
8386

8487
```
8588
#!/bin/bash
@@ -97,6 +100,24 @@ curl -s -H "Authorization: $API_KEY" "https://g.codefresh.io/api/analytics/rep
97100
# Adapt the endpoint for pipelineCreditConsumption or activeCommiters as needed.
98101
```
99102

103+
##Error handling
104+
105+
The API can return errors. Known error types and typical messages:
106+
107+
- BadRequestError (400)
108+
- "Invalid report name" — check the report name for typos.
109+
- "Passed structure is invalid -[Time dimensions are not supported for target report: {reportName}]" — invalid combination of date range and granularity. Different reports support different parameter combinations (for example, creditConsumption with daily granularity supports a maximum range of 45 days).
110+
- "Filter by account id is not allowed by user params" — invalid filter parameter.
111+
112+
- AuthError (403)
113+
- "Permission denied" — the API key/user is not authorized to access the requested report.
114+
115+
- ReportExecutionError (432)
116+
- "analytics report not finished yet" — the report is still being generated. Retry the same request later (common when requesting large periods with no pre-aggregated cache).
117+
118+
- InternalServerError (500)
119+
- "Could not get analytics report" — no data available for the requested combination of parameters (period/granularity/filters).
120+
100121
##Best practices
101122

102123
- Use the**metadata** endpoint to confirm available reports and supported query parameters.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp