utils

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNetworkAreaName

func GetNetworkAreaName(ctx context.Context, apiClient IaaSClient, organizationId, areaId string) (string, error)

func GetNetworkName

func GetNetworkName(ctx context.Context, apiClient IaaSClient, projectId, networkId string) (string, error)

func GetNetworkRangeFromAPIResponse

func GetNetworkRangeFromAPIResponse(prefix string, networkRanges *[]iaas.NetworkRange) (iaas.NetworkRange, error)

GetNetworkRangeFromAPIResponse returns the network range from the API response that matches the given prefix This works because network range prefixes are unique in the same SNA

func GetNetworkRangePrefix

func GetNetworkRangePrefix(ctx context.Context, apiClient IaaSClient, organizationId, areaId, networkRangeId string) (string, error)

func GetRouteFromAPIResponse

func GetRouteFromAPIResponse(prefix, nexthop string, routes *[]iaas.Route) (iaas.Route, error)

GetRouteFromAPIResponse returns the static route from the API response that matches the prefix and nexthop This works because static routes are unique by prefix and nexthop

func ListAttachedProjects

func ListAttachedProjects(ctx context.Context, apiClient IaaSClient, organizationId, areaId string) ([]string, error)

Types

type IaaSClient

type IaaSClient interface {
	GetNetworkExecute(ctx context.Context, projectId, networkId string) (*iaas.Network, error)
	GetNetworkAreaExecute(ctx context.Context, organizationId, areaId string) (*iaas.NetworkArea, error)
	ListNetworkAreaProjectsExecute(ctx context.Context, organizationId, areaId string) (*iaas.ProjectListResponse, error)
	GetNetworkAreaRangeExecute(ctx context.Context, organizationId, areaId, networkRangeId string) (*iaas.NetworkRange, error)
}

Jump to

Keyboard shortcuts

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