GenerativeAiSandboxClient¶
-
class
oci.generative_ai_sandbox.GenerativeAiSandboxClient(config, **kwargs)¶ API for managing sandbox resources and exchanging sandbox access tokens.
Methods
__init__(config, **kwargs)Creates a new service client cancel_sandbox_command(sandbox_id, …)Requests cancellation of a running sandbox command. create_sandbox(project_id, …)Creates a sandbox resource and returns its initial state. create_sandbox_snapshot(…)Creates a sandbox snapshot resource and returns its initial state. delete_sandbox(sandbox_id, **kwargs)Deletes a sandbox. delete_sandbox_snapshot(snapshot_id, **kwargs)Deletes a sandbox snapshot. extend_sandbox(sandbox_id, …)Extends the duration of a sandbox. get_sandbox(sandbox_id, **kwargs)Gets information about a sandbox. get_sandbox_command(sandbox_id, command_id, …)Gets command metadata for a sandbox command. get_sandbox_command_output(sandbox_id, …)Gets captured output for a sandbox command starting from the requested event sequence. get_sandbox_snapshot(snapshot_id, **kwargs)Gets information about a sandbox snapshot. list_sandbox_command(sandbox_id, **kwargs)Lists sandbox commands for a sandbox with optional pagination. list_sandbox_snapshots(**kwargs)Lists sandbox snapshot resources with optional filtering and pagination. list_sandboxes(**kwargs)Lists sandbox resources with optional filtering and pagination. read_sandbox_file(sandbox_id, file_path, …)Reads a file from a sandbox. resume_sandbox(sandbox_id, …)Resumes a suspended sandbox by scaling its backing runtime back to one replica. run_sandbox_command(sandbox_id, …)Runs a command in a sandbox and returns the command identifier immediately. run_sandbox_command_and_stream(sandbox_id, …)Runs a command in a sandbox and streams command events as newline-delimited JSON. run_sandbox_command_and_wait(sandbox_id, …)Runs a command in a sandbox, blocks until command execution finishes, and returns the final command metadata. stop_sandbox(sandbox_id, …)Stops a running sandbox. stream_sandbox_command_events(sandbox_id, …)Streams command events for an existing sandbox command from fromSeq through untilSeq using Server-Sent Events. suspend_sandbox(sandbox_id, …)Suspends a running sandbox by scaling its backing runtime to zero replicas while retaining the workspace block volume. update_sandbox(sandbox_id, …)Updates a sandbox. write_sandbox_file(sandbox_id, file_path, …)Writes a file in a sandbox and returns the resulting file resource. -
__init__(config, **kwargs)¶ Creates a new service client
Parameters: - config (dict) – Configuration keys and values as per SDK and Tool Configuration.
The
from_file()method can be used to load configuration from a file. Alternatively, adictcan be passed. You can validate_config the dict usingvalidate_config() - service_endpoint (str) – (optional)
The endpoint of the service to call using this client. For example
https://iaas.us-ashburn-1.oraclecloud.com. If this keyword argument is not provided then it will be derived using the region in the config parameter. You should only provide this keyword argument if you have an explicit need to specify a service endpoint. - timeout (float or tuple(float, float)) – (optional) The connection and read timeouts for the client. The default values are connection timeout 10 seconds and read timeout 60 seconds. This keyword argument can be provided as a single float, in which case the value provided is used for both the read and connection timeouts, or as a tuple of two floats. If a tuple is provided then the first value is used as the connection timeout and the second value as the read timeout.
- signer (
AbstractBaseSigner) –(optional) The signer to use when signing requests made by the service client. The default is to use a
Signerbased on the values provided in the config parameter.One use case for this parameter is for Instance Principals authentication by passing an instance of
InstancePrincipalsSecurityTokenSigneras the value for this keyword argument - retry_strategy (obj) –
(optional) A retry strategy to apply to all calls made by this service client (i.e. at the client level). There is no retry strategy applied by default. Retry strategies can also be applied at the operation level by passing a
retry_strategykeyword argument as part of calling the operation. Any value provided at the operation level will override whatever is specified at the client level.This should be one of the strategies available in the
retrymodule. A convenienceDEFAULT_RETRY_STRATEGYis also available. The specifics of the default retry strategy are described here. - circuit_breaker_strategy (obj) – (optional)
A circuit breaker strategy to apply to all calls made by this service client (i.e. at the client level).
This client uses
DEFAULT_CIRCUIT_BREAKER_STRATEGYas default if no circuit breaker strategy is provided. The specifics of circuit breaker strategy are described here. - circuit_breaker_callback (function) – (optional) Callback function to receive any exceptions triggerred by the circuit breaker.
- client_level_realm_specific_endpoint_template_enabled (bool) – (optional) A boolean flag to indicate whether or not this client should be created with realm specific endpoint template enabled or disable. By default, this will be set as None.
- allow_control_chars – (optional) allow_control_chars is a boolean to indicate whether or not this client should allow control characters in the response object. By default, the client will not allow control characters to be in the response object.
- enable_strict_url_encoding – (optional) enable_strict_url_encoding is a boolean to indicate whether or not this client should enable strict url encoding in path params of a request. By default, the client will not enable strict url encoding
- config (dict) – Configuration keys and values as per SDK and Tool Configuration.
The
-
cancel_sandbox_command(sandbox_id, command_id, cancel_sandbox_command_details, **kwargs)¶ Requests cancellation of a running sandbox command.
Parameters: - sandbox_id (str) – (required) Sandbox identifier. Newly generated Sandbox IDs use sbx- followed by 16 lowercase base32 characters (a-z2-7); existing legacy IDs remain accepted.
- command_id (str) – (required) Sandbox command identifier.
- cancel_sandbox_command_details (oci.generative_ai_sandbox.models.CancelSandboxCommandDetails) – (required) Request payload for canceling a sandbox command.
- opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
- opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of running that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and removed from the system, then a retry of the original creation request might be rejected.
- retry_strategy (obj) –
(optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.
This should be one of the strategies available in the
retrymodule. This operation usesDEFAULT_RETRY_STRATEGYas default if no retry strategy is provided. The specifics of the default retry strategy are described here.To have this operation explicitly not perform any retries, pass an instance of
NoneRetryStrategy. - allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
- enable_strict_url_encoding (bool) – (optional) enable_strict_url_encoding is a boolean to indicate whether or not this request should enable strict url encoding for path params. By default, strict url encoding for path params is disabled
Returns: A
Responseobject with data of typeSandboxCommandReturn type: Example: Click here to see an example of how to use cancel_sandbox_command API.
-
create_sandbox(project_id, create_sandbox_details, **kwargs)¶ Creates a sandbox resource and returns its initial state.
Parameters: - project_id (str) – (required) Required project identifier used to scope sandbox creation.
- create_sandbox_details (oci.generative_ai_sandbox.models.CreateSandboxDetails) – (required) Request payload for sandbox creation.
- opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
- opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of running that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and removed from the system, then a retry of the original creation request might be rejected.
- retry_strategy (obj) –
(optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.
This should be one of the strategies available in the
retrymodule. This operation usesDEFAULT_RETRY_STRATEGYas default if no retry strategy is provided. The specifics of the default retry strategy are described here.To have this operation explicitly not perform any retries, pass an instance of
NoneRetryStrategy. - allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
- enable_strict_url_encoding (bool) – (optional) enable_strict_url_encoding is a boolean to indicate whether or not this request should enable strict url encoding for path params. By default, strict url encoding for path params is disabled
Returns: Return type: Example: Click here to see an example of how to use create_sandbox API.
-
create_sandbox_snapshot(create_sandbox_snapshot_details, **kwargs)¶ Creates a sandbox snapshot resource and returns its initial state.
Parameters: - create_sandbox_snapshot_details (oci.generative_ai_sandbox.models.CreateSandboxSnapshotDetails) – (required) Request payload for sandbox snapshot creation.
- opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
- opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of running that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and removed from the system, then a retry of the original creation request might be rejected.
- retry_strategy (obj) –
(optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.
This should be one of the strategies available in the
retrymodule. This operation usesDEFAULT_RETRY_STRATEGYas default if no retry strategy is provided. The specifics of the default retry strategy are described here.To have this operation explicitly not perform any retries, pass an instance of
NoneRetryStrategy. - allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
- enable_strict_url_encoding (bool) – (optional) enable_strict_url_encoding is a boolean to indicate whether or not this request should enable strict url encoding for path params. By default, strict url encoding for path params is disabled
Returns: A
Responseobject with data of typeSandboxSnapshotReturn type: Example: Click here to see an example of how to use create_sandbox_snapshot API.
-
delete_sandbox(sandbox_id, **kwargs)¶ Deletes a sandbox.
Parameters: - sandbox_id (str) – (required) Sandbox identifier. Newly generated Sandbox IDs use sbx- followed by 16 lowercase base32 characters (a-z2-7); existing legacy IDs remain accepted.
- opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
- if_match (str) – (optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource is updated or deleted only if the etag provided matches the resource’s current etag value.
- retry_strategy (obj) –
(optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.
This should be one of the strategies available in the
retrymodule. This operation usesDEFAULT_RETRY_STRATEGYas default if no retry strategy is provided. The specifics of the default retry strategy are described here.To have this operation explicitly not perform any retries, pass an instance of
NoneRetryStrategy. - allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
- enable_strict_url_encoding (bool) – (optional) enable_strict_url_encoding is a boolean to indicate whether or not this request should enable strict url encoding for path params. By default, strict url encoding for path params is disabled
Returns: A
Responseobject with data of type NoneReturn type: Example: Click here to see an example of how to use delete_sandbox API.
-
delete_sandbox_snapshot(snapshot_id, **kwargs)¶ Deletes a sandbox snapshot.
Parameters: - snapshot_id (str) – (required) Sandbox snapshot identifier.
- opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
- if_match (str) – (optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource is updated or deleted only if the etag provided matches the resource’s current etag value.
- retry_strategy (obj) –
(optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.
This should be one of the strategies available in the
retrymodule. This operation usesDEFAULT_RETRY_STRATEGYas default if no retry strategy is provided. The specifics of the default retry strategy are described here.To have this operation explicitly not perform any retries, pass an instance of
NoneRetryStrategy. - allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
- enable_strict_url_encoding (bool) – (optional) enable_strict_url_encoding is a boolean to indicate whether or not this request should enable strict url encoding for path params. By default, strict url encoding for path params is disabled
Returns: A
Responseobject with data of type NoneReturn type: Example: Click here to see an example of how to use delete_sandbox_snapshot API.
-
extend_sandbox(sandbox_id, extend_sandbox_details, **kwargs)¶ Extends the duration of a sandbox.
Parameters: - sandbox_id (str) – (required) Sandbox identifier. Newly generated Sandbox IDs use sbx- followed by 16 lowercase base32 characters (a-z2-7); existing legacy IDs remain accepted.
- extend_sandbox_details (oci.generative_ai_sandbox.models.ExtendSandboxDetails) – (required) Request payload for extending a sandbox.
- opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
- opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of running that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and removed from the system, then a retry of the original creation request might be rejected.
- if_match (str) – (optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource is updated or deleted only if the etag provided matches the resource’s current etag value.
- retry_strategy (obj) –
(optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.
This should be one of the strategies available in the
retrymodule. This operation usesDEFAULT_RETRY_STRATEGYas default if no retry strategy is provided. The specifics of the default retry strategy are described here.To have this operation explicitly not perform any retries, pass an instance of
NoneRetryStrategy. - allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
- enable_strict_url_encoding (bool) – (optional) enable_strict_url_encoding is a boolean to indicate whether or not this request should enable strict url encoding for path params. By default, strict url encoding for path params is disabled
Returns: Return type: Example: Click here to see an example of how to use extend_sandbox API.
-
get_sandbox(sandbox_id, **kwargs)¶ Gets information about a sandbox.
Parameters: - sandbox_id (str) – (required) Sandbox identifier. Newly generated Sandbox IDs use sbx- followed by 16 lowercase base32 characters (a-z2-7); existing legacy IDs remain accepted.
- opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
- retry_strategy (obj) –
(optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.
This should be one of the strategies available in the
retrymodule. This operation usesDEFAULT_RETRY_STRATEGYas default if no retry strategy is provided. The specifics of the default retry strategy are described here.To have this operation explicitly not perform any retries, pass an instance of
NoneRetryStrategy. - allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
- enable_strict_url_encoding (bool) – (optional) enable_strict_url_encoding is a boolean to indicate whether or not this request should enable strict url encoding for path params. By default, strict url encoding for path params is disabled
Returns: Return type: Example: Click here to see an example of how to use get_sandbox API.
-
get_sandbox_command(sandbox_id, command_id, **kwargs)¶ Gets command metadata for a sandbox command.
Parameters: - sandbox_id (str) – (required) Sandbox identifier. Newly generated Sandbox IDs use sbx- followed by 16 lowercase base32 characters (a-z2-7); existing legacy IDs remain accepted.
- command_id (str) – (required) Sandbox command identifier.
- opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
- retry_strategy (obj) –
(optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.
This should be one of the strategies available in the
retrymodule. This operation usesDEFAULT_RETRY_STRATEGYas default if no retry strategy is provided. The specifics of the default retry strategy are described here.To have this operation explicitly not perform any retries, pass an instance of
NoneRetryStrategy. - allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
- enable_strict_url_encoding (bool) – (optional) enable_strict_url_encoding is a boolean to indicate whether or not this request should enable strict url encoding for path params. By default, strict url encoding for path params is disabled
Returns: A
Responseobject with data of typeSandboxCommandReturn type: Example: Click here to see an example of how to use get_sandbox_command API.
-
get_sandbox_command_output(sandbox_id, command_id, **kwargs)¶ Gets captured output for a sandbox command starting from the requested event sequence.
Parameters: - sandbox_id (str) – (required) Sandbox identifier. Newly generated Sandbox IDs use sbx- followed by 16 lowercase base32 characters (a-z2-7); existing legacy IDs remain accepted.
- command_id (str) – (required) Sandbox command identifier.
- opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
- from_seq (int) – (optional) The first command event sequence number to include.
- retry_strategy (obj) –
(optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.
This should be one of the strategies available in the
retrymodule. This operation usesDEFAULT_RETRY_STRATEGYas default if no retry strategy is provided. The specifics of the default retry strategy are described here.To have this operation explicitly not perform any retries, pass an instance of
NoneRetryStrategy. - allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
- enable_strict_url_encoding (bool) – (optional) enable_strict_url_encoding is a boolean to indicate whether or not this request should enable strict url encoding for path params. By default, strict url encoding for path params is disabled
Returns: A
Responseobject with data of typeSandboxCommandOutputReturn type: Example: Click here to see an example of how to use get_sandbox_command_output API.
-
get_sandbox_snapshot(snapshot_id, **kwargs)¶ Gets information about a sandbox snapshot.
Parameters: - snapshot_id (str) – (required) Sandbox snapshot identifier.
- opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
- retry_strategy (obj) –
(optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.
This should be one of the strategies available in the
retrymodule. This operation usesDEFAULT_RETRY_STRATEGYas default if no retry strategy is provided. The specifics of the default retry strategy are described here.To have this operation explicitly not perform any retries, pass an instance of
NoneRetryStrategy. - allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
- enable_strict_url_encoding (bool) – (optional) enable_strict_url_encoding is a boolean to indicate whether or not this request should enable strict url encoding for path params. By default, strict url encoding for path params is disabled
Returns: A
Responseobject with data of typeSandboxSnapshotReturn type: Example: Click here to see an example of how to use get_sandbox_snapshot API.
-
list_sandbox_command(sandbox_id, **kwargs)¶ Lists sandbox commands for a sandbox with optional pagination.
Parameters: - sandbox_id (str) – (required) Sandbox identifier. Newly generated Sandbox IDs use sbx- followed by 16 lowercase base32 characters (a-z2-7); existing legacy IDs remain accepted.
- opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
- command_id (str) – (optional) Sandbox command identifier used to filter listed command resources.
- sort_by (str) –
(optional) The field to sort by. Only one sort order may be provided. Default order for timeCreated is ascending.
Allowed values are: “timeCreated”, “timeStarted”, “timeFinished”
- sort_order (str) –
(optional) The sort order to use, either ascending (ASC) or descending (DESC).
Allowed values are: “ASC”, “DESC”
- limit (int) – (optional) The maximum number of items to return.
- page (str) – (optional) A token representing the position at which to start retrieving results.
- retry_strategy (obj) –
(optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.
This should be one of the strategies available in the
retrymodule. This operation usesDEFAULT_RETRY_STRATEGYas default if no retry strategy is provided. The specifics of the default retry strategy are described here.To have this operation explicitly not perform any retries, pass an instance of
NoneRetryStrategy. - allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
- enable_strict_url_encoding (bool) – (optional) enable_strict_url_encoding is a boolean to indicate whether or not this request should enable strict url encoding for path params. By default, strict url encoding for path params is disabled
Returns: A
Responseobject with data of typeSandboxCommandCollectionReturn type: Example: Click here to see an example of how to use list_sandbox_command API.
-
list_sandbox_snapshots(**kwargs)¶ Lists sandbox snapshot resources with optional filtering and pagination.
Parameters: - opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
- project_id (str) – (optional) The project identifier used to filter listed sandbox snapshot resources.
- display_name (str) – (optional) Sandbox snapshot display name used to filter listed sandbox snapshot resources.
- sandbox_id (str) – (optional) Sandbox identifier used to filter listed sandbox snapshot resources. Newly generated Sandbox IDs use sbx- followed by 16 lowercase base32 characters (a-z2-7); existing legacy IDs remain accepted.
- snapshot_id (str) – (optional) Sandbox snapshot identifier used to filter listed sandbox snapshot resources.
- lifecycle_state (str) –
(optional) A filter to return only sandbox snapshot resources whose state matches the given state.
Allowed values are: “CREATING”, “ACTIVE”, “FAILED”, “DELETING”, “DELETED”
- sort_by (str) –
(optional) The field to sort by. Only one sort order may be provided. Default order for timeCreated is ascending.
Allowed values are: “timeCreated”, “displayName”
- sort_order (str) –
(optional) The sort order to use, either ascending (ASC) or descending (DESC).
Allowed values are: “ASC”, “DESC”
- limit (int) – (optional) The maximum number of items to return.
- page (str) – (optional) A token representing the position at which to start retrieving results.
- retry_strategy (obj) –
(optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.
This should be one of the strategies available in the
retrymodule. This operation usesDEFAULT_RETRY_STRATEGYas default if no retry strategy is provided. The specifics of the default retry strategy are described here.To have this operation explicitly not perform any retries, pass an instance of
NoneRetryStrategy. - allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
- enable_strict_url_encoding (bool) – (optional) enable_strict_url_encoding is a boolean to indicate whether or not this request should enable strict url encoding for path params. By default, strict url encoding for path params is disabled
Returns: A
Responseobject with data of typeSandboxSnapshotCollectionReturn type: Example: Click here to see an example of how to use list_sandbox_snapshots API.
-
list_sandboxes(**kwargs)¶ Lists sandbox resources with optional filtering and pagination. Specify exactly one of projectId or compartmentId. A compartment-scoped request returns sandboxes from Generative AI projects directly contained in that compartment; child compartments are not included.
Parameters: - opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
- project_id (str) – (optional) The project identifier used to filter listed sandbox resources.
- compartment_id (str) –
(optional) The OCID of the compartment in which to list resources.
- sandbox_id (str) – (optional) Sandbox identifier used to filter listed sandbox resources. Newly generated Sandbox IDs use sbx- followed by 16 lowercase base32 characters (a-z2-7); existing legacy IDs remain accepted.
- display_name (str) – (optional) Sandbox display name used to filter listed sandbox resources.
- lifecycle_state (str) –
(optional) A filter to return only resources whose state matches the given state.
Allowed values are: “RUNNING”, “CREATING”, “UPDATING”, “DELETED”, “FAILED”, “SUSPENDING”, “SUSPENDED”, “RESUMING”, “STOPPING”, “STOPPED”
- sort_by (str) –
(optional) The field to sort by. Only one sort order may be provided. Default order for timeCreated is ascending.
Allowed values are: “timeCreated”, “displayName”
- sort_order (str) –
(optional) The sort order to use, either ascending (ASC) or descending (DESC).
Allowed values are: “ASC”, “DESC”
- limit (int) – (optional) The maximum number of items to return.
- page (str) – (optional) A token representing the position at which to start retrieving results.
- retry_strategy (obj) –
(optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.
This should be one of the strategies available in the
retrymodule. This operation usesDEFAULT_RETRY_STRATEGYas default if no retry strategy is provided. The specifics of the default retry strategy are described here.To have this operation explicitly not perform any retries, pass an instance of
NoneRetryStrategy. - allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
- enable_strict_url_encoding (bool) – (optional) enable_strict_url_encoding is a boolean to indicate whether or not this request should enable strict url encoding for path params. By default, strict url encoding for path params is disabled
Returns: A
Responseobject with data of typeSandboxCollectionReturn type: Example: Click here to see an example of how to use list_sandboxes API.
-
read_sandbox_file(sandbox_id, file_path, **kwargs)¶ Reads a file from a sandbox.
Parameters: - sandbox_id (str) – (required) Sandbox identifier. Newly generated Sandbox IDs use sbx- followed by 16 lowercase base32 characters (a-z2-7); existing legacy IDs remain accepted.
- file_path (str) – (required) Absolute path under /workspace of the file to read.
- opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
- retry_strategy (obj) –
(optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.
This should be one of the strategies available in the
retrymodule. This operation usesDEFAULT_RETRY_STRATEGYas default if no retry strategy is provided. The specifics of the default retry strategy are described here.To have this operation explicitly not perform any retries, pass an instance of
NoneRetryStrategy. - allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
- enable_strict_url_encoding (bool) – (optional) enable_strict_url_encoding is a boolean to indicate whether or not this request should enable strict url encoding for path params. By default, strict url encoding for path params is disabled
Returns: A
Responseobject with data of type streamReturn type: Example: Click here to see an example of how to use read_sandbox_file API.
-
resume_sandbox(sandbox_id, resume_sandbox_details, **kwargs)¶ Resumes a suspended sandbox by scaling its backing runtime back to one replica.
Parameters: - sandbox_id (str) – (required) Sandbox identifier. Newly generated Sandbox IDs use sbx- followed by 16 lowercase base32 characters (a-z2-7); existing legacy IDs remain accepted.
- resume_sandbox_details (oci.generative_ai_sandbox.models.ResumeSandboxDetails) – (required) Request payload for resuming a sandbox.
- opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
- opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of running that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and removed from the system, then a retry of the original creation request might be rejected.
- if_match (str) – (optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource is updated or deleted only if the etag provided matches the resource’s current etag value.
- retry_strategy (obj) –
(optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.
This should be one of the strategies available in the
retrymodule. This operation usesDEFAULT_RETRY_STRATEGYas default if no retry strategy is provided. The specifics of the default retry strategy are described here.To have this operation explicitly not perform any retries, pass an instance of
NoneRetryStrategy. - allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
- enable_strict_url_encoding (bool) – (optional) enable_strict_url_encoding is a boolean to indicate whether or not this request should enable strict url encoding for path params. By default, strict url encoding for path params is disabled
Returns: Return type: Example: Click here to see an example of how to use resume_sandbox API.
-
run_sandbox_command(sandbox_id, run_sandbox_command_details, **kwargs)¶ Runs a command in a sandbox and returns the command identifier immediately.
Parameters: - sandbox_id (str) – (required) Sandbox identifier. Newly generated Sandbox IDs use sbx- followed by 16 lowercase base32 characters (a-z2-7); existing legacy IDs remain accepted.
- run_sandbox_command_details (oci.generative_ai_sandbox.models.RunSandboxCommandDetails) – (required) Request payload for running a sandbox command.
- opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
- opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of running that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and removed from the system, then a retry of the original creation request might be rejected.
- retry_strategy (obj) –
(optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.
This should be one of the strategies available in the
retrymodule. This operation usesDEFAULT_RETRY_STRATEGYas default if no retry strategy is provided. The specifics of the default retry strategy are described here.To have this operation explicitly not perform any retries, pass an instance of
NoneRetryStrategy. - allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
- enable_strict_url_encoding (bool) – (optional) enable_strict_url_encoding is a boolean to indicate whether or not this request should enable strict url encoding for path params. By default, strict url encoding for path params is disabled
Returns: A
Responseobject with data of typeSandboxCommandIdentifierReturn type: Example: Click here to see an example of how to use run_sandbox_command API.
-
run_sandbox_command_and_stream(sandbox_id, run_sandbox_command_details, **kwargs)¶ Runs a command in a sandbox and streams command events as newline-delimited JSON. Each line is a serialized SandboxCommandEvent.
Parameters: - sandbox_id (str) – (required) Sandbox identifier. Newly generated Sandbox IDs use sbx- followed by 16 lowercase base32 characters (a-z2-7); existing legacy IDs remain accepted.
- run_sandbox_command_details (oci.generative_ai_sandbox.models.RunSandboxCommandDetails) – (required) Request payload for running a sandbox command.
- opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
- opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of running that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and removed from the system, then a retry of the original creation request might be rejected.
- retry_strategy (obj) –
(optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.
This should be one of the strategies available in the
retrymodule. This operation usesDEFAULT_RETRY_STRATEGYas default if no retry strategy is provided. The specifics of the default retry strategy are described here.To have this operation explicitly not perform any retries, pass an instance of
NoneRetryStrategy. - allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
- enable_strict_url_encoding (bool) – (optional) enable_strict_url_encoding is a boolean to indicate whether or not this request should enable strict url encoding for path params. By default, strict url encoding for path params is disabled
Returns: A
Responseobject with data of type streamReturn type: Example: Click here to see an example of how to use run_sandbox_command_and_stream API.
-
run_sandbox_command_and_wait(sandbox_id, run_sandbox_command_details, **kwargs)¶ Runs a command in a sandbox, blocks until command execution finishes, and returns the final command metadata.
Parameters: - sandbox_id (str) – (required) Sandbox identifier. Newly generated Sandbox IDs use sbx- followed by 16 lowercase base32 characters (a-z2-7); existing legacy IDs remain accepted.
- run_sandbox_command_details (oci.generative_ai_sandbox.models.RunSandboxCommandDetails) – (required) Request payload for running a sandbox command.
- opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
- opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of running that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and removed from the system, then a retry of the original creation request might be rejected.
- retry_strategy (obj) –
(optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.
This should be one of the strategies available in the
retrymodule. This operation usesDEFAULT_RETRY_STRATEGYas default if no retry strategy is provided. The specifics of the default retry strategy are described here.To have this operation explicitly not perform any retries, pass an instance of
NoneRetryStrategy. - allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
- enable_strict_url_encoding (bool) – (optional) enable_strict_url_encoding is a boolean to indicate whether or not this request should enable strict url encoding for path params. By default, strict url encoding for path params is disabled
Returns: A
Responseobject with data of typeSandboxCommandReturn type: Example: Click here to see an example of how to use run_sandbox_command_and_wait API.
-
stop_sandbox(sandbox_id, stop_sandbox_details, **kwargs)¶ Stops a running sandbox.
Parameters: - sandbox_id (str) – (required) Sandbox identifier. Newly generated Sandbox IDs use sbx- followed by 16 lowercase base32 characters (a-z2-7); existing legacy IDs remain accepted.
- stop_sandbox_details (oci.generative_ai_sandbox.models.StopSandboxDetails) – (required) Request payload for stopping a sandbox.
- opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
- opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of running that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and removed from the system, then a retry of the original creation request might be rejected.
- if_match (str) – (optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource is updated or deleted only if the etag provided matches the resource’s current etag value.
- retry_strategy (obj) –
(optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.
This should be one of the strategies available in the
retrymodule. This operation usesDEFAULT_RETRY_STRATEGYas default if no retry strategy is provided. The specifics of the default retry strategy are described here.To have this operation explicitly not perform any retries, pass an instance of
NoneRetryStrategy. - allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
- enable_strict_url_encoding (bool) – (optional) enable_strict_url_encoding is a boolean to indicate whether or not this request should enable strict url encoding for path params. By default, strict url encoding for path params is disabled
Returns: Return type: Example: Click here to see an example of how to use stop_sandbox API.
-
stream_sandbox_command_events(sandbox_id, command_id, **kwargs)¶ Streams command events for an existing sandbox command from fromSeq through untilSeq using Server-Sent Events. Each SSE data field contains a serialized SandboxCommandEvent.
Parameters: - sandbox_id (str) – (required) Sandbox identifier. Newly generated Sandbox IDs use sbx- followed by 16 lowercase base32 characters (a-z2-7); existing legacy IDs remain accepted.
- command_id (str) – (required) Sandbox command identifier.
- opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
- from_seq (int) – (optional) The first command event sequence number to include.
- until_seq (int) – (optional) The last command event sequence number to include. If omitted, all available events from fromSeq are included.
- retry_strategy (obj) –
(optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.
This should be one of the strategies available in the
retrymodule. This operation usesDEFAULT_RETRY_STRATEGYas default if no retry strategy is provided. The specifics of the default retry strategy are described here.To have this operation explicitly not perform any retries, pass an instance of
NoneRetryStrategy. - allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
- enable_strict_url_encoding (bool) – (optional) enable_strict_url_encoding is a boolean to indicate whether or not this request should enable strict url encoding for path params. By default, strict url encoding for path params is disabled
Returns: A
Responseobject with data of type streamReturn type: Example: Click here to see an example of how to use stream_sandbox_command_events API.
-
suspend_sandbox(sandbox_id, suspend_sandbox_details, **kwargs)¶ Suspends a running sandbox by scaling its backing runtime to zero replicas while retaining the workspace block volume.
Parameters: - sandbox_id (str) – (required) Sandbox identifier. Newly generated Sandbox IDs use sbx- followed by 16 lowercase base32 characters (a-z2-7); existing legacy IDs remain accepted.
- suspend_sandbox_details (oci.generative_ai_sandbox.models.SuspendSandboxDetails) – (required) Request payload for suspending a sandbox.
- opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
- opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of running that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and removed from the system, then a retry of the original creation request might be rejected.
- if_match (str) – (optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource is updated or deleted only if the etag provided matches the resource’s current etag value.
- retry_strategy (obj) –
(optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.
This should be one of the strategies available in the
retrymodule. This operation usesDEFAULT_RETRY_STRATEGYas default if no retry strategy is provided. The specifics of the default retry strategy are described here.To have this operation explicitly not perform any retries, pass an instance of
NoneRetryStrategy. - allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
- enable_strict_url_encoding (bool) – (optional) enable_strict_url_encoding is a boolean to indicate whether or not this request should enable strict url encoding for path params. By default, strict url encoding for path params is disabled
Returns: Return type: Example: Click here to see an example of how to use suspend_sandbox API.
-
update_sandbox(sandbox_id, update_sandbox_details, **kwargs)¶ Updates a sandbox.
Parameters: - sandbox_id (str) – (required) Sandbox identifier. Newly generated Sandbox IDs use sbx- followed by 16 lowercase base32 characters (a-z2-7); existing legacy IDs remain accepted.
- update_sandbox_details (oci.generative_ai_sandbox.models.UpdateSandboxDetails) – (required) Request payload for sandbox update.
- opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
- if_match (str) – (optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource is updated or deleted only if the etag provided matches the resource’s current etag value.
- retry_strategy (obj) –
(optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.
This should be one of the strategies available in the
retrymodule. This operation usesDEFAULT_RETRY_STRATEGYas default if no retry strategy is provided. The specifics of the default retry strategy are described here.To have this operation explicitly not perform any retries, pass an instance of
NoneRetryStrategy. - allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
- enable_strict_url_encoding (bool) – (optional) enable_strict_url_encoding is a boolean to indicate whether or not this request should enable strict url encoding for path params. By default, strict url encoding for path params is disabled
Returns: Return type: Example: Click here to see an example of how to use update_sandbox API.
-
write_sandbox_file(sandbox_id, file_path, write_sandbox_file_content_details, **kwargs)¶ Writes a file in a sandbox and returns the resulting file resource.
Parameters: - sandbox_id (str) – (required) Sandbox identifier. Newly generated Sandbox IDs use sbx- followed by 16 lowercase base32 characters (a-z2-7); existing legacy IDs remain accepted.
- file_path (str) – (required) Absolute path under /workspace where the file will be written.
- write_sandbox_file_content_details (stream) – (required) Raw file bytes to write.
- opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
- opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of running that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and removed from the system, then a retry of the original creation request might be rejected.
- opc_content_sha256 (str) – (optional) Optional base64-encoded SHA-256 checksum of the sandbox file content. When supported by the sandbox runtime, the runtime validates the uploaded file content against this value and rejects the request if the values do not match.
- retry_strategy (obj) –
(optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.
This should be one of the strategies available in the
retrymodule. This operation usesDEFAULT_RETRY_STRATEGYas default if no retry strategy is provided. The specifics of the default retry strategy are described here.To have this operation explicitly not perform any retries, pass an instance of
NoneRetryStrategy. - allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
- enable_strict_url_encoding (bool) – (optional) enable_strict_url_encoding is a boolean to indicate whether or not this request should enable strict url encoding for path params. By default, strict url encoding for path params is disabled
- buffer_limit (int) –
(optional) A buffer limit for the stream to be buffered. buffer_limit is used to set the buffer size capacity. Streams will be read until the size of the buffer reaches the buffer_limit. If the stream size is greater than the buffer_limit, a BufferError exception will be thrown.
The buffer_limit parameter is used when the stream object does not have a seek, tell, or fileno property for the Python Request library to calculate out the content length. If buffer_limit is not passed, then the buffer_limit will be defaulted to 100MB. Large streams can cause the process to freeze, consider passing in content-length for large streams instead.
Returns: A
Responseobject with data of typeSandboxFileReturn type: Example: Click here to see an example of how to use write_sandbox_file API.
-