Creating a profile to use the cpd-cli management commands
Before you can complete certain set up and management tasks for IBM® Cloud Pak for Data, you must create a profile so that you can
run the appropriate
About this task
- Gathering diagnostics and checking the health of the Cloud Pak for Data cluster (by running the
- Managing Cloud Pak for Data users (by running the
- Managing service instances (by running the
- Migrating metadata between Cloud Pak for Data
deployments (by running the
Before you run any cpd-cli commands, ensure that:
- You downloaded the
cpd-cliv10.0.0 command line utility for your operating system and Cloud Pak for Data edition from: https://github.com/IBM/cpd-cli/releases.
A profile enables the
cpd-cli to verify that you are a Cloud Pak for Data user and that you have the appropriate
administrator permissions to complete a given task.
Generate the API key that you'll need for user authentication by going to your
Profile and settings page in the Cloud Pak for Data client and clicking Generate API
This API key does not expire. The configuration information is stored in $HOME/.cpd-cli/config.
- Create a local user configuration for yourself by pasting the API key in the following
./cpd-cli config users set cpd-admin-user --username admin --apikey api_key
where cpd-admin-user is an example name of the new local user configuration.
Anytime you regenerate the API key, you must rerun this command to update your local user configuration.Tip: To delete a user, you can enter the command:
./cpd-cli config users unset cpd-admin-user
- Set a new profile to store the Cloud Pak for Data URL and its association with the local
configuration you created:
./cpd-cli config profiles set cpd-admin-profile --user cpd-admin-user --url cpd_route
where cpd-admin-profile is an example name of the new profile. If you have multiple Cloud Pak for Data instances, you must set a new profile on every instance. You can also have profiles for other users in the same Cloud Pak for Data URL.Tip: To delete a profile, you can enter the command:
./cpd-cli config profiles unset cpd-admin-profile
You can now run
cpd-cli commands with this profile using the
--profile flag. For example:
./cpd-cli service-instance list --profile cpd-admin-profile
Otherwise, you receive an Error: required flag(s) "profile" not set error.