본문으로 건너뛰기

5. 사용자 관리

이 장에서 하는 일

사용자 계정을 API 로 관리합니다. 조회·등록·변경·삭제를 다룹니다.

그룹과 권한은 4장에서 다룹니다. 보통 사용자를 만든 뒤 그룹에 넣는 순서로 씁니다.

사용자

조회

등록된 사용자 목록을 받아 옵니다. 각 사용자가 어느 그룹에 속하는지(groups)도 함께 옵니다.

항목설명
URL/monitoring/api/users
URL 요청 예시/monitoring/api/users
HTTP METHODGET
Content-Typeapplication/json; charset=UTF-8
Body
Response아래 참고

응답 예시

{
"status": 200,
"result": [
{
"userId": "omadm",
"name": "Administrator",
"email": "support@opennaru.com",
"phoneNumber": "010-1234-1234",
"groups": [
"admin",
"users"
],
"timeZone": "GMT+09:00",
"locale": "kr",
"language": "ko",
"registered": 1502182129012,
"updated": 0
}
]
}

등록

사용자를 만듭니다. groups 에 넣지 않으면 로그인은 되지만 볼 수 있는 화면이 없습니다.

항목설명
URL/monitoring/api/user
URL 요청 예시/monitoring/api/user
HTTP METHODPOST
Content-Typeapplication/json; charset=UTF-8
Body{ "userId": "test", "password": "test", "name": "테스트", "email": "", "phoneNumber": "", "timeZone": "GMT+09:00", "language": "ko", "groups": [ "users", “testGroups” ], "locale": "kr" }
Response{"status": 200}

수정

이름·연락처·소속 그룹 등을 바꿉니다. 비밀번호는 별도 항목으로 보냅니다.

항목설명
URL/monitoring/api/user/{사용자 아이디}
URL 요청 예시/monitoring/api/user/test
HTTP METHODPUT
Content-Typeapplication/json; charset=UTF-8
Body{ "userId": "test", "password": "test", "name": "테스트", "email": "", "phoneNumber": "", "timeZone": "GMT+09:00", "language": "ko", "groups": [ "users", “testGroups” ], "locale": "kr" }
Response{"status": 200}

삭제

사용자를 지웁니다. 그 사용자가 만든 대시보드도 함께 사라집니다.

항목설명
URL/monitoring/api/user/{사용자 아이디}
URL 요청 예시/monitoring/api/user/test
HTTP METHODDELETE
Content-Typeapplication/json; charset=UTF-8
Body
Response{"status": 200}