api

package
v1.20.0-pre.3 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: Apache-2.0 Imports: 23 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAzureCloudName

func GetAzureCloudName(ctx context.Context, logger *slog.Logger) (string, error)

GetAzureCloudName retrieves the current Azure cloud name in which the host running the Cilium Operator is located This is retrieved via the Azure Instance Metadata Service

func GetResourceGroupName

func GetResourceGroupName(ctx context.Context, logger *slog.Logger) (string, error)

GetResourceGroupName retrieves the current resource group name in which the host running the Cilium Operator is located This is retrieved via the Azure Instance Metadata Service

func GetSubscriptionID

func GetSubscriptionID(ctx context.Context, logger *slog.Logger) (string, error)

GetSubscriptionID retrieves the Azure subscriptionID from the Azure Instance Metadata Service

Types

type Client

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

Client represents an Azure API client

func NewClient

func NewClient(logger *slog.Logger, cloudName, subscriptionID, resourceGroup, userAssignedIdentityID string, metrics MetricsAPI, rateLimit float64, burst int, usePrimary bool) (*Client, error)

NewClient returns a new Azure client

func (*Client) AssignPrivateIpAddressesVM

func (c *Client) AssignPrivateIpAddressesVM(ctx context.Context, subnetID, interfaceName string, addresses int) error

AssignPrivateIpAddressesVM assign a private IP to an interface attached to a standalone instance

func (*Client) AssignPrivateIpAddressesVMSS

func (c *Client) AssignPrivateIpAddressesVMSS(ctx context.Context, instanceID, vmssName, subnetID, interfaceName string, addresses int) error

AssignPrivateIpAddressesVMSS assign a private IP to an interface attached to a VMSS instance

func (*Client) AssignPublicIPAddressesVM added in v1.19.0

func (c *Client) AssignPublicIPAddressesVM(ctx context.Context, instanceID string, publicIpTags ipamTypes.Tags) (string, error)

AssignPublicIPAddressesVM assigns a public IP to a VM instance. The public IP is allocated from a Public IP Prefix matching publicIpTags

func (*Client) AssignPublicIPAddressesVMSS added in v1.19.0

func (c *Client) AssignPublicIPAddressesVMSS(ctx context.Context, instanceID, vmssName string, publicIpTags ipamTypes.Tags) (string, error)

AssignPublicIPAddressesVMSS assigns a public IP to a VMSS instance. The public IP is allocated from a Public IP Prefix matching publicIpTags

func (*Client) GetSubnetsByIDs

func (c *Client) GetSubnetsByIDs(ctx context.Context, subnetIDs []string) (ipamTypes.SubnetMap, error)

GetSubnetsByIDs retrieves subnet information for specific subnet IDs

func (*Client) ListAllNetworkInterfaces

func (c *Client) ListAllNetworkInterfaces(ctx context.Context) ([]*armnetwork.Interface, error)

ListAllNetworkInterfaces returns all network interfaces in the resource group This is exposed to allow callers to fetch network interfaces once and parse them multiple times

func (*Client) ListVMNetworkInterfaces

func (c *Client) ListVMNetworkInterfaces(ctx context.Context, instanceID string) ([]*armnetwork.Interface, error)

ListVMNetworkInterfaces returns all network interfaces for a specific VMSS instance This is exposed to allow callers to fetch network interfaces once and parse them multiple times

func (*Client) ParseInterfacesIntoInstance

func (c *Client) ParseInterfacesIntoInstance(networkInterfaces []*armnetwork.Interface, subnets ipamTypes.SubnetMap) *ipamTypes.Instance

ParseInterfacesIntoInstance parses network interfaces into an Instance This allows re-parsing the same network interface data with different subnet maps without making additional Azure API calls

func (*Client) ParseInterfacesIntoInstanceMap

func (c *Client) ParseInterfacesIntoInstanceMap(networkInterfaces []*armnetwork.Interface, subnets ipamTypes.SubnetMap) *ipamTypes.InstanceMap

ParseInterfacesIntoInstanceMap parses network interfaces into an InstanceMap This allows re-parsing the same network interface data with different subnet maps without making additional Azure API calls

type MetricsAPI

type MetricsAPI interface {
	helpers.MetricsAPI
	ObserveAPICall(call, status string, duration float64)
}

MetricsAPI represents the metrics maintained by the Azure API client

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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