Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

웹사이트 버전 삭제(Delete Version) (V2)

versionVersion으로 지정한 웹사이트 버전을 삭제합니다. 삭제할 앱 RID와 버전 문자열을 함께 확인합니다. 현재 배포를 대상으로 하는 배포 해제와는 별도의 요청입니다.

HTTP 요청

DELETE /api/v2/thirdPartyApplications/{thirdPartyApplicationRid}/website/versions/{versionVersion}

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

경로 매개변수

이름자료형필수 여부의미와 조건예시 값
thirdPartyApplicationRidstring필수Developer Console에서 생성한 타사 애플리케이션의 RID입니다.ri.third-party-applications.main.application.292db3b2-b653-4de6-971c-7e97a7b881d6
versionVersionstring필수웹사이트의 시맨틱 버전 문자열입니다.1.2.0

쿼리 매개변수

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

요청 본문

요청 본문을 사용하지 않습니다.

응답

성공 응답에 반환할 본문 모델이 없습니다.

개별 오류

오류 이름오류 코드HTTP의미와 조건추가 매개변수
DeleteVersionPermissionDeniedPERMISSION_DENIED403웹사이트 버전을 삭제할 권한이 없습니다.thirdPartyApplicationRid, versionVersion

요청 예제

FOUNDRY_HOST에는 https://를 제외한 Foundry 호스트를, FOUNDRY_TOKEN에는 유효한 토큰을 환경 변수로 제공합니다. 예시 식별자와 매개변수 값은 실제 작업 대상에 맞게 바꿉니다.

애플리케이션의 1.2.0 버전을 삭제하는 예제입니다. 실제로 삭제하려는 앱과 버전으로 바꿉니다.

cURL

curl -X DELETE \
	-H "Authorization: Bearer ${FOUNDRY_TOKEN}" \
	"https://${FOUNDRY_HOST}/api/v2/thirdPartyApplications/ri.third-party-applications.main.application.292db3b2-b653-4de6-971c-7e97a7b881d6/website/versions/1.2.0"

Python

Requests 라이브러리가 설치된 Python 환경에서 사용합니다.

import os
import requests

HOSTNAME = os.environ["FOUNDRY_HOST"]
TOKEN = os.environ["FOUNDRY_TOKEN"]
headers = {
    "authorization": "Bearer {}".format(TOKEN)
}

response = requests.delete('https://{}/api/v2/thirdPartyApplications/ri.third-party-applications.main.application.292db3b2-b653-4de6-971c-7e97a7b881d6/website/versions/1.2.0'.format(HOSTNAME), headers=headers)
print(response)

Java

Apache HttpClient 4.5 API와 try-with-resources를 사용합니다. 클래스 이름에 맞는 DeleteVersionExample.java 파일에서 사용합니다.

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpDelete;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;

public class DeleteVersionExample {
    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()) {
            HttpDelete request = new HttpDelete("https://" + HOSTNAME + "/api/v2/thirdPartyApplications/ri.third-party-applications.main.application.292db3b2-b653-4de6-971c-7e97a7b881d6/website/versions/1.2.0");
            request.addHeader("authorization", String.format("Bearer %s", TOKEN));
            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/thirdPartyApplications/ri.third-party-applications.main.application.292db3b2-b653-4de6-971c-7e97a7b881d6/website/versions/1.2.0`, {
    method: 'DELETE',
    headers: {
        'Authorization': `Bearer ${TOKEN}`,
    }
}).then((response) => {
    console.log(response)
});

PowerShell

$ErrorActionPreference = 'Stop'
$TOKEN = $env:FOUNDRY_TOKEN
$HOSTNAME = $env:FOUNDRY_HOST

$headers = @{
    "authorization" = "Bearer $TOKEN"
}

$response = Invoke-WebRequest -Uri "https://$HOSTNAME/api/v2/thirdPartyApplications/ri.third-party-applications.main.application.292db3b2-b653-4de6-971c-7e97a7b881d6/website/versions/1.2.0" `
	-Method Delete `
	-Headers $headers

$response.content