Files
netbird-docs/docs/api/retrieve-a-route.api.mdx
2023-04-26 15:06:59 +02:00

50 lines
7.2 KiB
Plaintext

---
id: retrieve-a-route
title: "Retrieve a Route"
description: "Get information about a Routes"
sidebar_label: "Retrieve a Route"
hide_title: true
hide_table_of_contents: true
api: {"description":"Get information about a Routes","tags":["Routes"],"security":[{"BearerAuth":[]},{"TokenAuth":[]}],"parameters":[{"in":"path","name":"routeId","required":true,"schema":{"type":"string"},"description":"The unique identifier of a route"}],"responses":{"200":{"description":"A Route object","content":{"application/json":{"schema":{"allOf":[{"type":"object","properties":{"id":{"description":"Route Id","type":"string"},"network_type":{"description":"Network type indicating if it is IPv4 or IPv6","type":"string"}},"required":["id","network_type"]},{"type":"object","properties":{"description":{"description":"Route description","type":"string"},"network_id":{"description":"Route network identifier, to group HA routes","type":"string","maxLength":40,"minLength":1},"enabled":{"description":"Route status","type":"boolean"},"peer":{"description":"Peer Identifier associated with route","type":"string"},"network":{"description":"Network range in CIDR format","type":"string"},"metric":{"description":"Route metric number. Lowest number has higher priority","type":"integer","maximum":9999,"minimum":1},"masquerade":{"description":"Indicate if peer should masquerade traffic to this route's prefix","type":"boolean"},"groups":{"description":"Route group tag groups","type":"array","items":{"type":"string"}}},"required":["id","description","network_id","enabled","peer","network","metric","masquerade","groups"],"title":"RouteRequest"}],"title":"Route"}}}},"400":{"description":"Bad Request","content":{}},"401":{"description":"Requires authentication","content":{}},"403":{"description":"Forbidden","content":{}},"500":{"description":"Internal Server Error","content":{}}},"method":"get","path":"/api/routes/{routeId}","servers":[{"url":"https://netbird.io","description":"Default server"}],"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"TokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Prefix the value with \\\"Token\\\" to indicate the custom authorization type"}},"info":{"title":"NetBird REST API","description":"API to manipulate groups, rules, policies and retrieve information about peers and users","version":"0.0.1"},"postman":{"name":"Retrieve a Route","description":{"content":"Get information about a Routes","type":"text/plain"},"url":{"path":["api","routes",":routeId"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) The unique identifier of a route","type":"text/plain"},"type":"any","value":"","key":"routeId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET","auth":{"type":"bearer","bearer":[{"type":"any","value":"<Bearer Token>","key":"token"}]}}}
sidebar_class_name: "get api-method"
info_path: api/netbird-rest-api
custom_edit_url: null
---
import ApiTabs from "@theme/ApiTabs";
import MimeTabs from "@theme/MimeTabs";
import ParamsItem from "@theme/ParamsItem";
import ResponseSamples from "@theme/ResponseSamples";
import SchemaItem from "@theme/SchemaItem";
import SchemaTabs from "@theme/SchemaTabs";
import DiscriminatorTabs from "@theme/DiscriminatorTabs";
import TabItem from "@theme/TabItem";
## Retrieve a Route
Get information about a Routes
<details style={{"marginBottom":"1rem"}} data-collapsed={false} open={true}><summary style={{}}><strong>Path Parameters</strong></summary><div><ul><ParamsItem className={"paramsItem"} param={{"in":"path","name":"routeId","required":true,"schema":{"type":"string"},"description":"The unique identifier of a route"}}></ParamsItem></ul></div></details><div><ApiTabs><TabItem label={"200"} value={"200"}><div>
A Route object
</div><div><MimeTabs schemaType={"response"}><TabItem label={"application/json"} value={"application/json"}><SchemaTabs><TabItem label={"Schema"} value={"Schema"}><details style={{}} data-collapsed={false} open={true}><summary style={{"textAlign":"left"}}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"id"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"Route Id","type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"network_type"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"Network type indicating if it is IPv4 or IPv6","type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"description"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"Route description","type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"network_id"} required={true} schemaName={"string"} qualifierMessage={"**Possible values:** `non-empty` and `<= 40 characters`"} schema={{"description":"Route network identifier, to group HA routes","type":"string","maxLength":40,"minLength":1}}></SchemaItem><SchemaItem collapsible={false} name={"enabled"} required={true} schemaName={"boolean"} qualifierMessage={undefined} schema={{"description":"Route status","type":"boolean"}}></SchemaItem><SchemaItem collapsible={false} name={"peer"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"Peer Identifier associated with route","type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"network"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"Network range in CIDR format","type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"metric"} required={true} schemaName={"integer"} qualifierMessage={"**Possible values:** `>= 1` and `<= 9999`"} schema={{"description":"Route metric number. Lowest number has higher priority","type":"integer","maximum":9999,"minimum":1}}></SchemaItem><SchemaItem collapsible={false} name={"masquerade"} required={true} schemaName={"boolean"} qualifierMessage={undefined} schema={{"description":"Indicate if peer should masquerade traffic to this route's prefix","type":"boolean"}}></SchemaItem><SchemaItem collapsible={false} name={"groups"} required={true} schemaName={"string[]"} qualifierMessage={undefined} schema={{"description":"Route group tag groups","type":"array","items":{"type":"string"}}}></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n \"id\": \"string\",\n \"network_type\": \"string\",\n \"description\": \"string\",\n \"network_id\": \"string\",\n \"enabled\": true,\n \"peer\": \"string\",\n \"network\": \"string\",\n \"metric\": 0,\n \"masquerade\": true,\n \"groups\": [\n \"string\"\n ]\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"400"} value={"400"}><div>
Bad Request
</div><div></div></TabItem><TabItem label={"401"} value={"401"}><div>
Requires authentication
</div><div></div></TabItem><TabItem label={"403"} value={"403"}><div>
Forbidden
</div><div></div></TabItem><TabItem label={"500"} value={"500"}><div>
Internal Server Error
</div><div></div></TabItem></ApiTabs></div>