Help us shape the future of Go! Take the 2026 Go Developer Survey

api

package
v1.20.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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) (netip.Addr, 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) (netip.Addr, 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 added in v1.20.0

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

GetSubnetsByIDs retrieves subnet information for specific subnet IDs

func (*Client) ListAllNetworkInterfaces added in v1.20.0

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 added in v1.20.0

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 added in v1.20.0

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 added in v1.20.0

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