Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

액션 유형 목록(List Action Types) (V1)

온톨로지에 정의된 액션 유형을 페이지 단위로 조회합니다.

위치이름자료형필수 여부의미
경로ontologyRidstring필수온톨로지 RID. List Ontologies 또는 Ontology Manager에서 확인
쿼리pageSizeinteger선택원하는 페이지 크기. 기본값 500
쿼리pageTokenstring선택이전 응답의 nextPageToken. 첫 요청에서는 생략

요청 본문은 없습니다. 페이지 크기는 요청한 값보다 작을 수 있지만, 뒤에 결과가 더 있으면 현재 응답에 적어도 한 항목이 포함됩니다. 다음 페이지가 있으면 응답의 nextPageToken을 다음 요청의 pageToken으로 전달합니다.

ListActionTypesResponse에는 선택적인 nextPageToken 문자열과 data: list<ActionType>이 있습니다. 각 액션 유형의 필수 필드는 apiName, status, rid이고, 매개변수와 변경 규칙은 액션 유형 자료형을 따릅니다.

응답 예시는 ACTIVE 상태이며 나열한 매개변수를 모두 필수로 구성한 두 액션 유형입니다. 사무실의 newAddress는 물리적 주소로 배송 주소와 다를 수 있습니다. newCapacity는 책상에 앉을 수 있는 인원으로, 소방 기준의 최대 수용 인원과 구분합니다.

HTTP 요청

GET /api/v1/ontologies/{ontologyRid}/actionTypes

작업 식별자는 v1.listActionTypes입니다. Authorization: Bearer <접근 토큰> 헤더로 인증합니다. OAuth 클라이언트에는 api:ontologies-read 권한 범위가 필요합니다.

JSON 응답 예시

가상 온톨로지의 응답 예시입니다.

{
  "nextPageToken": "v1.QnVpbGQgdGhlIEZ1dHVyZTogaHR0cHM6Ly93d3cucGFsYW50aXIuY29tL2NhcmVlcnMvP2xldmVyLXNvdXJjZSU1YiU1ZD1BUElEb2NzI29wZW4tcG9zaXRpb25z",
  "data": [
    {
      "apiName": "promote-employee",
      "description": "Update an employee's title and compensation",
      "parameters": {
        "employeeId": {
          "baseType": "Integer",
          "required": true
        },
        "newTitle": {
          "baseType": "String",
          "required": true
        },
        "newCompensation": {
          "baseType": "Decimal",
          "required": true
        }
      },
      "rid": "ri.ontology.main.action-type.7ed72754-7491-428a-bb18-4d7296eb2167",
      "status": "ACTIVE"
    },
    {
      "apiName": "move-office",
      "description": "Update an office's physical location",
      "parameters": {
        "officeId": {
          "baseType": "String",
          "required": true
        },
        "newAddress": {
          "description": "The office's new physical address (not necessarily shipping address)",
          "baseType": "String",
          "required": true
        },
        "newCapacity": {
          "description": "The maximum seated-at-desk capacity of the new office (maximum fire-safe capacity may be higher)",
          "baseType": "Integer",
          "required": true
        }
      },
      "rid": "ri.ontology.main.action-type.9f84017d-cf17-4fa8-84c3-8e01e5d594f2",
      "status": "ACTIVE"
    }
  ]
}

오류

실패 응답은 공통 API 오류의 형식으로 처리합니다.

요청 예제

FOUNDRY_HOST에는 https://를 제외한 Foundry 호스트를, FOUNDRY_TOKEN에는 유효한 토큰을 환경 변수로 제공합니다. 아래 식별자와 입력값은 예시이므로 실제 요청 대상에 맞게 지정합니다.

cURL

curl \
	-H "Authorization: Bearer ${FOUNDRY_TOKEN}" \
	"https://${FOUNDRY_HOST}/api/v1/ontologies/ri.ontology.main.ontology.c61d9ab5-2919-4127-a0a1-ac64c0ce6367/actionTypes"

Python

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

import os
import requests

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

response = requests.get('https://{}/api/v1/ontologies/ri.ontology.main.ontology.c61d9ab5-2919-4127-a0a1-ac64c0ce6367/actionTypes'.format(HOSTNAME), headers=headers)
print(response)

Java

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

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

public class ListActionTypesExample {
    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()) {
            HttpGet request = new HttpGet("https://" + HOSTNAME + "/api/v1/ontologies/ri.ontology.main.ontology.c61d9ab5-2919-4127-a0a1-ac64c0ce6367/actionTypes");
            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/v1/ontologies/ri.ontology.main.ontology.c61d9ab5-2919-4127-a0a1-ac64c0ce6367/actionTypes`, {
    method: 'GET',
    headers: {
        'Authorization': `Bearer ${TOKEN}`,
    }
}).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/v1/ontologies/ri.ontology.main.ontology.c61d9ab5-2919-4127-a0a1-ac64c0ce6367/actionTypes" `
	-Headers $headers

$response.content