[management] Add routing peer counter (#3036)

This commit is contained in:
Pascal Fischer
2024-12-13 11:57:07 +01:00
committed by GitHub
parent 86352f00fc
commit e436c39a86
16 changed files with 344 additions and 88 deletions

View File

@@ -1241,6 +1241,10 @@ components:
items:
type: string
example: ch8i4ug6lnn4g9hqv7m0
routing_peers_count:
description: Count of routing peers associated with the network
type: integer
example: 2
resources:
description: List of network resource IDs associated with the network
type: array
@@ -1251,8 +1255,9 @@ components:
- id
- routers
- resources
- routing_peers_count
- $ref: '#/components/schemas/NetworkRequest'
NetworkResourceRequest:
NetworkResourceMinimum:
type: object
properties:
name:
@@ -1270,6 +1275,19 @@ components:
required:
- name
- address
NetworkResourceRequest:
allOf:
- $ref: '#/components/schemas/NetworkResourceMinimum'
- type: object
properties:
groups:
description: Group IDs containing the resource
type: array
items:
type: string
example: "chacdk86lnnboviihd70"
required:
- groups
NetworkResource:
allOf:
- type: object
@@ -1280,10 +1298,16 @@ components:
example: chacdk86lnnboviihd7g
type:
$ref: '#/components/schemas/NetworkResourceType'
groups:
description: Groups that the resource belongs to
type: array
items:
$ref: '#/components/schemas/GroupMinimum'
required:
- id
- type
- $ref: '#/components/schemas/NetworkResourceRequest'
- groups
- $ref: '#/components/schemas/NetworkResourceMinimum'
NetworkResourceType:
description: Network resource type based of the address
type: string

View File

@@ -532,6 +532,9 @@ type Network struct {
// Routers List of router IDs associated with the network
Routers []string `json:"routers"`
// RoutingPeersCount Count of routing peers associated with the network
RoutingPeersCount int `json:"routing_peers_count"`
}
// NetworkRequest defines model for NetworkRequest.
@@ -551,6 +554,9 @@ type NetworkResource struct {
// Description Network resource description
Description *string `json:"description,omitempty"`
// Groups Groups that the resource belongs to
Groups []GroupMinimum `json:"groups"`
// Id Network Resource ID
Id string `json:"id"`
@@ -561,6 +567,18 @@ type NetworkResource struct {
Type NetworkResourceType `json:"type"`
}
// NetworkResourceMinimum defines model for NetworkResourceMinimum.
type NetworkResourceMinimum struct {
// Address Network resource address (either a direct host like 1.1.1.1 or 1.1.1.1/32, or a subnet like 192.168.178.0/24, or a domain like example.com)
Address string `json:"address"`
// Description Network resource description
Description *string `json:"description,omitempty"`
// Name Network resource name
Name string `json:"name"`
}
// NetworkResourceRequest defines model for NetworkResourceRequest.
type NetworkResourceRequest struct {
// Address Network resource address (either a direct host like 1.1.1.1 or 1.1.1.1/32, or a subnet like 192.168.178.0/24, or a domain like example.com)
@@ -569,6 +587,9 @@ type NetworkResourceRequest struct {
// Description Network resource description
Description *string `json:"description,omitempty"`
// Groups Group IDs containing the resource
Groups []string `json:"groups"`
// Name Network resource name
Name string `json:"name"`
}