Diese Version von GitHub Enterprise Server wurde eingestellt am 2024-07-09. Es wird keine Patch-Freigabe vorgenommen, auch nicht für kritische Sicherheitsprobleme. Für bessere Leistung, verbesserte Sicherheit und neue Features aktualisiere auf die neueste Version von GitHub Enterprise Server. Wende dich an den GitHub Enterprise-Support, um Hilfe zum Upgrade zu erhalten.
REST-API-Endpunkte für Meilensteine
Verwende die REST-API, um Meilensteine zu verwalten.
List milestones
Lists milestones for a repository.
Parameter für „List milestones“
| Name, type, BESCHREIBUNG | 
|---|
accept string Setting to   | 
| Name, type, BESCHREIBUNG | 
|---|
owner string ErforderlichThe account owner of the repository. The name is not case sensitive.  | 
repo string ErforderlichThe name of the repository without the   | 
| Name, type, BESCHREIBUNG | 
|---|
state string The state of the milestone. Either  Standard:  Kann eine der Folgenden sein:   | 
sort string What to sort results by. Either  Standard:  Kann eine der Folgenden sein:   | 
direction string The direction of the sort. Either  Standard:  Kann eine der Folgenden sein:   | 
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." Standard:   | 
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." Standard:   | 
HTTP-Antwortstatuscodes für „List milestones“
| Statuscode | BESCHREIBUNG | 
|---|---|
200 | OK  | 
404 | Resource not found  | 
Codebeispiele für „List milestones“
Anforderungsbeispiel
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/milestonesResponse
Status: 200[
  {
    "url": "https://HOSTNAME/repos/octocat/Hello-World/milestones/1",
    "html_url": "https://github.com/octocat/Hello-World/milestones/v1.0",
    "labels_url": "https://HOSTNAME/repos/octocat/Hello-World/milestones/1/labels",
    "id": 1002604,
    "node_id": "MDk6TWlsZXN0b25lMTAwMjYwNA==",
    "number": 1,
    "state": "open",
    "title": "v1.0",
    "description": "Tracking milestone for version 1.0",
    "creator": {
      "login": "octocat",
      "id": 1,
      "node_id": "MDQ6VXNlcjE=",
      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
      "gravatar_id": "",
      "url": "https://HOSTNAME/users/octocat",
      "html_url": "https://github.com/octocat",
      "followers_url": "https://HOSTNAME/users/octocat/followers",
      "following_url": "https://HOSTNAME/users/octocat/following{/other_user}",
      "gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}",
      "starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}",
      "subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions",
      "organizations_url": "https://HOSTNAME/users/octocat/orgs",
      "repos_url": "https://HOSTNAME/users/octocat/repos",
      "events_url": "https://HOSTNAME/users/octocat/events{/privacy}",
      "received_events_url": "https://HOSTNAME/users/octocat/received_events",
      "type": "User",
      "site_admin": false
    },
    "open_issues": 4,
    "closed_issues": 8,
    "created_at": "2011-04-10T20:09:31Z",
    "updated_at": "2014-03-03T18:58:10Z",
    "closed_at": "2013-02-12T13:22:01Z",
    "due_on": "2012-10-09T23:39:01Z"
  }
]Create a milestone
Creates a milestone.
Parameter für „Create a milestone“
| Name, type, BESCHREIBUNG | 
|---|
accept string Setting to   | 
| Name, type, BESCHREIBUNG | 
|---|
owner string ErforderlichThe account owner of the repository. The name is not case sensitive.  | 
repo string ErforderlichThe name of the repository without the   | 
| Name, type, BESCHREIBUNG | 
|---|
title string ErforderlichThe title of the milestone.  | 
state string The state of the milestone. Either  Standard:  Kann eine der Folgenden sein:   | 
description string A description of the milestone.  | 
due_on string The milestone due date. This is a timestamp in ISO 8601 format:   | 
HTTP-Antwortstatuscodes für „Create a milestone“
| Statuscode | BESCHREIBUNG | 
|---|---|
201 | Created  | 
404 | Resource not found  | 
422 | Validation failed, or the endpoint has been spammed.  | 
Codebeispiele für „Create a milestone“
Anforderungsbeispiel
curl -L \
  -X POST \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/milestones \
  -d '{"title":"v1.0","state":"open","description":"Tracking milestone for version 1.0","due_on":"2012-10-09T23:39:01Z"}'Response
Status: 201{
  "url": "https://HOSTNAME/repos/octocat/Hello-World/milestones/1",
  "html_url": "https://github.com/octocat/Hello-World/milestones/v1.0",
  "labels_url": "https://HOSTNAME/repos/octocat/Hello-World/milestones/1/labels",
  "id": 1002604,
  "node_id": "MDk6TWlsZXN0b25lMTAwMjYwNA==",
  "number": 1,
  "state": "open",
  "title": "v1.0",
  "description": "Tracking milestone for version 1.0",
  "creator": {
    "login": "octocat",
    "id": 1,
    "node_id": "MDQ6VXNlcjE=",
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "gravatar_id": "",
    "url": "https://HOSTNAME/users/octocat",
    "html_url": "https://github.com/octocat",
    "followers_url": "https://HOSTNAME/users/octocat/followers",
    "following_url": "https://HOSTNAME/users/octocat/following{/other_user}",
    "gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}",
    "starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}",
    "subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions",
    "organizations_url": "https://HOSTNAME/users/octocat/orgs",
    "repos_url": "https://HOSTNAME/users/octocat/repos",
    "events_url": "https://HOSTNAME/users/octocat/events{/privacy}",
    "received_events_url": "https://HOSTNAME/users/octocat/received_events",
    "type": "User",
    "site_admin": false
  },
  "open_issues": 4,
  "closed_issues": 8,
  "created_at": "2011-04-10T20:09:31Z",
  "updated_at": "2014-03-03T18:58:10Z",
  "closed_at": "2013-02-12T13:22:01Z",
  "due_on": "2012-10-09T23:39:01Z"
}Get a milestone
Gets a milestone using the given milestone number.
Parameter für „Get a milestone“
| Name, type, BESCHREIBUNG | 
|---|
accept string Setting to   | 
| Name, type, BESCHREIBUNG | 
|---|
owner string ErforderlichThe account owner of the repository. The name is not case sensitive.  | 
repo string ErforderlichThe name of the repository without the   | 
milestone_number integer ErforderlichThe number that identifies the milestone.  | 
HTTP-Antwortstatuscodes für „Get a milestone“
| Statuscode | BESCHREIBUNG | 
|---|---|
200 | OK  | 
404 | Resource not found  | 
Codebeispiele für „Get a milestone“
Anforderungsbeispiel
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/milestones/MILESTONE_NUMBERResponse
Status: 200{
  "url": "https://HOSTNAME/repos/octocat/Hello-World/milestones/1",
  "html_url": "https://github.com/octocat/Hello-World/milestones/v1.0",
  "labels_url": "https://HOSTNAME/repos/octocat/Hello-World/milestones/1/labels",
  "id": 1002604,
  "node_id": "MDk6TWlsZXN0b25lMTAwMjYwNA==",
  "number": 1,
  "state": "open",
  "title": "v1.0",
  "description": "Tracking milestone for version 1.0",
  "creator": {
    "login": "octocat",
    "id": 1,
    "node_id": "MDQ6VXNlcjE=",
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "gravatar_id": "",
    "url": "https://HOSTNAME/users/octocat",
    "html_url": "https://github.com/octocat",
    "followers_url": "https://HOSTNAME/users/octocat/followers",
    "following_url": "https://HOSTNAME/users/octocat/following{/other_user}",
    "gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}",
    "starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}",
    "subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions",
    "organizations_url": "https://HOSTNAME/users/octocat/orgs",
    "repos_url": "https://HOSTNAME/users/octocat/repos",
    "events_url": "https://HOSTNAME/users/octocat/events{/privacy}",
    "received_events_url": "https://HOSTNAME/users/octocat/received_events",
    "type": "User",
    "site_admin": false
  },
  "open_issues": 4,
  "closed_issues": 8,
  "created_at": "2011-04-10T20:09:31Z",
  "updated_at": "2014-03-03T18:58:10Z",
  "closed_at": "2013-02-12T13:22:01Z",
  "due_on": "2012-10-09T23:39:01Z"
}Update a milestone
Parameter für „Update a milestone“
| Name, type, BESCHREIBUNG | 
|---|
accept string Setting to   | 
| Name, type, BESCHREIBUNG | 
|---|
owner string ErforderlichThe account owner of the repository. The name is not case sensitive.  | 
repo string ErforderlichThe name of the repository without the   | 
milestone_number integer ErforderlichThe number that identifies the milestone.  | 
| Name, type, BESCHREIBUNG | 
|---|
title string The title of the milestone.  | 
state string The state of the milestone. Either  Standard:  Kann eine der Folgenden sein:   | 
description string A description of the milestone.  | 
due_on string The milestone due date. This is a timestamp in ISO 8601 format:   | 
HTTP-Antwortstatuscodes für „Update a milestone“
| Statuscode | BESCHREIBUNG | 
|---|---|
200 | OK  | 
Codebeispiele für „Update a milestone“
Anforderungsbeispiel
curl -L \
  -X PATCH \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/milestones/MILESTONE_NUMBER \
  -d '{"title":"v1.0","state":"open","description":"Tracking milestone for version 1.0","due_on":"2012-10-09T23:39:01Z"}'Response
Status: 200{
  "url": "https://HOSTNAME/repos/octocat/Hello-World/milestones/1",
  "html_url": "https://github.com/octocat/Hello-World/milestones/v1.0",
  "labels_url": "https://HOSTNAME/repos/octocat/Hello-World/milestones/1/labels",
  "id": 1002604,
  "node_id": "MDk6TWlsZXN0b25lMTAwMjYwNA==",
  "number": 1,
  "state": "open",
  "title": "v1.0",
  "description": "Tracking milestone for version 1.0",
  "creator": {
    "login": "octocat",
    "id": 1,
    "node_id": "MDQ6VXNlcjE=",
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "gravatar_id": "",
    "url": "https://HOSTNAME/users/octocat",
    "html_url": "https://github.com/octocat",
    "followers_url": "https://HOSTNAME/users/octocat/followers",
    "following_url": "https://HOSTNAME/users/octocat/following{/other_user}",
    "gists_url": "https://HOSTNAME/users/octocat/gists{/gist_id}",
    "starred_url": "https://HOSTNAME/users/octocat/starred{/owner}{/repo}",
    "subscriptions_url": "https://HOSTNAME/users/octocat/subscriptions",
    "organizations_url": "https://HOSTNAME/users/octocat/orgs",
    "repos_url": "https://HOSTNAME/users/octocat/repos",
    "events_url": "https://HOSTNAME/users/octocat/events{/privacy}",
    "received_events_url": "https://HOSTNAME/users/octocat/received_events",
    "type": "User",
    "site_admin": false
  },
  "open_issues": 4,
  "closed_issues": 8,
  "created_at": "2011-04-10T20:09:31Z",
  "updated_at": "2014-03-03T18:58:10Z",
  "closed_at": "2013-02-12T13:22:01Z",
  "due_on": "2012-10-09T23:39:01Z"
}Delete a milestone
Deletes a milestone using the given milestone number.
Parameter für „Delete a milestone“
| Name, type, BESCHREIBUNG | 
|---|
accept string Setting to   | 
| Name, type, BESCHREIBUNG | 
|---|
owner string ErforderlichThe account owner of the repository. The name is not case sensitive.  | 
repo string ErforderlichThe name of the repository without the   | 
milestone_number integer ErforderlichThe number that identifies the milestone.  | 
HTTP-Antwortstatuscodes für „Delete a milestone“
| Statuscode | BESCHREIBUNG | 
|---|---|
204 | No Content  | 
404 | Resource not found  | 
Codebeispiele für „Delete a milestone“
Anforderungsbeispiel
curl -L \
  -X DELETE \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/milestones/MILESTONE_NUMBERResponse
Status: 204