Skip to main content

Network FC fabrics endpoint overview

Contributors

Overview

The Fibre Channel (FC) fabric REST APIs provide read-only access to FC network information. This includes:

  • the connections between the ONTAP cluster and the FC fabric,

  • the switches that comprise the fabric, and

  • the zones of the active zoneset of the fabric.

Caching

Obtaining this information from the FC fabric can be time consuming. To allow the REST API to be more responsive, the APIs always return data from a cache that is updated asynchronously, but only on demand. Cache updates are triggered when the age of cached data exceeds the caller-specified maximum age as specified by the query parameter cache.maximum_age.

When a GET request initiates a cache refresh, the API attempts to wait for the update to complete before returning. If the cache cannot be updated before the return timeout (see query parameter return_timeout), the GET returns the currently cached data, but the cache update continues asynchronously. The caller may examine the returned property cache.update_time or cache.age to determine if the returned information is sufficiently fresh. If not, the caller should wait several seconds, then make a GET request again until the returned information is updated.

Examples

Fibre Channel fabric data is typically large. The numbers of rows returned in the following examples has been edited to simplify reading.

Retrieving the Fibre Channel fabrics to which the cluster is connected

This example retrieves the names of the cluster's connected Fibre Channel fabrics. It also retrieves the cache timestamp properties so that the caller can verify the currency of the data.

# The API:
GET /api/network/fc/fabrics

# The call:
curl -X GET 'https://<mgmt-ip>/api/network/fc/fabrics?fields=cache' -H 'Accept: application/hal+json'

# The response:
{
"records": [
  {
    "name": "10:00:aa:bb:cc:dd:ee:ff",
    "cache": {
      "update_time": "2022-02-07T21:21:29Z",
      "age": "PT1M16S",
      "is_current": "true"
    },
    "_links": {
      "self": {
        "href": "/api/network/fc/fabrics/10%3A00%3Aaa%3Abb%3Acc%3Add%3Aee%3Aff"
      }
    }
  },
  {
    "name": "10:00:ff:ee:dd:cc:bb:aa",
    "cache": {
      "update_time": "2022-02-07T21:21:29Z",
      "age": "PT1M16S",
      "is_current": "true"
    },
    "_links": {
      "self": {
        "href": "/api/network/fc/fabrics/10%3A00%3Aff%3Aee%3Add%3Acc%3Abb%3Aaa"
      }
    }
  }
],
"num_records": 2,
"_links": {
  "self": {
    "href": "/api/network/fc/fabrics?fields=cache"
  }
}
}

Retrieving all switches of a Fibre Channel fabric

This example retrieves the switches of Fibre Channel fabric 10:00:aa:bb:cc:dd:ee:ff.

# The API:
GET /api/network/fc/fabrics/10:00:aa:bb:cc:dd:ee:ff/switches

# The call:
curl -X GET 'https://<mgmt-ip>/api/network/fc/fabrics/10:00:aa:bb:cc:dd:ee:ff/switches?fields=cache' -H 'Accept: application/hal+json'

# The response:
{
"records": [
  {
    "wwn": "10:00:1a:1b:1c:1d:1e:1f",
    "cache": {
      "update_time": "2022-02-07T21:22:00Z",
      "age": "PT45S",
      "is_current": "true"
    },
    "_links": {
      "self": {
        "href": "/api/network/fc/fabrics/10:00:aa:bb:cc:dd:ee:ff/switches/10:00:1a:1b:1c:1d:1e:1f"
      }
    }
  },
  {
    "wwn": "10:00:2a:2b:2c:2d:2e:1f",
    "cache": {
      "update_time": "2022-02-07T21:22:00Z",
      "age": "PT45S",
      "is_current": "true"
    },
    "_links": {
      "self": {
        "href": "/api/network/fc/fabrics/10:00:aa:bb:cc:dd:ee:ff/switches/10:00:2a:2b:2c:2d:2e:1f"
      }
    }
  },
  {
    "wwn": "10:00:3a:3b:3c:3d:3e:3f",
    "cache": {
      "update_time": "2022-02-07T21:22:00Z",
      "age": "PT45S",
      "is_current": "true"
    },
    "_links": {
      "self": {
        "href": "/api/network/fc/fabrics/10:00:aa:bb:cc:dd:ee:ff/switches/10:00:3a:3b:3c:3d:3e:3f"
      }
    }
  },
  {
    "wwn": "10:00:4a:4b:4c:4d:4e:4f",
    "cache": {
      "update_time": "2022-02-07T21:22:00Z",
      "age": "PT45S",
      "is_current": "true"
    },
    "_links": {
      "self": {
        "href": "/api/network/fc/fabrics/10:00:aa:bb:cc:dd:ee:ff/switches/10:00:4a:4b:4c:4d:4e:4f"
      }
    }
  },
  {
    "wwn": "10:00:5a:5b:1a:5c:5d:5e",
    "cache": {
      "update_time": "2022-02-07T21:22:00Z",
      "age": "PT45S",
      "is_current": "true"
    },
    "_links": {
      "self": {
        "href": "/api/network/fc/fabrics/10:00:aa:bb:cc:dd:ee:ff/switches/10:00:5a:5b:1a:5c:5d:5e"
      }
    }
  }
],
"num_records": 5,
"_links": {
  "self": {
    "href": "/api/network/fc/fabrics/10:00:aa:bb:cc:dd:ee:ff/switches?fields=cache"
  }
}
}

Retrieving all zones of the active zoneset of a Fibre Channel fabric

This example retrieves the zone of the active set of Fibre Channel fabric 10:00:aa:bb:cc:dd:ee:ff.

# The API:
GET /api/network/fc/fabrics/10:00:aa:bb:cc:dd:ee:ff/zones

# The call:
curl -X GET 'https://<mgmt-ip>/api/network/fc/fabrics/10:00:aa:bb:cc:dd:ee:ff/zones?fields=cache' -H 'Accept: application/hal+json'

# The response:
{
"records": [
  {
    "name": "zone1",
    "cache": {
      "update_time": "2022-02-07T20:17:06Z",
      "age": "PT1H17M54S",
      "is_current": "true"
    },
    "_links": {
      "self": {
        "href": "/api/network/fc/fabrics/10:00:aa:bb:cc:dd:ee:ff/zones/zone1"
      }
    }
  },
  {
    "name": "zone2",
    "cache": {
      "update_time": "2022-02-07T20:17:06Z",
      "age": "PT1H17M54S",
      "is_current": "true"
    },
    "_links": {
      "self": {
        "href": "/api/network/fc/fabrics/10:00:aa:bb:cc:dd:ee:ff/zones/zone2"
      }
    }
  },
  {
    "name": "zone3",
    "cache": {
      "update_time": "2022-02-07T20:17:06Z",
      "age": "PT1H17M54S",
      "is_current": "true"
    },
    "_links": {
      "self": {
        "href": "/api/network/fc/fabrics/10:00:aa:bb:cc:dd:ee:ff/zones/zone3"
      }
    }
  },
  {
    "name": "zone4",
    "cache": {
      "update_time": "2022-02-07T20:17:06Z",
      "age": "PT1H17M54S",
      "is_current": "true"
    },
    "_links": {
      "self": {
        "href": "/api/network/fc/fabrics/10:00:aa:bb:cc:dd:ee:ff/zones/zone4"
      }
    }
  }
],
"num_records": 4,
"_links": {
  "self": {
    "href": "/api/network/fc/fabrics/10:00:aa:bb:cc:dd:ee:ff/zones?fields=cache"
  }
}
}

Searching all Fibre Channel fabrics for a specific attached device identified by its WWPN

This example finds the Fibre Channel fabric, switch, and switch port to which the device with WWPN 50:0a:2a:2b:2c:2d:2e:2f is attached. Note the use of the wildcard character in place of a fabric WWN in order to search all Fibre Channel fabrics.

# The API:
GET /api/network/fc/fabrics/*/switches

# The call:
curl -X GET 'https://<mgmt-ip>/api/network/fc/fabrics/*/switches?fields=ports,cache&ports.attached_device.wwpn=50:0a:2a:2b:2c:2d:2e:2f' -H 'Accept: application/hal+json'

# The response:
{
"records": [
  {
    "fabric": {
      "name": "10:00:aa:bb:cc:dd:ee:ff",
      "_links": {
        "self": {
          "href": "/api/network/fc/fabrics/10%3A00%3Aaa%3Abb%3Acc%3Add%3Aee%3Aff"
        }
      }
    },
    "wwn": "10:00:6a:6b:6c:6d:6e:6f",
    "ports": [
      {
        "slot": "0",
        "state": "online",
        "type": "f_port",
        "wwpn": "20:00:1a:1b:1c:1d:1e:1f",
        "attached_device": {
          "port_id": "0x999000",
          "wwpn": "50:0a:1a:1b:1c:1d:1e:1f"
        }
      },
      {
        "slot": "1",
        "state": "online",
        "type": "f_port",
        "wwpn": "20:01:2a:2b:1c:2d:2e:2f",
        "attached_device": {
          "port_id": "0x999100",
          "wwpn": "50:0a:2a:2b:2c:2d:2e:2f"
        }
      },
      {
        "slot": "2",
        "state": "offline",
        "type": "none",
        "wwpn": "20:02:3a:3b:3c:3d:3e:3f"
      },
      {
        "slot": "3",
        "state": "offline",
        "type": "f_port",
        "wwpn": "20:03:4a:4b:4c:4d:4e:4f",
        "attached_device": {
          "port_id": "0x999300",
          "wwpn": "50:0a:4a:4b:4c:4d:4e:4f"
        }
      },
      {
        "slot": "4",
        "state": "online",
        "type": "f_port",
        "wwpn": "20:04:5a:5b:5c:5d:5e:5f",
        "attached_device": {
          "port_id": "0x999400",
          "wwpn": "50:0a:5a:5b:5c:5d:5e:5f"
        }
      }
    ],
    "cache": {
      "update_time": "2022-02-07T21:57:29Z",
      "age": "PT4M49S",
      "is_current": "true"
    },
    "_links": {
      "self": {
        "href": "/api/network/fc/fabrics/10:00:aa:bb:cc:dd:ee:ff/switches/10:00:6a:6b:6c:6d:6e:6f"
      }
    }
  }
],
"num_records": 1,
"_links": {
  "self": {
    "href": "/api/network/fc/fabrics/*/switches?fields=ports,cache&ports.attached_device.wwpn=50:0a:2a:2b:2c:2d:2e:2f"
  }
}
}