0% found this document useful (0 votes)
104 views6 pages

API - Cek ONT v2.1

Uploaded by

g4zerock
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
104 views6 pages

API - Cek ONT v2.1

Uploaded by

g4zerock
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

API – Cek ONT Documentation

Ver 2.1

API End Point http://172.16.1.25


Type REST

1. Authentication Token
SPECIFICATION
API Route /api/v2/auth/token
Method POST
Content Type application/json
Authentication Header Basic {username:password}

RESPONSE
Field Type Description
duration Integer Token Expiration Time in Seconds
token String Generated access token
token_type String Token type

RESULT
{
"duration": 3600,
"token": "eyJhbGciOiJIUzUxMiIsImV4cCI6MTYxNzU5OTgxNywiaWF0IjoxNjE3NTk2MjE3fQ.eyJ
1c2VybmFtZSI6ImZzbXlyZXAzIn0.iVO5yu_qA-
rtAp9SxoxTvS5Oab8uf0CxxhoEfgnRD4T94Z_hF81o0h327Dlp0K_f1DHenyE4h25kBlSvtXdqgQ",
"token_type": "bearer"
}

Page | 1
2. Command
SPECIFICATION
API Route /api/v2/command
Method POST
Content Type application/json
Authentication Header Bearer {token}

REQUEST PARAMETER
Field Type Description
Provide both customerID and commandName
customerID String Customer ID
commandName String Command name, list of possible
commands will be shown by going
to route /api/help

RESPONSE
Field Type Description
circuit_id String Return a Circuit ID of the customer
command String The command run on the device
command_return String The output of the command, new
lines are separated using ‘\n’
status String Shows whether the command is
executed in the device. And also
error messages
using String Will show whether SSH or Telnet is
used to access the device. Telnet
will only be used if SSH failed.
possible_commands String Returns a list of possible commands
and its description

Page | 2
RESULT
1. MacAddress
{
"result": [
{
"circuit_id": "CRT1234567899",
"command": "show mac gpon onu gpon-onu_1/1/6:15",
"command_return": "Total mac address : 1\nMac address Vlan Type
Port\t Vc \n-------------------------------
------------------------------------------------
\n9072.82dd.45e5 1491 Dynamic gpon-onu_1/1/6:15 vport 1 \n",
"status": "success",
"using": "SSH"
}
]
}

2. ONTConfiguration
{
"result": [
{
"circuit_id": "CRT1234567899",
"command": "sh run int gpon-onu_1/1/6:15",
"command_return": "\nLast login time is 04.05.2021-14:11:28-
UTC, 0 authentication failures happened s\nince that time.\ninterface gpon-
onu_1/1/6:15\n name 1/1/6:15 - CRT1234567899 – JOHN
DOE - TAMAN KANTOR\n JLN. TESTING\n description FOB-
100M - PROMO SPEED BOOST\n tcont 1 profile FOB-
100M\n gemport 1 tcont 1\n gemport 1 traffic-
limit upstream 100M downstream 100M \n service-port 1 vport 1 user-
vlan 1491 vlan 1491 \n!\nend\n",
"status": "success",
"using": "SSH"
}
]
}

3. ONTReboot
{
"result": [
{
"status": "success"
}
]
}

Page | 3
4. ONUInterfaceStatus
{
"result": [
{
"circuit_id": "CRT1234567899",
"command": "show gpon onu detail-info gpon-onu_1/1/6:15",
"command_return": "ONU interface: gpon-
onu_1/1/6:15\n Name: 1/1/6:15 - CRT1234567899 – John
Doe \n State: ready\n Admin state: enable\n Phase state:
working\n Serial number: ZTEGC8552253\n ONU Status: enable\n
Online Duration: 162h 00m 08s\n------------------------------------------
\n Authpass Time OfflineTime Cause\n 1 2021-03-
19 20:41:41 2021-03-19 21:21:07 Reboot \n 2 2021-03-
19 21:22:04 2021-03-19 21:29:38 DyingGasp \n 3 2021-03-
19 21:31:13 2021-03-28 14:11:54 DyingGasp \n 4 2021-03-
28 15:12:08 2021-03-29 15:37:49 DyingGasp \n 5 2021-03-
29 17:13:49 2021-03-29 20:29:19 DyingGasp \n 6 2021-03-
29 20:30:47 0000-00-00 00:00:00 \n 7 0000-00-
00 00:00:00 0000-00-00 00:00:00 \n 8 0000-00-
00 00:00:00 0000-00-00 00:00:00 \n 9 0000-00-
00 00:00:00 0000-00-00 00:00:00 \n 10 0000-00-
00 00:00:00 0000-00-00 00:00:00 \n",
"status": "success",
"using": "SSH"
}
]
}

5. PortStatus
{
"result": [
{
"circuit_id": "CRT1234567899",
"command": "show gpon remote-onu int eth gpon-onu_1/1/6:15",
"command_return": "Interface : eth_0/1\nSpeed status : full-
100\nOperate status : enable\nInterface : eth_0/2\nSpeed status : auto\nOpera
te status : disable\nInterface : eth_0/3\nSpeed status : auto\nOperate status
: disable\nInterface : eth_0/4\nSpeed status : auto\nOperate status : disabl
e\n",
"status": "success",
"using": "SSH"
}
]
}

Page | 4
6. RxPower

{
"result": [
{
"circuit_id": "CRT1234567899",
"command": "show pon power onu-rx gpon-onu_1/1/6:15",
"command_return": "-19.546(dbm)",
"status": "success",
"using": "SSH"
}
]
}

7. Temperature
{
"result": [
{
"circuit_id": "CRT1234567899",
"command": "sh temp",
"command_return": "50.773 C",
"status": "success",
"using": "SSH"
}
]
}

3. Help
SPECIFICATION
API Route /api/help
Method GET
Content Type application/json
Authentication Header Bearer {token}

RESPONSE
Field Type Description
possible_commands String Returns a list of possible
commands and its description

RESULT

Page | 5
{
"possible_commands": {
"MacAddress": "get device mac address",
"ONTConfiguration": "get ONT Configuration",
"ONTReboot": "Reboot ONT",
"ONUInterfaceStatus": "check Onu Interface status",
"PortStatus": "check port status",
"RxPower": "gets rx power",
"Temperature": "get temperature of ONT"
}
}

!END OF DOCUMENT

Page | 6

You might also like