简体   繁体   English

门户网站问题-从命令行下载“设备”文件

[英]Portal issue - Download “devices” file from command line

In "Devices" --> Device list --> click the sprocket on the right --> Download CSV - then I can download (manually) my list of devices using my web browser. 在“设备”->设备列表->单击右侧的链轮-> 下载CSV-然后,我可以使用Web浏览器下载(手动)设备列表。 Is there a way to download the file via command line? 有没有办法通过命令行下载文件?
I tried to use Curl with no luck. 我没有运气就尝试使用Curl。

/curl -sslv3 -v -u gili.XXX "https://control.softlayer.com/device/device/downloaddevices?sort=#####......"
Enter host password for user 'gili.XXX':
* Trying 66.228.118.118...
* Connected to control.softlayer.com (66.228.118.118) port 443 (#0)
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: none
* SSLv3 (OUT), TLS handshake, Client hello (1):
* Unknown SSL protocol error in connection to control.softlayer.com:443
* Closing connection 0

I also tried links, links2, wget... They all complain regarding SSL problem. 我也尝试了link,links2,wget ...他们都抱怨SSL问题。

Please advice... 请指教...

Gili 吉利

They don't support SSLv3, only TLS 1.0-1.2 so you will need to remove the -sslv3 flag. 它们不支持SSLv3,仅支持TLS 1.0-1.2,因此您需要删除-sslv3标志。 Additionally, you'll need to log in and maintain a session with them (via cookies), not HTTP auth with the -u option. 此外,您需要登录并维护与它们的会话(通过cookie),而不是使用-u选项进行HTTP身份验证。

I can't test it but you might be able to pull it off all in one command like this: 我无法对其进行测试,但是您可以像这样在一条命令中将其全部拉出:

curl -L -d username=youruser -d password=yourpass \
--cookie-jar cookies.txt --cookie cookies.txt \
https://control.softlayer.com/device/device/downloaddevices?sort=.....

The -d parameters make curl do a form post sending username and password fields (these are from their login form). -d参数使curl执行发送用户名和密码字段的表单发布(这些表单和密码字段来自其登录表单)。 The cookie parameters are probably not needed since it will probably log you in and redirect to the CSV download but if you need to issue one curl request to log in, and another to download you'll need them. cookie参数可能不需要,因为它可能会登录并重定向到CSV下载,但是如果您需要发出一个curl请求来登录,而又要发出另一个curl请求,则需要它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM