3

我正在尝试编写一个 bash 脚本,该脚本将发布 Crafter 中已经存在的文件列表。

有没有 API 可以做到这一点?我想你需要先登录。

谢谢

4

2 回答 2

5

尝试使用批量发布 API,如下所示:

POST /api/1/services/api/1/deployment/bulk-golive.json?site={siteName}&path={path}&environment={env}

您需要登录,因此登录并保存 cookie 以在调用此 API 时使用。

于 2017-05-05T13:34:10.787 回答
4

添加到 sumerz 响应中,您可以使用它来登录

curl -i -b cookies.txt -H "Content-Type:application/x-www-form-urlencoded" -H "Accept:application/json, text/plain, */*"  -c cookies.txt -X POST -d "username=admin&password=admin" http://localhost:8080/studio/api/1/services/api/1/user/login.json

然后你可以使用-b-c让 curl 知道会话。

于 2017-05-05T14:06:06.777 回答