Codespaces 머신
REST API를 사용하여 codespace에 대한 컴퓨터 형식의 가용성을 관리합니다.
Codespaces 머신 정보
지정된 리포지토리 또는 인증된 사용자로 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.
You must authenticate using an access token with the codespace scope to use this endpoint.
GitHub Apps must have write access to the codespaces_metadata repository permission to use this endpoint.
매개 변수
| Headers |
|---|
| Name, Type, Description |
acceptstringSetting to |
| Path parameters |
| Name, Type, Description |
ownerstringRequiredThe account owner of the repository. The name is not case sensitive. |
repostringRequiredThe name of the repository. The name is not case sensitive. |
| Query parameters |
| Name, Type, Description |
locationstringThe location to check for available machines. Assigned by IP if not provided. |
client_ipstringIP for location auto-detection when proxying a request |
HTTP 응답 상태 코드
| 상태 코드 | 설명 |
|---|---|
200 | OK |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
404 | Resource not found |
500 | Internal Error |
코드 샘플
curl \
-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/machinesResponse
Status: 200{
"total_count": 2,
"machines": [
{
"name": "standardLinux",
"display_name": "4 cores, 8 GB RAM, 64 GB storage",
"operating_system": "linux",
"storage_in_bytes": 68719476736,
"memory_in_bytes": 8589934592,
"cpus": 4
},
{
"name": "premiumLinux",
"display_name": "8 cores, 16 GB RAM, 64 GB storage",
"operating_system": "linux",
"storage_in_bytes": 68719476736,
"memory_in_bytes": 17179869184,
"cpus": 8
}
]
}List machine types for a codespace
List the machine types a codespace can transition to use.
You must authenticate using an access token with the codespace scope to use this endpoint.
GitHub Apps must have read access to the codespaces_metadata repository permission to use this endpoint.
매개 변수
| Headers |
|---|
| Name, Type, Description |
acceptstringSetting to |
| Path parameters |
| Name, Type, Description |
codespace_namestringRequiredThe name of the codespace. |
HTTP 응답 상태 코드
| 상태 코드 | 설명 |
|---|---|
200 | OK |
304 | Not modified |
401 | Requires authentication |
403 | Forbidden |
404 | Resource not found |
500 | Internal Error |
코드 샘플
curl \
-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/machinesResponse
Status: 200{
"total_count": 2,
"machines": [
{
"name": "standardLinux",
"display_name": "4 cores, 8 GB RAM, 64 GB storage",
"operating_system": "linux",
"storage_in_bytes": 68719476736,
"memory_in_bytes": 8589934592,
"cpus": 4
},
{
"name": "premiumLinux",
"display_name": "8 cores, 16 GB RAM, 64 GB storage",
"operating_system": "linux",
"storage_in_bytes": 68719476736,
"memory_in_bytes": 17179869184,
"cpus": 8
}
]
}