Documentation
¶
Index ¶
- Constants
- Variables
- func AKSAgentPoolsAPIErrorFromAKSMachineNotFound(agentPoolName string, validMachines []string) error
- func AKSMachineAPIProvisioningErrorAllocationFailed() *armcontainerservice.ErrorDetail
- func AKSMachineAPIProvisioningErrorAny() *armcontainerservice.ErrorDetail
- func AKSMachineAPIProvisioningErrorLowPriorityCoresQuota(location string) *armcontainerservice.ErrorDetail
- func AKSMachineAPIProvisioningErrorOverconstrainedAllocation() *armcontainerservice.ErrorDetail
- func AKSMachineAPIProvisioningErrorOverconstrainedZonalAllocation() *armcontainerservice.ErrorDetail
- func AKSMachineAPIProvisioningErrorSkuNotAvailable(sku string, location string) *armcontainerservice.ErrorDetail
- func AKSMachineAPIProvisioningErrorTotalRegionalCoresQuota(location string) *armcontainerservice.ErrorDetail
- func AKSMachineAPIProvisioningErrorVMFamilyQuotaExceeded(location string, familyName string, currentLimit int32, currentUsage int32, ...) *armcontainerservice.ErrorDetail
- func AKSMachineAPIProvisioningErrorZoneAllocationFailed(sku string, zone string) *armcontainerservice.ErrorDetail
- func MakeBackendAddressPoolID(resourceGroupName, loadBalancerName string, backendAddressPoolName string) string
- func MakeLoadBalancerID(resourceGroupName, loadBalancerName string) string
- func MakeNetworkInterfaceID(resourceGroupName, interfaceName string) string
- func MakeNetworkSecurityGroupID(resourceGroupName, networkSecurityGroupName string) string
- func MakeVMExtensionID(resourceGroupName, vmName, extensionName string) string
- func MkAgentPoolID(resourceGroupName string, clusterName string, agentPoolName string) string
- func MkMachineID(resourceGroupName string, clusterName string, agentPoolName string, ...) string
- func MkVMID(resourceGroupName string, vmName string) string
- func NewProductPrice(instanceType string, price float64) client.Item
- func NewSpotProductPrice(instanceType string, price float64) client.Item
- type AKSAgentPoolsAPI
- func (c *AKSAgentPoolsAPI) BeginDeleteMachines(ctx context.Context, resourceGroupName string, resourceName string, ...) (*runtime.Poller[armcontainerservice.AgentPoolsClientDeleteMachinesResponse], ...)
- func (c *AKSAgentPoolsAPI) Get(ctx context.Context, resourceGroupName string, resourceName string, ...) (armcontainerservice.AgentPoolsClientGetResponse, error)
- func (c *AKSAgentPoolsAPI) Reset()
- type AKSDataStorage
- type AKSMachineCreateOrUpdateInput
- type AKSMachineGetInput
- type AKSMachineListInput
- type AKSMachinesAPI
- func (c *AKSMachinesAPI) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, ...) (*runtime.Poller[armcontainerservice.MachinesClientCreateOrUpdateResponse], ...)
- func (c *AKSMachinesAPI) Get(ctx context.Context, resourceGroupName string, resourceName string, ...) (armcontainerservice.MachinesClientGetResponse, error)
- func (c *AKSMachinesAPI) NewListPager(resourceGroupName string, resourceName string, agentPoolName string, ...) *runtime.Pager[armcontainerservice.MachinesClientListResponse]
- func (c *AKSMachinesAPI) Reset()
- type AKSMachinesBehavior
- type AgentPoolCreateOrUpdateInput
- type AgentPoolDeleteMachinesInput
- type AgentPoolGetInput
- type AgentPoolsBehavior
- type AtomicError
- type AtomicErrorOption
- type AtomicPtr
- type AtomicPtrSlice
- type AtomicPtrStack
- type AuxiliaryTokenBehavior
- type AuxiliaryTokenDoInput
- type AuxiliaryTokenServer
- type AzureResourceGraphAPI
- type AzureResourceGraphBehavior
- type AzureResourceGraphResourcesInput
- type CommunityGalleryImageVersionsAPI
- type ListLocationsInput
- type LoadBalancersAPI
- func (api *LoadBalancersAPI) Get(_ context.Context, resourceGroupName string, loadBalancerName string, ...) (armnetwork.LoadBalancersClientGetResponse, error)
- func (api *LoadBalancersAPI) NewListPager(_ string, _ *armnetwork.LoadBalancersClientListOptions) *runtime.Pager[armnetwork.LoadBalancersClientListResponse]
- func (api *LoadBalancersAPI) Reset()
- type LoadBalancersBehavior
- type MockHandler
- type MockedFunction
- type MockedLRO
- type NetworkInterfaceCreateOrUpdateInput
- type NetworkInterfaceDeleteInput
- type NetworkInterfaceUpdateTagsInput
- type NetworkInterfacesAPI
- func (c *NetworkInterfacesAPI) BeginCreateOrUpdate(_ context.Context, resourceGroupName string, interfaceName string, ...) (*runtime.Poller[armnetwork.InterfacesClientCreateOrUpdateResponse], error)
- func (c *NetworkInterfacesAPI) BeginDelete(_ context.Context, resourceGroupName string, interfaceName string, ...) (*runtime.Poller[armnetwork.InterfacesClientDeleteResponse], error)
- func (c *NetworkInterfacesAPI) Get(_ context.Context, resourceGroupName string, interfaceName string, ...) (armnetwork.InterfacesClientGetResponse, error)
- func (c *NetworkInterfacesAPI) Reset()
- func (c *NetworkInterfacesAPI) UpdateTags(ctx context.Context, resourceGroupName string, interfaceName string, ...) (armnetwork.InterfacesClientUpdateTagsResponse, error)
- type NetworkInterfacesBehavior
- type NetworkSecurityGroupAPI
- func (api *NetworkSecurityGroupAPI) Get(ctx context.Context, resourceGroupName string, securityGroupName string, ...) (armnetwork.SecurityGroupsClientGetResponse, error)
- func (api *NetworkSecurityGroupAPI) NewListPager(resourceGroupName string, options *armnetwork.SecurityGroupsClientListOptions) *runtime.Pager[armnetwork.SecurityGroupsClientListResponse]
- func (api *NetworkSecurityGroupAPI) Reset()
- type NetworkSecurityGroupBevhavior
- type NodeBootstrappingAPI
- type NodeBootstrappingBehavior
- type NodeBootstrappingGetInput
- type NodeImageVersionsAPI
- type PricingAPI
- type PricingBehavior
- type ResourceSKUsAPI
- type SubnetsAPI
- type SubscriptionsAPI
- type SubscriptionsAPIBehavior
- type VirtualMachineCreateOrUpdateInput
- type VirtualMachineDeleteInput
- type VirtualMachineExtensionCreateOrUpdateInput
- type VirtualMachineExtensionUpdateInput
- type VirtualMachineExtensionsAPI
- func (c *VirtualMachineExtensionsAPI) BeginCreateOrUpdate(_ context.Context, resourceGroupName, vmName, extensionName string, ...) (...)
- func (c *VirtualMachineExtensionsAPI) BeginUpdate(_ context.Context, resourceGroupName string, vmName string, ...) (*runtime.Poller[armcompute.VirtualMachineExtensionsClientUpdateResponse], ...)
- func (c *VirtualMachineExtensionsAPI) Reset()
- type VirtualMachineExtensionsBehavior
- type VirtualMachineGetInput
- type VirtualMachineUpdateInput
- type VirtualMachinesAPI
- func (c *VirtualMachinesAPI) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmName string, ...) (*runtime.Poller[armcompute.VirtualMachinesClientCreateOrUpdateResponse], error)
- func (c *VirtualMachinesAPI) BeginDelete(_ context.Context, resourceGroupName string, vmName string, ...) (*runtime.Poller[armcompute.VirtualMachinesClientDeleteResponse], error)
- func (c *VirtualMachinesAPI) BeginUpdate(_ context.Context, resourceGroupName string, vmName string, ...) (*runtime.Poller[armcompute.VirtualMachinesClientUpdateResponse], error)
- func (c *VirtualMachinesAPI) Get(_ context.Context, resourceGroupName string, vmName string, ...) (armcompute.VirtualMachinesClientGetResponse, error)
- func (c *VirtualMachinesAPI) Reset()
- func (c *VirtualMachinesAPI) UseAuxiliaryTokenPolicy() error
- type VirtualMachinesBehavior
Constants ¶
const Region = "southcentralus"
const RegionNonZonal = "westcentralus"
Variables ¶
var AKSAgentPoolsAPIErrorFromAKSAgentPoolNotFound = &azcore.ResponseError{ ErrorCode: "NotFound", StatusCode: http.StatusNotFound, }
var AKSMachineAPIErrorAny = &azcore.ResponseError{
ErrorCode: "SomeRandomError",
}
var AKSMachineAPIErrorFromAKSMachineImmutablePropertyChangeAttempted = &azcore.ResponseError{ ErrorCode: "OperationNotAllowed", StatusCode: http.StatusBadRequest, }
var AKSMachineAPIErrorFromAKSMachineNotFound = &azcore.ResponseError{ ErrorCode: "NotFound", StatusCode: http.StatusNotFound, }
var AKSMachineAPIErrorFromAKSMachinesPoolNotFound = &azcore.ResponseError{ ErrorCode: "NotFound", StatusCode: http.StatusNotFound, }
var ResourceSkus = make(map[string][]compute.ResourceSku)
ResourceSkus is a map of location to resource skus
Functions ¶
func AKSAgentPoolsAPIErrorFromAKSMachineNotFound ¶ added in v1.6.8
func AKSAgentPoolsAPIErrorFromAKSMachineNotFound(agentPoolName string, validMachines []string) error
AKSAgentPoolsAPIErrorFromAKSMachineNotFound creates the specific error for when machines cannot be found during delete
func AKSMachineAPIProvisioningErrorAllocationFailed ¶ added in v1.6.8
func AKSMachineAPIProvisioningErrorAllocationFailed() *armcontainerservice.ErrorDetail
func AKSMachineAPIProvisioningErrorAny ¶ added in v1.6.8
func AKSMachineAPIProvisioningErrorAny() *armcontainerservice.ErrorDetail
func AKSMachineAPIProvisioningErrorLowPriorityCoresQuota ¶ added in v1.6.8
func AKSMachineAPIProvisioningErrorLowPriorityCoresQuota(location string) *armcontainerservice.ErrorDetail
func AKSMachineAPIProvisioningErrorOverconstrainedAllocation ¶ added in v1.6.8
func AKSMachineAPIProvisioningErrorOverconstrainedAllocation() *armcontainerservice.ErrorDetail
func AKSMachineAPIProvisioningErrorOverconstrainedZonalAllocation ¶ added in v1.6.8
func AKSMachineAPIProvisioningErrorOverconstrainedZonalAllocation() *armcontainerservice.ErrorDetail
func AKSMachineAPIProvisioningErrorSkuNotAvailable ¶ added in v1.6.8
func AKSMachineAPIProvisioningErrorSkuNotAvailable(sku string, location string) *armcontainerservice.ErrorDetail
func AKSMachineAPIProvisioningErrorTotalRegionalCoresQuota ¶ added in v1.6.8
func AKSMachineAPIProvisioningErrorTotalRegionalCoresQuota(location string) *armcontainerservice.ErrorDetail
func AKSMachineAPIProvisioningErrorVMFamilyQuotaExceeded ¶ added in v1.6.8
func AKSMachineAPIProvisioningErrorVMFamilyQuotaExceeded(location string, familyName string, currentLimit int32, currentUsage int32, additionalRequired int32, newLimitRequired int32) *armcontainerservice.ErrorDetail
func AKSMachineAPIProvisioningErrorZoneAllocationFailed ¶ added in v1.6.8
func AKSMachineAPIProvisioningErrorZoneAllocationFailed(sku string, zone string) *armcontainerservice.ErrorDetail
func MakeLoadBalancerID ¶
func MakeNetworkInterfaceID ¶ added in v1.6.2
func MakeNetworkSecurityGroupID ¶ added in v1.5.0
func MakeVMExtensionID ¶ added in v1.6.2
func MkAgentPoolID ¶ added in v1.6.8
func MkMachineID ¶ added in v1.6.8
Types ¶
type AKSAgentPoolsAPI ¶ added in v1.6.8
type AKSAgentPoolsAPI struct {
AgentPoolsBehavior
// contains filtered or unexported fields
}
func NewAKSAgentPoolsAPI ¶ added in v1.6.8
func NewAKSAgentPoolsAPI(aksDataStorage *AKSDataStorage) *AKSAgentPoolsAPI
func (*AKSAgentPoolsAPI) BeginDeleteMachines ¶ added in v1.6.8
func (c *AKSAgentPoolsAPI) BeginDeleteMachines( ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, aksMachines armcontainerservice.AgentPoolDeleteMachinesParameter, options *armcontainerservice.AgentPoolsClientBeginDeleteMachinesOptions, ) (*runtime.Poller[armcontainerservice.AgentPoolsClientDeleteMachinesResponse], error)
Already procedural, and is a fake nolint: gocyclo
func (*AKSAgentPoolsAPI) Get ¶ added in v1.6.8
func (c *AKSAgentPoolsAPI) Get(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *armcontainerservice.AgentPoolsClientGetOptions) (armcontainerservice.AgentPoolsClientGetResponse, error)
func (*AKSAgentPoolsAPI) Reset ¶ added in v1.6.8
func (c *AKSAgentPoolsAPI) Reset()
Reset must be called between tests otherwise tests will pollute each other.
type AKSDataStorage ¶ added in v1.6.8
AKSDataStorage contains the shared data stores for both AKS agent pools and machines
func NewAKSDataStorage ¶ added in v1.6.8
func NewAKSDataStorage() *AKSDataStorage
NewAKSDataStorage creates a new instance of shared data stores
type AKSMachineCreateOrUpdateInput ¶ added in v1.6.8
type AKSMachineCreateOrUpdateInput struct {
ResourceGroupName string
ResourceName string
AgentPoolName string
AKSMachineName string
AKSMachine armcontainerservice.Machine
Options *armcontainerservice.MachinesClientBeginCreateOrUpdateOptions
}
type AKSMachineGetInput ¶ added in v1.6.8
type AKSMachineGetInput struct {
ResourceGroupName string
ResourceName string
AgentPoolName string
AKSMachineName string
Options *armcontainerservice.MachinesClientGetOptions
}
type AKSMachineListInput ¶ added in v1.6.8
type AKSMachineListInput struct {
ResourceGroupName string
ResourceName string
AgentPoolName string
Options *armcontainerservice.MachinesClientListOptions
}
type AKSMachinesAPI ¶ added in v1.6.8
type AKSMachinesAPI struct {
AKSMachinesBehavior
// contains filtered or unexported fields
}
func NewAKSMachinesAPI ¶ added in v1.6.8
func NewAKSMachinesAPI(aksDataStorage *AKSDataStorage) *AKSMachinesAPI
NewAKSMachinesAPI creates a new AKSMachinesAPI instance with shared data stores
func (*AKSMachinesAPI) BeginCreateOrUpdate ¶ added in v1.6.8
func (c *AKSMachinesAPI) BeginCreateOrUpdate( ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, aksMachineName string, parameters armcontainerservice.Machine, options *armcontainerservice.MachinesClientBeginCreateOrUpdateOptions, ) (*runtime.Poller[armcontainerservice.MachinesClientCreateOrUpdateResponse], error)
func (*AKSMachinesAPI) Get ¶ added in v1.6.8
func (c *AKSMachinesAPI) Get( ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, aksMachineName string, options *armcontainerservice.MachinesClientGetOptions, ) (armcontainerservice.MachinesClientGetResponse, error)
func (*AKSMachinesAPI) NewListPager ¶ added in v1.6.8
func (c *AKSMachinesAPI) NewListPager( resourceGroupName string, resourceName string, agentPoolName string, options *armcontainerservice.MachinesClientListOptions, ) *runtime.Pager[armcontainerservice.MachinesClientListResponse]
func (*AKSMachinesAPI) Reset ¶ added in v1.6.8
func (c *AKSMachinesAPI) Reset()
Reset must be called between tests otherwise tests will pollute each other.
type AKSMachinesBehavior ¶ added in v1.6.8
type AKSMachinesBehavior struct {
AKSMachineCreateOrUpdateBehavior MockedLRO[AKSMachineCreateOrUpdateInput, armcontainerservice.MachinesClientCreateOrUpdateResponse]
AKSMachineGetBehavior MockedFunction[AKSMachineGetInput, armcontainerservice.MachinesClientGetResponse]
AKSMachineNewListPagerBehavior MockedFunction[AKSMachineListInput, *runtime.Pager[armcontainerservice.MachinesClientListResponse]]
AfterPollProvisioningErrorOverride *armcontainerservice.ErrorDetail
}
type AgentPoolCreateOrUpdateInput ¶ added in v1.6.8
type AgentPoolCreateOrUpdateInput struct {
ResourceGroupName string
ResourceName string
AgentPoolName string
Parameters armcontainerservice.AgentPool
Options *armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions
}
type AgentPoolDeleteMachinesInput ¶ added in v1.6.8
type AgentPoolDeleteMachinesInput struct {
ResourceGroupName string
ResourceName string
AgentPoolName string
AKSMachines armcontainerservice.AgentPoolDeleteMachinesParameter
Options *armcontainerservice.AgentPoolsClientBeginDeleteMachinesOptions
}
type AgentPoolGetInput ¶ added in v1.6.8
type AgentPoolGetInput struct {
ResourceGroupName string
ResourceName string
AgentPoolName string
Options *armcontainerservice.AgentPoolsClientGetOptions
}
type AgentPoolsBehavior ¶ added in v1.6.8
type AgentPoolsBehavior struct {
AgentPoolDeleteMachinesBehavior MockedLRO[AgentPoolDeleteMachinesInput, armcontainerservice.AgentPoolsClientDeleteMachinesResponse]
AgentPoolGetBehavior MockedFunction[AgentPoolGetInput, armcontainerservice.AgentPoolsClientGetResponse]
}
type AtomicError ¶
type AtomicError struct {
// contains filtered or unexported fields
}
func (*AtomicError) Get ¶
func (e *AtomicError) Get() error
Get is equivalent to the error being called, so we increase number of calls in this function
func (*AtomicError) IsNil ¶
func (e *AtomicError) IsNil() bool
func (*AtomicError) Reset ¶
func (e *AtomicError) Reset()
func (*AtomicError) Set ¶
func (e *AtomicError) Set(err error, opts ...AtomicErrorOption)
type AtomicErrorOption ¶
type AtomicErrorOption func(atomicError *AtomicError)
func MaxCalls ¶
func MaxCalls(maxCalls int) AtomicErrorOption
type AtomicPtr ¶
type AtomicPtr[T any] struct { // contains filtered or unexported fields }
AtomicPtr is intended for use in mocks to easily expose variables for use in testing. It makes setting and retrieving the values race free by wrapping the pointer itself in a mutex. There is no Get() method, but instead a Clone() method deep copies the object being stored by serializing/de-serializing it from JSON. This pattern shouldn't be followed anywhere else but is an easy way to eliminate races in our tests.
type AtomicPtrSlice ¶
type AtomicPtrSlice[T any] struct { // contains filtered or unexported fields }
AtomicPtrSlice exposes a slice of a pointer type in a race-free manner.
func (*AtomicPtrSlice[T]) Append ¶
func (a *AtomicPtrSlice[T]) Append(input ...*T)
func (*AtomicPtrSlice[T]) Get ¶
func (a *AtomicPtrSlice[T]) Get(index int) *T
func (*AtomicPtrSlice[T]) Len ¶
func (a *AtomicPtrSlice[T]) Len() int
func (*AtomicPtrSlice[T]) Reset ¶
func (a *AtomicPtrSlice[T]) Reset()
type AtomicPtrStack ¶
type AtomicPtrStack[T any] struct { // contains filtered or unexported fields }
AtomicPtrStack exposes a slice of a pointer type in a race-free manner. The interface is just enough to replace the set.Set usage in our previous tests.
func (*AtomicPtrStack[T]) Add ¶
func (a *AtomicPtrStack[T]) Add(input *T)
func (*AtomicPtrStack[T]) All ¶ added in v1.6.6
func (a *AtomicPtrStack[T]) All() iter.Seq[*T]
All returns an iterator over all values in the stack NOTE: This pops the values from the stack
func (*AtomicPtrStack[T]) Len ¶
func (a *AtomicPtrStack[T]) Len() int
func (*AtomicPtrStack[T]) Pop ¶
func (a *AtomicPtrStack[T]) Pop() *T
func (*AtomicPtrStack[T]) Reset ¶
func (a *AtomicPtrStack[T]) Reset()
type AuxiliaryTokenBehavior ¶ added in v1.5.0
type AuxiliaryTokenBehavior struct {
AuxiliaryTokenDoBehavior MockedFunction[AuxiliaryTokenDoInput, *http.Response]
}
type AuxiliaryTokenDoInput ¶ added in v1.5.0
type AuxiliaryTokenDoInput struct {
// contains filtered or unexported fields
}
type AuxiliaryTokenServer ¶ added in v1.5.0
type AuxiliaryTokenServer struct {
AuxiliaryTokenBehavior
Token azcore.AccessToken
}
func NewAuxiliaryTokenServer ¶ added in v1.5.0
func NewAuxiliaryTokenServer(token string, expiresOn time.Time, refreshOn time.Time) *AuxiliaryTokenServer
NewAuxiliaryTokenServer creates a new AuxiliaryTokenServer with the given token.
func (*AuxiliaryTokenServer) Reset ¶ added in v1.5.0
func (c *AuxiliaryTokenServer) Reset()
Reset must be called between tests otherwise tests will pollute each other.
type AzureResourceGraphAPI ¶
type AzureResourceGraphAPI struct {
AzureResourceGraphBehavior
// contains filtered or unexported fields
}
func NewAzureResourceGraphAPI ¶ added in v0.6.2
func NewAzureResourceGraphAPI(resourceGroup string, virtualMachinesAPI *VirtualMachinesAPI, networkInterfacesAPI *NetworkInterfacesAPI) *AzureResourceGraphAPI
func (*AzureResourceGraphAPI) Reset ¶
func (c *AzureResourceGraphAPI) Reset()
Reset must be called between tests otherwise tests will pollute each other.
func (*AzureResourceGraphAPI) Resources ¶
func (c *AzureResourceGraphAPI) Resources(_ context.Context, query armresourcegraph.QueryRequest, options *armresourcegraph.ClientResourcesOptions) (armresourcegraph.ClientResourcesResponse, error)
type AzureResourceGraphBehavior ¶
type AzureResourceGraphBehavior struct {
AzureResourceGraphResourcesBehavior MockedFunction[AzureResourceGraphResourcesInput, armresourcegraph.ClientResourcesResponse]
VirtualMachinesAPI *VirtualMachinesAPI
NetworkInterfacesAPI *NetworkInterfacesAPI
ResourceGroup string
}
type AzureResourceGraphResourcesInput ¶
type AzureResourceGraphResourcesInput struct {
Query armresourcegraph.QueryRequest
Options *armresourcegraph.ClientResourcesOptions
}
type CommunityGalleryImageVersionsAPI ¶
type CommunityGalleryImageVersionsAPI struct {
ImageVersions AtomicPtrSlice[armcompute.CommunityGalleryImageVersion]
}
TODO: no ability to simulate errors on the Pager.
func (*CommunityGalleryImageVersionsAPI) NewListPager ¶
func (c *CommunityGalleryImageVersionsAPI) NewListPager(_ string, _ string, _ string, _ *armcompute.CommunityGalleryImageVersionsClientListOptions) *runtime.Pager[armcompute.CommunityGalleryImageVersionsClientListResponse]
NewListPager returns a new pager to return the next page of CommunityGalleryImageVersionsClientListResponse
func (*CommunityGalleryImageVersionsAPI) Reset ¶
func (c *CommunityGalleryImageVersionsAPI) Reset()
type ListLocationsInput ¶ added in v1.6.2
type ListLocationsInput struct {
SubscriptionID string
Options *armsubscriptions.ClientListLocationsOptions
}
type LoadBalancersAPI ¶
type LoadBalancersAPI struct {
LoadBalancersBehavior
}
func (*LoadBalancersAPI) Get ¶
func (api *LoadBalancersAPI) Get(_ context.Context, resourceGroupName string, loadBalancerName string, _ *armnetwork.LoadBalancersClientGetOptions) (armnetwork.LoadBalancersClientGetResponse, error)
func (*LoadBalancersAPI) NewListPager ¶
func (api *LoadBalancersAPI) NewListPager(_ string, _ *armnetwork.LoadBalancersClientListOptions) *runtime.Pager[armnetwork.LoadBalancersClientListResponse]
func (*LoadBalancersAPI) Reset ¶
func (api *LoadBalancersAPI) Reset()
Reset must be called between tests otherwise tests will pollute each other.
type LoadBalancersBehavior ¶
type MockHandler ¶
type MockHandler[T any] struct { // contains filtered or unexported fields }
MockHandler returns a pre-defined result or error.
func (MockHandler[T]) Done ¶
func (h MockHandler[T]) Done() bool
Done returns true if the LRO has reached a terminal state. TrivialHandler is always done.
type MockedFunction ¶
type MockedFunction[I any, O any] struct { Output AtomicPtr[O] // Output to return on call to this function CalledWithInput AtomicPtrStack[I] // Stack used to keep track of passed input to this function Error AtomicError // Error to return a certain number of times defined by custom error options // contains filtered or unexported fields }
func (*MockedFunction[I, O]) Calls ¶
func (m *MockedFunction[I, O]) Calls() int
func (*MockedFunction[I, O]) FailedCalls ¶
func (m *MockedFunction[I, O]) FailedCalls() int
func (*MockedFunction[I, O]) Invoke ¶
func (m *MockedFunction[I, O]) Invoke(input *I, defaultTransformer func(*I) (O, error)) (O, error)
func (*MockedFunction[I, O]) Reset ¶
func (m *MockedFunction[I, O]) Reset()
Reset must be called between tests otherwise tests will pollute each other.
func (*MockedFunction[I, O]) SuccessfulCalls ¶
func (m *MockedFunction[I, O]) SuccessfulCalls() int
type MockedLRO ¶
type MockedLRO[I any, O any] struct { MockedFunction[I, O] BeginError AtomicError // Error to return a certain number of times defined by custom error options (for Begin) }
func (*MockedLRO[I, O]) FailedCalls ¶
func (*MockedLRO[I, O]) Reset ¶
func (m *MockedLRO[I, O]) Reset()
Reset must be called between tests otherwise tests will pollute each other.
func (*MockedLRO[I, O]) SuccessfulCalls ¶
type NetworkInterfaceCreateOrUpdateInput ¶
type NetworkInterfaceCreateOrUpdateInput struct {
ResourceGroupName string
InterfaceName string
Interface armnetwork.Interface
Options *armnetwork.InterfacesClientBeginCreateOrUpdateOptions
}
type NetworkInterfaceDeleteInput ¶
type NetworkInterfaceDeleteInput struct {
ResourceGroupName, InterfaceName string
}
type NetworkInterfaceUpdateTagsInput ¶ added in v1.6.2
type NetworkInterfaceUpdateTagsInput struct {
ResourceGroupName string
InterfaceName string
Tags armnetwork.TagsObject
Options *armnetwork.InterfacesClientUpdateTagsOptions
}
type NetworkInterfacesAPI ¶
type NetworkInterfacesAPI struct {
// instance.NetworkInterfacesAPI
NetworkInterfacesBehavior
}
func (*NetworkInterfacesAPI) BeginCreateOrUpdate ¶
func (c *NetworkInterfacesAPI) BeginCreateOrUpdate(_ context.Context, resourceGroupName string, interfaceName string, iface armnetwork.Interface, options *armnetwork.InterfacesClientBeginCreateOrUpdateOptions) (*runtime.Poller[armnetwork.InterfacesClientCreateOrUpdateResponse], error)
func (*NetworkInterfacesAPI) BeginDelete ¶
func (c *NetworkInterfacesAPI) BeginDelete(_ context.Context, resourceGroupName string, interfaceName string, _ *armnetwork.InterfacesClientBeginDeleteOptions) (*runtime.Poller[armnetwork.InterfacesClientDeleteResponse], error)
func (*NetworkInterfacesAPI) Get ¶
func (c *NetworkInterfacesAPI) Get(_ context.Context, resourceGroupName string, interfaceName string, _ *armnetwork.InterfacesClientGetOptions) (armnetwork.InterfacesClientGetResponse, error)
func (*NetworkInterfacesAPI) Reset ¶
func (c *NetworkInterfacesAPI) Reset()
Reset must be called between tests otherwise tests will pollute each other.
func (*NetworkInterfacesAPI) UpdateTags ¶ added in v1.6.2
func (c *NetworkInterfacesAPI) UpdateTags( ctx context.Context, resourceGroupName string, interfaceName string, tags armnetwork.TagsObject, options *armnetwork.InterfacesClientUpdateTagsOptions, ) (armnetwork.InterfacesClientUpdateTagsResponse, error)
type NetworkInterfacesBehavior ¶
type NetworkInterfacesBehavior struct {
NetworkInterfacesCreateOrUpdateBehavior MockedLRO[NetworkInterfaceCreateOrUpdateInput, armnetwork.InterfacesClientCreateOrUpdateResponse]
NetworkInterfacesDeleteBehavior MockedLRO[NetworkInterfaceDeleteInput, armnetwork.InterfacesClientDeleteResponse]
NetworkInterfacesUpdateTagsBehavior MockedFunction[NetworkInterfaceUpdateTagsInput, armnetwork.InterfacesClientUpdateTagsResponse]
NetworkInterfaces sync.Map
}
type NetworkSecurityGroupAPI ¶ added in v1.5.0
type NetworkSecurityGroupAPI struct {
NetworkSecurityGroupBevhavior
}
func (*NetworkSecurityGroupAPI) Get ¶ added in v1.5.0
func (api *NetworkSecurityGroupAPI) Get( ctx context.Context, resourceGroupName string, securityGroupName string, options *armnetwork.SecurityGroupsClientGetOptions, ) (armnetwork.SecurityGroupsClientGetResponse, error)
Get implements networksecuritygroup.API.
func (*NetworkSecurityGroupAPI) NewListPager ¶ added in v1.5.0
func (api *NetworkSecurityGroupAPI) NewListPager(resourceGroupName string, options *armnetwork.SecurityGroupsClientListOptions) *runtime.Pager[armnetwork.SecurityGroupsClientListResponse]
NewListPager implements networksecuritygroup.API.
func (*NetworkSecurityGroupAPI) Reset ¶ added in v1.5.0
func (api *NetworkSecurityGroupAPI) Reset()
Reset must be called between tests otherwise tests will pollute each other.
type NetworkSecurityGroupBevhavior ¶ added in v1.5.0
type NodeBootstrappingAPI ¶ added in v1.5.0
type NodeBootstrappingAPI struct {
NodeBootstrappingBehavior
SimulateDown bool
}
NodeBootstrappingAPI implements a fake version of the imagefamily.types.NodeBootstrappingAPI for testing purposes.
func (*NodeBootstrappingAPI) Get ¶ added in v1.5.0
func (n *NodeBootstrappingAPI) Get(ctx context.Context, params *models.ProvisionValues) (types.NodeBootstrapping, error)
Get implements the NodeBootstrappingAPI interface for testing
func (*NodeBootstrappingAPI) Reset ¶ added in v1.6.6
func (n *NodeBootstrappingAPI) Reset()
Reset must be called between tests otherwise tests will pollute each other.
type NodeBootstrappingBehavior ¶ added in v1.6.6
type NodeBootstrappingBehavior struct {
NodeBootstrappingGetBehavior MockedFunction[NodeBootstrappingGetInput, types.NodeBootstrapping]
}
type NodeBootstrappingGetInput ¶ added in v1.6.6
type NodeBootstrappingGetInput struct {
Params *models.ProvisionValues
}
type NodeImageVersionsAPI ¶ added in v0.7.1
type NodeImageVersionsAPI struct {
// OverrideNodeImageVersions allows tests to override the default static data
// When nil, the default NodeImageVersions slice is used
OverrideNodeImageVersions []types.NodeImageVersion
// Error allows tests to simulate API errors.
// If Error is set to non-nil, it will take precedence over other fake data
Error error
}
func (*NodeImageVersionsAPI) List ¶ added in v0.7.1
func (n *NodeImageVersionsAPI) List(_ context.Context, _, _ string) (types.NodeImageVersionsResponse, error)
func (*NodeImageVersionsAPI) Reset ¶ added in v1.6.5
func (n *NodeImageVersionsAPI) Reset()
type PricingAPI ¶
type PricingAPI struct {
client.PricingAPI
PricingBehavior
}
func (*PricingAPI) GetProductsPricePages ¶
func (p *PricingAPI) GetProductsPricePages(_ context.Context, _ []*client.Filter, fn func(output *client.ProductsPricePage)) error
func (*PricingAPI) Reset ¶
func (p *PricingAPI) Reset()
type PricingBehavior ¶
type PricingBehavior struct {
NextError AtomicError
ProductsPricePage AtomicPtr[client.ProductsPricePage]
}
type ResourceSKUsAPI ¶
func (*ResourceSKUsAPI) ListComplete ¶
func (s *ResourceSKUsAPI) ListComplete(_ context.Context, _, _ string) (compute.ResourceSkusResultIterator, error)
func (*ResourceSKUsAPI) Reset ¶
func (s *ResourceSKUsAPI) Reset()
Reset must be called between tests otherwise tests will pollute each other.
type SubnetsAPI ¶ added in v1.6.2
type SubnetsAPI struct {
GetFunc func(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, options *armnetwork.SubnetsClientGetOptions) (armnetwork.SubnetsClientGetResponse, error)
}
func (*SubnetsAPI) Get ¶ added in v1.6.2
func (s *SubnetsAPI) Get(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, options *armnetwork.SubnetsClientGetOptions) (armnetwork.SubnetsClientGetResponse, error)
func (*SubnetsAPI) Reset ¶ added in v1.6.2
func (s *SubnetsAPI) Reset()
type SubscriptionsAPI ¶ added in v1.6.2
type SubscriptionsAPI struct {
SubscriptionsAPIBehavior
}
func NewSubscriptionsAPI ¶ added in v1.6.2
func NewSubscriptionsAPI() (*SubscriptionsAPI, error)
func (*SubscriptionsAPI) NewListLocationsPager ¶ added in v1.6.2
func (api *SubscriptionsAPI) NewListLocationsPager( subscriptionID string, options *armsubscriptions.ClientListLocationsOptions, ) *runtime.Pager[armsubscriptions.ClientListLocationsResponse]
func (*SubscriptionsAPI) Reset ¶ added in v1.6.2
func (api *SubscriptionsAPI) Reset()
type SubscriptionsAPIBehavior ¶ added in v1.6.2
type SubscriptionsAPIBehavior struct {
NewListLocationsPagerBehavior MockedFunction[ListLocationsInput, armsubscriptions.ClientListLocationsResponse]
Locations sync.Map
UseFakeData bool
}
type VirtualMachineCreateOrUpdateInput ¶
type VirtualMachineCreateOrUpdateInput struct {
ResourceGroupName string
VMName string
VM armcompute.VirtualMachine
Options *armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions
}
type VirtualMachineDeleteInput ¶
type VirtualMachineDeleteInput struct {
ResourceGroupName string
VMName string
Options *armcompute.VirtualMachinesClientBeginDeleteOptions
}
type VirtualMachineExtensionCreateOrUpdateInput ¶
type VirtualMachineExtensionCreateOrUpdateInput struct {
ResourceGroupName string
VirtualMachineName string
VirtualMachineExtensionName string
VirtualMachineExtension armcompute.VirtualMachineExtension
Options *armcompute.VirtualMachineExtensionsClientBeginCreateOrUpdateOptions
}
type VirtualMachineExtensionUpdateInput ¶ added in v1.6.2
type VirtualMachineExtensionUpdateInput struct {
ResourceGroupName string
VirtualMachineName string
VirtualMachineExtensionName string
VirtualMachineExtensionUpdate armcompute.VirtualMachineExtensionUpdate
Options *armcompute.VirtualMachineExtensionsClientBeginUpdateOptions
}
type VirtualMachineExtensionsAPI ¶
type VirtualMachineExtensionsAPI struct {
// instance.VirtualMachineExtensionsAPI
VirtualMachineExtensionsBehavior
}
func (*VirtualMachineExtensionsAPI) BeginCreateOrUpdate ¶
func (c *VirtualMachineExtensionsAPI) BeginCreateOrUpdate( _ context.Context, resourceGroupName, vmName, extensionName string, extension armcompute.VirtualMachineExtension, options *armcompute.VirtualMachineExtensionsClientBeginCreateOrUpdateOptions, ) (*runtime.Poller[armcompute.VirtualMachineExtensionsClientCreateOrUpdateResponse], error)
func (*VirtualMachineExtensionsAPI) BeginUpdate ¶ added in v1.6.2
func (c *VirtualMachineExtensionsAPI) BeginUpdate( _ context.Context, resourceGroupName string, vmName string, extensionName string, updates armcompute.VirtualMachineExtensionUpdate, options *armcompute.VirtualMachineExtensionsClientBeginUpdateOptions, ) (*runtime.Poller[armcompute.VirtualMachineExtensionsClientUpdateResponse], error)
func (*VirtualMachineExtensionsAPI) Reset ¶
func (c *VirtualMachineExtensionsAPI) Reset()
Reset must be called between tests otherwise tests will pollute each other.
type VirtualMachineExtensionsBehavior ¶
type VirtualMachineExtensionsBehavior struct {
VirtualMachineExtensionsCreateOrUpdateBehavior MockedLRO[VirtualMachineExtensionCreateOrUpdateInput, armcompute.VirtualMachineExtensionsClientCreateOrUpdateResponse]
VirtualMachineExtensionsUpdateBehavior MockedLRO[VirtualMachineExtensionUpdateInput, armcompute.VirtualMachineExtensionsClientUpdateResponse]
Extensions sync.Map
}
type VirtualMachineGetInput ¶
type VirtualMachineGetInput struct {
ResourceGroupName string
VMName string
Options *armcompute.VirtualMachinesClientGetOptions
}
type VirtualMachineUpdateInput ¶
type VirtualMachineUpdateInput struct {
ResourceGroupName string
VMName string
Updates armcompute.VirtualMachineUpdate
Options *armcompute.VirtualMachinesClientBeginUpdateOptions
}
type VirtualMachinesAPI ¶
type VirtualMachinesAPI struct {
// TODO: document the implications of embedding vs. not embedding the interface here
// instance.VirtualMachinesAPI // - this is the interface we are mocking.
VirtualMachinesBehavior
AuxiliaryTokenPolicy *auth.AuxiliaryTokenPolicy
}
func (*VirtualMachinesAPI) BeginCreateOrUpdate ¶
func (c *VirtualMachinesAPI) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmName string, parameters armcompute.VirtualMachine, options *armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions) (*runtime.Poller[armcompute.VirtualMachinesClientCreateOrUpdateResponse], error)
func (*VirtualMachinesAPI) BeginDelete ¶
func (c *VirtualMachinesAPI) BeginDelete(_ context.Context, resourceGroupName string, vmName string, options *armcompute.VirtualMachinesClientBeginDeleteOptions) (*runtime.Poller[armcompute.VirtualMachinesClientDeleteResponse], error)
func (*VirtualMachinesAPI) BeginUpdate ¶
func (c *VirtualMachinesAPI) BeginUpdate(_ context.Context, resourceGroupName string, vmName string, updates armcompute.VirtualMachineUpdate, options *armcompute.VirtualMachinesClientBeginUpdateOptions) (*runtime.Poller[armcompute.VirtualMachinesClientUpdateResponse], error)
func (*VirtualMachinesAPI) Get ¶
func (c *VirtualMachinesAPI) Get(_ context.Context, resourceGroupName string, vmName string, options *armcompute.VirtualMachinesClientGetOptions) (armcompute.VirtualMachinesClientGetResponse, error)
func (*VirtualMachinesAPI) Reset ¶
func (c *VirtualMachinesAPI) Reset()
Reset must be called between tests otherwise tests will pollute each other.
func (*VirtualMachinesAPI) UseAuxiliaryTokenPolicy ¶ added in v1.5.0
func (c *VirtualMachinesAPI) UseAuxiliaryTokenPolicy() error
UseAuxiliaryTokenPolicy simulates AuxiliaryTokenPolicy.Do() method being called at the beginning of each API call This is useful for testing scenarios where the auxiliary token is required for the API call to succeed. If the AuxiliaryTokenPolicy is not set (USE_SIG: false), this method does nothing and returns nil.
type VirtualMachinesBehavior ¶
type VirtualMachinesBehavior struct {
VirtualMachineCreateOrUpdateBehavior MockedLRO[VirtualMachineCreateOrUpdateInput, armcompute.VirtualMachinesClientCreateOrUpdateResponse]
VirtualMachineUpdateBehavior MockedLRO[VirtualMachineUpdateInput, armcompute.VirtualMachinesClientUpdateResponse]
VirtualMachineDeleteBehavior MockedLRO[VirtualMachineDeleteInput, armcompute.VirtualMachinesClientDeleteResponse]
VirtualMachineGetBehavior MockedFunction[VirtualMachineGetInput, armcompute.VirtualMachinesClientGetResponse]
Instances sync.Map
}
Source Files
¶
- aksagentpoolsapi.go
- aksmachinesapi.go
- atomic.go
- auxiliarytokenserver.go
- azureresourcegraphapi.go
- communityimageversionsapi.go
- loadbalancerapi.go
- networkinterfaceapi.go
- networksecuritygroupapi.go
- nodebootstrappingapi.go
- nodeimageversionsapi.go
- pricingapi.go
- resourceskuapi.go
- subnetsapi.go
- subscriptionsapi.go
- types.go
- virtualmachineextensionsapi.go
- virtualmachinesapi.go
- zz_generated.sku.southcentralus.go
- zz_generated.sku.westcentralus.go