363.md 2.9 KB
Newer Older
Lab机器人's avatar
readme  
Lab机器人 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
# Resource weight events API

> 原文:[https://docs.gitlab.com/ee/api/resource_weight_events.html](https://docs.gitlab.com/ee/api/resource_weight_events.html)

*   [Issues](#issues)
    *   [List project issue weight events](#list-project-issue-weight-events)
    *   [Get single issue weight event](#get-single-issue-weight-event)

# Resource weight events API[](#resource-weight-events-api "Permalink")

资源权重事件跟踪 GitLab [问题的](../user/project/issues/)发生情况.

使用它们来跟踪设置了哪些权重,由谁进行权重以及何时发生.

## Issues[](#issues "Permalink")

### List project issue weight events[](#list-project-issue-weight-events "Permalink")

获取单个问题的所有举重事件的列表.

```
GET /projects/:id/issues/:issue_iid/resource_weight_events 
```

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 项目的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `issue_iid` | integer | yes | 问题的 IID |

请求示例:

```
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/issues/11/resource_weight_events" 
```

响应示例:

```
[  {  "id":  142,  "user":  {  "id":  1,  "name":  "Administrator",  "username":  "root",  "state":  "active",  "avatar_url":  "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",  "web_url":  "http://gitlab.example.com/root"  },  "created_at":  "2018-08-20T13:38:20.077Z",  "issue_id":  253,  "weight":  3  },  {  "id":  143,  "user":  {  "id":  1,  "name":  "Administrator",  "username":  "root",  "state":  "active",  "avatar_url":  "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",  "web_url":  "http://gitlab.example.com/root"  },  "created_at":  "2018-08-21T14:38:20.077Z",  "issue_id":  253,  "weight":  2  }  ] 
```

### Get single issue weight event[](#get-single-issue-weight-event "Permalink")

返回特定项目问题的单个权重事件

```
GET /projects/:id/issues/:issue_iid/resource_weight_events/:resource_weight_event_id 
```

Parameters:

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 项目的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `issue_iid` | integer | yes | 问题的 IID |
| `resource_weight_event_id` | integer | yes | 举重事件的 ID |

请求示例:

```
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/issues/11/resource_weight_events/143" 
```

响应示例:

```
{  "id":  143,  "user":  {  "id":  1,  "name":  "Administrator",  "username":  "root",  "state":  "active",  "avatar_url":  "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",  "web_url":  "http://gitlab.example.com/root"  },  "created_at":  "2018-08-21T14:38:20.077Z",  "issue_id":  253,  "weight":  2  } 
```