cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
978
Views
20
Helpful
2
Replies

Getting contents of Flash or Available Space via RESTCONF/REST API

BradRenner
Level 1
Level 1

I am trying to automate the upgrading of an IOS XE device using REST/RESTCONF and the accompany YANG data models. Using: https://{{device}}/restconf/data/Cisco-IOS-XE-install-rpc:install/ , for example, one can configure the body of the POST call to initialize the install RPC via RESTCONF and one-shot upgrade the device. The body of the POST call would look something like this in JSON:

{
    "Cisco-IOS-XE-install-rpc:input": {
        "uuid""test",
        "one-shot"true,
        "path""bootflash:image.x.x.x.SPA.bin"
    }
}
 
This is all working correctly. I can also copy the files via this RESTCONF API call: https://{{device}}/restconf/data/Cisco-IOS-XE-rpc:copy as well (if you'd like the body JSON of this I can provide it, but it works). What would be helpful would be to find out what Yang module or REST API call I can use to query the contents of the IOS XE device's flash (to verify the copy was successful and the file exists on the device) and/or a REST API call to display the available space left in the device's flash
 
I have been using Cisco's YangSuite to parse the many Yang modules available for my IOS XE device, but I am still having trouble finding any that will return the contents of a device's flash or the amount of space available in the device's flash. I am finding very little (to no) documentation or examples for a lot of the Yang modules to use with RESTCONF and was hoping someone smarter than me has already made this discovery. Thanks!
 
1 Accepted Solution

Accepted Solutions

Marcel Zehnder
Spotlight
Spotlight

Hi

Cisco-IOS-XE-platform-software-oper will do the trick. Start here, you'll find what you're looking for: 
https://<IP>/restconf/data/Cisco-IOS-XE-platform-software-oper:cisco-platform-software/q-filesystem

HTH

Marcel

View solution in original post

2 Replies 2

Marcel Zehnder
Spotlight
Spotlight

Hi

Cisco-IOS-XE-platform-software-oper will do the trick. Start here, you'll find what you're looking for: 
https://<IP>/restconf/data/Cisco-IOS-XE-platform-software-oper:cisco-platform-software/q-filesystem

HTH

Marcel

Thank you Marcel for your quick and accurate response to my inquiry. It was exactly what I needed! I had seen the "Cisco-IOS-XE-platform-software-oper" module but I hadn't fully investigate it and all its leaf's yet. You definitely saved me some time, thank you!