java.lang.Object
org.apache.camel.component.torchserve.client.management.invoker.BaseApi
org.apache.camel.component.torchserve.client.management.api.DefaultApi

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", date="2025-03-26T06:59:55.406306607Z[Etc/UTC]", comments="Generator version: 7.11.0") public class DefaultApi extends BaseApi
  • Constructor Details

    • DefaultApi

      public DefaultApi()
    • DefaultApi

      public DefaultApi(ApiClient apiClient)
  • Method Details

    • apiDescription

      public ApiDescription200Response apiDescription() throws ApiException
      Get openapi description.
      Returns:
      ApiDescription200Response
      Throws:
      ApiException - if fails to make API call
    • apiDescription

      public ApiDescription200Response apiDescription(Map<String,String> additionalHeaders) throws ApiException
      Get openapi description.
      Parameters:
      additionalHeaders - additionalHeaders for this call
      Returns:
      ApiDescription200Response
      Throws:
      ApiException - if fails to make API call
    • apiDescription_0

      @Deprecated public ApiDescription200Response apiDescription_0() throws ApiException
      Deprecated.
      Get openapi description.
      Returns:
      ApiDescription200Response
      Throws:
      ApiException - if fails to make API call
    • apiDescription_0

      @Deprecated public ApiDescription200Response apiDescription_0(Map<String,String> additionalHeaders) throws ApiException
      Deprecated.
      Get openapi description.
      Parameters:
      additionalHeaders - additionalHeaders for this call
      Returns:
      ApiDescription200Response
      Throws:
      ApiException - if fails to make API call
    • describeModel

      public List<DescribeModel200ResponseInner> describeModel(String modelName) throws ApiException
      Provides detailed information about the default version of a model.
      Parameters:
      modelName - Name of model to describe. (required)
      Returns:
      List<DescribeModel200ResponseInner>
      Throws:
      ApiException - if fails to make API call
    • describeModel

      public List<DescribeModel200ResponseInner> describeModel(String modelName, Map<String,String> additionalHeaders) throws ApiException
      Provides detailed information about the default version of a model.
      Parameters:
      modelName - Name of model to describe. (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      List<DescribeModel200ResponseInner>
      Throws:
      ApiException - if fails to make API call
    • listModels

      public ListModels200Response listModels(Integer limit, String nextPageToken) throws ApiException
      List registered models in TorchServe.
      Parameters:
      limit - Use this parameter to specify the maximum number of items to return. When this value is present, TorchServe does not return more than the specified number of items, but it might return fewer. This value is optional. If you include a value, it must be between 1 and 1000, inclusive. If you do not include a value, it defaults to 100. (optional)
      nextPageToken - The token to retrieve the next set of results. TorchServe provides the token when the response from a previous call has more results than the maximum page size. (optional)
      Returns:
      ListModels200Response
      Throws:
      ApiException - if fails to make API call
    • listModels

      public ListModels200Response listModels(Integer limit, String nextPageToken, Map<String,String> additionalHeaders) throws ApiException
      List registered models in TorchServe.
      Parameters:
      limit - Use this parameter to specify the maximum number of items to return. When this value is present, TorchServe does not return more than the specified number of items, but it might return fewer. This value is optional. If you include a value, it must be between 1 and 1000, inclusive. If you do not include a value, it defaults to 100. (optional)
      nextPageToken - The token to retrieve the next set of results. TorchServe provides the token when the response from a previous call has more results than the maximum page size. (optional)
      additionalHeaders - additionalHeaders for this call
      Returns:
      ListModels200Response
      Throws:
      ApiException - if fails to make API call
    • metrics

      public Metrics200Response metrics(String name) throws ApiException
      Get TorchServe application metrics in prometheus format.
      Parameters:
      name - Names of metrics to filter (optional)
      Returns:
      Metrics200Response
      Throws:
      ApiException - if fails to make API call
    • metrics

      public Metrics200Response metrics(String name, Map<String,String> additionalHeaders) throws ApiException
      Get TorchServe application metrics in prometheus format.
      Parameters:
      name - Names of metrics to filter (optional)
      additionalHeaders - additionalHeaders for this call
      Returns:
      Metrics200Response
      Throws:
      ApiException - if fails to make API call
    • registerModel

      public RegisterModel200Response registerModel(String url, String modelName, String handler, String runtime, Integer batchSize, Integer maxBatchDelay, Integer responseTimeout, Integer startupTimeout, Integer initialWorkers, Boolean synchronous, Boolean s3SseKms, Object body) throws ApiException
      Register a new model in TorchServe.
      Parameters:
      url - Model archive download url, support local file or HTTP(s) protocol. For S3, consider use pre-signed url. (required)
      modelName - Name of model. This value will override modelName in MANIFEST.json if present. (optional)
      handler - Inference handler entry-point. This value will override handler in MANIFEST.json if present. (optional)
      runtime - Runtime for the model custom service code. This value will override runtime in MANIFEST.json if present. (optional)
      batchSize - Inference batch size, default: 1. (optional)
      maxBatchDelay - Maximum delay for batch aggregation, default: 100. (optional)
      responseTimeout - Maximum time, in seconds, the TorchServe waits for a response from the model inference code, default: 120. (optional)
      startupTimeout - Maximum time, in seconds, the TorchServe waits for the model to startup/initialize, default: 120. (optional)
      initialWorkers - Number of initial workers, default: 0. (optional)
      synchronous - Decides whether creation of worker synchronous or not, default: false. (optional, default to false)
      s3SseKms - Model mar file is S3 SSE KMS(server side encryption) enabled or not, default: false. (optional, default to false)
      body - (optional)
      Returns:
      RegisterModel200Response
      Throws:
      ApiException - if fails to make API call
    • registerModel

      public RegisterModel200Response registerModel(String url, String modelName, String handler, String runtime, Integer batchSize, Integer maxBatchDelay, Integer responseTimeout, Integer startupTimeout, Integer initialWorkers, Boolean synchronous, Boolean s3SseKms, Object body, Map<String,String> additionalHeaders) throws ApiException
      Register a new model in TorchServe.
      Parameters:
      url - Model archive download url, support local file or HTTP(s) protocol. For S3, consider use pre-signed url. (required)
      modelName - Name of model. This value will override modelName in MANIFEST.json if present. (optional)
      handler - Inference handler entry-point. This value will override handler in MANIFEST.json if present. (optional)
      runtime - Runtime for the model custom service code. This value will override runtime in MANIFEST.json if present. (optional)
      batchSize - Inference batch size, default: 1. (optional)
      maxBatchDelay - Maximum delay for batch aggregation, default: 100. (optional)
      responseTimeout - Maximum time, in seconds, the TorchServe waits for a response from the model inference code, default: 120. (optional)
      startupTimeout - Maximum time, in seconds, the TorchServe waits for the model to startup/initialize, default: 120. (optional)
      initialWorkers - Number of initial workers, default: 0. (optional)
      synchronous - Decides whether creation of worker synchronous or not, default: false. (optional, default to false)
      s3SseKms - Model mar file is S3 SSE KMS(server side encryption) enabled or not, default: false. (optional, default to false)
      body - (optional)
      additionalHeaders - additionalHeaders for this call
      Returns:
      RegisterModel200Response
      Throws:
      ApiException - if fails to make API call
    • setAutoScale

      public RegisterModel200Response setAutoScale(String modelName, Integer minWorker, Integer maxWorker, Integer numberGpu, Boolean synchronous, Integer timeout) throws ApiException
      Configure number of workers for a default version of a model. This is an asynchronous call by default. Caller need to call describeModel to check if the model workers has been changed.
      Parameters:
      modelName - Name of model to scale workers. (required)
      minWorker - Minimum number of worker processes. (optional)
      maxWorker - Maximum number of worker processes. (optional)
      numberGpu - Number of GPU worker processes to create. (optional)
      synchronous - Decides whether the call is synchronous or not, default: false. (optional, default to false)
      timeout - Waiting up to the specified wait time if necessary for a worker to complete all pending requests. Use 0 to terminate backend worker process immediately. Use -1 for wait infinitely. (optional)
      Returns:
      RegisterModel200Response
      Throws:
      ApiException - if fails to make API call
    • setAutoScale

      public RegisterModel200Response setAutoScale(String modelName, Integer minWorker, Integer maxWorker, Integer numberGpu, Boolean synchronous, Integer timeout, Map<String,String> additionalHeaders) throws ApiException
      Configure number of workers for a default version of a model. This is an asynchronous call by default. Caller need to call describeModel to check if the model workers has been changed.
      Parameters:
      modelName - Name of model to scale workers. (required)
      minWorker - Minimum number of worker processes. (optional)
      maxWorker - Maximum number of worker processes. (optional)
      numberGpu - Number of GPU worker processes to create. (optional)
      synchronous - Decides whether the call is synchronous or not, default: false. (optional, default to false)
      timeout - Waiting up to the specified wait time if necessary for a worker to complete all pending requests. Use 0 to terminate backend worker process immediately. Use -1 for wait infinitely. (optional)
      additionalHeaders - additionalHeaders for this call
      Returns:
      RegisterModel200Response
      Throws:
      ApiException - if fails to make API call
    • setDefault

      public RegisterModel200Response setDefault(String modelName, String modelVersion) throws ApiException
      Set default version of a model
      Parameters:
      modelName - Name of model whose default version needs to be updated. (required)
      modelVersion - Version of model to be set as default version for the model (required)
      Returns:
      RegisterModel200Response
      Throws:
      ApiException - if fails to make API call
    • setDefault

      public RegisterModel200Response setDefault(String modelName, String modelVersion, Map<String,String> additionalHeaders) throws ApiException
      Set default version of a model
      Parameters:
      modelName - Name of model whose default version needs to be updated. (required)
      modelVersion - Version of model to be set as default version for the model (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      RegisterModel200Response
      Throws:
      ApiException - if fails to make API call
    • unregisterModel

      public RegisterModel200Response unregisterModel(String modelName, Boolean synchronous, Integer timeout) throws ApiException
      Unregister the default version of a model from TorchServe if it is the only version available. This is an asynchronous call by default. Caller can call listModels to confirm model is unregistered.
      Parameters:
      modelName - Name of model to unregister. (required)
      synchronous - Decides whether the call is synchronous or not, default: false. (optional, default to false)
      timeout - Waiting up to the specified wait time if necessary for a worker to complete all pending requests. Use 0 to terminate backend worker process immediately. Use -1 for wait infinitely. (optional)
      Returns:
      RegisterModel200Response
      Throws:
      ApiException - if fails to make API call
    • unregisterModel

      public RegisterModel200Response unregisterModel(String modelName, Boolean synchronous, Integer timeout, Map<String,String> additionalHeaders) throws ApiException
      Unregister the default version of a model from TorchServe if it is the only version available. This is an asynchronous call by default. Caller can call listModels to confirm model is unregistered.
      Parameters:
      modelName - Name of model to unregister. (required)
      synchronous - Decides whether the call is synchronous or not, default: false. (optional, default to false)
      timeout - Waiting up to the specified wait time if necessary for a worker to complete all pending requests. Use 0 to terminate backend worker process immediately. Use -1 for wait infinitely. (optional)
      additionalHeaders - additionalHeaders for this call
      Returns:
      RegisterModel200Response
      Throws:
      ApiException - if fails to make API call
    • versionDescribeModel

      public List<DescribeModel200ResponseInner> versionDescribeModel(String modelName, String modelVersion) throws ApiException
      Provides detailed information about the specified version of a model.If \"all\" is specified as version, returns the details about all the versions of the model.
      Parameters:
      modelName - Name of model to describe. (required)
      modelVersion - Version of model to describe. (required)
      Returns:
      List<DescribeModel200ResponseInner>
      Throws:
      ApiException - if fails to make API call
    • versionDescribeModel

      public List<DescribeModel200ResponseInner> versionDescribeModel(String modelName, String modelVersion, Map<String,String> additionalHeaders) throws ApiException
      Provides detailed information about the specified version of a model.If \"all\" is specified as version, returns the details about all the versions of the model.
      Parameters:
      modelName - Name of model to describe. (required)
      modelVersion - Version of model to describe. (required)
      additionalHeaders - additionalHeaders for this call
      Returns:
      List<DescribeModel200ResponseInner>
      Throws:
      ApiException - if fails to make API call
    • versionSetAutoScale

      public RegisterModel200Response versionSetAutoScale(String modelName, String modelVersion, Integer minWorker, Integer maxWorker, Integer numberGpu, Boolean synchronous, Integer timeout) throws ApiException
      Configure number of workers for a specified version of a model. This is an asynchronous call by default. Caller need to call describeModel to check if the model workers has been changed.
      Parameters:
      modelName - Name of model to scale workers. (required)
      modelVersion - Version of model to scale workers. (required)
      minWorker - Minimum number of worker processes. (optional)
      maxWorker - Maximum number of worker processes. (optional)
      numberGpu - Number of GPU worker processes to create. (optional)
      synchronous - Decides whether the call is synchronous or not, default: false. (optional, default to false)
      timeout - Waiting up to the specified wait time if necessary for a worker to complete all pending requests. Use 0 to terminate backend worker process immediately. Use -1 for wait infinitely. (optional)
      Returns:
      RegisterModel200Response
      Throws:
      ApiException - if fails to make API call
    • versionSetAutoScale

      public RegisterModel200Response versionSetAutoScale(String modelName, String modelVersion, Integer minWorker, Integer maxWorker, Integer numberGpu, Boolean synchronous, Integer timeout, Map<String,String> additionalHeaders) throws ApiException
      Configure number of workers for a specified version of a model. This is an asynchronous call by default. Caller need to call describeModel to check if the model workers has been changed.
      Parameters:
      modelName - Name of model to scale workers. (required)
      modelVersion - Version of model to scale workers. (required)
      minWorker - Minimum number of worker processes. (optional)
      maxWorker - Maximum number of worker processes. (optional)
      numberGpu - Number of GPU worker processes to create. (optional)
      synchronous - Decides whether the call is synchronous or not, default: false. (optional, default to false)
      timeout - Waiting up to the specified wait time if necessary for a worker to complete all pending requests. Use 0 to terminate backend worker process immediately. Use -1 for wait infinitely. (optional)
      additionalHeaders - additionalHeaders for this call
      Returns:
      RegisterModel200Response
      Throws:
      ApiException - if fails to make API call
    • versionUnregisterModel

      public RegisterModel200Response versionUnregisterModel(String modelName, String modelVersion, Boolean synchronous, Integer timeout) throws ApiException
      Unregister the specified version of a model from TorchServe. This is an asynchronous call by default. Caller can call listModels to confirm model is unregistered
      Parameters:
      modelName - Name of model to unregister. (required)
      modelVersion - Version of model to unregister. (required)
      synchronous - Decides whether the call is synchronous or not, default: false. (optional, default to false)
      timeout - Waiting up to the specified wait time if necessary for a worker to complete all pending requests. Use 0 to terminate backend worker process immediately. Use -1 for wait infinitely. (optional)
      Returns:
      RegisterModel200Response
      Throws:
      ApiException - if fails to make API call
    • versionUnregisterModel

      public RegisterModel200Response versionUnregisterModel(String modelName, String modelVersion, Boolean synchronous, Integer timeout, Map<String,String> additionalHeaders) throws ApiException
      Unregister the specified version of a model from TorchServe. This is an asynchronous call by default. Caller can call listModels to confirm model is unregistered
      Parameters:
      modelName - Name of model to unregister. (required)
      modelVersion - Version of model to unregister. (required)
      synchronous - Decides whether the call is synchronous or not, default: false. (optional, default to false)
      timeout - Waiting up to the specified wait time if necessary for a worker to complete all pending requests. Use 0 to terminate backend worker process immediately. Use -1 for wait infinitely. (optional)
      additionalHeaders - additionalHeaders for this call
      Returns:
      RegisterModel200Response
      Throws:
      ApiException - if fails to make API call
    • invokeAPI

      public <T> T invokeAPI(String url, String method, Object request, com.fasterxml.jackson.core.type.TypeReference<T> returnType, Map<String,String> additionalHeaders) throws ApiException
      Description copied from class: BaseApi
      Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests.
      Specified by:
      invokeAPI in class BaseApi
      Parameters:
      url - The URL for the request, either full URL or only the path.
      method - The HTTP method for the request.
      request - The request object.
      returnType - The return type.
      additionalHeaders - Additional headers for the request.
      Returns:
      The API response in the specified type.
      Throws:
      ApiException - if fails to make API call.