mirror of
https://github.com/netbirdio/netbird.git
synced 2024-11-07 16:54:16 +01:00
Return system serial on a peer HTTP API call (#1929)
This commit is contained in:
parent
4e7c17756c
commit
df4ca01848
@ -335,6 +335,10 @@ components:
|
||||
$ref: '#/components/schemas/CountryCode'
|
||||
city_name:
|
||||
$ref: '#/components/schemas/CityName'
|
||||
serial_number:
|
||||
description: System serial number
|
||||
type: string
|
||||
example: "C02XJ0J0JGH7"
|
||||
required:
|
||||
- city_name
|
||||
- connected
|
||||
@ -356,6 +360,7 @@ components:
|
||||
- version
|
||||
- ui_version
|
||||
- approval_required
|
||||
- serial_number
|
||||
AccessiblePeer:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/PeerMinimum'
|
||||
|
@ -523,6 +523,9 @@ type Peer struct {
|
||||
// Os Peer's operating system and version
|
||||
Os string `json:"os"`
|
||||
|
||||
// SerialNumber System serial number
|
||||
SerialNumber string `json:"serial_number"`
|
||||
|
||||
// SshEnabled Indicates whether SSH server is enabled on this peer
|
||||
SshEnabled bool `json:"ssh_enabled"`
|
||||
|
||||
@ -592,6 +595,9 @@ type PeerBase struct {
|
||||
// Os Peer's operating system and version
|
||||
Os string `json:"os"`
|
||||
|
||||
// SerialNumber System serial number
|
||||
SerialNumber string `json:"serial_number"`
|
||||
|
||||
// SshEnabled Indicates whether SSH server is enabled on this peer
|
||||
SshEnabled bool `json:"ssh_enabled"`
|
||||
|
||||
@ -664,6 +670,9 @@ type PeerBatch struct {
|
||||
// Os Peer's operating system and version
|
||||
Os string `json:"os"`
|
||||
|
||||
// SerialNumber System serial number
|
||||
SerialNumber string `json:"serial_number"`
|
||||
|
||||
// SshEnabled Indicates whether SSH server is enabled on this peer
|
||||
SshEnabled bool `json:"ssh_enabled"`
|
||||
|
||||
|
@ -308,6 +308,7 @@ func toSinglePeerResponse(peer *nbpeer.Peer, groupsInfo []api.GroupMinimum, dnsD
|
||||
ApprovalRequired: !approved,
|
||||
CountryCode: peer.Location.CountryCode,
|
||||
CityName: peer.Location.CityName,
|
||||
SerialNumber: peer.Meta.SystemSerialNumber,
|
||||
}
|
||||
}
|
||||
|
||||
@ -340,6 +341,7 @@ func toPeerListItemResponse(peer *nbpeer.Peer, groupsInfo []api.GroupMinimum, dn
|
||||
AccessiblePeersCount: accessiblePeersCount,
|
||||
CountryCode: peer.Location.CountryCode,
|
||||
CityName: peer.Location.CityName,
|
||||
SerialNumber: peer.Meta.SystemSerialNumber,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -128,6 +128,7 @@ func TestGetPeers(t *testing.T) {
|
||||
Platform: "platform",
|
||||
OS: "OS",
|
||||
WtVersion: "development",
|
||||
SystemSerialNumber: "C02XJ0J0JGH7",
|
||||
},
|
||||
}
|
||||
|
||||
@ -245,6 +246,7 @@ func TestGetPeers(t *testing.T) {
|
||||
assert.Equal(t, got.LoginExpirationEnabled, tc.expectedPeer.LoginExpirationEnabled)
|
||||
assert.Equal(t, got.SshEnabled, tc.expectedPeer.SSHEnabled)
|
||||
assert.Equal(t, got.Connected, tc.expectedPeer.Status.Connected)
|
||||
assert.Equal(t, got.SerialNumber, tc.expectedPeer.Meta.SystemSerialNumber)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user