v1.16.7
This commit is contained in:
dayterr
2026-10-09 16:23:35 +03:00
parent 25e2242360
commit 8cde0e9371
80 changed files with 2303 additions and 606 deletions

View File

@@ -47,7 +47,7 @@ var testRoutersList = RoutersList{
},
},
Status: Status{
Common: "active",
OperationStatus: "Synchronized",
},
VersionID: 1,
},
@@ -93,7 +93,7 @@ var testRoutersList = RoutersList{
},
},
Status: Status{
Common: "active",
OperationStatus: "Synchronized",
},
VersionID: 2,
},
@@ -139,7 +139,7 @@ var testRoutersList = RoutersList{
},
},
Status: Status{
Common: "inactive",
OperationStatus: "FailedAtCore",
},
VersionID: 3,
},
@@ -270,7 +270,7 @@ func TestFilterBySNATEnabled(t *testing.T) {
func TestFilterByStatus(t *testing.T) {
actual := testRoutersList.FilterFunc(func(rm RoutersModel) bool {
return rm.Status.Common == "inactive"
return rm.Status.OperationStatus == "FailedAtCore"
})
if len(actual) != 1 || actual[0].ID != "router3" {

View File

@@ -70,6 +70,15 @@ type ExternalNetworkPort struct {
// Floating IP
FloatingIP FloatingIP `json:"floating_ip"`
// External network ID
ExternalNetworkID string `json:"external_network_id"`
// ID
ID string `json:"id"`
// Version ID
VersionID uint64 `json:"version_id"`
}
// IPv6 configuration information
@@ -123,7 +132,7 @@ type FloatingIP struct {
CreatedAt string `json:"created_at"`
// External network port
ExternalNetworkPort string `json:"external_network_port"`
ExternalNetworkPort *ExternalNetworkPort `json:"external_network_port"`
// ID
ID string `json:"id"`
@@ -132,7 +141,55 @@ type FloatingIP struct {
LogicalPort LogicalPort `json:"logical_port"`
// Router
Router string `json:"router"`
Router *Router `json:"router"`
// Updated time
UpdatedAt string `json:"updated_at"`
// Created by
CreatedBy string `json:"created_by"`
// Updated by
UpdatedBy string `json:"updated_by"`
// Version ID
VersionID uint64 `json:"version_id"`
}
// Router information
type Router struct {
// Access group ID
AccessGroupID string `json:"access_group_id"`
// Access group name
AccessGroupName string `json:"access_group_name"`
// Created time
CreatedAt string `json:"created_at"`
// Description
Description string `json:"description"`
// Display name
DisplayName string `json:"display_name"`
// Enabled flag
Enabled bool `json:"enabled"`
// List of gateway ports
GatewayPorts []GatewayPort `json:"gateway_ports"`
// ID
ID string `json:"id"`
// List of policies
Policies []Policy `json:"policies"`
// List of ports
Ports []Port `json:"ports"`
// Status information
Status Status `json:"status"`
// Updated time
UpdatedAt string `json:"updated_at"`
@@ -170,6 +227,9 @@ type LogicalPort struct {
// Enabled flag
Enabled bool `json:"enabled"`
// Exclude firewall information
ExcludeFirewall ExcludeFirewall `json:"exclude_firewall"`
// External network ID
ExternalNetworkID string `json:"external_network_id"`
@@ -179,6 +239,9 @@ type LogicalPort struct {
// Hypervisor display name
HypervisorDisplayName string `json:"hypervisor_display_name"`
// Labels
Labels Labels `json:"labels"`
// Live migration target HV
LiveMigrationTargetHV string `json:"live_migration_target_hv"`
@@ -200,8 +263,8 @@ type LogicalPort struct {
// Status information
type Status struct {
// Common status
Common string `json:"common"`
// Operation status
OperationStatus string `json:"operation_status"`
// Hypervisors status list
Hypervisors []HypervisorStatus `json:"hypervisors"`
@@ -209,8 +272,8 @@ type Status struct {
// Hypervisor status information
type HypervisorStatus struct {
// Status
Status string `json:"status"`
// Operation status
OperationStatus string `json:"operation_status"`
// Name
Name string `json:"name"`
@@ -225,6 +288,27 @@ type HypervisorStatus struct {
SyncedAt string `json:"synced_at"`
}
// Exclude firewall information
type ExcludeFirewall struct {
// Exclusion reason
ExclusionReason string `json:"exclusion_reason"`
// Logical port addresses excluded flag
LogicalPortAddressesExcluded bool `json:"logical_port_addresses_excluded"`
// Logical port excluded flag
LogicalPortExcluded bool `json:"logical_port_excluded"`
}
// Labels information
type Labels struct {
// VM ID
VMID string `json:"vm_id"`
// VM name
VMName string `json:"vm_name"`
}
// Bindings information
type Bindings struct {
// ID
@@ -242,9 +326,6 @@ type Bindings struct {
// Address detection flag
AddressDetection bool `json:"address_detection"`
// Is excluded from firewall flag
IsExcludedFromFirewall bool `json:"is_excluded_from_firewall"`
// Version ID
VersionID uint64 `json:"version_id"`
@@ -395,6 +476,9 @@ type Segment struct {
// Logical ports info list
LogicalPortsInfo []LogicalPortInfo `json:"logical_ports_info"`
// L2 connection port information
L2ConnectionPort *L2ConnectionPort `json:"l2_connection_port,omitempty"`
// Routers info list
RoutersInfo []RouterInfo `json:"routers_info"`
@@ -407,6 +491,9 @@ type Segment struct {
// IPv6 subnet
SubnetV6 string `json:"subnet_v6"`
// Type
Type string `json:"type"`
// Updated time
UpdatedAt string `json:"updated_at"`
@@ -479,3 +566,66 @@ type RouterInfo struct {
// ID
ID string `json:"id"`
}
// L2 connection port information
type L2ConnectionPort struct {
// Access group ID
AccessGroupID string `json:"access_group_id"`
// Created time
CreatedAt string `json:"created_at"`
// Created by
CreatedBy string `json:"created_by"`
// ID
ID string `json:"id"`
// L2 external network information
L2ExternalNetwork L2ExternalNetwork `json:"l2_external_network"`
// Updated time
UpdatedAt string `json:"updated_at"`
// Updated by
UpdatedBy string `json:"updated_by"`
// Version ID
VersionID uint64 `json:"version_id"`
}
// L2 external network information
type L2ExternalNetwork struct {
// ID
ID string `json:"id"`
// Display name
DisplayName string `json:"display_name"`
// Description
Description string `json:"description"`
// Bridge network name
BridgeNetworkName string `json:"bridge_network_name"`
// Hypervisors list
Hypervisors []string `json:"hypervisors"`
// VLAN tag
VLANTag uint64 `json:"vlan_tag"`
// Created time
CreatedAt string `json:"created_at"`
// Created by
CreatedBy string `json:"created_by"`
// Updated time
UpdatedAt string `json:"updated_at"`
// Updated by
UpdatedBy string `json:"updated_by"`
// Version ID
VersionID uint64 `json:"version_id"`
}

View File

@@ -57,6 +57,10 @@ type ListRequest struct {
// Sort order (asc/desc)
// Required: false
SortOrder string `url:"sort_order,omitempty" json:"sort_order,omitempty" validate:"omitempty,oneof=asc desc"`
// Filter by operation status
// Required: false
OperationStatus string `url:"operation_status,omitempty" json:"operation_status,omitempty"`
}
// List of routers

View File

@@ -112,6 +112,15 @@ type ExternalNetworkPort struct {
// Floating IP
FloatingIP FloatingIP `json:"floating_ip"`
// External network ID
ExternalNetworkID string `json:"external_network_id"`
// ID
ID string `json:"id"`
// Version ID
VersionID uint64 `json:"version_id"`
}
// IPv6 configuration information
@@ -165,7 +174,7 @@ type FloatingIP struct {
CreatedAt string `json:"created_at"`
// External network port
ExternalNetworkPort string `json:"external_network_port"`
ExternalNetworkPort *ExternalNetworkPort `json:"external_network_port"`
// ID
ID string `json:"id"`
@@ -174,11 +183,17 @@ type FloatingIP struct {
LogicalPort LogicalPort `json:"logical_port"`
// Router
Router string `json:"router"`
Router *RoutersModel `json:"router"`
// Updated time
UpdatedAt string `json:"updated_at"`
// Created by
CreatedBy string `json:"created_by"`
// Updated by
UpdatedBy string `json:"updated_by"`
// Version ID
VersionID uint64 `json:"version_id"`
}
@@ -212,6 +227,9 @@ type LogicalPort struct {
// Enabled flag
Enabled bool `json:"enabled"`
// Exclude firewall information
ExcludeFirewall ExcludeFirewall `json:"exclude_firewall"`
// External network ID
ExternalNetworkID string `json:"external_network_id"`
@@ -221,6 +239,9 @@ type LogicalPort struct {
// Hypervisor display name
HypervisorDisplayName string `json:"hypervisor_display_name"`
// Labels
Labels Labels `json:"labels"`
// Live migration target HV
LiveMigrationTargetHV string `json:"live_migration_target_hv"`
@@ -242,8 +263,8 @@ type LogicalPort struct {
// Status information
type Status struct {
// Common status
Common string `json:"common"`
// Operation status
OperationStatus string `json:"operation_status"`
// Hypervisors status list
Hypervisors []HypervisorStatus `json:"hypervisors"`
@@ -251,8 +272,8 @@ type Status struct {
// Hypervisor status information
type HypervisorStatus struct {
// Status
Status string `json:"status"`
// Operation status
OperationStatus string `json:"operation_status"`
// Name
Name string `json:"name"`
@@ -267,6 +288,27 @@ type HypervisorStatus struct {
SyncedAt string `json:"synced_at"`
}
// Exclude firewall information
type ExcludeFirewall struct {
// Exclusion reason
ExclusionReason string `json:"exclusion_reason"`
// Logical port addresses excluded flag
LogicalPortAddressesExcluded bool `json:"logical_port_addresses_excluded"`
// Logical port excluded flag
LogicalPortExcluded bool `json:"logical_port_excluded"`
}
// Labels information
type Labels struct {
// VM ID
VMID string `json:"vm_id"`
// VM name
VMName string `json:"vm_name"`
}
// Bindings information
type Bindings struct {
// ID
@@ -284,9 +326,6 @@ type Bindings struct {
// Address detection flag
AddressDetection bool `json:"address_detection"`
// Is excluded from firewall flag
IsExcludedFromFirewall bool `json:"is_excluded_from_firewall"`
// Version ID
VersionID uint64 `json:"version_id"`
@@ -437,6 +476,9 @@ type Segment struct {
// Logical ports info list
LogicalPortsInfo []LogicalPortInfo `json:"logical_ports_info"`
// L2 connection port information
L2ConnectionPort *L2ConnectionPort `json:"l2_connection_port,omitempty"`
// Routers info list
RoutersInfo []RouterInfo `json:"routers_info"`
@@ -449,6 +491,9 @@ type Segment struct {
// IPv6 subnet
SubnetV6 string `json:"subnet_v6"`
// Type
Type string `json:"type"`
// Updated time
UpdatedAt string `json:"updated_at"`
@@ -521,3 +566,66 @@ type RouterInfo struct {
// ID
ID string `json:"id"`
}
// L2 connection port information
type L2ConnectionPort struct {
// Access group ID
AccessGroupID string `json:"access_group_id"`
// Created time
CreatedAt string `json:"created_at"`
// Created by
CreatedBy string `json:"created_by"`
// ID
ID string `json:"id"`
// L2 external network information
L2ExternalNetwork L2ExternalNetwork `json:"l2_external_network"`
// Updated time
UpdatedAt string `json:"updated_at"`
// Updated by
UpdatedBy string `json:"updated_by"`
// Version ID
VersionID uint64 `json:"version_id"`
}
// L2 external network information
type L2ExternalNetwork struct {
// ID
ID string `json:"id"`
// Display name
DisplayName string `json:"display_name"`
// Description
Description string `json:"description"`
// Bridge network name
BridgeNetworkName string `json:"bridge_network_name"`
// Hypervisors list
Hypervisors []string `json:"hypervisors"`
// VLAN tag
VLANTag uint64 `json:"vlan_tag"`
// Created time
CreatedAt string `json:"created_at"`
// Created by
CreatedBy string `json:"created_by"`
// Updated time
UpdatedAt string `json:"updated_at"`
// Updated by
UpdatedBy string `json:"updated_by"`
// Version ID
VersionID uint64 `json:"version_id"`
}

View File

@@ -26,9 +26,9 @@ type ListRequest struct {
// Required: false
PerPage uint64 `url:"per_page,omitempty" json:"per_page,omitempty"`
// Field to sort by (display_name, subnet, created_at, updated_at)
// Field to sort by (created_at, updated_at, priority)
// Required: false
SortBy string `url:"sort_by,omitempty" json:"sort_by,omitempty" validate:"omitempty,oneof=display_name subnet created_at updated_at"`
SortBy string `url:"sort_by,omitempty" json:"sort_by,omitempty" validate:"omitempty,oneof=created_at updated_at priority"`
// Sort order (asc/desc)
// Required: false