Os dados de Slot e PON estão presentes nas propriedades The OLT, Slot and PON data are located in the olt
, slot
e pon
de um Splitter. Existem duas abordagens principais para realizar essa busca por esses dados:
Busca Direta pelos IDs: Nesta abordagem, os dados de Slot e PON são obtidos utilizando os IDs presentes nas propriedades do Splitter.
Busca com query populate: Nesta abordagem, a query
populate
é utilizada para obter os dados de Slot e PON diretamente na chamada para o Splitter.
➡️ Exemplo
1. Busca Direta pelos IDs
Para buscar os dados de Slot e PON, pode-se utilizar os IDs presentes nas propriedades slot
e pon
do Splitter. Abaixo, será apresentado um exemplo prático utilizando um Splitter com o ID 5da7248311450e0006947b40
., 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
:
Code Block | ||
---|---|---|
| ||
"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" ... } |
Buscando de dados do Slot
...
Retrieving OLT data
To fetch the OLT data, send the following request to the olts
endpoint for the ID 5da61f6a493d9c000666552f
:
Code Block | ||
---|---|---|
| ||
curl --location -g --request GET 'https://example.ozmap.com.br:9994/api/v2/slotsolts/5da722ef11450e0006947ab05da61f6a493d9c000666552f --header 'Authorization: <API Key>' \ |
A resposta esperada para essa chamada é:The expected response is:
Code Block | ||
---|---|---|
| ||
{ "label": "4444", "connectablesport": [ 22, "5da722ef11450e0006947aafconnectables",: [ "5da722ef11450e0006947ab35da61f6a493d9c000666552e", "5da722ef11450e0006947ab75da61f6a493d9c0006665533", "5da722f011450e0006947abb5da722ef11450e0006947aaf", ], "5da722f011450e0006947abfattenuation": [], "implanted": true, "5da722f011450e0006947ac3isDrop": false, "kind": "5da722f011450e0006947ac7OLT", "parent": "5da722f011450e0006947acb5da61d35493d9c0006665404", "5da722f011450e0006947acf"project": "5d9f3ff9200141000647f814", "oltType": "5cb5d737aacc5e394036ce92", "5da722f011450e0006947ad3name",: "OLT 1", "user": "5da722f011450e0006947ad7", "5da722f011450e0006947adb"ip": "192.168.0.2", "password": "5da722f011450e0006947adf" ], "attenuationcreatedAt": []"2019-10-15T19:35:06.989Z", "implantedupdatedAt": true"2024-12-07T20:55:47.227Z", "isDropindex": false1, "kindshelf": "Slot5da61f5a493d9c000666552d", "namesize": "2"1, "parentid": "5da61d35493d9c0006665404", "project": "5d9f3ff9200141000647f814", "createdAt": "2019-10-16T14:02:23.868Z5da61f6a493d9c000666552f" } |
Retrieving Slot data
To fetch the Slot data, send the following request to the slots
endpoint for the ID 5da722ef11450e0006947ab0
:
Code Block | ||
---|---|---|
| ||
curl --location -g --request GET 'https://example.ozmap.com.br:9994/api/v2/slots/5da722ef11450e0006947ab0
--header 'Authorization: <API Key>' \ |
The expected response is:
Code Block | ||
---|---|---|
| ||
{ "label": "", "updatedAtconnectables": [ "2024-08-16T13:09:50.253Z", "5da722ef11450e0006947aaf", "starting_pon_number": 1, "5da722ef11450e0006947ab3", "olt": "5da61f6a493d9c000666552f5da722ef11450e0006947ab7", "id5da722f011450e0006947abb":, "5da722ef11450e0006947ab0" } |
Na resposta, a propriedade name
refere-se à porta do Slot (neste caso, porta 2) e starting_pon_number
indica a porta inicial do PON (iniciando em 1).
Buscando de dados do PON
...
"5da722f011450e0006947abf",
"5da722f011450e0006947ac3",
"5da722f011450e0006947ac7",
"5da722f011450e0006947acb",
"5da722f011450e0006947acf",
"5da722f011450e0006947ad3",
"5da722f011450e0006947ad7",
"5da722f011450e0006947adb",
"5da722f011450e0006947adf"
],
"attenuation": [],
"implanted": true,
"isDrop": false,
"kind": "Slot",
"name": "2",
"parent": "5da61d35493d9c0006665404",
"project": "5d9f3ff9200141000647f814",
"createdAt": "2019-10-16T14:02:23.868Z",
"updatedAt": "2024-08-16T13:09:50.253Z",
"starting_pon_number": 1,
"olt": "5da61f6a493d9c000666552f",
"id": "5da722ef11450e0006947ab0"
} |
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
:
Code Block | ||
---|---|---|
| ||
curl --location -g --request GET 'https://example.ozmap.com.br:9994/api/v2/pons/5da722ef11450e0006947ab8 --header 'Authorization: <API Key>' \ |
A resposta esperada para essa chamada éThe expected response is:
Code Block | ||
---|---|---|
| ||
{ "connectables": [ "5da722ef11450e0006947ab7", "66bf500450ce3b0014a52913" ], "maximumClients": null, "label": "", "attenuation": [], "implanted": true, "isDrop": false, "kind": "PON", "name": "2", "parent": "5da61d35493d9c0006665404", "project": "5d9f3ff9200141000647f814", "potency": 2, "createdAt": "2019-10-16T14:02:23.973Z", "updatedAt": "2024-08-16T13:11:32.332Z", "olt": "5da61f6a493d9c000666552f", "slot": "5da722ef11450e0006947ab0", "id": "5da722ef11450e0006947ab8" } |
Assim como no Slot, a propriedade name
refere-se à porta do PON (neste caso, porta 2)
Com as informações obtidas, podemos concluir que o Splitter com ID 5da7248311450e0006947b40
está conectado ao Slot de número 2 e à porta PON de número 2.
2. Busca com query populate
Outra forma de obter os dados de Slot e PON é utilizando a query populate
na chamada para buscar os dados do Splitter. Para o Splitter com ID 5da7248311450e0006947b40
, a chamada seriaHere, 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:
Code Block | ||
---|---|---|
| ||
curl --location -g --request GET 'https://example.ozmap.com.br:9994/api/v2/splitters/5da7248311450e0006947b40?populate=olt slot pon --header 'Authorization: <API Key>' \ |
...
The expected response is:
Code Block | ||
---|---|---|
| ||
{ ... "isBalanced": true, "orientation": "right", "implanted": true, "isDrop": true, "kind": "Splitter", "parent": "5da7248311450e0006947b3c", "project": "5d9f3ff9200141000647f814", "name": "Splitter 1", "splitterType": "5b74204cffd4524508626953", "createdAt": "2019-10-16T14:09:07.809Z", "updatedAt": "2024-11-07T23:58:08.703Z", "olt": { "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" }, "pon": { "connectables": [ "5da722ef11450e0006947ab7", "66bf500450ce3b0014a52913" ], "maximumClients": null, "label": "", "attenuation": [], "implanted": true, "isDrop": false, "kind": "PON", "name": "2", "parent": "5da61d35493d9c0006665404", "project": "5d9f3ff9200141000647f814", "potency": 2, "createdAt": "2019-10-16T14:02:23.973Z", "updatedAt": "2024-08-16T13:11:32.332Z", "olt": "5da61f6a493d9c000666552f", "slot": "5da722ef11450e0006947ab0", "id": "5da722ef11450e0006947ab8" }, "slot": { "label": "", "connectables": [ "5da722ef11450e0006947aaf", "5da722ef11450e0006947ab3", "5da722ef11450e0006947ab7", "5da722f011450e0006947abb", "5da722f011450e0006947abf", "5da722f011450e0006947ac3", "5da722f011450e0006947ac7", "5da722f011450e0006947acb", "5da722f011450e0006947acf", "5da722f011450e0006947ad3", "5da722f011450e0006947ad7", "5da722f011450e0006947adb", "5da722f011450e0006947adf" ], "attenuation": [], "implanted": true, "isDrop": false, "kind": "Slot", "name": "2", "parent": "5da61d35493d9c0006665404", "project": "5d9f3ff9200141000647f814", "createdAt": "2019-10-16T14:02:23.868Z", "updatedAt": "2024-08-16T13:09:50.253Z", "starting_pon_number": 1, "olt": "5da61f6a493d9c000666552f", "id": "5da722ef11450e0006947ab0" }, "id": "5da7248311450e0006947b40" } |
Na resposta, os dados de In the response, the olt, slot e pon
são retornados juntos, permitindo uma visualização mais prática. Pode-se observar que o Splitter possui conexão com a OLT de nome “OLT 1” e etiqueta “4444”, e também é possível observar a partir da propriedade name
presente no slot e PON, que o Splitter está conectado ao Slot de número 2 e à porta PON de número , 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.