下載並安裝 IBM Cloud Pak for Data 指令行介面 ( IBM cpdctl)

本主題提供如何下載、安裝和驗證 IBM Cloud Pak for Data 指令行介面 ( IBM cpdctl) 的資訊,重點介紹 IBM® watsonx.data (wx-data) 外掛程式。

開始之前

您可以從官方的 README 檔案瞭解更多有關 IBM cpdctl 的資訊。

程序

  1. 使用下列 2 種方法之一下載並安裝 IBM cpdctl:

    a. 選項 1:執行下列指令,自動下載並安裝 IBM cpdctl,偵測 Linux 的作業系統和處理器架構,以及 macOS:

    platform=$(uname -s | tr '[A-Z]' '[a-z]')
    arch=$(uname -m | sed 's/x86_64/amd64/')
    curl -LOs "https://github.com/IBM/cpdctl/releases/latest/download/cpdctl_${platform}_${arch}.tar.gz"
    tar zxf cpdctl_${platform}_${arch}.tar.gz
    

    b. 選項 2:從 IBM cpdctl 套件庫下載適當的存檔。

    IBM 適用於 Windows 作業系統的 cpdctl 可從檔案庫下載。

    適用於各種作業系統的可下載檔案
    作業系統 保存檔名稱 註解
    Microsoft Windows x64 cpdctl_windows_amd64.zip 使用 Windows 檔案總管從存檔中提取 cpdctl.exe
    Linux x64 cpdctl_linux_amd64.tar.gz 發出指令 $ tar zxf cpdctl_linux_amd64.tar.gz,從存檔中萃取 cpdctl 可執行檔。
    Linux Power 64 位元 LE cpdctl_linux_ppc64le.tar.gz 發出指令 $ tar zxf cpdctl_linux_ppc64le.tar.gz,從存檔中萃取 cpdctl 可執行檔。
    Linux on IBM Z cpdctl_linux_s390x.tar.gz 發出指令 $ tar zxf cpdctl_linux_s390x.tar.gz,從檔案中萃取 cpdctl 可執行檔
    macOS- 英特爾 x64 cpdctl_darwin_amd64.tar.gz 發出指令 $ tar zxf cpdctl_darwin_amd64.tar.gz,從檔案中萃取 cpdctl 可執行檔
    macOS - Apple silicon cpdctl_darwin_arm64.tar.gz 發出指令 $ tar zxf cpdctl_darwin_arm64.tar.gz,從存檔中萃取 cpdctl 可執行檔。
    支援的 cpdctl 版本
    watsonx.data 版本 cpdctl 版本
    v2.1.1 v1.6.95 及後
    v2.1.1 (開發人員版) 1.6.104 及後
    v2.1.2 v1.7.0 及後
    v2.2.1 ( V3 API) v1.8.25 及後
    v2.2.2 v1.8.33 以及後來
    v2.3.0 v1.8.85 以及後來

    MCSP 支援 CPDCTL 自 版本 v1.8.0 及後續版本。

  2. 在終端執行 ./cpdctl 以驗證 cpdctl 是否安裝成功,並顯示支援的指令。

    結果是

    NAME:
      cpdctl - IBM Cloud Pak for Data Command Line Interface
    
    USAGE:
       cpdctl [command] [options]
    
    COMMANDS:
      config         Manage Configuration
      asset          Manage Assets
      project        Manage Watson Studio - Projects API - OpenAPI Docs.
      space          Manage Spaces
      connection     Manage IBM Watson Data Platform Connections service.
      environment    Manage Environments and Runtimes API.
      notebook       Manage Notebooks API.
      code-package   Manage Code Packages API.
      job            Manage IBM Watson Data Platform Jobs and Scheduling Service.
      ml             Manage Watson Machine Learning.
      datastage      Manage IBM APIs for DataStage.
      find           Find a resource with CPD Path
      pipeline       Manage IBM Orchestration Pipelines API.
      wx-data        Manage watsonx.data.
      wx-ai          Manage watsonx.ai.
      version        Display the tool version
    
    OPTIONS:
          --cpd-config string   Configuration file path
          --cpdconfig string    [Deprecated] Use --cpd-config instead
      -h, --help                Show help
          --profile string      Name of the configuration profile to use
          --raw-output          If set to true, single values in JSON output mode are not surrounded by quotes
      -v, --version             Version of the plugin.
    
    Use "cpdctl service-command --help" for more information about a command.