# Device42

## About <a href="#about" id="about"></a>

The Device42 NetoFuse module provides enriched asset context to Netography Fusion from the Device42 asset management platform. It connects to the Device42 API to retrieve asset information from the Devices table and then uploads it as [Context Labels](/enrich-traffic-with-context/labels.md) to the Netography Fusion API.

{% hint style="info" %}
**☁️NetoFuse Modules: Cloud deployment vs. On-Prem deployment**

This page documents how to add and configure the NetoFuse module for an on-prem deployment with a container or Python package. If you want to use the cloud deployment model and have this integration run in the Netography Fusion SaaS, you can add it as a context integration in the Netography Fusion Portal instead by consulting the [Context Integrations](/enrich-traffic-with-context/configure-context-integrations.md) documentation.
{% endhint %}

## API Configuration Parameters <a href="#api-configuration-parameters" id="api-configuration-parameters"></a>

All the fields required for this integration are listed here, along with the corresponding environment variable name used to set that field in the NetoFuse module.

| Device42 Field | Required | NetoFuse Environment Variable               | Description                                                                    |
| -------------- | -------- | ------------------------------------------- | ------------------------------------------------------------------------------ |
| URL            | Yes      | `NETO__DEVICE42__URL`                       | URL to Device42 API                                                            |
| Client Key     | Yes      | `NETO__DEVICE42__CREDENTIALS__CLIENT_KEY`   | Device42 Token Authentication Client Key                                       |
| Client Secret  | Yes      | `NETO__DEVICE42_CREDENTIALS__CLIENT_SECRET` | Device42 Token Authentication Client Secret                                    |
| Username       | No       | `NETO__DEVICE42__CREDENTIALS__USERNAME`     | Device42 User Authentication Username, if used instead of Token Authentication |
| Password       | No       | `NETO__DEVICE42__CREDENTIALS__PASSWORD`     | Device42 User Authentication Password, if used instead of Token Authentication |

### Selecting Token Authentication or User Authentication <a href="#selecting-token-authentication-or-user-authentication" id="selecting-token-authentication-or-user-authentication"></a>

Device42 can use either Token Authentication or User Authentication to connect to the API. Token authentication is the recommended approach for a production deployment.

The `Username` and `Password` fields are not required if token authentication is used (and conversely, the `Client Key` and `Client Secret` fields are not required if User authentication is used).

## Device42 Configuration <a href="#device42-configuration" id="device42-configuration"></a>

Follow Device42 instructions to generate a `Client Key` and `Client Secret` for a production deployment as documented here: <https://api.device42.com/#API_Authentication>

## `device42` NetoFuse Module Configuration <a href="#device42-netofuse-module-configuration" id="device42-netofuse-module-configuration"></a>

All the fields required for this integration are listed above in the [API Configuration Parameters](#api-configuration-parameters) section above. See [Configure > module](/netofuse/configure.md#module) for additional options for setting configuration fields and [Security Considerations](https://docs.netography.com/netofuse/security-considerations) for additional options for setting credentials.

### Advanced Configuration Options <a href="#advanced-configuration-options" id="advanced-configuration-options"></a>

The `device42` module gathers asset information from the `Devices` API endpoints. By default, this uses the `/api/2.0/devices/` API endpoint to retrieve all assets and all available fields. The fields that are used for context labels are then limited by the transform.

The `params:` section passes the `key:value`set to the Device42 as parameters to the API call. In this section, set the `include_cols` key to limit what fields are returned for retrieved assets, and set additional parameters to filter what assets are retrieved. The list of available parameters are in the Device42 API documentation: [Device42 API Guide > Devices > Get all v2](https://api.device42.com/#Devices_getDevices_2)

#### default `device42` module configuration <a href="#default-device42-module-configuration" id="default-device42-module-configuration"></a>

{% tabs %}
{% tab title="YAML" %}

```
  device42:
    url:
    ip_fields: ip,mac_address,label
    fetch_devices: false
    per_page: 1000 # Max is 1000
    credentials:
      username:
      password:
    transform:
      ip:
        context: ip
      ips:
        context: ip
      device_id:
        context: DeviceID
      serial_no:
        context: serial_number
      available:
        context: Available
      mac_id:
        context: mac_id
      mac_address:
        context: mac_addr
      last_updated:
        context: Last_Updated
      device:
        context: Device
      label:
        context: Label
      subnet:
        context: Subnet
      port_name:
        context: Port_Name
      port_id:
        context: Port_ID
      ip_type:
        context: IP_Type
      tags:
        context: Tags
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fusion.vectra.ai/netofuse/modules/device42.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
