Skip to content

Commit

Permalink
feat: add new Enterprise licenses APIs (`GET /enterprises/{enterprise…
Browse files Browse the repository at this point in the history
…}/consumed-licenses`, `GET /enterprises/{enterprise}/license-sync-status`) (#224)

WIP
  • Loading branch information
octokitbot committed Aug 16, 2022
1 parent bd874aa commit c4ddcb2
Show file tree
Hide file tree
Showing 17 changed files with 607 additions and 16 deletions.
322 changes: 319 additions & 3 deletions cache/api.github.com.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"openapi": "3.0.3",
"info": {
"version": "7.1.0",
"version": "7.2.0",
"title": "GitHub's official OpenAPI spec + Octokit extension",
"description": "OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs",
"license": {
Expand Down Expand Up @@ -3576,6 +3576,105 @@
"x-octokit": {}
}
},
"/enterprises/{enterprise}/consumed-licenses": {
"get": {
"summary": "List enterprise consumed licenses",
"description": "Lists the license consumption information for all users, including those from connected servers, associated with an enterprise.\nTo use this endpoint, you must be an enterprise admin, and you must use an access\ntoken with the `read:enterprise` scope.",
"tags": [
"enterprise-admin"
],
"operationId": "enterprise-admin/get-consumed-licenses",
"externalDocs": {
"description": "API method documentation",
"url": "https://docs.github.com/rest/reference/enterprise-admin#list-enterprise-consumed-licenses"
},
"parameters": [
{
"$ref": "#/components/parameters/enterprise"
},
{
"$ref": "#/components/parameters/per-page"
},
{
"$ref": "#/components/parameters/page"
}
],
"responses": {
"200": {
"description": "Consumed Licenses Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/get-consumed-licenses"
},
"examples": {
"default": {
"$ref": "#/components/examples/get-consumed-licenses"
}
}
}
},
"headers": {
"Link": {
"$ref": "#/components/headers/link"
}
}
}
},
"x-github": {
"githubCloudOnly": true,
"enabledForGitHubApps": false,
"previews": [],
"category": "enterprise-admin",
"subcategory": "license"
},
"x-octokit": {}
}
},
"/enterprises/{enterprise}/license-sync-status": {
"get": {
"summary": "Get a license sync status",
"description": "Gets information about the status of a license sync job for an enterprise.\nTo use this endpoint, you must be an enterprise admin, and you must use an access\ntoken with the `read:enterprise` scope.",
"tags": [
"enterprise-admin"
],
"operationId": "enterprise-admin/get-license-sync-status",
"externalDocs": {
"description": "API method documentation",
"url": "https://docs.github.com/rest/reference/enterprise-admin#get-a-license-sync-status"
},
"parameters": [
{
"$ref": "#/components/parameters/enterprise"
}
],
"responses": {
"200": {
"description": "License Sync Status Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/get-license-sync-status"
},
"examples": {
"default": {
"$ref": "#/components/examples/get-license-sync-status"
}
}
}
}
}
},
"x-github": {
"githubCloudOnly": true,
"enabledForGitHubApps": false,
"previews": [],
"category": "enterprise-admin",
"subcategory": "license"
},
"x-octokit": {}
}
},
"/enterprises/{enterprise}/secret-scanning/alerts": {
"get": {
"summary": "List secret scanning alerts for an enterprise",
Expand Down Expand Up @@ -28018,8 +28117,8 @@
"examples": {
"default": {
"value": {
"repository_id": 1,
"ref": "main"
"ref": "main",
"machine": "standardLinux32gb"
}
}
}
Expand Down Expand Up @@ -28057,6 +28156,9 @@
}
}
},
"400": {
"$ref": "#/components/responses/bad_request"
},
"401": {
"$ref": "#/components/responses/requires_authentication"
},
Expand Down Expand Up @@ -58591,6 +58693,12 @@
"text/plain": {
"schema": {
"type": "string"
},
"examples": {
"default": {
"summary": "Example response",
"value": "Responsive is better than fast"
}
}
}
}
Expand Down Expand Up @@ -62568,6 +62676,129 @@
"repository"
]
},
"get-consumed-licenses": {
"title": "Enterprise Consumed Licenses",
"description": "A breakdown of the licenses consumed by an enterprise.",
"properties": {
"total_seats_consumed": {
"type": "integer"
},
"total_seats_purchased": {
"type": "integer"
},
"users": {
"type": "array",
"items": {
"type": "object",
"properties": {
"github_com_login": {
"type": "string"
},
"github_com_name": {
"type": "string",
"nullable": true
},
"github_com_profile": {
"type": "string",
"nullable": true
},
"license_type": {
"type": "string"
},
"github_com_member_roles": {
"type": "array",
"items": {
"type": "string"
}
},
"github_com_enterprise_role": {
"type": "string",
"nullable": true
},
"visual_studio_subscription_user": {
"type": "boolean"
},
"github_com_verified_domain_emails": {
"type": "array",
"items": {
"type": "string"
}
},
"github_com_saml_name_id": {
"type": "string",
"nullable": true
},
"enterprise_server_user": {
"type": "boolean",
"nullable": true
},
"enterprise_server_emails": {
"type": "array",
"items": {
"type": "string"
}
},
"github_com_user": {
"type": "boolean"
},
"total_user_accounts": {
"type": "integer"
},
"enterprise_server_user_ids": {
"type": "array",
"items": {
"type": "string"
}
},
"github_com_orgs_with_pending_invites": {
"type": "array",
"items": {
"type": "string"
}
},
"visual_studio_subscription_email": {
"type": "string",
"nullable": true
}
}
}
}
}
},
"get-license-sync-status": {
"title": "License Sync Status",
"description": "Information about the status of a license sync job for an enterprise.",
"properties": {
"server_instances": {
"type": "array",
"items": {
"type": "object",
"properties": {
"server_id": {
"type": "string"
},
"hostname": {
"type": "string"
},
"last_sync": {
"type": "object",
"properties": {
"date": {
"type": "string"
},
"status": {
"type": "string"
},
"error": {
"type": "string"
}
}
}
}
}
}
}
},
"nullable-alert-updated-at": {
"type": "string",
"description": "The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.",
Expand Down Expand Up @@ -88818,6 +89049,91 @@
}
]
},
"get-consumed-licenses": {
"value": {
"total_seats_consumed": 5000,
"total_seats_purchased": 4500,
"users": [
{
"enterprise_server_emails": [
"monalisa@github.com"
],
"github_com_login": "monalisa",
"github_com_name": "Mona Lisa",
"github_com_profile": "https://github.com/monalisa",
"license_type": "enterprise",
"github_com_member_roles": [
"org1:Owner",
"org2:Owner"
],
"github_com_enterprise_role": "owner",
"visual_studio_subscription_user": false,
"github_com_verified_domain_emails": [
"monalisa@github.com"
],
"github_com_saml_name_id": "monalisa",
"enterprise_server_user": true,
"github_com_user": true,
"total_user_accounts": 3,
"enterprise_server_user_ids": [
"example_host_name.com:123",
"example_host_name_2:222"
],
"github_com_orgs_with_pending_invites": [
"org1",
"org2"
],
"visual_studio_subscription_email": ""
},
{
"enterprise_server_emails": [
"deleonjavier@example.com"
],
"github_com_login": "",
"github_com_name": "",
"github_com_profile": "",
"license_type": "enterprise",
"github_com_member_roles": [],
"github_com_enterprise_role": "",
"visual_studio_subscription_user": false,
"github_com_verified_domain_emails": [],
"github_com_saml_name_id": "",
"enterprise_server_user": true,
"github_com_user": false,
"total_user_accounts": 1,
"enterprise_server_user_ids": [
"example_host_name:123"
],
"github_com_orgs_with_pending_invites": [],
"visual_studio_subscription_email": ""
}
]
}
},
"get-license-sync-status": {
"value": {
"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": ""
}
}
]
}
},
"organization-secret-scanning-alert-list": {
"value": [
{
Expand Down
8 changes: 7 additions & 1 deletion cache/ghes-3.2.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"openapi": "3.0.3",
"info": {
"version": "7.1.0",
"version": "7.2.0",
"title": "GitHub's official OpenAPI spec + Octokit extension",
"description": "OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs",
"license": {
Expand Down Expand Up @@ -49784,6 +49784,12 @@
"text/plain": {
"schema": {
"type": "string"
},
"examples": {
"default": {
"summary": "Example response",
"value": "Responsive is better than fast"
}
}
}
}
Expand Down
Loading

0 comments on commit c4ddcb2

Please sign in to comment.