Documentation ¶
Index ¶
- Constants
- func FetchAsyncOperation(ctx context.Context, client autorest.Sender, as *v1alpha3.AsyncOperation) error
- func IsNotFound(err error) bool
- func LateInitializeBoolPtrFromPtr(in, from *bool) *bool
- func LateInitializeIntPtrFromInt32Ptr(in *int, from *int32) *int
- func LateInitializeStringMap(in map[string]string, from map[string]*string) map[string]string
- func LateInitializeStringPtrFromPtr(in, from *string) *string
- func LateInitializeStringPtrFromVal(in *string, from string) *string
- func LateInitializeStringValArrFromArrPtr(in []string, from *[]string) []string
- func ToBool(b *bool) bool
- func ToBoolPtr(b bool, o ...FieldOption) *bool
- func ToInt(i *int32) int
- func ToInt32(i *int) *int32
- func ToInt32Ptr(i int, o ...FieldOption) *int32
- func ToInt32PtrFromIntPtr(i *int, o ...FieldOption) *int32
- func ToString(s *string) string
- func ToStringArrayPtr(m []string) *[]string
- func ToStringPtr(s string, o ...FieldOption) *string
- func ToStringPtrMap(m map[string]string) map[string]*string
- func ValidateClient(client *Client) error
- type ApplicationAPI
- type ApplicationClient
- type ApplicationParameters
- type Client
- type Credentials
- type FieldOption
- type ServicePrincipalAPI
- type ServicePrincipalClient
Constants ¶
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" )
Variables ¶
This section is empty.
Functions ¶
func FetchAsyncOperation ¶ added in v0.4.0
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 IsNotFound ¶
IsNotFound returns a value indicating whether the given error represents that the resource was not found.
func LateInitializeBoolPtrFromPtr ¶ added in v0.3.0
LateInitializeBoolPtrFromPtr late-inits *bool
func LateInitializeIntPtrFromInt32Ptr ¶ added in v0.3.0
LateInitializeIntPtrFromInt32Ptr late-inits *int
func LateInitializeStringMap ¶ added in v0.3.0
LateInitializeStringMap late-inits map[string]string
func LateInitializeStringPtrFromPtr ¶ added in v0.3.0
LateInitializeStringPtrFromPtr late-inits *string
func LateInitializeStringPtrFromVal ¶ added in v0.3.0
LateInitializeStringPtrFromVal late-inits *string using string
func LateInitializeStringValArrFromArrPtr ¶ added in v0.3.0
LateInitializeStringValArrFromArrPtr late-inits []string
func ToBool ¶
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 ¶
ToInt converts the supplied pointer to int32 to an int, returning zero if the pointer is nil,
func ToInt32 ¶ added in v0.3.0
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 ¶ added in v0.3.0
func ToInt32PtrFromIntPtr(i *int, o ...FieldOption) *int32
ToInt32PtrFromIntPtr converts the supplied int pointer for use with the Azure Go SDK.
func ToString ¶
ToString converts the supplied pointer to string to a string, returning the empty string if the pointer is nil.
func ToStringArrayPtr ¶ added in v0.3.0
ToStringArrayPtr converts []string to *[]string which is expected by Azure API.
func ToStringPtr ¶
func ToStringPtr(s string, o ...FieldOption) *string
ToStringPtr converts the supplied string for use with the Azure Go SDK.
func ToStringPtrMap ¶
ToStringPtrMap converts the supplied map for use with the Azure Go SDK.
func ValidateClient ¶
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 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(c *Client) (*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
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.
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(c *Client) (*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