service-instance create

Create a Cloud Pak for Data service instance from a JSON request file.

Syntax

cpd-cli service-instance create \
--generate-template-from=<get-command-response-file> \
--from-source=<json-template> \
--profile=<cpd-configuration-profile-name> \
[--verbose]

Arguments

The create command has no arguments.

Options

Option Description
--from-source Specify the JSON template file location and name. The JSON template file is used to create the service instance.
Status
Required.
Syntax
--from-source=<json-template>
Default value
No default.
Valid values
A valid JSON template file location and name.
--generate-template-from Specify a JSON file location and name. The JSON file is used to generate a JSON template file from which the service instance is created. The JSON file can store information about different contexts, where each context can refer to a different environment.
Status
Required.
Syntax
--generate-template-from=<get-command-response-file>
Default value
No default.
Valid values
A valid JSON file location and name.
--help Display command help.
Status
Optional.
Syntax
--help
Default value
No default.
Valid values
Not applicable.
--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.
--verbose Logs include more detailed messages.
Status
Optional.
Syntax
--verbose
Default value
No default.
Valid values
Not applicable.

Examples

Generate a template for service instance creation
cpd-cli service-instance create \
--generate-template-from=./cpd-cli-workspace/service-instance/example_stream.json \
--profile=<cpd-configuration-profile-name>
The following status message is provided.
SUCCESS: Service instance request template is generated and stored in the /Users/<username>/work/development/golang/src/cpd-cli/cpd-cli-workspace/service-instance/templates/example_stream_create_template.json
Create service instance from JSON template file
cpd-cli service-instance create \
--from-source=./cpd-cli-workspace/service-instance/templates/example_stream_create_template.json \
--profile=<cpd-configuration-profile-name>
The following status message is provided.
Creation of service instance example_stream-demo (ID: 1600560703037888) of type streams in namespace default is in progress
Checking status once..., use command 'service-instance status' to check the progress.

 Namespace      Service type        Version        ID                  Name                  Provision status        Service status 
 ---------      ------------        -------        --                  ----                  ----------------        -------------- 
 default        streams             5.5.0          1600560703037888    example_stream-demo   PROVISION_IN_PROGRESS   PENDING