示例:使用REST API的固件升级
将文件上传为二级固件图像
在下面的示例中,使用curl命令将固件图像文件从本地工作站上传到开关,作为辅助固件图像。这-F
选项指定邮政方法用于上传文件。
示例方法和URI:
发帖“ https://192.0.2.5/rest/V10.04/固件?图像=次级
请求主体包含以二进制格式的开关固件图像文件。
示例卷曲命令:
$curl -noproxy -k -k -b/tmp/auth_cookie \ -h'content -type:application/json'\ -h'accept:application/json'\ -f“ fileupload =@fileupload =@m myfirmwarefiles/myswwarefiles/mysswitchfirmware_2020020200209050505.swi \ https” \ https://192.0.2.5/rest/V10.04/固件?图像=次级
在卷曲命令中,将邮政请求作为一部分处理-F
选项。使用辅助固件图像启动系统
示例方法和URI:
发帖“ https://192.0.2.5/rest/V10.04/boot?image =次级
示例卷曲命令:
$curl -noproxy -k -k -x post -b/tmp/auth_cookie \ -h'content -type:application/json'\ -h'accept:application/json'\“ https://192.0.2.0.2.5/rest/V10.04/boot?image =次级