구성 명령 및 사용법
구성 명령에는 IBM cpdctl에서 IBM® watsonx.data 환경을 구성할 수 있는 다양한 명령이 추가로 포함되어 있습니다. 이 항목에는 수행할 수 있는 작업에 대한 간략한 설명과 함께 명령이 나열되어 있습니다.
Config 명령은 watsonx.data 에 대한 프로필 및 사용자 구성을 관리합니다. 작업을 구성하고 수행하는 동안 웹 브라우저에서 watsonx.data 인스턴스가 열려 있어야 합니다.
구문:
./cpdctl config [commands]
Config 명령은 다음 명령을 지원합니다:
이러한 명령을 별도로 실행하여 사용자 및 프로필을 설정할 수 있습니다. 하나의 명령으로 프로필과 사용자를 설정하려면 결합된 명령을 사용하는 것이 좋습니다. 자세한 내용은 사용자 및 프로필 명령어 함께 사용하기를 참조하세요.
IBM cpdctl에 대한 암호화 키 구성하기
비밀번호와 API 키를 보호하기 위해 IBM cpdctl은 AES-256 암호화를 사용합니다. 사용자 정의 암호화 키를 사용하거나 IBM cpdctl에서 제공하는 기본 하드코딩된 키를 사용할 수 있습니다.
암호화 키 파일 보유 디렉터리의 경로를 가리키는 CPDCTL_ENCRYPTION_KEY_PATH 환경 변수를 설정하여 AES-256 에 사용자 지정 암호화 키를 제공할 수 있습니다. 이 환경 변수가 설정되어 있지 않으면 cpdctl은 자체 하드코딩된 암호화 키를 사용합니다.
macOS 및 Linux:
export CPDCTL_ENCRYPTION_KEY_PATH=/path/cpdctl.key
Windows 명령 프롬프트의 경우:
set CPDCTL_ENCRYPTION_KEY_PATH=/path/cpdctl.key
Windows용 PowerShell:
$env:CPDCTL_ENCRYPTION_KEY_PATH = "/path/cpdctl.key"
사용자
user 명령은 watsonx.data 에서 사용자를 관리합니다.
구문:
./cpdctl config user [commands]
user 명령은 다음 명령을 추가로 지원합니다:
| 옵션 | 설명 |
|---|---|
./cpdctl config user set [commands] |
watsonx.data 인스턴스에 연결할 수 있도록 cpdctl 구성에서 사용자의 자격 증명을 설정합니다. |
./cpdctl config user list |
watsonx.data 인스턴스에 연결하는 데 사용되는 cpdctl 구성에 저장된 자격 증명을 나열합니다. |
./cpdctl config user get <username> |
watsonx.data 인스턴스에 연결하는 데 사용되는 cpdctl 구성에 저장된 사용자의 자격 증명을 가져옵니다. |
./cpdctl config user unset <username> |
watsonx.data 인스턴스의 cpdctl 구성에서 현재 설정된 사용자 이름을 제거합니다. |
./cpdctl config user set [commands] 는 자격 증명 설정에 사용할 수 있는 옵션으로 다음 명령을 추가로 지원합니다:
--apikey (string) : Set user apikey
--password (string) : Set user password
--token-file (string) : Set location of a file that contains user token
--username (string) : Set user name
클라우드 인스턴스에서 사용자를 설정하는 예제입니다:
./cpdctl config user set <user> --username <saas_username> --apikey <APIKEY>
./cpdctl config user set user2 --username user@ibm.com --apikey APIKEY
watsonx.data 의 경우 IBM Cloud, 콘솔 로그인에 사용되는 --username 및 --apikey 을 사용하는 것이 좋습니다. 자세한 내용은 API 키 가져오기를 참조하세요.
프로파일
profile 명령은 watsonx.data 에서 프로필을 관리합니다.
싱글사인온(SSO) 로그인은 cpdctl 구성에서 사용하도록 설정합니다.
구문:
./cpdctl config profile [commands]
profile 명령은 다음 명령을 지원합니다:
| 옵션 | 설명 |
|---|---|
./cpdctl config profile set [commands] |
Cpdctl 구성에서 watsonx.data 환경 프로필을 설정합니다. |
./cpdctl config profile list |
Cpdctl 구성에 설정된 모든 watsonx.data 환경 프로필을 나열합니다. |
./cpdctl config profile get <profilename> |
watsonx.data 환경 프로필에 대한 자세한 내용은 cpdctl 구성에서 확인하세요. |
./cpdctl config profile unset <profilename> |
Cpdctl 구성에서 watsonx.data 환경 프로필을 제거합니다. |
./cpdctl config profile current |
현재 사용 중인 watsonx.data 환경 프로필의 세부 정보를 cpdctl 구성에서 가져옵니다. |
./cpdctl config profile use <profilename> |
Cpdctl 구성에서 특정 watsonx.data 환경 프로필을 사용합니다. |
./cpdctl config profile set [commands] 는 자격 증명 설정에 사용할 수 있는 옵션으로 다음 명령을 추가로 지원합니다:
--apikey (string) : Create a user having this API key and associate it with the profile. Used for SaaS and Onprem. Recommended to use for SaaS instance.
--common-services-url (string) : Set Common Services URL for the profile
--iam-integration-enabled () : Set if IAM integration is enabled on CP4D
--ibmcloud (string) : Connect the profile to IBM Cloud CLI session metadata. Flag value specifies IBM Cloud CLI configuration directory. If no value is given, default IBM Cloud CLI configuration directory is assumed.
--password (string) : Create a user having this password and associate it with the profile. Used for Onprem. Recommended to use for Onprem instance.
--region (string) : IBM cloud region.
--token-file (string) : Create a user having this token location and associate it with the profile.
--url (string) : Set URL for the profile
--user (string) : Set user for the profile
--username (string) : Create a user having this name and associate it with the profile.
앞서 클라우드 인스턴스에서 설정한 user 구성을 사용하여 프로필을 설정하는 예제입니다:
./cpdctl config profile set <profile_name> --user <user> --url <profile_url> --region <region_name>
./cpdctl config profile set saas --user user2 --url https://cloud.ibm.com/ --region us-south
사용자 및 프로필 명령을 함께 사용하기
사용자 및 프로필 두 명령을 결합하여 cpdctl 구성에서 인스턴스 프로필을 구성할 수 있습니다. 조합을 사용하는 방법에 대한 예시 그림은 아래에 나와 있습니다:
클라우드 인스턴스 프로필 설정하기:
구문:
cpdctl config profile set <profile_name> --username <saas_username> --apikey <APIKEY> --url <saas_url> --region <region_name> \
--env "WATSONX_DATA_INSTANCE_ID=<crn>" \
--env "WATSONX_DATA_URL=<WXD-base-url>"
예:
./cpdctl config profile set saas --username user@ibm.com --apikey APIKEY --url https://cloud.ibm.com/ --region us-south \
--env "WATSONX_DATA_INSTANCE_ID=crn:v1:staging:public:lakehouse:us-south:a/781f752068d44638a3b2a13de58d3cfe:2c590eda-8d51-4269-86ce-a6dfb84c8267::" \
--env "WATSONX_DATA_URL=https://us-south.lakehouse.dev.cloud.ibm.com/"
watsonx.data 의 경우 IBM Cloud, 콘솔 로그인에 사용되는 --username 및 --apikey 을 사용하는 것이 좋습니다. 자세한 내용은 API 키 가져오기를 참조하세요.
인스턴스 ID를 환경 변수로 설정
Cpdctl 버전 1.8.5 부터는 더 이상 instance ID 을 환경 변수로 설정할 필요가 없습니다. 이 방법은 더 이상 사용되지 않으며 향후 릴리스에서 완전히 제거될 예정입니다. 대신 instance ID 을 사용하여 직접 설정해야 합니다
Cpdctl 명령을 실행하려면 해당 환경에 액세스할 수 있는 인스턴스 ID를 설정해야 합니다. 인스턴스 ID를 설정하려면 WX_DATA_INSTANCE_ID 환경 변수를 사용하면 됩니다. 이렇게 하면 각 명령에 인스턴스 ID를 지정하지 않아도 됩니다.
변수를 설정하려면 macOS 및 Linux 에서 다음 명령을 실행합니다:
export WX_DATA_INSTANCE_ID=<instance-id_value>
여기서 <instance-id_value> 은 watsonx.data 소프트웨어 인스턴스의 인스턴스 ID 또는 홈페이지에서 i 아이콘을 클릭하여 액세스할 수 있는 watsonx.data 인스턴스의 CRN( IBM Cloud )입니다.
변수를 설정하려면 Windows 명령 프롬프트에서 다음 명령을 실행합니다:
set WX_DATA_INSTANCE_ID=<instance-id_value>
변수를 설정하려면 Windows에서 다음 명령을 실행합니다 PowerShell:
$env:WX_DATA_INSTANCE_ID = "<instance-id_value>"