buildkite / feedback

Got feedback? Please let us know!
https://buildkite.com
25 stars 24 forks source link

Feature Request: List Teams and corresponding Pipelines of Teams via REST API #443

Open dannykansas opened 6 years ago

dannykansas commented 6 years ago

Possibly this feature exists and is not yet reflected in documentation, but the following would be very useful for our current needs (and I imagine many others making heavy use of Teams for user organization/grouping/pipeline access restriction):

1. View all teams visible to user:

Example Request:

curl "https://api.buildkite.com/v2/organizations/{org.slug}/teams"

Example Response:

[
  {
    "id": "0a12abc3-4567-8901d-e23f-4abcd5e678fa",
    "url": "https://api.buildkite.com/v2/organizations/my-org/teams/team-name",
    "web-url": "https://buildkite.com/organizations/my-org/teams/team-name",
    "name": "team-name",
    [...]
  },
  {
    "id": "9a87abc6-5432-10987d-e65f-4abcd3e210fa",
    "url": "https://api.buildkite.com/v2/organizations/my-org/teams/other-team-name",
    "web-url": "https://buildkite.com/organizations/my-org/teams/team-name",
    "name": "other-team-name",
    [...]
  }
]

2. View pipelines of a given team:

Example Request:

curl "https://api.buildkite.com/v2/organizations/{org.slug}/teams/team-name/pipelines"

Example Response:

[
  {
    "id": "849411f9-9e6d-4739-a0d8-e247088e9b52",
    "url": "https://api.buildkite.com/v2/organizations/my-org/pipelines/my-pipeline",
    "web_url": "https://buildkite.com/my-org/my-pipeline",
    "name": "My Pipeline",
    "slug": "my-pipeline",
    [...]
  },
  {
    "id": "12345f67-8900-1234-bdd8-e00000f00012",
    "url": "https://api.buildkite.com/v2/organizations/my-org/pipelines/my-other-pipeline",
    "web_url": "https://buildkite.com/my-org/my-other-pipeline",
    "name": "My Other Pipeline",
    "slug": "my-other-pipeline",
    [...]
  }
]

The response examples are truncated as I'm not sure what the underlying schema can provide, but hopefully this will serve as a reasonable basis for a new endpoint spec.

dannykansas commented 4 years ago

I believe this functionality is now accessible via GraphQL; is there any plan to introduce it via a REST endpoint as well?