Retrieving OLT, Slot, and PON data from splitters
The OLT, Slot and PON data are located in the olt
, slot
, and pon
properties of a Splitter. There are two main approaches to retrieve this data:
Direct Retrieval by IDs: In this method, Slot and PON data are obtained using the IDs present in the Splitter's properties.
Search with a populate query: This method involves using the
populate
query to fetch Slot and PON data directly in the Splitter request.
Example
1. Direct Retrieval by IDs
To retrieve Slot and PON data, you can use the IDs present in the slot
and pon
properties of the Splitter. Below is a practical example using a Splitter with ID 5da7248311450e0006947b40
:
"isBalanced": true,
"orientation": "right",
"implanted": true,
"isDrop": true,
"kind": "Splitter",
"parent": "5da7248311450e0006947b3c",
"project": "5d9f3ff9200141000647f814",
"name": "Splitter 1",
"splitterType": "5b74204cffd4524508626953",
"connectables": {
"input": [
"5da724b3f003e83fc000001b"
],
"output": [
"646fbbdb48566b0020b1af68",
null,
null,
null,
null,
null,
null,
null
],
"id": "6784fec0de2d97f2805bacfe"
},
"ratio": {
"output": 8,
"input": 1,
"id": "6784fec0de2d97f2805bacff"
},
"createdAt": "2019-10-16T14:09:07.809Z",
"updatedAt": "2024-11-07T23:58:08.703Z",
"olt": "5da61f6a493d9c000666552f",
"pon": "5da722ef11450e0006947ab8",
"slot": "5da722ef11450e0006947ab0",
"id": "5da7248311450e0006947b40"
...
}
Retrieving OLT data
To fetch the OLT data, send the following request to the olts
endpoint for the ID 5da61f6a493d9c000666552f
:
curl --location -g --request GET 'https://example.ozmap.com.br:9994/api/v2/olts/5da61f6a493d9c000666552f
--header 'Authorization: <API Key>' \
The expected response is:
{
"label": "4444",
"port": 22,
"connectables": [
"5da61f6a493d9c000666552e",
"5da61f6a493d9c0006665533",
"5da722ef11450e0006947aaf"
],
"attenuation": [],
"implanted": true,
"isDrop": false,
"kind": "OLT",
"parent": "5da61d35493d9c0006665404",
"project": "5d9f3ff9200141000647f814",
"oltType": "5cb5d737aacc5e394036ce92",
"name": "OLT 1",
"user": "",
"ip": "192.168.0.2",
"password": "",
"createdAt": "2019-10-15T19:35:06.989Z",
"updatedAt": "2024-12-07T20:55:47.227Z",
"index": 1,
"shelf": "5da61f5a493d9c000666552d",
"size": 1,
"id": "5da61f6a493d9c000666552f"
}
Retrieving Slot data
To fetch the Slot data, send the following request to the slots
endpoint for the ID 5da722ef11450e0006947ab0
:
The expected response is:
Here, the name
property refers to the Slot port (in this case, port 2), and starting_pon_number
indicates the starting PON port (starting at 1).
Retrieving PON data
To fetch the PON data, send the following request to the pons
endpoint for the ID 5da722ef11450e0006947ab8
:
The expected response is:
Here, the name
property refers to the PON port (in this case, port 2).
Based on the information gathered, we can conclude that the Splitter with ID 5da7248311450e0006947b40
is connected to the OLT named "OLT 1", on Slot number 2 and PON port number 2.
2. Search with a populate query
Alternatively, you can use the populate
query to fetch the OLT, Slot and PON data directly in the Splitter request. For the Splitter ID 5da7248311450e0006947b40
, the request would be:
The expected response is:
In the response, the olt, slot, and pon data are returned together, providing a more practical view. It can be observed that the Splitter is connected to the OLT named "OLT 1," and it is also possible to see from the name
property in the slot and PON that the Splitter is connected to Slot number 2 and PON port number 2.