mirror of
https://github.com/netbirdio/netbird.git
synced 2025-06-20 17:58:02 +02: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'
|
$ref: '#/components/schemas/CountryCode'
|
||||||
city_name:
|
city_name:
|
||||||
$ref: '#/components/schemas/CityName'
|
$ref: '#/components/schemas/CityName'
|
||||||
|
serial_number:
|
||||||
|
description: System serial number
|
||||||
|
type: string
|
||||||
|
example: "C02XJ0J0JGH7"
|
||||||
required:
|
required:
|
||||||
- city_name
|
- city_name
|
||||||
- connected
|
- connected
|
||||||
@ -356,6 +360,7 @@ components:
|
|||||||
- version
|
- version
|
||||||
- ui_version
|
- ui_version
|
||||||
- approval_required
|
- approval_required
|
||||||
|
- serial_number
|
||||||
AccessiblePeer:
|
AccessiblePeer:
|
||||||
allOf:
|
allOf:
|
||||||
- $ref: '#/components/schemas/PeerMinimum'
|
- $ref: '#/components/schemas/PeerMinimum'
|
||||||
|
@ -523,6 +523,9 @@ type Peer struct {
|
|||||||
// Os Peer's operating system and version
|
// Os Peer's operating system and version
|
||||||
Os string `json:"os"`
|
Os string `json:"os"`
|
||||||
|
|
||||||
|
// SerialNumber System serial number
|
||||||
|
SerialNumber string `json:"serial_number"`
|
||||||
|
|
||||||
// SshEnabled Indicates whether SSH server is enabled on this peer
|
// SshEnabled Indicates whether SSH server is enabled on this peer
|
||||||
SshEnabled bool `json:"ssh_enabled"`
|
SshEnabled bool `json:"ssh_enabled"`
|
||||||
|
|
||||||
@ -592,6 +595,9 @@ type PeerBase struct {
|
|||||||
// Os Peer's operating system and version
|
// Os Peer's operating system and version
|
||||||
Os string `json:"os"`
|
Os string `json:"os"`
|
||||||
|
|
||||||
|
// SerialNumber System serial number
|
||||||
|
SerialNumber string `json:"serial_number"`
|
||||||
|
|
||||||
// SshEnabled Indicates whether SSH server is enabled on this peer
|
// SshEnabled Indicates whether SSH server is enabled on this peer
|
||||||
SshEnabled bool `json:"ssh_enabled"`
|
SshEnabled bool `json:"ssh_enabled"`
|
||||||
|
|
||||||
@ -664,6 +670,9 @@ type PeerBatch struct {
|
|||||||
// Os Peer's operating system and version
|
// Os Peer's operating system and version
|
||||||
Os string `json:"os"`
|
Os string `json:"os"`
|
||||||
|
|
||||||
|
// SerialNumber System serial number
|
||||||
|
SerialNumber string `json:"serial_number"`
|
||||||
|
|
||||||
// SshEnabled Indicates whether SSH server is enabled on this peer
|
// SshEnabled Indicates whether SSH server is enabled on this peer
|
||||||
SshEnabled bool `json:"ssh_enabled"`
|
SshEnabled bool `json:"ssh_enabled"`
|
||||||
|
|
||||||
|
@ -308,6 +308,7 @@ func toSinglePeerResponse(peer *nbpeer.Peer, groupsInfo []api.GroupMinimum, dnsD
|
|||||||
ApprovalRequired: !approved,
|
ApprovalRequired: !approved,
|
||||||
CountryCode: peer.Location.CountryCode,
|
CountryCode: peer.Location.CountryCode,
|
||||||
CityName: peer.Location.CityName,
|
CityName: peer.Location.CityName,
|
||||||
|
SerialNumber: peer.Meta.SystemSerialNumber,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -340,6 +341,7 @@ func toPeerListItemResponse(peer *nbpeer.Peer, groupsInfo []api.GroupMinimum, dn
|
|||||||
AccessiblePeersCount: accessiblePeersCount,
|
AccessiblePeersCount: accessiblePeersCount,
|
||||||
CountryCode: peer.Location.CountryCode,
|
CountryCode: peer.Location.CountryCode,
|
||||||
CityName: peer.Location.CityName,
|
CityName: peer.Location.CityName,
|
||||||
|
SerialNumber: peer.Meta.SystemSerialNumber,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,6 +128,7 @@ func TestGetPeers(t *testing.T) {
|
|||||||
Platform: "platform",
|
Platform: "platform",
|
||||||
OS: "OS",
|
OS: "OS",
|
||||||
WtVersion: "development",
|
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.LoginExpirationEnabled, tc.expectedPeer.LoginExpirationEnabled)
|
||||||
assert.Equal(t, got.SshEnabled, tc.expectedPeer.SSHEnabled)
|
assert.Equal(t, got.SshEnabled, tc.expectedPeer.SSHEnabled)
|
||||||
assert.Equal(t, got.Connected, tc.expectedPeer.Status.Connected)
|
assert.Equal(t, got.Connected, tc.expectedPeer.Status.Connected)
|
||||||
|
assert.Equal(t, got.SerialNumber, tc.expectedPeer.Meta.SystemSerialNumber)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user