Documentation ¶
Overview ¶
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
Index ¶
- Constants
- Variables
- func DeepCopy(dst, src interface{}) (err error)
- func DeployTemplateSync(az armhelpers.AKSEngineClient, logger *logrus.Entry, ...) error
- type AzureClient
- func NewAzureClientWithClientCertificate(env azure.Environment, subscriptionID, clientID string, ...) (*AzureClient, error)
- func NewAzureClientWithClientCertificateExternalTenant(env azure.Environment, subscriptionID, tenantID, clientID string, ...) (*AzureClient, error)
- func NewAzureClientWithClientCertificateFile(env azure.Environment, ...) (*AzureClient, error)
- func NewAzureClientWithClientCertificateFileExternalTenant(env azure.Environment, ...) (*AzureClient, error)
- func NewAzureClientWithClientSecret(env azure.Environment, subscriptionID, clientID, clientSecret string) (*AzureClient, error)
- func NewAzureClientWithClientSecretExternalTenant(env azure.Environment, subscriptionID, tenantID, clientID, clientSecret string) (*AzureClient, error)
- func (az *AzureClient) AddAcceptLanguages(languages []string)
- func (az *AzureClient) AddAuxiliaryTokens(tokens []string)
- func (az *AzureClient) AddContainerInsightsSolution(ctx context.Context, ...) (result bool, err error)
- func (az *AzureClient) CheckDeploymentExistence(ctx context.Context, resourceGroupName string, deploymentName string) (result autorest.Response, err error)
- func (az *AzureClient) CheckResourceGroupExistence(ctx context.Context, name string) (result autorest.Response, err error)
- func (az *AzureClient) CreateApp(ctx context.Context, appName, appURL string, replyURLs *[]string, ...) (applicationResp graphrbac.Application, ...)
- func (az *AzureClient) CreateGraphApplication(ctx context.Context, ...) (graphrbac.Application, error)
- func (az *AzureClient) CreateGraphPrincipal(ctx context.Context, ...) (graphrbac.ServicePrincipal, error)
- func (az *AzureClient) CreateRoleAssignment(ctx context.Context, scope string, roleAssignmentName string, ...) (authorization.RoleAssignment, error)
- func (az *AzureClient) CreateRoleAssignmentSimple(ctx context.Context, resourceGroup, servicePrincipalObjectID string) error
- func (az *AzureClient) CreateUserAssignedID(location string, resourceGroup string, userAssignedID string) (id *msi.Identity, err error)
- func (az *AzureClient) DeleteApp(ctx context.Context, applicationName, applicationObjectID string) (autorest.Response, error)
- func (az *AzureClient) DeleteGraphApplication(ctx context.Context, applicationObjectID string) (result autorest.Response, err error)
- func (az *AzureClient) DeleteManagedDisk(ctx context.Context, resourceGroupName string, diskName string) error
- func (az *AzureClient) DeleteNetworkInterface(ctx context.Context, resourceGroup, nicName string) error
- func (az *AzureClient) DeleteResourceGroup(ctx context.Context, name string) error
- func (az *AzureClient) DeleteRoleAssignmentByID(ctx context.Context, roleAssignmentID string) (authorization.RoleAssignment, error)
- func (az *AzureClient) DeleteVirtualMachine(ctx context.Context, resourceGroup, name string) error
- func (az *AzureClient) DeleteVirtualMachineScaleSet(ctx context.Context, resourceGroup, vmssName string) error
- func (az *AzureClient) DeleteVirtualMachineScaleSetVM(ctx context.Context, resourceGroup, virtualMachineScaleSet, instanceID string) error
- func (az *AzureClient) DeployTemplate(ctx context.Context, resourceGroupName, deploymentName string, ...) (de resources.DeploymentExtended, err error)
- func (az *AzureClient) EnsureDefaultLogAnalyticsWorkspace(ctx context.Context, resourceGroup, location string) (workspaceResourceID string, err error)
- func (az *AzureClient) EnsureProvidersRegistered(subscriptionID string) error
- func (az *AzureClient) EnsureResourceGroup(ctx context.Context, name, location string, managedBy *string) (resourceGroup *resources.Group, err error)
- func (az *AzureClient) GetAvailabilitySet(ctx context.Context, resourceGroup, availabilitySetName string) (azcompute.AvailabilitySet, error)
- func (az *AzureClient) GetAvailabilitySetFaultDomainCount(ctx context.Context, resourceGroup string, vmasIDs []string) (int, error)
- func (az *AzureClient) GetDeployment(ctx context.Context, resourceGroupName, deploymentName string) (result resources.DeploymentExtended, err error)
- func (az *AzureClient) GetKubernetesClient(apiserverURL, kubeConfig string, interval, timeout time.Duration) (kubernetes.Client, error)
- func (az *AzureClient) GetLogAnalyticsWorkspaceInfo(ctx context.Context, ...) (workspaceID string, workspaceKey string, workspaceLocation string, err error)
- func (az *AzureClient) GetStorageClient(ctx context.Context, resourceGroup, accountName string) (armhelpers.AKSStorageClient, error)
- func (az *AzureClient) GetVirtualMachine(ctx context.Context, resourceGroup, name string) (azcompute.VirtualMachine, error)
- func (az *AzureClient) GetVirtualMachineImage(ctx context.Context, location, publisherName, offer, skus, version string) (compute.VirtualMachineImage, error)
- func (az *AzureClient) ListDeploymentOperations(ctx context.Context, resourceGroupName string, deploymentName string, ...) (armhelpers.DeploymentOperationsListResultPage, error)
- func (az *AzureClient) ListLocations(ctx context.Context) (*[]subscriptions.Location, error)
- func (az *AzureClient) ListManagedDisksByResourceGroup(ctx context.Context, resourceGroupName string) (result armhelpers.DiskListPage, err error)
- func (az *AzureClient) ListProviders(ctx context.Context) (armhelpers.ProviderListResultPage, error)
- func (az *AzureClient) ListResourceSkus(ctx context.Context, filter string) (armhelpers.ResourceSkusResultPage, error)
- func (az *AzureClient) ListRoleAssignmentsForPrincipal(ctx context.Context, scope string, principalID string) (armhelpers.RoleAssignmentListResultPage, error)
- func (az *AzureClient) ListVirtualMachineImages(ctx context.Context, location, publisherName, offer, skus string) (compute.ListVirtualMachineImageResource, error)
- func (az *AzureClient) ListVirtualMachineScaleSetVMs(ctx context.Context, resourceGroup, virtualMachineScaleSet string) (armhelpers.VirtualMachineScaleSetVMListResultPage, error)
- func (az *AzureClient) ListVirtualMachineScaleSets(ctx context.Context, resourceGroup string) (armhelpers.VirtualMachineScaleSetListResultPage, error)
- func (az *AzureClient) ListVirtualMachines(ctx context.Context, resourceGroup string) (armhelpers.VirtualMachineListResultPage, error)
- func (az *AzureClient) RestartVirtualMachine(ctx context.Context, resourceGroup, name string) error
- func (az *AzureClient) RestartVirtualMachineScaleSets(ctx context.Context, resourceGroup string, virtualMachineScaleSet string, ...) error
- func (az *AzureClient) SetVirtualMachineScaleSetCapacity(ctx context.Context, resourceGroup, virtualMachineScaleSet string, ...) error
- func (az *AzureClient) ValidateTemplate(ctx context.Context, resourceGroupName string, deploymentName string, ...) (result resources.DeploymentValidateResult, err error)
- type AzureStorageClient
- func (as *AzureStorageClient) CreateContainer(containerName string, options *azStorage.CreateContainerOptions) (bool, error)
- func (as *AzureStorageClient) DeleteBlob(vhdContainer, vhdBlob string, options *azStorage.DeleteBlobOptions) error
- func (as *AzureStorageClient) SaveBlockBlob(containerName, blobName string, b []byte, options *azStorage.PutBlobOptions) error
- type DeploymentError
- type DeploymentValidationError
- type DiskListPageClient
- type HTTPMockClient
- func (mc *HTTPMockClient) Activate() error
- func (mc *HTTPMockClient) DeactivateAndReset()
- func (mc HTTPMockClient) GetEnvironment() azure.Environment
- func (mc *HTTPMockClient) RegisterDeleteManagedDisk()
- func (mc *HTTPMockClient) RegisterDeleteNetworkInterface()
- func (mc HTTPMockClient) RegisterDeleteOperation()
- func (mc HTTPMockClient) RegisterDeployOperationFailure()
- func (mc HTTPMockClient) RegisterDeployOperationSuccess()
- func (mc *HTTPMockClient) RegisterDeployTemplate()
- func (mc HTTPMockClient) RegisterEnsureDefaultLogAnalyticsWorkspaceCreateNew()
- func (mc HTTPMockClient) RegisterEnsureDefaultLogAnalyticsWorkspaceUseExisting()
- func (mc HTTPMockClient) RegisterGetAvailabilitySet()
- func (mc HTTPMockClient) RegisterGetAvailabilitySetFaultDomainCount()
- func (mc HTTPMockClient) RegisterGetLogAnalyticsWorkspaceInfo()
- func (mc HTTPMockClient) RegisterListLocations()
- func (mc HTTPMockClient) RegisterListResourceSkus()
- func (mc HTTPMockClient) RegisterListVirtualMachineScaleSetVMs()
- func (mc HTTPMockClient) RegisterListVirtualMachineScaleSets()
- func (mc HTTPMockClient) RegisterListVirtualMachines()
- func (mc HTTPMockClient) RegisterLogin()
- func (mc *HTTPMockClient) RegisterVMImageFetcherInterface()
- func (mc *HTTPMockClient) RegisterVirtualMachineEndpoint()
- type VirtualMachineListResultPageClient
- func (page *VirtualMachineListResultPageClient) Next() error
- func (page *VirtualMachineListResultPageClient) NextWithContext(ctx context.Context) (err error)
- func (page VirtualMachineListResultPageClient) NotDone() bool
- func (page VirtualMachineListResultPageClient) Response() azcompute.VirtualMachineListResult
- func (page VirtualMachineListResultPageClient) Values() []azcompute.VirtualMachine
- type VirtualMachineScaleSetListResultPageClient
- func (page *VirtualMachineScaleSetListResultPageClient) Next() error
- func (page *VirtualMachineScaleSetListResultPageClient) NextWithContext(ctx context.Context) (err error)
- func (page VirtualMachineScaleSetListResultPageClient) NotDone() bool
- func (page VirtualMachineScaleSetListResultPageClient) Response() azcompute.VirtualMachineScaleSetListResult
- func (page VirtualMachineScaleSetListResultPageClient) Values() []azcompute.VirtualMachineScaleSet
- type VirtualMachineScaleSetListValues
- type VirtualMachineScaleSetVMListResultPageClient
- func (page *VirtualMachineScaleSetVMListResultPageClient) Next() error
- func (page *VirtualMachineScaleSetVMListResultPageClient) NextWithContext(ctx context.Context) (err error)
- func (page VirtualMachineScaleSetVMListResultPageClient) NotDone() bool
- func (page VirtualMachineScaleSetVMListResultPageClient) Response() azcompute.VirtualMachineScaleSetVMListResult
- func (page VirtualMachineScaleSetVMListResultPageClient) Values() []azcompute.VirtualMachineScaleSetVM
- type VirtualMachineScaleSetVMValues
- type VirtualMachineVMValues
Constants ¶
const ( // AADContributorRoleID is the role id that exists in every subscription for 'Contributor' AADContributorRoleID = "b24988ac-6180-42a0-ab88-20f7382dd24c" // AADRoleReferenceTemplate is a template for a roleDefinitionId AADRoleReferenceTemplate = "/subscriptions/%s/providers/Microsoft.Authorization/roleDefinitions/%s" // AADRoleResourceGroupScopeTemplate is a template for a roleDefinition scope AADRoleResourceGroupScopeTemplate = "/subscriptions/%s/resourceGroups/%s" )
const (
// ApplicationDir is the name of the dir where the token is cached
ApplicationDir = ".acsengine"
)
const DefaultARMOperationTimeout = 150 * time.Minute
DefaultARMOperationTimeout defines a default (permissive) ARM operation timeout
Variables ¶
var ( // RequiredResourceProviders is the list of Azure Resource Providers needed for AKS Engine to function RequiredResourceProviders = []string{"Microsoft.Compute", "Microsoft.Storage", "Microsoft.Network"} )
Functions ¶
func DeepCopy ¶
func DeepCopy(dst, src interface{}) (err error)
DeepCopy dst and src should be the same type in different API version dst should be pointer type
func DeployTemplateSync ¶
func DeployTemplateSync(az armhelpers.AKSEngineClient, logger *logrus.Entry, resourceGroupName, deploymentName string, template map[string]interface{}, parameters map[string]interface{}) error
DeployTemplateSync deploys the template and returns ArmError
Types ¶
type AzureClient ¶
type AzureClient struct {
// contains filtered or unexported fields
}
AzureClient implements the `AKSEngineClient` interface. This client is backed by real Azure clients talking to an ARM endpoint.
func NewAzureClientWithClientCertificate ¶
func NewAzureClientWithClientCertificate(env azure.Environment, subscriptionID, clientID string, certificate *x509.Certificate, privateKey *rsa.PrivateKey) (*AzureClient, error)
NewAzureClientWithClientCertificate returns an AzureClient via client_id and jwt certificate assertion
func NewAzureClientWithClientCertificateExternalTenant ¶
func NewAzureClientWithClientCertificateExternalTenant(env azure.Environment, subscriptionID, tenantID, clientID string, certificate *x509.Certificate, privateKey *rsa.PrivateKey) (*AzureClient, error)
NewAzureClientWithClientCertificateExternalTenant returns an AzureClient via client_id and jwt certificate assertion against a 3rd party tenant
func NewAzureClientWithClientCertificateFile ¶
func NewAzureClientWithClientCertificateFile(env azure.Environment, subscriptionID, clientID, certificatePath, privateKeyPath string) (*AzureClient, error)
NewAzureClientWithClientCertificateFile returns an AzureClient via client_id and jwt certificate assertion
func NewAzureClientWithClientCertificateFileExternalTenant ¶
func NewAzureClientWithClientCertificateFileExternalTenant(env azure.Environment, subscriptionID, tenantID, clientID, certificatePath, privateKeyPath string) (*AzureClient, error)
NewAzureClientWithClientCertificateFileExternalTenant returns an AzureClient via client_id and jwt certificate assertion a 3rd party tenant
func NewAzureClientWithClientSecret ¶
func NewAzureClientWithClientSecret(env azure.Environment, subscriptionID, clientID, clientSecret string) (*AzureClient, error)
NewAzureClientWithClientSecret returns an AzureClient via client_id and client_secret
func NewAzureClientWithClientSecretExternalTenant ¶
func NewAzureClientWithClientSecretExternalTenant(env azure.Environment, subscriptionID, tenantID, clientID, clientSecret string) (*AzureClient, error)
NewAzureClientWithClientSecretExternalTenant returns an AzureClient via client_id and client_secret from a tenant
func (*AzureClient) AddAcceptLanguages ¶
func (az *AzureClient) AddAcceptLanguages(languages []string)
AddAcceptLanguages sets the list of languages to accept on this request
func (*AzureClient) AddAuxiliaryTokens ¶
func (az *AzureClient) AddAuxiliaryTokens(tokens []string)
AddAuxiliaryTokens sets the list of aux tokens to accept on this request
func (*AzureClient) AddContainerInsightsSolution ¶ added in v0.41.0
func (az *AzureClient) AddContainerInsightsSolution(ctx context.Context, workspaceSubscriptionID, workspaceResourceGroup, workspaceName, workspaceLocation string) (result bool, err error)
AddContainerInsightsSolution adds container insights solution for the specified log analytics workspace
func (*AzureClient) CheckDeploymentExistence ¶
func (az *AzureClient) CheckDeploymentExistence(ctx context.Context, resourceGroupName string, deploymentName string) (result autorest.Response, err error)
CheckDeploymentExistence returns if the deployment already exists
func (*AzureClient) CheckResourceGroupExistence ¶
func (az *AzureClient) CheckResourceGroupExistence(ctx context.Context, name string) (result autorest.Response, err error)
CheckResourceGroupExistence return if the resource group exists
func (*AzureClient) CreateApp ¶
func (az *AzureClient) CreateApp(ctx context.Context, appName, appURL string, replyURLs *[]string, requiredResourceAccess *[]graphrbac.RequiredResourceAccess) (applicationResp graphrbac.Application, servicePrincipalObjectID, servicePrincipalClientSecret string, err error)
CreateApp is a simpler method for creating an application
func (*AzureClient) CreateGraphApplication ¶
func (az *AzureClient) CreateGraphApplication(ctx context.Context, applicationCreateParameters graphrbac.ApplicationCreateParameters) (graphrbac.Application, error)
CreateGraphApplication creates an application via the graphrbac client
func (*AzureClient) CreateGraphPrincipal ¶
func (az *AzureClient) CreateGraphPrincipal(ctx context.Context, servicePrincipalCreateParameters graphrbac.ServicePrincipalCreateParameters) (graphrbac.ServicePrincipal, error)
CreateGraphPrincipal creates a service principal via the graphrbac client
func (*AzureClient) CreateRoleAssignment ¶
func (az *AzureClient) CreateRoleAssignment(ctx context.Context, scope string, roleAssignmentName string, parameters authorization.RoleAssignmentCreateParameters) (authorization.RoleAssignment, error)
CreateRoleAssignment creates a role assignment via the authorization client
func (*AzureClient) CreateRoleAssignmentSimple ¶
func (az *AzureClient) CreateRoleAssignmentSimple(ctx context.Context, resourceGroup, servicePrincipalObjectID string) error
CreateRoleAssignmentSimple is a wrapper around RoleAssignmentsClient.Create
func (*AzureClient) CreateUserAssignedID ¶
func (az *AzureClient) CreateUserAssignedID(location string, resourceGroup string, userAssignedID string) (id *msi.Identity, err error)
CreateUserAssignedID - Creates a user assigned msi.
func (*AzureClient) DeleteApp ¶
func (az *AzureClient) DeleteApp(ctx context.Context, applicationName, applicationObjectID string) (autorest.Response, error)
DeleteApp is a simpler method for deleting an application and the associated spn
func (*AzureClient) DeleteGraphApplication ¶
func (az *AzureClient) DeleteGraphApplication(ctx context.Context, applicationObjectID string) (result autorest.Response, err error)
DeleteGraphApplication deletes an application via the graphrbac client
func (*AzureClient) DeleteManagedDisk ¶
func (az *AzureClient) DeleteManagedDisk(ctx context.Context, resourceGroupName string, diskName string) error
DeleteManagedDisk deletes a managed disk.
func (*AzureClient) DeleteNetworkInterface ¶
func (az *AzureClient) DeleteNetworkInterface(ctx context.Context, resourceGroup, nicName string) error
DeleteNetworkInterface deletes the specified network interface.
func (*AzureClient) DeleteResourceGroup ¶
func (az *AzureClient) DeleteResourceGroup(ctx context.Context, name string) error
DeleteResourceGroup delete the named resource group
func (*AzureClient) DeleteRoleAssignmentByID ¶
func (az *AzureClient) DeleteRoleAssignmentByID(ctx context.Context, roleAssignmentID string) (authorization.RoleAssignment, error)
DeleteRoleAssignmentByID deletes a roleAssignment via its unique identifier
func (*AzureClient) DeleteVirtualMachine ¶
func (az *AzureClient) DeleteVirtualMachine(ctx context.Context, resourceGroup, name string) error
DeleteVirtualMachine handles deletion of a CRP/VMAS VM (aka, not a VMSS VM).
func (*AzureClient) DeleteVirtualMachineScaleSet ¶
func (az *AzureClient) DeleteVirtualMachineScaleSet(ctx context.Context, resourceGroup, vmssName string) error
DeleteVirtualMachineScaleSet deletes an entire VM Scale Set.
func (*AzureClient) DeleteVirtualMachineScaleSetVM ¶
func (az *AzureClient) DeleteVirtualMachineScaleSetVM(ctx context.Context, resourceGroup, virtualMachineScaleSet, instanceID string) error
DeleteVirtualMachineScaleSetVM deletes a VM in a VMSS
func (*AzureClient) DeployTemplate ¶
func (az *AzureClient) DeployTemplate(ctx context.Context, resourceGroupName, deploymentName string, template map[string]interface{}, parameters map[string]interface{}) (de resources.DeploymentExtended, err error)
DeployTemplate implements the TemplateDeployer interface for the AzureClient client
func (*AzureClient) EnsureDefaultLogAnalyticsWorkspace ¶ added in v0.41.0
func (az *AzureClient) EnsureDefaultLogAnalyticsWorkspace(ctx context.Context, resourceGroup, location string) (workspaceResourceID string, err error)
EnsureDefaultLogAnalyticsWorkspace ensures the default log analytics exists corresponding to specified location
func (*AzureClient) EnsureProvidersRegistered ¶
func (az *AzureClient) EnsureProvidersRegistered(subscriptionID string) error
EnsureProvidersRegistered checks if the AzureClient is registered to required resource providers and, if not, register subscription to providers
func (*AzureClient) EnsureResourceGroup ¶
func (az *AzureClient) EnsureResourceGroup(ctx context.Context, name, location string, managedBy *string) (resourceGroup *resources.Group, err error)
EnsureResourceGroup ensures the named resource group exists in the given location.
func (*AzureClient) GetAvailabilitySet ¶ added in v0.37.0
func (az *AzureClient) GetAvailabilitySet(ctx context.Context, resourceGroup, availabilitySetName string) (azcompute.AvailabilitySet, error)
GetAvailabilitySet retrieves the specified VM availability set.
func (*AzureClient) GetAvailabilitySetFaultDomainCount ¶ added in v0.37.0
func (az *AzureClient) GetAvailabilitySetFaultDomainCount(ctx context.Context, resourceGroup string, vmasIDs []string) (int, error)
GetAvailabilitySetFaultDomainCount returns the first existing fault domain count it finds from the IDs provided.
func (*AzureClient) GetDeployment ¶
func (az *AzureClient) GetDeployment(ctx context.Context, resourceGroupName, deploymentName string) (result resources.DeploymentExtended, err error)
GetDeployment returns the template deployment
func (*AzureClient) GetKubernetesClient ¶
func (az *AzureClient) GetKubernetesClient(apiserverURL, kubeConfig string, interval, timeout time.Duration) (kubernetes.Client, error)
GetKubernetesClient returns a KubernetesClient hooked up to the api server at the apiserverURL.
func (*AzureClient) GetLogAnalyticsWorkspaceInfo ¶ added in v0.41.0
func (az *AzureClient) GetLogAnalyticsWorkspaceInfo(ctx context.Context, workspaceSubscriptionID, workspaceResourceGroup, workspaceName string) (workspaceID string, workspaceKey string, workspaceLocation string, err error)
GetLogAnalyticsWorkspaceInfo gets the details about the workspace
func (*AzureClient) GetStorageClient ¶
func (az *AzureClient) GetStorageClient(ctx context.Context, resourceGroup, accountName string) (armhelpers.AKSStorageClient, error)
GetStorageClient returns an authenticated client for the specified account.
func (*AzureClient) GetVirtualMachine ¶
func (az *AzureClient) GetVirtualMachine(ctx context.Context, resourceGroup, name string) (azcompute.VirtualMachine, error)
GetVirtualMachine returns the specified machine in the specified resource group.
func (*AzureClient) GetVirtualMachineImage ¶ added in v0.47.0
func (az *AzureClient) GetVirtualMachineImage(ctx context.Context, location, publisherName, offer, skus, version string) (compute.VirtualMachineImage, error)
GetVirtualMachineImage returns an image or an error if the image is not found
func (*AzureClient) ListDeploymentOperations ¶
func (az *AzureClient) ListDeploymentOperations(ctx context.Context, resourceGroupName string, deploymentName string, top *int32) (armhelpers.DeploymentOperationsListResultPage, error)
ListDeploymentOperations gets all deployments operations for a deployment.
func (*AzureClient) ListLocations ¶ added in v0.48.0
func (az *AzureClient) ListLocations(ctx context.Context) (*[]subscriptions.Location, error)
ListLocations returns the Azure regions available to the subscription.
func (*AzureClient) ListManagedDisksByResourceGroup ¶
func (az *AzureClient) ListManagedDisksByResourceGroup(ctx context.Context, resourceGroupName string) (result armhelpers.DiskListPage, err error)
ListManagedDisksByResourceGroup lists managed disks in a resource group.
func (*AzureClient) ListProviders ¶
func (az *AzureClient) ListProviders(ctx context.Context) (armhelpers.ProviderListResultPage, error)
ListProviders returns all the providers for a given AzureClient
func (*AzureClient) ListResourceSkus ¶ added in v0.49.0
func (az *AzureClient) ListResourceSkus(ctx context.Context, filter string) (armhelpers.ResourceSkusResultPage, error)
ListResourceSkus lists Microsoft.Compute SKUs available for a subscription
func (*AzureClient) ListRoleAssignmentsForPrincipal ¶
func (az *AzureClient) ListRoleAssignmentsForPrincipal(ctx context.Context, scope string, principalID string) (armhelpers.RoleAssignmentListResultPage, error)
ListRoleAssignmentsForPrincipal (e.g. a VM) via the scope and the unique identifier of the principal
func (*AzureClient) ListVirtualMachineImages ¶ added in v0.47.0
func (az *AzureClient) ListVirtualMachineImages(ctx context.Context, location, publisherName, offer, skus string) (compute.ListVirtualMachineImageResource, error)
ListVirtualMachineImages returns the list of images available in the current environment
func (*AzureClient) ListVirtualMachineScaleSetVMs ¶
func (az *AzureClient) ListVirtualMachineScaleSetVMs(ctx context.Context, resourceGroup, virtualMachineScaleSet string) (armhelpers.VirtualMachineScaleSetVMListResultPage, error)
ListVirtualMachineScaleSetVMs returns the list of VMs per VMSS
func (*AzureClient) ListVirtualMachineScaleSets ¶
func (az *AzureClient) ListVirtualMachineScaleSets(ctx context.Context, resourceGroup string) (armhelpers.VirtualMachineScaleSetListResultPage, error)
ListVirtualMachineScaleSets returns (the first page of) the VMSS resources in the specified resource group.
func (*AzureClient) ListVirtualMachines ¶
func (az *AzureClient) ListVirtualMachines(ctx context.Context, resourceGroup string) (armhelpers.VirtualMachineListResultPage, error)
ListVirtualMachines returns (the first page of) the machines in the specified resource group.
func (*AzureClient) RestartVirtualMachine ¶ added in v0.35.0
func (az *AzureClient) RestartVirtualMachine(ctx context.Context, resourceGroup, name string) error
RestartVirtualMachine restarts the specified virtual machine.
func (*AzureClient) RestartVirtualMachineScaleSets ¶ added in v0.35.0
func (az *AzureClient) RestartVirtualMachineScaleSets(ctx context.Context, resourceGroup string, virtualMachineScaleSet string, instanceIDs *azcompute.VirtualMachineScaleSetVMInstanceIDs) error
RestartVirtualMachineScaleSets restarts the specified VMSS
func (*AzureClient) SetVirtualMachineScaleSetCapacity ¶
func (az *AzureClient) SetVirtualMachineScaleSetCapacity(ctx context.Context, resourceGroup, virtualMachineScaleSet string, sku azcompute.Sku, location string) error
SetVirtualMachineScaleSetCapacity sets the VMSS capacity
func (*AzureClient) ValidateTemplate ¶
func (az *AzureClient) ValidateTemplate( ctx context.Context, resourceGroupName string, deploymentName string, template map[string]interface{}, parameters map[string]interface{}) (result resources.DeploymentValidateResult, err error)
ValidateTemplate validate the template and parameters
type AzureStorageClient ¶
type AzureStorageClient struct {
// contains filtered or unexported fields
}
AzureStorageClient implements the StorageClient interface and wraps the Azure storage client.
func (*AzureStorageClient) CreateContainer ¶
func (as *AzureStorageClient) CreateContainer(containerName string, options *azStorage.CreateContainerOptions) (bool, error)
CreateContainer creates the CloudBlobContainer if it does not exist
func (*AzureStorageClient) DeleteBlob ¶
func (as *AzureStorageClient) DeleteBlob(vhdContainer, vhdBlob string, options *azStorage.DeleteBlobOptions) error
DeleteBlob deletes the specified blob TODO(colemick): why doesn't SDK give a way to just delete a blob by URI? it's what it ends up doing internally anyway...
func (*AzureStorageClient) SaveBlockBlob ¶
func (as *AzureStorageClient) SaveBlockBlob(containerName, blobName string, b []byte, options *azStorage.PutBlobOptions) error
SaveBlockBlob initializes a block blob by taking the byte
type DeploymentError ¶
type DeploymentError struct { DeploymentName string ResourceGroup string TopError error StatusCode int Response []byte ProvisioningState string OperationsLists []resources.DeploymentOperationsListResult }
DeploymentError contains the root deployment error along with deployment operation errors
func (*DeploymentError) Error ¶
func (e *DeploymentError) Error() string
Error implements error interface
type DeploymentValidationError ¶
type DeploymentValidationError struct {
Err error
}
DeploymentValidationError contains validation error
func (*DeploymentValidationError) Error ¶
func (e *DeploymentValidationError) Error() string
Error implements error interface
type DiskListPageClient ¶
type DiskListPageClient struct {
// contains filtered or unexported fields
}
DiskListPageClient contains a page of Disk values.
func (*DiskListPageClient) Next ¶
func (page *DiskListPageClient) Next() error
Next advances to the next page of values. If there was an error making the request the page does not advance and the error is returned. Deprecated: Use NextWithContext() instead.
func (*DiskListPageClient) NextWithContext ¶
func (page *DiskListPageClient) NextWithContext(ctx context.Context) (err error)
NextWithContext advances to the next page of values. If there was an error making the request the page does not advance and the error is returned.
func (DiskListPageClient) NotDone ¶
func (page DiskListPageClient) NotDone() bool
NotDone returns true if the page enumeration should be started or is not yet complete.
func (DiskListPageClient) Response ¶
func (page DiskListPageClient) Response() azcompute.DiskList
Response returns the raw server response from the last page request.
func (DiskListPageClient) Values ¶
func (page DiskListPageClient) Values() []azcompute.Disk
Values returns the slice of values for the current page or nil if there are no values.
type HTTPMockClient ¶
type HTTPMockClient struct { SubscriptionID string TenantID string ResourceGroup string ResourceGroupAPIVersion string ComputeAPIVersion string NetworkAPIVersion string DeploymentAPIVersion string LogAnalyticsAPIVersion string SubscriptionsAPIVersion string DeploymentName string DeploymentStatus string VirtualMachineScaleSetName string VirtualMachineName string LogAnalyticsDefaultResourceGroupEUS string LogAnalyticsDefaultWorkspaceNameEUS string LogAnalyticsDefaultResourceGroupWEU string LogAnalyticsDefaultWorkspaceNameWEU string LogAnalyticsWorkspaceName string LogAnalyticsSolutionName string VirtualNicName string VirutalDiskName string Location string OperationID string TokenResponse string Publisher string Sku string Offer string Version string ResponseListLocations string ResponseListVirtualMachineScaleSets string ResponseListVirtualMachineScaleSetVMs string ResponseListVirtualMachines string ResponseGetVirtualMachine string ResponseDeployVirtualMachine string ResponseDeployVirtualMachineError string ResponseGetAvailabilitySet string ResponseGetLogAnalyticsWorkspace string ResponseListWorkspacesByResourceGroup string ResponseCreateOrUpdateWorkspace string ResponseGetVirtualMachineImage string ResponseListVirtualMachineImages string // contains filtered or unexported fields }
HTTPMockClient is an wrapper of httpmock
func NewHTTPMockClient ¶
func NewHTTPMockClient() (HTTPMockClient, error)
NewHTTPMockClient creates HTTPMockClient with default values
func (*HTTPMockClient) Activate ¶
func (mc *HTTPMockClient) Activate() error
Activate starts the mock environment and should only be called after all required endpoints have been registered.
func (*HTTPMockClient) DeactivateAndReset ¶
func (mc *HTTPMockClient) DeactivateAndReset()
DeactivateAndReset shuts down the mock environment and removes any registered mocks
func (HTTPMockClient) GetEnvironment ¶
func (mc HTTPMockClient) GetEnvironment() azure.Environment
GetEnvironment return azure.Environment for Azure Stack
func (*HTTPMockClient) RegisterDeleteManagedDisk ¶
func (mc *HTTPMockClient) RegisterDeleteManagedDisk()
RegisterDeleteManagedDisk registers the mock response for DeleteManagedDisk
func (*HTTPMockClient) RegisterDeleteNetworkInterface ¶
func (mc *HTTPMockClient) RegisterDeleteNetworkInterface()
RegisterDeleteNetworkInterface registers the mock response for DeleteNetworkInterface
func (HTTPMockClient) RegisterDeleteOperation ¶ added in v0.39.0
func (mc HTTPMockClient) RegisterDeleteOperation()
RegisterDeleteOperation registers mock responses for checking the status of a delete operation
func (HTTPMockClient) RegisterDeployOperationFailure ¶ added in v0.39.0
func (mc HTTPMockClient) RegisterDeployOperationFailure()
RegisterDeployOperationSuccess registers the mock response for a failed deployment
func (HTTPMockClient) RegisterDeployOperationSuccess ¶ added in v0.39.0
func (mc HTTPMockClient) RegisterDeployOperationSuccess()
RegisterDeployOperationSuccess registers the mock response for a successful deployment
func (*HTTPMockClient) RegisterDeployTemplate ¶
func (mc *HTTPMockClient) RegisterDeployTemplate()
RegisterDeployTemplate registers the mock response for DeployTemplate
func (HTTPMockClient) RegisterEnsureDefaultLogAnalyticsWorkspaceCreateNew ¶ added in v0.41.0
func (mc HTTPMockClient) RegisterEnsureDefaultLogAnalyticsWorkspaceCreateNew()
RegisterEnsureDefaultLogAnalyticsWorkspace registers the mock response for EnsureDefaultLogAnalyticsWorkspace.
func (HTTPMockClient) RegisterEnsureDefaultLogAnalyticsWorkspaceUseExisting ¶ added in v0.41.0
func (mc HTTPMockClient) RegisterEnsureDefaultLogAnalyticsWorkspaceUseExisting()
RegisterEnsureDefaultLogAnalyticsWorkspace registers the mock response for EnsureDefaultLogAnalyticsWorkspace.
func (HTTPMockClient) RegisterGetAvailabilitySet ¶ added in v0.37.0
func (mc HTTPMockClient) RegisterGetAvailabilitySet()
RegisterGetAvailabilitySet registers the mock response for GetAvailabilitySet.
func (HTTPMockClient) RegisterGetAvailabilitySetFaultDomainCount ¶ added in v0.37.0
func (mc HTTPMockClient) RegisterGetAvailabilitySetFaultDomainCount()
RegisterGetAvailabilitySetFaultDomainCount registers a mock response for GetAvailabilitySet.
func (HTTPMockClient) RegisterGetLogAnalyticsWorkspaceInfo ¶ added in v0.41.0
func (mc HTTPMockClient) RegisterGetLogAnalyticsWorkspaceInfo()
RegisterGetLogAnalyticsWorkspaceInfo registers the mock response for GetLogAnalyticsWorkspaceInfo.
func (HTTPMockClient) RegisterListLocations ¶ added in v0.48.0
func (mc HTTPMockClient) RegisterListLocations()
RegisterListLocations registers the mock response for ListVirtualMachines
func (HTTPMockClient) RegisterListResourceSkus ¶ added in v0.49.0
func (mc HTTPMockClient) RegisterListResourceSkus()
RegisterListResourceSkus registers a mock response for ListResourceSkus.
func (HTTPMockClient) RegisterListVirtualMachineScaleSetVMs ¶
func (mc HTTPMockClient) RegisterListVirtualMachineScaleSetVMs()
RegisterListVirtualMachineScaleSetVMs registers the mock response for ListVirtualMachineScaleSetVMs
func (HTTPMockClient) RegisterListVirtualMachineScaleSets ¶
func (mc HTTPMockClient) RegisterListVirtualMachineScaleSets()
RegisterListVirtualMachineScaleSets registers the mock response for ListVirtualMachineScaleSets
func (HTTPMockClient) RegisterListVirtualMachines ¶
func (mc HTTPMockClient) RegisterListVirtualMachines()
RegisterListVirtualMachines registers the mock response for ListVirtualMachines
func (HTTPMockClient) RegisterLogin ¶
func (mc HTTPMockClient) RegisterLogin()
RegisterLogin registers the mock response for login
func (*HTTPMockClient) RegisterVMImageFetcherInterface ¶ added in v0.47.0
func (mc *HTTPMockClient) RegisterVMImageFetcherInterface()
RegisterVMImageFetcherInterface registers the mock response for VMImageFetcherInterface methods.
func (*HTTPMockClient) RegisterVirtualMachineEndpoint ¶ added in v0.39.0
func (mc *HTTPMockClient) RegisterVirtualMachineEndpoint()
RegisterVirtualMachineEndpoint registers mock responses for the Microsoft.Compute/virtualMachines endpoint
type VirtualMachineListResultPageClient ¶
type VirtualMachineListResultPageClient struct {
// contains filtered or unexported fields
}
VirtualMachineListResultPageClient Virtual Machine List Result Page Client
func (*VirtualMachineListResultPageClient) Next ¶
func (page *VirtualMachineListResultPageClient) Next() error
Next advances to the next page of values. If there was an error making the request the page does not advance and the error is returned.
func (*VirtualMachineListResultPageClient) NextWithContext ¶
func (page *VirtualMachineListResultPageClient) NextWithContext(ctx context.Context) (err error)
NextWithContext advances to the next page of values. If there was an error making the request the page does not advance and the error is returned.
func (VirtualMachineListResultPageClient) NotDone ¶
func (page VirtualMachineListResultPageClient) NotDone() bool
NotDone returns true if the page enumeration should be started or is not yet complete.
func (VirtualMachineListResultPageClient) Response ¶
func (page VirtualMachineListResultPageClient) Response() azcompute.VirtualMachineListResult
Response returns the raw server response from the last page request.
func (VirtualMachineListResultPageClient) Values ¶
func (page VirtualMachineListResultPageClient) Values() []azcompute.VirtualMachine
Values returns the slice of values for the current page or nil if there are no values.
type VirtualMachineScaleSetListResultPageClient ¶
type VirtualMachineScaleSetListResultPageClient struct {
// contains filtered or unexported fields
}
VirtualMachineScaleSetListResultPageClient Virtual Machine Scale Set List Result Page Client
func (*VirtualMachineScaleSetListResultPageClient) Next ¶
func (page *VirtualMachineScaleSetListResultPageClient) Next() error
Next advances to the next page of values. If there was an error making the request the page does not advance and the error is returned.
func (*VirtualMachineScaleSetListResultPageClient) NextWithContext ¶
func (page *VirtualMachineScaleSetListResultPageClient) NextWithContext(ctx context.Context) (err error)
NextWithContext advances to the next page of values. If there was an error making the request the page does not advance and the error is returned.
func (VirtualMachineScaleSetListResultPageClient) NotDone ¶
func (page VirtualMachineScaleSetListResultPageClient) NotDone() bool
NotDone returns true if the page enumeration should be started or is not yet complete.
func (VirtualMachineScaleSetListResultPageClient) Response ¶
func (page VirtualMachineScaleSetListResultPageClient) Response() azcompute.VirtualMachineScaleSetListResult
Response returns the raw server response from the last page request.
func (VirtualMachineScaleSetListResultPageClient) Values ¶
func (page VirtualMachineScaleSetListResultPageClient) Values() []azcompute.VirtualMachineScaleSet
Values returns the slice of values for the current page or nil if there are no values.
type VirtualMachineScaleSetListValues ¶
type VirtualMachineScaleSetListValues struct {
Value []compute.VirtualMachineScaleSet
}
VirtualMachineScaleSetListValues is an wrapper of virtual machine scale set list response values
type VirtualMachineScaleSetVMListResultPageClient ¶
type VirtualMachineScaleSetVMListResultPageClient struct {
// contains filtered or unexported fields
}
VirtualMachineScaleSetVMListResultPageClient Virtual Machine Scale Set VM List Result Page Client
func (*VirtualMachineScaleSetVMListResultPageClient) Next ¶
func (page *VirtualMachineScaleSetVMListResultPageClient) Next() error
Next advances to the next page of values. If there was an error making the request the page does not advance and the error is returned.
func (*VirtualMachineScaleSetVMListResultPageClient) NextWithContext ¶
func (page *VirtualMachineScaleSetVMListResultPageClient) NextWithContext(ctx context.Context) (err error)
NextWithContext advances to the next page of values. If there was an error making the request the page does not advance and the error is returned.
func (VirtualMachineScaleSetVMListResultPageClient) NotDone ¶
func (page VirtualMachineScaleSetVMListResultPageClient) NotDone() bool
NotDone returns true if the page enumeration should be started or is not yet complete.
func (VirtualMachineScaleSetVMListResultPageClient) Response ¶
func (page VirtualMachineScaleSetVMListResultPageClient) Response() azcompute.VirtualMachineScaleSetVMListResult
Response returns the raw server response from the last page request.
func (VirtualMachineScaleSetVMListResultPageClient) Values ¶
func (page VirtualMachineScaleSetVMListResultPageClient) Values() []azcompute.VirtualMachineScaleSetVM
Values returns the slice of values for the current page or nil if there are no values.
type VirtualMachineScaleSetVMValues ¶
type VirtualMachineScaleSetVMValues struct {
Value []compute.VirtualMachineScaleSetVM
}
VirtualMachineScaleSetVMValues is an wrapper of virtual machine scale set VM response values
type VirtualMachineVMValues ¶
type VirtualMachineVMValues struct {
Value []compute.VirtualMachine
}
VirtualMachineVMValues is an wrapper of virtual machine VM response values