Documentation
¶
Index ¶
- Constants
- type AzureClient
- type Cache
- func (c *Cache) Get(ctx context.Context, name string, kind ResourceType) (SKU, error)
- func (c *Cache) GetZones(ctx context.Context, location string) ([]string, error)
- func (c *Cache) GetZonesWithVMSize(ctx context.Context, size, location string) ([]string, error)
- func (c *Cache) Map(ctx context.Context, mapFn func(sku SKU)) error
- type Cacher
- type Client
- type NewCacheFunc
- type ResourceType
- type SKU
- type Supported
Constants ¶
const ( // EphemeralOSDisk identifies the capability for ephemeral os support. EphemeralOSDisk = "EphemeralOSDiskSupported" // AcceleratedNetworking identifies the capability for accelerated networking support. AcceleratedNetworking = "AcceleratedNetworkingEnabled" //VCPUs identifies the capability for the number of vCPUS. VCPUs = "vCPUs" // MemoryGB identifies the capability for memory Size. MemoryGB = "MemoryGB" // MinimumVCPUS is the minimum vCPUS allowed. MinimumVCPUS = 2 // MinimumMemory is the minimum memory allowed. MinimumMemory = 2 // EncryptionAtHost identifies the capability for encryption at host. EncryptionAtHost = "EncryptionAtHostSupported" // MaximumPlatformFaultDomainCount identifies the maximum fault domain count for an availability set in a region MaximumPlatformFaultDomainCount = "MaximumPlatformFaultDomainCount" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AzureClient ¶
type AzureClient struct {
// contains filtered or unexported fields
}
AzureClient contains the Azure go-sdk Client
func NewClient ¶
func NewClient(auth azure.Authorizer) *AzureClient
NewClient creates a new Resource SKUs client from subscription ID.
func (*AzureClient) List ¶
func (ac *AzureClient) List(ctx context.Context, filter string) ([]compute.ResourceSku, error)
List returns all Resource SKUs available to the subscription.
type Cache ¶ added in v0.4.7
type Cache struct {
// contains filtered or unexported fields
}
Cache loads resource SKUs at the beginning of reconcile to expose features available on compute resources. It exposes convenience functionality for trawling Azure SKU capabilities. It may be adapted to periodically refresh data in the background.
func GetCache ¶ added in v0.4.11
func GetCache(auth azure.Authorizer, location string) (*Cache, error)
GetCache either creates a new SKUs cache or returns an existing one based on the location + Authorizer HashKey()
func NewStaticCache ¶ added in v0.4.7
func NewStaticCache(data []compute.ResourceSku) *Cache
NewStaticCache initializes a cache with data and no ability to refresh. Used for testing.
func (*Cache) Get ¶ added in v0.4.7
Get returns a resource SKU with the provided name and category. It returns an error if we could not find a match. We should consider enhancing this function to handle restrictions (e.g. SKU not supported in region), which is why it returns an error and not a boolean.
func (*Cache) GetZones ¶ added in v0.4.7
GetZones looks at all virtual machine sizes and returns the unique set of zones into which some machine size may deploy. It removes restricted virtual machine sizes and duplicates.
func (*Cache) GetZonesWithVMSize ¶ added in v0.4.7
GetZonesWithVMSize returns available zones for a virtual machine size in the given location.
type Cacher ¶ added in v0.4.11
type Cacher interface { Get(key interface{}) (value interface{}, ok bool) Add(key interface{}, value interface{}) }
Cacher describes the ability to get and to add items to cache
type NewCacheFunc ¶ added in v0.4.7
type NewCacheFunc func(azure.Authorizer, string) *Cache
NewCacheFunc allows for mocking out the underlying client
func NewStaticCacheFn ¶ added in v0.4.7
func NewStaticCacheFn(data []compute.ResourceSku) NewCacheFunc
NewStaticCacheFn returns a function that initializes a cache with data and no ability to refresh. Used for testing.
type ResourceType ¶ added in v0.4.7
type ResourceType string
ResourceType models available resource types as a set of known string constants.
const ( // VirtualMachines is a convenience constant to filter resource SKUs to only include VMs. VirtualMachines ResourceType = "virtualMachines" // Disks is a convenience constant to filter resource SKUs to only include disks. Disks ResourceType = "disks" // AvailabilitySets is a convenience constant to filter resource SKUs to only include availability sets. AvailabilitySets ResourceType = "availabilitySets" )
type SKU ¶ added in v0.4.7
type SKU compute.ResourceSku
SKU is a thin layer over the Azure resource SKU API to better introspect capabilities
func (SKU) GetCapability ¶ added in v0.4.11
GetCapability gets the value assigned to the given capability Eg. MaximumPlatformFaultDomainCount -> "3" will return "3" for the capability "MaximumPlatformFaultDomainCount"
func (SKU) HasCapability ¶ added in v0.4.7
HasCapability return true for a capability which can be either supported or not. Examples include "EphemeralOSDiskSupported", "UltraSSDAvavailable" "EncryptionAtHostSupported", "AcceleratedNetworkingEnabled", and "RdmaEnabled"
func (SKU) HasCapabilityWithCapacity ¶ added in v0.4.7
HasCapabilityWithCapacity returns true when the provided resource exposes a numeric capability and the maximum value exposed by that capability exceeds the value requested by the user. Examples include "MaxResourceVolumeMB", "OSVhdSizeMB", "vCPUs", "MemoryGB","MaxDataDiskCount", "CombinedTempDiskAndCachedIOPS", "CombinedTempDiskAndCachedReadBytesPerSecond", "CombinedTempDiskAndCachedWriteBytesPerSecond", "UncachedDiskIOPS", and "UncachedDiskBytesPerSecond"
Directories
¶
Path | Synopsis |
---|---|
Run go generate to regenerate this mock.
|
Run go generate to regenerate this mock. |