Skip to content

Query all K8S runners shared with the repository

GET /api/v8/repos/{owner}/{repo}/actions/shared-runner-sets

Call this endpoint to query all K8S runners shared with the repository.

Access token support

  • AtomGit user access tokens

Anonymous access

This endpoint does not allow anonymous access.

Request parameters

Parameter Location Type Required Description
owner path string Yes Address path of the namespace that owns the repository (organization or personal address path)
repo path string Yes Repository path (path)
access_token query string Yes User authorization code
keyword query string No Keyword filter
page query integer No Current page number, default 1
per_page query integer No Number of items per page, default 10

Response parameters

Field Type Always returned Nullable Description
total_count integer Yes No RunnerSet total
runner_sets object[] Yes Yes RunnerSet list

runner_sets object

Field Type Always returned Nullable Description
runner_sets.id string Yes No RunnerSet ID
runner_sets.runner_group_id string Yes Yes Runner Group ID
runner_sets.name string Yes Yes Name
runner_sets.status string Yes Yes State: using in use / wait_release releasing
runner_sets.required_labels object[] Yes Yes Required label list
runner_sets.min_runner_size integer Yes Yes Minimum runner count
runner_sets.max_runner_size integer Yes Yes Maximum runner count
runner_sets.limit_cpu integer Yes Yes CPU limit
runner_sets.limit_memory integer Yes Yes Memory limit
runner_sets.image_name string Yes Yes Image name
runner_sets.user_k8s_cluster_id string Yes Yes User K8S cluster ID
runner_sets.user_k8s_cluster_name string Yes Yes User K8S cluster name
runner_sets.user_k8s_resource_type string Yes Yes User K8S resource type
runner_sets.user_k8s_cluster_namespace string Yes Yes User K8S namespace
runner_sets.user_k8s_url string Yes Yes User K8S address
runner_sets.create_time integer Yes Yes Creation time
runner_sets.update_time integer Yes Yes Update time
runner_sets.user_id string Yes Yes User ID
runner_sets.user_name string Yes Yes Username
runner_sets.user_project_id string Yes Yes User project ID

runner_sets.required_labels object

Field Type Always returned Nullable Description
runner_sets.required_labels.label_name string Yes Yes Label name
runner_sets.required_labels.label_value string Yes Yes Label value
runner_sets.required_labels.label_color string Yes Yes Label color

Error responses

This endpoint may return the following failure responses for invalid parameters or unauthenticated requests. The error field names returned by the backend take precedence.

400 Invalid parameters

{
  "error": "invalid_request",
  "message": "Parameter validation failed; check the request parameters"
}

401 Unauthenticated

{
  "error": "unauthorized",
  "message": "Missing or invalid access token"
}

HTTP response status codes

Status code Description
200 Success (OK)
304 Not modified
400 Bad request
401 Requires authentication
403 Forbidden
404 Not found

Request example

Parameter notes

<owner> is replaced with the address path of the namespace that owns the repository (organization or personal address path); <repo> is replaced with the repository path; <token> is replaced with your AtomGit user access token.

cURL

curl -X GET 'https://api.atomgit.com/api/v8/repos/<owner>/<repo>/actions/shared-runner-sets?access_token=<token>&page=1&per_page=10' \
  -H 'Accept: application/json'

JavaScript

// Native fetch (Node.js 18+ / browser)
const response = await fetch(
  "https://api.atomgit.com/api/v8/repos/<owner>/<repo>/actions/shared-runner-sets?access_token=<token>&page=1&per_page=10",
  {
    headers: {
      "Accept": "application/json",
    },
  }
);

if (!response.ok) {
  throw new Error(`Request failed: ${response.status}`);
}

const data = await response.json();
console.log(data);

Python

import requests

resp = requests.get(
    "https://api.atomgit.com/api/v8/repos/<owner>/<repo>/actions/shared-runner-sets",
    params={
        "access_token": "<token>",
        "page": 1,
        "per_page": 10,
    },
    headers={
        "Accept": "application/json",
    },
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 200

{
  "total_count": 2,
  "runner_sets": [
    {
      "id": "rs_1001",
      "runner_group_id": "rg_2001",
      "name": "shared-k8s-runner-set",
      "status": "using",
      "required_labels": [
        {
          "label_name": "os",
          "label_value": "linux",
          "label_color": "blue"
        }
      ],
      "min_runner_size": 1,
      "max_runner_size": 10,
      "limit_cpu": 4,
      "limit_memory": 8192,
      "image_name": "ubuntu-22.04",
      "user_k8s_cluster_id": "cluster_3001",
      "user_k8s_cluster_name": "prod-cluster",
      "user_k8s_resource_type": "deployment",
      "user_k8s_cluster_namespace": "runner",
      "user_k8s_url": "https://k8s.example.internal",
      "create_time": 1728000000,
      "update_time": 1728100000,
      "user_id": "user_4001",
      "user_name": "octocat",
      "user_project_id": "proj_5001"
    }
  ]
}

Error codes

Error code Description
400 Invalid parameters or the request could not be parsed
401 Unauthenticated or invalid credentials (missing or invalid access token)
403 Forbidden
404 The request path does not exist
429 Too many requests; rate limit triggered
500 Internal server error

Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc