project create

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

Syntax

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

Arguments

The project create command has no arguments.

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.
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. Valid formats include json, yaml, or text (the default format).
Status
Optional.
Syntax
--output=json|yaml|text
Default value
text
Valid values
json|yaml|text
--output-file Specify a file path where all output is redirected.
Status
Required.
Syntax
--output-file=<output-file-location>
Default value
No default.
Valid values
A valid output file path location.
--profile The profile-name from the Cloud Pak for Data configuration.
Status
Required.
Syntax
--profile=<cpd-configuration-profile-name>
Default value
default
Valid values
Any valid profile name from the Cloud Pak for Data configuration.
--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 in
 JSON output mode are not surrounded by quotes.
Status
Optional.
Syntax
--raw-output=true|false
Default value
false
Valid values
false
Single values in JSON output mode are surrounded by quotes.
true
Single values in JSON output mode are not surrounded by quotes.
--storage

-s

Specify the object storage properties that are associated with the project. This option is required on public cloud and optional on Cloud Pak for Data.
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 optionally add the listed environment variables to the install variables script. For more information, see Best practice: Setting up install variables.
Specify the environment variables in a script file.
RESTORED_PROJECT_NAME = <A restored Cloud Pak for Data 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}