azure

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2018 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AgentPoolProfileNameFmt is a format string for the name of the automatically created cluster agent pool profile
	AgentPoolProfileNameFmt = "%s-nodepool"
)
View Source
const (
	// UserAgent is the user agent extension that identifies the Crossplane Azure client
	UserAgent = "crossplane-azure-client"
)

Variables

This section is empty.

Functions

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns a value indicating whether the given error represents that the resource was not found.

func MySQLServerConditionType

func MySQLServerConditionType(state mysql.ServerState) corev1alpha1.ConditionType

MySQLServerConditionType converts the given MySQL Server state string into a corresponding condition type

func MySQLServerSkuName

func MySQLServerSkuName(pricingTier databasev1alpha1.PricingTierSpec) (string, error)

MySQLServerSkuName returns the name of the MySQL Server SKU, which is tier + family + cores, e.g. B_Gen4_1, GP_Gen5_8.

func MySQLServerStatusMessage

func MySQLServerStatusMessage(instanceName string, state mysql.ServerState) string

MySQLServerStatusMessage returns a status message based on the given server state

func SanitizeClusterName

func SanitizeClusterName(name string) string

SanitizeClusterName sanitizes the given AKS cluster name

func ToGeoRedundantBackup

func ToGeoRedundantBackup(geoRedundantBackup bool) mysql.GeoRedundantBackup

ToGeoRedundantBackup converts the given bool its corresponding GeoRedundantBackup value

func ToSslEnforcement

func ToSslEnforcement(sslEnforced bool) mysql.SslEnforcementEnum

ToSslEnforcement converts the given bool its corresponding SslEnforcementEnum value

func ValidateClient

func ValidateClient(client *Client) error

ValidateClient verifies if the given client is valid by testing if it can make an Azure service API call TODO: is there a better way to validate the Azure client?

Types

type AKSClusterAPI

type AKSClusterAPI interface {
	Get(ctx context.Context, instance computev1alpha1.AKSCluster) (containerservice.ManagedCluster, error)
	CreateOrUpdateBegin(ctx context.Context, instance computev1alpha1.AKSCluster, clusterName, appID, spSecret string) ([]byte, error)
	CreateOrUpdateEnd(op []byte) (bool, error)
	Delete(ctx context.Context, instance computev1alpha1.AKSCluster) (containerservice.ManagedClustersDeleteFuture, error)
	ListClusterAdminCredentials(ctx context.Context, instance computev1alpha1.AKSCluster) (containerservice.CredentialResults, error)
}

AKSClusterAPI represents the API interface for a AKS Cluster client

type AKSClusterClient

type AKSClusterClient struct {
	containerservice.ManagedClustersClient
}

AKSClusterClient is the concreate implementation of the AKSClusterAPI interface that calls Azure API.

func NewAKSClusterClient

func NewAKSClusterClient(provider *v1alpha1.Provider, clientset kubernetes.Interface) (*AKSClusterClient, error)

NewAKSClusterClient creates and initializes a AKSClusterClient instance.

func (*AKSClusterClient) CreateOrUpdateBegin

func (c *AKSClusterClient) CreateOrUpdateBegin(ctx context.Context, instance computev1alpha1.AKSCluster, clusterName, appID, spSecret string) ([]byte, error)

CreateOrUpdateBegin begins the create/update operation for a AKS Cluster with the given properties

func (*AKSClusterClient) CreateOrUpdateEnd

func (c *AKSClusterClient) CreateOrUpdateEnd(op []byte) (done bool, err error)

CreateOrUpdateEnd checks to see if the given create/update operation is completed and if any error has occurred.

func (*AKSClusterClient) Delete

Delete begins the deletion operator for the given AKS cluster instance

func (*AKSClusterClient) Get

Get returns the AKS cluster details for the given instance

func (*AKSClusterClient) ListClusterAdminCredentials

func (c *AKSClusterClient) ListClusterAdminCredentials(ctx context.Context, instance computev1alpha1.AKSCluster) (containerservice.CredentialResults, error)

ListClusterAdminCredentials will return the admin credentials used to connect to the given AKS cluster

type AKSSetupAPIFactory

type AKSSetupAPIFactory interface {
	CreateSetupClient(*v1alpha1.Provider, kubernetes.Interface) (*AKSSetupClient, error)
}

AKSSetupAPIFactory is an interface that can create instances of the AKSSetupClient

type AKSSetupClient

type AKSSetupClient struct {
	AKSClusterAPI
	ApplicationAPI
	ServicePrincipalAPI
}

AKSSetupClient is a type that implements all of the AKS setup interface

type AKSSetupClientFactory

type AKSSetupClientFactory struct {
}

AKSSetupClientFactory implements the AKSSetupAPIFactory interface by returning real clients that talk to Azure APIs

func (*AKSSetupClientFactory) CreateSetupClient

func (f *AKSSetupClientFactory) CreateSetupClient(provider *v1alpha1.Provider, clientset kubernetes.Interface) (*AKSSetupClient, error)

CreateSetupClient creates and returns an AKS setup client that is ready to talk to Azure APIs

type ApplicationAPI

type ApplicationAPI interface {
	CreateApplication(ctx context.Context, appParams ApplicationParameters) (*graphrbac.Application, error)
	DeleteApplication(ctx context.Context, appObjectID string) error
}

ApplicationAPI represents the API interface for an Azure Application client

type ApplicationClient

type ApplicationClient struct {
	graphrbac.ApplicationsClient
}

ApplicationClient is the concreate implementation of the ApplicationAPI interface that calls Azure API.

func NewApplicationClient

func NewApplicationClient(provider *v1alpha1.Provider, clientset kubernetes.Interface) (*ApplicationClient, error)

NewApplicationClient creates and initializes a ApplicationClient instance.

func (*ApplicationClient) CreateApplication

func (c *ApplicationClient) CreateApplication(ctx context.Context, appParams ApplicationParameters) (*graphrbac.Application, error)

CreateApplication creates a new AD application with the given parameters

func (*ApplicationClient) DeleteApplication

func (c *ApplicationClient) DeleteApplication(ctx context.Context, appObjectID string) error

DeleteApplication will delete the given AD application

type ApplicationParameters

type ApplicationParameters struct {
	Name          string
	DNSNamePrefix string
	Location      string
	ObjectID      string
	ClientSecret  string
}

ApplicationParameters are the parameters used to create an AD application

type Client

type Client struct {
	autorest.Authorizer
	SubscriptionID string
	// contains filtered or unexported fields
}

Client struct that represents the information needed to connect to the Azure services as a client

func NewClient

func NewClient(provider *v1alpha1.Provider, clientset kubernetes.Interface) (*Client, error)

NewClient will look up the Azure credential information from the given provider and return a client that can be used to connect to Azure services.

type MySQLServerAPI

type MySQLServerAPI interface {
	GetServer(ctx context.Context, resourceGroupName string, serverName string) (mysql.Server, error)
	CreateServerBegin(ctx context.Context, resourceGroupName string, serverName string, parameters mysql.ServerForCreate) ([]byte, error)
	CreateServerEnd(createOp []byte) (bool, error)
	DeleteServer(ctx context.Context, resourceGroupName string, serverName string) (mysql.ServersDeleteFuture, error)
	GetFirewallRule(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string) (result mysql.FirewallRule, err error)
	CreateFirewallRulesBegin(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters mysql.FirewallRule) ([]byte, error)
	CreateFirewallRulesEnd(createOp []byte) (bool, error)
}

MySQLServerAPI represents the API interface for a MySQL Server client

type MySQLServerAPIFactory

type MySQLServerAPIFactory interface {
	CreateAPIInstance(*v1alpha1.Provider, kubernetes.Interface) (MySQLServerAPI, error)
}

MySQLServerAPIFactory is an interface that can create instances of the MySQLServerAPI interface

type MySQLServerClient

type MySQLServerClient struct {
	mysql.ServersClient
	mysql.FirewallRulesClient
}

MySQLServerClient is the concreate implementation of the MySQLServerAPI interface that calls Azure API.

func NewMySQLServerClient

func NewMySQLServerClient(provider *v1alpha1.Provider, clientset kubernetes.Interface) (*MySQLServerClient, error)

NewMySQLServerClient creates and initializes a MySQLServerClient instance.

func (*MySQLServerClient) CreateFirewallRulesBegin

func (c *MySQLServerClient) CreateFirewallRulesBegin(ctx context.Context, resourceGroupName string, serverName string,
	firewallRuleName string, parameters mysql.FirewallRule) ([]byte, error)

CreateFirewallRulesBegin begins the create operation for a firewall rule

func (*MySQLServerClient) CreateFirewallRulesEnd

func (c *MySQLServerClient) CreateFirewallRulesEnd(createOp []byte) (done bool, err error)

CreateFirewallRulesEnd checks to see if the given create operation is completed and if any error has occurred.

func (*MySQLServerClient) CreateServerBegin

func (c *MySQLServerClient) CreateServerBegin(ctx context.Context, resourceGroupName string, serverName string,
	parameters mysql.ServerForCreate) ([]byte, error)

CreateServerBegin begins the create operation for a MySQL Server with the given properties

func (*MySQLServerClient) CreateServerEnd

func (c *MySQLServerClient) CreateServerEnd(createOp []byte) (done bool, err error)

CreateServerEnd checks to see if the given create operation is completed and if any error has occurred.

func (*MySQLServerClient) DeleteServer

func (c *MySQLServerClient) DeleteServer(ctx context.Context, resourceGroupName string, serverName string) (mysql.ServersDeleteFuture, error)

DeleteServer deletes the given MySQL Server

func (*MySQLServerClient) GetFirewallRule

func (c *MySQLServerClient) GetFirewallRule(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string) (result mysql.FirewallRule, err error)

GetFirewallRule gets the given firewall rule

func (*MySQLServerClient) GetServer

func (c *MySQLServerClient) GetServer(ctx context.Context, resourceGroupName string, serverName string) (mysql.Server, error)

GetServer returns the given MySQL Server

type MySQLServerClientFactory

type MySQLServerClientFactory struct {
}

MySQLServerClientFactory implements the MySQLServerAPIFactory by returning the concrete MySQLServerClient implementation

func (*MySQLServerClientFactory) CreateAPIInstance

func (f *MySQLServerClientFactory) CreateAPIInstance(provider *v1alpha1.Provider, clientset kubernetes.Interface) (MySQLServerAPI, error)

CreateAPIInstance returns a concrete MySQLServerClient implementation

type ServicePrincipalAPI

type ServicePrincipalAPI interface {
	CreateServicePrincipal(ctx context.Context, spID, appID string) (*graphrbac.ServicePrincipal, error)
	DeleteServicePrincipal(ctx context.Context, spID string) error
}

ServicePrincipalAPI represents the API interface for an Azure service principal client

type ServicePrincipalClient

type ServicePrincipalClient struct {
	graphrbac.ServicePrincipalsClient
}

ServicePrincipalClient is the concreate implementation of the ServicePrincipalAPI interface that calls Azure API.

func NewServicePrincipalClient

func NewServicePrincipalClient(provider *v1alpha1.Provider, clientset kubernetes.Interface) (*ServicePrincipalClient, error)

NewServicePrincipalClient creates and initializes a ServicePrincipalClient instance.

func (*ServicePrincipalClient) CreateServicePrincipal

func (c *ServicePrincipalClient) CreateServicePrincipal(ctx context.Context, spID, appID string) (*graphrbac.ServicePrincipal, error)

CreateServicePrincipal creates a new service principal linked to the given AD application

func (*ServicePrincipalClient) DeleteServicePrincipal

func (c *ServicePrincipalClient) DeleteServicePrincipal(ctx context.Context, spID string) error

DeleteServicePrincipal will delete the given service principal

Jump to

Keyboard shortcuts

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