このバージョンの GitHub Enterprise サーバーはこの日付をもって終了となりました: 2024-03-26. 重大なセキュリティの問題に対してであっても、パッチリリースは作成されません。 パフォーマンスの向上、セキュリティの向上、新機能の向上を図るために、最新バージョンの GitHub Enterprise サーバーにアップグレードしてください。 アップグレードに関するヘルプについては、GitHub Enterprise サポートにお問い合わせください。
サイト管理者が Enterprise Server インスタンスを Enterprise Server 3.9 以降にアップグレードすると、REST API はバージョン管理されます。 インスタンスのバージョンを検索する方法については、「GitHub Docs のバージョンについて」を参照してください。 詳細については、「API のバージョン管理について」を参照してください。
管理統計の REST API エンドポイント
REST API を使って、インストールに関するさまざまなメトリックを取得します。
Get all statistics
"Get all statistics" の HTTP 応答状態コード
| 状態コード | 説明 |
|---|---|
200 | OK |
"Get all statistics" のコード サンプル
要求の例
get/enterprise/stats/all
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
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
"Get comment statistics" の HTTP 応答状態コード
| 状態コード | 説明 |
|---|---|
200 | OK |
"Get comment statistics" のコード サンプル
要求の例
get/enterprise/stats/comments
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
http(s)://HOSTNAME/api/v3/enterprise/stats/commentsResponse
Get gist statistics
"Get gist statistics" の HTTP 応答状態コード
| 状態コード | 説明 |
|---|---|
200 | OK |
"Get gist statistics" のコード サンプル
要求の例
get/enterprise/stats/gists
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
http(s)://HOSTNAME/api/v3/enterprise/stats/gistsResponse
Get hooks statistics
"Get hooks statistics" の HTTP 応答状態コード
| 状態コード | 説明 |
|---|---|
200 | OK |
"Get hooks statistics" のコード サンプル
要求の例
get/enterprise/stats/hooks
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
http(s)://HOSTNAME/api/v3/enterprise/stats/hooksResponse
Get issue statistics
"Get issue statistics" の HTTP 応答状態コード
| 状態コード | 説明 |
|---|---|
200 | OK |
"Get issue statistics" のコード サンプル
要求の例
get/enterprise/stats/issues
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
http(s)://HOSTNAME/api/v3/enterprise/stats/issuesResponse
Get milestone statistics
"Get milestone statistics" の HTTP 応答状態コード
| 状態コード | 説明 |
|---|---|
200 | OK |
"Get milestone statistics" のコード サンプル
要求の例
get/enterprise/stats/milestones
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
http(s)://HOSTNAME/api/v3/enterprise/stats/milestonesResponse
Get organization statistics
"Get organization statistics" の HTTP 応答状態コード
| 状態コード | 説明 |
|---|---|
200 | OK |
"Get organization statistics" のコード サンプル
要求の例
get/enterprise/stats/orgs
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
http(s)://HOSTNAME/api/v3/enterprise/stats/orgsResponse
Get pages statistics
"Get pages statistics" の HTTP 応答状態コード
| 状態コード | 説明 |
|---|---|
200 | OK |
"Get pages statistics" のコード サンプル
要求の例
get/enterprise/stats/pages
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
http(s)://HOSTNAME/api/v3/enterprise/stats/pagesResponse
Get pull request statistics
"Get pull request statistics" の HTTP 応答状態コード
| 状態コード | 説明 |
|---|---|
200 | OK |
"Get pull request statistics" のコード サンプル
要求の例
get/enterprise/stats/pulls
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
http(s)://HOSTNAME/api/v3/enterprise/stats/pullsResponse
Get repository statistics
"Get repository statistics" の HTTP 応答状態コード
| 状態コード | 説明 |
|---|---|
200 | OK |
"Get repository statistics" のコード サンプル
要求の例
get/enterprise/stats/repos
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
http(s)://HOSTNAME/api/v3/enterprise/stats/reposResponse
Get users statistics
"Get users statistics" の HTTP 応答状態コード
| 状態コード | 説明 |
|---|---|
200 | OK |
"Get users statistics" のコード サンプル
要求の例
get/enterprise/stats/users
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
http(s)://HOSTNAME/api/v3/enterprise/stats/usersResponse