그룹 교체(Replace Group) (V2)
지정한 그룹의 이름, 조직 범위, 설명과 특성을 교체합니다. 먼저 Get Group을 호출하고, 응답에서 multipass:로 시작하는 모든 특성을 값까지 정확히 보존해 다시 전달해야 합니다. 예약 특성의 값을 바꾸면 AttributesNotEditable 오류가 발생합니다.
organizations는 형식 스키마에서는 선택 필드이지만 요청에는 조직 RID가 최소 하나 있어야 합니다.
HTTP 요청
PUT /api/v2/admin/groups/{groupId}
작업 식별자는 v2.replaceGroup입니다. OAuth2로 호출하는 타사 애플리케이션에는 api:admin-write 권한 범위가 필요합니다. 각 요청에 Authorization: Bearer <접근 토큰>을 전달합니다.
경로 매개변수
| 이름 | 자료형 | 필수 여부 | 의미와 조건 | 예시 값 |
|---|---|---|---|---|
groupId | string | 필수 | Foundry 그룹 ID입니다. | 0d1fe74e-2b70-4a93-9b1a-80070637788b |
쿼리 매개변수
지정할 쿼리 매개변수가 없습니다.
요청 본문
본문은 필수 ReplaceGroupRequest JSON 객체입니다. 아래 예약 특성은 형식을 설명하는 가상 값이며, 실제 요청에서는 대상 그룹의 조회 응답을 그대로 사용합니다.
| 이름 | 자료형 | 필수 여부 | 의미와 조건 | 예시 값 |
|---|---|---|---|---|
name | string | 필수 | 그룹 이름입니다. | Data Source Admins |
organizations | list<OrganizationRid> | 선택 | 이 그룹을 볼 수 있는 구성원들의 조직 RID 목록입니다. 조직 RID를 최소 하나 지정해야 합니다. | |
description | string | 선택 | 그룹 설명입니다. | Create and modify data sources in the platform |
attributes | map<AttributeName, AttributeValues> | 선택 | 그룹 특성 맵입니다. multipass: 접두사의 특성은 Foundry 내부용으로 예약되어 있으며 변경될 수 있습니다. | 본문 예시 참조 |
organizations의 구조
배열 항목은 OrganizationRid이며 자료형은 string입니다.
attributes의 구조
맵의 키는 AttributeName(string), 값은 AttributeValues(list<AttributeValue>)입니다. 이 이름은 키와 값의 유형 별칭입니다.
배열 항목은 AttributeValue이며 자료형은 string입니다.
다음 본문의 식별자와 값은 가상 예시입니다.
{
"name": "Data Source Admins",
"organizations": [
"ri.multipass..organization.c30ee6ad-b5e4-4afe-a74f-fe4a289f2faa"
],
"description": "Create and modify data sources in the platform",
"attributes": {
"multipass:realm": [
"eab0a251-ca1a-4a84-a482-200edfb8026f"
],
"multipass:organization-rid": [
"ri.multipass..organization.c30ee6ad-b5e4-4afe-a74f-fe4a289f2faa"
]
}
}
응답
응답 형식은 Group입니다.
교체한 그룹입니다.
| 이름 | 자료형 | 필수 여부 | 의미와 조건 | 예시 값 |
|---|---|---|---|---|
id | string | 필수 | Foundry 그룹 ID입니다. | 0d1fe74e-2b70-4a93-9b1a-80070637788b |
name | string | 필수 | 그룹 이름입니다. | Data Source Admins |
description | string | 선택 | 그룹 설명입니다. | Create and modify data sources in the platform |
realm | string | 필수 | 사용자나 그룹이 속한 인증 영역입니다. palantir-internal-realm은 관리자가 Foundry에서 생성하고 SSO 제공자와 연결하지 않은 사용자 및 그룹에 사용합니다. | palantir-internal-realm |
organizations | list<OrganizationRid> | 선택 | 이 그룹을 볼 수 있는 구성원들의 조직 RID 목록입니다. 조직 RID를 최소 하나 지정해야 합니다. | |
attributes | map<AttributeName, AttributeValues> | 선택 | 그룹 특성 맵입니다. multipass: 접두사의 특성은 Foundry 내부용으로 예약되어 있으며 변경될 수 있습니다. | 응답 예시 참조 |
organizations의 구조
배열 항목은 OrganizationRid이며 자료형은 string입니다.
attributes의 구조
맵의 키는 AttributeName(string), 값은 AttributeValues(list<AttributeValue>)입니다. 이 이름은 키와 값의 유형 별칭입니다.
배열 항목은 AttributeValue이며 자료형은 string입니다.
가상 그룹의 응답 예시입니다.
{
"name": "Data Source Admins",
"organizations": [
"ri.multipass..organization.c30ee6ad-b5e4-4afe-a74f-fe4a289f2faa"
],
"description": "Create and modify data sources in the platform",
"realm": "palantir-internal-realm",
"attributes": {
"multipass:realm": [
"eab0a251-ca1a-4a84-a482-200edfb8026f"
],
"multipass:organization-rid": [
"ri.multipass..organization.c30ee6ad-b5e4-4afe-a74f-fe4a289f2faa"
]
},
"id": "0d1fe74e-2b70-4a93-9b1a-80070637788b"
}
개별 오류
| 오류 이름 | 오류 코드 | HTTP | 의미와 조건 | 추가 매개변수 |
|---|---|---|---|---|
InvalidGroupOrganizations | INVALID_ARGUMENT | 400 | 그룹에 조직 RID를 최소 하나 제공해야 합니다. | |
GroupNameAlreadyExists | INVALID_ARGUMENT | 400 | 같은 이름의 그룹이 이미 있습니다. | groupName |
AttributesNotEditable | INVALID_ARGUMENT | 400 | 수정할 수 없는 특성이 있습니다. multipass: 접두사의 특성은 Foundry 내부용으로 예약되어 있어 수정할 수 없습니다. | attributeNames |
ReplaceGroupPermissionDenied | PERMISSION_DENIED | 403 | 그룹 교체 권한이 거부되었습니다. | groupId |
GroupNotFound | NOT_FOUND | 404 | 지정한 그룹을 찾을 수 없습니다. | groupId |
요청 예제
FOUNDRY_HOST에는 https://를 제외한 Foundry 호스트를, FOUNDRY_TOKEN에는 유효한 토큰을 환경 변수로 제공합니다. 예시 식별자와 매개변수 값은 실제 작업 대상에 맞게 바꿉니다.
교체 예제의 multipass: 특성을 임의로 만들거나 수정하지 않습니다. 대상 그룹을 조회해 받은 모든 예약 특성을 그대로 넣은 뒤 변경할 일반 값을 준비합니다.
cURL
curl -X PUT \
-H "Content-type: application/json" \
-H "Authorization: Bearer ${FOUNDRY_TOKEN}" \
"https://${FOUNDRY_HOST}/api/v2/admin/groups/0d1fe74e-2b70-4a93-9b1a-80070637788b" \
-d '{"name":"Data Source Admins","organizations":["ri.multipass..organization.c30ee6ad-b5e4-4afe-a74f-fe4a289f2faa"],"description":"Create and modify data sources in the platform","attributes":{"multipass:realm":["eab0a251-ca1a-4a84-a482-200edfb8026f"],"multipass:organization-rid":["ri.multipass..organization.c30ee6ad-b5e4-4afe-a74f-fe4a289f2faa"]}}'
Python
Requests 라이브러리가 설치된 Python 환경에서 사용합니다.
import os
import requests
HOSTNAME = os.environ["FOUNDRY_HOST"]
TOKEN = os.environ["FOUNDRY_TOKEN"]
headers = {
"content-type": "application/json",
"authorization": "Bearer {}".format(TOKEN)
}
request_body = {
"name": "Data Source Admins",
"organizations": [
"ri.multipass..organization.c30ee6ad-b5e4-4afe-a74f-fe4a289f2faa"
],
"description": "Create and modify data sources in the platform",
"attributes": {
"multipass:realm": [
"eab0a251-ca1a-4a84-a482-200edfb8026f"
],
"multipass:organization-rid": [
"ri.multipass..organization.c30ee6ad-b5e4-4afe-a74f-fe4a289f2faa"
]
}
}
response = requests.put('https://{}/api/v2/admin/groups/0d1fe74e-2b70-4a93-9b1a-80070637788b'.format(HOSTNAME), headers=headers, json=request_body)
print(response)
Java
Apache HttpClient 4.5 API와 try-with-resources를 사용합니다. 클래스 이름에 맞는 ReplaceGroupExample.java 파일에서 사용합니다.
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
public class ReplaceGroupExample {
public static void main(String[] args) throws Exception {
String HOSTNAME = System.getenv("FOUNDRY_HOST");
String TOKEN = System.getenv("FOUNDRY_TOKEN");
try (CloseableHttpClient httpClient = HttpClientBuilder.create().build()) {
HttpPut request = new HttpPut("https://" + HOSTNAME + "/api/v2/admin/groups/0d1fe74e-2b70-4a93-9b1a-80070637788b");
request.addHeader("content-type", "application/json");
request.addHeader("authorization", String.format("Bearer %s", TOKEN));
request.setEntity(new StringEntity("{\"name\":\"Data Source Admins\",\"organizations\":[\"ri.multipass..organization.c30ee6ad-b5e4-4afe-a74f-fe4a289f2faa\"],\"description\":\"Create and modify data sources in the platform\",\"attributes\":{\"multipass:realm\":[\"eab0a251-ca1a-4a84-a482-200edfb8026f\"],\"multipass:organization-rid\":[\"ri.multipass..organization.c30ee6ad-b5e4-4afe-a74f-fe4a289f2faa\"]}}", ContentType.APPLICATION_JSON));
try (CloseableHttpResponse response = httpClient.execute(request)) {
System.out.println(response);
}
}
}
}
JavaScript
fetch를 제공하는 Node.js 환경에서 사용합니다. 서비스 사용자 토큰을 브라우저로 전달하지 않습니다.
const HOSTNAME = process.env.FOUNDRY_HOST;
const TOKEN = process.env.FOUNDRY_TOKEN;
fetch(`https://${HOSTNAME}/api/v2/admin/groups/0d1fe74e-2b70-4a93-9b1a-80070637788b`, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${TOKEN}`,
},
body: '{"name":"Data Source Admins","organizations":["ri.multipass..organization.c30ee6ad-b5e4-4afe-a74f-fe4a289f2faa"],"description":"Create and modify data sources in the platform","attributes":{"multipass:realm":["eab0a251-ca1a-4a84-a482-200edfb8026f"],"multipass:organization-rid":["ri.multipass..organization.c30ee6ad-b5e4-4afe-a74f-fe4a289f2faa"]}}'
}).then((response) => {
console.log(response)
});
PowerShell
$TOKEN = $env:FOUNDRY_TOKEN
$HOSTNAME = $env:FOUNDRY_HOST
$headers = @{
"authorization" = "Bearer $TOKEN"
}
$response = Invoke-WebRequest -Uri "https://$HOSTNAME/api/v2/admin/groups/0d1fe74e-2b70-4a93-9b1a-80070637788b" `
-Method Put `
-Headers $headers `
-ContentType application/json `
-Body "{`"name`":`"Data Source Admins`",`"organizations`":[`"ri.multipass..organization.c30ee6ad-b5e4-4afe-a74f-fe4a289f2faa`"],`"description`":`"Create and modify data sources in the platform`",`"attributes`":{`"multipass:realm`":[`"eab0a251-ca1a-4a84-a482-200edfb8026f`"],`"multipass:organization-rid`":[`"ri.multipass..organization.c30ee6ad-b5e4-4afe-a74f-fe4a289f2faa`"]}}"
$response.content