netmaker/swagger.yml
2023-12-11 20:01:31 +04:00

2502 lines
77 KiB
YAML

basePath: /
consumes:
- application/json
definitions:
ACL:
additionalProperties:
format: uint8
type: integer
description: ACL - the ACL of other nodes in a NetworkACL for a single unique node
type: object
x-go-package: github.com/gravitl/netmaker/logic/acls
ACLContainer:
additionalProperties:
$ref: '#/definitions/ACL'
description: ACLContainer - the total list of all node's ACL in a given network
type: object
x-go-package: github.com/gravitl/netmaker/logic/acls
ApiHost:
description: ApiHost - the host struct for API usage
properties:
debug:
type: boolean
x-go-name: Debug
defaultinterface:
type: string
x-go-name: DefaultInterface
endpointip:
type: string
x-go-name: EndpointIP
firewallinuse:
type: string
x-go-name: FirewallInUse
id:
type: string
x-go-name: ID
interfaces:
items:
$ref: '#/definitions/Iface'
type: array
x-go-name: Interfaces
isdefault:
type: boolean
x-go-name: IsDefault
isrelay:
type: boolean
x-go-name: IsRelay
isrelayed:
type: boolean
x-go-name: IsRelayed
isstatic:
type: boolean
x-go-name: IsStatic
listenport:
format: int64
type: integer
x-go-name: ListenPort
macaddress:
type: string
x-go-name: MacAddress
mtu:
format: int64
type: integer
x-go-name: MTU
name:
type: string
x-go-name: Name
nat_type:
type: string
x-go-name: NatType
nodes:
items:
type: string
type: array
x-go-name: Nodes
os:
type: string
x-go-name: OS
publickey:
type: string
x-go-name: PublicKey
relay_hosts:
items:
type: string
type: array
x-go-name: RelayedHosts
relayed_by:
type: string
x-go-name: RelayedBy
verbosity:
format: int64
type: integer
x-go-name: Verbosity
version:
type: string
x-go-name: Version
wg_public_listen_port:
format: int64
type: integer
x-go-name: WgPublicListenPort
type: object
x-go-package: github.com/gravitl/netmaker/models
AuthParams:
description: AuthParams - struct for auth params
properties:
id:
type: string
x-go-name: ID
macaddress:
type: string
x-go-name: MacAddress
password:
type: string
x-go-name: Password
type: object
x-go-package: github.com/gravitl/netmaker/models
CustomExtClient:
description: CustomExtClient - struct for CustomExtClient params
properties:
clientid:
type: string
x-go-name: ClientID
deniednodeacls:
additionalProperties:
type: object
type: object
x-go-name: DeniedACLs
dns:
type: string
x-go-name: DNS
enabled:
type: boolean
x-go-name: Enabled
extraallowedips:
items:
type: string
type: array
x-go-name: ExtraAllowedIPs
publickey:
type: string
x-go-name: PublicKey
remote_access_client_id:
type: string
x-go-name: RemoteAccessClientID
type: object
x-go-package: github.com/gravitl/netmaker/models
DNSEntry:
description: DNSEntry - a DNS entry represented as struct
properties:
address:
type: string
x-go-name: Address
address6:
type: string
x-go-name: Address6
name:
type: string
x-go-name: Name
network:
type: string
x-go-name: Network
type: object
x-go-package: github.com/gravitl/netmaker/models
Duration:
description: |-
A Duration represents the elapsed time between two instants
as an int64 nanosecond count. The representation limits the
largest representable duration to approximately 290 years.
format: int64
type: integer
x-go-package: time
EgressGatewayRequest:
description: EgressGatewayRequest - egress gateway request
properties:
natenabled:
type: string
x-go-name: NatEnabled
netid:
type: string
x-go-name: NetID
nodeid:
type: string
x-go-name: NodeID
ranges:
items:
type: string
type: array
x-go-name: Ranges
type: object
x-go-package: github.com/gravitl/netmaker/models
EnrollmentKey:
description: EnrollmentKey - the key used to register hosts and join them to specific networks
properties:
expiration:
format: date-time
type: string
x-go-name: Expiration
networks:
items:
type: string
type: array
x-go-name: Networks
tags:
items:
type: string
type: array
x-go-name: Tags
token:
type: string
x-go-name: Token
type:
$ref: '#/definitions/KeyType'
unlimited:
type: boolean
x-go-name: Unlimited
uses_remaining:
format: int64
type: integer
x-go-name: UsesRemaining
value:
type: string
x-go-name: Value
type: object
x-go-package: github.com/gravitl/netmaker/models
ExtClient:
description: ExtClient - struct for external clients
properties:
address:
type: string
x-go-name: Address
address6:
type: string
x-go-name: Address6
clientid:
type: string
x-go-name: ClientID
deniednodeacls:
additionalProperties:
type: object
type: object
x-go-name: DeniedACLs
dns:
type: string
x-go-name: DNS
enabled:
type: boolean
x-go-name: Enabled
extraallowedips:
items:
type: string
type: array
x-go-name: ExtraAllowedIPs
ingressgatewayendpoint:
type: string
x-go-name: IngressGatewayEndpoint
ingressgatewayid:
type: string
x-go-name: IngressGatewayID
lastmodified:
format: int64
type: integer
x-go-name: LastModified
network:
type: string
x-go-name: Network
ownerid:
type: string
x-go-name: OwnerID
privatekey:
type: string
x-go-name: PrivateKey
publickey:
type: string
x-go-name: PublicKey
remote_access_client_id:
type: string
x-go-name: RemoteAccessClientID
type: object
x-go-package: github.com/gravitl/netmaker/models
File:
title: File represents an open file descriptor.
type: object
x-go-package: os
HardwareAddr:
items:
format: uint8
type: integer
title: A HardwareAddr represents a physical hardware address.
type: array
x-go-package: net
Host:
description: Host - represents a host on the network
properties:
autoupdate:
type: boolean
x-go-name: AutoUpdate
daemoninstalled:
type: boolean
x-go-name: DaemonInstalled
debug:
type: boolean
x-go-name: Debug
defaultinterface:
type: string
x-go-name: DefaultInterface
endpointip:
type: string
x-go-name: EndpointIP
firewallinuse:
type: string
x-go-name: FirewallInUse
hostpass:
type: string
x-go-name: HostPass
id:
format: uuid
type: string
x-go-name: ID
interface:
type: string
x-go-name: Interface
interfaces:
items:
$ref: '#/definitions/Iface'
type: array
x-go-name: Interfaces
ipforwarding:
type: boolean
x-go-name: IPForwarding
isdefault:
type: boolean
x-go-name: IsDefault
isdocker:
type: boolean
x-go-name: IsDocker
isk8s:
type: boolean
x-go-name: IsK8S
isstatic:
type: boolean
x-go-name: IsStatic
listenport:
format: int64
type: integer
x-go-name: ListenPort
macaddress:
$ref: '#/definitions/HardwareAddr'
mtu:
format: int64
type: integer
x-go-name: MTU
name:
type: string
x-go-name: Name
nat_type:
type: string
x-go-name: NatType
nodes:
items:
type: string
type: array
x-go-name: Nodes
os:
type: string
x-go-name: OS
publickey:
$ref: '#/definitions/Key'
traffickeypublic:
items:
format: uint8
type: integer
type: array
x-go-name: TrafficKeyPublic
turn_endpoint:
type: string
x-go-name: TurnEndpoint
verbosity:
format: int64
type: integer
x-go-name: Verbosity
version:
type: string
x-go-name: Version
wg_public_listen_port:
format: int64
type: integer
x-go-name: WgPublicListenPort
type: object
x-go-package: github.com/gravitl/netmaker/models
HostPull:
description: HostPull - response of a host's pull
properties:
host:
$ref: '#/definitions/Host'
nodes:
items:
$ref: '#/definitions/Node'
type: array
x-go-name: Nodes
peer_ids:
$ref: '#/definitions/PeerMap'
peers:
items:
$ref: '#/definitions/PeerConfig'
type: array
x-go-name: Peers
server_config:
$ref: '#/definitions/ServerConfig'
type: object
x-go-package: github.com/gravitl/netmaker/models
IDandAddr:
description: IDandAddr - struct to hold ID and primary Address
properties:
address:
type: string
x-go-name: Address
id:
type: string
x-go-name: ID
is_extclient:
type: boolean
x-go-name: IsExtClient
isserver:
type: string
x-go-name: IsServer
listen_port:
format: int64
type: integer
x-go-name: ListenPort
name:
type: string
x-go-name: Name
network:
type: string
x-go-name: Network
type: object
x-go-package: github.com/gravitl/netmaker/models
IPMask:
description: See type IPNet and func ParseCIDR for details.
items:
format: uint8
type: integer
title: |-
An IPMask is a bitmask that can be used to manipulate
IP addresses for IP addressing and routing.
type: array
x-go-package: net
IPNet:
properties:
IP:
type: string
Mask:
$ref: '#/definitions/IPMask'
title: An IPNet represents an IP network.
type: object
x-go-package: net
Iface:
description: Iface struct for local interfaces of a node
properties:
address:
$ref: '#/definitions/IPNet'
addressString:
type: string
x-go-name: AddressString
name:
type: string
x-go-name: Name
type: object
x-go-package: github.com/gravitl/netmaker/models
Key:
description: |-
A Key is a public, private, or pre-shared secret key. The Key constructor
functions in this package can be used to create Keys suitable for each of
these applications.
items:
format: uint8
type: integer
type: array
x-go-package: golang.zx2c4.com/wireguard/wgctrl/wgtypes
KeyType:
description: KeyType - the type of enrollment key
format: int64
type: integer
x-go-package: github.com/gravitl/netmaker/models
LegacyNode:
description: LegacyNode - legacy struct for node model
properties:
accesskey:
type: string
x-go-name: AccessKey
action:
type: string
x-go-name: Action
address:
type: string
x-go-name: Address
address6:
type: string
x-go-name: Address6
allowedips:
items:
type: string
type: array
x-go-name: AllowedIPs
connected:
type: string
x-go-name: Connected
defaultacl:
description: == PRO ==
type: string
x-go-name: DefaultACL
dnson:
type: string
x-go-name: DNSOn
egressgatewaynatenabled:
type: string
x-go-name: EgressGatewayNatEnabled
egressgatewayranges:
items:
type: string
type: array
x-go-name: EgressGatewayRanges
egressgatewayrequest:
$ref: '#/definitions/EgressGatewayRequest'
endpoint:
type: string
x-go-name: Endpoint
expdatetime:
format: int64
type: integer
x-go-name: ExpirationDateTime
failover:
type: string
x-go-name: Failover
failovernode:
type: string
x-go-name: FailoverNode
firewallinuse:
type: string
x-go-name: FirewallInUse
id:
type: string
x-go-name: ID
ingressgatewayrange:
type: string
x-go-name: IngressGatewayRange
ingressgatewayrange6:
type: string
x-go-name: IngressGatewayRange6
interface:
type: string
x-go-name: Interface
interfaces:
items:
$ref: '#/definitions/Iface'
type: array
x-go-name: Interfaces
internetgateway:
type: string
x-go-name: InternetGateway
ipforwarding:
type: string
x-go-name: IPForwarding
isdocker:
type: string
x-go-name: IsDocker
isegressgateway:
type: string
x-go-name: IsEgressGateway
ishub:
type: string
x-go-name: IsHub
isingressgateway:
type: string
x-go-name: IsIngressGateway
isk8s:
type: string
x-go-name: IsK8S
ispending:
type: string
x-go-name: IsPending
isrelay:
type: string
x-go-name: IsRelay
isrelayed:
type: string
x-go-name: IsRelayed
isserver:
type: string
x-go-name: IsServer
isstatic:
description: IsStatic - refers to if the Endpoint is set manually or dynamically
type: string
x-go-name: IsStatic
lastcheckin:
format: int64
type: integer
x-go-name: LastCheckIn
lastmodified:
format: int64
type: integer
x-go-name: LastModified
lastpeerupdate:
format: int64
type: integer
x-go-name: LastPeerUpdate
listenport:
format: int32
type: integer
x-go-name: ListenPort
localaddress:
type: string
x-go-name: LocalAddress
locallistenport:
format: int32
type: integer
x-go-name: LocalListenPort
macaddress:
type: string
x-go-name: MacAddress
mtu:
format: int32
type: integer
x-go-name: MTU
name:
type: string
x-go-name: Name
network:
type: string
x-go-name: Network
networksettings:
$ref: '#/definitions/Network'
os:
type: string
x-go-name: OS
ownerid:
type: string
x-go-name: OwnerID
password:
type: string
x-go-name: Password
persistentkeepalive:
format: int32
type: integer
x-go-name: PersistentKeepalive
publickey:
type: string
x-go-name: PublicKey
relayaddrs:
items:
type: string
type: array
x-go-name: RelayAddrs
server:
type: string
x-go-name: Server
traffickeys:
$ref: '#/definitions/TrafficKeys'
udpholepunch:
type: string
x-go-name: UDPHolePunch
version:
type: string
x-go-name: Version
type: object
x-go-package: github.com/gravitl/netmaker/models
Network:
description: |-
Network Struct - contains info for a given unique network
At some point, need to replace all instances of Name with something else like Identifier
properties:
addressrange:
type: string
x-go-name: AddressRange
addressrange6:
type: string
x-go-name: AddressRange6
allowmanualsignup:
type: string
x-go-name: AllowManualSignUp
defaultacl:
type: string
x-go-name: DefaultACL
defaultinterface:
type: string
x-go-name: DefaultInterface
defaultkeepalive:
format: int32
type: integer
x-go-name: DefaultKeepalive
defaultlistenport:
format: int32
type: integer
x-go-name: DefaultListenPort
defaultmtu:
format: int32
type: integer
x-go-name: DefaultMTU
defaultpostdown:
type: string
x-go-name: DefaultPostDown
defaultudpholepunch:
type: string
x-go-name: DefaultUDPHolePunch
isipv4:
type: string
x-go-name: IsIPv4
isipv6:
type: string
x-go-name: IsIPv6
netid:
type: string
x-go-name: NetID
networklastmodified:
format: int64
type: integer
x-go-name: NetworkLastModified
nodelimit:
format: int32
type: integer
x-go-name: NodeLimit
nodeslastmodified:
format: int64
type: integer
x-go-name: NodesLastModified
type: object
x-go-package: github.com/gravitl/netmaker/models
Node:
description: Node - a model of a network node
properties:
action:
type: string
x-go-name: Action
address:
$ref: '#/definitions/IPNet'
address6:
$ref: '#/definitions/IPNet'
connected:
type: boolean
x-go-name: Connected
defaultacl:
description: == PRO ==
type: string
x-go-name: DefaultACL
dnson:
type: boolean
x-go-name: DNSOn
egressgatewaynatenabled:
type: boolean
x-go-name: EgressGatewayNatEnabled
egressgatewayranges:
items:
type: string
type: array
x-go-name: EgressGatewayRanges
egressgatewayrequest:
$ref: '#/definitions/EgressGatewayRequest'
expdatetime:
format: date-time
type: string
x-go-name: ExpirationDateTime
failover:
type: boolean
x-go-name: Failover
failovernode:
format: uuid
type: string
x-go-name: FailoverNode
hostid:
format: uuid
type: string
x-go-name: HostID
id:
format: uuid
type: string
x-go-name: ID
ingressdns:
type: string
x-go-name: IngressDNS
ingressgatewayrange:
type: string
x-go-name: IngressGatewayRange
ingressgatewayrange6:
type: string
x-go-name: IngressGatewayRange6
internetgateway:
$ref: '#/definitions/UDPAddr'
isegressgateway:
type: boolean
x-go-name: IsEgressGateway
isingressgateway:
type: boolean
x-go-name: IsIngressGateway
isrelay:
type: boolean
x-go-name: IsRelay
isrelayed:
type: boolean
x-go-name: IsRelayed
lastcheckin:
format: date-time
type: string
x-go-name: LastCheckIn
lastmodified:
format: date-time
type: string
x-go-name: LastModified
lastpeerupdate:
format: date-time
type: string
x-go-name: LastPeerUpdate
localaddress:
$ref: '#/definitions/IPNet'
network:
type: string
x-go-name: Network
networkrange:
$ref: '#/definitions/IPNet'
networkrange6:
$ref: '#/definitions/IPNet'
ownerid:
type: string
x-go-name: OwnerID
pendingdelete:
type: boolean
x-go-name: PendingDelete
persistentkeepalive:
$ref: '#/definitions/Duration'
relayedby:
type: string
x-go-name: RelayedBy
relaynodes:
items:
type: string
type: array
x-go-name: RelayedNodes
server:
type: string
x-go-name: Server
type: object
x-go-package: github.com/gravitl/netmaker/models
PeerConfig:
description: |-
Because the zero value of some Go types may be significant to WireGuard for
PeerConfig fields, pointer types are used for some of these fields. Only
pointer fields which are not nil will be applied when configuring a peer.
properties:
AllowedIPs:
description: |-
AllowedIPs specifies a list of allowed IP addresses in CIDR notation
for this peer.
items:
$ref: '#/definitions/IPNet'
type: array
Endpoint:
$ref: '#/definitions/UDPAddr'
PersistentKeepaliveInterval:
$ref: '#/definitions/Duration'
PresharedKey:
$ref: '#/definitions/Key'
PublicKey:
$ref: '#/definitions/Key'
Remove:
description: |-
Remove specifies if the peer with this public key should be removed
from a device's peer list.
type: boolean
ReplaceAllowedIPs:
description: |-
ReplaceAllowedIPs specifies if the allowed IPs specified in this peer
configuration should replace any existing ones, instead of appending them
to the allowed IPs list.
type: boolean
UpdateOnly:
description: |-
UpdateOnly specifies that an operation will only occur on this peer
if the peer already exists as part of the interface.
type: boolean
title: A PeerConfig is a WireGuard device peer configuration.
type: object
x-go-package: golang.zx2c4.com/wireguard/wgctrl/wgtypes
PeerMap:
additionalProperties:
$ref: '#/definitions/IDandAddr'
description: PeerMap - peer map for ids and addresses in metrics
type: object
x-go-package: github.com/gravitl/netmaker/models
RegisterResponse:
description: RegisterResponse - the response to a successful enrollment register
properties:
requested_host:
$ref: '#/definitions/Host'
server_config:
$ref: '#/definitions/ServerConfig'
type: object
x-go-package: github.com/gravitl/netmaker/models
RelayRequest:
description: RelayRequest - relay request struct
properties:
netid:
type: string
x-go-name: NetID
nodeid:
type: string
x-go-name: NodeID
relayaddrs:
items:
type: string
type: array
x-go-name: RelayedNodes
type: object
x-go-package: github.com/gravitl/netmaker/models
ServerConfig:
description: ServerConfig - server conf struct
properties:
APIConnString:
type: string
APIHost:
type: string
APIPort:
type: string
AllowedOrigin:
type: string
AuthProvider:
type: string
AzureTenant:
type: string
BasicAuth:
type: string
Broker:
type: string
BrokerType:
type: string
ClientID:
type: string
ClientSecret:
type: string
CoreDNSAddr:
type: string
DNSKey:
type: string
DNSMode:
type: string
Database:
type: string
DeployedByOperator:
type: boolean
DisableRemoteIPCheck:
type: string
DisplayKeys:
type: string
EgressesLimit:
format: int64
type: integer
EmqxRestEndpoint:
type: string
Environment:
type: string
FrontendURL:
type: string
HostNetwork:
type: string
IngressesLimit:
format: int64
type: integer
IsEE:
type: string
x-go-name: IsPro
LicenseValue:
type: string
MQPassword:
type: string
MQUserName:
type: string
MachinesLimit:
format: int64
type: integer
MasterKey:
type: string
MessageQueueBackend:
type: string
MetricsExporter:
type: string
NetclientAutoUpdate:
type: string
NetclientEndpointDetection:
type: string
NetmakerTenantID:
type: string
NetworksLimit:
format: int64
type: integer
NodeID:
type: string
OIDCIssuer:
type: string
Platform:
type: string
PublicIPService:
type: string
RestBackend:
type: string
SQLConn:
type: string
Server:
type: string
ServerBrokerEndpoint:
type: string
StunList:
type: string
StunPort:
format: int64
type: integer
Telemetry:
type: string
TurnApiServer:
type: string
TurnPassword:
type: string
TurnPort:
format: int64
type: integer
TurnServer:
type: string
TurnUserName:
type: string
UseTurn:
type: boolean
UsersLimit:
format: int64
type: integer
Verbosity:
format: int32
type: integer
Version:
type: string
type: object
x-go-package: github.com/gravitl/netmaker/config
Signal:
description: Signal - struct for signalling peer
properties:
action:
$ref: '#/definitions/SignalAction'
from_host_pubkey:
type: string
x-go-name: FromHostPubKey
reply:
type: boolean
x-go-name: Reply
server:
type: string
x-go-name: Server
timestamp:
format: int64
type: integer
x-go-name: TimeStamp
to_host_pubkey:
type: string
x-go-name: ToHostPubKey
turn_relay_addr:
type: string
x-go-name: TurnRelayEndpoint
type: object
x-go-package: github.com/gravitl/netmaker/models
SignalAction:
description: SignalAction - turn peer signal action
type: string
x-go-package: github.com/gravitl/netmaker/models
SuccessResponse:
properties:
Code:
format: int64
type: integer
Message:
type: string
Response: {}
title: SuccessResponse is struct for sending error message with code.
type: object
x-go-package: github.com/gravitl/netmaker/models
TrafficKeys:
description: TrafficKeys - struct to hold public keys
properties:
mine:
items:
format: uint8
type: integer
type: array
x-go-name: Mine
server:
items:
format: uint8
type: integer
type: array
x-go-name: Server
type: object
x-go-package: github.com/gravitl/netmaker/models
UDPAddr:
properties:
IP:
type: string
Port:
format: int64
type: integer
Zone:
type: string
title: UDPAddr represents the address of a UDP end point.
type: object
x-go-package: net
User:
description: User struct - struct for Users
properties:
isadmin:
type: boolean
x-go-name: IsAdmin
issuperadmin:
type: boolean
x-go-name: IsSuperAdmin
password:
type: string
x-go-name: Password
remote_gw_ids:
additionalProperties:
type: object
type: object
x-go-name: RemoteGwIDs
username:
type: string
x-go-name: UserName
type: object
x-go-package: github.com/gravitl/netmaker/models
UserAuthParams:
description: UserAuthParams - user auth params struct
properties:
password:
type: string
x-go-name: Password
username:
type: string
x-go-name: UserName
type: object
x-go-package: github.com/gravitl/netmaker/models
host: api.demo.netmaker.io
info:
description: |-
# API Usage
Most actions that can be performed via API can be performed via UI. We recommend managing your networks using the official netmaker-ui project. However, Netmaker can also be run without the UI, and all functions can be achieved via API calls. If your use case requires using Netmaker without the UI or you need to do some troubleshooting/advanced configuration, using the API directly may help.
# Authentication
API calls must be authenticated via a header of the format -H “Authorization: Bearer <YOUR_SECRET_KEY>” There are two methods to obtain YOUR_SECRET_KEY: 1. Using the masterkey. By default, this value is “secret key,” but you should change this on your instance and keep it secure. This value can be set via env var at startup or in a config file (config/environments/< env >.yaml). See the [Netmaker](https://docs.netmaker.org/index.html) documentation for more details. 2. Using a JWT received for a node. This can be retrieved by calling the /api/nodes/<network>/authenticate endpoint, as documented below.
title: Netmaker
version: 0.22.0
paths:
/api/dns:
get:
operationId: getAllDNS
responses:
"200":
$ref: '#/responses/dnsResponse'
schemes:
- https
summary: Gets all DNS entries.
tags:
- dns
/api/dns/{network}:
post:
operationId: createDNS
parameters:
- description: Network
in: path
name: network
required: true
type: string
x-go-name: Network
- description: DNS Entry
in: body
name: body
schema:
items:
$ref: '#/definitions/DNSEntry'
type: array
x-go-name: Body
responses:
"200":
$ref: '#/responses/dnsResponse'
schemes:
- https
summary: Create a DNS entry.
tags:
- dns
/api/dns/{network}/{domain}:
delete:
operationId: deleteDNS
parameters:
- description: Network
in: path
name: network
required: true
type: string
x-go-name: Network
- description: Domain
in: path
name: domain
required: true
type: string
x-go-name: Domain
responses:
"200":
$ref: '#/responses/stringJSONResponse'
schemes:
- https
summary: Delete a DNS entry.
tags:
- dns
/api/dns/adm/{network}:
get:
operationId: getDNS
parameters:
- description: Network
in: path
name: network
required: true
type: string
x-go-name: Network
responses:
"200":
$ref: '#/responses/dnsResponse'
schemes:
- https
summary: Gets all DNS entries associated with the network.
tags:
- dns
/api/dns/adm/{network}/custom:
get:
operationId: getCustomDNS
parameters:
- description: Network
in: path
name: network
required: true
type: string
x-go-name: Network
responses:
"200":
$ref: '#/responses/dnsResponse'
schemes:
- https
summary: Gets custom DNS entries associated with a network.
tags:
- dns
/api/dns/adm/{network}/nodes:
get:
operationId: getNodeDNS
parameters:
- description: Network
in: path
name: network
required: true
type: string
x-go-name: Network
responses:
"200":
$ref: '#/responses/dnsResponse'
schemes:
- https
summary: Gets node DNS entries associated with a network.
tags:
- dns
/api/dns/adm/pushdns:
post:
operationId: pushDNS
responses:
"200":
$ref: '#/responses/dnsResponse'
schemes:
- https
summary: Push DNS entries to nameserver.
tags:
- dns
/api/extclients:
get:
operationId: getAllExtClients
parameters:
- description: Networks
in: body
name: networks
schema:
items:
type: string
type: array
x-go-name: Networks
responses:
"200":
$ref: '#/responses/extClientSliceResponse'
schemes:
- https
summary: A separate function to get all extclients, not just extclients for a particular network.
tags:
- ext_client
/api/extclients/{network}:
get:
description: Gets all extclients associated with network, including pending extclients.
operationId: getNetworkExtClients
parameters:
- description: Network
in: path
name: network
required: true
type: string
x-go-name: Network
responses:
"200":
$ref: '#/responses/extClientSliceResponse'
schemes:
- https
summary: Get all extclients associated with network.
tags:
- ext_client
/api/extclients/{network}/{clientid}:
delete:
operationId: deleteExtClient
parameters:
- description: Client ID
in: path
name: clientid
required: true
type: string
x-go-name: ClientID
- description: Network
in: path
name: network
required: true
type: string
x-go-name: Network
responses:
"200":
$ref: '#/responses/successResponse'
schemes:
- https
summary: Delete an individual extclient.
tags:
- ext_client
get:
operationId: getExtClient
parameters:
- description: Client ID
in: path
name: clientid
required: true
type: string
x-go-name: ClientID
- description: Network
in: path
name: network
required: true
type: string
x-go-name: Network
responses:
"200":
$ref: '#/responses/extClientResponse'
schemes:
- https
summary: Get an individual extclient.
tags:
- ext_client
put:
operationId: updateExtClient
parameters:
- description: Client ID
in: path
name: clientid
required: true
type: string
x-go-name: ClientID
- description: Network
in: path
name: network
required: true
type: string
x-go-name: Network
- description: ExtClient
in: body
name: ext_client
schema:
$ref: '#/definitions/ExtClient'
x-go-name: ExtClient
responses:
"200":
$ref: '#/responses/extClientResponse'
schemes:
- https
summary: Update an individual extclient.
tags:
- ext_client
/api/extclients/{network}/{clientid}/{type}:
get:
operationId: getExtClientConf
parameters:
- description: Type
in: path
name: type
required: true
type: string
x-go-name: Type
- description: Client ID
in: path
name: clientid
required: true
type: string
x-go-name: ClientID
- description: Network
in: path
name: network
required: true
type: string
x-go-name: Network
responses:
"200":
$ref: '#/responses/extClientResponse'
schemes:
- https
summary: Get an individual extclient.
tags:
- ext_client
/api/extclients/{network}/{nodeid}:
post:
operationId: createExtClient
parameters:
- description: Network
in: path
name: network
required: true
type: string
x-go-name: Network
- description: Node ID
in: path
name: nodeid
required: true
type: string
x-go-name: NodeID
- description: Custom ExtClient
in: body
name: custom_ext_client
schema:
$ref: '#/definitions/CustomExtClient'
x-go-name: CustomExtClient
responses:
"200":
$ref: '#/responses/okResponse'
schemes:
- https
summary: Create an individual extclient. Must have valid key and be unique.
tags:
- ext_client
/api/getip:
get:
operationId: getPublicIP
responses:
"200":
$ref: '#/responses/byteArrayResponse'
schemes:
- https
summary: Get the current public IP address.
tags:
- ipservice
/api/hosts:
get:
operationId: getHosts
responses:
"200":
$ref: '#/responses/apiHostResponse'
schemes:
- https
summary: Lists all hosts.
tags:
- hosts
/api/hosts/{hostid}:
delete:
operationId: deleteHost
parameters:
- description: HostID
in: path
name: hostid
required: true
type: string
x-go-name: HostID
responses:
"200":
$ref: '#/responses/apiHostResponse'
schemes:
- https
summary: Deletes a Netclient host from Netmaker server.
tags:
- hosts
put:
operationId: updateHost
parameters:
- description: HostID
in: path
name: hostid
required: true
type: string
x-go-name: HostID
responses:
"200":
$ref: '#/responses/apiHostResponse'
schemes:
- https
summary: Updates a Netclient host on Netmaker server.
tags:
- hosts
/api/hosts/{hostid}/networks/{network}:
delete:
operationId: deleteHostFromNetwork
parameters:
- description: hostid to add or delete from network
in: path
name: hostid
required: true
type: string
x-go-name: HostID
- description: network
in: path
name: network
required: true
type: string
x-go-name: Network
responses:
"200":
$ref: '#/responses/okResponse'
schemes:
- https
summary: Given a network, a host is removed from the network.
tags:
- hosts
post:
operationId: addHostToNetwork
parameters:
- description: hostid to add or delete from network
in: path
name: hostid
required: true
type: string
x-go-name: HostID
- description: network
in: path
name: network
required: true
type: string
x-go-name: Network
responses:
"200":
$ref: '#/responses/okResponse'
schemes:
- https
summary: Given a network, a host is added to the network.
tags:
- hosts
/api/hosts/{hostid}/signalpeer:
post:
operationId: signalPeer
parameters:
- description: HostID
in: path
name: hostid
required: true
type: string
x-go-name: HostID
responses:
"200":
$ref: '#/responses/signal'
schemes:
- https
summary: send signal to peer.
tags:
- hosts
/api/hosts/{hostid}/sync:
post:
operationId: synchost
parameters:
- description: HostID
in: path
name: hostid
required: true
type: string
x-go-name: HostID
responses:
"200":
$ref: '#/responses/networkBodyResponse'
schemes:
- https
summary: Requests a host to pull.
tags:
- hosts
/api/hosts/{hostid}keys:
post:
operationId: updateKeys
parameters:
- description: HostID
in: path
name: hostid
required: true
type: string
x-go-name: HostID
responses:
"200":
$ref: '#/responses/networkBodyResponse'
schemes:
- https
summary: Update keys for a network.
tags:
- hosts
/api/hosts/adm/authenticate:
post:
operationId: authenticateHost
responses:
"200":
$ref: '#/responses/successResponse'
schemes:
- https
summary: Host based authentication for making further API calls.
tags:
- authenticate
/api/hosts/keys:
post:
operationId: updateAllKeys
responses:
"200":
$ref: '#/responses/networkBodyResponse'
schemes:
- https
summary: Update keys for a network.
tags:
- hosts
/api/networks:
get:
operationId: getNetworks
responses:
"200":
$ref: '#/responses/getNetworksSliceResponse'
schemes:
- https
summary: Lists all networks.
tags:
- networks
post:
operationId: createNetwork
parameters:
- description: Network
in: body
name: network
schema:
$ref: '#/definitions/Network'
x-go-name: Network
responses:
"200":
$ref: '#/responses/networkBodyResponse'
schemes:
- https
summary: Create a network.
tags:
- networks
/api/networks/{networkname}:
delete:
operationId: deleteNetwork
parameters:
- description: 'name: network name'
in: path
name: networkname
required: true
type: string
x-go-name: Networkname
responses:
"200":
$ref: '#/responses/successResponse'
schemes:
- https
summary: Delete a network. Will not delete if there are any nodes that belong to the network.
tags:
- networks
get:
operationId: getNetwork
parameters:
- description: 'name: network name'
in: path
name: networkname
required: true
type: string
x-go-name: Networkname
responses:
"200":
$ref: '#/responses/networkBodyResponse'
schemes:
- https
summary: Get a network.
tags:
- networks
put:
operationId: updateNetwork
parameters:
- description: 'name: network name'
in: path
name: networkname
required: true
type: string
x-go-name: Networkname
- description: Network
in: body
name: network
schema:
$ref: '#/definitions/Network'
x-go-name: Network
responses:
"200":
$ref: '#/responses/networkBodyResponse'
schemes:
- https
summary: Update pro settings for a network.
tags:
- networks
/api/networks/{networkname}/acls:
get:
operationId: getNetworkACL
parameters:
- description: 'name: network name'
in: path
name: networkname
required: true
type: string
x-go-name: Networkname
- description: ACL Container
in: body
name: acl_container
schema:
$ref: '#/definitions/ACLContainer'
x-go-name: ACLContainer
responses:
"200":
$ref: '#/responses/aclContainerResponse'
schemes:
- https
summary: Get a network ACL (Access Control List).
tags:
- networks
put:
operationId: updateNetworkACL
parameters:
- description: 'name: network name'
in: path
name: networkname
required: true
type: string
x-go-name: Networkname
- description: ACL Container
in: body
name: acl_container
schema:
$ref: '#/definitions/ACLContainer'
x-go-name: ACLContainer
responses:
"200":
$ref: '#/responses/aclContainerResponse'
schemes:
- https
summary: Update a network ACL (Access Control List).
tags:
- networks
/api/nodes:
get:
operationId: getAllNodes
responses:
"200":
$ref: '#/responses/nodeSliceResponse'
schemes:
- https
summary: Get all nodes across all networks.
tags:
- nodes
/api/nodes/{network}:
get:
operationId: getNetworkNodes
parameters:
- description: Network
in: path
name: network
required: true
type: string
x-go-name: Network
responses:
"200":
$ref: '#/responses/nodeSliceResponse'
schemes:
- https
summary: Gets all nodes associated with network including pending nodes.
tags:
- nodes
/api/nodes/{network}/{nodeid}:
delete:
operationId: deleteNode
parameters:
- in: path
name: network
required: true
type: string
x-go-name: Network
- in: path
name: nodeid
required: true
type: string
x-go-name: NodeID
- description: Node
in: body
name: node
schema:
$ref: '#/definitions/LegacyNode'
x-go-name: Node
responses:
"200":
$ref: '#/responses/nodeResponse'
schemes:
- https
summary: Delete an individual node.
tags:
- nodes
get:
operationId: getNode
parameters:
- in: path
name: network
required: true
type: string
x-go-name: Network
- in: path
name: nodeid
required: true
type: string
x-go-name: NodeID
responses:
"200":
$ref: '#/responses/nodeResponse'
schemes:
- https
summary: Get an individual node.
tags:
- nodes
put:
operationId: updateNode
parameters:
- in: path
name: network
required: true
type: string
x-go-name: Network
- in: path
name: nodeid
required: true
type: string
x-go-name: NodeID
- description: Node
in: body
name: node
schema:
$ref: '#/definitions/LegacyNode'
x-go-name: Node
responses:
"200":
$ref: '#/responses/nodeResponse'
schemes:
- https
summary: Update an individual node.
tags:
- nodes
/api/nodes/{network}/{nodeid}/creategateway:
post:
operationId: createEgressGateway
parameters:
- in: path
name: network
required: true
type: string
x-go-name: Network
- in: path
name: nodeid
required: true
type: string
x-go-name: NodeID
- description: Egress Gateway Request
in: body
name: egress_gateway_request
schema:
$ref: '#/definitions/EgressGatewayRequest'
x-go-name: EgressGatewayRequest
responses:
"200":
$ref: '#/responses/nodeResponse'
schemes:
- https
summary: Create an egress gateway.
tags:
- nodes
/api/nodes/{network}/{nodeid}/createingress:
post:
operationId: createIngressGateway
parameters:
- in: path
name: network
required: true
type: string
x-go-name: Network
- in: path
name: nodeid
required: true
type: string
x-go-name: NodeID
responses:
"200":
$ref: '#/responses/nodeResponse'
schemes:
- https
summary: Create an ingress gateway.
tags:
- nodes
/api/nodes/{network}/{nodeid}/createrelay:
post:
operationId: createRelay
parameters:
- in: path
name: network
required: true
type: string
x-go-name: Network
- in: path
name: nodeid
required: true
type: string
x-go-name: NodeID
- description: Relay Request
in: body
name: relay_request
schema:
$ref: '#/definitions/RelayRequest'
x-go-name: RelayRequest
responses:
"200":
$ref: '#/responses/nodeResponse'
schemes:
- https
summary: Create a relay.
tags:
- nodes
/api/nodes/{network}/{nodeid}/deletegateway:
delete:
operationId: deleteEgressGateway
parameters:
- in: path
name: network
required: true
type: string
x-go-name: Network
- in: path
name: nodeid
required: true
type: string
x-go-name: NodeID
responses:
"200":
$ref: '#/responses/nodeResponse'
schemes:
- https
summary: Delete an egress gateway.
tags:
- nodes
/api/nodes/{network}/{nodeid}/deleteingress:
delete:
operationId: deleteIngressGateway
parameters:
- in: path
name: network
required: true
type: string
x-go-name: Network
- in: path
name: nodeid
required: true
type: string
x-go-name: NodeID
responses:
"200":
$ref: '#/responses/nodeResponse'
schemes:
- https
summary: Delete an ingress gateway.
tags:
- nodes
/api/nodes/{network}/{nodeid}/deleterelay:
delete:
operationId: deleteRelay
parameters:
- in: path
name: network
required: true
type: string
x-go-name: Network
- in: path
name: nodeid
required: true
type: string
x-go-name: NodeID
responses:
"200":
$ref: '#/responses/nodeResponse'
schemes:
- https
summary: Remove a relay.
tags:
- nodes
/api/nodes/{network}/{nodeid}/ingress/users:
get:
operationId: ingressGatewayUsers
parameters:
- in: path
name: network
required: true
type: string
x-go-name: Network
- in: path
name: nodeid
required: true
type: string
x-go-name: NodeID
responses:
"200":
$ref: '#/responses/nodeResponse'
schemes:
- https
summary: Lists all the users attached to an ingress gateway.
tags:
- users
/api/nodes/adm/{network}/authenticate:
post:
operationId: authenticate
parameters:
- description: network
in: path
name: network
required: true
type: string
x-go-name: Network
- description: AuthParams
in: body
name: auth_params
schema:
$ref: '#/definitions/AuthParams'
x-go-name: AuthParams
responses:
"200":
$ref: '#/responses/successResponse'
schemes:
- https
summary: Authenticate to make further API calls related to a network.
tags:
- authenticate
/api/oauth/login:
get:
operationId: HandleAuthLogin
responses:
"200":
$ref: '#/responses/okResponse'
schemes:
- https
summary: Handles OAuth login.
tags:
- nodes
/api/server/getconfig:
get:
operationId: getConfig
responses:
"200":
$ref: '#/responses/serverConfigResponse'
schemes:
- https
summary: Get the server configuration.
tags:
- server
/api/server/getserverinfo:
get:
operationId: getServerInfo
responses:
"200":
$ref: '#/responses/serverConfigResponse'
schemes:
- https
summary: Get the server configuration.
tags:
- server
/api/server/status:
get:
operationId: getStatus
responses:
"200":
$ref: '#/responses/serverConfigResponse'
schemes:
- https
summary: Get the server configuration.
tags:
- server
/api/users:
get:
operationId: getUsers
responses:
"200":
$ref: '#/responses/userBodyResponse'
schemes:
- https
summary: Get all users.
tags:
- user
/api/users/{username}:
delete:
operationId: deleteUser
parameters:
- description: Username
in: path
name: username
required: true
type: string
x-go-name: Username
responses:
"200":
$ref: '#/responses/userBodyResponse'
schemes:
- https
summary: Delete a user.
tags:
- user
get:
operationId: getUser
parameters:
- description: Username
in: path
name: username
required: true
type: string
x-go-name: Username
responses:
"200":
$ref: '#/responses/userBodyResponse'
schemes:
- https
summary: Get an individual user.
tags:
- user
post:
operationId: createUser
parameters:
- description: User
in: body
name: user
schema:
$ref: '#/definitions/User'
x-go-name: User
- description: Username
in: path
name: username
required: true
type: string
x-go-name: Username
responses:
"200":
$ref: '#/responses/userBodyResponse'
schemes:
- https
summary: Create a user.
tags:
- user
put:
operationId: updateUser
parameters:
- description: User
in: body
name: user
schema:
$ref: '#/definitions/User'
x-go-name: User
- description: Username
in: path
name: username
required: true
type: string
x-go-name: Username
responses:
"200":
$ref: '#/responses/userBodyResponse'
schemes:
- https
summary: Update a user.
tags:
- user
/api/users/{username}/remote_access_gw:
delete:
operationId: removeUserFromRemoteAccessGW
parameters:
- in: path
name: username
required: true
type: string
x-go-name: Username
responses:
"200":
$ref: '#/responses/userBodyResponse'
schemes:
- https
summary: Delete User from a remote access gateway.
tags:
- user
post:
operationId: attachUserToRemoteAccessGateway
parameters:
- in: path
name: username
required: true
type: string
x-go-name: Username
responses:
"200":
$ref: '#/responses/userBodyResponse'
schemes:
- https
summary: Attach User to a remote access gateway.
tags:
- user
/api/users/adm/authenticate:
post:
operationId: authenticateUser
parameters:
- description: User Auth Params
in: body
name: user_auth_params
schema:
$ref: '#/definitions/UserAuthParams'
x-go-name: UserAuthParams
responses:
"200":
$ref: '#/responses/successResponse'
schemes:
- https
summary: User authenticates using its password and retrieves a JWT for authorization.
tags:
- authenticate
/api/users/adm/createsuperadmin:
post:
operationId: createAdmin
parameters:
- description: User
in: body
name: user
schema:
$ref: '#/definitions/User'
x-go-name: User
responses:
"200":
$ref: '#/responses/userBodyResponse'
schemes:
- https
summary: Make a user an admin.
tags:
- user
/api/users/adm/hassuperadmin:
get:
operationId: hasSuperAdmin
responses:
"200":
$ref: '#/responses/hasAdmin'
schemes:
- https
summary: Checks whether the server has an admin.
tags:
- user
/api/users/adm/transfersuperadmin:
post:
operationId: transferSuperAdmin
responses:
"200":
$ref: '#/responses/userBodyResponse'
schemes:
- https
summary: Transfers superadmin role to an admin user.
tags:
- user
/api/v1/enrollment-keys:
get:
operationId: getEnrollmentKeys
responses:
"200":
$ref: '#/responses/EnrollmentKeys'
schemes:
- https
summary: Lists all EnrollmentKeys for admins.
tags:
- enrollmentKeys
post:
operationId: createEnrollmentKey
responses:
"200":
$ref: '#/responses/EnrollmentKey'
schemes:
- https
summary: Creates an EnrollmentKey for hosts to use on Netmaker server.
tags:
- enrollmentKeys
/api/v1/enrollment-keys/{keyid}:
delete:
operationId: deleteEnrollmentKey
parameters:
- in: path
name: keyid
required: true
type: string
x-go-name: KeyID
responses:
"200":
$ref: '#/responses/okResponse'
schemes:
- https
summary: Deletes an EnrollmentKey from Netmaker server.
tags:
- enrollmentKeys
/api/v1/enrollment-keys/{token}:
post:
operationId: handleHostRegister
parameters:
- in: path
name: token
required: true
type: string
x-go-name: Token
- in: body
name: host
schema:
$ref: '#/definitions/Host'
x-go-name: Host
responses:
"200":
$ref: '#/responses/RegisterResponse'
schemes:
- https
summary: Handles a Netclient registration with server and add nodes accordingly.
tags:
- enrollmentKeys
/api/v1/host:
get:
description: Used by clients for "pull" command
operationId: pullHost
responses:
"200":
$ref: '#/responses/hostPull'
schemes:
- https
tags:
- hosts
/api/v1/legacy/nodes:
delete:
operationId: wipeLegacyNodes
responses:
"200":
$ref: '#/responses/successResponse'
schemes:
- https
summary: Delete all legacy nodes from DB.
tags:
- nodes
/api/v1/nodes/migrate:
put:
operationId: migrateData
responses:
"200":
$ref: '#/responses/hostPull'
schemes:
- https
summary: Used to migrate a legacy node.
tags:
- nodes
/meshclient/files/{filename}:
get:
operationId: getFile
parameters:
- description: Filename
in: path
name: filename
required: true
type: string
x-go-name: Filename
responses:
"200":
$ref: '#/responses/fileResponse'
schemes:
- https
summary: Retrieve a file from the file server.
tags:
- meshclient
produces:
- application/json
responses:
EnrollmentKey:
description: ""
schema:
$ref: '#/definitions/EnrollmentKey'
EnrollmentKeys:
description: ""
schema:
items:
$ref: '#/definitions/EnrollmentKey'
type: array
RegisterResponse:
description: ""
schema:
$ref: '#/definitions/RegisterResponse'
aclContainerResponse:
description: ""
schema:
$ref: '#/definitions/ACLContainer'
apiHostResponse:
description: ""
schema:
$ref: '#/definitions/ApiHost'
byteArrayResponse:
description: ""
schema:
items:
format: uint8
type: integer
type: array
dnsResponse:
description: Success
schema:
items:
$ref: '#/definitions/DNSEntry'
type: array
extClientResponse:
description: ""
schema:
$ref: '#/definitions/ExtClient'
extClientSliceResponse:
description: ""
schema:
items:
$ref: '#/definitions/ExtClient'
type: array
fileResponse:
description: ""
schema:
$ref: '#/definitions/File'
getNetworksSliceResponse:
description: ""
schema:
items:
$ref: '#/definitions/Network'
type: array
hasAdmin:
description: ""
hostPull:
description: ""
schema:
$ref: '#/definitions/HostPull'
networkBodyResponse:
description: ""
schema:
$ref: '#/definitions/Network'
nodeResponse:
description: ""
schema:
$ref: '#/definitions/LegacyNode'
nodeSliceResponse:
description: ""
schema:
items:
$ref: '#/definitions/LegacyNode'
type: array
okResponse:
description: ""
serverConfigResponse:
description: ""
schema:
$ref: '#/definitions/ServerConfig'
signal:
description: ""
schema:
$ref: '#/definitions/Signal'
stringJSONResponse:
description: ""
successResponse:
description: ""
schema:
$ref: '#/definitions/SuccessResponse'
userBodyResponse:
description: ""
schema:
$ref: '#/definitions/User'
schemes:
- https
swagger: "2.0"