REST API를 사용하여 엔티티 및 집계 값 가져오기
REST API 호출을 수행함으로써 솔루션의 엔티티 및 집계에 대한 정보를 검색할 수 있습니다.
시작하기 전에
REST API 명령에 대한 역할 기반 액세스 제어를 설정하고 REST API 참조 주제를 검토합니다.
이 태스크 정보
브라우저를 사용하여 REST API 메소드를 호출할 수 있으므로 값 가져오기는 테스트에 유용합니다. 예를 들어, 엔티티가 작성되는지 여부를 브라우저에서 확인하거나 글로벌 집계의 현재 값을 확인할 수 있습니다.
프로시저
- 엔티티 값을 검색하려면 다음 양식으로 GET 요청을 입력하십시오.
예를 들어, 다음 요청은 regex 매개변수를 사용하여 BankingSolution 비즈니스 모델 정의에 있는 CustomerID 엔티티의 범위를 리턴합니다.https://localhost:port/ibm/ia/rest/solutions/solution_name/entity-types/entity_type/entities/entity_idhttps://localhost:9443/ibm/ia/rest/solutions/BankingSolution/entity-types/CustomerID/entities/?regex=id[200-205] - 공유 집계 값을 검색하려면 다음 양식으로 GET 요청을 입력하십시오.
예를 들어, 다음 요청은 BankingSolution에 있는 DepositCount 공유 집계 값을 리턴합니다.https://localhost:port/ibm/ia/rest/solutions/solution_name/entity-types/entity_type/entities/entity_id/aggregate/shared_aggregate_namehttps://localhost:9443/ibm/ia/rest/solutions/BankingSolution/entity-types/Customer/entities/GoldCustomer/aggregate/DepositCount - 글로벌 집계 값을 검색하려면 다음 양식으로 GET 요청을 입력하십시오.
https://localhost:port/ibm/ia/rest/solutions/solution_name/aggregate/aggregate_name글로벌 집계의 이름에는 defvar 접두부를 포함해야 합니다.
aggregate_name을 생략하면 솔루션의 모든 글로벌 집계가 리턴됩니다.
예를 들어, 다음 요청은 BankingSolution에 있는 MaxDeposit 글로벌 집계의 현재 값을 리턴합니다.https://localhost:9443/ibm/ia/rest/solutions/BankingSolution/aggregate/defvarMaxDeposit - 공유 집계별로 그룹화된 값을 검색하려면 다음 양식으로 GET 요청을 입력하십시오.
예를 들어, 다음 요청은 BankingSolution의 비즈니스 모델 정의에서 정의된 엔티티의 유형인 bank별로 그룹화된 depositsByBank 공유 집계의 값을 리턴합니다.https://localhost:port/ibm/ia/rest/solutions/solution_name/entity-types/entity_type/entities/entity_id/aggregate/shared_aggregate_name?groupBy=valuehttps://localhost:9443/ibm/ia/rest/solutions/BankingSolution/entity-types/Customer/entities/GoldCustomer/aggregate/depositsByBank?groupBy=Bank0735이벤트가 그룹화되는 공유 특성은 정수, 문자열, 열거, 절대 기간, 연도, 월, 요일, 일, 시, 분, 초, 시간, 특성 또는 엔티티 값 유형 중 하나를 기준으로 해야 합니다.
팁:열거를 사용하는 경우, 열거 값이 비즈니스 모델에서 정의된 대로 작성되어야 합니다. 절대 기간은 ISO_8601 표준을 사용해야 합니다. 예를 들어, groupBy=PT30M입니다.
월 groupBy 유형은 각 월에 대한 1-12의 범위이며 1은 일월에 해당됩니다.
요일의 경우, groupBy는 영어 문자 이름 또는 정수 값일 수 있습니다. 정수 값은 ISO-8601 표준에 따라 1(월요일)에서 7(일요일)까지입니다. 다음 예에서 모든 요청에 의해 값이 리턴됩니다.
https://localhost:9443/ibm/ia/rest/solutions/PizzaDelivery/entity-types/pizza.Customer/entities/Smith/aggregate/monthlyPurchasePrice?groupBy=4 https://localhost:9443/ibm/ia/rest/solutions/PizzaDelivery/entity-types/pizza.Customer/entities/Smith/aggregate/monthlyPurchasePrice?groupBy=thursday https://localhost:9443/ibm/ia/rest/solutions/PizzaDelivery/entity-types/pizza.Customer/entities/Smith/aggregate/monthlyPurchasePrice?groupBy=THURSDAY시간의 경우, 값이 인코딩되어야 합니다. 예 groupBy=04%3A24%3A50은 오전 04:24:50에 해당됩니다. 엔티티 값은 엔티티 ID를 사용해야 합니다. 예를 들어, groupBy=entityId입니다.