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 \
--name=<space-name> \
--profile=<profile-name> \
[--async] \
[--context=<catalog-project-or-space-id>] \
[--cpd-config=<cpd-config-location>] \
[--description=<space-description>] \
[--generator=<generator-label>] \
[--jmes-query=<jmespath-query>] \
[--output=json|yaml|table] \
[--output-file=<output-file-location>] \
[--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
Table 1: Command 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 IBM Software Hub
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 composed 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.
|
--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.
|
--quiet |
Suppress verbose
messages.
|
--raw-output |
When set to true, single values
are not surrounded by quotation marks in
JSON output
mode.
|
--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 IBM Software
Hub 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 add the listed
environment variables to the installation variables script. For more information, see Setting up installation environment 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