"create-sandbox-sandbox-snapshot-source"
****************************************

* Description

* Usage

* Required Parameters

* Optional Parameters

* Global Parameters

* Example using required parameter


Description
===========

Creates a sandbox resource and returns its initial state.


Usage
=====

   oci generative-ai-sandbox sandbox create-sandbox-sandbox-snapshot-source [OPTIONS]


Required Parameters
===================

--project-id [text]

Required project identifier used to scope sandbox creation.

--source-snapshot-id [text]

Identifier of the sandbox snapshot to restore during sandbox creation.


Optional Parameters
===================

--credential-profile-label [text]

The Project credential profile selected for this Sandbox. Omit this
field to select no credential profile. The selection and its
configuration snapshot are immutable for the lifetime of the Sandbox;
later Project profile updates apply only to subsequently created
Sandboxes after configuration propagation.

--display-name [text]

User-provided display name for the sandbox.

--environment-variables [complex type]

Environment variables to inject into the sandbox runtime.

This option is a JSON list with items of type EnvironmentVariable.
For documentation on EnvironmentVariable please see our API reference:
https://docs.oracle.com/en-us/iaas/api/#/en/generativeaisandbox/1.0/d
atatypes/EnvironmentVariable. This is a complex type whose value must
be valid JSON. The value can be provided as a string on the command
line or passed in as a file using the file://path/to/file syntax.

The "--generate-param-json-input" option can be used to generate an
example of the JSON which must be provided. We recommend storing this
example in a file, modifying it as needed and then passing it back in
via the file:// syntax.

--expiration-duration [text]

Deprecated. Use *expiresInMinutes* instead. Existing clients may pass
*-1* to disable automatic expiration.

--expires-in-minutes [integer]

Number of minutes from creation until automatic sandbox expiration.
Use *-1* to disable automatic expiration.

--from-json [text]

Provide input to this command as a JSON document from a file using the
file://path-to/file syntax.

The "--generate-full-command-json-input" option can be used to
generate a sample json file to be used with this command option. The
key names are pre-populated and match the command option names
(converted to camelCase format, e.g. compartment-id –> compartmentId),
while the values of the keys need to be populated by the user before
using the sample file as an input to this command. For any command
option that accepts multiple values, the value of the key can be a
JSON array.

Options can still be provided on the command line. If an option exists
in both the JSON document and the command line then the command line
specified value will be used.

For examples on usage of this option, please see our “using CLI with
advanced JSON options” link: https://docs.cloud.oracle.com/iaas/Conte
nt/API/SDKDocs/cliusing.htm#AdvancedJSONOptions

--max-wait-seconds [integer]

The maximum time to wait for the resource to reach the lifecycle state
defined by "--wait-for-state". Defaults to 1200 seconds.

--publish-ports [complex type]

Published ports to expose for the sandbox. This is a complex type
whose value must be valid JSON. The value can be provided as a string
on the command line or passed in as a file using the
file://path/to/file syntax.

The "--generate-param-json-input" option can be used to generate an
example of the JSON which must be provided. We recommend storing this
example in a file, modifying it as needed and then passing it back in
via the file:// syntax.

--published-port-auth-mode [text]

Authorization for all published-port HTTP requests and WebSocket
handshakes. OCI_IAM requires Sandbox use and project read permission
on the owning project. Omission defaults to OCI_IAM for new sandboxes
with published ports in enabled tenancies; elsewhere omission retains
legacy behavior. Explicit OCI_IAM outside the rollout, null,
unsupported values, or a mode without published ports are rejected.
The effective mode is immutable and is preserved when restoring
protected snapshots.

--runtime [text]

Runtime identifier for the sandbox, either a built-in runtime such as
python-3.11 or a same-region Oracle Cloud Infrastructure Registry
customer image reference.

--shape [text]

Compute shape for the sandbox.

--wait-for-state [text]

This operation creates, modifies or deletes a resource that has a
defined lifecycle state. Specify this option to perform the action and
then wait until the resource reaches a given lifecycle state. Multiple
states can be specified, returning on the first state. For example, "
--wait-for-state" RUNNING "--wait-for-state" STOPPED would return on
whichever lifecycle state is reached first. If timeout is reached, a
return code of 2 is returned. For any other error, a return code of 1
is returned.

Accepted values are:

   CREATING, DELETED, FAILED, RESUMING, RUNNING, STOPPED, STOPPING, SUSPENDED, SUSPENDING, UPDATING

--wait-interval-seconds [integer]

Check every "--wait-interval-seconds" to see whether the resource has
reached the lifecycle state defined by "--wait-for-state". Defaults to
30 seconds.

--warmpool-name [text]

Name of a MANAGED or CUSTOM warm pool in the owning project. Runtime
and shape are derived from the pool; explicit values must match.
Deleting pools cannot be used. Snapshot restore, credential brokerage,
and nested resource principals are not supported with named pools. An
empty pool may cold-create using its same template, including when
desired capacity is zero. Zero capacity stops idle prewarming; it does
not prevent creation from an available applied template. When
warmpoolName is omitted, a built-in runtime can automatically select
an eligible named MANAGED pool in the same project matching its
runtime and shape. Omitted runtime defaults to python-3.11 and omitted
shape defaults to SMALL for automatic matching. A digest-pinned
customer image can automatically select an eligible CUSTOM pool in the
same project matching its canonical registry host, repository, digest
and shape. Tag-based customer images are not automatically matched.
Matching pools are considered in name order; the first with a valid
applied template is selected without reading ready counts. Empty pools
and zero desired or applied capacity still allow cold creation through
the selected template. If no eligible pool is found or automatic
lookup is unavailable, built-in runtimes use the existing managed
runtime path, and customer images use the ordinary direct customer-
image path with its existing validation. Automatic matching does not
apply when source is supplied, including snapshot restore, or when
credential brokerage or nested resource principals are used. Explicit
names retain strict validation and do not fall back to automatic
matching or another creation path. Retries preserve the original
persisted pool binding or the original managed or direct customer-
image route, even when matching pools change. Sandbox and
SandboxSummary report an automatically selected pool in warmpoolName.


Global Parameters
=================

Use "oci --help" for help on global parameters.

"--auth-purpose", "--auth", "--cert-bundle", "--cli-auto-prompt", "--
cli-rc-file", "--config-file", "--connection-timeout", "--debug", "--
defaults-file", "--enable-dual-stack", "--enable-propagation", "--
endpoint", "--federation-endpoint", "--generate-full-command-json-
input", "--generate-param-json-input", "--help", "--latest-version", "
--max-retries", "--no-retry", "--opc-client-request-id", "--opc-
request-id", "--output", "--profile", "--proxy", "--query", "--raw-
output", "--read-timeout", "--realm-specific-endpoint", "--region", "
--release-info", "--request-id", "--version", "-?", "-d", "-h", "-i",
"-v"


Example using required parameter
================================

Copy the following CLI commands into a file named example.sh. Run the
command by typing “bash example.sh” and replacing the example
parameters with your own.

Please note this sample will only work in the POSIX-compliant bash-
like shell. You need to set up the OCI configuration and appropriate
security policies before trying the examples.

       export project_id=<substitute-value-of-project_id> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/generative-ai-sandbox/sandbox/create-sandbox-sandbox-snapshot-source.html#cmdoption-project-id
       export source_snapshot_id=<substitute-value-of-source_snapshot_id> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/generative-ai-sandbox/sandbox/create-sandbox-sandbox-snapshot-source.html#cmdoption-source-snapshot-id

       oci generative-ai-sandbox sandbox create-sandbox-sandbox-snapshot-source --project-id $project_id --source-snapshot-id $source_snapshot_id
