Skip to content

Commit 4864877

Browse files
author
André Gaul
committed
link.alias -> link.alias_local, link.alias_remote
Closes #2.
1 parent 8da6af2 commit 4864877

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

doc-api-router.md

+16-12
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,12 @@ curl -X DELETE http://libremap.net/api/router/d3e7183695687af88617e253d702ccf6
4747
* `lon`: (required, number) longitude in degrees, range [-180,180], EPSG:3857.
4848
* `elev`: (optional, number) elevation in meters above mean sea level.
4949
* `aliases`: (optional, array): each element is an object with the following keys:
50+
* `type`: (required, string) this value may, for example, describe the routing protocol where the router is known under this alias, see the [example](#json-example) below.
5051
* `alias`: (required, string): alias name under which the router is known (for example in OLSR- or BATMAN-networks). Note that MAC-addresses or other information may be stored here. You may want to use a hash of MAC-addresses for privacy reasons. If you do that, just make sure that the same hash function is used for the `links`, see below.
51-
* `type`: (optional, string) this value may, for example, describe the routing protocol where the router is known under this alias, see the [example](#json-example) below.
5252
* `links`: (optional, array) each element is an object with the following keys:
53-
* `alias`: (required, string) an alias name of the remote router.
54-
* `type`: (optional, string) the alias type of the remote router, see `aliases` above.
53+
* `type`: (required, string) the alias type of the remote router, see `aliases` above.
54+
* `alias_local`: (required, string) an alias name of this router (the `alias`-`type` pair should also be contained in the `aliases` field).
55+
* `alias_remote`: (required, string) an alias name of the remote router.
5556
* `quality`: (optional, number) quality of the link, in range [0, 1] where 0 is the poorest and 1 is the best link quality.
5657
* `attributes`: (optional, object) you may store arbitrary information for a link here, e.g. link information that depends on the routing protocol (like LQ, NLQ and ETX values in OLSR).
5758
* `site`: (optional, string) a site this router belongs to, e.g. `"roof town hall"`.
@@ -73,22 +74,24 @@ curl -X DELETE http://libremap.net/api/router/d3e7183695687af88617e253d702ccf6
7374
"elev": 50,
7475
"aliases": [
7576
{
76-
"alias": "104.201.0.29",
77-
"type": "olsr"
77+
"type": "olsr",
78+
"alias": "104.201.0.29"
79+
7880
},
7981
{
80-
"alias": "awesome-router.olsr",
81-
"type": "olsr"
82+
"type": "olsr",
83+
"alias": "awesome-router.olsr"
8284
},
8385
{
84-
"alias": "21:13:f1:a5:a2:20",
85-
"type": "batman-adv"
86+
"type": "batman-adv",
87+
"alias": "21:13:f1:a5:a2:20"
8688
}
8789
],
8890
"links": [
8991
{
90-
"alias": "104.201.0.64",
9192
"type": "olsr",
93+
"alias_local": "104.201.0.29",
94+
"alias_remote": "104.201.0.64",
9295
"quality": 0.78,
9396
"attributes": {
9497
"etx": 2.094,
@@ -97,8 +100,9 @@ curl -X DELETE http://libremap.net/api/router/d3e7183695687af88617e253d702ccf6
97100
}
98101
},
99102
{
100-
"alias": "52:23:61:a7:a1:56",
101103
"type": "batman-adv",
104+
"alias_local":"21:13:f1:a5:a2:20",
105+
"alias_remote": "52:23:61:a7:a1:56",
102106
"quality": 0.78
103107
}
104108
],
@@ -166,7 +170,7 @@ When querying for a large set of given keys a POST request should be used with t
166170

167171
#### By alias
168172

169-
A [Standard view](#standard-views) where the keys are objects with the fields `alias` and `type`, e.g. `{"alias":"awesome-router","type":"olsr"}`.
173+
A [Standard view](#standard-views) where the keys are objects with the fields `alias` and `type`, e.g. `{"type":"olsr", "alias":"awesome-router"}`.
170174

171175
#### Coarse
172176

0 commit comments

Comments
 (0)