api:zerotier:networklist
Table of Contents
API : ZeroTier : List networks
Introduction
This API will return a list of the networks a customer has.
Request
| URL | https://api.telecomx.dk/zerotier/network | |
|---|---|---|
| Method | GET | |
| Access level | VIEWER, MAMAGER or OWNER that belongs to the customer RESELLER, RESELLER_ADMIN for the customer or ADMIN |
|
| Query | offset | Index of first item to return, default 0. |
| limit | Number of items to return at most, default 100. | |
| filter | Search for network id or name. | |
| customer | Id of customer to show networks for, default to own customer. | |
| full | True to show full data, instead of only id and name. | |
Query example
https://api.telecomx.dk/zerotier/network?customer=12345678901234567890ABCD https://api.telecomx.dk/zerotier/network?customer=12345678901234567890ABCD&full=true
Response (normal)
| Field | Type | Description |
|---|---|---|
| offset | Number | Index of first item returned. |
| limit | Number | Number of items returned at most. |
| total | Number | Total number of items available. |
| networks | Array | List of networks. |
| networks[]._id | String | Id of the network. |
| networks[].name | String | Name of the network. |
| networks[].members | Number | Number of members. |
Example
{ offset: 0, limit: 100, total: 10, networks: [ { _id: '1354878985858956', name: 'Server network', members: 13 }, { ... } ] }
Response (full=true)
Like normal response, but where each network contains the following:
| Field | Type | Description |
|---|---|---|
| _id | String | Id of the network. |
| name | String | Name of network. |
| members | Number | Number of members. |
| customer | Id | Id of customer. |
| notes | String | Optional notes about the network. |
| rawRules | string | Firewall rules in uncompiled format. |
| creationTime | Date | When the network was created. |
| dns | Object | DNS settings. |
| dns.domain | String | Search domain for DNS. |
| dns.servers | Array | List of IP addresses of DNS servers to use. |
| enableBroadcast | Boolean | True to enable broadcast traffic. |
| ipAssignmentPools | Array | IP address ranges to assign from. |
| ipAssignmentPools[].ipRangeStart | String | First IP address to assign from. |
| ipAssignmentPools[].ipRangeEnd | String | Last IP address to assign from. |
| mtu | Number | MTU size, default 2800. |
| multicastLimit | Number | Multicast limit, default 32. |
| routes | Array | List of routes and their gateway. |
| routes[].target | String | IP/subnet that is reachable via the network. |
| routes[].via | String | Default gateway IP address to reach the network. |
| rules | Array | List of firewall rules. |
| rules[].ip | String | IP or IP/subnet to match against. |
| rules[].etherType | String | Ethernet type to match. |
| rules[].not | Boolean | True if this shall not match. |
| rules[].or | Boolean | True if this is an or to the previous rule. |
| rules[].type | String | Type of match or action to execute. |
| v4AssignMode | Object | IPv4 assignment mode. |
| v4AssignMode.zt | Boolean | True if ZeroTier shall assign an IPv4 address. |
| v6AssignMode | Object | IPv6 assignment mode. |
| v6AssignMode.6plane | Boolean | Assign IP according to 6-plane. |
| v6AssignMode.rfc4193 | Boolean | Assign IP according to RFC4193. |
| v6AssignMode.zt | Boolean | True if ZeroTier shall assign an IPv6 address. |
Example
{ offset: 0, limit: 100, total: 10, networks: [ { _id: '1354878985858956', name: 'Server network', members: 13, customer: '12345678901234567890ABCD', notes: 'Our primary net', rawRules: 'drop not ethertype ipv4 and not ethertype arp and not ethertype ipv6;\naccept;\n', creationTime: '2022-01-01T00:00:00.000Z', dns: { domain: 'ourdomain.com', servers: [ '8.8.8.8', '8.8.4.4' ] }, enableBroadcast: true, ipAssignmentPools: [ { ipRangeStart: '192.168.100.1', ipRangeEnd: '192.168.100.254' } ], mtu: 2800, multicastLimit: 32, routes: [ { target: '192.168.100.0/24', via: null }, { target: '192.168.90.0/24', via: '192.168.100.1' } ], rules: [ { etherType: 2048, not: true, or: false, type: 'MATCH_ETHERTYPE' }, { etherType: 2054, not: true, or: false, type: 'MATCH_ETHERTYPE' }, { etherType: 34525, not: true, or: false, type: 'MATCH_ETHERTYPE' }, { type: 'ACTION_DROP' }, { type: 'ACTION_ACCEPT' } ] }, { ... } ] }
Errors
| Error code | Message | Description |
|---|---|---|
| 403 | access_denied | Access denied |
| 500 | internal_error | <Unspecified> |
api/zerotier/networklist.txt · Last modified: 2022/12/12 10:13 by Per Møller