下载并安装 IBM Cloud Pak for Data 命令行界面 ( IBM cpdctl)

本主题介绍如何下载、安装和验证 IBM Cloud Pak for Data 命令行界面 ( IBM cpdctl),重点是 IBM® watsonx.data (wx-data) 插件。

准备工作

有关 IBM cpdctl 的更多信息,请参阅官方的 README 文件。

过程

  1. 使用以下两种方法之一下载并安装 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.