diff --git a/generator/api-back.mdx b/generator/api-back.mdx deleted file mode 100644 index 6e2d24d2..00000000 --- a/generator/api-back.mdx +++ /dev/null @@ -1,5333 +0,0 @@ ---- -id: usage -slug: /usage -title: Usage -toc_max_heading_level: 3 ---- - - - - -API to manipulate groups, rules, policies and retrieve information about peers and users - - - - - - -## Users [#users] - -Interact with and view information about users. - - - - - -### Retrieve Users [#retrieve-users] - -``` -GET https://api.netbird.io/api/users -``` - - - - - - - - - - - - - - -#### Responses - - - - - -A JSON array of Users - - - - -```json -{ - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/User" - } - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Create a User [#create-a-user] - -``` -POST https://api.netbird.io/api/users -``` - - - - - - - - - - - -#### Body Parameters - -```json -{ - "schema": { - "$ref": "#/components/schemas/UserCreateRequest" - } -} -``` - - - - -#### Responses - - - - - -A User object - - - - -```json -{ - "schema": { - "$ref": "#/components/schemas/User" - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Update a User [#update-a-user] - -``` -PUT https://api.netbird.io/api/users/{userId} -``` - - - - -#### Path Parameters - - - - - - - - - - -#### Body Parameters - -```json -{ - "schema": { - "$ref": "#/components/schemas/UserRequest" - } -} -``` - - - - -#### Responses - - - - - -A User object - - - - -```json -{ - "schema": { - "$ref": "#/components/schemas/User" - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Delete a User [#delete-a-user] - -``` -DELETE https://api.netbird.io/api/users/{userId} -``` - - - - -#### Path Parameters - - - - - - - - - - - - - -#### Responses - - - - - -Delete status code - - - - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### List all Tokens [#list-all-tokens] - -``` -GET https://api.netbird.io/api/users/{userId}/tokens -``` - - - - -#### Path Parameters - - - - - - - - - - - - - -#### Responses - - - - - -A JSON Array of PersonalAccessTokens - - - - -```json -{ - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PersonalAccessToken" - } - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Create a Token [#create-a-token] - -``` -POST https://api.netbird.io/api/users/{userId}/tokens -``` - - - - -#### Path Parameters - - - - - - - - - - -#### Body Parameters - -```json -{ - "schema": { - "$ref": "#/components/schemas/PersonalAccessTokenRequest" - } -} -``` - - - - -#### Responses - - - - - -The token in plain text - - - - -```json -{ - "schema": { - "$ref": "#/components/schemas/PersonalAccessTokenGenerated" - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Retrieve a Token [#retrieve-a-token] - -``` -GET https://api.netbird.io/api/users/{userId}/tokens/{tokenId} -``` - - - - -#### Path Parameters - - - - - - - - - - - - - -#### Responses - - - - - -A PersonalAccessTokens Object - - - - -```json -{ - "schema": { - "$ref": "#/components/schemas/PersonalAccessToken" - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Delete a Token [#delete-a-token] - -``` -DELETE https://api.netbird.io/api/users/{userId}/tokens/{tokenId} -``` - - - - -#### Path Parameters - - - - - - - - - - - - - -#### Responses - - - - - -Delete status code - - - - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - -## Peers [#peers] - -Interact with and view information about peers. - - - - - -### List all Peers [#list-all-peers] - -``` -GET https://api.netbird.io/api/peers -``` - - - - - - - - - - - - - - -#### Responses - - - - - -A JSON Array of Peers - - - - -```json -{ - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Peer" - } - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Retrieve a Peer [#retrieve-a-peer] - -``` -GET https://api.netbird.io/api/peers/{peerId} -``` - - - - -#### Path Parameters - - - - - - - - - - - - - -#### Responses - - - - - -A Peer object - - - - -```json -{ - "schema": { - "$ref": "#/components/schemas/Peer" - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Update a Peer [#update-a-peer] - -``` -PUT https://api.netbird.io/api/peers/{peerId} -``` - - - - -#### Path Parameters - - - - - - - - - - -#### Body Parameters - -```json -{ - "schema": { - "$ref": "#/components/schemas/peers_peerId_body" - } -} -``` - - - - -#### Responses - - - - - -A Peer object - - - - -```json -{ - "schema": { - "$ref": "#/components/schemas/Peer" - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Delete a Peer [#delete-a-peer] - -``` -DELETE https://api.netbird.io/api/peers/{peerId} -``` - - - - -#### Path Parameters - - - - - - - - - - - - - -#### Responses - - - - - -Delete status code - - - - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - -## Setup Keys [#setup-keys] - -Interact with and view information about setup keys. - - - - - -### List all Setup Keys [#list-all-setup-keys] - -``` -GET https://api.netbird.io/api/setup-keys -``` - - - - - - - - - - - - - - -#### Responses - - - - - -A JSON Array of Setup keys - - - - -```json -{ - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SetupKey" - } - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Create a Setup Key [#create-a-setup-key] - -``` -POST https://api.netbird.io/api/setup-keys -``` - - - - - - - - - - - -#### Body Parameters - -```json -{ - "schema": { - "$ref": "#/components/schemas/SetupKeyRequest" - } -} -``` - - - - -#### Responses - - - - - -A Setup Keys Object - - - - -```json -{ - "schema": { - "$ref": "#/components/schemas/SetupKey" - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Retrieve a Setup Key [#retrieve-a-setup-key] - -``` -GET https://api.netbird.io/api/setup-keys/{keyId} -``` - - - - -#### Path Parameters - - - - - - - - - - - - - -#### Responses - - - - - -A Setup Key object - - - - -```json -{ - "schema": { - "$ref": "#/components/schemas/SetupKey" - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Update a Setup Key [#update-a-setup-key] - -``` -PUT https://api.netbird.io/api/setup-keys/{keyId} -``` - - - - -#### Path Parameters - - - - - - - - - - -#### Body Parameters - -```json -{ - "schema": { - "$ref": "#/components/schemas/SetupKeyRequest" - } -} -``` - - - - -#### Responses - - - - - -A Setup Key object - - - - -```json -{ - "schema": { - "$ref": "#/components/schemas/SetupKey" - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - -## Groups [#groups] - -Interact with and view information about groups. - - - - - -### List all Groups [#list-all-groups] - -``` -GET https://api.netbird.io/api/groups -``` - - - - - - - - - - - - - - -#### Responses - - - - - -A JSON Array of Groups - - - - -```json -{ - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Group" - } - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Create a Group [#create-a-group] - -``` -POST https://api.netbird.io/api/groups -``` - - - - - - - - - - - -#### Body Parameters - -```json -{ - "schema": { - "$ref": "#/components/schemas/api_groups_body" - } -} -``` - - - - -#### Responses - - - - - -A Group Object - - - - -```json -{ - "schema": { - "$ref": "#/components/schemas/Group" - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Retrieve a Group [#retrieve-a-group] - -``` -GET https://api.netbird.io/api/groups/{groupId} -``` - - - - -#### Path Parameters - - - - - - - - - - - - - -#### Responses - - - - - -A Group object - - - - -```json -{ - "schema": { - "$ref": "#/components/schemas/Group" - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Update a Group [#update-a-group] - -``` -PUT https://api.netbird.io/api/groups/{groupId} -``` - - - - -#### Path Parameters - - - - - - - - - - -#### Body Parameters - -```json -{ - "schema": { - "$ref": "#/components/schemas/groups_groupId_body" - } -} -``` - - - - -#### Responses - - - - - -A Group object - - - - -```json -{ - "schema": { - "$ref": "#/components/schemas/Group" - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Delete a Group [#delete-a-group] - -``` -DELETE https://api.netbird.io/api/groups/{groupId} -``` - - - - -#### Path Parameters - - - - - - - - - - - - - -#### Responses - - - - - -Delete status code - - - - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - -## Rules [#rules] - -Interact with and view information about rules. - - - - - -### List all Rules [#list-all-rules] - -``` -GET https://api.netbird.io/api/rules -``` - - - - - - - - - - - - - - -#### Responses - - - - - -A JSON Array of Rules - - - - -```json -{ - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Rule" - } - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Create a Rule [#create-a-rule] - -``` -POST https://api.netbird.io/api/rules -``` - - - - - - - - - - - -#### Body Parameters - -```json -{ - "schema": { - "$ref": "#/components/schemas/api_rules_body" - } -} -``` - - - - -#### Responses - - - - - -A Rule Object - - - - -```json -{ - "schema": { - "$ref": "#/components/schemas/Rule" - } -} -``` - - - - - - - - -
- - - - -### Retrieve a Rule [#retrieve-a-rule] - -``` -GET https://api.netbird.io/api/rules/{ruleId} -``` - - - - -#### Path Parameters - - - - - - - - - - - - - -#### Responses - - - - - -A Rule object - - - - -```json -{ - "schema": { - "$ref": "#/components/schemas/Rule" - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Update a Rule [#update-a-rule] - -``` -PUT https://api.netbird.io/api/rules/{ruleId} -``` - - - - -#### Path Parameters - - - - - - - - - - -#### Body Parameters - -```json -{ - "schema": { - "$ref": "#/components/schemas/rules_ruleId_body" - } -} -``` - - - - -#### Responses - - - - - -A Rule object - - - - -```json -{ - "schema": { - "$ref": "#/components/schemas/Rule" - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Delete a Rule [#delete-a-rule] - -``` -DELETE https://api.netbird.io/api/rules/{ruleId} -``` - - - - -#### Path Parameters - - - - - - - - - - - - - -#### Responses - - - - - -Delete status code - - - - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - -## Policies [#policies] - -Interact with and view information about policies. - - - - - -### List all Policies [#list-all-policies] - -``` -GET https://api.netbird.io/api/policies -``` - - - - - - - - - - - - - - -#### Responses - - - - - -A JSON Array of Policies - - - - -```json -{ - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Policy" - } - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Create a Policy [#create-a-policy] - -``` -POST https://api.netbird.io/api/policies -``` - - - - - - - - - - - -#### Body Parameters - -```json -{ - "schema": { - "$ref": "#/components/schemas/api_policies_body" - } -} -``` - - - - -#### Responses - - - - - -A Policy Object - - - - -```json -{ - "schema": { - "$ref": "#/components/schemas/Policy" - } -} -``` - - - - - - - - -
- - - - -### Retrieve a Policy [#retrieve-a-policy] - -``` -GET https://api.netbird.io/api/policies/{policyId} -``` - - - - -#### Path Parameters - - - - - - - - - - - - - -#### Responses - - - - - -A Policy object - - - - -```json -{ - "schema": { - "$ref": "#/components/schemas/Policy" - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Update a Policy [#update-a-policy] - -``` -PUT https://api.netbird.io/api/policies/{policyId} -``` - - - - -#### Path Parameters - - - - - - - - - - -#### Body Parameters - -```json -{ - "schema": { - "$ref": "#/components/schemas/policies_policyId_body" - } -} -``` - - - - -#### Responses - - - - - -A Policy object - - - - -```json -{ - "schema": { - "$ref": "#/components/schemas/Policy" - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Delete a Policy [#delete-a-policy] - -``` -DELETE https://api.netbird.io/api/policies/{policyId} -``` - - - - -#### Path Parameters - - - - - - - - - - - - - -#### Responses - - - - - -Delete status code - - - - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - -## Routes [#routes] - -Interact with and view information about routes. - - - - - -### List all Routes [#list-all-routes] - -``` -GET https://api.netbird.io/api/routes -``` - - - - - - - - - - - - - - -#### Responses - - - - - -A JSON Array of Routes - - - - -```json -{ - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Route" - } - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Create a Route [#create-a-route] - -``` -POST https://api.netbird.io/api/routes -``` - - - - - - - - - - - -#### Body Parameters - -```json -{ - "schema": { - "$ref": "#/components/schemas/RouteRequest" - } -} -``` - - - - -#### Responses - - - - - -A Route Object - - - - -```json -{ - "schema": { - "$ref": "#/components/schemas/Route" - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Retrieve a Route [#retrieve-a-route] - -``` -GET https://api.netbird.io/api/routes/{routeId} -``` - - - - -#### Path Parameters - - - - - - - - - - - - - -#### Responses - - - - - -A Route object - - - - -```json -{ - "schema": { - "$ref": "#/components/schemas/Route" - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Update a Route [#update-a-route] - -``` -PUT https://api.netbird.io/api/routes/{routeId} -``` - - - - -#### Path Parameters - - - - - - - - - - -#### Body Parameters - -```json -{ - "schema": { - "$ref": "#/components/schemas/RouteRequest" - } -} -``` - - - - -#### Responses - - - - - -A Route object - - - - -```json -{ - "schema": { - "$ref": "#/components/schemas/Route" - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Delete a Route [#delete-a-route] - -``` -DELETE https://api.netbird.io/api/routes/{routeId} -``` - - - - -#### Path Parameters - - - - - - - - - - - - - -#### Responses - - - - - -Delete status code - - - - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - -## DNS [#dns] - -Interact with and view information about DNS configuration. - - - - - -### List all Nameserver Groups [#list-all-nameserver-groups] - -``` -GET https://api.netbird.io/api/dns/nameservers -``` - - - - - - - - - - - - - - -#### Responses - - - - - -A JSON Array of Nameserver Groups - - - - -```json -{ - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/NameserverGroup" - } - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Create a Nameserver Group [#create-a-nameserver-group] - -``` -POST https://api.netbird.io/api/dns/nameservers -``` - - - - - - - - - - - -#### Body Parameters - -```json -{ - "schema": { - "$ref": "#/components/schemas/NameserverGroupRequest" - } -} -``` - - - - -#### Responses - - - - - -A Nameserver Groups Object - - - - -```json -{ - "schema": { - "$ref": "#/components/schemas/NameserverGroup" - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Retrieve a Nameserver Group [#retrieve-a-nameserver-group] - -``` -GET https://api.netbird.io/api/dns/nameservers/{nsgroupId} -``` - - - - -#### Path Parameters - - - - - - - - - - - - - -#### Responses - - - - - -A Nameserver Group object - - - - -```json -{ - "schema": { - "$ref": "#/components/schemas/NameserverGroup" - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Update a Nameserver Group [#update-a-nameserver-group] - -``` -PUT https://api.netbird.io/api/dns/nameservers/{nsgroupId} -``` - - - - -#### Path Parameters - - - - - - - - - - -#### Body Parameters - -```json -{ - "schema": { - "$ref": "#/components/schemas/NameserverGroupRequest" - } -} -``` - - - - -#### Responses - - - - - -A Nameserver Group object - - - - -```json -{ - "schema": { - "$ref": "#/components/schemas/NameserverGroup" - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Delete a Nameserver Group [#delete-a-nameserver-group] - -``` -DELETE https://api.netbird.io/api/dns/nameservers/{nsgroupId} -``` - - - - -#### Path Parameters - - - - - - - - - - - - - -#### Responses - - - - - -Delete status code - - - - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Retrieve DNS Settings [#retrieve-dns-settings] - -``` -GET https://api.netbird.io/api/dns/settings -``` - - - - - - - - - - - - - - -#### Responses - - - - - -A JSON Object of DNS Setting - - - - -```json -{ - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DNSSettings" - } - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Update DNS Settings [#update-dns-settings] - -``` -PUT https://api.netbird.io/api/dns/settings -``` - - - - - - - - - - - -#### Body Parameters - -```json -{ - "schema": { - "$ref": "#/components/schemas/DNSSettings" - } -} -``` - - - - -#### Responses - - - - - -A JSON Object of DNS Setting - - - - -```json -{ - "schema": { - "$ref": "#/components/schemas/DNSSettings" - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - -## Events [#events] - -View information about the account and network events. - - - - - -### List all Events [#list-all-events] - -``` -GET https://api.netbird.io/api/events -``` - - - - - - - - - - - - - - -#### Responses - - - - - -A JSON Array of Events - - - - -```json -{ - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Event" - } - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - -## Accounts [#accounts] - -View information about the accounts. - - - - - -### List all Accounts [#list-all-accounts] - -``` -GET https://api.netbird.io/api/accounts -``` - - - - - - - - - - - - - - -#### Responses - - - - - -A JSON array of accounts - - - - -```json -{ - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Account" - } - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- - - - -### Update an Account [#update-an-account] - -``` -PUT https://api.netbird.io/api/accounts/{accountId} -``` - - - - -#### Path Parameters - - - - - - - - - - -#### Body Parameters - -```json -{ - "schema": { - "$ref": "#/components/schemas/accounts_accountId_body" - } -} -``` - - - - -#### Responses - - - - - -An Account object - - - - -```json -{ - "schema": { - "$ref": "#/components/schemas/Account" - } -} -``` - - - - - - - - -Bad Request - - - - - - - - - - - -Requires authentication - - - - - - - - - - - -Forbidden - - - - - - - - - - - -Internal Server Error - - - - - - - - - - - -
- diff --git a/generator/api.mdx b/generator/api.mdx deleted file mode 100644 index f6b0e208..00000000 --- a/generator/api.mdx +++ /dev/null @@ -1,4425 +0,0 @@ - - - -# Users - -Interact with and view information about users. - ---- - - - -## Retrieve Users {{ tag: 'GET' , label: '/api/users' }} - - - - Returns a list of all users - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/users \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \ -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -[ - { - "id": "string", - "email": "string", - "name": "string", - "role": "string", - "status": "string", - "auto_groups": [ - "string" - ], - "is_current": "boolean", - "is_service_user": "boolean" - } -] -``` - - - - - - - - - ---- - - -## Create a User {{ tag: 'POST' , label: '/api/users' }} - - - - Creates a new service user or sends an invite to a regular user - - #### Request-Body Parameters - - - - User's Email to send invite to - - - - User's full name - - - - User's NetBird account role - - - - Groups to auto-assign to peers registered by this user - - - - Is true if this user is a service user - - - - - - -```bash {{ title: 'cURL' }} -curl -X POST https://api.netbird.io/api/users \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \-H 'Content-Type: application/json' \ ---data-raw '{ - "email": "string", - "name": "string", - "role": "string", - "auto_groups": [ - "string" - ], - "is_service_user": "boolean" -}' -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -{ - "id": "string", - "email": "string", - "name": "string", - "role": "string", - "status": "string", - "auto_groups": [ - "string" - ], - "is_current": "boolean", - "is_service_user": "boolean" -} -``` - - - - - - - - - ---- - - -## Update a User {{ tag: 'PUT' , label: '/api/users/{userId}' }} - - - - Update information about a User - - #### Path Parameters - - - - The unique identifier of a user - - - - #### Request-Body Parameters - - - - User's NetBird account role - - - - Groups to auto-assign to peers registered by this user - - - - - - -```bash {{ title: 'cURL' }} -curl -X PUT https://api.netbird.io/api/users/{userId} \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \-H 'Content-Type: application/json' \ ---data-raw '{ - "role": "string", - "auto_groups": [ - "string" - ] -}' -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -{ - "id": "string", - "email": "string", - "name": "string", - "role": "string", - "status": "string", - "auto_groups": [ - "string" - ], - "is_current": "boolean", - "is_service_user": "boolean" -} -``` - - - - - - - - - ---- - - -## Delete a User {{ tag: 'DELETE' , label: '/api/users/{userId}' }} - - - - Delete a User - - #### Path Parameters - - - - The unique identifier of a user - - - - - - -```bash {{ title: 'cURL' }} -curl -X DELETE https://api.netbird.io/api/users/{userId} \ --H "Authorization: Bearer {token}" \ - -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - - - - - ---- - - -## List all Tokens {{ tag: 'GET' , label: '/api/users/{userId}/tokens' }} - - - - Returns a list of all tokens for a user - - #### Path Parameters - - - - The unique identifier of a user - - - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/users/{userId}/tokens \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \ -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -[ - { - "id": "string", - "name": "string", - "expiration_date": "string", - "created_by": "string", - "created_at": "string", - "last_used": "string" - } -] -``` - - - - - - - - - ---- - - -## Create a Token {{ tag: 'POST' , label: '/api/users/{userId}/tokens' }} - - - - Create a new token for a user - - #### Path Parameters - - - - The unique identifier of a user - - - - #### Request-Body Parameters - - - - Name of the token - - - - Expiration in days - - - - - - -```bash {{ title: 'cURL' }} -curl -X POST https://api.netbird.io/api/users/{userId}/tokens \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \-H 'Content-Type: application/json' \ ---data-raw '{ - "name": "string", - "expires_in": "integer" -}' -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -{ - "plain_token": "string", - "personal_access_token": { - "id": "string", - "name": "string", - "expiration_date": "string", - "created_by": "string", - "created_at": "string", - "last_used": "string" - } -} -``` - - - - - - - - - ---- - - -## Retrieve a Token {{ tag: 'GET' , label: '/api/users/{userId}/tokens/{tokenId}' }} - - - - Returns a specific token for a user - - #### Path Parameters - - - - The unique identifier of a user - - - - The unique identifier of a token - - - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/users/{userId}/tokens/{tokenId} \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \ -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -{ - "id": "string", - "name": "string", - "expiration_date": "string", - "created_by": "string", - "created_at": "string", - "last_used": "string" -} -``` - - - - - - - - - ---- - - -## Delete a Token {{ tag: 'DELETE' , label: '/api/users/{userId}/tokens/{tokenId}' }} - - - - Delete a token for a user - - #### Path Parameters - - - - The unique identifier of a user - - - - The unique identifier of a token - - - - - - -```bash {{ title: 'cURL' }} -curl -X DELETE https://api.netbird.io/api/users/{userId}/tokens/{tokenId} \ --H "Authorization: Bearer {token}" \ - -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - - - - - ---- - - - -# Peers - -Interact with and view information about peers. - ---- - - - -## List all Peers {{ tag: 'GET' , label: '/api/peers' }} - - - - Returns a list of all peers - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/peers \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \ -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -[ - { - "id": "string", - "name": "string", - "ip": "string", - "connected": "boolean", - "last_seen": "string", - "os": "string", - "version": "string", - "groups": [ - { - "id": "string", - "name": "string", - "peers_count": "integer" - } - ], - "ssh_enabled": "boolean", - "user_id": "string", - "hostname": "string", - "ui_version": "string", - "dns_label": "string", - "login_expiration_enabled": "boolean", - "login_expired": "boolean", - "last_login": "string" - } -] -``` - - - - - - - - - ---- - - -## Retrieve a Peer {{ tag: 'GET' , label: '/api/peers/{peerId}' }} - - - - Get information about a peer - - #### Path Parameters - - - - The unique identifier of a peer - - - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/peers/{peerId} \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \ -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -{ - "id": "string", - "name": "string", - "ip": "string", - "connected": "boolean", - "last_seen": "string", - "os": "string", - "version": "string", - "groups": [ - { - "id": "string", - "name": "string", - "peers_count": "integer" - } - ], - "ssh_enabled": "boolean", - "user_id": "string", - "hostname": "string", - "ui_version": "string", - "dns_label": "string", - "login_expiration_enabled": "boolean", - "login_expired": "boolean", - "last_login": "string" -} -``` - - - - - - - - - ---- - - -## Update a Peer {{ tag: 'PUT' , label: '/api/peers/{peerId}' }} - - - - Update information about a peer - - #### Path Parameters - - - - The unique identifier of a peer - - - - #### Request-Body Parameters - - - - - - - - - - - - - - - - - - -```bash {{ title: 'cURL' }} -curl -X PUT https://api.netbird.io/api/peers/{peerId} \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \-H 'Content-Type: application/json' \ ---data-raw '{ - "name": "string", - "ssh_enabled": "boolean", - "login_expiration_enabled": "boolean" -}' -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -{ - "id": "string", - "name": "string", - "ip": "string", - "connected": "boolean", - "last_seen": "string", - "os": "string", - "version": "string", - "groups": [ - { - "id": "string", - "name": "string", - "peers_count": "integer" - } - ], - "ssh_enabled": "boolean", - "user_id": "string", - "hostname": "string", - "ui_version": "string", - "dns_label": "string", - "login_expiration_enabled": "boolean", - "login_expired": "boolean", - "last_login": "string" -} -``` - - - - - - - - - ---- - - -## Delete a Peer {{ tag: 'DELETE' , label: '/api/peers/{peerId}' }} - - - - Delete a peer - - #### Path Parameters - - - - The unique identifier of a peer - - - - - - -```bash {{ title: 'cURL' }} -curl -X DELETE https://api.netbird.io/api/peers/{peerId} \ --H "Authorization: Bearer {token}" \ - -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - - - - - ---- - - - -# Setup Keys - -Interact with and view information about setup keys. - ---- - - - -## List all Setup Keys {{ tag: 'GET' , label: '/api/setup-keys' }} - - - - Returns a list of all Setup Keys - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/setup-keys \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \ -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -[ - { - "id": "string", - "key": "string", - "name": "string", - "expires": "string", - "type": "string", - "valid": "boolean", - "revoked": "boolean", - "used_times": "integer", - "last_used": "string", - "state": "string", - "auto_groups": [ - "string" - ], - "updated_at": "string", - "usage_limit": "integer" - } -] -``` - - - - - - - - - ---- - - -## Create a Setup Key {{ tag: 'POST' , label: '/api/setup-keys' }} - - - - Creates a Setup Key - - #### Request-Body Parameters - - - - Setup Key name - - - - Setup key type, one-off for single time usage and reusable - - - - Expiration time in seconds - - - - Setup key revocation status - - - - Setup key groups to auto-assign to peers registered with this key - - - - A number of times this key can be used. The value of 0 indicates the unlimited usage. - - - - - - -```bash {{ title: 'cURL' }} -curl -X POST https://api.netbird.io/api/setup-keys \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \-H 'Content-Type: application/json' \ ---data-raw '{ - "name": "string", - "type": "string", - "expires_in": "integer", - "revoked": "boolean", - "auto_groups": [ - "string" - ], - "usage_limit": "integer" -}' -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -{ - "id": "string", - "key": "string", - "name": "string", - "expires": "string", - "type": "string", - "valid": "boolean", - "revoked": "boolean", - "used_times": "integer", - "last_used": "string", - "state": "string", - "auto_groups": [ - "string" - ], - "updated_at": "string", - "usage_limit": "integer" -} -``` - - - - - - - - - ---- - - -## Retrieve a Setup Key {{ tag: 'GET' , label: '/api/setup-keys/{keyId}' }} - - - - Get information about a Setup Key - - #### Path Parameters - - - - The unique identifier of a setup key - - - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/setup-keys/{keyId} \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \ -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -{ - "id": "string", - "key": "string", - "name": "string", - "expires": "string", - "type": "string", - "valid": "boolean", - "revoked": "boolean", - "used_times": "integer", - "last_used": "string", - "state": "string", - "auto_groups": [ - "string" - ], - "updated_at": "string", - "usage_limit": "integer" -} -``` - - - - - - - - - ---- - - -## Update a Setup Key {{ tag: 'PUT' , label: '/api/setup-keys/{keyId}' }} - - - - Update information about a Setup Key - - #### Path Parameters - - - - The unique identifier of a setup key - - - - #### Request-Body Parameters - - - - Setup Key name - - - - Setup key type, one-off for single time usage and reusable - - - - Expiration time in seconds - - - - Setup key revocation status - - - - Setup key groups to auto-assign to peers registered with this key - - - - A number of times this key can be used. The value of 0 indicates the unlimited usage. - - - - - - -```bash {{ title: 'cURL' }} -curl -X PUT https://api.netbird.io/api/setup-keys/{keyId} \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \-H 'Content-Type: application/json' \ ---data-raw '{ - "name": "string", - "type": "string", - "expires_in": "integer", - "revoked": "boolean", - "auto_groups": [ - "string" - ], - "usage_limit": "integer" -}' -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -{ - "id": "string", - "key": "string", - "name": "string", - "expires": "string", - "type": "string", - "valid": "boolean", - "revoked": "boolean", - "used_times": "integer", - "last_used": "string", - "state": "string", - "auto_groups": [ - "string" - ], - "updated_at": "string", - "usage_limit": "integer" -} -``` - - - - - - - - - ---- - - - -# Groups - -Interact with and view information about groups. - ---- - - - -## List all Groups {{ tag: 'GET' , label: '/api/groups' }} - - - - Returns a list of all Groups - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/groups \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \ -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -[ - { - "id": "string", - "name": "string", - "peers_count": "integer", - "peers": [ - { - "id": "string", - "name": "string" - } - ] - } -] -``` - - - - - - - - - ---- - - -## Create a Group {{ tag: 'POST' , label: '/api/groups' }} - - - - Creates a Group - - #### Request-Body Parameters - - - - - - - - - - - - - - -```bash {{ title: 'cURL' }} -curl -X POST https://api.netbird.io/api/groups \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \-H 'Content-Type: application/json' \ ---data-raw '{ - "name": "string", - "peers": [ - "string" - ] -}' -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -{ - "id": "string", - "name": "string", - "peers_count": "integer", - "peers": [ - { - "id": "string", - "name": "string" - } - ] -} -``` - - - - - - - - - ---- - - -## Retrieve a Group {{ tag: 'GET' , label: '/api/groups/{groupId}' }} - - - - Get information about a Group - - #### Path Parameters - - - - The unique identifier of a group - - - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/groups/{groupId} \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \ -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -{ - "id": "string", - "name": "string", - "peers_count": "integer", - "peers": [ - { - "id": "string", - "name": "string" - } - ] -} -``` - - - - - - - - - ---- - - -## Update a Group {{ tag: 'PUT' , label: '/api/groups/{groupId}' }} - - - - Update/Replace a Group - - #### Path Parameters - - - - The unique identifier of a group - - - - #### Request-Body Parameters - - - - - - - - - - - - - - -```bash {{ title: 'cURL' }} -curl -X PUT https://api.netbird.io/api/groups/{groupId} \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \-H 'Content-Type: application/json' \ ---data-raw '{ - "Name": "string", - "Peers": [ - "string" - ] -}' -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -{ - "id": "string", - "name": "string", - "peers_count": "integer", - "peers": [ - { - "id": "string", - "name": "string" - } - ] -} -``` - - - - - - - - - ---- - - -## Delete a Group {{ tag: 'DELETE' , label: '/api/groups/{groupId}' }} - - - - Delete a Group - - #### Path Parameters - - - - The unique identifier of a group - - - - - - -```bash {{ title: 'cURL' }} -curl -X DELETE https://api.netbird.io/api/groups/{groupId} \ --H "Authorization: Bearer {token}" \ - -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - - - - - ---- - - - -# Rules - -Interact with and view information about rules. - ---- - - - -## List all Rules {{ tag: 'GET' , label: '/api/rules' }} - - - - Returns a list of all Rules - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/rules \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \ -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -[ - { - "id": "string", - "name": "string", - "description": "string", - "disabled": "boolean", - "flow": "string", - "sources": [ - { - "id": "string", - "name": "string", - "peers_count": "integer" - } - ], - "destinations": [ - { - "id": "string", - "name": "string", - "peers_count": "integer" - } - ] - } -] -``` - - - - - - - - - ---- - - -## Create a Rule {{ tag: 'POST' , label: '/api/rules' }} - - - - Creates a Rule - - #### Request-Body Parameters - - - - - - - - - - - - - - -```bash {{ title: 'cURL' }} -curl -X POST https://api.netbird.io/api/rules \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \-H 'Content-Type: application/json' \ ---data-raw '{ - "name": "string", - "description": "string", - "disabled": "boolean", - "flow": "string", - "sources": [ - "string" - ], - "destinations": [ - "string" - ] -}' -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -{ - "id": "string", - "name": "string", - "description": "string", - "disabled": "boolean", - "flow": "string", - "sources": [ - { - "id": "string", - "name": "string", - "peers_count": "integer" - } - ], - "destinations": [ - { - "id": "string", - "name": "string", - "peers_count": "integer" - } - ] -} -``` - - - - - ---- - - -## Retrieve a Rule {{ tag: 'GET' , label: '/api/rules/{ruleId}' }} - - - - Get information about a Rules - - #### Path Parameters - - - - The unique identifier of a rule - - - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/rules/{ruleId} \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \ -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -{ - "id": "string", - "name": "string", - "description": "string", - "disabled": "boolean", - "flow": "string", - "sources": [ - { - "id": "string", - "name": "string", - "peers_count": "integer" - } - ], - "destinations": [ - { - "id": "string", - "name": "string", - "peers_count": "integer" - } - ] -} -``` - - - - - - - - - ---- - - -## Update a Rule {{ tag: 'PUT' , label: '/api/rules/{ruleId}' }} - - - - Update/Replace a Rule - - #### Path Parameters - - - - The unique identifier of a rule - - - - #### Request-Body Parameters - - - - - - - - - - - - - - -```bash {{ title: 'cURL' }} -curl -X PUT https://api.netbird.io/api/rules/{ruleId} \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \-H 'Content-Type: application/json' \ ---data-raw '{ - "name": "string", - "description": "string", - "disabled": "boolean", - "flow": "string", - "sources": [ - "string" - ], - "destinations": [ - "string" - ] -}' -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -{ - "id": "string", - "name": "string", - "description": "string", - "disabled": "boolean", - "flow": "string", - "sources": [ - { - "id": "string", - "name": "string", - "peers_count": "integer" - } - ], - "destinations": [ - { - "id": "string", - "name": "string", - "peers_count": "integer" - } - ] -} -``` - - - - - - - - - ---- - - -## Delete a Rule {{ tag: 'DELETE' , label: '/api/rules/{ruleId}' }} - - - - Delete a Rule - - #### Path Parameters - - - - The unique identifier of a rule - - - - - - -```bash {{ title: 'cURL' }} -curl -X DELETE https://api.netbird.io/api/rules/{ruleId} \ --H "Authorization: Bearer {token}" \ - -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - - - - - ---- - - - -# Policies - -Interact with and view information about policies. - ---- - - - -## List all Policies {{ tag: 'GET' , label: '/api/policies' }} - - - - Returns a list of all Policies - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/policies \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \ -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -[ - { - "name": "string", - "description": "string", - "enabled": "boolean", - "query": "string", - "rules": [ - { - "id": "string", - "name": "string", - "description": "string", - "enabled": "boolean", - "sources": [ - { - "id": "string", - "name": "string", - "peers_count": "integer" - } - ], - "destinations": [ - { - "id": "string", - "name": "string", - "peers_count": "integer" - } - ], - "action": "string" - } - ], - "id": "string" - } -] -``` - - - - - - - - - ---- - - -## Create a Policy {{ tag: 'POST' , label: '/api/policies' }} - - - - Creates a Policy - - #### Request-Body Parameters - - - - - - -```bash {{ title: 'cURL' }} -curl -X POST https://api.netbird.io/api/policies \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \-H 'Content-Type: application/json' \ ---data-raw '{ - "name": "string", - "description": "string", - "enabled": "boolean", - "query": "string", - "rules": [ - { - "id": "string", - "name": "string", - "description": "string", - "enabled": "boolean", - "sources": [ - { - "id": "string", - "name": "string", - "peers_count": "integer" - } - ], - "destinations": [ - { - "id": "string", - "name": "string", - "peers_count": "integer" - } - ], - "action": "string" - } - ] -}' -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -{ - "name": "string", - "description": "string", - "enabled": "boolean", - "query": "string", - "rules": [ - { - "id": "string", - "name": "string", - "description": "string", - "enabled": "boolean", - "sources": [ - { - "id": "string", - "name": "string", - "peers_count": "integer" - } - ], - "destinations": [ - { - "id": "string", - "name": "string", - "peers_count": "integer" - } - ], - "action": "string" - } - ], - "id": "string" -} -``` - - - - - ---- - - -## Retrieve a Policy {{ tag: 'GET' , label: '/api/policies/{policyId}' }} - - - - Get information about a Policies - - #### Path Parameters - - - - The unique identifier of a policy - - - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/policies/{policyId} \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \ -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -{ - "name": "string", - "description": "string", - "enabled": "boolean", - "query": "string", - "rules": [ - { - "id": "string", - "name": "string", - "description": "string", - "enabled": "boolean", - "sources": [ - { - "id": "string", - "name": "string", - "peers_count": "integer" - } - ], - "destinations": [ - { - "id": "string", - "name": "string", - "peers_count": "integer" - } - ], - "action": "string" - } - ], - "id": "string" -} -``` - - - - - - - - - ---- - - -## Update a Policy {{ tag: 'PUT' , label: '/api/policies/{policyId}' }} - - - - Update/Replace a Policy - - #### Path Parameters - - - - The unique identifier of a policy - - - - #### Request-Body Parameters - - - - - - -```bash {{ title: 'cURL' }} -curl -X PUT https://api.netbird.io/api/policies/{policyId} \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \-H 'Content-Type: application/json' \ ---data-raw '{ - "name": "string", - "description": "string", - "enabled": "boolean", - "query": "string", - "rules": [ - { - "id": "string", - "name": "string", - "description": "string", - "enabled": "boolean", - "sources": [ - { - "id": "string", - "name": "string", - "peers_count": "integer" - } - ], - "destinations": [ - { - "id": "string", - "name": "string", - "peers_count": "integer" - } - ], - "action": "string" - } - ] -}' -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -{ - "name": "string", - "description": "string", - "enabled": "boolean", - "query": "string", - "rules": [ - { - "id": "string", - "name": "string", - "description": "string", - "enabled": "boolean", - "sources": [ - { - "id": "string", - "name": "string", - "peers_count": "integer" - } - ], - "destinations": [ - { - "id": "string", - "name": "string", - "peers_count": "integer" - } - ], - "action": "string" - } - ], - "id": "string" -} -``` - - - - - - - - - ---- - - -## Delete a Policy {{ tag: 'DELETE' , label: '/api/policies/{policyId}' }} - - - - Delete a Policy - - #### Path Parameters - - - - The unique identifier of a policy - - - - - - -```bash {{ title: 'cURL' }} -curl -X DELETE https://api.netbird.io/api/policies/{policyId} \ --H "Authorization: Bearer {token}" \ - -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - - - - - ---- - - - -# Routes - -Interact with and view information about routes. - ---- - - - -## List all Routes {{ tag: 'GET' , label: '/api/routes' }} - - - - Returns a list of all routes - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/routes \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \ -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -[ - { - "id": "string", - "network_type": "string", - "description": "string", - "network_id": "string", - "enabled": "boolean", - "peer": "string", - "network": "string", - "metric": "integer", - "masquerade": "boolean", - "groups": [ - "string" - ] - } -] -``` - - - - - - - - - ---- - - -## Create a Route {{ tag: 'POST' , label: '/api/routes' }} - - - - Creates a Route - - #### Request-Body Parameters - - - - Route description - - - - Route network identifier, to group HA routes - - - - Route status - - - - Peer Identifier associated with route - - - - Network range in CIDR format - - - - Route metric number. Lowest number has higher priority - - - - Indicate if peer should masquerade traffic to this route's prefix - - - - Route group tag groups - - - - - - -```bash {{ title: 'cURL' }} -curl -X POST https://api.netbird.io/api/routes \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \-H 'Content-Type: application/json' \ ---data-raw '{ - "description": "string", - "network_id": "string", - "enabled": "boolean", - "peer": "string", - "network": "string", - "metric": "integer", - "masquerade": "boolean", - "groups": [ - "string" - ] -}' -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -{ - "id": "string", - "network_type": "string", - "description": "string", - "network_id": "string", - "enabled": "boolean", - "peer": "string", - "network": "string", - "metric": "integer", - "masquerade": "boolean", - "groups": [ - "string" - ] -} -``` - - - - - - - - - ---- - - -## Retrieve a Route {{ tag: 'GET' , label: '/api/routes/{routeId}' }} - - - - Get information about a Routes - - #### Path Parameters - - - - The unique identifier of a route - - - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/routes/{routeId} \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \ -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -{ - "id": "string", - "network_type": "string", - "description": "string", - "network_id": "string", - "enabled": "boolean", - "peer": "string", - "network": "string", - "metric": "integer", - "masquerade": "boolean", - "groups": [ - "string" - ] -} -``` - - - - - - - - - ---- - - -## Update a Route {{ tag: 'PUT' , label: '/api/routes/{routeId}' }} - - - - Update/Replace a Route - - #### Path Parameters - - - - The unique identifier of a route - - - - #### Request-Body Parameters - - - - Route description - - - - Route network identifier, to group HA routes - - - - Route status - - - - Peer Identifier associated with route - - - - Network range in CIDR format - - - - Route metric number. Lowest number has higher priority - - - - Indicate if peer should masquerade traffic to this route's prefix - - - - Route group tag groups - - - - - - -```bash {{ title: 'cURL' }} -curl -X PUT https://api.netbird.io/api/routes/{routeId} \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \-H 'Content-Type: application/json' \ ---data-raw '{ - "description": "string", - "network_id": "string", - "enabled": "boolean", - "peer": "string", - "network": "string", - "metric": "integer", - "masquerade": "boolean", - "groups": [ - "string" - ] -}' -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -{ - "id": "string", - "network_type": "string", - "description": "string", - "network_id": "string", - "enabled": "boolean", - "peer": "string", - "network": "string", - "metric": "integer", - "masquerade": "boolean", - "groups": [ - "string" - ] -} -``` - - - - - - - - - ---- - - -## Delete a Route {{ tag: 'DELETE' , label: '/api/routes/{routeId}' }} - - - - Delete a Route - - #### Path Parameters - - - - The unique identifier of a route - - - - - - -```bash {{ title: 'cURL' }} -curl -X DELETE https://api.netbird.io/api/routes/{routeId} \ --H "Authorization: Bearer {token}" \ - -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - - - - - ---- - - - -# DNS - -Interact with and view information about DNS configuration. - ---- - - - -## List all Nameserver Groups {{ tag: 'GET' , label: '/api/dns/nameservers' }} - - - - Returns a list of all Nameserver Groups - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/dns/nameservers \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \ -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -[ - { - "id": "string", - "name": "string", - "description": "string", - "nameservers": [ - { - "ip": "string", - "ns_type": "string", - "port": "integer" - } - ], - "enabled": "boolean", - "groups": [ - "string" - ], - "primary": "boolean", - "domains": [ - "string" - ] - } -] -``` - - - - - - - - - ---- - - -## Create a Nameserver Group {{ tag: 'POST' , label: '/api/dns/nameservers' }} - - - - Creates a Nameserver Group - - #### Request-Body Parameters - - - - Nameserver group name - - - - Nameserver group description - - - - Nameserver group - - - - Nameserver group status - - - - Nameserver group tag groups - - - - Nameserver group primary status - - - - Nameserver group domain list - - - - - - -```bash {{ title: 'cURL' }} -curl -X POST https://api.netbird.io/api/dns/nameservers \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \-H 'Content-Type: application/json' \ ---data-raw '{ - "name": "string", - "description": "string", - "nameservers": [ - { - "ip": "string", - "ns_type": "string", - "port": "integer" - } - ], - "enabled": "boolean", - "groups": [ - "string" - ], - "primary": "boolean", - "domains": [ - "string" - ] -}' -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -{ - "id": "string", - "name": "string", - "description": "string", - "nameservers": [ - { - "ip": "string", - "ns_type": "string", - "port": "integer" - } - ], - "enabled": "boolean", - "groups": [ - "string" - ], - "primary": "boolean", - "domains": [ - "string" - ] -} -``` - - - - - - - - - ---- - - -## Retrieve a Nameserver Group {{ tag: 'GET' , label: '/api/dns/nameservers/{nsgroupId}' }} - - - - Get information about a Nameserver Groups - - #### Path Parameters - - - - The unique identifier of a Nameserver Group - - - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/dns/nameservers/{nsgroupId} \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \ -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -{ - "id": "string", - "name": "string", - "description": "string", - "nameservers": [ - { - "ip": "string", - "ns_type": "string", - "port": "integer" - } - ], - "enabled": "boolean", - "groups": [ - "string" - ], - "primary": "boolean", - "domains": [ - "string" - ] -} -``` - - - - - - - - - ---- - - -## Update a Nameserver Group {{ tag: 'PUT' , label: '/api/dns/nameservers/{nsgroupId}' }} - - - - Update/Replace a Nameserver Group - - #### Path Parameters - - - - The unique identifier of a Nameserver Group - - - - #### Request-Body Parameters - - - - Nameserver group name - - - - Nameserver group description - - - - Nameserver group - - - - Nameserver group status - - - - Nameserver group tag groups - - - - Nameserver group primary status - - - - Nameserver group domain list - - - - - - -```bash {{ title: 'cURL' }} -curl -X PUT https://api.netbird.io/api/dns/nameservers/{nsgroupId} \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \-H 'Content-Type: application/json' \ ---data-raw '{ - "name": "string", - "description": "string", - "nameservers": [ - { - "ip": "string", - "ns_type": "string", - "port": "integer" - } - ], - "enabled": "boolean", - "groups": [ - "string" - ], - "primary": "boolean", - "domains": [ - "string" - ] -}' -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -{ - "id": "string", - "name": "string", - "description": "string", - "nameservers": [ - { - "ip": "string", - "ns_type": "string", - "port": "integer" - } - ], - "enabled": "boolean", - "groups": [ - "string" - ], - "primary": "boolean", - "domains": [ - "string" - ] -} -``` - - - - - - - - - ---- - - -## Delete a Nameserver Group {{ tag: 'DELETE' , label: '/api/dns/nameservers/{nsgroupId}' }} - - - - Delete a Nameserver Group - - #### Path Parameters - - - - The unique identifier of a Nameserver Group - - - - - - -```bash {{ title: 'cURL' }} -curl -X DELETE https://api.netbird.io/api/dns/nameservers/{nsgroupId} \ --H "Authorization: Bearer {token}" \ - -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - - - - - ---- - - -## Retrieve DNS Settings {{ tag: 'GET' , label: '/api/dns/settings' }} - - - - Returns a DNS settings object - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/dns/settings \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \ -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -[ - { - "disabled_management_groups": [ - "string" - ] - } -] -``` - - - - - - - - - ---- - - -## Update DNS Settings {{ tag: 'PUT' , label: '/api/dns/settings' }} - - - - Updates a DNS settings object - - #### Request-Body Parameters - - - - Groups whose DNS management is disabled - - - - - - -```bash {{ title: 'cURL' }} -curl -X PUT https://api.netbird.io/api/dns/settings \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \-H 'Content-Type: application/json' \ ---data-raw '{ - "disabled_management_groups": [ - "string" - ] -}' -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -{ - "disabled_management_groups": [ - "string" - ] -} -``` - - - - - - - - - ---- - - - -# Events - -View information about the account and network events. - ---- - - - -## List all Events {{ tag: 'GET' , label: '/api/events' }} - - - - Returns a list of all events - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/events \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \ -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -[ - { - "id": "string", - "timestamp": "string", - "activity": "string", - "activity_code": "string", - "initiator_id": "string", - "target_id": "string", - "meta": "object" - } -] -``` - - - - - - - - - ---- - - - -# Accounts - -View information about the accounts. - ---- - - - -## List all Accounts {{ tag: 'GET' , label: '/api/accounts' }} - - - - Returns a list of accounts of a user. Always returns a list of one account. - - - - -```bash {{ title: 'cURL' }} -curl -X GET https://api.netbird.io/api/accounts \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \ -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -[ - { - "id": "string", - "settings": { - "peer_login_expiration_enabled": "boolean", - "peer_login_expiration": "integer" - } - } -] -``` - - - - - - - - - ---- - - -## Update an Account {{ tag: 'PUT' , label: '/api/accounts/{accountId}' }} - - - - Update information about an account - - #### Path Parameters - - - - The unique identifier of an account - - - - #### Request-Body Parameters - - - - - - - - - - -```bash {{ title: 'cURL' }} -curl -X PUT https://api.netbird.io/api/accounts/{accountId} \ --H "Authorization: Bearer {token}" \ --H 'Accept: application/json' \-H 'Content-Type: application/json' \ ---data-raw '{ - "settings": { - "peer_login_expiration_enabled": "boolean", - "peer_login_expiration": "integer" - } -}' -``` - - ```js - import ApiClient from '@example/protocol-api' - - const client = new ApiClient(token) - - await client.contacts.update('WAz8eIbvDR60rouK', { - display_name: 'UncleFrank', - }) - ``` - - ```python - from protocol_api import ApiClient - - client = ApiClient(token) - - client.contacts.update("WAz8eIbvDR60rouK", display_name="UncleFrank") - ``` - - ```php - $client = new \Protocol\ApiClient($token); - - $client->contacts->update('WAz8eIbvDR60rouK', [ - 'display_name' => 'UncleFrank', - ]); - ``` - - - - - - -```json {{ title: '200' }} -{ - "id": "string", - "settings": { - "peer_login_expiration_enabled": "boolean", - "peer_login_expiration": "integer" - } -} -``` - - - - - - - - - ---- diff --git a/generator/api.ts b/generator/api.ts index 3074a7d0..be74f984 100644 --- a/generator/api.ts +++ b/generator/api.ts @@ -4,7 +4,7 @@ import { OpenAPIV3, OpenAPIV2 } from 'openapi-types' import * as fs from 'fs' import * as ejs from 'ejs' -export default async function gen(inputFileName: string, outputDir: string, apiUrl: string) { +export default async function gen(inputFileName: string, outputDir: string) { const specRaw = fs.readFileSync(inputFileName, 'utf8') const spec = JSON.parse(specRaw) as any // console.log('spec', spec) @@ -13,7 +13,7 @@ export default async function gen(inputFileName: string, outputDir: string, apiU case '3.0.0': case '3.0.1': case '3.0.3': - await gen_v3(spec, outputDir, { apiUrl }) + await gen_v3(spec, outputDir) break default: @@ -55,12 +55,13 @@ export type component = { parameters: schemaParameter[] } -async function gen_v3(spec: OpenAPIV3.Document, dest: string, { apiUrl }: { apiUrl: string }) { +async function gen_v3(spec: OpenAPIV3.Document, dest: string) { const specLayout = spec.tags || [] // const operations: enrichedOperation[] = [] const tagGroups = new Map() + const server = spec.servers.pop().url Object.entries(spec.paths).forEach(([key, val]) => { - const fullPath = `${apiUrl}${key}` + const fullPath = `${server}${key}` toArrayWithKey(val!, 'operation').forEach((o) => { const operation = o as v3OperationWithPath diff --git a/generator/index.ts b/generator/index.ts index 53ead88d..e215d25c 100644 --- a/generator/index.ts +++ b/generator/index.ts @@ -24,22 +24,10 @@ function handleInput(command: string, options: any) { export default async function DocGenerator({ input, output, - type, - url, }: { input: string output: string - type: 'api' - url?: string }) { - switch (type) { - case 'api': - await ApiGenerator(input, output, url || '') - break - - default: - await console.log('Unrecognized type: ', type) - break - } + await ApiGenerator(input, output) return 'Done' } diff --git a/generator/openapi.json b/generator/openapi.json index cd4d15b5..b0a40828 100644 --- a/generator/openapi.json +++ b/generator/openapi.json @@ -6,7 +6,7 @@ "version" : "0.0.1" }, "servers" : [ { - "url" : "https://netbird.io", + "url" : "https://api.netbird.io", "description" : "Default server" } ], "security" : [ { diff --git a/generator/openapi.yml b/generator/openapi.yml index 72cee0df..8d3b7a5b 100644 --- a/generator/openapi.yml +++ b/generator/openapi.yml @@ -1,6 +1,6 @@ openapi: 3.0.1 servers: - - url: https://netbird.io + - url: https://api.netbird.io description: Default server info: title: NetBird REST API diff --git a/generator/templates/ApiTemplateBack.ts b/generator/templates/ApiTemplateBack.ts deleted file mode 100644 index d27a424d..00000000 --- a/generator/templates/ApiTemplateBack.ts +++ /dev/null @@ -1,144 +0,0 @@ -const template = ` ---- -id: usage -slug: /usage -title: Usage -toc_max_heading_level: 3 ---- - - - - -<%- info.description %> - - - - -<% sections.forEach(function(section){ %> - -## <%- section.title %> [#<%= section.id %>] - -<%- section.description %> - -<% section.operations.forEach(function(operation){ %> - - - -### <%- operation.summary %> [#<%- operation.operationId %>] - -\`\`\` -<%- operation.operation.toUpperCase() %> <%- operation.fullPath %> -\`\`\` - - - -<% if(operation.parameters && operation.parameters.filter((parameter) => parameter.in === 'path').length > 0){ %> -#### Path Parameters - - -<% }; %> - -<% if(operation.parameters && operation.parameters.filter((parameter) => parameter.in === 'header').length > 0){ %> -#### Header Parameters - -<% }; %> - - - - -<% if(operation.requestBody?.content && operation.requestBody?.content['application/json']){ %> -#### Body Parameters - -\`\`\`json -<%- JSON.stringify(operation.requestBody?.content['application/json'], null, 2) %> -\`\`\` -<% }; %> - - - -#### Responses - - -<% operation.responseList.forEach(function(response){ %> - - -<%- response.description %> - - - -<% if(response?.content && response?.content['application/json']){ %> -\`\`\`json -<%- JSON.stringify(response.content['application/json'], null, 2) %> -\`\`\` -<% }; %> - - - - -<% }); %> - - -
-<% }); %> -<% }); %> - - -`.trim() - -export default template diff --git a/generator/types/CliSpec.ts b/generator/types/CliSpec.ts deleted file mode 100644 index 8c3515e7..00000000 --- a/generator/types/CliSpec.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { SpecLink } from './Spec' -import { Url } from 'url' - -export type CliInfo = { - id: string - version: string - title: string - language: string - source: Url - bugs: Url - spec: Url - description: string - options: string -} - -export type CliCommand = { - id: string - title: string - summary: string - description: string - tags: string[] - links: SpecLink[] - usage: string - subcommands: string[] - options: string -} - -export interface CliSpec { - clispec: '001' - - info: CliInfo - - commands: CliCommand[] -} diff --git a/generator/types/ConfigSpec.ts b/generator/types/ConfigSpec.ts deleted file mode 100644 index 6981b9b4..00000000 --- a/generator/types/ConfigSpec.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { SpecLink } from './Spec' -import { Url } from 'url' - -export type Tag = { - id: string - title: string - description?: string -} - -export type ConfigInfo = { - id: string - version: string - title: string - source: Url - bugs: Url - spec: Url - description: string - tags: Tag[] -} - -export type ConfigParameter = { - id: string - title: string - tags: string[] - required: boolean - description: string - links: SpecLink[] -} - -export interface ConfigSpec { - configspec: '001' - - info: ConfigInfo - - parameters: ConfigParameter[] -} diff --git a/generator/types/SdkSpec.ts b/generator/types/SdkSpec.ts deleted file mode 100644 index 9664d2e2..00000000 --- a/generator/types/SdkSpec.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { SpecLink } from './Spec' -import { Url } from 'url' - -export type SdkInfo = { - id: string - version: string - title: string - language: string - source: Url - bugs: Url - spec: Url - description: string - options: string -} - -export type SdkType = { - id: string - title: string - summary: string - source: Url - value: string - ref?: SdkType - links: SpecLink[] -} - -export type FunctionAttribute = { - id: string - title: string - required: boolean - description: string - type?: string[] - ref?: string // If a "type" is not supplied, a "ref" must be. This is a pointer to a type. - children: FunctionAttribute[] -} - -export type FunctionReturn = { - id: string - title: string - value: string - description: string - ref?: string // This is a pointer to a type. -} - -export type FunctionExample = { - id: string - title: string - description?: string - links: SpecLink[] - code: string - returns?: FunctionReturn -} - -export type Function = { - id: string - title: string - summary: string - source: Url - description?: string - usage: string - tags: string[] - links: SpecLink[] - attributes?: FunctionAttribute[] - returns?: FunctionReturn[] - examples?: FunctionExample[] -} - -export interface SdkSpec { - sdkspec: '001' - - info: SdkInfo - - functions: Function[] - - types: SdkType[] -} diff --git a/generator/types/Spec.ts b/generator/types/Spec.ts deleted file mode 100644 index 6f6c2c72..00000000 --- a/generator/types/Spec.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { Url } from 'url' - -export type SpecLink = { - name: string - url: Url -}