utils

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetImageName added in v0.21.0

func GetImageName(ctx context.Context, apiClient IaaSClient, projectId, imageId string) (string, error)

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 GetPublicIP added in v0.18.0

func GetPublicIP(ctx context.Context, apiClient IaaSClient, projectId, publicIpId string) (ip, associatedResource string, err 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 GetSecurityGroupName added in v0.20.0

func GetSecurityGroupName(ctx context.Context, apiClient IaaSClient, projectId, securityGroupId string) (string, error)

func GetSecurityGroupRuleName added in v0.20.0

func GetSecurityGroupRuleName(ctx context.Context, apiClient IaaSClient, projectId, securityGroupRuleId, securityGroupId string) (string, error)

func GetServerName added in v0.17.0

func GetServerName(ctx context.Context, apiClient IaaSClient, projectId, serverId string) (string, error)

func GetVolumeName added in v0.17.0

func GetVolumeName(ctx context.Context, apiClient IaaSClient, projectId, volumeId string) (string, error)

func ListAttachedProjects

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

Types

type IaaSClient

type IaaSClient interface {
	GetSecurityGroupRuleExecute(ctx context.Context, projectId, securityGroupRuleId, securityGroupId string) (*iaas.SecurityGroupRule, error)
	GetSecurityGroupExecute(ctx context.Context, projectId, securityGroupId string) (*iaas.SecurityGroup, error)
	GetPublicIPExecute(ctx context.Context, projectId, publicIpId string) (*iaas.PublicIp, error)
	GetServerExecute(ctx context.Context, projectId, serverId string) (*iaas.Server, error)
	GetVolumeExecute(ctx context.Context, projectId, volumeId string) (*iaas.Volume, error)
	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)
	GetImageExecute(ctx context.Context, projectId string, imageId string) (*iaas.Image, error)
}

Jump to

Keyboard shortcuts

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