Package com.sap.ai.sdk.core.client

# Class ScenarioApi

java.lang.Object
com.sap.cloud.sdk.services.openapi.apache.apiclient.BaseApi
com.sap.ai.sdk.core.client.ScenarioApi

public class ScenarioApi extends com.sap.cloud.sdk.services.openapi.apache.apiclient.BaseApi
AI Core in version 2.42.0.

Provides tools to manage your scenarios and workflows in SAP AI Core. Execute pipelines as a batch job, for example to pre-process or train your models, or perform batch inference. Serve inference requests of trained models. Deploy а trained machine learning model as a web service to serve inference requests with high performance. Register your own Docker registry, synchronize your AI content from your own git repository, and register your own object store for training data and trained models.

- ## Field Summary

  ### Fields inherited from class com.sap.cloud.sdk.services.openapi.apache.apiclient.BaseApi

  `apiClient, defaultHeaders`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ScenarioApi()`
  Instantiates this API class to invoke operations on the AI Core
  `ScenarioApi(AiCoreService aiCoreService)`
  Instantiates this API class to invoke operations on the AI Core

- ## Method Summary

  Modifier and Type
  Method
  Description
  `AiScenario`
  `get(String aiResourceGroup, String scenarioId)`
  Get scenario by id
  `AiScenarioList`
  `query(String aiResourceGroup)`
  Get list of scenarios
  `AiModelList`
  `queryModels(String scenarioId, String aiResourceGroup)`
  Get information about all models available in LLM global scenario
  `AiVersionList`
  `queryVersions(String aiResourceGroup, String scenarioId)`
  Get list of versions for scenario
  `AiVersionList`
  `queryVersions(String aiResourceGroup, String scenarioId, List<String> labelSelector)`
  Get list of versions for scenario
  `ScenarioApi`
  `withDefaultHeaders(Map<String,String> defaultHeaders)`
  Creates a new API instance with additional default headers.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ScenarioApi

    public ScenarioApi()
    Instantiates this API class to invoke operations on the AI Core

  - ### ScenarioApi

    public ScenarioApi(@Nonnull AiCoreService aiCoreService)
    Instantiates this API class to invoke operations on the AI Core
    Parameters:
      `aiCoreService` - The configured connectivity instance to AI Core

- ## Method Details

  - ### withDefaultHeaders

    public ScenarioApi withDefaultHeaders(@Nonnull Map<String,String> defaultHeaders)
    Creates a new API instance with additional default headers.
    Parameters:
      `defaultHeaders` - Additional headers to include in all requests
    Returns:
      A new API instance with the combined headers

  - ### get

    @Nonnull public AiScenario get(@Nonnull String aiResourceGroup, @Nonnull String scenarioId) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException
    Get scenario by id

    Retrieve details for a scenario specified by scenarioId.

    200 - A scenario

    400 - The specification of the resource was incorrect

    404 - The specified resource was not found

    Parameters:
      `aiResourceGroup` - Specify a resource group id
      `scenarioId` - Scenario identifier
    Returns:
      AiScenario
    Throws:
      `com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException` - if an error occurs while attempting to invoke the API

  - ### query

    @Nonnull public AiScenarioList query(@Nonnull String aiResourceGroup) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException
    Get list of scenarios

    Retrieve a list of all available scenarios.

    200 - A list of scenarios

    Parameters:
      `aiResourceGroup` - Specify a resource group id
    Returns:
      AiScenarioList
    Throws:
      `com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException` - if an error occurs while attempting to invoke the API

  - ### queryModels

    @Nonnull public AiModelList queryModels(@Nonnull String scenarioId, @Nonnull String aiResourceGroup) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException
    Get information about all models available in LLM global scenario

    Retrieve information about all models available in LLM global scenario

    200 - The request was successful and information of all LLM models will be returned.

    400 - The specification of the resource was incorrect

    Parameters:
      `scenarioId` - Scenario identifier
      `aiResourceGroup` - Specify a resource group id
    Returns:
      AiModelList
    Throws:
      `com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException` - if an error occurs while attempting to invoke the API

  - ### queryVersions

    @Nonnull public AiVersionList queryVersions(@Nonnull String aiResourceGroup, @Nonnull String scenarioId, @Nullable List<String> labelSelector) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException
    Get list of versions for scenario

    Retrieve a list of scenario versions based on the versions of executables available within that scenario.

    200 - A list of versions for the scenario

    400 - The specification of the resource was incorrect

    Parameters:
      `aiResourceGroup` - (required) Specify a resource group id
      `scenarioId` - (required) Scenario identifier
      `labelSelector` - (optional) filter by labels. Pass in expressions in the form of \"key=value\" or \"key!=value\" separated by commas and the result will be filtered to only those resources that have labels that match all provided expressions (i.e. logical AND)
    Returns:
      AiVersionList
    Throws:
      `com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException` - if an error occurs while attempting to invoke the API

  - ### queryVersions

    @Nonnull public AiVersionList queryVersions(@Nonnull String aiResourceGroup, @Nonnull String scenarioId) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException
    Get list of versions for scenario

    Retrieve a list of scenario versions based on the versions of executables available within that scenario.

    200 - A list of versions for the scenario

    400 - The specification of the resource was incorrect

    Parameters:
      `aiResourceGroup` - Specify a resource group id
      `scenarioId` - Scenario identifier
    Returns:
      AiVersionList
    Throws:
      `com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException` - if an error occurs while attempting to invoke the API