neutron

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const GetAgents = `-- name: GetAgents :many
SELECT
    a.id,
    a.agent_type,
    a.` + "`" + `binary` + "`" + ` as service,
    a.host as hostname,
    CASE
        WHEN a.admin_state_up = 1 THEN 'enabled'
        ELSE 'disabled'
    END as admin_state,
    a.availability_zone as zone,
    CASE
        WHEN TIMESTAMPDIFF(SECOND, a.heartbeat_timestamp, NOW()) <= 75 THEN 1
        ELSE 0
    END as alive
FROM
    agents a
`
View Source
const GetFloatingIPs = `` /* 212-byte string literal not displayed */
View Source
const GetHARouterAgentPortBindingsWithAgents = `` /* 330-byte string literal not displayed */
View Source
const GetNetworkIPAvailabilitiesTotal = `` /* 489-byte string literal not displayed */
View Source
const GetNetworkIPAvailabilitiesUsed = `` /* 404-byte string literal not displayed */
View Source
const GetNetworks = `` /* 1238-byte string literal not displayed */
View Source
const GetPorts = `` /* 558-byte string literal not displayed */
View Source
const GetQuotas = `-- name: GetQuotas :many
SELECT
    q.project_id,
    q.resource,
    q.` + "`" + `limit` + "`" + `
FROM
    quotas q
WHERE
    q.project_id IS NOT NULL
`
View Source
const GetResourceCountsByProject = `` /* 1508-byte string literal not displayed */
View Source
const GetRouters = `` /* 227-byte string literal not displayed */
View Source
const GetSecurityGroupCount = `-- name: GetSecurityGroupCount :one
SELECT
    CAST(COUNT(*) AS SIGNED) as cnt
FROM
    securitygroups
`
View Source
const GetSubnetPools = `` /* 434-byte string literal not displayed */
View Source
const GetSubnets = `` /* 640-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	ID                 string
	AgentType          string
	Binary             string
	Topic              string
	Host               string
	AdminStateUp       bool
	CreatedAt          time.Time
	StartedAt          time.Time
	HeartbeatTimestamp time.Time
	Description        sql.NullString
	Configurations     string
	Load               int32
	AvailabilityZone   sql.NullString
	ResourceVersions   sql.NullString
	ResourcesSynced    sql.NullBool
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type Dnsnameserver

type Dnsnameserver struct {
	Address  string
	SubnetID string
	Order    int32
}

type Externalnetwork

type Externalnetwork struct {
	NetworkID string
	IsDefault bool
}

type Floatingip

type Floatingip struct {
	ProjectID         sql.NullString
	ID                string
	FloatingIpAddress string
	FloatingNetworkID string
	FloatingPortID    string
	FixedPortID       sql.NullString
	FixedIpAddress    sql.NullString
	RouterID          sql.NullString
	LastKnownRouterID sql.NullString
	Status            sql.NullString
	StandardAttrID    int64
}

type GetAgentsRow

type GetAgentsRow struct {
	ID         string
	AgentType  string
	Service    string
	Hostname   string
	AdminState string
	Zone       sql.NullString
	Alive      int32
}

type GetFloatingIPsRow

type GetFloatingIPsRow struct {
	ID                string
	FloatingIpAddress string
	FloatingNetworkID string
	ProjectID         sql.NullString
	RouterID          sql.NullString
	Status            sql.NullString
	FixedIpAddress    sql.NullString
}

type GetHARouterAgentPortBindingsWithAgentsRow

type GetHARouterAgentPortBindingsWithAgentsRow struct {
	RouterID                string
	L3AgentID               sql.NullString
	State                   NullHaRouterAgentPortBindingsState
	AgentHost               sql.NullString
	AgentAdminStateUp       sql.NullBool
	AgentHeartbeatTimestamp sql.NullTime
}

type GetNetworkIPAvailabilitiesTotalRow

type GetNetworkIPAvailabilitiesTotalRow struct {
	SubnetName  sql.NullString
	NetworkName sql.NullString
	SubnetID    string
	NetworkID   string
	FirstIp     sql.NullString
	LastIp      sql.NullString
	ProjectID   sql.NullString
	Cidr        string
	IpVersion   int32
}

type GetNetworkIPAvailabilitiesUsedRow

type GetNetworkIPAvailabilitiesUsedRow struct {
	SubnetID        string
	SubnetName      sql.NullString
	Cidr            string
	IpVersion       int32
	ProjectID       sql.NullString
	NetworkID       sql.NullString
	NetworkName     sql.NullString
	AllocationCount int64
}

type GetNetworksRow

type GetNetworksRow struct {
	ID                      string
	Name                    sql.NullString
	ProjectID               sql.NullString
	Status                  sql.NullString
	ProviderNetworkType     sql.NullString
	ProviderPhysicalNetwork sql.NullString
	ProviderSegmentationID  interface{}
	Subnets                 interface{}
	IsExternal              int32
	IsShared                int32
	Tags                    interface{}
}

type GetPortsRow

type GetPortsRow struct {
	ID             string
	MacAddress     string
	DeviceOwner    string
	Status         string
	NetworkID      string
	AdminStateUp   bool
	IpAllocation   sql.NullString
	BindingVifType sql.NullString
	FixedIps       interface{}
}

type GetQuotasRow

type GetQuotasRow struct {
	ProjectID sql.NullString
	Resource  sql.NullString
	Limit     sql.NullInt32
}

type GetResourceCountsByProjectRow

type GetResourceCountsByProjectRow struct {
	ProjectID sql.NullString
	Resource  string
	Cnt       int64
}

type GetRoutersRow

type GetRoutersRow struct {
	ID                string
	Name              sql.NullString
	Status            sql.NullString
	AdminStateUp      sql.NullBool
	ProjectID         sql.NullString
	ExternalNetworkID string
}

type GetSubnetPoolsRow

type GetSubnetPoolsRow struct {
	ID               string
	IpVersion        int32
	MaxPrefixlen     int32
	MinPrefixlen     int32
	DefaultPrefixlen int32
	ProjectID        sql.NullString
	Name             sql.NullString
	Prefixes         interface{}
}

type GetSubnetsRow

type GetSubnetsRow struct {
	ID             string
	Name           sql.NullString
	Cidr           string
	GatewayIp      sql.NullString
	NetworkID      string
	ProjectID      sql.NullString
	EnableDhcp     sql.NullBool
	DnsNameservers interface{}
	SubnetpoolID   sql.NullString
	Tags           interface{}
}

type HaRouterAgentPortBinding

type HaRouterAgentPortBinding struct {
	PortID    string
	RouterID  string
	L3AgentID sql.NullString
	State     NullHaRouterAgentPortBindingsState
}

type HaRouterAgentPortBindingsState

type HaRouterAgentPortBindingsState string
const (
	HaRouterAgentPortBindingsStateActive  HaRouterAgentPortBindingsState = "active"
	HaRouterAgentPortBindingsStateStandby HaRouterAgentPortBindingsState = "standby"
	HaRouterAgentPortBindingsStateUnknown HaRouterAgentPortBindingsState = "unknown"
)

func (*HaRouterAgentPortBindingsState) Scan

func (e *HaRouterAgentPortBindingsState) Scan(src interface{}) error

type Ipallocation

type Ipallocation struct {
	PortID    sql.NullString
	IpAddress string
	SubnetID  string
	NetworkID string
}

type Ipallocationpool

type Ipallocationpool struct {
	ID       string
	SubnetID sql.NullString
	FirstIp  string
	LastIp   string
}

type Ml2PortBinding

type Ml2PortBinding struct {
	PortID     string
	Host       string
	VifType    string
	VnicType   string
	Profile    string
	VifDetails string
	Status     string
}

type Network

type Network struct {
	ProjectID             sql.NullString
	ID                    string
	Name                  sql.NullString
	Status                sql.NullString
	AdminStateUp          sql.NullBool
	VlanTransparent       sql.NullBool
	StandardAttrID        int64
	AvailabilityZoneHints sql.NullString
	Mtu                   int32
}

type Networkrbac

type Networkrbac struct {
	ID            string
	ObjectID      string
	ProjectID     sql.NullString
	TargetProject string
	Action        string
}

type Networksegment

type Networksegment struct {
	ID              string
	NetworkID       string
	NetworkType     string
	PhysicalNetwork sql.NullString
	SegmentationID  sql.NullInt32
	IsDynamic       bool
	SegmentIndex    int32
	StandardAttrID  int64
	Name            sql.NullString
}

type NullHaRouterAgentPortBindingsState

type NullHaRouterAgentPortBindingsState struct {
	HaRouterAgentPortBindingsState HaRouterAgentPortBindingsState
	Valid                          bool // Valid is true if HaRouterAgentPortBindingsState is not NULL
}

func (*NullHaRouterAgentPortBindingsState) Scan

func (ns *NullHaRouterAgentPortBindingsState) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullHaRouterAgentPortBindingsState) Value

Value implements the driver Valuer interface.

type NullSecuritygrouprulesDirection

type NullSecuritygrouprulesDirection struct {
	SecuritygrouprulesDirection SecuritygrouprulesDirection
	Valid                       bool // Valid is true if SecuritygrouprulesDirection is not NULL
}

func (*NullSecuritygrouprulesDirection) Scan

func (ns *NullSecuritygrouprulesDirection) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullSecuritygrouprulesDirection) Value

Value implements the driver Valuer interface.

type NullSubnetsIpv6AddressMode

type NullSubnetsIpv6AddressMode struct {
	SubnetsIpv6AddressMode SubnetsIpv6AddressMode
	Valid                  bool // Valid is true if SubnetsIpv6AddressMode is not NULL
}

func (*NullSubnetsIpv6AddressMode) Scan

func (ns *NullSubnetsIpv6AddressMode) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullSubnetsIpv6AddressMode) Value

Value implements the driver Valuer interface.

type NullSubnetsIpv6RaMode

type NullSubnetsIpv6RaMode struct {
	SubnetsIpv6RaMode SubnetsIpv6RaMode
	Valid             bool // Valid is true if SubnetsIpv6RaMode is not NULL
}

func (*NullSubnetsIpv6RaMode) Scan

func (ns *NullSubnetsIpv6RaMode) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullSubnetsIpv6RaMode) Value

func (ns NullSubnetsIpv6RaMode) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Port

type Port struct {
	ProjectID      sql.NullString
	ID             string
	Name           sql.NullString
	NetworkID      string
	MacAddress     string
	AdminStateUp   bool
	Status         string
	DeviceID       string
	DeviceOwner    string
	StandardAttrID int64
	IpAllocation   sql.NullString
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) GetAgents

func (q *Queries) GetAgents(ctx context.Context) ([]GetAgentsRow, error)

func (*Queries) GetFloatingIPs

func (q *Queries) GetFloatingIPs(ctx context.Context) ([]GetFloatingIPsRow, error)

func (*Queries) GetHARouterAgentPortBindingsWithAgents

func (q *Queries) GetHARouterAgentPortBindingsWithAgents(ctx context.Context) ([]GetHARouterAgentPortBindingsWithAgentsRow, error)

func (*Queries) GetNetworkIPAvailabilitiesTotal

func (q *Queries) GetNetworkIPAvailabilitiesTotal(ctx context.Context) ([]GetNetworkIPAvailabilitiesTotalRow, error)

func (*Queries) GetNetworkIPAvailabilitiesUsed

func (q *Queries) GetNetworkIPAvailabilitiesUsed(ctx context.Context) ([]GetNetworkIPAvailabilitiesUsedRow, error)

func (*Queries) GetNetworks

func (q *Queries) GetNetworks(ctx context.Context) ([]GetNetworksRow, error)

func (*Queries) GetPorts

func (q *Queries) GetPorts(ctx context.Context) ([]GetPortsRow, error)

func (*Queries) GetQuotas

func (q *Queries) GetQuotas(ctx context.Context) ([]GetQuotasRow, error)

func (*Queries) GetResourceCountsByProject

func (q *Queries) GetResourceCountsByProject(ctx context.Context) ([]GetResourceCountsByProjectRow, error)

func (*Queries) GetRouters

func (q *Queries) GetRouters(ctx context.Context) ([]GetRoutersRow, error)

func (*Queries) GetSecurityGroupCount

func (q *Queries) GetSecurityGroupCount(ctx context.Context) (int64, error)

func (*Queries) GetSubnetPools

func (q *Queries) GetSubnetPools(ctx context.Context) ([]GetSubnetPoolsRow, error)

func (*Queries) GetSubnets

func (q *Queries) GetSubnets(ctx context.Context) ([]GetSubnetsRow, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type Quota

type Quota struct {
	ID        string
	ProjectID sql.NullString
	Resource  sql.NullString
	Limit     sql.NullInt32
}

type Router

type Router struct {
	ProjectID      sql.NullString
	ID             string
	Name           sql.NullString
	Status         sql.NullString
	AdminStateUp   sql.NullBool
	GwPortID       sql.NullString
	EnableSnat     bool
	StandardAttrID int64
	FlavorID       sql.NullString
}

type Securitygroup

type Securitygroup struct {
	ProjectID      sql.NullString
	ID             string
	Name           sql.NullString
	StandardAttrID int64
	Stateful       bool
}

type Securitygrouprule

type Securitygrouprule struct {
	ProjectID            sql.NullString
	ID                   string
	SecurityGroupID      string
	RemoteGroupID        sql.NullString
	Direction            NullSecuritygrouprulesDirection
	Ethertype            sql.NullString
	Protocol             sql.NullString
	PortRangeMin         sql.NullInt32
	PortRangeMax         sql.NullInt32
	RemoteIpPrefix       sql.NullString
	StandardAttrID       int64
	RemoteAddressGroupID sql.NullString
	NormalizedCidr       sql.NullString
}

type SecuritygrouprulesDirection

type SecuritygrouprulesDirection string
const (
	SecuritygrouprulesDirectionIngress SecuritygrouprulesDirection = "ingress"
	SecuritygrouprulesDirectionEgress  SecuritygrouprulesDirection = "egress"
)

func (*SecuritygrouprulesDirection) Scan

func (e *SecuritygrouprulesDirection) Scan(src interface{}) error

type Standardattribute

type Standardattribute struct {
	ID             int64
	ResourceType   string
	Description    sql.NullString
	RevisionNumber int64
	CreatedAt      time.Time
	UpdatedAt      sql.NullTime
}

type Subnet

type Subnet struct {
	ProjectID       sql.NullString
	ID              string
	Name            sql.NullString
	NetworkID       string
	IpVersion       int32
	Cidr            string
	GatewayIp       sql.NullString
	EnableDhcp      sql.NullBool
	Ipv6RaMode      NullSubnetsIpv6RaMode
	Ipv6AddressMode NullSubnetsIpv6AddressMode
	SubnetpoolID    sql.NullString
	StandardAttrID  int64
	SegmentID       sql.NullString
}

type Subnetpool

type Subnetpool struct {
	ProjectID        sql.NullString
	ID               string
	Name             sql.NullString
	IpVersion        int32
	DefaultPrefixlen int32
	MinPrefixlen     int32
	MaxPrefixlen     int32
	Shared           bool
	DefaultQuota     sql.NullInt32
	Hash             string
	AddressScopeID   sql.NullString
	IsDefault        bool
	StandardAttrID   int64
}

type Subnetpoolprefix

type Subnetpoolprefix struct {
	Cidr         string
	SubnetpoolID string
}

type SubnetsIpv6AddressMode

type SubnetsIpv6AddressMode string
const (
	SubnetsIpv6AddressModeSlaac           SubnetsIpv6AddressMode = "slaac"
	SubnetsIpv6AddressModeDhcpv6Stateful  SubnetsIpv6AddressMode = "dhcpv6-stateful"
	SubnetsIpv6AddressModeDhcpv6Stateless SubnetsIpv6AddressMode = "dhcpv6-stateless"
)

func (*SubnetsIpv6AddressMode) Scan

func (e *SubnetsIpv6AddressMode) Scan(src interface{}) error

type SubnetsIpv6RaMode

type SubnetsIpv6RaMode string
const (
	SubnetsIpv6RaModeSlaac           SubnetsIpv6RaMode = "slaac"
	SubnetsIpv6RaModeDhcpv6Stateful  SubnetsIpv6RaMode = "dhcpv6-stateful"
	SubnetsIpv6RaModeDhcpv6Stateless SubnetsIpv6RaMode = "dhcpv6-stateless"
)

func (*SubnetsIpv6RaMode) Scan

func (e *SubnetsIpv6RaMode) Scan(src interface{}) error

type Tag

type Tag struct {
	StandardAttrID int64
	Tag            string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL