Get Storage - Cisco 340 Series Configuration Manual

Table of Contents

Advertisement

Chapter 4
Configuring HTTP API

Get Storage

Example: get storage
Request
curl -k -X GET -H 'password: cisco123!' https://localhost/api/2.0/sys/storage
Reply
{"storage":"Root[/]
Used:2.7G Free:4.4G Used38%","success":"true","getAt":"2013-05-08 11:44:02"}
Get Hostname
Example: get hostname
Request
curl -k -X GET -H 'password: cisco123!' https://localhost/api/2.0/sys/hostname
Reply
{"hostname":"cisco.com","success":"true","getAt":"2013-05-08 11:44:21"}
Set Hostname
Example: set hostname to cisco
Request
curl -k -X PUT -H 'password: cisco123!' -H 'Content-Type: application/json' -d
'{"hostname" : "cisco"}' https://localhost/api/2.0/sys/hostname
Reply
{"success":"true","updatedAt":"2013-04-08 13:14:51"}
Parameter Restrictions
The hostname must be a valid domain name.
Get RPM Version
Example: get RPM version of Python package
Request
curl -k -X GET -H 'password: cisco123!' https://localhost/api/2.0/sys/rpmVersion/python
Reply
{"python":"2.7.3","success":"true","getAt":"2013-05-08 11:56:24"}
OL-29491-01
Size:7.4G Used:2.7G Free:4.4G Used38%\nHOME[/home] Size:7.4G
Cisco Edge 340 Series Software Configuration Guide, Release 1.0
System API
4-3

Advertisement

Table of Contents
loading

Table of Contents