Skip to content
GitLab
Next
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 44,763
    • Issues 44,763
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,329
    • Merge requests 1,329
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #324269
Closed
Open
Issue created Mar 12, 2021 by Mikhail Mazurskiy@ash2kDeveloper

API to get allowed agents by CI_JOB_TOKEN

New api endpoint: /api/v4/job/allowed_agents

returns:

{
  "allowed_agents": [
    {
        "id": 5,  // agent id
        "config_project": {
          "id": 3,
        }
    },
    {
        "id": 3,
        "config_project": {
          "id": 3,
        }
    },
  ],
  "job": {
    "id": 9 // job id
  },
  "project": {
    "id": 123213 // project id
  },
  "pipeline": {
    "id": 2323 // pipeline id
  },
  "user": {
    "id": 1,
    "username": "root"
  }
}

Specifications from the epic:

  • allowed_agents will only include agents for the JOB_TOKEN project. Adding external agents requires additional permissions, which will be handled in follow-up issues.
  • Endpoint auth: The user running the CI job should have Developer rights on the project configuring the agent used.
  • This feature can be disabled -- I think this will be handled in the agentk config file so the API does not need to worry about this setting.
Edited Apr 01, 2021 by Mikhail Mazurskiy
Assignee
Assign to
Time tracking