Files
decort-golang-sdk/pkg/sdn/extnet/models.go
dayterr 8cde0e9371 v1.16.7
v1.16.7
2026-10-09 16:23:35 +03:00

688 lines
14 KiB
Go

package extnet
import "time"
// List external networks
type ListExtNet []ExternalNetworkResponse
type ExternalNetworkResponse struct {
// Name of the bridge network
BridgeNetworkName string `json:"bridge_network_name"`
// IPv4 default gateway address
DefaultGatewayIPv4 string `json:"default_gateway_ipv4"`
// IPv6 default gateway address
DefaultGatewayIPv6 string `json:"default_gateway_ipv6"`
// Detailed description of the external network
Description string `json:"description"`
// List of external network ports
ExternalNetworkPorts []ExternalNetworkPort `json:"external_network_ports"`
// List of hypervisor names
Hypervisors []string `json:"hypervisors"`
// Extnet ID
ID string `json:"id"`
// Status
Status Status `json:"status"`
// ID of version
VersionID uint64 `json:"version_id"`
// IPv4 subnet in CIDR notation
SubnetV4 string `json:"subnet_v4"`
// IPv6 subnet in CIDR notation
SubnetV6 string `json:"subnet_v6"`
// Creation time
CreatedAt time.Time `json:"created_at"`
// Update time
UpdatedAt time.Time `json:"updated_at"`
// VLAN tag identifier
VLANTag int64 `json:"vlan_tag"`
}
type ExternalNetworkPort struct {
// Access group ID
AccessGroupID string `json:"access_group_id"`
// Access group name
AccessGroupName string `json:"access_group_name"`
// Comment for the external network port
Comment string `json:"comment"`
// User-friendly name for the external network port
DisplayName string `json:"display_name"`
// Whether the network port is enabled
Enabled bool `json:"enabled"`
// IPv4
IPv4 string `json:"ipv4"`
// IPv6
IPv6 string `json:"ipv6"`
// IPv6 Config
IPv6Config IPv6Config `json:"ipv6_config"`
// MAC address
MAC string `json:"mac"`
// Router gateway port
RouterGatewayPort RouterGatewayPort `json:"router_gateway_port"`
// Floating IP
FloatingIP FloatingIP `json:"floating_ip"`
// ID of external network
ExternalNetworkID string `json:"external_network_id"`
// ID of external network port
ID string `json:"id"`
// ID of version
VersionID uint64 `json:"version_id"`
}
type IPv6Config struct {
// Address mode
AddressMode string `json:"address_mode"`
// If true, the port will periodically send RA packets.
EnablePeriodicRa bool `json:"enable_periodic_ra"`
// The number of waiting seconds between sending periodic RA
IntervalRa int64 `json:"interval_ra"`
// The Default Router Preference (PRF) indicates whether this router should be preferred over other default routers.
RouterPreference string `json:"router_preference"`
}
type RouterGatewayPort struct {
// Creation time
CreatedAt time.Time `json:"created_at"`
// Description
Description string `json:"description"`
// Port ID
ID string `json:"id"`
// User-friendly name for the external network port
RouterDisplayName string `json:"router_display_name"`
// Router ID
RouterID string `json:"router_id"`
// SNAT Enabled
SNATEnabled bool `json:"snat_enabled"`
// Update time
UpdatedAt time.Time `json:"updated_at"`
}
type FloatingIP struct {
// Access group ID
AccessGroupID string `json:"access_group_id"`
// Access group name
AccessGroupName string `json:"access_group_name"`
// Created time
CreatedAt time.Time `json:"created_at"`
// External network port
ExternalNetworkPort *ExternalNetworkPort `json:"external_network_port"`
// ID of floating IP
ID string `json:"id"`
// Logical Port
LogicalPort LogicalPort `json:"logical_port"`
// Router
Router Router `json:"router"`
// Update time
UpdatedAt time.Time `json:"updated_at"`
// ID of the user who created the floating IP
CreatedBy string `json:"created_by"`
// ID of the user who last updated the floating IP
UpdatedBy string `json:"updated_by"`
// ID of version
VersionID uint64 `json:"version_id"`
}
type LogicalPort struct {
// Logical Port ID
ID string `json:"id"`
// Access group ID
AccessGroupID string `json:"access_group_id"`
// Access group name
AccessGroupName string `json:"access_group_name"`
// MAC of adapter
AdapterMAC string `json:"adapter_mac"`
// Address detection
AddressDetection bool `json:"address_detection"`
// Description
Description string `json:"description"`
// Created time
CreatedAt time.Time `json:"created_at"`
// User-friendly name for router
DisplayName string `json:"display_name"`
// Whether the logical port is enabled
Enabled bool `json:"enabled"`
// Exclude firewall information
ExcludeFirewall ExcludeFirewall `json:"exclude_firewall"`
// External Network ID
ExternalNetworkID string `json:"external_network_id"`
// Hypervisor name
Hypervisor string `json:"hypervisor"`
// User-friendly name for hypervisor
HypervisorDisplayName string `json:"hypervisor_display_name"`
// Labels
Labels Labels `json:"labels"`
// Live Migration Target Hv
LiveMigrationTargetHV string `json:"live_migration_target_hv"`
// Status
Status Status `json:"status"`
// Bindings struct
Bindings PortBindings `json:"bindings"`
// Unique Identifier
UniqueIDentifier string `json:"unique_identifier"`
// Updated time
UpdatedAt time.Time `json:"updated_at"`
// ID of version
VersionID uint64 `json:"version_id"`
}
type ExcludeFirewall struct {
// Exclusion reason
ExclusionReason string `json:"exclusion_reason"`
// Whether logical port addresses are excluded from firewall
LogicalPortAddressesExcluded bool `json:"logical_port_addresses_excluded"`
// Whether logical port is excluded from firewall
LogicalPortExcluded bool `json:"logical_port_excluded"`
}
type Labels struct {
// VM ID
VMID string `json:"vm_id"`
// VM name
VMName string `json:"vm_name"`
}
type PortBindings struct {
// Binding ID
ID string `json:"id"`
// User-friendly name for segment
SegmentDisplayName string `json:"segment_display_name"`
// Segment ID
SegmentID string `json:"segment_id"`
// Port security
PortSecurity bool `json:"port_security"`
// Address detection
AddressDetection bool `json:"address_detection"`
// ID of version
VersionID uint64 `json:"version_id"`
// Created time
CreatedAt time.Time `json:"created_at"`
// Update time
UpdatedAt time.Time `json:"updated_at"`
// Logical port addresses
LogicalPortAddresses []LogicalPortAddress `json:"logical_port_addresses"`
}
type LogicalPortAddress struct {
// IP of port
IP string `json:"ip"`
// IP type (IPv4 or IPv6)
IPType string `json:"ip_type"`
// Is discovered
IsDiscovered bool `json:"is_discovered"`
// Is primary
IsPrimary bool `json:"is_primary"`
// MAC
MAC string `json:"mac"`
// ID
ID string `json:"id"`
// Logical port id
LogicalPortID string `json:"logical_port_id"`
// Assigned time
AssignedAt time.Time `json:"assigned_at"`
}
type Router struct {
// Access group ID
AccessGroupID string `json:"access_group_id"`
// Access group name
AccessGroupName string `json:"access_group_name"`
// Created time
CreatedAt time.Time `json:"created_at"`
// Detailed description of the router
Description string `json:"description"`
// User-friendly name for the router
DisplayName string `json:"display_name"`
// Whether the router is enabled
Enabled bool `json:"enabled"`
// Gateway ports
GatewayPorts []GatewayPort `json:"gateway_ports"`
// ID of router
ID string `json:"id"`
// Policies
Policies []RouterPolicy `json:"policies"`
// Ports
Ports []RouterPort `json:"ports"`
// Status
Status Status `json:"status"`
// Update time
UpdatedAt time.Time `json:"updated_at"`
// ID of version
VersionID uint64 `json:"version_id"`
}
type GatewayPort struct {
// Created time
CreatedAt time.Time `json:"created_at"`
// Description
Description string `json:"description"`
// L4 port max
ExternalL4PortMax int64 `json:"external_l4_port_max"`
// L4 port min
ExternalL4PortMin int64 `json:"external_l4_port_min"`
// External network port
ExternalNetworkPort *ExternalNetworkPort `json:"external_network_port"`
// ID of port
ID string `json:"id"`
// SNAT Enabled
SNATEnabled bool `json:"snat_enabled"`
// Status
Status Status `json:"status"`
// Update time
UpdatedAt time.Time `json:"updated_at"`
// ID of version
VersionID uint64 `json:"version_id"`
}
type RouterPolicy struct {
// Action
Action string `json:"action"`
// Created time
CreatedAt time.Time `json:"created_at"`
// User-friendly name for the policy
DisplayName string `json:"display_name"`
// Whether the policy is enabled
Enabled bool `json:"enabled"`
// ID of router policy
ID string `json:"id"`
// Match
Match interface{} `json:"match"`
// Next IPv4 address
NextIPv4Address []string `json:"next_ipv4_address"`
// Next IPv6 address
NextIPv6Address []string `json:"next_ipv6_address"`
// Priority number
Priority int64 `json:"priority"`
// Update time
UpdatedAt time.Time `json:"updated_at"`
// ID of version
VersionID uint64 `json:"version_id"`
}
type RouterPort struct {
// Created at
CreatedAt time.Time `json:"created_at"`
// Detailed description of the router port
Description string `json:"description"`
// Whether the router port is enabled
Enabled bool `json:"enabled"`
// ID of router port
ID string `json:"id"`
// Next IPv4 address
IPv4Address string `json:"ipv4_address"`
// Next IPv6 address
IPv6Address string `json:"ipv6_address"`
// IPv6 Config
IPv6Config IPv6Config `json:"ipv6_config"`
// MAC address
MAC string `json:"mac"`
// Segment
Segment Segment `json:"segment"`
// Segment ID
SegmentID string `json:"segment_id"`
// Status
Status Status `json:"status"`
// Update time
UpdatedAt time.Time `json:"updated_at"`
// ID of version
VersionID uint64 `json:"version_id"`
}
type Segment struct {
// Access group ID
AccessGroupID string `json:"access_group_id"`
// Access group name
AccessGroupName string `json:"access_group_name"`
// Created time
CreatedAt time.Time `json:"created_at"`
// Detailed description of the router port
Description string `json:"description"`
// DHCP IPv4
DHCPv4 DHCPv4Config `json:"dhcp_v4"`
// DHCP IPv6
DHCPv6 DHCPv6Config `json:"dhcp_v6"`
// User-friendly name for the segment
DisplayName string `json:"display_name"`
// Whether the segment is enabled
Enabled bool `json:"enabled"`
// ID of segment
ID string `json:"id"`
// L2 connection port info
L2ConnectionPort *L2ConnectionPort `json:"l2_connection_port,omitempty"`
// Logical ports info
LogicalPortsInfo []EntityInfo `json:"logical_ports_info"`
// Routers info
RoutersInfo []EntityInfo `json:"routers_info"`
// Status
Status Status `json:"status"`
// IPv4 subnet in CIDR notation
SubnetV4 string `json:"subnet_v4"`
// IPv6 subnet in CIDR notation
SubnetV6 string `json:"subnet_v6"`
// Type of segment
Type string `json:"type"`
// Update time
UpdatedAt time.Time `json:"updated_at"`
// ID of version
VersionID uint64 `json:"version_id"`
}
// L2ConnectionPort holds information about the L2 connection port of a segment
type L2ConnectionPort struct {
// ID of the L2 connection port
ID string `json:"id"`
// Access group ID
AccessGroupID string `json:"access_group_id"`
// ID of version
VersionID uint64 `json:"version_id"`
// L2 external network details
L2ExternalNetwork L2ExternalNetwork `json:"l2_external_network"`
// Created time
CreatedAt time.Time `json:"created_at"`
// ID of the user who created the port
CreatedBy string `json:"created_by"`
// Updated time
UpdatedAt time.Time `json:"updated_at"`
// ID of the user who last updated the port
UpdatedBy string `json:"updated_by"`
}
// L2ExternalNetwork holds information about an L2 external network
type L2ExternalNetwork struct {
// ID of the network
ID string `json:"id"`
// User-friendly name for the network
DisplayName string `json:"display_name"`
// Detailed description of the network
Description string `json:"description"`
// Bridge network name
BridgeNetworkName string `json:"bridge_network_name"`
// List of hypervisor IDs attached to the network
Hypervisors []string `json:"hypervisors"`
// VLAN tag
VLANTag uint64 `json:"vlan_tag"`
// ID of version
VersionID uint64 `json:"version_id"`
// Created time
CreatedAt time.Time `json:"created_at"`
// ID of the user who created the network
CreatedBy string `json:"created_by"`
// Updated time
UpdatedAt time.Time `json:"updated_at"`
// ID of the user who last updated the network
UpdatedBy string `json:"updated_by"`
}
type DHCPv4Config struct {
// DNS
DNS []string `json:"dns"`
// Excluded address ranges
ExcludedAddressRanges []string `json:"excluded_address_ranges"`
// Gateway
Gateway string `json:"gateway"`
// ID of config
ID string `json:"id"`
// Lease time
LeaseTime int64 `json:"lease_time"`
// Server IP
ServerIP string `json:"server_ip"`
// Server MAC
ServerMAC string `json:"server_mac"`
// Whether the config is enabled
Enabled bool `json:"enabled"`
}
type DHCPv6Config struct {
// Address prefix
AddressPrefix string `json:"address_prefix"`
// DNS
DNS []string `json:"dns"`
// ID of config
ID string `json:"id"`
// Lease time
LeaseTime int64 `json:"lease_time"`
// Server MAC
ServerMAC string `json:"server_mac"`
// Whether the config is enabled
Enabled bool `json:"enabled"`
}
type EntityInfo struct {
// User-friendly name for the entity
DisplayName string `json:"display_name"`
// ID of entity
ID string `json:"id"`
}
type Status struct {
// Operation status
OperationStatus string `json:"operation_status"`
// Hypervisors status
Hypervisors []HypervisorStatus `json:"hypervisors"`
// Hypervisor status
HypervisorStatus string `json:"hypervisor_status"`
}
type HypervisorStatus struct {
// Operation status
OperationStatus string `json:"operation_status"`
// Name of hypervisor
Name string `json:"name"`
// User-friendly name for the hypervisor
DisplayName string `json:"display_name"`
// Hypervisor status
HypervisorStatus string `json:"hypervisor_status"`
// Synced time
SyncedAt time.Time `json:"synced_at"`
}
type ExternalNetworkAddPortsResponce struct {
// ID of extnet port
ID string `json:"id"`
// ID of extnet
ExtNetID string `json:"external_network_id"`
// User-friendly name for the external network port
DisplayName string `json:"display_name"`
// Comment
Comment string `json:"comment"`
// Mac
MAC string `json:"mac"`
// IPv4 gateway address
IPv4 string `json:"ipv4"`
// IPv6 gateway address
IPv6 string `json:"ipv6"`
// IPv6 config
IPv6Config IPv6Config `json:"ipv6_config"`
// Whether the network port is enabled
Enabled bool `json:"enabled"`
// ID of version
VersionID uint64 `json:"version_id"`
// Router gateway port
RouterGatewayPort RouterGatewayPort `json:"router_gateway_port"`
}