login();
Logs in to the Brocade FC switch REST API. Host, user and password are read from the FC_SWITCH_BROCADE_HOST, FC_SWITCH_BROCADE_USER and _SECRET_FC_SWITCH_BROCADE_PASSWORD job settings. Returns the session authorization token (e.g. "Custom_Basic ...") to pass as the Authorization header on subsequent requests.
Dies on any non-2xx response or a missing token in the response.
logout($token);
Closes the REST API session identified by $token, as returned by login().
Dies on any non-2xx response.
get_port($token, $port_name);
Fetches the current state of a Fibre Channel port, e.g. get_port($token, '0/1'). Returns the decoded "fibrechannel" hashref from the switch's response, e.g. containing 'is-enabled-state', 'physical-state', 'name' and other port fields.
Dies on any non-2xx response.
get_all_ports($token);
Fetches the current state of every Fibre Channel port on the switch. Returns an array of the same per-port hashrefs as get_port().
Dies on any non-2xx response.
get_all_enabled_ports($token);
Fetches every Fibre Channel port that is currently enabled (is-enabled-state true), as returned by get_all_ports().
Dies on any non-2xx response.
enable_port($token, $port_name);
Enables a Fibre Channel port, e.g. enable_port($token, '0/1').
Dies on any non-2xx response.
disable_port($token, $port_name);
Disables a Fibre Channel port, e.g. disable_port($token, '0/1').
Dies on any non-2xx response.
get_port_diagnostic_state($token, $port_name);
Fetches the result of the most recent ClearLink D_Port diagnostic test on a port, e.g. get_port_diagnostic_state($token, '0/1'). Returns the state string (e.g. "PASSED").
See the Brocade Fabric OS Troubleshooting and Diagnostics Reference Manual for D_Port diagnostics in general. This is a read-only call and never changes port state.
Dies on any non-2xx response.
get_port_diagnostic_frame_count($token, $port_name);
Fetches the frame count processed so far by an in-progress or completed D_Port link traffic test on a port, e.g. get_port_diagnostic_frame_count($token, '0/1').
Dies on any non-2xx response.