# Module `netapp_ontap.resources.storage_bridge`

Copyright © 2021 NetApp Inc. All rights reserved.

## Retrieving storage bridge information

The storage bridge GET API retrieves all of the bridges in the cluster.

## Examples

### 1) Retrieves a list of bridges from the cluster

#### The following example shows the response with a list of bridges from the cluster:

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import StorageBridge

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        print(list(StorageBridge.get_collection()))

Try it out

    [
        StorageBridge({"wwn": "2000001086a18100", "name": "ATTO_2000001086a18100"}),
        StorageBridge({"wwn": "2000001086a18380", "name": "ATTO_2000001086a18380"}),
    ]

### 2) Retrieves a specific bridge from the cluster

#### The following example shows the response of the requested bridge. If there is no bridge with the requested wwn, an error is returned.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import StorageBridge

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = StorageBridge(wwn="2000001086a18100")
        resource.get()
        print(resource)

Try it out

    StorageBridge(
        {
            "last_reboot": {
                "reason": {
                    "message": 'Reason: "FirmwareRestart Command".',
                    "code": "39321683",
                },
                "time": "2020-12-09T00:47:58-05:00",
            },
            "wwn": "2000001086a18100",
            "name": "ATTO_2000001086a18100",
            "paths": [
                {
                    "node": {
                        "name": "sti8080mcc-htp-005",
                        "uuid": "ecc3d992-3a86-11eb-9fab-00a0985a6024",
                        "_links": {
                            "self": {
                                "href": "/api/cluster/nodes/ecc3d992-3a86-11eb-9fab-00a0985a6024"
                            }
                        },
                    },
                    "name": "0e",
                    "target_port": {"wwn": "2100001086a18380"},
                }
            ],
            "power_supply_units": [
                {"state": "ok", "name": "A"},
                {"state": "ok", "name": "B"},
            ],
            "symbolic_name": "RTP-FCSAS02-41KK10",
            "chassis_throughput_state": "ok",
            "managed_by": "in_band",
            "vendor": "atto",
            "state": "ok",
            "dram_single_bit_error_count": 0,
            "ip_address": "10.226.57.178",
            "security_enabled": False,
            "model": "FibreBridge 7500N",
            "sas_ports": [
                {
                    "enabled": True,
                    "id": 1,
                    "data_rate_capability": 12.0,
                    "phy_3": {"state": "online"},
                    "phy_4": {"state": "online"},
                    "cable": {
                        "serial_number": "618130935",
                        "technology": "Passive Copper 5m ID:00",
                        "vendor": "Molex Inc.",
                        "part_number": "112-00431",
                    },
                    "wwn": "5001086000a18100",
                    "negotiated_data_rate": 6.0,
                    "phy_1": {"state": "online"},
                    "phy_2": {"state": "online"},
                    "state": "online",
                },
                {
                    "enabled": False,
                    "data_rate_capability": 12.0,
                    "phy_3": {"state": "offline"},
                    "phy_4": {"state": "offline"},
                    "wwn": "5001086000a18104",
                    "negotiated_data_rate": 0.0,
                    "phy_1": {"state": "offline"},
                    "phy_2": {"state": "offline"},
                    "state": "offline",
                },
                {
                    "enabled": False,
                    "data_rate_capability": 12.0,
                    "phy_3": {"state": "offline"},
                    "phy_4": {"state": "offline"},
                    "wwn": "5001086000a18108",
                    "negotiated_data_rate": 0.0,
                    "phy_1": {"state": "offline"},
                    "phy_2": {"state": "offline"},
                    "state": "offline",
                },
                {
                    "enabled": False,
                    "data_rate_capability": 12.0,
                    "phy_3": {"state": "offline"},
                    "phy_4": {"state": "offline"},
                    "wwn": "5001086000a1810c",
                    "negotiated_data_rate": 0.0,
                    "phy_1": {"state": "offline"},
                    "phy_2": {"state": "offline"},
                    "state": "offline",
                },
            ],
            "serial_number": "FB7500N102450",
            "firmware_version": "3.10 007A",
            "temperature_sensor": {
                "reading": 54,
                "minimum": 0,
                "state": "ok",
                "name": "Chassis Temperature Sensor",
                "maximum": 90,
            },
            "fc_ports": [
                {
                    "enabled": True,
                    "id": 1,
                    "data_rate_capability": 16.0,
                    "configured_data_rate": 8.0,
                    "negotiated_data_rate": 8.0,
                    "wwn": "2100001086a18100",
                    "sfp": {
                        "serial_number": "UW106SA",
                        "data_rate_capability": 16.0,
                        "vendor": "FINISAR CORP.",
                        "part_number": "FTLF8529P3BCV",
                    },
                    "state": "online",
                    "peer_wwn": "0000000000000000",
                },
                {
                    "enabled": True,
                    "id": 2,
                    "data_rate_capability": 16.0,
                    "configured_data_rate": 16.0,
                    "negotiated_data_rate": 16.0,
                    "wwn": "2200001086a18100",
                    "sfp": {
                        "serial_number": "UW1072B",
                        "data_rate_capability": 16.0,
                        "vendor": "FINISAR CORP.",
                        "part_number": "FTLF8529P3BCV",
                    },
                    "state": "online",
                    "peer_wwn": "0000000000000000",
                },
            ],
            "monitoring_enabled": True,
        }
    )

## Classes

`class StorageBridge (*args, **kwargs)`

  Allows interaction with StorageBridge objects on the host

  Initialize the instance of the resource.

  Any keyword arguments are set on the instance as properties. For example, if the class was named 'MyResource', then this statement would be true:

      MyResource(name='foo').name == 'foo'

  ## Args

  `*args`
    Each positional argument represents a parent key as used in the URL of the object. That is, each value will be used to fill in a segment of the URL which refers to some parent object. The order of these arguments must match the order they are specified in the URL, from left to right.
  `**kwargs`
    each entry will have its key set as an attribute name on the instance and its value will be the value of that attribute.

  ### Ancestors

  - Resource

  ### Static methods

  `def count_collection(*args, connection: HostConnection = None, **kwargs) -> int`

    Retrieves a collection of bridges.

    ### Related ONTAP commands

    - `storage bridge show`

    ### Learn more

    - `DOC /storage/bridges`

    Fetch a count of all objects of this type from the host.

    This calls GET on the object to determine the number of records. It is more efficient than calling get_collection() because it will not construct any objects. Query parameters can be passed in as kwargs to determine a count of objects that match some filtered criteria.

    ## Args

    `*args`
      Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to get the count of bars for a particular foo, the foo.name value should be passed.
    `connection`
      The `HostConnection` object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context.
    `**kwargs`
      Any key/value pairs passed will be sent as query parameters to the host. These query parameters can affect the count. A return_records query param will be ignored.

    ## Returns

    On success, returns an integer count of the objects of this type. On failure, returns -1.

    ## Raises

    `NetAppRestError`: If the API call returned a status code >= 400, or if there is no connection available to use either passed in or on the library.

  `def find(*args, connection: HostConnection = None, **kwargs) -> Resource`

    Retrieves a collection of bridges.

    ### Related ONTAP commands

    - `storage bridge show`

    ### Learn more

    - `DOC /storage/bridges`

    Find an instance of an object on the host given a query.

    The host will be queried with the provided key/value pairs to find a matching resource. If 0 are found, None will be returned. If more than 1 is found, an error will be raised or returned. If there is exactly 1 matching record, then it will be returned.

    ## Args

    `*args`
      Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to find a bar for a particular foo, the foo.name value should be passed.
    `connection`
      The `HostConnection` object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context.
    `**kwargs`
      Any key/value pairs passed will be sent as query parameters to the host.

    ## Returns

    A `Resource` object containing the details of the object or None if no matches were found.

    ## Raises

    `NetAppRestError`: If the API call returned more than 1 matching resource.

  `def get_collection(*args, connection: HostConnection = None, max_records: int = None, **kwargs) -> typing.Iterable`

    Retrieves a collection of bridges.

    ### Related ONTAP commands

    - `storage bridge show`

    ### Learn more

    - `DOC /storage/bridges`

    Fetch a list of all objects of this type from the host.

    This is a lazy fetch, making API calls only as necessary when the result of this call is iterated over. For instance, if max_records is set to 5, then iterating over the collection causes an API call to be sent to the server once for every 5 records. If the client stops iterating before getting to the 6th record, then no additional API calls are made.

    ## Args

    `*args`
      Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to get the collection of bars for a particular foo, the foo.name value should be passed.
    `connection`
      The `HostConnection` object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context.
    `max_records`
      The maximum number of records to return per call
    `**kwargs`
      Any key/value pairs passed will be sent as query parameters to the host.

    ## Returns

    A list of `Resource` objects

    ## Raises

    `NetAppRestError`: If there is no connection available to use either passed in or on the library. This would be not be raised when get_collection() is called, but rather when the result is iterated.

  ### Methods

  `def get(self, **kwargs) -> NetAppResponse`

    Retrieves a specific bridge

    ### Related ONTAP commands

    - `storage bridge show`

    ### Learn more

    - `DOC /storage/bridges`

    Fetch the details of the object from the host.

    Requires the keys to be set (if any). After returning, new or changed properties from the host will be set on the instance.

    ## Returns

    A `NetAppResponse` object containing the details of the HTTP response.

    ## Raises

    `NetAppRestError`: If the API call returned a status code >= 400

  ### Inherited members

  - `Resource`:
    - `from_dict`
    - `get_collection_url`
    - `get_connection`
    - `instance_location`
    - `path_keys`
    - `poll`
    - `set_connection`
    - `to_dict`
`class StorageBridgeSchema (*, only: typing.Union = None, exclude: typing.Union = (), many: bool = False, context: typing.Dict = None, load_only: typing.Union = (), dump_only: typing.Union = (), partial: typing.Union = False, unknown: str = None)`

  The fields of the StorageBridge object

  ### Ancestors

  - netapp_ontap.resource.ResourceSchema
  - marshmallow.schema.Schema
  - marshmallow.base.SchemaABC

  ### Class variables

  `chassis_throughput_state GET`

    Chassis throughput status

    Valid choices:

    - ok
    - warning
  `dram_single_bit_error_count GET`

    The dram_single_bit_error_count field of the storage_bridge.

  `errors GET`

    The errors field of the storage_bridge.

  `fc_ports GET`

    The fc_ports field of the storage_bridge.

  `firmware_version GET`

    Bridge firmware version

    Example: 4.10 007A

  `ip_address GET`

    IP Address

  `last_reboot GET`

    The last_reboot field of the storage_bridge.

  `managed_by GET`

    The managed_by field of the storage_bridge.

    Valid choices:

    - snmp
    - in_band
  `model GET`

    Bridge model

    Example: FibreBridge6500N

  `monitoring_enabled GET`

    Indicates whether monitoring is enabled for the bridge.

  `name GET`

    Bridge name

    Example: ATTO_FibreBridge6500N_1

  `paths GET`

    The paths field of the storage_bridge.

  `power_supply_units GET`

    The power_supply_units field of the storage_bridge.

  `sas_ports GET`

    The sas_ports field of the storage_bridge.

  `security_enabled GET`

    Indicates whether security is enabled for the bridge.

  `serial_number GET`

    Bridge serial number

    Example: FB7600N100004

  `state GET`

    Bridge state

    Valid choices:

    - unknown
    - ok
    - error
  `symbolic_name GET`

    Bridge symbolic name

    Example: rtp-fcsas03-41kk11

  `temperature_sensor GET`

    The temperature_sensor field of the storage_bridge.

  `vendor GET`

    Bridge vendor

    Valid choices:

    - unknown
    - atto
  `wwn GET`

    Bridge world wide name

    Example: 2000001086600476