environment create
Create an environment.
Syntax
cpd-cli environment create \
--display-name=<environment-display-name> \
--hardware-specification=<hardware-sub-specification-pointer> \
--name=<environment-name> \
--profile=<profile-name> \
--software-specification=<software-sub-specification> \
--type=<environment-type> \
[--authorization-variables=<environment-authorization-variables>] \
[--compute-specification=<environment-compute-specification>] \
[--context=<catalog-project-or-space-id>] \
[--cpd-config=<cpd-config-location>] \
[--cpd-scope=<cpd-scope>] \
[--description=<environment-description>] \
[--environment-variables=<environment-variables>] \
[--jmes-query=<jmespath-query>] \
[--location=<environment-runtime-location>] \
[--output=json|yaml|table] \
[--output-file=<output-file-location>] \
[--project-id=<project-id>] \
[--quiet] \
[--runtime-definition=<environment-runtime-definition>] \
[--runtime-idle-time=<runtime-idle-timeout-value>] \
[--space-id=<space-identifier>] \
[--tools-specification=<environment-tools-specification>] \
[--verbose]
Arguments
The environment create command has
no arguments.
Options
Table 1: Command options
| Option | Description |
|---|---|
--authorization-variables |
Specify the environment
authorization variables.
|
--compute-specification |
Specify the environment compute
specification.
|
--context |
Specify the configuration context
name.
|
--cpd-config |
The IBM Software Hub
configuration location. For example,
$HOME/.cpd-cli/config.
|
--cpd-scope |
The IBM Software Hub space,
project, or catalog scope. For example,
cpd://default-context/spaces/7bccdda4-9752-4f37-868e-891de6c48135.
|
--description |
Specify an environment
description.
|
--display-name |
Specify the environment display
name.
|
--environment-variables |
Specify environment variables for
the specified environment.
|
--hardware-specification |
Provide a pointer to a
sub-specification that was defined somewhere else.
|
|
|
Display command
help.
|
--jmes-query |
Provide a JMESPath query to
customize the output.
|
--location |
Specify the environment runtime
location.
|
--name |
Specify the
environment name.
|
--output |
Specify an output
format.
|
--output-file |
Specify a file path where all
output is redirected.
|
--profile |
The name of the profile that you
created to store information about an instance of IBM Software Hub and your credentials for the
instance.
|
--project-id |
Specify an IBM Software Hub
project instance.
|
--quiet |
Suppress verbose
messages.
|
--raw-output |
When set to true, single values
are not surrounded by quotation marks in
JSON output
mode.
|
--runtime-definition |
Specify the environment's runtime
definition.
|
--runtime-idle-time |
Specify the runtime idle timeout
value.
|
--software-specification |
Specify a sub-software
specification that was defined somewhere else.
|
--space-id |
Specify a space
identifier.
|
--tools-specification |
Specify the environment's tools
specification.
|
--type |
Specify the environment
type.
|
--verbose |
Logs include more detailed
messages.
|
Examples
Note: The following examples use environment variables. Use a script to create
environment variables with the correct values for your environment. You can add the listed
environment variables to the installation variables script. For more information, see Setting up installation environment variables.
- Specify the environment variables in a script file.
-
custom_sw_spec_json = <The sub-software specification> env_name = <The environment display name> hw_spec_json = <A hardware json sub-specification> tool_spec_json = <The environment tools json specification> - Add a package extension to a custom software specification.
-
cpd-cli environment create \ --display-name=${env_name} \ --hardware-specification=${hw_spec_json} \ --jmes-query="metadata.asset_id" \ --name=${env_name} \ --output=json \ --project-id=zen \ --raw-output \ --software-specification=${custom_sw_spec_json} \ --tools-specification=${tool_spec_json} \ --type=notebook