client

package
v1.41.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: Apache-2.0, MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultMaxRetries is the default value for max retries on retryable operations.
	DefaultMaxRetries = 3
	// DefaultMaxRetryDelay is the default maximum value for delay on retryable operations.
	DefaultMaxRetryDelay = math.MaxInt64
	// DefaultRetryDelay is the default value for the initial delay on retry for retryable operations.
	DefaultRetryDelay = 5 * time.Second
)

Variables

View Source
var (
	// DefaultAzureClientOpts generates clientOptions for the azure clients.
	DefaultAzureClientOpts func() *arm.ClientOptions
)

Functions

func FilterNotFoundError added in v1.40.0

func FilterNotFoundError(err error) error

FilterNotFoundError returns nil for NotFound errors.

func IsAzureAPINotFoundError added in v1.18.0

func IsAzureAPINotFoundError(err error) bool

IsAzureAPINotFoundError tries to determine if an error is a resource not found error.

func IsAzureAPIUnauthorized added in v1.33.0

func IsAzureAPIUnauthorized(err error) bool

IsAzureAPIUnauthorized tries to determine if the API error is due to unauthorized access

Types

type AvailabilitySet added in v1.40.0

type AvailabilitySet interface {
	GetFunc[armcompute.AvailabilitySet]
	CreateOrUpdateFunc[armcompute.AvailabilitySet]
	DeleteFunc[armcompute.AvailabilitySet]
}

AvailabilitySet is an interface for the Azure AvailabilitySet service.

type AvailabilitySetClient added in v1.40.0

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

AvailabilitySetClient is an implementation of AvailabilitySet for an availability set k8sClient.

func NewAvailabilitySetClient added in v1.40.0

func NewAvailabilitySetClient(auth internal.ClientAuth) (*AvailabilitySetClient, error)

NewAvailabilitySetClient creates a new AvailabilitySetClient.

func (*AvailabilitySetClient) CreateOrUpdate added in v1.40.0

func (c *AvailabilitySetClient) CreateOrUpdate(ctx context.Context, resourceGroupName, availabilitySetName string, parameters armcompute.AvailabilitySet) (*armcompute.AvailabilitySet, error)

CreateOrUpdate creates or updates a new availability set.

func (*AvailabilitySetClient) Delete added in v1.40.0

func (c *AvailabilitySetClient) Delete(ctx context.Context, resourceGroupName, availabilitySetName string) error

Delete deletes the availability set for the given resource group and availability set name.

func (*AvailabilitySetClient) Get added in v1.40.0

func (c *AvailabilitySetClient) Get(ctx context.Context, resourceGroupName, availabilitySetName string) (*armcompute.AvailabilitySet, error)

Get returns the availability set for the given resource group and availability set name.

type ContainerCheckExistenceFunc added in v1.40.0

type ContainerCheckExistenceFunc[T any] interface {
	CheckExistence(ctx context.Context, container string) (bool, error)
}

ContainerCheckExistenceFunc checks if the container resource exists in the infrastructure.

type ContainerCreateOrUpdateFunc added in v1.40.0

type ContainerCreateOrUpdateFunc[T any] interface {
	CreateOrUpdate(ctx context.Context, container string, resourceParam T) (*T, error)
}

ContainerCreateOrUpdateFunc creates or updates a container resource for example resource groups.

type ContainerDeleteFunc added in v1.40.0

type ContainerDeleteFunc[T any] interface {
	Delete(ctx context.Context, container string) error
}

ContainerDeleteFunc deletes the specified container resource.

type ContainerGetFunc added in v1.40.0

type ContainerGetFunc[T any] interface {
	Get(ctx context.Context, container string) (*T, error)
}

ContainerGetFunc retrieves a container resource.

type CreateOrUpdateFunc added in v1.40.0

type CreateOrUpdateFunc[T any] interface {
	CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, resourceParam T) (*T, error)
}

CreateOrUpdateFunc creates or updates a resource.

type DNSRecordSet added in v1.21.0

type DNSRecordSet interface {
	CreateOrUpdate(context.Context, string, string, string, []string, int64) error
	Delete(context.Context, string, string, string) error
}

DNSRecordSet represents an Azure DNS recordset k8sClient.

type DNSRecordSetClient added in v1.21.0

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

DNSRecordSetClient is an implementation of DNSRecordSet for a DNS recordset k8sClient.

func (*DNSRecordSetClient) CreateOrUpdate added in v1.21.0

func (c *DNSRecordSetClient) CreateOrUpdate(ctx context.Context, zoneID string, name string, recordType string, values []string, ttl int64) error

CreateOrUpdate creates or updates the recordset with the given name, record type, values, and TTL in the zone with the given zone ID.

func (*DNSRecordSetClient) Delete added in v1.21.0

func (c *DNSRecordSetClient) Delete(ctx context.Context, zoneID string, name string, recordType string) error

Delete deletes the recordset with the given name and record type in the zone with the given zone ID.

type DNSZone added in v1.21.0

type DNSZone interface {
	List(context.Context) (map[string]string, error)
}

DNSZone represents an Azure DNS zone k8sClient.

type DNSZoneClient added in v1.21.0

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

DNSZoneClient is an implementation of DNSZone for a DNS zone k8sClient.

func (*DNSZoneClient) List added in v1.40.0

func (c *DNSZoneClient) List(ctx context.Context) (map[string]string, error)

List returns a map of all zone names mapped to their IDs.

type DeleteFunc added in v1.40.0

type DeleteFunc[T any] interface {
	Delete(ctx context.Context, resourceGroupName string, resourceName string) error
}

DeleteFunc deletes a resource.

type DeleteWithOptsFunc added in v1.40.0

type DeleteWithOptsFunc[T, O any] interface {
	Delete(ctx context.Context, resourceGroupName string, resourceName string, opts O) error
}

DeleteWithOptsFunc deletes a resource with the specified deleteOpts.

type Disk added in v1.26.0

type Disk interface {
	GetFunc[armcompute.Disk]
	CreateOrUpdateFunc[armcompute.Disk]
	DeleteFunc[armcompute.Disk]
}

Disk represents an Azure Disk k8sClient.

func NewDisksClient added in v1.40.0

func NewDisksClient(auth internal.ClientAuth, tc azcore.TokenCredential, opts *arm.ClientOptions) (Disk, error)

NewDisksClient creates a new disk client

type DisksClient added in v1.26.0

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

DisksClient is an implementation of Disk for a disk k8sClient.

func (*DisksClient) CreateOrUpdate added in v1.26.0

func (c *DisksClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, diskName string, disk armcompute.Disk) (*armcompute.Disk, error)

CreateOrUpdate will create or update a disk.

func (*DisksClient) Delete added in v1.26.0

func (c *DisksClient) Delete(ctx context.Context, resourceGroupName, name string) error

Delete will delete a disk.

func (*DisksClient) Get added in v1.26.0

func (c *DisksClient) Get(ctx context.Context, resourceGroupName string, name string) (*armcompute.Disk, error)

Get will fetch a disk by given name in a given resource group.

type Factory added in v1.15.0

type Factory interface {
	Auth() *internal.ClientAuth

	Storage(context.Context, corev1.SecretReference) (Storage, error)
	StorageAccount() (StorageAccount, error)
	Vmss() (Vmss, error)
	DNSZone() (DNSZone, error)
	DNSRecordSet() (DNSRecordSet, error)
	VirtualMachine() (VirtualMachine, error)
	NetworkInterface() (NetworkInterface, error)
	Disk() (Disk, error)
	Group() (ResourceGroup, error)
	NetworkSecurityGroup() (NetworkSecurityGroup, error)
	Subnet() (Subnet, error)
	PublicIP() (PublicIP, error)
	Vnet() (VirtualNetwork, error)
	RouteTables() (RouteTables, error)
	NatGateway() (NatGateway, error)
	AvailabilitySet() (AvailabilitySet, error)
	ManagedUserIdentity() (ManagedUserIdentity, error)
	VirtualMachineImages() (VirtualMachineImages, error)
}

Factory represents a factory to produce clients for various Azure services.

func NewAzureClientFactory added in v1.15.0

func NewAzureClientFactory(ctx context.Context, client client.Client, secretRef corev1.SecretReference) (Factory, error)

NewAzureClientFactory creates a new Azure client factory with the passed secret reference.

func NewAzureClientFactoryWithAuth added in v1.40.0

func NewAzureClientFactoryWithAuth(auth *internal.ClientAuth, client client.Client) (Factory, error)

NewAzureClientFactoryWithAuth creates a new Azure client factory with the passed credentials.

func NewAzureClientFactoryWithDNSSecret added in v1.40.0

func NewAzureClientFactoryWithDNSSecret(ctx context.Context, client client.Client, secretRef corev1.SecretReference) (Factory, error)

NewAzureClientFactoryWithDNSSecret creates a new Azure client factory with the passed secret reference using the DNS secret keys.

type GetFunc added in v1.40.0

type GetFunc[T any] interface {
	Get(ctx context.Context, resourceGroupName string, resourceName string) (*T, error)
}

GetFunc gets a resource of type T.

type GetWithExpandFunc added in v1.40.0

type GetWithExpandFunc[T, E any] interface {
	Get(ctx context.Context, resourceGroupName string, resourceName string, expand E) (*T, error)
}

GetWithExpandFunc gets a resource and allows expansion of other referenced resources.

type ListFunc added in v1.40.0

type ListFunc[T any] interface {
	List(ctx context.Context, resourceGroupName string) (result []*T, err error)
}

ListFunc gets a list of resources is the target resource group.

type ManagedUserIdentity added in v1.40.0

type ManagedUserIdentity interface {
	GetFunc[msi.Identity]
}

ManagedUserIdentity is a k8sClient for the Azure Managed User Identity service.

type ManagedUserIdentityClient added in v1.40.0

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

ManagedUserIdentityClient is an implementation of ManagedUserIdentity for a managed user identity k8sClient.

func NewManagedUserIdentityClient added in v1.40.0

func NewManagedUserIdentityClient(auth internal.ClientAuth) (*ManagedUserIdentityClient, error)

NewManagedUserIdentityClient creates a new ManagedUserIdentityClient

func (*ManagedUserIdentityClient) Get added in v1.40.0

func (m *ManagedUserIdentityClient) Get(ctx context.Context, resourceGroup, id string) (*msi.Identity, error)

Get returns a Managed User Identity by name.

type NatGateway added in v1.40.0

type NatGateway interface {
	CreateOrUpdateFunc[armnetwork.NatGateway]
	GetWithExpandFunc[armnetwork.NatGateway, *string]
	ListFunc[armnetwork.NatGateway]
	DeleteFunc[armnetwork.NatGateway]
}

NatGateway is an interface for the Azure NatGateway service.

type NatGatewayClient added in v1.40.0

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

NatGatewayClient is an implementation of NatGateway for a Nat Gateway k8sClient.

func NewNatGatewaysClient added in v1.40.0

func NewNatGatewaysClient(auth internal.ClientAuth, tc azcore.TokenCredential, opts *arm.ClientOptions) (*NatGatewayClient, error)

NewNatGatewaysClient creates a new NatGateway client.

func (*NatGatewayClient) CreateOrUpdate added in v1.40.0

func (c *NatGatewayClient) CreateOrUpdate(ctx context.Context, resourceGroupName, natGatewayName string, parameters armnetwork.NatGateway) (*armnetwork.NatGateway, error)

CreateOrUpdate creates or updates a NatGateway.

func (*NatGatewayClient) Delete added in v1.40.0

func (c *NatGatewayClient) Delete(ctx context.Context, resourceGroupName, natGatewayName string) error

Delete deletes the NatGateway with the given name.

func (*NatGatewayClient) Get added in v1.40.0

func (c *NatGatewayClient) Get(ctx context.Context, resourceGroupName, natGatewayName string, expand *string) (*armnetwork.NatGateway, error)

Get returns a NatGateway by name or nil if it doesn't exist.

func (*NatGatewayClient) List added in v1.40.0

func (c *NatGatewayClient) List(ctx context.Context, resourceGroupName string) ([]*armnetwork.NatGateway, error)

List returns all NATGateways in the given resource group.

type NetworkInterface added in v1.26.0

type NetworkInterface interface {
	GetFunc[armnetwork.Interface]
	CreateOrUpdateFunc[armnetwork.Interface]
	DeleteFunc[armnetwork.Interface]
}

NetworkInterface represents an Azure Network Interface k8sClient.

type NetworkInterfaceClient added in v1.26.0

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

NetworkInterfaceClient is an implementation of Network Interface.

func NewNetworkInterfaceClient added in v1.40.0

func NewNetworkInterfaceClient(auth internal.ClientAuth, tc azcore.TokenCredential, opts *arm.ClientOptions) (*NetworkInterfaceClient, error)

NewNetworkInterfaceClient creates a new NetworkInterfaceClient

func (*NetworkInterfaceClient) CreateOrUpdate added in v1.26.0

func (c *NetworkInterfaceClient) CreateOrUpdate(ctx context.Context, resourceGroupName, name string, parameters armnetwork.Interface) (*armnetwork.Interface, error)

CreateOrUpdate indicates an expected call of Network interface CreateOrUpdate.

func (*NetworkInterfaceClient) Delete added in v1.26.0

func (c *NetworkInterfaceClient) Delete(ctx context.Context, resourceGroupName, name string) error

Delete will delete a Network interface.

func (*NetworkInterfaceClient) Get added in v1.26.0

func (c *NetworkInterfaceClient) Get(ctx context.Context, resourceGroupName string, name string) (*armnetwork.Interface, error)

Get will get a Network interface.

type NetworkSecurityGroup added in v1.26.0

type NetworkSecurityGroup interface {
	GetFunc[armnetwork.SecurityGroup]
	CreateOrUpdateFunc[armnetwork.SecurityGroup]
	DeleteFunc[armnetwork.SecurityGroup]
}

NetworkSecurityGroup represents an Azure Network security group k8sClient.

type NetworkSecurityGroupClient added in v1.26.0

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

NetworkSecurityGroupClient is an implementation of Network Security Group for a network security group k8sClient.

func NewSecurityGroupClient added in v1.40.0

func NewSecurityGroupClient(auth internal.ClientAuth, tc azcore.TokenCredential, opts *arm.ClientOptions) (*NetworkSecurityGroupClient, error)

NewSecurityGroupClient creates a new SecurityGroupClient

func (*NetworkSecurityGroupClient) CreateOrUpdate added in v1.26.0

func (c *NetworkSecurityGroupClient) CreateOrUpdate(ctx context.Context, resourceGroupName, name string, parameters armnetwork.SecurityGroup) (*armnetwork.SecurityGroup, error)

CreateOrUpdate indicates an expected call of Network Security Group CreateOrUpdate.

func (*NetworkSecurityGroupClient) Delete added in v1.40.0

func (c *NetworkSecurityGroupClient) Delete(ctx context.Context, resourceGroupName, name string) error

Delete deletes a network security group.

func (*NetworkSecurityGroupClient) Get added in v1.26.0

func (c *NetworkSecurityGroupClient) Get(ctx context.Context, resourceGroupName string, networkSecurityGroupName string) (*armnetwork.SecurityGroup, error)

Get will fetch a network security group.

type PublicIP added in v1.26.0

type PublicIP interface {
	GetWithExpandFunc[armnetwork.PublicIPAddress, *string]
	CreateOrUpdateFunc[armnetwork.PublicIPAddress]
	DeleteFunc[armnetwork.PublicIPAddress]
	ListFunc[armnetwork.PublicIPAddress]
}

PublicIP represents an Azure Network Public IP k8sClient.

type PublicIPClient added in v1.26.0

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

PublicIPClient is an implementation of Network Public IP Address.

func NewPublicIPClient added in v1.40.0

func NewPublicIPClient(auth internal.ClientAuth, tc azcore.TokenCredential, opts *arm.ClientOptions) (*PublicIPClient, error)

NewPublicIPClient creates a new PublicIPClient

func (*PublicIPClient) CreateOrUpdate added in v1.26.0

func (c *PublicIPClient) CreateOrUpdate(ctx context.Context, resourceGroupName, name string, parameters armnetwork.PublicIPAddress) (*armnetwork.PublicIPAddress, error)

CreateOrUpdate indicates an expected call of Network Public IP CreateOrUpdate.

func (*PublicIPClient) Delete added in v1.26.0

func (c *PublicIPClient) Delete(ctx context.Context, resourceGroupName, name string) error

Delete will delete a network Public IP Address.

func (*PublicIPClient) Get added in v1.26.0

func (c *PublicIPClient) Get(ctx context.Context, resourceGroupName string, name string, opts *string) (*armnetwork.PublicIPAddress, error)

Get will get a network public IP Address

func (*PublicIPClient) List added in v1.40.0

func (c *PublicIPClient) List(ctx context.Context, resourceGroupName string) ([]*armnetwork.PublicIPAddress, error)

List will get all network public IP Addresses

type ResourceGroupClient added in v1.40.0

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

ResourceGroupClient is a client for resource groups.

func NewResourceGroupsClient added in v1.40.0

func NewResourceGroupsClient(auth *internal.ClientAuth, tc azcore.TokenCredential, opts *arm.ClientOptions) (*ResourceGroupClient, error)

NewResourceGroupsClient creates a new ResourceGroupClient

func (*ResourceGroupClient) CheckExistence added in v1.40.0

func (c *ResourceGroupClient) CheckExistence(ctx context.Context, resourceGroupName string) (bool, error)

CheckExistence checks if a resource group exists

func (*ResourceGroupClient) CreateOrUpdate added in v1.40.0

func (c *ResourceGroupClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resource armresources.ResourceGroup) (*armresources.ResourceGroup, error)

CreateOrUpdate creates or updates a resource group

func (*ResourceGroupClient) Delete added in v1.40.0

func (c *ResourceGroupClient) Delete(ctx context.Context, resourceGroupName string) error

Delete deletes a resource group if it exists.

func (*ResourceGroupClient) Get added in v1.40.0

func (c *ResourceGroupClient) Get(ctx context.Context, resourceGroupName string) (*armresources.ResourceGroup, error)

Get gets a resource group.

type RouteTables added in v1.40.0

type RouteTables interface {
	CreateOrUpdateFunc[armnetwork.RouteTable]
	DeleteFunc[armnetwork.RouteTable]
	GetFunc[armnetwork.RouteTable]
}

RouteTables is a k8sClient for the Azure RouteTable service.

type RouteTablesClient added in v1.40.0

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

RouteTablesClient is an implementation of RouteTables for a RouteTables k8sClient.

func NewRouteTablesClient added in v1.40.0

func NewRouteTablesClient(auth internal.ClientAuth, tc azcore.TokenCredential, opts *arm.ClientOptions) (*RouteTablesClient, error)

NewRouteTablesClient creates a new RouteTables client.

func (*RouteTablesClient) CreateOrUpdate added in v1.40.0

func (c *RouteTablesClient) CreateOrUpdate(ctx context.Context, resourceGroupName, routeTableName string, parameters armnetwork.RouteTable) (*armnetwork.RouteTable, error)

CreateOrUpdate creates or updates a RouteTable.

func (*RouteTablesClient) Delete added in v1.40.0

func (c *RouteTablesClient) Delete(ctx context.Context, resourceGroupName, name string) (err error)

Delete deletes the RouteTable with the given name.

func (*RouteTablesClient) Get added in v1.40.0

func (c *RouteTablesClient) Get(ctx context.Context, resourceGroupName, name string) (*armnetwork.RouteTable, error)

Get returns a RouteTable by name.

type Storage

type Storage interface {
	DeleteObjectsWithPrefix(context.Context, string, string) error
	CreateContainerIfNotExists(context.Context, string) error
	DeleteContainerIfExists(context.Context, string) error
}

Storage represents an Azure (blob) storage k8sClient.

type StorageAccount added in v1.15.0

type StorageAccount interface {
	CreateStorageAccount(context.Context, string, string, string) error
	ListStorageAccountKey(context.Context, string, string) (string, error)
}

StorageAccount represents an Azure storage account k8sClient.

type StorageAccountClient added in v1.15.0

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

StorageAccountClient is an implementation of StorageAccount for storage account k8sClient.

func (*StorageAccountClient) CreateStorageAccount added in v1.15.0

func (c *StorageAccountClient) CreateStorageAccount(ctx context.Context, resourceGroupName, storageAccountName, region string) error

CreateStorageAccount creates a storage account.

func (*StorageAccountClient) ListStorageAccountKey added in v1.15.0

func (c *StorageAccountClient) ListStorageAccountKey(ctx context.Context, resourceGroupName, storageAccountName string) (string, error)

ListStorageAccountKey lists the first key of a storage account.

type StorageClient

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

StorageClient is an implementation of Storage for a (blob) storage k8sClient.

func (*StorageClient) CreateContainerIfNotExists

func (c *StorageClient) CreateContainerIfNotExists(ctx context.Context, container string) error

CreateContainerIfNotExists creates the azure blob container with name <container>. If it already exist,no error is returned.

func (*StorageClient) DeleteContainerIfExists

func (c *StorageClient) DeleteContainerIfExists(ctx context.Context, container string) error

DeleteContainerIfExists deletes the azure blob container with name <container>. If it does not exist, no error is returned.

func (*StorageClient) DeleteObjectsWithPrefix

func (c *StorageClient) DeleteObjectsWithPrefix(ctx context.Context, container, prefix string) error

DeleteObjectsWithPrefix deletes the blob objects with the specific <prefix> from <container>. If it does not exist, no error is returned.

type SubResourceCreateOrUpdateFunc added in v1.40.0

type SubResourceCreateOrUpdateFunc[T any] interface {
	CreateOrUpdate(ctx context.Context, resourceGroupName string, parentResourceName string, resourceName string, resourceParam T) (*T, error)
}

SubResourceCreateOrUpdateFunc creates or updates a subresource.

type SubResourceDeleteFunc added in v1.40.0

type SubResourceDeleteFunc[T any] interface {
	Delete(ctx context.Context, resourceGroupName string, parentResourceName string, resourceName string) error
}

SubResourceDeleteFunc deletes a resource.

type SubResourceGetFunc added in v1.40.0

type SubResourceGetFunc[T any] interface {
	Get(ctx context.Context, resourceGroupName string, parentResourceName string, resourceName string) (*T, error)
}

SubResourceGetFunc gets a subresource of type T.

type SubResourceGetWithExpandFunc added in v1.40.0

type SubResourceGetWithExpandFunc[T, E any] interface {
	Get(ctx context.Context, resourceGroupName string, parentResourceName string, resourceName string, expand E) (*T, error)
}

SubResourceGetWithExpandFunc gets a subresource and allows expansion of other referenced resources.

type SubResourceListFunc added in v1.40.0

type SubResourceListFunc[T any] interface {
	List(ctx context.Context, resourceGroupName string, parentResourceName string) ([]*T, error)
}

SubResourceListFunc gets a list of subresources is the target resource.

type Subnet added in v1.26.0

type Subnet interface {
	SubResourceCreateOrUpdateFunc[armnetwork.Subnet]
	SubResourceGetWithExpandFunc[armnetwork.Subnet, *string]
	SubResourceListFunc[armnetwork.Subnet]
	SubResourceDeleteFunc[armnetwork.Subnet]
}

Subnet represents an Azure Subnet k8sClient.

type SubnetsClient added in v1.26.0

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

SubnetsClient implements the interface for the subnets client.

func NewSubnetsClient added in v1.40.0

func NewSubnetsClient(auth internal.ClientAuth, tc azcore.TokenCredential, opts *arm.ClientOptions) (*SubnetsClient, error)

NewSubnetsClient creates a new client for the subnets API.

func (*SubnetsClient) CreateOrUpdate added in v1.40.0

func (c *SubnetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName, vnetName, subnetName string, parameters armnetwork.Subnet) (*armnetwork.Subnet, error)

CreateOrUpdate creates or updates a subnet in a given virtual network.

func (*SubnetsClient) Delete added in v1.28.0

func (c *SubnetsClient) Delete(ctx context.Context, resourceGroupName, vnetName, subnetName string) error

Delete deletes a subnet in a given virtual network.

func (*SubnetsClient) Get added in v1.26.0

func (c *SubnetsClient) Get(ctx context.Context, resourceGroupName string, vnetName string, name string, expand *string) (*armnetwork.Subnet, error)

Get will get a subnet in a given virtual network. If the requested subnet not exists nil will be returned.

func (*SubnetsClient) List added in v1.28.0

func (c *SubnetsClient) List(ctx context.Context, resourceGroupName, vnetName string) ([]*armnetwork.Subnet, error)

List lists all subnets of a given virtual network.

type VirtualMachine added in v1.26.0

type VirtualMachine interface {
	GetWithExpandFunc[armcompute.VirtualMachine, *armcompute.InstanceViewTypes]
	CreateOrUpdateFunc[armcompute.VirtualMachine]
	DeleteWithOptsFunc[armcompute.VirtualMachine, *bool]
}

VirtualMachine represents an Azure virtual machine k8sClient.

type VirtualMachineImageClient added in v1.38.0

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

VirtualMachineImageClient is an implementation of Virtual Machine Image for a Virtual Machine Image k8sClient.

func NewVirtualMachineImagesClient added in v1.40.0

func NewVirtualMachineImagesClient(auth internal.ClientAuth) (*VirtualMachineImageClient, error)

NewVirtualMachineImagesClient creates a new VirtualMachineImagesClient client.

func (*VirtualMachineImageClient) ListSkus added in v1.38.0

func (c *VirtualMachineImageClient) ListSkus(ctx context.Context, location string, publisherName string, offer string) (*compute.ListVirtualMachineImageResource, error)

ListSkus will a list of virtual machine image SKUs for the specified location, publisher, and offer.

type VirtualMachineImages added in v1.40.0

type VirtualMachineImages interface {
	ListSkus(ctx context.Context, location string, publisherName string, offer string) (*compute.ListVirtualMachineImageResource, error)
}

VirtualMachineImages represents an Azure Virtual Machine Image k8sClient.

type VirtualMachinesClient added in v1.26.0

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

VirtualMachinesClient is an implementation of Vm for a virtual machine k8sClient.

func NewVMClient added in v1.40.0

NewVMClient creates a new VM client

func (*VirtualMachinesClient) CreateOrUpdate added in v1.40.0

func (c *VirtualMachinesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, name string, parameters armcompute.VirtualMachine) (*armcompute.VirtualMachine, error)

CreateOrUpdate will Create a virtual machine or update an existing one.

func (*VirtualMachinesClient) Delete added in v1.26.0

func (c *VirtualMachinesClient) Delete(ctx context.Context, resourceGroupName, name string, forceDeletion *bool) error

Delete will delete a virtual machine.

func (*VirtualMachinesClient) Get added in v1.26.0

func (c *VirtualMachinesClient) Get(ctx context.Context, resourceGroupName string, resource string, opts *armcompute.InstanceViewTypes) (*armcompute.VirtualMachine, error)

Get will get virtual machines in a resource group.

type VirtualNetwork added in v1.40.0

type VirtualNetwork interface {
	CreateOrUpdateFunc[armnetwork.VirtualNetwork]
	GetFunc[armnetwork.VirtualNetwork]
	DeleteFunc[armnetwork.VirtualNetwork]
}

VirtualNetwork represents an Azure Virtual Network k8sClient.

type Vmss added in v1.18.0

type Vmss interface {
	ListFunc[armcompute.VirtualMachineScaleSet]
	GetWithExpandFunc[armcompute.VirtualMachineScaleSet, *armcompute.ExpandTypesForGetVMScaleSets]
	CreateOrUpdateFunc[armcompute.VirtualMachineScaleSet]
	DeleteWithOptsFunc[armcompute.VirtualMachineScaleSet, *bool]
}

Vmss represents an Azure virtual machine scale set k8sClient.

func NewVmssClient added in v1.40.0

func NewVmssClient(auth internal.ClientAuth, tc azcore.TokenCredential, opts *arm.ClientOptions) (Vmss, error)

NewVmssClient creates a new VmssClient

type VmssClient added in v1.18.0

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

VmssClient is an implementation of Vmss for a virtual machine scale set k8sClient.

func (VmssClient) CreateOrUpdate added in v1.40.0

func (c VmssClient) CreateOrUpdate(ctx context.Context, resourceGroupName, name string, properties armcompute.VirtualMachineScaleSet) (*armcompute.VirtualMachineScaleSet, error)

CreateOrUpdate will create a vmss or update an existing one.

func (VmssClient) Delete added in v1.18.0

func (c VmssClient) Delete(ctx context.Context, resourceGroupName, name string, forceDeletion *bool) error

Delete will delete a vmss.

func (VmssClient) Get added in v1.18.0

func (c VmssClient) Get(ctx context.Context, resourceGroupName, name string, expander *armcompute.ExpandTypesForGetVMScaleSets) (*armcompute.VirtualMachineScaleSet, error)

Get will fetch a vmss.

func (VmssClient) List added in v1.18.0

func (c VmssClient) List(ctx context.Context, resourceGroupName string) ([]*armcompute.VirtualMachineScaleSet, error)

List will list vmss in a resource group.

type VnetClient added in v1.40.0

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

VnetClient is an implmenetation of VirtualNetwork for a virtual network k8sClient.

func NewVnetClient added in v1.40.0

func NewVnetClient(auth internal.ClientAuth, tc azcore.TokenCredential, opts *arm.ClientOptions) (*VnetClient, error)

NewVnetClient creates a new VnetClient.

func (*VnetClient) CreateOrUpdate added in v1.40.0

func (v *VnetClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, name string, parameters armnetwork.VirtualNetwork) (*armnetwork.VirtualNetwork, error)

CreateOrUpdate creates or updates a virtual network.

func (*VnetClient) Delete added in v1.40.0

func (v *VnetClient) Delete(ctx context.Context, resourceGroup, vnetName string) (err error)

Delete a given an existing virtual network.

func (*VnetClient) Get added in v1.40.0

func (v *VnetClient) Get(ctx context.Context, resourceGroupName, name string) (*armnetwork.VirtualNetwork, error)

Get gets a given virtual network by name

Directories

Path Synopsis
Package client is a generated GoMock package.
Package client is a generated GoMock package.

Jump to

Keyboard shortcuts

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