General troubleshooting tips

Connectivity

  • Connectivity is often the first issue you encounter. Ensure that you have enabled https-server on the VRF you are trying to use.

    • 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.

Resources, attributes, and behaviors

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

    If you are getting errors when making requests to switches with different software versions, use theAOS-CXREST 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, and the switch supports access through multiple versions of the REST API.

GET, PUT, POST, and DELETE methods

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

  • JSON模型资源变化的方法ed. 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 themutable(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.

  • Use the GET method with theselector=configurationparameter to get only the configuration attributes of a resource. Using the REST v10.04 API, you can also use the GET method with theselector=writableparameter to get only the mutable configuration attributes of a resource.

    You can use theAOS-CXREST API Reference to view information about the supported methods and resource models.

  • You can obtain 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/v10.04/system/subsystems"

      Example response body:

      { "chassis,1": "/rest/v10.04/system/subsystems/chassis,1", "line_card,1/3": "/rest/v10.04/system/subsystems/line_card,1%2F3", "management_module,1/5": "/rest/v10.04/system/subsystems/management_module,1%2F5" }
    • Example request:

      GET "https://192.0.2.5/rest/v10.04/system/subsystems/chassis,1?attributes=product_info"

      Example response body:

      { "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/v10.04/system/subsystems

      Example response body:

      { "chassis,1": "/rest/v10.04/system/subsystems/chassis,1", "line_card,1/1": "/rest/v10.04/system/subsystems/line_card,1%2F1 ", "management_module,1/1": "/rest/v10.04/system/subsystems/management_module,1%2F1" }
    • Example request:

      GET "https://192.0.2.5/rest/v10.04/system/subsystems/chassis,1?attributes=product_info"

      Example response body:

      { "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" } }

Hardware and other features

  • 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 theplatform_namesystem attribute.

    For example:

    GET "https://192.0.2.5/rest/v10.04/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" }
  • The words "port" and "interface" have meanings that are different from other network operating systems. In theAOS-CXoperating 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 thedebugcommand. The module name isrest. You can specify all severity log levels or a minimum severity log level.

    Example specifying all severity log levels:

    switch#debug rest all

    示例指定最低严重性的日志级别error:

    switch#debug rest all severity error