Class GenerativeAiSandboxAsyncClient
- java.lang.Object
-
- com.oracle.bmc.http.internal.BaseAsyncClient
-
- com.oracle.bmc.generativeaisandbox.GenerativeAiSandboxAsyncClient
-
- All Implemented Interfaces:
GenerativeAiSandboxAsync,AutoCloseable
@Generated(value="OracleSDKGenerator", comments="API Version: 1.0") public class GenerativeAiSandboxAsyncClient extends BaseAsyncClient implements GenerativeAiSandboxAsyncAsync client implementation for GenerativeAiSandbox service.
There are two ways to use async client: 1. Use AsyncHandler: using AsyncHandler, if the response to the call is anInputStream, like getObject Api in object storage service, developers need to process the stream in AsyncHandler, and not anywhere else, because the stream will be closed right after the AsyncHandler is invoked.
2. Use Java Future: using Java Future, developers need to close the stream after they are done with the Java Future.
Accessing the result should be done in a mutually exclusive manner, either through the Future or the AsyncHandler, but not both. If the Future is used, the caller should pass in null as the AsyncHandler. If the AsyncHandler is used, it is still safe to use the Future to determine whether or not the request was completed via Future.isDone/isCancelled.
Please refer to https://github.com/oracle/oci-java-sdk/blob/master/bmc-examples/src/main/java/ResteasyClientWithObjectStorageExample.java
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGenerativeAiSandboxAsyncClient.BuilderBuilder class for this client.
-
Field Summary
Fields Modifier and Type Field Description StringclientCommonLibraryVersionCompatible SDK version, provided by the codegen.Optional<String>minimumClientCommonLibraryVersionFromClientMinimum compatible SDK version, maybe provided by the codegen.static ServiceSERVICEService instance for GenerativeAiSandbox.
-
Constructor Summary
Constructors Constructor Description GenerativeAiSandboxAsyncClient(AbstractAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator, RequestSignerFactory defaultRequestSignerFactory)Deprecated.Use thebuilderinstead.GenerativeAiSandboxAsyncClient(AbstractAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator, RequestSignerFactory defaultRequestSignerFactory, List<ClientConfigurator> additionalClientConfigurators)Deprecated.Use thebuilderinstead.GenerativeAiSandboxAsyncClient(AbstractAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator, RequestSignerFactory defaultRequestSignerFactory, List<ClientConfigurator> additionalClientConfigurators, String endpoint)Deprecated.Use thebuilderinstead.GenerativeAiSandboxAsyncClient(AbstractAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator, RequestSignerFactory defaultRequestSignerFactory, Map<SigningStrategy,RequestSignerFactory> signingStrategyRequestSignerFactories, List<ClientConfigurator> additionalClientConfigurators, String endpoint)Deprecated.Use thebuilderinstead.GenerativeAiSandboxAsyncClient(BasicAuthenticationDetailsProvider authenticationDetailsProvider)Deprecated.Use thebuilderinstead.GenerativeAiSandboxAsyncClient(BasicAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration)Deprecated.Use thebuilderinstead.GenerativeAiSandboxAsyncClient(BasicAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator)Deprecated.Use thebuilderinstead.
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.AutoCloseable
close
-
Methods inherited from interface com.oracle.bmc.generativeaisandbox.GenerativeAiSandboxAsync
getEndpoint, refreshClient, setEndpoint, useRealmSpecificEndpointTemplate
-
-
-
-
Constructor Detail
-
GenerativeAiSandboxAsyncClient
@Deprecated public GenerativeAiSandboxAsyncClient(BasicAuthenticationDetailsProvider authenticationDetailsProvider)
Deprecated.Use thebuilderinstead.Create a new client instance.- Parameters:
authenticationDetailsProvider- The authentication details (seeGenerativeAiSandboxAsyncClient.Builder.build(com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider))
-
GenerativeAiSandboxAsyncClient
@Deprecated public GenerativeAiSandboxAsyncClient(BasicAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration)
Deprecated.Use thebuilderinstead.Create a new client instance.- Parameters:
authenticationDetailsProvider- The authentication details (seeGenerativeAiSandboxAsyncClient.Builder.build(com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider))configuration-ClientBuilderBase.configuration
-
GenerativeAiSandboxAsyncClient
@Deprecated public GenerativeAiSandboxAsyncClient(BasicAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator)
Deprecated.Use thebuilderinstead.Create a new client instance.- Parameters:
authenticationDetailsProvider- The authentication details (seeGenerativeAiSandboxAsyncClient.Builder.build(com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider))configuration-ClientBuilderBase.configurationclientConfigurator-ClientBuilderBase.clientConfigurator(com.oracle.bmc.http.ClientConfigurator)
-
GenerativeAiSandboxAsyncClient
@Deprecated public GenerativeAiSandboxAsyncClient(AbstractAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator, RequestSignerFactory defaultRequestSignerFactory)
Deprecated.Use thebuilderinstead.Create a new client instance.- Parameters:
authenticationDetailsProvider- The authentication details (seeGenerativeAiSandboxAsyncClient.Builder.build(com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider))configuration-ClientBuilderBase.configurationclientConfigurator-ClientBuilderBase.clientConfigurator(com.oracle.bmc.http.ClientConfigurator)defaultRequestSignerFactory-ClientBuilderBase.requestSignerFactory
-
GenerativeAiSandboxAsyncClient
@Deprecated public GenerativeAiSandboxAsyncClient(AbstractAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator, RequestSignerFactory defaultRequestSignerFactory, List<ClientConfigurator> additionalClientConfigurators)
Deprecated.Use thebuilderinstead.Create a new client instance.- Parameters:
authenticationDetailsProvider- The authentication details (seeGenerativeAiSandboxAsyncClient.Builder.build(com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider))configuration-ClientBuilderBase.configurationclientConfigurator-ClientBuilderBase.clientConfigurator(com.oracle.bmc.http.ClientConfigurator)defaultRequestSignerFactory-ClientBuilderBase.requestSignerFactoryadditionalClientConfigurators-ClientBuilderBase.additionalClientConfigurators
-
GenerativeAiSandboxAsyncClient
@Deprecated public GenerativeAiSandboxAsyncClient(AbstractAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator, RequestSignerFactory defaultRequestSignerFactory, List<ClientConfigurator> additionalClientConfigurators, String endpoint)
Deprecated.Use thebuilderinstead.Create a new client instance.- Parameters:
authenticationDetailsProvider- The authentication details (seeGenerativeAiSandboxAsyncClient.Builder.build(com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider))configuration-ClientBuilderBase.configurationclientConfigurator-ClientBuilderBase.clientConfigurator(com.oracle.bmc.http.ClientConfigurator)defaultRequestSignerFactory-ClientBuilderBase.requestSignerFactoryadditionalClientConfigurators-ClientBuilderBase.additionalClientConfiguratorsendpoint-ClientBuilderBase.endpoint(java.lang.String)
-
GenerativeAiSandboxAsyncClient
@Deprecated public GenerativeAiSandboxAsyncClient(AbstractAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator, RequestSignerFactory defaultRequestSignerFactory, Map<SigningStrategy,RequestSignerFactory> signingStrategyRequestSignerFactories, List<ClientConfigurator> additionalClientConfigurators, String endpoint)
Deprecated.Use thebuilderinstead.Create a new client instance.- Parameters:
authenticationDetailsProvider- The authentication details (seeGenerativeAiSandboxAsyncClient.Builder.build(com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider))configuration-ClientBuilderBase.configurationclientConfigurator-ClientBuilderBase.clientConfigurator(com.oracle.bmc.http.ClientConfigurator)defaultRequestSignerFactory-ClientBuilderBase.requestSignerFactoryadditionalClientConfigurators-ClientBuilderBase.additionalClientConfiguratorsendpoint-ClientBuilderBase.endpoint(java.lang.String)signingStrategyRequestSignerFactories-ClientBuilderBase.signingStrategyRequestSignerFactories
-
-
Method Detail
-
builder
public static GenerativeAiSandboxAsyncClient.Builder builder()
Create a builder for this client.- Returns:
- builder
-
setRegion
public void setRegion(Region region)
Description copied from interface:GenerativeAiSandboxAsyncSets the region to call (ex, Region.US_PHOENIX_1).Note, this will call
setEndpointafter resolving the endpoint. If the service is not available in this region, however, an IllegalArgumentException will be raised.- Specified by:
setRegionin interfaceGenerativeAiSandboxAsync- Parameters:
region- The region of the service.
-
setRegion
public void setRegion(String regionId)
Description copied from interface:GenerativeAiSandboxAsyncSets the region to call (ex, ‘us-phoenix-1’).Note, this will first try to map the region ID to a known Region and call
setRegion.If no known Region could be determined, it will create an endpoint based on the default endpoint format (
Region.formatDefaultRegionEndpoint(Service, String)and then callsetEndpoint.- Specified by:
setRegionin interfaceGenerativeAiSandboxAsync- Parameters:
regionId- The public region ID.
-
cancelSandboxCommand
public Future<CancelSandboxCommandResponse> cancelSandboxCommand(CancelSandboxCommandRequest request, AsyncHandler<CancelSandboxCommandRequest,CancelSandboxCommandResponse> handler)
Description copied from interface:GenerativeAiSandboxAsyncRequests cancellation of a running sandbox command.- Specified by:
cancelSandboxCommandin interfaceGenerativeAiSandboxAsync- Parameters:
request- The request object containing the details to sendhandler- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
createSandbox
public Future<CreateSandboxResponse> createSandbox(CreateSandboxRequest request, AsyncHandler<CreateSandboxRequest,CreateSandboxResponse> handler)
Description copied from interface:GenerativeAiSandboxAsyncCreates a sandbox resource and returns its initial state.- Specified by:
createSandboxin interfaceGenerativeAiSandboxAsync- Parameters:
request- The request object containing the details to sendhandler- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
createSandboxSnapshot
public Future<CreateSandboxSnapshotResponse> createSandboxSnapshot(CreateSandboxSnapshotRequest request, AsyncHandler<CreateSandboxSnapshotRequest,CreateSandboxSnapshotResponse> handler)
Description copied from interface:GenerativeAiSandboxAsyncCreates a sandbox snapshot resource and returns its initial state.- Specified by:
createSandboxSnapshotin interfaceGenerativeAiSandboxAsync- Parameters:
request- The request object containing the details to sendhandler- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
deleteSandbox
public Future<DeleteSandboxResponse> deleteSandbox(DeleteSandboxRequest request, AsyncHandler<DeleteSandboxRequest,DeleteSandboxResponse> handler)
Description copied from interface:GenerativeAiSandboxAsyncDeletes a sandbox.- Specified by:
deleteSandboxin interfaceGenerativeAiSandboxAsync- Parameters:
request- The request object containing the details to sendhandler- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
deleteSandboxSnapshot
public Future<DeleteSandboxSnapshotResponse> deleteSandboxSnapshot(DeleteSandboxSnapshotRequest request, AsyncHandler<DeleteSandboxSnapshotRequest,DeleteSandboxSnapshotResponse> handler)
Description copied from interface:GenerativeAiSandboxAsyncDeletes a sandbox snapshot.- Specified by:
deleteSandboxSnapshotin interfaceGenerativeAiSandboxAsync- Parameters:
request- The request object containing the details to sendhandler- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
extendSandbox
public Future<ExtendSandboxResponse> extendSandbox(ExtendSandboxRequest request, AsyncHandler<ExtendSandboxRequest,ExtendSandboxResponse> handler)
Description copied from interface:GenerativeAiSandboxAsyncExtends the duration of a sandbox.- Specified by:
extendSandboxin interfaceGenerativeAiSandboxAsync- Parameters:
request- The request object containing the details to sendhandler- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
getSandbox
public Future<GetSandboxResponse> getSandbox(GetSandboxRequest request, AsyncHandler<GetSandboxRequest,GetSandboxResponse> handler)
Description copied from interface:GenerativeAiSandboxAsyncGets information about a sandbox.- Specified by:
getSandboxin interfaceGenerativeAiSandboxAsync- Parameters:
request- The request object containing the details to sendhandler- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
getSandboxCommand
public Future<GetSandboxCommandResponse> getSandboxCommand(GetSandboxCommandRequest request, AsyncHandler<GetSandboxCommandRequest,GetSandboxCommandResponse> handler)
Description copied from interface:GenerativeAiSandboxAsyncGets command metadata for a sandbox command.- Specified by:
getSandboxCommandin interfaceGenerativeAiSandboxAsync- Parameters:
request- The request object containing the details to sendhandler- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
getSandboxCommandOutput
public Future<GetSandboxCommandOutputResponse> getSandboxCommandOutput(GetSandboxCommandOutputRequest request, AsyncHandler<GetSandboxCommandOutputRequest,GetSandboxCommandOutputResponse> handler)
Description copied from interface:GenerativeAiSandboxAsyncGets captured output for a sandbox command starting from the requested event sequence.- Specified by:
getSandboxCommandOutputin interfaceGenerativeAiSandboxAsync- Parameters:
request- The request object containing the details to sendhandler- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
getSandboxSnapshot
public Future<GetSandboxSnapshotResponse> getSandboxSnapshot(GetSandboxSnapshotRequest request, AsyncHandler<GetSandboxSnapshotRequest,GetSandboxSnapshotResponse> handler)
Description copied from interface:GenerativeAiSandboxAsyncGets information about a sandbox snapshot.- Specified by:
getSandboxSnapshotin interfaceGenerativeAiSandboxAsync- Parameters:
request- The request object containing the details to sendhandler- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
listSandboxCommand
public Future<ListSandboxCommandResponse> listSandboxCommand(ListSandboxCommandRequest request, AsyncHandler<ListSandboxCommandRequest,ListSandboxCommandResponse> handler)
Description copied from interface:GenerativeAiSandboxAsyncLists sandbox commands for a sandbox with optional pagination.- Specified by:
listSandboxCommandin interfaceGenerativeAiSandboxAsync- Parameters:
request- The request object containing the details to sendhandler- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
listSandboxSnapshots
public Future<ListSandboxSnapshotsResponse> listSandboxSnapshots(ListSandboxSnapshotsRequest request, AsyncHandler<ListSandboxSnapshotsRequest,ListSandboxSnapshotsResponse> handler)
Description copied from interface:GenerativeAiSandboxAsyncLists sandbox snapshot resources with optional filtering and pagination.- Specified by:
listSandboxSnapshotsin interfaceGenerativeAiSandboxAsync- Parameters:
request- The request object containing the details to sendhandler- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
listSandboxes
public Future<ListSandboxesResponse> listSandboxes(ListSandboxesRequest request, AsyncHandler<ListSandboxesRequest,ListSandboxesResponse> handler)
Description copied from interface:GenerativeAiSandboxAsyncLists sandbox resources with optional filtering and pagination.Specify exactly one of
projectIdorcompartmentId. A compartment-scoped request returns sandboxes from Generative AI projects directly contained in that compartment; child compartments are not included.- Specified by:
listSandboxesin interfaceGenerativeAiSandboxAsync- Parameters:
request- The request object containing the details to sendhandler- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
readSandboxFile
public Future<ReadSandboxFileResponse> readSandboxFile(ReadSandboxFileRequest request, AsyncHandler<ReadSandboxFileRequest,ReadSandboxFileResponse> handler)
Description copied from interface:GenerativeAiSandboxAsyncReads a file from a sandbox.- Specified by:
readSandboxFilein interfaceGenerativeAiSandboxAsync- Parameters:
request- The request object containing the details to sendhandler- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
resumeSandbox
public Future<ResumeSandboxResponse> resumeSandbox(ResumeSandboxRequest request, AsyncHandler<ResumeSandboxRequest,ResumeSandboxResponse> handler)
Description copied from interface:GenerativeAiSandboxAsyncResumes a suspended sandbox by scaling its backing runtime back to one replica.- Specified by:
resumeSandboxin interfaceGenerativeAiSandboxAsync- Parameters:
request- The request object containing the details to sendhandler- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
runSandboxCommand
public Future<RunSandboxCommandResponse> runSandboxCommand(RunSandboxCommandRequest request, AsyncHandler<RunSandboxCommandRequest,RunSandboxCommandResponse> handler)
Description copied from interface:GenerativeAiSandboxAsyncRuns a command in a sandbox and returns the command identifier immediately.- Specified by:
runSandboxCommandin interfaceGenerativeAiSandboxAsync- Parameters:
request- The request object containing the details to sendhandler- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
runSandboxCommandAndStream
public Future<RunSandboxCommandAndStreamResponse> runSandboxCommandAndStream(RunSandboxCommandAndStreamRequest request, AsyncHandler<RunSandboxCommandAndStreamRequest,RunSandboxCommandAndStreamResponse> handler)
Description copied from interface:GenerativeAiSandboxAsyncRuns a command in a sandbox and streams command events as newline-delimited JSON.Each line is a serialized SandboxCommandEvent.
- Specified by:
runSandboxCommandAndStreamin interfaceGenerativeAiSandboxAsync- Parameters:
request- The request object containing the details to sendhandler- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
runSandboxCommandAndWait
public Future<RunSandboxCommandAndWaitResponse> runSandboxCommandAndWait(RunSandboxCommandAndWaitRequest request, AsyncHandler<RunSandboxCommandAndWaitRequest,RunSandboxCommandAndWaitResponse> handler)
Description copied from interface:GenerativeAiSandboxAsyncRuns a command in a sandbox, blocks until command execution finishes, and returns the final command metadata.- Specified by:
runSandboxCommandAndWaitin interfaceGenerativeAiSandboxAsync- Parameters:
request- The request object containing the details to sendhandler- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
stopSandbox
public Future<StopSandboxResponse> stopSandbox(StopSandboxRequest request, AsyncHandler<StopSandboxRequest,StopSandboxResponse> handler)
Description copied from interface:GenerativeAiSandboxAsyncStops a running sandbox.- Specified by:
stopSandboxin interfaceGenerativeAiSandboxAsync- Parameters:
request- The request object containing the details to sendhandler- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
streamSandboxCommandEvents
public Future<StreamSandboxCommandEventsResponse> streamSandboxCommandEvents(StreamSandboxCommandEventsRequest request, AsyncHandler<StreamSandboxCommandEventsRequest,StreamSandboxCommandEventsResponse> handler)
Description copied from interface:GenerativeAiSandboxAsyncStreams command events for an existing sandbox command fromfromSeqthroughuntilSequsing Server-Sent Events.Each SSE
datafield contains a serialized SandboxCommandEvent.- Specified by:
streamSandboxCommandEventsin interfaceGenerativeAiSandboxAsync- Parameters:
request- The request object containing the details to sendhandler- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
suspendSandbox
public Future<SuspendSandboxResponse> suspendSandbox(SuspendSandboxRequest request, AsyncHandler<SuspendSandboxRequest,SuspendSandboxResponse> handler)
Description copied from interface:GenerativeAiSandboxAsyncSuspends a running sandbox by scaling its backing runtime to zero replicas while retaining the workspace block volume.- Specified by:
suspendSandboxin interfaceGenerativeAiSandboxAsync- Parameters:
request- The request object containing the details to sendhandler- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
updateSandbox
public Future<UpdateSandboxResponse> updateSandbox(UpdateSandboxRequest request, AsyncHandler<UpdateSandboxRequest,UpdateSandboxResponse> handler)
Description copied from interface:GenerativeAiSandboxAsyncUpdates a sandbox.- Specified by:
updateSandboxin interfaceGenerativeAiSandboxAsync- Parameters:
request- The request object containing the details to sendhandler- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
writeSandboxFile
public Future<WriteSandboxFileResponse> writeSandboxFile(WriteSandboxFileRequest request, AsyncHandler<WriteSandboxFileRequest,WriteSandboxFileResponse> handler)
Description copied from interface:GenerativeAiSandboxAsyncWrites a file in a sandbox and returns the resulting file resource.- Specified by:
writeSandboxFilein interfaceGenerativeAiSandboxAsync- Parameters:
request- The request object containing the details to sendhandler- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
getDefaultConfigurator
protected ClientConfigurator getDefaultConfigurator()
-
enableDualStackEndpoints
public void enableDualStackEndpoints(boolean enableDualStackEndpoints)
This method should be used to enable or disable the use of dual-stack endpoints.The default value is false i.e. dual-stack endpoints are disabled by default.
- Parameters:
enableDualStackEndpoints- This flag can be set to true or false to enable or disable the use of dual-stack endpoints respectively
-
getOptionsMap
public Map<String,Boolean> getOptionsMap()
Return an immutable snapshot representing the current options set for this client.- Returns:
- immutable snapshot representing the current options set for this client
-
getResolvedEndpoint
public String getResolvedEndpoint(Map<String,Object> requiredParametersMap)
Returns the endpoint after filling in the current options, as determined byBaseClient.getOptionsMap(), and then filling in the required parameters in requiredParametersMap into the placeholders in the endpoint.- Parameters:
requiredParametersMap- the map from required parameter name to their values- Returns:
- resolved endpoint, with all options and placeholders filled in
-
useRealmSpecificEndpointTemplate
public void useRealmSpecificEndpointTemplate(boolean useOfRealmSpecificEndpointTemplateEnabled)
This method should be used to enable or disable the use of realm-specific endpoint template.The default value is null. To enable the use of endpoint template defined for the realm in use, set the flag to true To disable the use of endpoint template defined for the realm in use, set the flag to false
- Parameters:
useOfRealmSpecificEndpointTemplateEnabled- This flag can be set to true or false to enable or disable the use of realm-specific endpoint template respectively
-
setEndpoint
public final void setEndpoint(String endpoint)
-
getEndpoint
public final String getEndpoint()
Get the endpoint of the client.Note that the endpoint may be parameterized and contain placeholders and options. The region subdomain and realm domain will have been properly replaced already if the endpoint was selected using a
Region.Examples of endpoints this may return:
- Unparameterized endpoints
https://identity.us-phoenix-1.oci.oraclecloud.com https://identity.us-ashburn-1.oci.oraclecloud.com https://test-namespace.objectstorage.us-ashburn-1.oci.customer-oci.com - Parameterized endpoints with placeholders
https://{namespaceName+Dot}objectstorage.us-phoenix-1.oci.customer-oci.com https://{namespaceName+Dot}objectstorage.us-ashburn-1.oci.customer-oci.com - Parameterized endpoints with options
https://{dualStack?ds.:}identity.us-phoenix-1.oci.oraclecloud.com https://{dualStack?ds.:}identity.us-ashburn-1.oci.oraclecloud.com - Parameterized endpoints with placeholders and options
https://{namespaceName+Dot}{dualStack?ds.:}objectstorage.us-phoenix-1.oci.customer-oci.com https://{namespaceName+Dot}{dualStack?ds.:}objectstorage.us-ashburn-1.oci.customer-oci.com
To get the actual endpoint for a parameterized request, you can use
BaseClient.getResolvedEndpoint(Map)orParameterizedEndpointUtil.getEndpointWithPopulatedServiceParameters(String, Map, Map).- Returns:
- the endpoint being used by the client
- Unparameterized endpoints
-
refreshClient
public final void refreshClient()
Rebuild the backingHttpClient.This will call
ClientConfigurators again, and can be used to e.g. refresh the SSL certificate.
-
close
public final void close()
- Specified by:
closein interfaceAutoCloseable
-
getClientCommonLibraryVersion
public String getClientCommonLibraryVersion()
-
getMinimumClientCommonLibraryVersionFromClient
public Optional<String> getMinimumClientCommonLibraryVersionFromClient()
-
clientCall
protected <REQ extends BmcRequest<?>,RESP extends BmcResponse,RESP_BUILDER extends BmcResponse.Builder<RESP>> ClientCall<REQ,RESP,RESP_BUILDER> clientCall(REQ request, Supplier<RESP_BUILDER> responseBuilder)
-
-