验证操作

验证操作

验证对象存储服务的操作。

注解

在控制节点上执行这些步骤。

  1. 导入``demo``凭证

    $ . demo-openrc
    
  2. 显示服务状态:

    $ swift stat
                            Account: AUTH_ed0b60bf607743088218b0a533d5943f
                         Containers: 0
                            Objects: 0
                              Bytes: 0
    Containers in policy "policy-0": 0
       Objects in policy "policy-0": 0
         Bytes in policy "policy-0": 0
        X-Account-Project-Domain-Id: default
                        X-Timestamp: 1444143887.71539
                         X-Trans-Id: tx1396aeaf17254e94beb34-0056143bde
                       Content-Type: text/plain; charset=utf-8
                      Accept-Ranges: bytes
    
  3. 创建``container1``容器

    $ openstack container create container1
    +---------------------------------------+------------+------------------------------------+
    | account                               | container  | x-trans-id                         |
    +---------------------------------------+------------+------------------------------------+
    | AUTH_ed0b60bf607743088218b0a533d5943f | container1 | tx8c4034dc306c44dd8cd68-0056f00a4a |
    +---------------------------------------+------------+------------------------------------+
    
  4. 上传一个测试文件到``container1``容器

    $ openstack object create container1 FILE
    +--------+------------+----------------------------------+
    | object | container  | etag                             |
    +--------+------------+----------------------------------+
    | FILE   | container1 | ee1eca47dc88f4879d8a229cc70a07c6 |
    +--------+------------+----------------------------------+
    

    用本地要上传到 container1 容器的文件名替换 FILE

  5. 列出``container1``容器里的所有文件

    $ openstack object list container1
    +------+
    | Name |
    +------+
    | FILE |
    +------+
    
  6. 从``container1``容器里下载一个测试文件

    $ openstack object save container1 FILE
    

    用上传到 container1 容器的文件名替换 FILE

    注解

    这个命令执行后没有输出。

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.