client

package
v6.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsCredentialsNotFoundError

func IsCredentialsNotFoundError(err error) bool

IsCredentialsNotFoundError asserts credentialsNotFoundError.

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsTooManyCredentials

func IsTooManyCredentials(err error) bool

IsTooManyCredentials asserts tooManyCredentialsError.

func ResponseWasNotFound

func ResponseWasNotFound(resp autorest.Response) bool

ResponseWasNotFound returns true if the response code from the Azure API was a 404.

Types

type AzureClientSet

type AzureClientSet struct {
	// The subscription ID this client set is configured with.
	SubscriptionID string

	// DeploymentsClient manages deployments of ARM templates.
	DeploymentsClient *resources.DeploymentsClient
	DisksClient       *compute.DisksClient
	// GroupsClient manages ARM resource groups.
	GroupsClient *resources.GroupsClient
	// DNSRecordSetsClient manages DNS zones' records.
	DNSRecordSetsClient *dns.RecordSetsClient
	// DNSRecordSetsClient manages DNS zones.
	DNSZonesClient *dns.ZonesClient
	// InterfacesClient manages virtual network interfaces.
	InterfacesClient *network.InterfacesClient
	// NatGatewaysClient manages Nat Gateways.
	NatGatewaysClient *network.NatGatewaysClient
	// PublicIpAddressesClient manages public IP addresses.
	PublicIpAddressesClient *network.PublicIPAddressesClient
	// ResourceSkusClient manages VM type SKUs.
	ResourceSkusClient *compute.ResourceSkusClient
	// SecurityRulesClient manages networking rules in a security group.
	SecurityRulesClient *network.SecurityRulesClient
	SnapshotsClient     *compute.SnapshotsClient
	// StorageAccountsClient manages blobs in storage containers.
	StorageAccountsClient *storage.AccountsClient
	// SubnetsClient manages subnets.
	SubnetsClient *network.SubnetsClient
	// UsageClient is used to work with limits and quotas.
	UsageClient *compute.UsageClient
	// VirtualNetworkClient manages virtual networks.
	VirtualNetworkClient *network.VirtualNetworksClient
	// VirtualNetworkGatewayConnectionsClient manages virtual network gateway connections.
	VirtualNetworkGatewayConnectionsClient *network.VirtualNetworkGatewayConnectionsClient
	// VirtualNetworkGatewaysClient manages virtual network gateways.
	VirtualNetworkGatewaysClient *network.VirtualNetworkGatewaysClient
	// VirtualMachineScaleSetsClient manages virtual machine scale sets.
	VirtualMachineScaleSetsClient *compute.VirtualMachineScaleSetsClient
	// VirtualMachineScaleSetVMsClient manages virtual machine scale set VMs.
	VirtualMachineScaleSetVMsClient *compute.VirtualMachineScaleSetVMsClient
	// VnetPeeringClient manages virtual network peerings.
	VnetPeeringClient *network.VirtualNetworkPeeringsClient
}

AzureClientSet is the collection of Azure API clients.

func NewAzureClientSet

func NewAzureClientSet(clientCredentialsConfig auth.ClientCredentialsConfig, metricsCollector collector.AzureAPIMetrics, subscriptionID, partnerID string) (*AzureClientSet, error)

NewAzureClientSet returns the Azure API clients using the given Authorizer.

type Factory

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

Factory is creating Azure clients for specified AzureConfig CRs, so basically for specified tenant clusters. All created clients are cached.

func NewFactory

func NewFactory(config FactoryConfig) (*Factory, error)

NewFactory returns a new Azure client factory that is used throughout entire azure-operator lifetime.

func (*Factory) GetDNSRecordSetsClient

func (f *Factory) GetDNSRecordSetsClient(credentialNamespace, credentialName string) (*dns.RecordSetsClient, error)

GetDNSRecordSetsClient returns RecordSetsClient that is used for management of DNS records. The client (for specified cluster) is cached after creation, so the same client is returned every time.

func (*Factory) GetDeploymentsClient

func (f *Factory) GetDeploymentsClient(credentialNamespace, credentialName string) (*resources.DeploymentsClient, error)

GetDeploymentsClient returns DeploymentsClient that is used for management of deployments and ARM templates. The client (for specified cluster) is cached after creation, so the same client is returned every time.

func (*Factory) GetDisksClient

func (f *Factory) GetDisksClient(credentialNamespace, credentialName string) (*compute.DisksClient, error)

GetDisksClient returns DisksClient that is used for management of virtual disks. The client (for specified cluster) is cached after creation, so the same client is returned every time.

func (*Factory) GetGroupsClient

func (f *Factory) GetGroupsClient(credentialNamespace, credentialName string) (*resources.GroupsClient, error)

GetGroupsClient returns GroupsClient that is used for management of resource groups for the specified cluster. The created client is cached for the time period specified in the factory config.

func (*Factory) GetInterfacesClient

func (f *Factory) GetInterfacesClient(credentialNamespace, credentialName string) (*network.InterfacesClient, error)

GetInterfacesClient returns InterfacesClient that is used for management of network interfaces for the specified cluster. The created client is cached for the time period specified in the factory config.

func (*Factory) GetNatGatewaysClient

func (f *Factory) GetNatGatewaysClient(credentialNamespace, credentialName string) (*network.NatGatewaysClient, error)

GetNatGatewaysClient returns *network.NatGatewaysClient that is used for management of Nat Gateways. The created client is cached for the time period specified in the factory config.

func (*Factory) GetNetworkSecurityGroupsClient

func (f *Factory) GetNetworkSecurityGroupsClient(credentialNamespace, credentialName string) (*network.SecurityGroupsClient, error)

GetNetworkSecurityGroupsClient returns *network.SecurityGroupsClient that is used for management of Network Security Groups. The created client is cached for the time period specified in the factory config.

func (*Factory) GetPublicIPAddressesClient

func (f *Factory) GetPublicIPAddressesClient(credentialNamespace, credentialName string) (*network.PublicIPAddressesClient, error)

func (*Factory) GetResourceSkusClient

func (f *Factory) GetResourceSkusClient(credentialNamespace, credentialName string) (*compute.ResourceSkusClient, error)

GetResourceSkusClient returns *compute.ResourceSkusClient that is used for reading VM instance types. The created client is cached for the time period specified in the factory config.

func (*Factory) GetRoleAssignmentsClient

func (f *Factory) GetRoleAssignmentsClient(credentialNamespace, credentialName string) (*authorization.RoleAssignmentsClient, error)

func (*Factory) GetSnapshotsClient

func (f *Factory) GetSnapshotsClient(credentialNamespace, credentialName string) (*compute.SnapshotsClient, error)

GetSnapshotsClient returns *compute.SnapshotsClient that is used for management of Azure snapshots (both disks and VMs). The created client is cached for the time period specified in the factory config.

func (*Factory) GetStorageAccountsClient

func (f *Factory) GetStorageAccountsClient(credentialNamespace, credentialName string) (*storage.AccountsClient, error)

GetStorageAccountsClient returns *storage.AccountsClient that is used for management of Azure storage accounts for the specified cluster. The created client is cached for the time period specified in the factory config.

func (*Factory) GetSubnetsClient

func (f *Factory) GetSubnetsClient(credentialNamespace, credentialName string) (*network.SubnetsClient, error)

GetSubnetsClient returns *network.SubnetsClient that is used for management of Azure subnets. The created client is cached for the time period specified in the factory config.

func (*Factory) GetVirtualMachineScaleSetVMsClient

func (f *Factory) GetVirtualMachineScaleSetVMsClient(credentialNamespace, credentialName string) (*compute.VirtualMachineScaleSetVMsClient, error)

GetVirtualMachineScaleSetVMsClient returns GetVirtualMachineScaleSetVMsClient that is used for management of virtual machine scale set instances for the specified cluster. The created client is cached for the time period specified in the factory config.

func (*Factory) GetVirtualMachineScaleSetsClient

func (f *Factory) GetVirtualMachineScaleSetsClient(credentialNamespace, credentialName string) (*compute.VirtualMachineScaleSetsClient, error)

GetVirtualMachineScaleSetsClient returns VirtualMachineScaleSetsClient that is used for management of virtual machine scale sets for the specified cluster. The created client is cached for the time period specified in the factory config.

func (*Factory) GetVirtualNetworkGatewayConnectionsClient

func (f *Factory) GetVirtualNetworkGatewayConnectionsClient(credentialNamespace, credentialName string) (*network.VirtualNetworkGatewayConnectionsClient, error)

func (*Factory) GetVirtualNetworkGatewaysClient

func (f *Factory) GetVirtualNetworkGatewaysClient(credentialNamespace, credentialName string) (*network.VirtualNetworkGatewaysClient, error)

func (*Factory) GetVirtualNetworkPeeringsClient

func (f *Factory) GetVirtualNetworkPeeringsClient(credentialNamespace, credentialName string) (*network.VirtualNetworkPeeringsClient, error)

func (*Factory) GetVirtualNetworksClient

func (f *Factory) GetVirtualNetworksClient(credentialNamespace, credentialName string) (*network.VirtualNetworksClient, error)

GetVirtualNetworksClient returns *network.VirtualNetworksClient that is used for management of Azure virtual networks. The created client is cached for the time period specified in the factory config.

type FactoryConfig

type FactoryConfig struct {
	AzureAPIMetrics    collector.AzureAPIMetrics
	CacheDuration      time.Duration
	CredentialProvider credential.Provider
	Logger             micrologger.Logger
}

type Interface

type Interface interface {
	GetCredentialSecret(ctx context.Context, objectMeta v1.ObjectMeta) (*v1alpha1.CredentialSecret, error)
	GetDeploymentsClient(ctx context.Context, objectMeta v1.ObjectMeta) (*resources.DeploymentsClient, error)
	GetDisksClient(ctx context.Context, objectMeta v1.ObjectMeta) (*compute.DisksClient, error)
	GetGroupsClient(ctx context.Context, objectMeta v1.ObjectMeta) (*resources.GroupsClient, error)
	GetInterfacesClient(ctx context.Context, objectMeta v1.ObjectMeta) (*network.InterfacesClient, error)
	GetDNSRecordSetsClient(ctx context.Context, objectMeta v1.ObjectMeta) (*dns.RecordSetsClient, error)
	GetVirtualMachineScaleSetsClient(ctx context.Context, objectMeta v1.ObjectMeta) (*compute.VirtualMachineScaleSetsClient, error)
	GetVirtualMachineScaleSetVMsClient(ctx context.Context, objectMeta v1.ObjectMeta) (*compute.VirtualMachineScaleSetVMsClient, error)
	GetVirtualNetworksClient(ctx context.Context, objectMeta v1.ObjectMeta) (*network.VirtualNetworksClient, error)
	GetSnapshotsClient(ctx context.Context, objectMeta v1.ObjectMeta) (*compute.SnapshotsClient, error)
	GetStorageAccountsClient(ctx context.Context, objectMeta v1.ObjectMeta) (*storage.AccountsClient, error)
	GetSubnetsClient(ctx context.Context, objectMeta v1.ObjectMeta) (*network.SubnetsClient, error)
	GetNatGatewaysClient(ctx context.Context, objectMeta v1.ObjectMeta) (*network.NatGatewaysClient, error)
	GetResourceSkusClient(ctx context.Context, objectMeta v1.ObjectMeta) (*compute.ResourceSkusClient, error)
	GetVnetPeeringsClient(ctx context.Context, objectMeta v1.ObjectMeta) (*network.VirtualNetworkPeeringsClient, error)
	GetVirtualNetworkGatewaysClient(ctx context.Context, objectMeta v1.ObjectMeta) (*network.VirtualNetworkGatewaysClient, error)
	GetVirtualNetworkGatewayConnectionsClient(ctx context.Context, objectMeta v1.ObjectMeta) (*network.VirtualNetworkGatewayConnectionsClient, error)
	GetPublicIpAddressesClient(ctx context.Context, objectMeta v1.ObjectMeta) (*network.PublicIPAddressesClient, error)
	GetRoleAssignmentsClient(ctx context.Context, objectMeta v1.ObjectMeta) (*authorization.RoleAssignmentsClient, error)
}

type OrganizationFactory

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

func (*OrganizationFactory) GetCredentialSecret

func (f *OrganizationFactory) GetCredentialSecret(ctx context.Context, objectMeta v1.ObjectMeta) (*v1alpha1.CredentialSecret, error)

func (*OrganizationFactory) GetDNSRecordSetsClient

func (f *OrganizationFactory) GetDNSRecordSetsClient(ctx context.Context, objectMeta v1.ObjectMeta) (*dns.RecordSetsClient, error)

func (*OrganizationFactory) GetDeploymentsClient

func (f *OrganizationFactory) GetDeploymentsClient(ctx context.Context, objectMeta v1.ObjectMeta) (*resources.DeploymentsClient, error)

func (*OrganizationFactory) GetDisksClient

func (f *OrganizationFactory) GetDisksClient(ctx context.Context, objectMeta v1.ObjectMeta) (*compute.DisksClient, error)

func (*OrganizationFactory) GetGroupsClient

func (f *OrganizationFactory) GetGroupsClient(ctx context.Context, objectMeta v1.ObjectMeta) (*resources.GroupsClient, error)

func (*OrganizationFactory) GetInterfacesClient

func (f *OrganizationFactory) GetInterfacesClient(ctx context.Context, objectMeta v1.ObjectMeta) (*network.InterfacesClient, error)

func (*OrganizationFactory) GetNatGatewaysClient

func (f *OrganizationFactory) GetNatGatewaysClient(ctx context.Context, objectMeta v1.ObjectMeta) (*network.NatGatewaysClient, error)

func (*OrganizationFactory) GetPublicIpAddressesClient

func (f *OrganizationFactory) GetPublicIpAddressesClient(ctx context.Context, objectMeta v1.ObjectMeta) (*network.PublicIPAddressesClient, error)

func (*OrganizationFactory) GetResourceSkusClient

func (f *OrganizationFactory) GetResourceSkusClient(ctx context.Context, objectMeta v1.ObjectMeta) (*compute.ResourceSkusClient, error)

func (*OrganizationFactory) GetRoleAssignmentsClient

func (f *OrganizationFactory) GetRoleAssignmentsClient(ctx context.Context, objectMeta v1.ObjectMeta) (*authorization.RoleAssignmentsClient, error)

func (*OrganizationFactory) GetSnapshotsClient

func (f *OrganizationFactory) GetSnapshotsClient(ctx context.Context, objectMeta v1.ObjectMeta) (*compute.SnapshotsClient, error)

func (*OrganizationFactory) GetStorageAccountsClient

func (f *OrganizationFactory) GetStorageAccountsClient(ctx context.Context, objectMeta v1.ObjectMeta) (*storage.AccountsClient, error)

func (*OrganizationFactory) GetSubnetsClient

func (f *OrganizationFactory) GetSubnetsClient(ctx context.Context, objectMeta v1.ObjectMeta) (*network.SubnetsClient, error)

func (*OrganizationFactory) GetVirtualMachineScaleSetVMsClient

func (f *OrganizationFactory) GetVirtualMachineScaleSetVMsClient(ctx context.Context, objectMeta v1.ObjectMeta) (*compute.VirtualMachineScaleSetVMsClient, error)

func (*OrganizationFactory) GetVirtualMachineScaleSetsClient

func (f *OrganizationFactory) GetVirtualMachineScaleSetsClient(ctx context.Context, objectMeta v1.ObjectMeta) (*compute.VirtualMachineScaleSetsClient, error)

func (*OrganizationFactory) GetVirtualNetworkGatewayConnectionsClient

func (f *OrganizationFactory) GetVirtualNetworkGatewayConnectionsClient(ctx context.Context, objectMeta v1.ObjectMeta) (*network.VirtualNetworkGatewayConnectionsClient, error)

func (*OrganizationFactory) GetVirtualNetworkGatewaysClient

func (f *OrganizationFactory) GetVirtualNetworkGatewaysClient(ctx context.Context, objectMeta v1.ObjectMeta) (*network.VirtualNetworkGatewaysClient, error)

func (*OrganizationFactory) GetVirtualNetworksClient

func (f *OrganizationFactory) GetVirtualNetworksClient(ctx context.Context, objectMeta v1.ObjectMeta) (*network.VirtualNetworksClient, error)

func (*OrganizationFactory) GetVnetPeeringsClient

func (f *OrganizationFactory) GetVnetPeeringsClient(ctx context.Context, objectMeta v1.ObjectMeta) (*network.VirtualNetworkPeeringsClient, error)

type OrganizationFactoryConfig

type OrganizationFactoryConfig struct {
	CtrlClient client.Client
	Factory    *Factory
	Logger     micrologger.Logger
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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