Reading and updating launch power at PON ports in an OLT

In OZmap, OLTs have distinct elements that make up their overall structure. Thus, an OLT in OZmap consists of its chassis (element "olt"), its slots (element "slot"), and the PONs of each slot (element "pon").

Initial Scenario

For example, consider a scenario where monitoring and provisioning software wants to read and update the power levels of one or more PONs of an OLT in OZmap.

Example

After a power change on a PON port is detected via monitoring, the integrator software wants to update the power value of that PON port in OZmap. To do this, it's necessary to search for the OLT and its slots and locate the PON that needs to be updated. In this example, the initial search for the OLT will be done by the OLT name in OZmap, but it could also be done using other attributes, such as the IP address.

API

The next step is to understand how requests for reading and updating PON port power levels of an OLT should be made. Below is an example:

Given the OLT name in OZmap, let's assume it is OLT 1 for this example. First, we need to search for this OLT to identify its slots in OZmap.

With the name OLT 1, the search in OZmap would be done as follows:

curl --location --request GET 'https://sandbox.ozmap.com.br:9994/api/v2/olts?filter=[{"property": "name", "operator": "=", "value":"OLT 1"}]' \ --header 'authorization: AUTHORIZATION_TOKEN' \ --header 'Accept: application/json' \

Attention! The authorization token must be created in the OZmap interface. For more information, click here.

The expected return is:

{ "total": 1, "count": 1, "rows": [ { "label": "", "port": 22, "connectables": [ "5da61f6a493d9c000666552e", "5da61f6a493d9c0006665533", "5da722ef11450e0006947aaf" ], "attenuation": [], "implanted": true, "isDrop": false, "kind": "OLT", "parent": "5da61d35493d9c0006665404", "project": "5d9f3ff9200141000647f814", "oltType": "5cb5d737aacc5e394036ce92", "name": "OLT 1", "user": "", "ip": "", "password": "", "createdAt": "2019-10-15T19:35:06.989Z", "updatedAt": "2022-07-14T04:02:22.231Z", "index": 1, "id": "5da61f6a493d9c000666552f" } ], "start": 0, "limit": 25 }

The next step is to search for the OLT slots in OZmap using the connectables parameter, which in the context of an OLT represents its slots. Using connectables, which in this case is "connectables":["5da61f6a493d9c000666552e", "5da61f6a493d9c0006665533", "5da722ef11450e0006947aaf"], the search for the OLT slots in OZmap is done as follows:

curl --location --request GET 'https://sandbox.ozmap.com.br:9994/api/v2/slots?filter=[{"property":"connectables","operator":"in","value":["5da61f6a493d9c000666552e","5da61f6a493d9c0006665533","5da722ef11450e0006947aaf"]}]' \ --header 'authorization: AUTHORIZATION_TOKEN' \ --header 'Accept: application/json'

Attention! The authorization token must be created in the OZmap interface. For more information, click here.

The expected return is:

From this response, we see that this OLT has two slots. For this example, we determine that the PON that needs to be updated belongs to slot 2.

The next step is to search for the PONs of slot 2, and for that, we use the connectables parameter again, which in the context of slots represents their PONs. The value is "connectables": ["5da722ef11450e0006947aaf", "5da722ef11450e0006947ab3", "5da722ef11450e0006947ab7", "5da722f011450e0006947abb", "5da722f011450e0006947abf", "5da722f011450e0006947ac3", "5da722f011450e0006947ac7", "5da722f011450e0006947acb", "5da722f011450e0006947acf", "5da722f011450e0006947ad3", "5da722f011450e0006947ad7", "5da722f011450e0006947adb", "5da722f011450e0006947adf"].

With this value, the search for the PONs of this slot in OZmap is done as follows:

The expected return is:

From this response, we can determine that the PON to be updated is PON 12.

To modify the power level of this PON, the update must be made using the id attribute of the PON, which in this example has the value 5da7222011450e0006947a9a.

With the id 5da7222011450e0006947a9a, the power update for PON port 12 of this slot in OZmap is done as follows:

Attention! The authorization token must be created in the OZmap interface. For more information, click here.

The expected response for this operation is an empty message and a status of “204 No Content,” indicating that the power level for PON port has been successfully updated.