machines
Creates, updates, deletes, gets or lists a machines resource.
Overview
| Name | machines |
| Type | Resource |
| Id | github.codespaces.machines |
Fields
The following fields are returned by SELECT queries:
- repo_machines_for_authenticated_user
- codespace_machines_for_authenticated_user
Response
| Name | Datatype | Description |
|---|---|---|
machines | array | |
total_count | integer |
Response
| Name | Datatype | Description |
|---|---|---|
machines | array | |
total_count | integer |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
repo_machines_for_authenticated_user | select | owner, repo | location, client_ip, ref | 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. |
codespace_machines_for_authenticated_user | select | codespace_name | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
codespace_name | string | The name of the codespace. |
owner | string | The account owner of the repository. The name is not case sensitive. |
repo | string | The name of the repository without the .git extension. The name is not case sensitive. |
client_ip | string | IP for location auto-detection when proxying a request |
location | string | The location to check for available machines. Assigned by IP if not provided. |
ref | string | The branch or commit to check for prebuild availability and devcontainer restrictions. |
SELECT examples
- repo_machines_for_authenticated_user
- codespace_machines_for_authenticated_user
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 }}'
;
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.
SELECT
machines,
total_count
FROM github.codespaces.machines
WHERE codespace_name = '{{ codespace_name }}' -- required
;