Diese Version von GitHub Enterprise Server wurde eingestellt am 2024-12-19. Es wird keine Patch-Freigabe vorgenommen, auch nicht für kritische Sicherheitsprobleme. Für bessere Leistung, verbesserte Sicherheit und neue Features aktualisiere auf die neueste Version von GitHub Enterprise Server. Wende dich an den GitHub Enterprise-Support, um Hilfe zum Upgrade zu erhalten.
REST-API-Endpunkte für Administratorstatistiken
Verwende die REST-API, um eine Vielzahl von Metriken zu deiner Installation abzurufen.
Informationen zu Administratorstatistiken
Diese Endpunkte sind nur für authentifizierte Websiteadministrator*innen verfügbar. Normale Benutzer erhalten eine 404-Antwort.
Note
Diese Endpunkte unterstützen nur die Authentifizierung über ein personal access token (classic). Weitere Informationen finden Sie unter Verwalten deiner persönlichen Zugriffstoken.
Get all statistics
Differenzierte Zugriffstoken für "Get all statistics"
Dieser Endpunkt funktioniert nicht mit GitHub-App-Benutzerzugriffstoken, GitHub-App-Installationszugriffstoken oder differenzierten persönlichen Zugriffstoken.
HTTP-Antwortstatuscodes für „Get all statistics“
| Statuscode | BESCHREIBUNG |
|---|---|
200 | OK |
Codebeispiele für „Get all statistics“
Anforderungsbeispiel
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/enterprise/stats/allResponse
Status: 200{
"repos": {
"total_repos": 212,
"root_repos": 194,
"fork_repos": 18,
"org_repos": 51,
"total_pushes": 3082,
"total_wikis": 15
},
"hooks": {
"total_hooks": 27,
"active_hooks": 23,
"inactive_hooks": 4
},
"pages": {
"total_pages": 36
},
"orgs": {
"total_orgs": 33,
"disabled_orgs": 0,
"total_teams": 60,
"total_team_members": 314
},
"users": {
"total_users": 254,
"admin_users": 45,
"suspended_users": 21
},
"pulls": {
"total_pulls": 86,
"merged_pulls": 60,
"mergeable_pulls": 21,
"unmergeable_pulls": 3
},
"issues": {
"total_issues": 179,
"open_issues": 83,
"closed_issues": 96
},
"milestones": {
"total_milestones": 7,
"open_milestones": 6,
"closed_milestones": 1
},
"gists": {
"total_gists": 178,
"private_gists": 151,
"public_gists": 25
},
"comments": {
"total_commit_comments": 6,
"total_gist_comments": 28,
"total_issue_comments": 366,
"total_pull_request_comments": 30
}
}Get comment statistics
Differenzierte Zugriffstoken für "Get comment statistics"
Dieser Endpunkt funktioniert nicht mit GitHub-App-Benutzerzugriffstoken, GitHub-App-Installationszugriffstoken oder differenzierten persönlichen Zugriffstoken.
HTTP-Antwortstatuscodes für „Get comment statistics“
| Statuscode | BESCHREIBUNG |
|---|---|
200 | OK |
Codebeispiele für „Get comment statistics“
Anforderungsbeispiel
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/enterprise/stats/commentsResponse
Status: 200{
"total_commit_comments": 5000,
"total_gist_comments": 400,
"total_issue_comments": 10900,
"total_pull_request_comments": 9900
}Get gist statistics
Differenzierte Zugriffstoken für "Get gist statistics"
Dieser Endpunkt funktioniert nicht mit GitHub-App-Benutzerzugriffstoken, GitHub-App-Installationszugriffstoken oder differenzierten persönlichen Zugriffstoken.
HTTP-Antwortstatuscodes für „Get gist statistics“
| Statuscode | BESCHREIBUNG |
|---|---|
200 | OK |
Codebeispiele für „Get gist statistics“
Anforderungsbeispiel
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/enterprise/stats/gistsResponse
Status: 200{
"total_gists": 500,
"private_gists": 30,
"public_gists": 470
}Get hooks statistics
Differenzierte Zugriffstoken für "Get hooks statistics"
Dieser Endpunkt funktioniert nicht mit GitHub-App-Benutzerzugriffstoken, GitHub-App-Installationszugriffstoken oder differenzierten persönlichen Zugriffstoken.
HTTP-Antwortstatuscodes für „Get hooks statistics“
| Statuscode | BESCHREIBUNG |
|---|---|
200 | OK |
Codebeispiele für „Get hooks statistics“
Anforderungsbeispiel
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/enterprise/stats/hooksResponse
Status: 200{
"total_hooks": 50,
"active_hooks": 47,
"inactive_hooks": 3
}Get issue statistics
Differenzierte Zugriffstoken für "Get issue statistics"
Dieser Endpunkt funktioniert nicht mit GitHub-App-Benutzerzugriffstoken, GitHub-App-Installationszugriffstoken oder differenzierten persönlichen Zugriffstoken.
HTTP-Antwortstatuscodes für „Get issue statistics“
| Statuscode | BESCHREIBUNG |
|---|---|
200 | OK |
Codebeispiele für „Get issue statistics“
Anforderungsbeispiel
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/enterprise/stats/issuesResponse
Status: 200{
"total_issues": 5000,
"open_issues": 300,
"closed_issues": 4700
}Get milestone statistics
Differenzierte Zugriffstoken für "Get milestone statistics"
Dieser Endpunkt funktioniert nicht mit GitHub-App-Benutzerzugriffstoken, GitHub-App-Installationszugriffstoken oder differenzierten persönlichen Zugriffstoken.
HTTP-Antwortstatuscodes für „Get milestone statistics“
| Statuscode | BESCHREIBUNG |
|---|---|
200 | OK |
Codebeispiele für „Get milestone statistics“
Anforderungsbeispiel
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/enterprise/stats/milestonesResponse
Status: 200{
"total_milestones": 90,
"open_milestones": 10,
"closed_milestones": 80
}Get organization statistics
Differenzierte Zugriffstoken für "Get organization statistics"
Dieser Endpunkt funktioniert nicht mit GitHub-App-Benutzerzugriffstoken, GitHub-App-Installationszugriffstoken oder differenzierten persönlichen Zugriffstoken.
HTTP-Antwortstatuscodes für „Get organization statistics“
| Statuscode | BESCHREIBUNG |
|---|---|
200 | OK |
Codebeispiele für „Get organization statistics“
Anforderungsbeispiel
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/enterprise/stats/orgsResponse
Status: 200{
"total_orgs": 50,
"disabled_orgs": 1,
"total_teams": 70,
"total_team_members": 700
}Get pages statistics
Differenzierte Zugriffstoken für "Get pages statistics"
Dieser Endpunkt funktioniert nicht mit GitHub-App-Benutzerzugriffstoken, GitHub-App-Installationszugriffstoken oder differenzierten persönlichen Zugriffstoken.
HTTP-Antwortstatuscodes für „Get pages statistics“
| Statuscode | BESCHREIBUNG |
|---|---|
200 | OK |
Codebeispiele für „Get pages statistics“
Anforderungsbeispiel
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/enterprise/stats/pagesResponse
Status: 200{
"total_pages": 20
}Get pull request statistics
Differenzierte Zugriffstoken für "Get pull request statistics"
Dieser Endpunkt funktioniert nicht mit GitHub-App-Benutzerzugriffstoken, GitHub-App-Installationszugriffstoken oder differenzierten persönlichen Zugriffstoken.
HTTP-Antwortstatuscodes für „Get pull request statistics“
| Statuscode | BESCHREIBUNG |
|---|---|
200 | OK |
Codebeispiele für „Get pull request statistics“
Anforderungsbeispiel
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/enterprise/stats/pullsResponse
Status: 200{
"total_pulls": 1200,
"merged_pulls": 1100,
"mergeable_pulls": 90,
"unmergeable_pulls": 10
}Get repository statistics
Differenzierte Zugriffstoken für "Get repository statistics"
Dieser Endpunkt funktioniert nicht mit GitHub-App-Benutzerzugriffstoken, GitHub-App-Installationszugriffstoken oder differenzierten persönlichen Zugriffstoken.
HTTP-Antwortstatuscodes für „Get repository statistics“
| Statuscode | BESCHREIBUNG |
|---|---|
200 | OK |
Codebeispiele für „Get repository statistics“
Anforderungsbeispiel
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/enterprise/stats/reposResponse
Status: 200{
"total_repos": 200,
"root_repos": 1,
"fork_repos": 10,
"org_repos": 150,
"total_pushes": 39000,
"total_wikis": 5
}Get security products statistics
Gets the statistics about security products for a GitHub Enterprise Server instance.
To use this endpoint, you must be a site admin.
Differenzierte Zugriffstoken für "Get security products statistics"
Dieser Endpunkt funktioniert nicht mit GitHub-App-Benutzerzugriffstoken, GitHub-App-Installationszugriffstoken oder differenzierten persönlichen Zugriffstoken.
HTTP-Antwortstatuscodes für „Get security products statistics“
| Statuscode | BESCHREIBUNG |
|---|---|
200 | OK |
Codebeispiele für „Get security products statistics“
Anforderungsbeispiel
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/enterprise/stats/security-productsResponse
Status: 200{
"total_repos": 150,
"nonarchived_repos": 130,
"secret_scanning_enabled_repos": 150,
"secret_scanning_push_protection_enabled_repos": 120,
"code_scanning_enabled_repos": 140,
"code_scanning_pr_reviews_enabled_repos": 100,
"code_scanning_default_setup_enabled_repos": 50,
"code_scanning_default_setup_eligible_repos": 30,
"dependabot_alerts_enabled_repos": 130,
"dependabot_security_updates_enabled_repos": 120,
"dependabot_version_updates_enabled_repos": 121,
"advanced_security_enabled_repos": 150,
"active_committers": 30,
"purchased_committers": 90,
"maximum_committers": 80
}Get users statistics
Differenzierte Zugriffstoken für "Get users statistics"
Dieser Endpunkt funktioniert nicht mit GitHub-App-Benutzerzugriffstoken, GitHub-App-Installationszugriffstoken oder differenzierten persönlichen Zugriffstoken.
HTTP-Antwortstatuscodes für „Get users statistics“
| Statuscode | BESCHREIBUNG |
|---|---|
200 | OK |
Codebeispiele für „Get users statistics“
Anforderungsbeispiel
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/enterprise/stats/usersResponse
Status: 200{
"total_users": 100,
"admin_users": 3,
"suspended_users": 1
}