General troubleshooting tips

  • Connectivity is often the first issue you encounter. The REST API is enabled, or disabled, per VRF.

    To connect to the REST API through the management (OOBM) port, REST API access must be enabled on the management VRF. To connect to the REST API through a data port, REST API access must be enabled on the default VRF or a user-created VRF that includes that data port.

  • Most resources do not allow POST, PUT, or DELETE methods and do not display those methods in the AOS-CX REST API Reference unless the REST access mode is set to read-write.

  • The JSON model of a resource can vary by method used. The JSON data you receive from the GET method is not the same as the JSON data you can or must provide with the POST or PUT methods:

    • The GET method model contains all the attributes.

    • The POST method model contains only the configuration attributes.

    • The PUT method model contains only the mutable (changeable) configuration attributes. If you do not provide all the mutable attributes in the request body of the PUT request, those attributes you do not provide are set to their defaults, which could be empty. If you attempt to provide an immutable attribute in a PUT request, an error is returned.

    You use the AOS-CX REST API Reference to view information about the supported methods and resource models. You can also use the GET method with the selector=configuration parameter to get only the configuration attributes of a resource.

  • Resources, attributes, and behaviors might differ between different versions of the switch software.

    For example, the bridge resource was eliminated from the URI path beginning with AOS-CX 10.03:

    • Example of getting the list of VLANs for a switch running AOS-CX version 10.02:

      GET "https://192.0.2.5/rest/v1/system/bridge/vlans"
    • Example of getting the list of VLANs for a switch running AOS-CX version 10.03:

      GET "https://192.0.2.5/rest/v1/system/vlans"

    If you are getting errors when making requests to switches with different software versions, use the AOS-CX REST API Reference on each switch to compare the URI paths and attributes for the resource. You might need to alter your code to handle the different software versions.

  • Resources, attributes, and behaviors might differ between different versions of the REST API. Ensure that the version used in the URIs match the version running on the switch. The version is included in the URI prefix portion of the path of the URI. The REST API version running on the switch is shown at the bottom of the AOS-CX REST API Reference browser window.

    • Example URI prefix: https://192.0.2.5/rest/v1

    • Example from the AOS-CX REST API Reference browser window:

  • Different switches have different hardware and features. For example, the management module resource ID is 1/1 for some switches, and 1/4 or 1/5 for other switches. To get information about the switch model, use the GET method request with the URI for the platform_name system attribute.

    For example:

    GET "https://192.0.2.5/rest/v1/system?attributes=platform_name"

    The following is an example of a response body for an Aruba 8320 switch:

    {
      "platform_name": "8320"
    }

    The following is an example of a response body for an Aruba 8400 switch:

    {
      "platform_name": "8400X"
    }
  • You can additional platform-specific information through get requests for product information attributes or subsystem collections.

    Aruba 8400 switch examples:

    • Example request:

      GET "https://192.0.2.5/rest/v1/system/subsystems"

      Example response:

      [
        "/rest/v1/system/subsystems/fabric_card/1%2F3",
        "/rest/v1/system/subsystems/chassis/base",
        "/rest/v1/system/subsystems/line_card/1%2F3",
        "/rest/v1/system/subsystems/line_card/1%2F2",
        "/rest/v1/system/subsystems/line_card/1%2F8",
        "/rest/v1/system/subsystems/line_card/1%2F7",
        "/rest/v1/system/subsystems/line_card/1%2F10",
        "/rest/v1/system/subsystems/management_module/1%2F5",
        "/rest/v1/system/subsystems/rear_display_card/1%2FRDC",
        "/rest/v1/system/subsystems/fabric_card/1%2F2",
        "/rest/v1/system/subsystems/management_module/1%2F6",
        "/rest/v1/system/subsystems/line_card/1%2F9",
        "/rest/v1/system/subsystems/fan_tray/1%2F2",
        "/rest/v1/system/subsystems/fabric_card/1%2F1",
        "/rest/v1/system/subsystems/fan_tray/1%2F3",
        "/rest/v1/system/subsystems/line_card/1%2F1",
        "/rest/v1/system/subsystems/line_card/1%2F4",
        "/rest/v1/system/subsystems/fan_tray/1%2F1"
      ]
      
    • Example request:

      GET "https://192.0.2.5/rest/v1/system/subsystems/chassis/base?attributes=product_info"

      Example response:

      {
        "product_info": {
          "base_mac_address": "00:00:5E:00:53:00",
          "device_version": "",
          "instance": "1",
          "number_of_macs": "512",
          "part_number": "JL375A",
          "product_description": "8400 8-slot Chassis/3xFan Trays/18xFans/Cable Manager/X462 Bundle",
          "product_name": "8400 Base Chassis/3xFT/18xFans/Cbl Mgr/X462 Bundle",
          "serial_number": "SG00A2A00A",
          "vendor": "Aruba"
        }
      }

    Aruba 8320 switch examples:

    • Example request:

      GET "https://192.0.2.5/rest/v1/system/subsystems

      Example response:

      [
        "/rest/v1/system/subsystems/chassis/base",
        "/rest/v1/system/subsystems/line_card/1%2F1",
        "/rest/v1/system/subsystems/management_module/1%2F1"
      ]
    • Example request:

      GET "https://10.102.254.250/rest/v1/system/subsystems/chassis/base?attributes=product_info"

      Example response:

      {
        "product_info": {
          "base_mac_address": "00:00:5E:00:53:01",
          "device_version": "",
          "instance": "1",
          "number_of_macs": "74",
          "part_number": "JL479A",
          "product_description": "8320",
          "product_name": "8320",
          "serial_number": "TW00000000",
          "vendor": "Aruba"
        }
      }
      
  • The words "port" and "interface" have meanings that are different from other network operating systems. In the AOS-CX operating system:

    • A port is the logical representation of a port.

    • An interface is the hardware representation of a port.

  • You can enable debugging logs by using the debug command. The module name is rest. You can specify all severity log levels or a minimum severity log level.

    Example specifying all severity log levels:

    switch# debug rest all

    Example specifying a minimum severity log level of error:

    switch# debug rest all severity error