InfoGrab Docs

사용자 정의 속성 API

요약

이 API를 사용하여 사용자, 그룹 및 프로젝트의 사용자 정의 속성을 관리합니다. 지정된 리소스에 대한 모든 사용자 정의 속성을 나열합니다. 리소스에 대한 지정된 사용자 정의 속성을 조회합니다. 지정된 리소스에 대한 사용자 정의 속성을 업데이트하거나 생성합니다.

이 API를 사용하여 사용자, 그룹 및 프로젝트의 사용자 정의 속성을 관리합니다.

사전 요구 사항:

  • 인스턴스 관리자여야 합니다.

모든 사용자 정의 속성 목록 조회#

지정된 리소스에 대한 모든 사용자 정의 속성을 나열합니다.

GET /users/:id/custom_attributes
GET /groups/:id/custom_attributes
GET /projects/:id/custom_attributes
속성 타입 필수 설명
id integer 리소스의 ID
curl --request GET \
   --header "PRIVATE-TOKEN: <your_access_token>" \
   --url "https://gitlab.example.com/api/v4/users/42/custom_attributes"

예시 응답:

[
   {
      "key": "location",
      "value": "Antarctica"
   },
   {
      "key": "role",
      "value": "Developer"
   }
]

사용자 정의 속성 조회#

리소스에 대한 지정된 사용자 정의 속성을 조회합니다.

GET /users/:id/custom_attributes/:key
GET /groups/:id/custom_attributes/:key
GET /projects/:id/custom_attributes/:key
속성 타입 필수 설명
id integer 리소스의 ID
key string 사용자 정의 속성의 키
curl --request GET \
   --header "PRIVATE-TOKEN: <your_access_token>" \
   --url "https://gitlab.example.com/api/v4/users/42/custom_attributes/location"

예시 응답:

{
   "key": "location",
   "value": "Antarctica"
}

사용자 정의 속성 업데이트#

지정된 리소스에 대한 사용자 정의 속성을 업데이트하거나 생성합니다. 속성이 이미 존재하면 업데이트되고, 그렇지 않으면 새로 생성됩니다.

PUT /users/:id/custom_attributes/:key
PUT /groups/:id/custom_attributes/:key
PUT /projects/:id/custom_attributes/:key
속성 타입 필수 설명
id integer 리소스의 ID
key string 사용자 정의 속성의 키
value string 사용자 정의 속성의 값
curl --request PUT \
   --header "PRIVATE-TOKEN: <your_access_token>" \
   --data "value=Greenland" \
   --url "https://gitlab.example.com/api/v4/users/42/custom_attributes/location"

예시 응답:

{
   "key": "location",
   "value": "Greenland"
}

사용자 정의 속성 삭제#

리소스에 대한 지정된 사용자 정의 속성을 삭제합니다.

DELETE /users/:id/custom_attributes/:key
DELETE /groups/:id/custom_attributes/:key
DELETE /projects/:id/custom_attributes/:key
속성 타입 필수 설명
id integer 리소스의 ID
key string 사용자 정의 속성의 키
curl --request DELETE \
   --header "PRIVATE-TOKEN: <your_access_token>" \
   --url "https://gitlab.example.com/api/v4/users/42/custom_attributes/location"

사용자 정의 속성 API

Tier: Free, Premium, Ultimate
Offering: GitLab Self-Managed, GitLab Dedicated
원문 보기
요약

이 API를 사용하여 사용자, 그룹 및 프로젝트의 사용자 정의 속성을 관리합니다. 지정된 리소스에 대한 모든 사용자 정의 속성을 나열합니다. 리소스에 대한 지정된 사용자 정의 속성을 조회합니다. 지정된 리소스에 대한 사용자 정의 속성을 업데이트하거나 생성합니다.

이 API를 사용하여 사용자, 그룹 및 프로젝트의 사용자 정의 속성을 관리합니다.

사전 요구 사항:

  • 인스턴스 관리자여야 합니다.

모든 사용자 정의 속성 목록 조회#

지정된 리소스에 대한 모든 사용자 정의 속성을 나열합니다.

GET /users/:id/custom_attributes
GET /groups/:id/custom_attributes
GET /projects/:id/custom_attributes
속성 타입 필수 설명
id integer 리소스의 ID
curl --request GET \
   --header "PRIVATE-TOKEN: <your_access_token>" \
   --url "https://gitlab.example.com/api/v4/users/42/custom_attributes"

예시 응답:

[
   {
      "key": "location",
      "value": "Antarctica"
   },
   {
      "key": "role",
      "value": "Developer"
   }
]

사용자 정의 속성 조회#

리소스에 대한 지정된 사용자 정의 속성을 조회합니다.

GET /users/:id/custom_attributes/:key
GET /groups/:id/custom_attributes/:key
GET /projects/:id/custom_attributes/:key
속성 타입 필수 설명
id integer 리소스의 ID
key string 사용자 정의 속성의 키
curl --request GET \
   --header "PRIVATE-TOKEN: <your_access_token>" \
   --url "https://gitlab.example.com/api/v4/users/42/custom_attributes/location"

예시 응답:

{
   "key": "location",
   "value": "Antarctica"
}

사용자 정의 속성 업데이트#

지정된 리소스에 대한 사용자 정의 속성을 업데이트하거나 생성합니다. 속성이 이미 존재하면 업데이트되고, 그렇지 않으면 새로 생성됩니다.

PUT /users/:id/custom_attributes/:key
PUT /groups/:id/custom_attributes/:key
PUT /projects/:id/custom_attributes/:key
속성 타입 필수 설명
id integer 리소스의 ID
key string 사용자 정의 속성의 키
value string 사용자 정의 속성의 값
curl --request PUT \
   --header "PRIVATE-TOKEN: <your_access_token>" \
   --data "value=Greenland" \
   --url "https://gitlab.example.com/api/v4/users/42/custom_attributes/location"

예시 응답:

{
   "key": "location",
   "value": "Greenland"
}

사용자 정의 속성 삭제#

리소스에 대한 지정된 사용자 정의 속성을 삭제합니다.

DELETE /users/:id/custom_attributes/:key
DELETE /groups/:id/custom_attributes/:key
DELETE /projects/:id/custom_attributes/:key
속성 타입 필수 설명
id integer 리소스의 ID
key string 사용자 정의 속성의 키
curl --request DELETE \
   --header "PRIVATE-TOKEN: <your_access_token>" \
   --url "https://gitlab.example.com/api/v4/users/42/custom_attributes/location"