无法使用swift cli从bluemix上的对象存储容器下载文件

无法使用swift cli从bluemix上的对象存储容器下载文件,swift,ibm-cloud,cloud-foundry,object-storage,Swift,Ibm Cloud,Cloud Foundry,Object Storage,我在对象存储容器中有一大组文件,我想备份这些文件,因此尝试下载它们。我已经完成了swift cli所需的所有设置并使用了这些设置。我从bluemix获得了所有这些对象存储详细信息 "auth_url": "https://identity.open.softlayer.com", "endpoint_url": "https://objectstorage.open.softlayer.com/v1/AUTH_", "password": "********", "projectId":

我在对象存储容器中有一大组文件,我想备份这些文件,因此尝试下载它们。我已经完成了swift cli所需的所有设置并使用了这些设置。我从bluemix获得了所有这些对象存储详细信息

"auth_url": "https://identity.open.softlayer.com",
 "endpoint_url": "https://objectstorage.open.softlayer.com/v1/AUTH_",
 "password": "********",
  "projectId": "**************",
 "userId": "**********",
 "v3_auth_url":"https://identity.open.softlayer.com/v3/auth/tokens"
但当我试图使用上述数据下载时,swift命令不起作用

当我使用这个命令时,我得到了对象存储url和auth_令牌作为响应

swift auth --os-auth-url https://identity.open.softlayer.com/v3 --auth-version 3 --os-project
-id ***** --os-user-id ****** --os-password *******
然后,我使用objectstorage url和auth_令牌获取容器列表,但得到的是空响应

swift --os-auth-token ***** --os-storage-url ******* list
此外,我使用此命令从容器下载所有文件,但不起作用

swift download --all containername --os-auth-url https://identity.open.softlayer.com/v3 --au
th-version 3 --os-project-id ****** --os-user-id ******* --os-password ******
请一些对此有知识的人可以帮助下载这些文件
谢谢

我发现使用适当的环境变量使Swift CLI更易于使用。首先定义这些

export OS_USER_ID='xxxxxxxx' #userId field in Bluemix UI
export OS_PASSWORD='xxxxxxxxx' # password field in Bluemix UI 
export OS_TENANT_ID='xxxxxxxxx' # projectId field in Bluemix data
export OS_AUTH_URL='https://identity.open.softlayer.com/v3'
export OS_REGION_NAME='dallas' #region (change as needed)
export OS_IDENTITY_API_VERSION=3 
export OS_AUTH_VERSION=3 
然后,您可以使用swift命令行,而无需大量的--options。列出“水果”容器的内容物:

$: swift list fruit
apple
banana
orange
$: swift download fruit
banana [auth 0.455s, headers 0.919s, total 0.920s, 0.000 MB/s]
apple [auth 0.444s, headers 0.932s, total 0.933s, 0.000 MB/s]
orange [auth 0.498s, headers 1.104s, total 1.104s, 0.000 MB/s]
下载“水果”容器中的所有对象:

$: swift list fruit
apple
banana
orange
$: swift download fruit
banana [auth 0.455s, headers 0.919s, total 0.920s, 0.000 MB/s]
apple [auth 0.444s, headers 0.932s, total 0.933s, 0.000 MB/s]
orange [auth 0.498s, headers 1.104s, total 1.104s, 0.000 MB/s]
--all选项可用于下载所有内容(所有容器和对象)。它不用于单个容器下载

    $: swift download --all
usercontainer/budgets.ods [auth 0.426s, headers 1.139s, total 1.140s, 0.033 MB/s]
usercontainer/get-pip.py [auth 0.440s, headers 1.109s, total 1.402s, 1.657 MB/s]
usercontainer/profile.jpg [auth 0.418s, headers 1.123s, total 5.240s, 0.415 MB/s]
fruit/orange [auth 0.000s, headers 0.064s, total 0.064s, 0.000 MB/s]
fruit/banana [auth 0.000s, headers 0.070s, total 0.070s, 0.000 MB/s]
fruit/apple [auth 0.000s, headers 0.077s, total 0.077s, 0.000 MB/s]

我发现使用适当的环境变量可以使Swift CLI更易于使用。首先定义这些

export OS_USER_ID='xxxxxxxx' #userId field in Bluemix UI
export OS_PASSWORD='xxxxxxxxx' # password field in Bluemix UI 
export OS_TENANT_ID='xxxxxxxxx' # projectId field in Bluemix data
export OS_AUTH_URL='https://identity.open.softlayer.com/v3'
export OS_REGION_NAME='dallas' #region (change as needed)
export OS_IDENTITY_API_VERSION=3 
export OS_AUTH_VERSION=3 
然后,您可以使用swift命令行,而无需大量的--options。列出“水果”容器的内容物:

$: swift list fruit
apple
banana
orange
$: swift download fruit
banana [auth 0.455s, headers 0.919s, total 0.920s, 0.000 MB/s]
apple [auth 0.444s, headers 0.932s, total 0.933s, 0.000 MB/s]
orange [auth 0.498s, headers 1.104s, total 1.104s, 0.000 MB/s]
下载“水果”容器中的所有对象:

$: swift list fruit
apple
banana
orange
$: swift download fruit
banana [auth 0.455s, headers 0.919s, total 0.920s, 0.000 MB/s]
apple [auth 0.444s, headers 0.932s, total 0.933s, 0.000 MB/s]
orange [auth 0.498s, headers 1.104s, total 1.104s, 0.000 MB/s]
--all选项可用于下载所有内容(所有容器和对象)。它不用于单个容器下载

    $: swift download --all
usercontainer/budgets.ods [auth 0.426s, headers 1.139s, total 1.140s, 0.033 MB/s]
usercontainer/get-pip.py [auth 0.440s, headers 1.109s, total 1.402s, 1.657 MB/s]
usercontainer/profile.jpg [auth 0.418s, headers 1.123s, total 5.240s, 0.415 MB/s]
fruit/orange [auth 0.000s, headers 0.064s, total 0.064s, 0.000 MB/s]
fruit/banana [auth 0.000s, headers 0.070s, total 0.070s, 0.000 MB/s]
fruit/apple [auth 0.000s, headers 0.077s, total 0.077s, 0.000 MB/s]

当我尝试使用export命令时,它给了我无法识别的信息。如果您在Windows上,您需要使用SET而不是export来设置环境变量。是的,我使用了SET,之后我给了swift下载containername,但它给了我authenticationfailure@mpcarl如何一次将所有文件上载到容器。一次只允许一个文件。我用过这个,但没用。swift upload containername——您可以用一个命令列出要上载的多个文件。例如:swift upload MOREFROUT苹果香蕉橙。当我尝试使用export命令时,如果您在Windows上,它会给我一个无法识别的提示,您需要使用SET而不是export来设置环境变量。是的,我使用SET,然后我给了swift下载containername,但它给了我authenticationfailure@mpcarl如何一次将所有文件上载到容器。一次只允许一个文件。我用过这个,但没用。swift upload containername——您可以用一个命令列出要上载的多个文件。例如:苹果香蕉橙。