Reading and updating Splitter powers
In OZmap, splitters have attenuation levels, installation power, and current power. The attenuation is defined by the type of splitter used in OZmap. The installation power is the first power recorded for the splitter's port. The current power represents the power value of the splitter's port. In API updates, when updating the current power, if no installation power has been defined yet, the value indicated for the current power will automatically be set as the installation power.
Initial Scenario
For example, consider a scenario where monitoring and provisioning software needs to read and update the current power of splitters in OZmap.
Example
A field technician wants to update the current power of a splitter during maintenance. To do this, it's possible to search for nearby boxes to select where the splitter to be updated is located. In this example, the search will be done using coordinates (representing the technician's location in the field), but it can also be done directly by the splitter if its exact name is known in OZmap.
API
The next step is to figure out how the requests for reading and updating the current power of splitters should be made. Below is an example:
Given the field technician’s coordinates, for this example, let's assume the coordinates are -27.57635071150383,-48.52777004241944
. First, we need to search for nearby boxes at this location.
With the coordinates -27.57635071150383,-48.52777004241944, you can also provide a search radius in meters, which in this example will be 100 meters. The search for nearby boxes in OZmap would be done as follows:
curl --location --request
GET 'https://sandbox.ozmap.com.br:9994/api/v2/ftth-viability/radius?lat=-27.57635071150383&lng=-48.52777004241944&radius=100' \
--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:
{
"viable": true,
"boxes": [
{
"distance": 53.62,
"name": "CTO - 7",
"id": "5da728dd11450e0006947cbb",
"project": "5d9f3ff9200141000647f814",
"lat": -27.576795302344355,
"lng": -48.5279792547226,
"boxTypeId": "589ddcf07dfe452f10d7c275",
"boxTypeCode": "CTO",
"certified": false,
"implanted": true,
"availability": 2,
"horizontal_condos": []
},
{
"distance": 55.41,
"name": "CTO - 8",
"id": "5da728e611450e0006947cc1",
"project": "5d9f3ff9200141000647f814",
"lat": -27.576139114160835,
"lng": -48.52726176381112,
"boxTypeId": "589ddcf07dfe452f10d7c275",
"boxTypeCode": "CTO",
"certified": false,
"implanted": true,
"availability": 3,
"horizontal_condos": []
},
{
"distance": 97.41,
"name": "CE - 7",
"id": "5da7248311450e0006947b3c",
"project": "5d9f3ff9200141000647f814",
"lat": -27.577115668156623,
"lng": -48.52824948728086,
"boxTypeId": "589ddcf07dfe452f10d7c274",
"boxTypeCode": "CE",
"certified": false,
"implanted": true,
"availability": 7,
"horizontal_condos": []
}
],
"refused_boxes": [
{
"distance": 91.85,
"name": "CE - 1",
"id": "5da61dbc493d9c000666542d",
"project": "5d9f3ff9200141000647f814",
"lat": -27.577128322016065,
"lng": -48.52745890617371,
"boxTypeId": "589ddcf07dfe452f10d7c274",
"boxTypeCode": "CE",
"certified": false,
"implanted": true,
"reasons": [
{
"reason": 1
}
],
"horizontal_condos": []
}
],
"properties": []
}
From this response, as an example, we determine that the box where the splitter to be updated is located is Enclosure - 7
.
The next step is to search for the splitters inside this box in OZmap, using the id attribute of Enclosure - 7
, which is 5da728dd11450e0006947cbb
. With the id 5da728dd11450e0006947cbb
, the search for the splitters in this box in OZmap is done as follows:
curl --location --request
GET 'https://sandbox.ozmap.com.br:9994/api/v2/splitters?filter=[{"property": "parent", "operator": "=", "value":"5da728dd11450e0006947cbb"}]' \
--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:
Of this response, we assume that the splitter to be updated is Splitter 1
.
To modify the current power level of this splitter, the update should be made using the id
attribute of the splitter, which in this example has the value 5da728dd11450e0006947cbf
.
With the id 5da728dd11450e0006947cbf
, the update of the current power level for port 2 of this splitter 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 with a status of "204 No Content", indicating that the power update for the client was successful.