azure

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2020 License: Apache-2.0 Imports: 19 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"
)

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

func IsNotFound(err error) bool

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

func LateInitializeBoolPtrFromPtr added in v0.3.0

func LateInitializeBoolPtrFromPtr(in, from *bool) *bool

LateInitializeBoolPtrFromPtr late-inits *bool

func LateInitializeIntPtrFromInt32Ptr added in v0.3.0

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

LateInitializeIntPtrFromInt32Ptr late-inits *int

func LateInitializeStringMap added in v0.3.0

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

LateInitializeStringMap late-inits map[string]string

func LateInitializeStringPtrFromPtr added in v0.3.0

func LateInitializeStringPtrFromPtr(in, from *string) *string

LateInitializeStringPtrFromPtr late-inits *string

func LateInitializeStringPtrFromVal added in v0.3.0

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

LateInitializeStringPtrFromVal late-inits *string using string

func LateInitializeStringValArrFromArrPtr added in v0.3.0

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 added in v0.3.0

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 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

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 ToStringArrayPtr added in v0.3.0

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

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

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

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

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 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

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.

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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