Skip to main content
이제 REST API의 버전이 지정되었습니다. 자세한 내용은 "API 버전 관리 정보"를 참조하세요.

Codespaces 컴퓨터에 대한 REST API 엔드포인트

REST API를 사용하여 codespace에 대한 컴퓨터 형식의 사용 가능성을 관리합니다.

Codespaces 컴퓨터 정보

지정된 리포지토리 또는 인증된 사용자로 codespace를 만드는 데 사용할 수 있는 머신 유형을 결정할 수 있습니다. 자세한 내용은 "codespace에 대한 컴퓨터 유형 변경"을(를) 참조하세요.

machine 속성을 업데이트하여 기존 codespace의 머신을 변경할 때 이 정보를 사용할 수도 있습니다. 머신 업데이트는 다음에 codespace를 다시 시작할 때 수행됩니다. 자세한 내용은 "codespace에 대한 컴퓨터 유형 변경"을(를) 참조하세요.

List available machine types for a repository

List the machine types available for a given repository based on its configuration.

OAuth app tokens and personal access tokens (classic) need the codespace scope to use this endpoint.

"List available machine types for a repository"에 대한 세분화된 액세스 토큰

이 엔드포인트는 다음 토큰 형식에서 작동합니다.:

토큰에 다음 권한 집합이 있어야 합니다.:

  • codespaces_metadata:read

"List available machine types for a repository"에 대한 매개 변수

헤더
이름, Type, 설명
accept string

Setting to application/vnd.github+json is recommended.

경로 매개 변수
이름, Type, 설명
owner string Required

The account owner of the repository. The name is not case sensitive.

repo string Required

The name of the repository without the .git extension. The name is not case sensitive.

쿼리 매개 변수
이름, Type, 설명
location string

The location to check for available machines. Assigned by IP if not provided.

client_ip string

IP for location auto-detection when proxying a request

ref string

The branch or commit to check for prebuild availability and devcontainer restrictions.

"List available machine types for a repository"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

OK

304

Not modified

401

Requires authentication

403

Forbidden

404

Resource not found

500

Internal Error

"List available machine types for a repository"에 대한 코드 샘플

요청 예제

get/repos/{owner}/{repo}/codespaces/machines
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/repos/OWNER/REPO/codespaces/machines

Response

Status: 200
{ "total_count": 2, "machines": [ { "name": "standardLinux", "display_name": "4 cores, 16 GB RAM, 64 GB storage", "operating_system": "linux", "storage_in_bytes": 68719476736, "memory_in_bytes": 17179869184, "cpus": 4 }, { "name": "premiumLinux", "display_name": "8 cores, 32 GB RAM, 64 GB storage", "operating_system": "linux", "storage_in_bytes": 68719476736, "memory_in_bytes": 34359738368, "cpus": 8 } ] }

List machine types for a codespace

List the machine types a codespace can transition to use.

OAuth app tokens and personal access tokens (classic) need the codespace scope to use this endpoint.

"List machine types for a codespace"에 대한 세분화된 액세스 토큰

이 엔드포인트는 다음 토큰 형식에서 작동합니다.:

토큰에 다음 권한 집합이 있어야 합니다.:

  • codespaces_metadata:read

"List machine types for a codespace"에 대한 매개 변수

헤더
이름, Type, 설명
accept string

Setting to application/vnd.github+json is recommended.

경로 매개 변수
이름, Type, 설명
codespace_name string Required

The name of the codespace.

"List machine types for a codespace"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

OK

304

Not modified

401

Requires authentication

403

Forbidden

404

Resource not found

500

Internal Error

"List machine types for a codespace"에 대한 코드 샘플

요청 예제

get/user/codespaces/{codespace_name}/machines
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/user/codespaces/CODESPACE_NAME/machines

Response

Status: 200
{ "total_count": 2, "machines": [ { "name": "standardLinux", "display_name": "4 cores, 16 GB RAM, 64 GB storage", "operating_system": "linux", "storage_in_bytes": 68719476736, "memory_in_bytes": 17179869184, "cpus": 4 }, { "name": "premiumLinux", "display_name": "8 cores, 32 GB RAM, 64 GB storage", "operating_system": "linux", "storage_in_bytes": 68719476736, "memory_in_bytes": 34359738368, "cpus": 8 } ] }