조직 교체(Replace Organization) (V2)
조직의 이름, 기본 호스트와 설명을 교체합니다. host는 조직 사용자의 URL을 만들 때 사용하는 도메인 이름입니다. 유효한 도메인 형식이어야 하며 문자, 숫자, 마침표와 하이픈만 허용합니다.
이 요청은 name, 선택적인 host와 description을 받습니다. 초기 관리자나 역할 할당을 다시 지정하는 요청과 구분합니다.
HTTP 요청
PUT /api/v2/admin/organizations/{organizationRid}
작업 식별자는 v2.replaceOrganization입니다. OAuth2로 호출하는 타사 애플리케이션에는 api:admin-write 권한 범위가 필요합니다. 각 요청에 Authorization: Bearer <접근 토큰>을 전달합니다.
경로 매개변수
| 이름 | 자료형 | 필수 여부 | 의미와 조건 | 예시 값 |
|---|---|---|---|---|
organizationRid | string | 필수 | ri.multipass..organization.c30ee6ad-b5e4-4afe-a74f-fe4a289f2faa |
쿼리 매개변수
지정할 쿼리 매개변수가 없습니다.
요청 본문
본문 형식은 ReplaceOrganizationRequest이며 필수입니다.
| 이름 | 자료형 | 필수 여부 | 의미와 조건 | 예시 값 |
|---|---|---|---|---|
name | string | 필수 | Example Organization | |
host | string | 선택 | 조직의 기본 호스트 이름입니다. 이 조직 사용자를 위한 URL을 만들 때 사용합니다. | example.palantirfoundry.com |
description | string | 선택 |
다음 본문의 식별자와 값은 가상 예시입니다.
{
"name": "Example Organization",
"host": "example.palantirfoundry.com"
}
응답
응답 형식은 Organization입니다.
교체한 조직입니다.
| 이름 | 자료형 | 필수 여부 | 의미와 조건 | 예시 값 |
|---|---|---|---|---|
rid | string | 필수 | ri.multipass..organization.c30ee6ad-b5e4-4afe-a74f-fe4a289f2faa | |
name | string | 필수 | Example Organization | |
description | string | 선택 | ||
markingId | string | 필수 | 조직의 기반 보안 표지 ID입니다. 이 표지의 구성원을 변경해 조직의 게스트 접근을 관리할 수 있습니다. | 18212f9a-0e63-4b79-96a0-aae04df23336 |
host | string | 선택 | 조직의 기본 호스트 이름입니다. 이 조직 사용자를 위한 URL을 만들 때 사용합니다. | example.palantirfoundry.com |
가상 조직의 응답 예시입니다.
{
"name": "Example Organization",
"host": "example.palantirfoundry.com",
"rid": "ri.multipass..organization.c30ee6ad-b5e4-4afe-a74f-fe4a289f2faa",
"markingId": "18212f9a-0e63-4b79-96a0-aae04df23336"
}
개별 오류
| 오류 이름 | 오류 코드 | HTTP | 의미와 조건 | 추가 매개변수 |
|---|---|---|---|---|
InvalidHostName | INVALID_ARGUMENT | 400 | 호스트는 유효한 도메인 이름이어야 하며 문자, 숫자, 마침표와 하이픈만 허용합니다. | invalidHostName |
OrganizationNameAlreadyExists | INVALID_ARGUMENT | 400 | 같은 이름의 조직이 이미 있습니다. | displayName |
ReplaceOrganizationPermissionDenied | PERMISSION_DENIED | 403 | 조직 교체 권한이 거부되었습니다. | organizationRid |
OrganizationNotFound | NOT_FOUND | 404 | 지정한 조직을 찾을 수 없습니다. | organizationRid |
요청 예제
FOUNDRY_HOST에는 https://를 제외한 Foundry 호스트를, FOUNDRY_TOKEN에는 유효한 토큰을 환경 변수로 제공합니다. 예시 식별자와 매개변수 값은 실제 작업 대상에 맞게 바꿉니다.
cURL
curl -X PUT \
-H "Content-type: application/json" \
-H "Authorization: Bearer ${FOUNDRY_TOKEN}" \
"https://${FOUNDRY_HOST}/api/v2/admin/organizations/ri.multipass..organization.c30ee6ad-b5e4-4afe-a74f-fe4a289f2faa" \
-d '{"name":"Example Organization","host":"example.palantirfoundry.com"}'
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": "Example Organization",
"host": "example.palantirfoundry.com"
}
response = requests.put('https://{}/api/v2/admin/organizations/ri.multipass..organization.c30ee6ad-b5e4-4afe-a74f-fe4a289f2faa'.format(HOSTNAME), headers=headers, json=request_body)
print(response)
Java
Apache HttpClient 4.5 API와 try-with-resources를 사용합니다. 클래스 이름에 맞는 ReplaceOrganizationExample.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 ReplaceOrganizationExample {
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/organizations/ri.multipass..organization.c30ee6ad-b5e4-4afe-a74f-fe4a289f2faa");
request.addHeader("content-type", "application/json");
request.addHeader("authorization", String.format("Bearer %s", TOKEN));
request.setEntity(new StringEntity("{\"name\":\"Example Organization\",\"host\":\"example.palantirfoundry.com\"}", 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/organizations/ri.multipass..organization.c30ee6ad-b5e4-4afe-a74f-fe4a289f2faa`, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${TOKEN}`,
},
body: '{"name":"Example Organization","host":"example.palantirfoundry.com"}'
}).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/organizations/ri.multipass..organization.c30ee6ad-b5e4-4afe-a74f-fe4a289f2faa" `
-Method Put `
-Headers $headers `
-ContentType application/json `
-Body "{`"name`":`"Example Organization`",`"host`":`"example.palantirfoundry.com`"}"
$response.content