그룹 생성(Create Group) (V2)
새 그룹을 생성합니다. name과 그룹을 볼 수 있는 조직 범위를 지정합니다. organizations는 형식 스키마에서 선택 필드이지만, 요청의 유효성 조건상 조직 RID를 최소 하나 제공해야 합니다.
HTTP 요청
POST /api/v2/admin/groups
작업 식별자는 v2.createGroup입니다. OAuth2로 호출하는 타사 애플리케이션에는 api:admin-write 권한 범위가 필요합니다. 각 요청에 Authorization: Bearer <접근 토큰>을 전달합니다.
경로 매개변수
지정할 경로 매개변수가 없습니다.
쿼리 매개변수
지정할 쿼리 매개변수가 없습니다.
요청 본문
본문은 필수 CreateGroupRequest JSON 객체입니다. 예제는 사용자 정의 특성을 추가하지 않는 새 그룹이므로 attributes를 빈 맵으로 전달합니다.
| 이름 | 자료형 | 필수 여부 | 의미와 조건 | 예시 값 |
|---|---|---|---|---|
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": {}
}
응답
응답 형식은 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 |
CreateGroupPermissionDenied | PERMISSION_DENIED | 403 | 그룹 생성 권한이 거부되었습니다. | |
OrganizationNotFound | NOT_FOUND | 404 | 지정한 조직을 찾을 수 없습니다. | organizationRid |
요청 예제
FOUNDRY_HOST에는 https://를 제외한 Foundry 호스트를, FOUNDRY_TOKEN에는 유효한 토큰을 환경 변수로 제공합니다. 예시 식별자와 매개변수 값은 실제 작업 대상에 맞게 바꿉니다.
cURL
curl -X POST \
-H "Content-type: application/json" \
-H "Authorization: Bearer ${FOUNDRY_TOKEN}" \
"https://${FOUNDRY_HOST}/api/v2/admin/groups" \
-d '{"name":"Data Source Admins","organizations":["ri.multipass..organization.c30ee6ad-b5e4-4afe-a74f-fe4a289f2faa"],"description":"Create and modify data sources in the platform","attributes":{}}'
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": {}
}
response = requests.post('https://{}/api/v2/admin/groups'.format(HOSTNAME), headers=headers, json=request_body)
print(response)
Java
Apache HttpClient 4.5 API와 try-with-resources를 사용합니다. 클래스 이름에 맞는 CreateGroupExample.java 파일에서 사용합니다.
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
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 CreateGroupExample {
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()) {
HttpPost request = new HttpPost("https://" + HOSTNAME + "/api/v2/admin/groups");
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\":{}}", 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`, {
method: 'POST',
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":{}}'
}).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" `
-Method Post `
-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`":{}}"
$response.content