Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

그룹 교체(Replace Group) (V2)

지정한 그룹의 이름, 조직 범위, 설명과 특성을 교체합니다. 먼저 Get Group을 호출하고, 응답에서 multipass:로 시작하는 모든 특성을 값까지 정확히 보존해 다시 전달해야 합니다. 예약 특성의 값을 바꾸면 AttributesNotEditable 오류가 발생합니다.

organizations는 형식 스키마에서는 선택 필드이지만 요청에는 조직 RID가 최소 하나 있어야 합니다.

HTTP 요청

PUT /api/v2/admin/groups/{groupId}

작업 식별자는 v2.replaceGroup입니다. OAuth2로 호출하는 타사 애플리케이션에는 api:admin-write 권한 범위가 필요합니다. 각 요청에 Authorization: Bearer <접근 토큰>을 전달합니다.

경로 매개변수

이름자료형필수 여부의미와 조건예시 값
groupIdstring필수Foundry 그룹 ID입니다.0d1fe74e-2b70-4a93-9b1a-80070637788b

쿼리 매개변수

지정할 쿼리 매개변수가 없습니다.

요청 본문

본문은 필수 ReplaceGroupRequest JSON 객체입니다. 아래 예약 특성은 형식을 설명하는 가상 값이며, 실제 요청에서는 대상 그룹의 조회 응답을 그대로 사용합니다.

이름자료형필수 여부의미와 조건예시 값
namestring필수그룹 이름입니다.Data Source Admins
organizationslist<OrganizationRid>선택이 그룹을 볼 수 있는 구성원들의 조직 RID 목록입니다. 조직 RID를 최소 하나 지정해야 합니다.
descriptionstring선택그룹 설명입니다.Create and modify data sources in the platform
attributesmap<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입니다.

교체한 그룹입니다.

이름자료형필수 여부의미와 조건예시 값
idstring필수Foundry 그룹 ID입니다.0d1fe74e-2b70-4a93-9b1a-80070637788b
namestring필수그룹 이름입니다.Data Source Admins
descriptionstring선택그룹 설명입니다.Create and modify data sources in the platform
realmstring필수사용자나 그룹이 속한 인증 영역입니다. palantir-internal-realm은 관리자가 Foundry에서 생성하고 SSO 제공자와 연결하지 않은 사용자 및 그룹에 사용합니다.palantir-internal-realm
organizationslist<OrganizationRid>선택이 그룹을 볼 수 있는 구성원들의 조직 RID 목록입니다. 조직 RID를 최소 하나 지정해야 합니다.
attributesmap<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의미와 조건추가 매개변수
InvalidGroupOrganizationsINVALID_ARGUMENT400그룹에 조직 RID를 최소 하나 제공해야 합니다.
GroupNameAlreadyExistsINVALID_ARGUMENT400같은 이름의 그룹이 이미 있습니다.groupName
AttributesNotEditableINVALID_ARGUMENT400수정할 수 없는 특성이 있습니다. multipass: 접두사의 특성은 Foundry 내부용으로 예약되어 있어 수정할 수 없습니다.attributeNames
ReplaceGroupPermissionDeniedPERMISSION_DENIED403그룹 교체 권한이 거부되었습니다.groupId
GroupNotFoundNOT_FOUND404지정한 그룹을 찾을 수 없습니다.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