project create

Create a project with the provided parameters (including all the storage and credentials) in a single transaction.

Syntax

cpd-cli project create \
--name=<project-name> \
--profile=<profile-name> \
--storage=<object-storage-properties> \
[--compute=<list-of-project-computes>] \
[--description=<project-description>] \
[--enforce-members=true|false] \
[--jmes-query=<jmespath-query>] \
[--output=json|yaml|table] \
[--output-file=<output-file-location>] \
[--public=true|false] \
[--raw-output=true|false] \
[--tags=<tag1,tag2,...>] \
[--tools=<list-of-project-tools>]

Arguments

The project create command has no arguments.

Options

Table 1: Command options
Option Description
--compute

-c

Specify a list of computes that are associated with the project.
Status
Optional.
Syntax
--compute=<list-of-project-computes>
Default value
No default.
Valid values
A valid list of project computes.
--description

-d

Specify a project
 description.
Status
Optional.
Syntax
--description=<project-description>
Default value
No default.
Valid values
A valid project description.
--enforce-members

-e

When set to 'true', project members are scoped to the account or SAML of the creator.
Status
Optional.
Syntax
--enforce-members=true|false
Default value
true
Valid values
true
Project members are scoped to the account or SAML of the creator.
false
Project members are not scoped to the account or SAML of the creator.

--help

-h

Display command help.
Status
Optional.
Syntax
--help
Default value
No default.
Valid values
Not applicable.
--jmes-query Provide a JMESPath query to customize the output.
Status
Optional. This option has effect only when --output is set to json or yaml.
Syntax
--jmes-query=<jmespath-query>
Default value
No default.
Valid values
A valid JMESPath query.
--name

-n

Specify a project name. The name must be a non-empty string and does not need to be unique.
Status
Required.
Syntax
--name=<project-name>
Default value
No default.
Valid values
A valid project name.
--output Specify an output format.
Status
Optional.
Syntax
--output=json|yaml|text
Default value
text
Valid values
Valid formats include JSON, YAML, or text (the default format).
--output-file Specify a file path where all output is redirected.
Status
Optional.
Syntax
--output-file=<output-file-location>
Default value
No default.
Valid values
A valid output file path location.
--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.
Status
Required.
Syntax
--profile=<profile-name>
Default value
No default.
Valid values

The name of the profile that you created.

--public

-p

When set to true, the project is public.
Status
Optional.
Syntax
--public=true|false
Default value
true
Valid values
true
The project is public.
false
The project is not public.
--raw-output When set to true, single values are not surrounded by quotation marks in
 JSON output mode.
Status
Optional. This option has effect only when --output is set to json or yaml.
Syntax
--raw-output=true|false
Default value
false
Valid values
false
Single values in JSON output mode are surrounded by quotation marks.
true
Single values in JSON output mode are not surrounded by quotation marks.
--storage

-s

Specify the object storage properties that are associated with the project. This option is required on public cloud and optional on IBM Software Hub.
Status
Required.
Syntax
--storage=<object-storage-properties>
Default value
No default.
Valid values
Valid project object storage properties.
--tags

-t

Specify a list of tags that are attached to the project.
Status
Optional.
Syntax
--tags=<tag1,tag2,...>
Default value
No default.
Valid values
A valid list of comma-separated project tags.
--tools

-T

Specify a list of tools that are associated with the project.
Status
Optional.
Syntax
--tools=<list-of-project-tools>
Default value
No default.
Valid values
A valid list of project tools.

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.
RESTORED_PROJECT_NAME = <A restored IBM Software
Hub project name>
STORAGE = {"type": "assetfiles", "guid": str(uuid.uuid4())}
STORAGE_JSON = json.dumps(STORAGE)
Create a project.
cpd-cli project create \
--jmes-query='location' \
--name=${RESTORED_PROJECT_NAME} \
--output=json \
--raw-output \
--storage=${STORAGE_JSON}