Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

보안 표지 교체(Replace Marking) (V2)

보안 표지의 이름과 설명을 교체합니다. 이름은 비어 있을 수 없고 같은 범주의 다른 표지와 중복될 수 없습니다. 이 요청 본문은 name과 선택적인 description을 받습니다. 구성원이나 역할을 교체하는 API와 구분합니다.

HTTP 요청

PUT /api/v2/admin/markings/{markingId}

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

경로 매개변수

이름자료형필수 여부의미와 조건예시 값
markingIdstring필수보안 표지의 ID입니다.18212f9a-0e63-4b79-96a0-aae04df23336

쿼리 매개변수

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

요청 본문

본문 형식은 ReplaceMarkingRequest이며 필수입니다.

이름자료형필수 여부의미와 조건예시 값
namestring필수PII
descriptionstring선택Contains personally identifiable information about our customers

다음 본문의 식별자와 값은 가상 예시입니다.

{
  "name": "PII",
  "description": "Contains personally identifiable information about our customers"
}

응답

응답 형식은 Marking입니다.

교체한 보안 표지입니다.

이름자료형필수 여부의미와 조건예시 값
idstring필수보안 표지의 ID입니다.18212f9a-0e63-4b79-96a0-aae04df23336
categoryIdstring필수보안 표지 범주 ID입니다. 사용자가 만든 범주는 UUID이며, 조직에 연결된 표지는 ID가 Organization인 범주에 속합니다.0950264e-01c8-4e83-81a9-1a6b7f77621a
namestring필수PII
descriptionstring선택Contains personally identifiable information about our customers
organizationstring선택조직에 연결된 표지라면 해당 조직의 RID가 들어갑니다.ri.multipass..organization.c30ee6ad-b5e4-4afe-a74f-fe4a289f2faa
prioritylong선택CBAC 표지에서만 사용하는 우선순위입니다. 숫자가 클수록 우선순위가 높습니다.10
prominenceenum선택표지를 강조하거나 덜 강조할지에 관한 힌트이며 CBAC 표지에서만 사용합니다. 허용값: COMMON, UNCOMMON.COMMON
deletedboolean필수보안 표지가 삭제되었는지 나타냅니다.false
createdTimestring (date-time)필수리소스 생성 시각입니다.2003-05-06T12:34:56.789Z
createdBystring선택리소스를 생성한 Foundry 사용자입니다.f05f8da4-b84c-4fca-9c77-8af0b13d11de

가상 일반 보안 표지의 응답 예시입니다.

{
  "deleted": false,
  "createdBy": "f05f8da4-b84c-4fca-9c77-8af0b13d11de",
  "name": "PII",
  "description": "Contains personally identifiable information about our customers",
  "createdTime": "2003-05-06T12:34:56.789Z",
  "id": "18212f9a-0e63-4b79-96a0-aae04df23336",
  "categoryId": "0950264e-01c8-4e83-81a9-1a6b7f77621a"
}

개별 오류

오류 이름오류 코드HTTP의미와 조건추가 매개변수
GetMarkingCategoryPermissionDeniedPERMISSION_DENIED403토큰에 해당 보안 표지 범주를 조회할 권한이 없습니다.markingCategoryId
MarkingNameInCategoryAlreadyExistsINVALID_ARGUMENT400같은 범주에 동일한 이름의 표지가 이미 있습니다.displayName, categoryId
GetMarkingPermissionDeniedPERMISSION_DENIED403토큰에 해당 보안 표지를 조회할 권한이 없습니다.markingId
MarkingNameIsEmptyINVALID_ARGUMENT400보안 표지 이름이 비어 있습니다.
ReplaceMarkingPermissionDeniedPERMISSION_DENIED403보안 표지 교체 권한이 거부되었습니다.markingId
MarkingNotFoundNOT_FOUND404지정한 보안 표지를 찾을 수 없습니다.markingId

요청 예제

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/markings/18212f9a-0e63-4b79-96a0-aae04df23336" \
	-d '{"name":"PII","description":"Contains personally identifiable information about our customers"}'

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": "PII",
    "description": "Contains personally identifiable information about our customers"
}

response = requests.put('https://{}/api/v2/admin/markings/18212f9a-0e63-4b79-96a0-aae04df23336'.format(HOSTNAME), headers=headers, json=request_body)
print(response)

Java

Apache HttpClient 4.5 API와 try-with-resources를 사용합니다. 클래스 이름에 맞는 ReplaceMarkingExample.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 ReplaceMarkingExample {
    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/markings/18212f9a-0e63-4b79-96a0-aae04df23336");
            request.addHeader("content-type", "application/json");
            request.addHeader("authorization", String.format("Bearer %s", TOKEN));
            request.setEntity(new StringEntity("{\"name\":\"PII\",\"description\":\"Contains personally identifiable information about our customers\"}", 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/markings/18212f9a-0e63-4b79-96a0-aae04df23336`, {
    method: 'PUT',
    headers: {
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${TOKEN}`,
    },
    body: '{"name":"PII","description":"Contains personally identifiable information about our customers"}'
}).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/markings/18212f9a-0e63-4b79-96a0-aae04df23336" `
	-Method Put `
	-Headers $headers `
	-ContentType application/json `
	-Body "{`"name`":`"PII`",`"description`":`"Contains personally identifiable information about our customers`"}"

$response.content