azurestack

package
v0.47.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2020 License: MIT Imports: 44 Imported by: 6

Documentation

Overview

Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.

Index

Constants

View Source
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"
)
View Source
const (
	// ApplicationDir is the name of the dir where the token is cached
	ApplicationDir = ".acsengine"
)
View Source
const DefaultARMOperationTimeout = 150 * time.Minute

DefaultARMOperationTimeout defines a default (permissive) ARM operation timeout

Variables

View Source
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{}) 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) (armhelpers.KubernetesClient, 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) 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

ListProviders returns all the providers for a given AzureClient

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
	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
	ResponseListVirtualMachineScaleSets        string
	ResponseListVirtualMachineScaleSetVMs      string
	ResponseListVirtualMachines                string
	ResponseGetVirtualMachine                  string
	ResponseDeployVirtualMachine               string
	ResponseDeployVirtualMachineError          string
	ResponseGetAvailabilitySet                 string
	ResponseGetLogAnalyticsWorkspace           string
	ResponseGetLogAnalyticsWorkspaceSharedKeys 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) 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 KubernetesClientSetClient

type KubernetesClientSetClient struct {
	// contains filtered or unexported fields
}

KubernetesClientSetClient is a Kubernetes client hooked up to a live api server.

func (*KubernetesClientSetClient) DeleteNode

func (c *KubernetesClientSetClient) DeleteNode(name string) error

DeleteNode deregisters the node in the api server.

func (*KubernetesClientSetClient) DeletePod

func (c *KubernetesClientSetClient) DeletePod(pod *v1.Pod) error

DeletePod deletes the passed in pod.

func (*KubernetesClientSetClient) DeleteServiceAccount added in v0.35.0

func (c *KubernetesClientSetClient) DeleteServiceAccount(sa *v1.ServiceAccount) error

DeleteServiceAccount deletes the passed in service account.

func (*KubernetesClientSetClient) EvictPod

func (c *KubernetesClientSetClient) EvictPod(pod *v1.Pod, policyGroupVersion string) error

EvictPod evicts the passed in pod using the passed in api version.

func (*KubernetesClientSetClient) GetDeployment added in v0.37.0

func (c *KubernetesClientSetClient) GetDeployment(namespace, name string) (*appsv1.Deployment, error)

GetDeployment returns a given deployment in a namespace.

func (*KubernetesClientSetClient) GetNode

func (c *KubernetesClientSetClient) GetNode(name string) (*v1.Node, error)

GetNode returns details about node with passed in name.

func (*KubernetesClientSetClient) ListAllPods added in v0.35.0

func (c *KubernetesClientSetClient) ListAllPods() (*v1.PodList, error)

ListAllPods returns all Pods running.

func (*KubernetesClientSetClient) ListNodes added in v0.35.0

func (c *KubernetesClientSetClient) ListNodes() (*v1.NodeList, error)

ListNodes returns a list of Nodes registered in the api server.

func (*KubernetesClientSetClient) ListPods

func (c *KubernetesClientSetClient) ListPods(node *v1.Node) (*v1.PodList, error)

ListPods returns all Pods running on the passed in node.

func (*KubernetesClientSetClient) ListServiceAccounts added in v0.35.0

func (c *KubernetesClientSetClient) ListServiceAccounts(namespace string) (*v1.ServiceAccountList, error)

ListServiceAccounts returns a list of Service Accounts in the provided namespace.

func (*KubernetesClientSetClient) SupportEviction

func (c *KubernetesClientSetClient) SupportEviction() (string, error)

SupportEviction queries the api server to discover if it supports eviction, and returns supported type if it is supported.

func (*KubernetesClientSetClient) UpdateDeployment added in v0.37.0

func (c *KubernetesClientSetClient) UpdateDeployment(namespace string, deployment *appsv1.Deployment) (*appsv1.Deployment, error)

UpdateDeployment updates a deployment to match the given specification.

func (*KubernetesClientSetClient) UpdateNode

func (c *KubernetesClientSetClient) UpdateNode(node *v1.Node) (*v1.Node, error)

UpdateNode updates the node in the api server with the passed in info.

func (*KubernetesClientSetClient) WaitForDelete

func (c *KubernetesClientSetClient) WaitForDelete(logger *log.Entry, pods []v1.Pod, usingEviction bool) ([]v1.Pod, error)

WaitForDelete waits until all pods are deleted. Returns all pods not deleted and an error on failure.

type VirtualMachineListResultPageClient

type VirtualMachineListResultPageClient struct {
	// contains filtered or unexported fields
}

VirtualMachineListResultPageClient Virtual Machine List Result Page Client

func (*VirtualMachineListResultPageClient) Next

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

NotDone returns true if the page enumeration should be started or is not yet complete.

func (VirtualMachineListResultPageClient) Response

Response returns the raw server response from the last page request.

func (VirtualMachineListResultPageClient) Values

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

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

NotDone returns true if the page enumeration should be started or is not yet complete.

func (VirtualMachineScaleSetListResultPageClient) Response

Response returns the raw server response from the last page request.

func (VirtualMachineScaleSetListResultPageClient) Values

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

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

NotDone returns true if the page enumeration should be started or is not yet complete.

func (VirtualMachineScaleSetVMListResultPageClient) Response

Response returns the raw server response from the last page request.

func (VirtualMachineScaleSetVMListResultPageClient) Values

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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