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" // UltraSSDAvailable identifies the capability for the support of UltraSSD data disks. UltraSSDAvailable = "UltraSSDAvailable" )
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 ¶
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 ¶
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 ¶
func NewStaticCache(data []compute.ResourceSku, location string) *Cache
NewStaticCache initializes a cache with data and no ability to refresh. Used for testing.
func (*Cache) Get ¶
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 ¶
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 ¶
GetZonesWithVMSize returns available zones for a virtual machine size in the given location.
type Cacher ¶
type Cacher interface { Get(key interface{}) (value interface{}, ok bool) Add(key interface{}, value interface{}) bool }
Cacher describes the ability to get and to add items to cache.
type NewCacheFunc ¶
type NewCacheFunc func(azure.Authorizer, string) *Cache
NewCacheFunc allows for mocking out the underlying client.
type ResourceType ¶
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 ¶
type SKU compute.ResourceSku
SKU is a thin layer over the Azure resource SKU API to better introspect capabilities.
func (SKU) GetCapability ¶
GetCapability gets the value assigned to the given capability. Eg. MaximumPlatformFaultDomainCount -> "3" will return "3" for the capability "MaximumPlatformFaultDomainCount".
func (SKU) HasCapability ¶
HasCapability return true for a capability which can be either supported or not. Examples include "EphemeralOSDiskSupported", "UltraSSDAvavailable" "EncryptionAtHostSupported", "AcceleratedNetworkingEnabled", and "RdmaEnabled".
func (SKU) HasCapabilityWithCapacity ¶
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".
func (SKU) HasLocationCapability ¶ added in v0.5.1
HasLocationCapability returns true if the provided resource supports the location capability.
Directories ¶
Path | Synopsis |
---|---|
Run go generate to regenerate this mock.
|
Run go generate to regenerate this mock. |