📣
TiDB Cloud Premium 开放公测中。为企业级工作负载提供无限扩展、即时弹性伸缩和高级安全保障。此页面由 AI 自动翻译,英文原文请见此处。

ti fs import-file-system-token



验证现有的 Filesystem 访问令牌,并将其存储到所选的本地配置(Profile)中。Filesystem ID 会从令牌中派生;你可以使用可选的 --file-system-id 来验证该令牌是否属于预期的 Filesystem。

语法

ti fs import-file-system-token [--dry-run] [--file-system-id <string>] [--from-file <string>] [--fs-token <string>] [--help] [--replace] [--version]

选项

  • --dry-run:验证令牌和目标位置,但不写入本地凭证。
  • --file-system-id <string>:断言该令牌属于此文件系统 ID。
  • --from-file <string>:从仅所有者可读的文件中读取令牌,或使用 - 表示标准输入。
  • --fs-token <string>:直接提供令牌。建议优先使用 TI_FS_TOKEN--from-file,以避免通过进程参数暴露令牌。
  • --help:显示帮助信息。
  • --replace:验证后,替换同一文件系统在本地存储的其他令牌。
  • --version:显示版本信息。

有关所有命令共享的选项,请参见全局选项

示例

  • 从受保护的文件中导入令牌:

    # Validate the token remotely and store it under its embedded file system ID. chmod 600 ./fs-token ti fs import-file-system-token --from-file ./fs-token --region aws-us-east-1
  • 从标准输入导入令牌:

    # Avoid placing the token in shell history or a process argument. cat ./fs-token | ti fs import-file-system-token --from-file - --region aws-us-east-1

文档内容是否有帮助?