본문 바로가기
WIKI 기술 지식 베이스

Get Users API

원문 보기 위키 갱신

출처: 문서

본문

Get Users API

1.0에서 도입됨 {: .label .label-purple }

내부 사용자를 조회해요. 사용자 이름을 지정하면 해당 사용자 한 명을 조회하고, 사용자 이름을 생략하면 모든 내부 사용자를 조회해요.

엔드포인트

GET /_plugins/_security/api/internalusers
GET /_plugins/_security/api/internalusers/{username}

경로 파라미터

다음 표는 사용 가능한 경로 파라미터를 정리한 거예요.

파라미터 데이터 타입 필수 여부 설명
username String 아니요 조회할 사용자의 이름이에요. 생략하면 모든 내부 사용자가 반환돼요.

요청 예제

다음 요청은 모든 내부 사용자를 조회해요:

GET _plugins/_security/api/internalusers

{% include copy-curl.html security=true %}

다음 요청은 kirk 사용자를 조회해요:

GET _plugins/_security/api/internalusers/kirk

{% include copy-curl.html security=true %}

응답 예제

응답에는 모든 내부 사용자가 나열돼요. 여기서는 축약해서 보여줄게요:

{
  "logstash": {
    "attributes": {},
    "backend_roles": [
      "logstash"
    ],
    "description": "Demo logstash user, using external role mapping",
    "hash": "",
    "hidden": false,
    "opendistro_security_roles": [],
    "reserved": false,
    "static": false
  },
  "snapshotrestore": {
    "attributes": {},
    "backend_roles": [
      "snapshotrestore"
    ],
    "description": "Demo snapshotrestore user, using external role mapping",
    "hash": "",
    "hidden": false,
    "opendistro_security_roles": [],
    "reserved": false,
    "static": false
  },
  "admin": {
    "attributes": {},
    "backend_roles": [
      "admin"
    ],
    "description": "Demo admin user",
    "hash": "",
    "hidden": false,
    "opendistro_security_roles": [],
    "reserved": true,
    "static": false
  },
  ...
}

한 명의 사용자에 대한 요청의 응답에는 해당 사용자만 포함돼요:

{
  "kirk": {
    "attributes": {
      "attribute1": "value1",
      "attribute2": "value2"
    },
    "backend_roles": [
      "captain",
      "starfleet"
    ],
    "hash": "",
    "hidden": false,
    "opendistro_security_roles": [
      "maintenance_staff",
      "database_manager"
    ],
    "reserved": false,
    "static": false
  }
}

더 알아보기 (Learn more)