cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
573
Views
0
Helpful
6
Replies

Public ios-xe-mgmt.cisco.com API not responding

Good night dear Cisco community,

I'm studying for my CCNP ENCOR, and I attempted to interact to the public device API (https://ios-xe-mgmt.cisco.com:9443/restconf/data/ietf-interfaces:interfaces). However, the subdomain doesn't seem to be reachable and the URL itself is unresponsive.

Can you check the status of it and fix, or point me to an alternative URL for me to practice? Thank you.

6 Replies 6

Hey @gianfranco-laroccam i see a couple of issue here. You should use this information

devnetsandboxiosxe.cisco.com
Username: admin
Password: C1sco12345
RESTCONF port: 443

I ran this command

Executing `curl -k -u admin:C1sco12345 -H "Accept: application/yang-data+json" -H "Content-Type: application/yang-data+json" https://devnetsandboxiosxe.cisco.com/restconf/data/ietf-interfaces:interfaces`...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2336    0  2336    0     0   2305      0 --:--:--  0:00:01 --:--:--  2306
{
  "ietf-interfaces:interfaces": {
    "interface": [
      {
        "name": "GigabitEthernet1",
        "description": "MANAGEMENT INTERFACE - DON'T TOUCH ME",
        "type": "iana-if-type:ethernetCsmacd",
        "enabled": true,
        "ietf-ip:ipv4": {
          "address": [
            {
              "ip": "10.10.20.48",
              "netmask": "255.255.255.0"
            }
          ]
        },
        "ietf-ip:ipv6": {
        }
      },
      {
        "name": "GigabitEthernet2",
        "description": "Configured by Terraform",
        "type": "iana-if-type:ethernetCsmacd",
        "enabled": true,
        "ietf-ip:ipv4": {
          "address": [
            {
              "ip": "172.16.1.1",
              "netmask": "255.255.255.0"
            }
          ]
        },
        "ietf-ip:ipv6": {
        }
      },
      {
        "name": "GigabitEthernet3",
        "description": "Network Interface",
        "type": "iana-if-type:ethernetCsmacd",
        "enabled": false,
        "ietf-ip:ipv4": {
        },
        "ietf-ip:ipv6": {
        }
      },
      {
        "name": "Loopback0",
        "type": "iana-if-type:softwareLoopback",
        "enabled": true,
        "ietf-ip:ipv4": {
          "address": [
            {
              "ip": "10.0.0.1",
              "netmask": "255.255.255.0"
            }
          ]
        },
        "ietf-ip:ipv6": {
        }
      },
      {
        "name": "Loopback10",
        "type": "iana-if-type:softwareLoopback",
        "enabled": true,
        "ietf-ip:ipv4": {
        },
        "ietf-ip:ipv6": {
        }
      },
      {
        "name": "Loopback11",
        "description": "Configured by Luster",
        "type": "iana-if-type:softwareLoopback",
        "enabled": true,
        "ietf-ip:ipv4": {
          "address": [
            {
              "ip": "111.125.10.10",
              "netmask": "255.255.255.0"
            }
          ]
        },
        "ietf-ip:ipv6": {
        }
      },
      {
        "name": "VirtualPortGroup0",
        "type": "iana-if-type:propVirtual",
        "enabled": true,
        "ietf-ip:ipv4": {
          "address": [
            {
              "ip": "192.168.1.1",
              "netmask": "255.255.255.0"
            }
          ]
        },
        "ietf-ip:ipv6": {
        }
      }
    ]
  }
}

 

Your error happens because the correct YANG model path is ietf-interfaces:interfaces (plural). The RESTCONF API follows the YANG data model structure, and in this case, the container is named "interfaces" (plural) in the YANG model. So to correctly query the interfaces on the device, you should use: /restconf/data/ietf-interfaces:interfaces

Hope this helps you.

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

Thanks for your response,

Once more thing, I'm able to connect to the URL and make GET requests.

However, I'm getting a 504 Gateway Time-out error when looking to do POST and DELETE requests

That should not be an issue on this sandbox, can you share your code?

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

I'm currently using Postman to interact with the API, not Python just yet.

Might you give me a quick documentation to interact with this new URL in Postman? mainly to POST and DELETE, please.

You can try this document/collection https://www.postman.com/ciscodevnet/cisco-devnet-s-public-workspace/documentation/ovd3uvy/cisco-ios-xe

if you are getting an error message can you share this?

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

@gianfranco-laroccam i just tested for you, this is a PUT command.

curl -k -u admin:C1sco12345 -X PUT -H "Accept: application/yang-data+json" -H "Content-Type: application/yang-data+json" -d '{"ietf-interfaces:interface": {"name": "Loopback100", "description": "Created with RESTCONF", "type": "iana-if-type:softwareLoopback", "enabled": true, "ietf-ip:ipv4": {"address": [{"ip": "192.0.2.100", "netmask": "255.255.255.0"}]}}}' https://devnetsandboxiosxe.cisco.com:443/restconf/data/ietf-interfaces:interfaces/interface=Loopback100

The the command to check this which is a GET

curl -k -u admin:C1sco12345 -H "Accept: application/yang-data+json" -H "Content-Type: application/yang-data+json" https://devnetsandboxiosxe.cisco.com:443/restconf/data/ietf-interfaces:interfaces/interface=Loopback100

{
  "ietf-interfaces:interface": [
    {
      "name": "Loopback100",
      "description": "Created with RESTCONF",
      "type": "iana-if-type:softwareLoopback",
      "enabled": true,
      "ietf-ip:ipv4": {
        "address": [
          {
            "ip": "192.0.2.100",
            "netmask": "255.255.255.0"
          }
        ]
      },
      "ietf-ip:ipv6": {
      }
    }
  ]
}

 I did a POST too

curl -k -u admin:C1sco12345 -X POST -H "Accept: application/yang-data+json" -H "Content-Type: application/yang-data+json" -d '{"ietf-interfaces:interface": {"name": "Loopback200", "description": "Created with RESTCONF POST", "type": "iana-if-type:softwareLoopback", "enabled": true}}' https://devnetsandboxiosxe.cisco.com:443/restconf/data/ietf-interfaces:interfaces

You see this here with a GET

curl -k -u admin:C1sco12345 -H "Accept: application/yang-data+json" -H "Content-Type: application/yang-data+json" https://devnetsandboxiosxe.cisco.com:443/restconf/data/ietf-interfaces:interfaces/interface=Loopback200

{
  "ietf-interfaces:interface": [
    {
      "name": "Loopback200",
      "description": "Created with RESTCONF POST",
      "type": "iana-if-type:softwareLoopback",
      "enabled": true,
      "ietf-ip:ipv4": {
      },
      "ietf-ip:ipv6": {
      }
    }
  ]
}

Let me know if you have questions here. 

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io