라이선스
REST API를 사용하여 엔터프라이즈 라이선스에 대한 정보를 검색합니다.
이러한 엔드포인트는 인증된 사이트 관리자만 사용할 수 있습니다. 일반 사용자는 응답을 받습니다 404
.
이러한 엔드포인트는 personal access token (classic)를 사용하는 인증만 지원합니다. 자세한 내용은 "개인용 액세스 토큰 만들기"을 참조하세요.
List enterprise consumed licenses
Lists the license consumption information for all users, including those from connected servers, associated with an enterprise.
To use this endpoint, you must be an enterprise admin, and you must use an access
token with the read:enterprise
scope.
"List enterprise consumed licenses"에 대한 매개 변수
헤더 |
---|
Name, 형식, 설명 |
accept string Setting to |
경로 매개 변수 |
Name, 형식, 설명 |
enterprise string 필수The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
쿼리 매개 변수 |
Name, 형식, 설명 |
per_page integer The number of results per page (max 100). 기본값: |
page integer Page number of the results to fetch. 기본값: |
"List enterprise consumed licenses"에 대한 HTTP 응답 상태 코드
상태 코드 | Description |
---|---|
200 | Consumed Licenses Response |
"List enterprise consumed licenses"에 대한 코드 샘플
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/consumed-licenses
Consumed Licenses Response
Status: 200
{
"total_seats_consumed": 5000,
"total_seats_purchased": 4500,
"users": [
{
"github_com_login": "monalisa",
"github_com_name": "Mona Lisa",
"enterprise_server_user_ids": [
"example_host_name.com:123",
"example_host_name_2:222"
],
"github_com_user": true,
"enterprise_server_user": true,
"visual_studio_subscription_user": false,
"license_type": "enterprise",
"github_com_profile": "https://github.com/monalisa",
"github_com_member_roles": [
"org1:Owner",
"org2:Owner"
],
"github_com_enterprise_roles": [
"owner"
],
"github_com_verified_domain_emails": [
"monalisa@github.com"
],
"github_com_saml_name_id": "monalisa",
"github_com_orgs_with_pending_invites": [
"org1",
"org2"
],
"github_com_two_factor_auth": true,
"enterprise_server_primary_emails": [
"monalisa@github.com"
],
"visual_studio_license_status": "",
"visual_studio_subscription_email": "",
"total_user_accounts": 3
},
{
"github_com_login": "",
"github_com_name": "",
"enterprise_server_user_ids": [
"example_host_name:123"
],
"github_com_user": false,
"enterprise_server_user": true,
"visual_studio_subscription_user": false,
"license_type": "enterprise",
"github_com_profile": "",
"github_com_member_roles": [],
"github_com_enterprise_role": "",
"github_com_enterprise_roles": [],
"github_com_verified_domain_emails": [],
"github_com_saml_name_id": "",
"github_com_orgs_with_pending_invites": [],
"github_com_two_factor_auth": "",
"enterprise_server_emails": [
"hubot@example.com"
],
"visual_studio_license_status": "",
"visual_studio_subscription_email": "",
"total_user_accounts": 1
}
]
}
Get a license sync status
Gets information about the status of a license sync job for an enterprise.
To use this endpoint, you must be an enterprise admin, and you must use an access
token with the read:enterprise
scope.
"Get a license sync status"에 대한 매개 변수
헤더 |
---|
Name, 형식, 설명 |
accept string Setting to |
경로 매개 변수 |
Name, 형식, 설명 |
enterprise string 필수The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
"Get a license sync status"에 대한 HTTP 응답 상태 코드
상태 코드 | Description |
---|---|
200 | License Sync Status Response |
"Get a license sync status"에 대한 코드 샘플
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/license-sync-status
License Sync Status Response
Status: 200
{
"server_instances": [
{
"server_id": "deadbeef1",
"hostname": "github.example.com",
"last_sync": {
"date": "2020-01-01T00:00:00Z",
"status": "success",
"error": ""
}
},
{
"server_id": "filetoffish1",
"hostname": "github2.example.com",
"last_sync": {
"date": "2020-01-01T00:00:00Z",
"status": "success",
"error": ""
}
}
]
}