Skip to content
Ona Docs

ListRunnerPolicies

runners.policies.list(PolicyListParams**kwargs) -> SyncPoliciesPage[RunnerPolicy]
POST/gitpod.v1.RunnerService/ListRunnerPolicies

Lists policies for a runner.

Use this method to:

  • View access controls
  • Check policy configurations
  • Audit permissions

Examples

  • List policies:

    Shows all policies for a runner.

    runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
    pagination:
      pageSize: 20
ParametersExpand Collapse
token: Optional[str]
page_size: Optional[int]
maximum100
minimum0
runner_id: Optional[str]

runner_id specifies the project identifier

formatuuid
ReturnsExpand Collapse
class RunnerPolicy:
group_id: Optional[str]
formatuuid
role: Optional[RunnerRole]

role is the role assigned to the group

One of the following:
"RUNNER_ROLE_UNSPECIFIED"
"RUNNER_ROLE_ADMIN"
"RUNNER_ROLE_USER"

ListRunnerPolicies

import os
from gitpod import Gitpod

client = Gitpod(
    bearer_token=os.environ.get("GITPOD_API_KEY"),  # This is the default and can be omitted
)
page = client.runners.policies.list(
    pagination={
        "page_size": 20
    },
    runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68",
)
page = page.policies[0]
print(page.group_id)
{
  "pagination": {
    "nextToken": "nextToken"
  },
  "policies": [
    {
      "groupId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "role": "RUNNER_ROLE_UNSPECIFIED"
    }
  ]
}
Returns Examples
{
  "pagination": {
    "nextToken": "nextToken"
  },
  "policies": [
    {
      "groupId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "role": "RUNNER_ROLE_UNSPECIFIED"
    }
  ]
}