사용 보고서
REST API를 사용하여 엔터프라이즈에 대한 사용 보고서 내보내기를 만들고 조회합니다.
List usage report exports
Note
This endpoint is in public preview and is subject to change.
Lists all usage report exports for an enterprise. The authenticated user must be an enterprise admin or billing manager.
"List usage report exports"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰에는 다음 권한 집합이 있어야 합니다.:
- "Enterprise administration" enterprise permissions (write)
"List usage report exports"에 대한 매개 변수
| 속성, 형식, 설명 |
|---|
accept string Setting to |
| 속성, 형식, 설명 |
|---|
enterprise string RequiredThe slug version of the enterprise name. |
"List usage report exports"에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 |
|---|---|
200 | List of usage report exports |
401 | Requires authentication |
403 | Forbidden |
404 | Resource not found |
500 | Internal Error |
503 | Service unavailable |
"List usage report exports"에 대한 코드 샘플
GHE.com에서 GitHub에 액세스하는 경우 api.github.com을 api.SUBDOMAIN.ghe.com의 엔터프라이즈 전용 하위 도메인으로 바꾸세요.
요청 예제
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/enterprises/ENTERPRISE/settings/billing/reportsList of usage report exports
Status: 200{
"usage_report_exports": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"report_type": "detailed",
"start_date": "2024-01-01",
"end_date": "2024-01-31",
"status": "completed",
"download_urls": [
"https://github.com/enterprises/github/metered_exports/1234"
],
"created_at": "2024-01-15T10:30:00Z",
"actor": "monalisa"
},
{
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"report_type": "summarized",
"start_date": "2024-01-01",
"end_date": "2024-01-31",
"status": "processing",
"created_at": "2024-01-14T09:00:00Z",
"actor": "monalisa"
},
{
"id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"report_type": "premium_request",
"start_date": "2024-01-01",
"end_date": "2024-01-31",
"status": "processing",
"created_at": "2024-01-13T08:00:00Z",
"actor": "octocat"
}
]
}Create a usage report export
Note
This endpoint is in public preview and is subject to change.
Initiates the generation of a usage report export for an enterprise. The report will be processed asynchronously and can be downloaded once completed. The authenticated user must be an enterprise admin or billing manager.
"Create a usage report export"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰에는 다음 권한 집합이 있어야 합니다.:
- "Enterprise administration" enterprise permissions (write)
"Create a usage report export"에 대한 매개 변수
| 속성, 형식, 설명 |
|---|
accept string Setting to |
| 속성, 형식, 설명 |
|---|
enterprise string RequiredThe slug version of the enterprise name. |
| 속성, 형식, 설명 |
|---|
report_type string RequiredThe type of usage report to generate 다음 중 하나일 수 있습니다.: |
start_date string RequiredThe start date for the report in YYYY-MM-DD format |
end_date string The end date for the report in YYYY-MM-DD format. Defaults to today (UTC) if not provided. |
send_email boolean Whether to send an email notification to the requester when the report is ready. Defaults to false. 기본값: |
"Create a usage report export"에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 |
|---|---|
202 | Report export request accepted |
400 | Bad Request |
401 | Requires authentication |
403 | Forbidden |
404 | Resource not found |
500 | Internal Error |
503 | Service unavailable |
"Create a usage report export"에 대한 코드 샘플
GHE.com에서 GitHub에 액세스하는 경우 api.github.com을 api.SUBDOMAIN.ghe.com의 엔터프라이즈 전용 하위 도메인으로 바꾸세요.
요청 예제
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/enterprises/ENTERPRISE/settings/billing/reports \
-d '{"report_type":"detailed","start_date":"2024-01-01","end_date":"2024-01-31"}'Report export request accepted
Status: 202{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"report_type": "detailed",
"start_date": "2024-01-01",
"end_date": "2024-01-31",
"status": "completed",
"download_urls": [
"https://github.com/enterprises/github/metered_exports/1234"
],
"created_at": "2024-01-15T10:30:00Z",
"actor": "monalisa"
}Get a usage report export
Note
This endpoint is in public preview and is subject to change.
Gets the status and details of a usage report export by ID. The authenticated user must be an enterprise admin or billing manager.
"Get a usage report export"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰에는 다음 권한 집합이 있어야 합니다.:
- "Enterprise administration" enterprise permissions (write)
"Get a usage report export"에 대한 매개 변수
| 속성, 형식, 설명 |
|---|
accept string Setting to |
| 속성, 형식, 설명 |
|---|
enterprise string RequiredThe slug version of the enterprise name. |
report_id string RequiredThe unique identifier (UUID) for the usage report export. |
"Get a usage report export"에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 |
|---|---|
200 | Usage report export details |
401 | Requires authentication |
403 | Forbidden |
404 | Resource not found |
500 | Internal Error |
503 | Service unavailable |
"Get a usage report export"에 대한 코드 샘플
GHE.com에서 GitHub에 액세스하는 경우 api.github.com을 api.SUBDOMAIN.ghe.com의 엔터프라이즈 전용 하위 도메인으로 바꾸세요.
요청 예제
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/enterprises/ENTERPRISE/settings/billing/reports/REPORT_IDUsage report export details
Status: 200{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"report_type": "detailed",
"start_date": "2024-01-01",
"end_date": "2024-01-31",
"status": "completed",
"download_urls": [
"https://github.com/enterprises/github/metered_exports/1234"
],
"created_at": "2024-01-15T10:30:00Z",
"actor": "monalisa"
}