azure

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UserAgent is the user agent addition that identifies the Crossplane Azure client
	UserAgent = "crossplane-azure-client"
	// AsyncOperationStatusInProgress is the status value for AsyncOperation type
	// that indicates the operation is still ongoing.
	AsyncOperationStatusInProgress = "InProgress"
)
View Source
const (
	CredentialsKeyClientID                       = "clientId"
	CredentialsKeyClientSecret                   = "clientSecret"
	CredentialsKeyTenantID                       = "tenantId"
	CredentialsKeySubscriptionID                 = "subscriptionId"
	CredentialsKeyActiveDirectoryEndpointURL     = "activeDirectoryEndpointUrl"
	CredentialsKeyResourceManagerEndpointURL     = "resourceManagerEndpointUrl"
	CredentialsKeyActiveDirectoryGraphResourceID = "activeDirectoryGraphResourceId"
	CredentialsKeySQLManagementEndpointURL       = "sqlManagementEndpointUrl"
	CredentialsKeyGalleryEndpointURL             = "galleryEndpointUrl"
	CredentialsManagementEndpointURL             = "managementEndpointUrl"
)

Credentials Secret content is a json whose keys are below.

Variables

This section is empty.

Functions

func FetchAsyncOperation

func FetchAsyncOperation(ctx context.Context, client autorest.Sender, as *v1alpha3.AsyncOperation) error

FetchAsyncOperation updates the given operation object with the most up-to-date status retrieved from Azure API.

func GetAuthInfo added in v0.12.0

func GetAuthInfo(ctx context.Context, c client.Client, mg resource.Managed) (content map[string]string, authorizer autorest.Authorizer, err error)

GetAuthInfo figures out how to connect to Azure API and returns the necessary information to be used for controllers to construct their specific clients.

func Int64ToInt added in v0.19.0

func Int64ToInt(i *int64) int

Int64ToInt converts the supplied pointer to int64 to an int, returning zero if the pointer is nil,

func IsNotFound

func IsNotFound(err error) bool

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

func LateInitializeBoolPtrFromPtr

func LateInitializeBoolPtrFromPtr(in, from *bool) *bool

LateInitializeBoolPtrFromPtr late-inits *bool

func LateInitializeInt32PtrFromInt32Ptr added in v0.18.0

func LateInitializeInt32PtrFromInt32Ptr(in *int32, from *int32) *int32

LateInitializeInt32PtrFromInt32Ptr late-inits *int32

func LateInitializeIntPtrFromInt32Ptr

func LateInitializeIntPtrFromInt32Ptr(in *int, from *int32) *int

LateInitializeIntPtrFromInt32Ptr late-inits *int

func LateInitializeStringMap

func LateInitializeStringMap(in map[string]string, from map[string]*string) map[string]string

LateInitializeStringMap late-inits map[string]string

func LateInitializeStringPtrFromPtr

func LateInitializeStringPtrFromPtr(in, from *string) *string

LateInitializeStringPtrFromPtr late-inits *string

func LateInitializeStringPtrFromVal

func LateInitializeStringPtrFromVal(in *string, from string) *string

LateInitializeStringPtrFromVal late-inits *string using string

func LateInitializeStringValArrFromArrPtr

func LateInitializeStringValArrFromArrPtr(in []string, from *[]string) []string

LateInitializeStringValArrFromArrPtr late-inits []string

func ToBool

func ToBool(b *bool) bool

ToBool converts the supplied pointer to bool to a bool, returning the false if the pointer is nil.

func ToBoolPtr

func ToBoolPtr(b bool, o ...FieldOption) *bool

ToBoolPtr converts the supplied bool for use with the Azure Go SDK.

func ToInt

func ToInt(i *int32) int

ToInt converts the supplied pointer to int32 to an int, returning zero if the pointer is nil,

func ToInt32

func ToInt32(i *int) *int32

ToInt32 converts the supplied *int to *int32, while returning nil if the supplied reference is nil.

func ToInt32Ptr

func ToInt32Ptr(i int, o ...FieldOption) *int32

ToInt32Ptr converts the supplied int for use with the Azure Go SDK.

func ToInt32PtrFromIntPtr

func ToInt32PtrFromIntPtr(i *int, o ...FieldOption) *int32

ToInt32PtrFromIntPtr converts the supplied int pointer for use with the Azure Go SDK.

func ToInt64 added in v0.19.0

func ToInt64(i *int) *int64

ToInt64 converts the supplied *int to *int64, while returning nil if the supplied reference is nil.

func ToString

func ToString(s *string) string

ToString converts the supplied pointer to string to a string, returning the empty string if the pointer is nil.

func ToStringArray added in v0.19.0

func ToStringArray(m *[]string) []string

ToStringArray converts *[]string to []string which is expected by Azure API.

func ToStringArrayPtr

func ToStringArrayPtr(m []string) *[]string

ToStringArrayPtr converts []string to *[]string which is expected by Azure API.

func ToStringMap added in v0.9.0

func ToStringMap(m map[string]*string) map[string]string

ToStringMap converts the supplied map from the Azure Go SDK to internal representation.

func ToStringPtr

func ToStringPtr(s string, o ...FieldOption) *string

ToStringPtr converts the supplied string for use with the Azure Go SDK.

func ToStringPtrMap

func ToStringPtrMap(m map[string]string) map[string]*string

ToStringPtrMap converts the supplied map for use with the Azure Go SDK.

func UseProvider added in v0.12.0

func UseProvider(ctx context.Context, c client.Client, mg resource.Managed) (content map[string]string, authorizer autorest.Authorizer, err error)

UseProvider to return the necessary information to construct an Azure client. Deprecated: Use UseProviderConfig

func UseProviderConfig added in v0.12.0

func UseProviderConfig(ctx context.Context, c client.Client, mg resource.Managed) (content map[string]string, authorizer autorest.Authorizer, err error)

UseProviderConfig to return the necessary information to construct an Azure client.

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 Client

type Client struct {
	autorest.Authorizer
	Credentials
}

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

func NewClient

func NewClient(credentials []byte) (*Client, error)

NewClient returns a client that can be used to connect to Azure services using the supplied JSON credentials.

type Credentials

type Credentials struct {
	ClientID                       string `json:"clientId"`
	ClientSecret                   string `json:"clientSecret"`
	TenantID                       string `json:"tenantId"`
	SubscriptionID                 string `json:"subscriptionId"`
	ActiveDirectoryEndpointURL     string `json:"activeDirectoryEndpointUrl"`
	ResourceManagerEndpointURL     string `json:"resourceManagerEndpointUrl"`
	ActiveDirectoryGraphResourceID string `json:"activeDirectoryGraphResourceId"`
}

Credentials represents the contents of a JSON encoded Azure credentials file. It is a subset of the internal type used by the Azure auth library. https://github.com/Azure/go-autorest/blob/be17756/autorest/azure/auth/auth.go#L226

type FieldOption

type FieldOption int

A FieldOption determines how common Go types are translated to the types required by the Azure Go SDK.

const (
	// FieldRequired causes zero values to be converted to a pointer to the zero
	// value, rather than a nil pointer. Azure Go SDK types use pointer fields,
	// with a nil pointer indicating an unset field. Our ToPtr functions return
	// a nil pointer for a zero values, unless FieldRequired is set.
	FieldRequired FieldOption = iota
)

Field options.

Directories

Path Synopsis
keyvault

Jump to

Keyboard shortcuts

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