``create-sandbox-sandbox-snapshot-source`` ========================================== .. contents:: :local: :depth: 1 Description ------------ Creates a sandbox resource and returns its initial state. Usage ----- .. code-block:: none oci generative-ai-sandbox sandbox create-sandbox-sandbox-snapshot-source [OPTIONS] Required Parameters -------------------- .. option:: --project-id [text] Required project identifier used to scope sandbox creation. .. option:: --source-snapshot-id [text] Identifier of the sandbox snapshot to restore during sandbox creation. Optional Parameters -------------------- .. option:: --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. .. option:: --display-name [text] User-provided display name for the sandbox. .. option:: --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/datatypes/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 :option:`--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. .. option:: --expiration-duration [text] Deprecated. Use `expiresInMinutes` instead. Existing clients may pass `-1` to disable automatic expiration. .. option:: --expires-in-minutes [integer] Number of minutes from creation until automatic sandbox expiration. Use `-1` to disable automatic expiration. .. option:: --from-json [text] Provide input to this command as a JSON document from a file using the file://path-to/file syntax. The :option:`--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/Content/API/SDKDocs/cliusing.htm#AdvancedJSONOptions .. option:: --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. .. option:: --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 :option:`--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. .. option:: --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. .. option:: --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. .. option:: --shape [text] Compute shape for the sandbox. .. option:: --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: .. code-block:: py CREATING, DELETED, FAILED, RESUMING, RUNNING, STOPPED, STOPPING, SUSPENDED, SUSPENDING, UPDATING .. option:: --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. .. option:: --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. :option:`--auth-purpose`, :option:`--auth`, :option:`--cert-bundle`, :option:`--cli-auto-prompt`, :option:`--cli-rc-file`, :option:`--config-file`, :option:`--connection-timeout`, :option:`--debug`, :option:`--defaults-file`, :option:`--enable-dual-stack`, :option:`--enable-propagation`, :option:`--endpoint`, :option:`--federation-endpoint`, :option:`--generate-full-command-json-input`, :option:`--generate-param-json-input`, :option:`--help`, :option:`--latest-version`, :option:`--max-retries`, :option:`--no-retry`, :option:`--opc-client-request-id`, :option:`--opc-request-id`, :option:`--output`, :option:`--profile`, :option:`--proxy`, :option:`--query`, :option:`--raw-output`, :option:`--read-timeout`, :option:`--realm-specific-endpoint`, :option:`--region`, :option:`--release-info`, :option:`--request-id`, :option:`--version`, :option:`-?`, :option:`-d`, :option:`-h`, :option:`-i`, :option:`-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. .. code-block:: none :class: copy-code-block export 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= # 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