space create
Create a space that will scope other assets. Authorized user must have the following roles: Platform management role - Administrator; Service access role - Manager.
Syntax
cpd-cli space create \
[--async] \
[--context=<catalog-project-or-space-id>] \
[--cpd-config=<cpd-config-location>] \
[--description=<space-description>] \
[--generator=<generator-label>] \
[--jmes-query=<jmespath-query>] \
--name=<space-name> \
[--output=json|yaml|table] \
[--output-file=<output-file-location>] \
--profile=<cpd-configuration-profile-name> \
[--quiet] \
[--raw-output=true|false] \
[--stage=<space-production-and-stage-name>] \
[--storage=<object-storage-properties>] \
[--tags=<tag1,tag2,...>] \
[--verbose]
Arguments
The space create
command has no
arguments.
Options
Option | Description |
---|---|
--async |
Run the command asynchronously. By default, processing finishes before the command runs.
|
--context |
Specify the configuration context
name.
|
--cpd-config |
The Cloud Pak for Data
configuration location (for example, $HOME/.cpd-cli/config).
|
--description |
Specify a space description.
|
--generator |
Specify a label that is used to identify a client that created a space. A generator label must be comprised of the following characters: alphanumeric, dash, underscore, and space.
|
|
Display command
help.
|
--jmes-query |
Provide a JMESPath query to customize the output.
|
--name |
Specify the space
name.
|
--output |
Specify an output format.
Valid formats include json, yaml, or text (the default
format).
|
--output-file |
Specify a file path where all output is redirected.
|
--profile |
The profile-name from the Cloud
Pak for Data configuration.
|
--quiet |
Suppress verbose messages.
|
--raw-output |
When set to true, single values in
JSON output mode are not surrounded by quotes.
|
--stage |
Specify the space production and stage name.
|
--storage |
Specify the Cloud Object Storage instance that is required for spaces created on the public cloud. On private Cloud Pak for Data installations, the default storage is used.
|
--tags |
Specify a list of tags that are associated with a space.
|
--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 optionally add the
listed environment variables to the install variables script. For more information, see Best practice: Setting up install variables.
- Define the environment variables.
- Replace the following properties with your
data.
export SPACE_NAME='space-for-scripts'
- Create a space.
-
cpd-cli space create \ --jmes-query="metadata.id" \ --name=${SPACE_NAME} \ --output=json \ --raw-output