netmaker/swagger.yaml

1867 lines
59 KiB
YAML
Raw Normal View History

2022-09-03 04:42:51 +08:00
basePath: /
consumes:
- application/json
2022-09-11 12:51:59 +08:00
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
AccessKey:
description: AccessKey - access key struct
properties:
accessstring:
type: string
x-go-name: AccessString
name:
type: string
x-go-name: Name
uses:
format: int64
type: integer
x-go-name: Uses
value:
type: string
x-go-name: Value
type: object
x-go-package: github.com/gravitl/netmaker/models
AttributeTypeAndValue:
description: |-
AttributeTypeAndValue mirrors the ASN.1 structure of the same name in
RFC 5280, Section 4.1.2.4.
properties:
Type:
$ref: '#/definitions/ObjectIdentifier'
Value: {}
type: object
x-go-package: crypto/x509/pkix
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
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:
interface:
type: string
x-go-name: Interface
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
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
description:
type: string
x-go-name: Description
enabled:
type: boolean
x-go-name: Enabled
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
privatekey:
type: string
x-go-name: PrivateKey
publickey:
type: string
x-go-name: PublicKey
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
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
Name:
description: |-
Name represents an X.509 distinguished name. This only includes the common
elements of a DN. Note that Name is only an approximation of the X.509
structure. If an accurate representation is needed, asn1.Unmarshal the raw
subject or issuer as an RDNSequence.
properties:
Country:
items:
type: string
type: array
x-go-name: OrganizationalUnit
ExtraNames:
description: |-
ExtraNames contains attributes to be copied, raw, into any marshaled
distinguished names. Values override any attributes with the same OID.
The ExtraNames field is not populated when parsing, see Names.
items:
$ref: '#/definitions/AttributeTypeAndValue'
type: array
Locality:
items:
type: string
type: array
x-go-name: Province
Names:
description: |-
Names contains all parsed attributes. When parsing distinguished names,
this can be used to extract non-standard attributes that are not parsed
by this package. When marshaling to RDNSequences, the Names field is
ignored, see ExtraNames.
items:
$ref: '#/definitions/AttributeTypeAndValue'
type: array
SerialNumber:
type: string
x-go-name: CommonName
StreetAddress:
items:
type: string
type: array
x-go-name: PostalCode
type: object
x-go-package: crypto/x509/pkix
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:
accesskeys:
items:
$ref: '#/definitions/AccessKey'
type: array
x-go-name: AccessKeys
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
defaultextclientdns:
type: string
x-go-name: DefaultExtClientDNS
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
defaultudpholepunch:
type: string
x-go-name: DefaultUDPHolePunch
isipv4:
type: string
x-go-name: IsIPv4
isipv6:
type: string
x-go-name: IsIPv6
ispointtosite:
type: string
x-go-name: IsPointToSite
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 - 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
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
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
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
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
NodeGet:
description: NodeGet - struct for a single node get response
properties:
node:
$ref: '#/definitions/Node'
peers:
items:
$ref: '#/definitions/PeerConfig'
type: array
x-go-name: Peers
serverconfig:
$ref: '#/definitions/ServerConfig'
type: object
x-go-package: github.com/gravitl/netmaker/models
ObjectIdentifier:
items:
format: int64
type: integer
title: An ObjectIdentifier represents an ASN.1 OBJECT IDENTIFIER.
type: array
x-go-package: encoding/asn1
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
PrivateKey:
items:
format: uint8
type: integer
title: PrivateKey is the type of Ed25519 private keys. It implements crypto.Signer.
type: array
x-go-package: crypto/ed25519
RegisterRequest:
description: RegisterRequest - struct for registation with netmaker server
properties:
CommonName:
$ref: '#/definitions/Name'
Key:
$ref: '#/definitions/PrivateKey'
type: object
x-go-package: github.com/gravitl/netmaker/netclient/config
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: RelayAddrs
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
ClientID:
type: string
ClientSecret:
type: string
CoreDNSAddr:
type: string
DNSKey:
type: string
DNSMode:
type: string
Database:
type: string
DisableRemoteIPCheck:
type: string
DisplayKeys:
type: string
FrontendURL:
type: string
HostNetwork:
type: string
MQHOST:
type: string
MQPort:
type: string
MQServerPort:
type: string
ManageIPTables:
type: string
MasterKey:
type: string
MessageQueueBackend:
type: string
NodeID:
type: string
OIDCIssuer:
type: string
Platform:
type: string
PortForwardServices:
type: string
PublicIPService:
type: string
RestBackend:
type: string
SQLConn:
type: string
Server:
type: string
Telemetry:
type: string
Verbosity:
format: int32
type: integer
Version:
type: string
type: object
x-go-package: github.com/gravitl/netmaker/config
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
networks:
items:
type: string
type: array
x-go-name: Networks
password:
type: string
x-go-name: Password
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
2022-09-07 05:08:49 +08:00
host: netmaker.io
2022-09-03 04:42:51 +08:00
info:
2022-09-06 20:20:24 +08:00
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
2022-09-07 01:30:40 +08:00
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
2023-05-03 10:18:05 +08:00
version: 0.19.0
2022-09-03 04:42:51 +08:00
paths:
2022-09-06 20:20:24 +08:00
/api/dns:
get:
operationId: getAllDNS
2022-09-11 12:51:59 +08:00
responses:
"200":
$ref: '#/responses/dnsResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
2022-09-11 12:51:59 +08:00
summary: Gets all DNS entries.
2022-09-06 20:20:24 +08:00
tags:
- dns
/api/dns/{network}:
post:
operationId: createDNS
2022-09-11 12:51:59 +08:00
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'
2022-09-06 20:20:24 +08:00
schemes:
- https
2022-09-11 12:51:59 +08:00
summary: Create a DNS entry.
2022-09-06 20:20:24 +08:00
tags:
- dns
/api/dns/{network}/{domain}:
delete:
operationId: deleteDNS
2022-09-11 12:51:59 +08:00
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'
2022-09-06 20:20:24 +08:00
schemes:
- https
2022-09-11 12:51:59 +08:00
summary: Delete a DNS entry.
2022-09-06 20:20:24 +08:00
tags:
- dns
/api/dns/adm/{network}:
get:
operationId: getDNS
2022-09-11 12:51:59 +08:00
parameters:
- description: Network
in: path
name: network
required: true
type: string
x-go-name: Network
responses:
"200":
$ref: '#/responses/dnsResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
2022-09-11 12:51:59 +08:00
summary: Gets all DNS entries associated with the network.
2022-09-06 20:20:24 +08:00
tags:
- dns
/api/dns/adm/{network}/custom:
get:
operationId: getCustomDNS
2022-09-11 12:51:59 +08:00
parameters:
- description: Network
in: path
name: network
required: true
type: string
x-go-name: Network
responses:
"200":
$ref: '#/responses/dnsResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
2022-09-11 12:51:59 +08:00
summary: Gets custom DNS entries associated with a network.
2022-09-06 20:20:24 +08:00
tags:
- dns
/api/dns/adm/{network}/nodes:
get:
operationId: getNodeDNS
2022-09-11 12:51:59 +08:00
parameters:
- description: Network
in: path
name: network
required: true
type: string
x-go-name: Network
2022-09-06 20:20:24 +08:00
schemes:
- https
2022-09-11 12:51:59 +08:00
summary: Gets node DNS entries associated with a network.
2022-09-06 20:20:24 +08:00
tags:
- dns
/api/dns/adm/pushdns:
post:
operationId: pushDNS
2022-09-11 12:51:59 +08:00
responses:
"200":
$ref: '#/responses/dnsStringJSONResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
2022-09-11 12:51:59 +08:00
summary: Push DNS entries to nameserver.
2022-09-06 20:20:24 +08:00
tags:
- dns
/api/extclients:
get:
2022-09-11 12:51:59 +08:00
operationId: getAllExtClients
parameters:
- description: Networks
in: body
name: networks
schema:
items:
type: string
type: array
x-go-name: Networks
responses:
"200":
$ref: '#/responses/extClientSliceResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
2022-09-11 12:51:59 +08:00
summary: A separate function to get all extclients, not just extclients for a particular network.
2022-09-06 20:20:24 +08:00
tags:
- ext_client
/api/extclients/{network}:
get:
2022-09-11 12:51:59 +08:00
description: Gets all extclients associated with network, including pending extclients.
2022-09-06 20:20:24 +08:00
operationId: getNetworkExtClients
2022-09-11 12:51:59 +08:00
parameters:
- description: Network
in: path
name: network
required: true
type: string
x-go-name: Network
responses:
"200":
$ref: '#/responses/extClientSliceResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
2022-09-11 12:51:59 +08:00
summary: Get all extclients associated with network.
2022-09-06 20:20:24 +08:00
tags:
- ext_client
/api/extclients/{network}/{clientid}:
delete:
operationId: deleteExtClient
2022-09-11 12:51:59 +08:00
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'
2022-09-06 20:20:24 +08:00
schemes:
- https
summary: Delete an individual extclient.
tags:
- ext_client
2022-09-11 12:51:59 +08:00
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
2022-09-06 20:20:24 +08:00
put:
operationId: updateExtClient
2022-09-11 12:51:59 +08:00
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'
2022-09-06 20:20:24 +08:00
schemes:
- https
summary: Update an individual extclient.
tags:
- ext_client
/api/extclients/{network}/{clientid}/{type}:
get:
operationId: getExtClientConf
2022-09-11 12:51:59 +08:00
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'
2022-09-06 20:20:24 +08:00
schemes:
- https
summary: Get an individual extclient.
tags:
- ext_client
/api/extclients/{network}/{nodeid}:
post:
operationId: createExtClient
2022-09-11 12:51:59 +08:00
parameters:
- description: Network
in: path
name: network
required: true
type: string
x-go-name: Network
- description: Node ID
in: path
name: node
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
2022-09-06 20:20:24 +08:00
schemes:
- https
summary: Create an individual extclient. Must have valid key and be unique.
tags:
- ext_client
/api/getip:
get:
operationId: getPublicIP
2022-09-11 12:51:59 +08:00
responses:
"200":
$ref: '#/responses/byteArrayResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
2022-09-11 12:51:59 +08:00
summary: Get the current public IP address.
2022-09-06 20:20:24 +08:00
tags:
- ipservice
2022-09-03 04:42:51 +08:00
/api/networks:
get:
2022-09-11 12:51:59 +08:00
operationId: getNetworks
parameters:
- description: 'name: networks'
in: header
items:
type: string
name: networks
type: array
x-go-name: Networks
responses:
"200":
$ref: '#/responses/getNetworksSliceResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
2022-09-11 12:51:59 +08:00
summary: Lists all networks.
2022-09-06 20:20:24 +08:00
tags:
- networks
post:
operationId: createNetwork
2022-09-11 12:51:59 +08:00
parameters:
- description: Network
in: body
name: network
schema:
$ref: '#/definitions/Network'
x-go-name: Network
responses:
"200":
$ref: '#/responses/networkBodyResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
2022-09-11 12:51:59 +08:00
summary: Create a network.
2022-09-06 20:20:24 +08:00
tags:
- networks
/api/networks/{networkname}:
delete:
operationId: deleteNetwork
parameters:
- description: Network Name
in: path
name: networkname
required: true
type: string
x-go-name: NetworkName
2022-09-11 12:51:59 +08:00
responses:
"200":
$ref: '#/responses/stringJSONResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
summary: Delete a network. Will not delete if there are any nodes that belong to the network.
tags:
- networks
2022-09-11 12:51:59 +08:00
get:
operationId: getNetwork
parameters:
- description: Network Name
in: path
name: networkname
required: true
type: string
x-go-name: NetworkName
2022-09-11 12:51:59 +08:00
responses:
"200":
$ref: '#/responses/networkBodyResponse'
schemes:
- https
summary: Get a network.
tags:
- networks
2022-09-06 20:20:24 +08:00
put:
operationId: updateNetwork
2022-09-11 12:51:59 +08:00
parameters:
- description: Network
in: body
name: network
schema:
$ref: '#/definitions/Network'
x-go-name: Network
- description: Network Name
in: path
name: networkname
required: true
type: string
x-go-name: NetworkName
2022-09-11 12:51:59 +08:00
responses:
"200":
$ref: '#/responses/networkBodyResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
2022-09-11 12:51:59 +08:00
summary: Update a network.
2022-09-06 20:20:24 +08:00
tags:
- networks
/api/networks/{networkname}/acls:
get:
operationId: getNetworkACL
2022-09-11 12:51:59 +08:00
parameters:
- description: Network Name
in: path
name: networkname
required: true
type: string
x-go-name: NetworkName
2022-09-11 12:51:59 +08:00
- description: ACL Container
in: body
name: acl_container
schema:
$ref: '#/definitions/ACLContainer'
x-go-name: ACLContainer
responses:
"200":
$ref: '#/responses/aclContainerResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
summary: Get a network ACL (Access Control List).
tags:
- networks
put:
operationId: updateNetworkACL
2022-09-11 12:51:59 +08:00
parameters:
- description: Network Name
in: path
name: networkname
required: true
type: string
x-go-name: NetworkName
2022-09-11 12:51:59 +08:00
- description: ACL Container
in: body
name: acl_container
schema:
$ref: '#/definitions/ACLContainer'
x-go-name: ACLContainer
responses:
"200":
$ref: '#/responses/aclContainerResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
summary: Update a network ACL (Access Control List).
tags:
- networks
/api/networks/{networkname}/keys:
get:
operationId: getAccessKeys
parameters:
- description: Network Name
in: path
name: networkname
required: true
type: string
x-go-name: NetworkName
2022-09-11 12:51:59 +08:00
responses:
"200":
$ref: '#/responses/accessKeySliceBodyResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
summary: Get network access keys for a network.
tags:
- networks
post:
operationId: createAccessKey
2022-09-11 12:51:59 +08:00
parameters:
- description: Network Name
in: path
name: networkname
required: true
type: string
x-go-name: NetworkName
2022-09-11 12:51:59 +08:00
- description: Access Key
in: body
name: access_key
schema:
$ref: '#/definitions/AccessKey'
x-go-name: AccessKey
responses:
"200":
$ref: '#/responses/accessKeyBodyResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
summary: Create a network access key.
tags:
- networks
/api/networks/{networkname}/keys/{name}:
2022-09-11 12:51:59 +08:00
delete:
2022-09-06 20:20:24 +08:00
operationId: deleteAccessKey
2022-09-11 12:51:59 +08:00
parameters:
- description: Network Name
in: path
name: networkname
required: true
type: string
x-go-name: NetworkName
2022-09-11 12:51:59 +08:00
- description: Access Key Name
in: path
name: access_key_name
required: true
type: string
x-go-name: AccessKeyName
responses:
"200":
description: ""
2022-09-03 04:42:51 +08:00
schemes:
- https
2022-09-06 20:20:24 +08:00
summary: Delete a network access key.
2022-09-03 04:42:51 +08:00
tags:
- networks
2022-09-06 20:20:24 +08:00
/api/networks/{networkname}/keyupdate:
post:
operationId: keyUpdate
parameters:
- description: Network Name
in: path
name: networkname
required: true
type: string
x-go-name: NetworkName
2022-09-11 12:51:59 +08:00
responses:
"200":
$ref: '#/responses/networkBodyResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
summary: Update keys for a network.
tags:
- networks
/api/nodes:
get:
operationId: getAllNodes
2022-09-11 12:51:59 +08:00
responses:
"200":
$ref: '#/responses/nodeSliceResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
summary: Get all nodes across all networks.
tags:
- nodes
/api/nodes/{network}:
get:
operationId: getNetworkNodes
2022-09-11 12:51:59 +08:00
responses:
"200":
$ref: '#/responses/nodeSliceResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
2022-09-11 12:51:59 +08:00
summary: Gets all nodes associated with network including pending nodes.
2022-09-06 20:20:24 +08:00
tags:
- nodes
post:
operationId: createNode
2022-09-11 12:51:59 +08:00
responses:
"200":
$ref: '#/responses/nodeGetResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
summary: Create a node on a network.
tags:
- nodes
/api/nodes/{network}/{nodeid}:
delete:
operationId: deleteNode
2022-09-11 12:51:59 +08:00
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: Node
in: body
name: node
schema:
$ref: '#/definitions/Node'
x-go-name: Node
responses:
"200":
$ref: '#/responses/nodeResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
summary: Delete an individual node.
tags:
- nodes
get:
operationId: getNode
2022-09-11 12:51:59 +08:00
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
responses:
"200":
$ref: '#/responses/nodeResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
summary: Get an individual node.
tags:
- nodes
put:
operationId: updateNode
2022-09-11 12:51:59 +08:00
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: Node
in: body
name: node
schema:
$ref: '#/definitions/Node'
x-go-name: Node
responses:
"200":
$ref: '#/responses/nodeResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
summary: Update an individual node.
tags:
- nodes
/api/nodes/{network}/{nodeid}/approve:
post:
operationId: uncordonNode
2022-09-11 12:51:59 +08:00
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
responses:
"200":
$ref: '#/responses/nodeResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
summary: Takes a node out of pending state.
tags:
- nodes
/api/nodes/{network}/{nodeid}/creategateway:
post:
operationId: createEgressGateway
2022-09-11 12:51:59 +08:00
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: Egress Gateway Request
in: body
name: egress_gateway_request
schema:
$ref: '#/definitions/EgressGatewayRequest'
x-go-name: EgressGatewayRequest
responses:
"200":
$ref: '#/responses/nodeResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
summary: Create an egress gateway.
tags:
- nodes
/api/nodes/{network}/{nodeid}/createingress:
post:
operationId: createIngressGateway
2022-09-11 12:51:59 +08:00
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
responses:
"200":
$ref: '#/responses/nodeResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
summary: Create an ingress gateway.
tags:
- nodes
/api/nodes/{network}/{nodeid}/createrelay:
post:
operationId: createRelay
2022-09-11 12:51:59 +08:00
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: Relay Request
in: body
name: relay_request
schema:
$ref: '#/definitions/RelayRequest'
x-go-name: RelayRequest
responses:
"200":
$ref: '#/responses/nodeResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
summary: Create a relay.
tags:
- nodes
/api/nodes/{network}/{nodeid}/deletegateway:
delete:
operationId: deleteEgressGateway
2022-09-11 12:51:59 +08:00
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
responses:
"200":
$ref: '#/responses/nodeResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
summary: Delete an egress gateway.
tags:
- nodes
/api/nodes/{network}/{nodeid}/deleteingress:
delete:
operationId: deleteIngressGateway
2022-09-11 12:51:59 +08:00
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
responses:
"200":
$ref: '#/responses/nodeResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
summary: Delete an ingress gateway.
tags:
- nodes
/api/nodes/{network}/{nodeid}/deleterelay:
delete:
operationId: deleteRelay
2022-09-11 12:51:59 +08:00
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
responses:
"200":
$ref: '#/responses/nodeResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
summary: Remove a relay.
tags:
- nodes
/api/nodes/adm/{network}/authenticate:
post:
operationId: authenticate
2022-09-11 12:51:59 +08:00
parameters:
- description: AuthParams
in: body
name: auth_params
schema:
$ref: '#/definitions/AuthParams'
x-go-name: AuthParams
responses:
"200":
$ref: '#/responses/successResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
summary: Authenticate to make further API calls related to a network.
tags:
- nodes
/api/oauth/login:
get:
operationId: HandleAuthLogin
schemes:
- https
2022-09-11 12:51:59 +08:00
summary: Handles OAuth login.
2022-09-06 20:20:24 +08:00
tags:
- nodes
/api/server/getconfig:
get:
operationId: getConfig
2022-09-11 12:51:59 +08:00
responses:
"200":
$ref: '#/responses/serverConfigResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
summary: Get the server configuration.
tags:
- server
2022-09-06 20:20:24 +08:00
/api/server/getserverinfo:
get:
operationId: getServerInfo
2022-09-11 12:51:59 +08:00
responses:
"200":
$ref: '#/responses/serverConfigResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
summary: Get the server configuration.
tags:
- server
2022-09-06 20:20:24 +08:00
/api/server/register:
post:
operationId: register
2022-09-11 12:51:59 +08:00
parameters:
- description: Register Request
in: body
name: register_request
schema:
$ref: '#/definitions/RegisterRequest'
x-go-name: RegisterRequest
responses:
"200":
$ref: '#/responses/registerResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
2022-09-11 12:51:59 +08:00
summary: Registers a client with the server and return the Certificate Authority and certificate.
2022-09-06 20:20:24 +08:00
tags:
- server
2022-09-06 20:20:24 +08:00
/api/users:
get:
operationId: getUsers
2022-09-11 12:51:59 +08:00
responses:
"200":
$ref: '#/responses/userBodyResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
2022-09-11 12:51:59 +08:00
summary: Get all users.
2022-09-06 20:20:24 +08:00
tags:
- user
2022-09-06 20:20:24 +08:00
/api/users/{username}:
delete:
operationId: deleteUser
2022-09-11 12:51:59 +08:00
parameters:
- description: Username
in: path
name: username
required: true
type: string
x-go-name: Username
responses:
"200":
$ref: '#/responses/userBodyResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
summary: Delete a user.
tags:
- user
2022-09-06 20:20:24 +08:00
get:
operationId: getUser
2022-09-11 12:51:59 +08:00
parameters:
- description: Username
in: path
name: username
required: true
type: string
x-go-name: Username
responses:
"200":
$ref: '#/responses/userBodyResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
summary: Get an individual user.
tags:
- user
2022-09-06 20:20:24 +08:00
post:
operationId: createUser
2022-09-11 12:51:59 +08:00
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'
2022-09-06 20:20:24 +08:00
schemes:
- https
summary: Create a user.
tags:
- user
2022-09-06 20:20:24 +08:00
put:
operationId: updateUser
2022-09-11 12:51:59 +08:00
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'
2022-09-06 20:20:24 +08:00
schemes:
- https
summary: Update a user.
tags:
- user
2022-09-06 20:20:24 +08:00
/api/users/{username}/adm:
put:
operationId: updateUserAdm
2022-09-11 12:51:59 +08:00
parameters:
- description: Username
in: path
name: username
required: true
type: string
x-go-name: Username
responses:
"200":
$ref: '#/responses/userBodyResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
2022-09-11 12:51:59 +08:00
summary: Updates the given admin user's info (as long as the user is an admin).
2022-09-06 20:20:24 +08:00
tags:
- user
2022-09-06 20:20:24 +08:00
/api/users/adm/authenticate:
post:
operationId: authenticateUser
2022-09-11 12:51:59 +08:00
parameters:
- description: User Auth Params
in: body
name: user_auth_params
schema:
$ref: '#/definitions/UserAuthParams'
x-go-name: UserAuthParams
responses:
"200":
$ref: '#/responses/successResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
summary: Node authenticates using its password and retrieves a JWT for authorization.
tags:
- user
2022-09-06 20:20:24 +08:00
/api/users/adm/createadmin:
post:
operationId: createAdmin
2022-09-11 12:51:59 +08:00
parameters:
- description: User
in: body
name: user
schema:
$ref: '#/definitions/User'
x-go-name: User
responses:
"200":
$ref: '#/responses/userBodyResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
summary: Make a user an admin.
tags:
- user
2022-09-06 20:20:24 +08:00
/api/users/adm/hasadmin:
get:
operationId: hasAdmin
2022-09-11 12:51:59 +08:00
responses:
"200":
$ref: '#/responses/successResponse'
2022-09-06 20:20:24 +08:00
schemes:
- https
summary: Checks whether the server has an admin.
tags:
- user
2022-09-06 20:20:24 +08:00
/api/users/networks/{username}:
put:
operationId: updateUserNetworks
2022-09-11 12:51:59 +08:00
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'
2022-09-06 20:20:24 +08:00
schemes:
- https
2022-09-11 12:51:59 +08:00
summary: Updates the networks of the given user.
2022-09-06 20:20:24 +08:00
tags:
- user
2022-09-07 03:27:21 +08:00
/meshclient/files/{filename}:
get:
operationId: fileServer
schemes:
- https
2022-09-11 12:51:59 +08:00
summary: Retrieve a file from the file server.
2022-09-07 03:27:21 +08:00
tags:
- meshclient
2022-09-03 04:42:51 +08:00
produces:
- application/json
2022-09-11 12:51:59 +08:00
responses:
accessKeyBodyResponse:
description: ""
schema:
$ref: '#/definitions/AccessKey'
accessKeySliceBodyResponse:
description: ""
schema:
items:
$ref: '#/definitions/AccessKey'
type: array
aclContainerResponse:
description: ""
schema:
$ref: '#/definitions/ACLContainer'
boolResponse:
description: ""
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
getNetworksSliceResponse:
description: ""
schema:
items:
$ref: '#/definitions/Network'
type: array
networkBodyResponse:
description: ""
schema:
$ref: '#/definitions/Network'
nodeGetResponse:
description: ""
schema:
$ref: '#/definitions/NodeGet'
nodeLastModifiedResponse:
description: ""
nodeResponse:
description: ""
schema:
$ref: '#/definitions/Node'
nodeSliceResponse:
description: ""
schema:
items:
$ref: '#/definitions/Node'
type: array
serverConfigResponse:
description: ""
schema:
$ref: '#/definitions/ServerConfig'
stringJSONResponse:
description: ""
successResponse:
description: ""
schema:
$ref: '#/definitions/SuccessResponse'
userBodyResponse:
description: ""
schema:
$ref: '#/definitions/User'
2022-09-03 04:42:51 +08:00
schemes:
2022-09-06 20:20:24 +08:00
- https
2022-09-03 04:42:51 +08:00
swagger: "2.0"