Class FileApi
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
ConstructorsConstructorDescriptionFileApi()Instantiates this API class to invoke operations on the AI CoreFileApi(AiCoreService aiCoreService) Instantiates this API class to invoke operations on the AI Core -
Method Summary
Modifier and TypeMethodDescriptioncom.sap.cloud.sdk.services.openapi.apache.core.OpenApiResponseDelete filecom.sap.cloud.sdk.services.openapi.apache.core.OpenApiResponseDelete fileDownload fileDownload fileUpload file (size <= 100Mb)Upload file (size <= 100Mb)withDefaultHeaders(Map<String, String> defaultHeaders) Creates a new API instance with additional default headers.
-
Constructor Details
-
FileApi
public FileApi()Instantiates this API class to invoke operations on the AI Core -
FileApi
Instantiates this API class to invoke operations on the AI Core- Parameters:
aiCoreService- The configured connectivity instance to AI Core
-
-
Method Details
-
withDefaultHeaders
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
-
delete
@Nonnull public com.sap.cloud.sdk.services.openapi.apache.core.OpenApiResponse delete(@Nonnull String path, @Nullable String aiResourceGroup) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException Delete fileDelete the file specified by the path parameter.
204 - The request was processed successfully.
400 - The specification of the resource was incorrect
404 - The specified resource was not found
- Parameters:
path- (required) path relative to the object store root URL in the secretaiResourceGroup- (optional) Specify a resource group id- Returns:
- An OpenApiResponse containing the status code of the HttpResponse.
- Throws:
com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException- if an error occurs while attempting to invoke the API
-
delete
@Nonnull public com.sap.cloud.sdk.services.openapi.apache.core.OpenApiResponse delete(@Nonnull String path) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException Delete fileDelete the file specified by the path parameter.
204 - The request was processed successfully.
400 - The specification of the resource was incorrect
404 - The specified resource was not found
- Parameters:
path- path relative to the object store root URL in the secret- Returns:
- An OpenApiResponse containing the status code of the HttpResponse.
- Throws:
com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException- if an error occurs while attempting to invoke the API
-
download
@Nonnull public File download(@Nonnull String path, @Nullable String aiResourceGroup) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException Download fileEndpoint for downloading file. The path must point to an individual file.
200 - OK
400 - The specification of the resource was incorrect
404 - The specified resource was not found
- Parameters:
path- (required) path relative to the object store root URL in the secretaiResourceGroup- (optional) Specify a resource group id- Returns:
- File
- Throws:
com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException- if an error occurs while attempting to invoke the API
-
download
@Nonnull public File download(@Nonnull String path) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException Download fileEndpoint for downloading file. The path must point to an individual file.
200 - OK
400 - The specification of the resource was incorrect
404 - The specified resource was not found
- Parameters:
path- path relative to the object store root URL in the secret- Returns:
- File
- Throws:
com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException- if an error occurs while attempting to invoke the API
-
upload
@Nonnull public DSetFileCreationResponse upload(@Nonnull String path, @Nullable String aiResourceGroup, @Nullable Boolean overwrite, @Nullable Object body) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException Upload file (size <= 100Mb)Endpoint for uploading file. The maximum file size depends on the actual implementation but must not exceed 100MB. The actual file size limit can be obtained by querying the AI API Runtime Capabilities Endpoint and checking the limits in the section of the `fileUpload` extension. Path cannot be a prefix, it must be a path to an object. Clients may group the objects in any manner they choose by specifying path prefixes. Allowed mime-types will be decided by the implementation. Content-Type header can be set to \"application/octet-stream\" but the implementation is responsible for detecting the actual mime type and checking against the allowed list of mime types. For security reasons, implementations cannot trust the mime type sent by the client. Example URLs: /files/dar/schemas/schema.json /files/icr/datasets/training/20201001/20201001-01.csv /files/icr/datasets/training/20201001/20201001-02.csv /files/mask-detection/training/mask-detection-20210301.tar.gz
201 - Created
400 - The specification of the resource was incorrect
409 - The specified file already exists and cannot be overwritten.
413 - The file size exceeds the supported limit.
- Parameters:
path- (required) path relative to the object store root URL in the secretaiResourceGroup- (optional) Specify a resource group idoverwrite- (optional) If true, then file is overwritten. Default is false.body- (optional) Body of the file upload request- Returns:
- DSetFileCreationResponse
- Throws:
com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException- if an error occurs while attempting to invoke the API
-
upload
@Nonnull public DSetFileCreationResponse upload(@Nonnull String path) throws com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException Upload file (size <= 100Mb)Endpoint for uploading file. The maximum file size depends on the actual implementation but must not exceed 100MB. The actual file size limit can be obtained by querying the AI API Runtime Capabilities Endpoint and checking the limits in the section of the `fileUpload` extension. Path cannot be a prefix, it must be a path to an object. Clients may group the objects in any manner they choose by specifying path prefixes. Allowed mime-types will be decided by the implementation. Content-Type header can be set to \"application/octet-stream\" but the implementation is responsible for detecting the actual mime type and checking against the allowed list of mime types. For security reasons, implementations cannot trust the mime type sent by the client. Example URLs: /files/dar/schemas/schema.json /files/icr/datasets/training/20201001/20201001-01.csv /files/icr/datasets/training/20201001/20201001-02.csv /files/mask-detection/training/mask-detection-20210301.tar.gz
201 - Created
400 - The specification of the resource was incorrect
409 - The specified file already exists and cannot be overwritten.
413 - The file size exceeds the supported limit.
- Parameters:
path- path relative to the object store root URL in the secret- Returns:
- DSetFileCreationResponse
- Throws:
com.sap.cloud.sdk.services.openapi.apache.core.OpenApiRequestException- if an error occurs while attempting to invoke the API
-