테이블 권한 부여

사용자 또는 그룹에 지정한 테이블 권한을 부여합니다. 이 작업은 관리자 권한을 요구합니다.

HTTP 요청

PUT /api/sonar/tables/:table/privileges
cURL 예시
curl -H "Authorization: Bearer <API_KEY>" \
     -d type=user \
     -d shared_users="8b6e740c-24b1-41d1-a4c5-39db2520f92a,32ef0629-9646-4eba-bd2d-4b99e4a5097d" \
     -X PUT "https://HOSTNAME/api/sonar/tables/demo/privileges"
요청 매개변수
경로 매개변수
타입설명비고
table문자열권한을 부여할 테이블 이름최소 1자, 최대 50자
요청 본문 매개변수
필수타입설명비고
typeO문자열대상 종류user 또는 group
shared_usersX문자열권한 부여된 계정 GUID 목록여러 개의 항목은 쉼표(,)로 구분
shared_groupsX문자열권한 부여된 계정 그룹 GUID 목록여러 개의 항목은 쉼표(,)로 구분
Note
테이블 이름은 영문자로 시작해야 하며, 영문 대소문자, 숫자, 밑줄(_), 하이픈(-)만 사용 가능합니다.
계정에 테이블 권한을 부여하려면 type을 'user'로 입력하고 shared_users에 값을 입력해야 합니다.
계정 그룹에 테이블 권한을 부여하려면 type을 'group'으로 입력하고 shared_groups에 값을 입력해야 합니다.

정상 응답

{
  "failures": []
}

오류 응답

table이 누락된 경우

HTTP 상태 코드 400 응답

{
  "error_code": "null-argument",
  "error_msg": "table should be not null"
}
table 값의 길이가 잘못된 경우

HTTP 상태 코드 400 응답

{
  "error_code": "invalid-argument",
  "error_msg": "'table' must be shorter than or equal to 50 characters."
}
table 이름이 규칙을 벗어난 경우

HTTP 상태 코드 400 응답

{
  "error_code": "invalid-argument",
  "error_msg": "'table' must begin with a letter and may contain alphanumeric and underscore characters: 0123"
}
type이 누락된 경우

HTTP 상태 코드 400 응답

{
  "error_code": "null-argument",
  "error_msg": "type should be not null"
}
type이 'user' 또는 'group'이 아닌 경우

HTTP 상태 코드 400 응답

{
  "error_code": "invalid-argument",
  "error_msg": "unsupported type: users"
}
type이 'user'이지만 shared_groups가 입력된 경우

HTTP 상태 코드 400 응답

{
  "error_code": "invalid-argument",
  "error_msg": "'shared_groups' must not be set when type is 'user'."
}
type이 'group'이지만 shared_users가 입력된 경우

HTTP 상태 코드 400 응답

{
  "error_code": "invalid-argument",
  "error_msg": "'shared_users' must not be set when type is 'group'."
}
shared_users가 리스트 형식이 아닌 경우

HTTP 상태 코드 400 응답

{
  "error_code": "invalid-argument",
  "error_msg": "shared_users 'invalid_value' should be list type."
}
shared_groups가 리스트 형식이 아닌 경우

HTTP 상태 코드 400 응답

{
  "error_code": "invalid-argument",
  "error_msg": "shared_groups 'invalid_value' should be list type."
}
계정 또는 그룹이 존재하지 않는 경우

HTTP 상태 코드 200 응답

{
  "failures": [
    {
      "guid": "32ef0629-9646-4eba-bd2d-4b99e4a5097d",
      "reason": "user-not-found"
    }
  ]
}
테이블이 존재하지 않는 경우

HTTP 상태 코드 500 응답

{
  "error_code": "illegal-state",
  "error_msg": "table not found: test"
}
테이블 권한 설정 권한이 없는 경우

HTTP 상태 코드 500 응답

{
  "error_code": "illegal-state",
  "error_msg": "no-permission"
}