Skip to main content

machines

Creates, updates, deletes, gets or lists a machines resource.

Overview

Namemachines
TypeResource
Idgithub.codespaces.machines

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
machinesarray
total_countinteger

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
repo_machines_for_authenticated_userselectowner, repolocation, client_ip, refList 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.
codespace_machines_for_authenticated_userselectcodespace_nameList 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.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
codespace_namestringThe name of the codespace.
ownerstringThe account owner of the repository. The name is not case sensitive.
repostringThe name of the repository without the .git extension. The name is not case sensitive.
client_ipstringIP for location auto-detection when proxying a request
locationstringThe location to check for available machines. Assigned by IP if not provided.
refstringThe branch or commit to check for prebuild availability and devcontainer restrictions.

SELECT examples

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.

SELECT
machines,
total_count
FROM github.codespaces.machines
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND location = '{{ location }}'
AND client_ip = '{{ client_ip }}'
AND ref = '{{ ref }}'
;