Skip to main content
简体中文版经机器翻译而成,仅供参考。如与英语版出现任何冲突,应以英语版为准。

测试Swift REST API配置

贡献者

您可以使用Swift命令行界面测试与StorageGRID系统的连接、并验证是否可以读取和写入对象。

开始之前
关于此任务

如果尚未配置安全性、则必须添加 --insecure 标记这些命令中的每个命令。

步骤
  1. 查询 StorageGRID Swift 部署的信息 URL :

    swift
    -U <Tenant_Account_ID:Account_User_Name>
    -K <User_Password>
    -A https://<FQDN | IP>:<Port>/info
    capabilities

    这足以测试您的 Swift 部署是否正常运行。要通过存储对象进一步测试帐户配置,请继续执行其他步骤。

  2. 将对象放入容器中:

    touch test_object
    swift
    -U <Tenant_Account_ID:Account_User_Name>
    -K <User_Password>
    -A https://<FQDN | IP>:<Port>/auth/v1.0
    upload test_container test_object
    --object-name test_object
  3. 获取用于验证对象的容器:

    swift
    -U <Tenant_Account_ID:Account_User_Name>
    -K <User_Password>
    -A https://<FQDN | IP>:<Port>/auth/v1.0
    list test_container
  4. 删除对象:

    swift
    -U <Tenant_Account_ID:Account_User_Name>
    -K <User_Password>
    -A https://<FQDN | IP>:<Port>/auth/v1.0
    delete test_container test_object
  5. 删除容器:

    swift
    -U `<_Tenant_Account_ID:Account_User_Name_>`
    -K `<_User_Password_>`
    -A `\https://<_FQDN_ | _IP_>:<_Port_>/auth/v1.0'
    delete test_container