Documentation ¶
Index ¶
- Constants
- func AvailabilitySetExists(t testing.TestingT, avsName string, resGroupName string, subscriptionID string) bool
- func AvailabilitySetExistsE(t testing.TestingT, avsName string, resGroupName string, subscriptionID string) (bool, error)
- func CheckAvailabilitySetContainsVM(t testing.TestingT, vmName string, avsName string, resGroupName string, ...) bool
- func CheckAvailabilitySetContainsVME(t testing.TestingT, vmName string, avsName string, resGroupName string, ...) (bool, error)
- func CheckPublicDNSNameAvailability(t testing.TestingT, location string, domainNameLabel string, ...) bool
- func CheckPublicDNSNameAvailabilityE(location string, domainNameLabel string, subscriptionID string) (bool, error)
- func CheckSubnetContainsIP(t testing.TestingT, IP string, subnetName string, vnetName string, ...) bool
- func CheckSubnetContainsIPE(ipAddress string, subnetName string, vnetName string, resGroupName string, ...) (bool, error)
- func DiskExists(t testing.TestingT, diskName string, resGroupName string, ...) bool
- func DiskExistsE(diskName string, resGroupName string, subscriptionID string) (bool, error)
- func GetActionGroupResource(t *testing.T, ruleName string, resGroupName string, subscriptionID string) *insights.ActionGroupResource
- func GetActionGroupResourceE(ruleName string, resGroupName string, subscriptionID string) (*insights.ActionGroupResource, error)
- func GetAllAzureRegions(t testing.TestingT, subscriptionID string) []string
- func GetAllAzureRegionsE(t testing.TestingT, subscriptionID string) ([]string, error)
- func GetAvailabilitySetClientE(subscriptionID string) (*compute.AvailabilitySetsClient, error)
- func GetAvailabilitySetE(t testing.TestingT, avsName string, resGroupName string, subscriptionID string) (*compute.AvailabilitySet, error)
- func GetAvailabilitySetFaultDomainCount(t testing.TestingT, avsName string, resGroupName string, subscriptionID string) int32
- func GetAvailabilitySetFaultDomainCountE(t testing.TestingT, avsName string, resGroupName string, subscriptionID string) (int32, error)
- func GetAvailabilitySetVMNamesInCaps(t testing.TestingT, avsName string, resGroupName string, subscriptionID string) []string
- func GetAvailabilitySetVMNamesInCapsE(t testing.TestingT, avsName string, resGroupName string, subscriptionID string) ([]string, error)
- func GetCustomNsgRulesClient(t *testing.T, subscriptionID string) network.SecurityRulesClient
- func GetCustomNsgRulesClientE(subscriptionID string) (network.SecurityRulesClient, error)
- func GetDatabaseClient(subscriptionID string) (*sql.DatabasesClient, error)
- func GetDefaultNsgRulesClient(t *testing.T, subscriptionID string) network.DefaultSecurityRulesClient
- func GetDefaultNsgRulesClientE(subscriptionID string) (network.DefaultSecurityRulesClient, error)
- func GetDisk(t testing.TestingT, diskName string, resGroupName string, ...) *compute.Disk
- func GetDiskClientE(subscriptionID string) (*compute.DisksClient, error)
- func GetDiskE(diskName string, resGroupName string, subscriptionID string) (*compute.Disk, error)
- func GetIPOfPublicIPAddressByName(t testing.TestingT, publicAddressName string, resGroupName string, ...) string
- func GetIPOfPublicIPAddressByNameE(publicAddressName string, resGroupName string, subscriptionID string) (string, error)
- func GetManagedClusterE(t testing.TestingT, resourceGroupName, clusterName, subscriptionID string) (*containerservice.ManagedCluster, error)
- func GetManagedClustersClientE(subscriptionID string) (*containerservice.ManagedClustersClient, error)
- func GetNameFromResourceID(resourceID string) string
- func GetNameFromResourceIDE(resourceID string) (string, error)
- func GetNetworkInterfaceClientE(subscriptionID string) (*network.InterfacesClient, error)
- func GetNetworkInterfaceConfigurationClientE(subscriptionID string) (*network.InterfaceIPConfigurationsClient, error)
- func GetNetworkInterfaceConfigurationE(nicName string, nicConfigName string, resGroupName string, ...) (*network.InterfaceIPConfiguration, error)
- func GetNetworkInterfaceE(nicName string, resGroupName string, subscriptionID string) (*network.Interface, error)
- func GetNetworkInterfacePrivateIPs(t testing.TestingT, nicName string, resGroupName string, subscriptionID string) []string
- func GetNetworkInterfacePrivateIPsE(nicName string, resGroupName string, subscriptionID string) ([]string, error)
- func GetNetworkInterfacePublicIPs(t testing.TestingT, nicName string, resGroupName string, subscriptionID string) []string
- func GetNetworkInterfacePublicIPsE(nicName string, resGroupName string, subscriptionID string) ([]string, error)
- func GetPublicIPAddressClientE(subscriptionID string) (*network.PublicIPAddressesClient, error)
- func GetPublicIPAddressE(publicIPAddressName string, resGroupName string, subscriptionID string) (*network.PublicIPAddress, error)
- func GetRandomRegion(t testing.TestingT, approvedRegions []string, forbiddenRegions []string, ...) string
- func GetRandomRegionE(t testing.TestingT, approvedRegions []string, forbiddenRegions []string, ...) (string, error)
- func GetRandomStableRegion(t testing.TestingT, approvedRegions []string, forbiddenRegions []string, ...) string
- func GetResourceGroupClientE(subscriptionID string) (*resources.GroupsClient, error)
- func GetResourceGroupE(resourceGroupName, subscriptionID string) (bool, error)
- func GetSQLDatabase(t testing.TestingT, resGroupName string, serverName string, dbName string, ...) *sql.Database
- func GetSQLDatabaseE(t testing.TestingT, subscriptionID string, resGroupName string, ...) (*sql.Database, error)
- func GetSQLServer(t testing.TestingT, resGroupName string, serverName string, ...) *sql.Server
- func GetSQLServerClient(subscriptionID string) (*sql.ServersClient, error)
- func GetSQLServerE(t testing.TestingT, subscriptionID string, resGroupName string, ...) (*sql.Server, error)
- func GetSizeOfVirtualMachine(t testing.TestingT, vmName string, resGroupName string, subscriptionID string) compute.VirtualMachineSizeTypes
- func GetSizeOfVirtualMachineE(vmName string, resGroupName string, subscriptionID string) (compute.VirtualMachineSizeTypes, error)
- func GetSubnetClientE(subscriptionID string) (*network.SubnetsClient, error)
- func GetSubnetE(subnetName string, vnetName string, resGroupName string, subscriptionID string) (*network.Subnet, error)
- func GetSubscriptionClient() (*subscriptions.Client, error)
- func GetTargetAzureResourceGroupName(resourceGroupName string) (string, error)
- func GetTargetAzureSubscription(subscriptionID string) (string, error)
- func GetVirtualMachine(t testing.TestingT, vmName string, resGroupName string, subscriptionID string) *compute.VirtualMachine
- func GetVirtualMachineAvailabilitySetID(t testing.TestingT, vmName string, resGroupName string, subscriptionID string) string
- func GetVirtualMachineAvailabilitySetIDE(vmName string, resGroupName string, subscriptionID string) (string, error)
- func GetVirtualMachineClientE(subscriptionID string) (*compute.VirtualMachinesClient, error)
- func GetVirtualMachineE(vmName string, resGroupName string, subscriptionID string) (*compute.VirtualMachine, error)
- func GetVirtualMachineManagedDisks(t testing.TestingT, vmName string, resGroupName string, subscriptionID string) []string
- func GetVirtualMachineManagedDisksE(vmName string, resGroupName string, subscriptionID string) ([]string, error)
- func GetVirtualMachineNics(t testing.TestingT, vmName string, resGroupName string, subscriptionID string) []string
- func GetVirtualMachineNicsE(vmName string, resGroupName string, subscriptionID string) ([]string, error)
- func GetVirtualMachineOSDiskName(t testing.TestingT, vmName string, resGroupName string, subscriptionID string) string
- func GetVirtualMachineOSDiskNameE(vmName string, resGroupName string, subscriptionID string) (string, error)
- func GetVirtualMachineTags(t testing.TestingT, vmName string, resGroupName string, subscriptionID string) map[string]string
- func GetVirtualMachineTagsE(vmName string, resGroupName string, subscriptionID string) (map[string]string, error)
- func GetVirtualMachinesForResourceGroup(t testing.TestingT, resGroupName string, subscriptionID string) map[string]compute.VirtualMachineProperties
- func GetVirtualMachinesForResourceGroupE(resourceGroupName string, subscriptionID string) (map[string]compute.VirtualMachineProperties, error)
- func GetVirtualNetworkDNSServerIPs(t testing.TestingT, vnetName string, resGroupName string, ...) []string
- func GetVirtualNetworkDNSServerIPsE(vnetName string, resGroupName string, subscriptionID string) ([]string, error)
- func GetVirtualNetworkE(vnetName string, resGroupName string, subscriptionID string) (*network.VirtualNetwork, error)
- func GetVirtualNetworkSubnets(t testing.TestingT, vnetName string, resGroupName string, ...) map[string]string
- func GetVirtualNetworkSubnetsE(vnetName string, resGroupName string, subscriptionID string) (map[string]string, error)
- func GetVirtualNetworksClientE(subscriptionID string) (*network.VirtualNetworksClient, error)
- func ListSQLServerDatabases(t testing.TestingT, resGroupName string, serverName string, ...) *[]sql.Database
- func ListSQLServerDatabasesE(t testing.TestingT, resGroupName string, serverName string, ...) (*[]sql.Database, error)
- func ListVirtualMachinesForResourceGroup(t testing.TestingT, resGroupName string, subscriptionID string) []string
- func ListVirtualMachinesForResourceGroupE(resourceGroupName string, subscriptionID string) ([]string, error)
- func NetworkInterfaceExists(t testing.TestingT, nicName string, resGroupName string, subscriptionID string) bool
- func NetworkInterfaceExistsE(nicName string, resGroupName string, subscriptionID string) (bool, error)
- func NewAuthorizer() (*autorest.Authorizer, error)
- func PublicAddressExists(t testing.TestingT, publicAddressName string, resGroupName string, ...) bool
- func PublicAddressExistsE(publicAddressName string, resGroupName string, subscriptionID string) (bool, error)
- func ResourceGroupExists(t *testing.T, resourceGroupName string, subscriptionID string) bool
- func ResourceGroupExistsE(resourceGroupName, subscriptionID string) (bool, error)
- func ResourceNotFoundErrorExists(err error) bool
- func SubnetExists(t testing.TestingT, subnetName string, vnetName string, resGroupName string, ...) bool
- func SubnetExistsE(subnetName string, vnetName string, resGroupName string, subscriptionID string) (bool, error)
- func VirtualMachineExists(t testing.TestingT, vmName string, resGroupName string, subscriptionID string) bool
- func VirtualMachineExistsE(vmName string, resGroupName string, subscriptionID string) (bool, error)
- func VirtualNetworkExists(t testing.TestingT, vnetName string, resGroupName string, ...) bool
- func VirtualNetworkExistsE(vnetName string, resGroupName string, subscriptionID string) (bool, error)
- type FailedToParseError
- type Instance
- type NotFoundError
- type NsgRuleSummary
- type NsgRuleSummaryList
- type ResourceGroupNameNotFound
- type SubscriptionIDNotFound
- type VMImage
Constants ¶
const ( // AuthFromEnvClient is an env variable supported by the Azure SDK AuthFromEnvClient = "AZURE_CLIENT_ID" // AuthFromEnvTenant is an env variable supported by the Azure SDK AuthFromEnvTenant = "AZURE_TENANT_ID" // AuthFromFile is an env variable supported by the Azure SDK AuthFromFile = "AZURE_AUTH_LOCATION" )
const ( // AzureSubscriptionID is an optional env variable supported by the `azurerm` Terraform provider to // designate a target Azure subscription ID AzureSubscriptionID = "ARM_SUBSCRIPTION_ID" // AzureResGroupName is an optional env variable custom to Terratest to designate a target Azure resource group AzureResGroupName = "AZURE_RES_GROUP_NAME" )
Variables ¶
This section is empty.
Functions ¶
func AvailabilitySetExists ¶
func AvailabilitySetExists(t testing.TestingT, avsName string, resGroupName string, subscriptionID string) bool
AvailabilitySetExists indicates whether the specified Azure Availability Set exists. This function would fail the test if there is an error.
func AvailabilitySetExistsE ¶
func AvailabilitySetExistsE(t testing.TestingT, avsName string, resGroupName string, subscriptionID string) (bool, error)
AvailabilitySetExistsE indicates whether the specified Azure Availability Set exists
func CheckAvailabilitySetContainsVM ¶
func CheckAvailabilitySetContainsVM(t testing.TestingT, vmName string, avsName string, resGroupName string, subscriptionID string) bool
CheckAvailabilitySetContainsVM checks if the Virtual Machine is contained in the Availability Set VMs. This function would fail the test if there is an error.
func CheckAvailabilitySetContainsVME ¶
func CheckAvailabilitySetContainsVME(t testing.TestingT, vmName string, avsName string, resGroupName string, subscriptionID string) (bool, error)
CheckAvailabilitySetContainsVME checks if the Virtual Machine is contained in the Availability Set VMs
func CheckPublicDNSNameAvailability ¶
func CheckPublicDNSNameAvailability(t testing.TestingT, location string, domainNameLabel string, subscriptionID string) bool
CheckPublicDNSNameAvailability checks whether a Domain Name in the cloudapp.azure.com zone is available for use. This function would fail the test if there is an error.
func CheckPublicDNSNameAvailabilityE ¶
func CheckPublicDNSNameAvailabilityE(location string, domainNameLabel string, subscriptionID string) (bool, error)
CheckPublicDNSNameAvailabilityE checks whether a Domain Name in the cloudapp.azure.com zone is available for use.
func CheckSubnetContainsIP ¶
func CheckSubnetContainsIP(t testing.TestingT, IP string, subnetName string, vnetName string, resGroupName string, subscriptionID string) bool
CheckSubnetContainsIP checks if the Private IP is contined in the Subnet Address Range. This function would fail the test if there is an error.
func CheckSubnetContainsIPE ¶
func CheckSubnetContainsIPE(ipAddress string, subnetName string, vnetName string, resGroupName string, subscriptionID string) (bool, error)
CheckSubnetContainsIPE checks if the Private IP is contined in the Subnet Address Range.
func DiskExists ¶
func DiskExists(t testing.TestingT, diskName string, resGroupName string, subscriptionID string) bool
DiskExists indicates whether the specified Azure Managed Disk exists This function would fail the test if there is an error.
func DiskExistsE ¶
DiskExistsE indicates whether the specified Azure Managed Disk exists
func GetActionGroupResource ¶
func GetActionGroupResource(t *testing.T, ruleName string, resGroupName string, subscriptionID string) *insights.ActionGroupResource
GetActionGroupResource gets the ActionGroupResource. ruleName - required to find the ActionGroupResource. resGroupName - use an empty string if you have the AZURE_RES_GROUP_NAME environment variable set subscriptionId - use an empty string if you have the ARM_SUBSCRIPTION_ID environment variable set
func GetActionGroupResourceE ¶
func GetActionGroupResourceE(ruleName string, resGroupName string, subscriptionID string) (*insights.ActionGroupResource, error)
GetActionGroupResourceE gets the ActionGroupResource with Error details on error. ruleName - required to find the ActionGroupResource. resGroupName - use an empty string if you have the AZURE_RES_GROUP_NAME environment variable set subscriptionId - use an empty string if you have the ARM_SUBSCRIPTION_ID environment variable set
func GetAllAzureRegions ¶
GetAllAzureRegions gets the list of Azure regions available in this subscription.
func GetAllAzureRegionsE ¶
GetAllAzureRegionsE gets the list of Azure regions available in this subscription
func GetAvailabilitySetClientE ¶
func GetAvailabilitySetClientE(subscriptionID string) (*compute.AvailabilitySetsClient, error)
GetAvailabilitySetClientE gets a new Availability Set client in the specified Azure Subscription
func GetAvailabilitySetE ¶
func GetAvailabilitySetE(t testing.TestingT, avsName string, resGroupName string, subscriptionID string) (*compute.AvailabilitySet, error)
GetAvailabilitySetE gets an Availability Set in the specified Azure Resource Group
func GetAvailabilitySetFaultDomainCount ¶
func GetAvailabilitySetFaultDomainCount(t testing.TestingT, avsName string, resGroupName string, subscriptionID string) int32
GetAvailabilitySetFaultDomainCount gets the Fault Domain Count for the specified Azure Availability Set. This function would fail the test if there is an error.
func GetAvailabilitySetFaultDomainCountE ¶
func GetAvailabilitySetFaultDomainCountE(t testing.TestingT, avsName string, resGroupName string, subscriptionID string) (int32, error)
GetAvailabilitySetFaultDomainCountE gets the Fault Domain Count for the specified Azure Availability Set
func GetAvailabilitySetVMNamesInCaps ¶
func GetAvailabilitySetVMNamesInCaps(t testing.TestingT, avsName string, resGroupName string, subscriptionID string) []string
GetAvailabilitySetVMNamesInCaps gets a list of VM names in the specified Azure Availability Set. This function would fail the test if there is an error.
func GetAvailabilitySetVMNamesInCapsE ¶
func GetAvailabilitySetVMNamesInCapsE(t testing.TestingT, avsName string, resGroupName string, subscriptionID string) ([]string, error)
GetAvailabilitySetVMNamesInCapsE gets a list of VM names in the specified Azure Availability Set
func GetCustomNsgRulesClient ¶
func GetCustomNsgRulesClient(t *testing.T, subscriptionID string) network.SecurityRulesClient
GetCustomNsgRulesClient returns a rules client which can be used to read the list of *custom* security rules defined on an network security group. Note that the "custom" rules are those defined by end users. This function would fail the test if there is an error.
func GetCustomNsgRulesClientE ¶
func GetCustomNsgRulesClientE(subscriptionID string) (network.SecurityRulesClient, error)
GetCustomNsgRulesClientE returns a rules client which can be used to read the list of *custom* security rules defined on an network security group. Note that the "custom" rules are those defined by end users.
func GetDatabaseClient ¶
func GetDatabaseClient(subscriptionID string) (*sql.DatabasesClient, error)
GetDatabaseClient is a helper function that will setup a sql DB client
func GetDefaultNsgRulesClient ¶
func GetDefaultNsgRulesClient(t *testing.T, subscriptionID string) network.DefaultSecurityRulesClient
GetDefaultNsgRulesClient returns a rules client which can be used to read the list of *default* security rules defined on an network security group. Note that the "default" rules are those provided implicitly by the Azure platform. This function would fail the test if there is an error.
func GetDefaultNsgRulesClientE ¶
func GetDefaultNsgRulesClientE(subscriptionID string) (network.DefaultSecurityRulesClient, error)
GetDefaultNsgRulesClientE returns a rules client which can be used to read the list of *default* security rules defined on an network security group. Note that the "default" rules are those provided implicitly by the Azure platform.
func GetDisk ¶
func GetDisk(t testing.TestingT, diskName string, resGroupName string, subscriptionID string) *compute.Disk
GetDisk returns a Disk in the specified Azure Resource Group This function would fail the test if there is an error.
func GetDiskClientE ¶
func GetDiskClientE(subscriptionID string) (*compute.DisksClient, error)
GetDiskClientE returns a new Disk client in the specified Azure Subscription
func GetIPOfPublicIPAddressByName ¶
func GetIPOfPublicIPAddressByName(t testing.TestingT, publicAddressName string, resGroupName string, subscriptionID string) string
GetIPOfPublicIPAddressByName gets the Public IP of the Public IP Address specified. This function would fail the test if there is an error.
func GetIPOfPublicIPAddressByNameE ¶
func GetIPOfPublicIPAddressByNameE(publicAddressName string, resGroupName string, subscriptionID string) (string, error)
GetIPOfPublicIPAddressByNameE gets the Public IP of the Public IP Address specified.
func GetManagedClusterE ¶
func GetManagedClusterE(t testing.TestingT, resourceGroupName, clusterName, subscriptionID string) (*containerservice.ManagedCluster, error)
GetManagedClusterE will return ManagedCluster
func GetManagedClustersClientE ¶
func GetManagedClustersClientE(subscriptionID string) (*containerservice.ManagedClustersClient, error)
GetManagedClustersClientE is a helper function that will setup an Azure ManagedClusters client on your behalf
func GetNameFromResourceID ¶
GetNameFromResourceID gets the Name from an Azure Resource ID.
func GetNameFromResourceIDE ¶
GetNameFromResourceIDE gets the Name from an Azure Resource ID. This function would fail the test if there is an error.
func GetNetworkInterfaceClientE ¶
func GetNetworkInterfaceClientE(subscriptionID string) (*network.InterfacesClient, error)
GetNetworkInterfaceClientE creates a new Network Interface client in the specified Azure Subscription.
func GetNetworkInterfaceConfigurationClientE ¶
func GetNetworkInterfaceConfigurationClientE(subscriptionID string) (*network.InterfaceIPConfigurationsClient, error)
GetNetworkInterfaceConfigurationClientE creates a new Network Interface Configuration client in the specified Azure Subscription.
func GetNetworkInterfaceConfigurationE ¶
func GetNetworkInterfaceConfigurationE(nicName string, nicConfigName string, resGroupName string, subscriptionID string) (*network.InterfaceIPConfiguration, error)
GetNetworkInterfaceConfigurationE gets a Network Interface Configuration in the specified Azure Resource Group.
func GetNetworkInterfaceE ¶
func GetNetworkInterfaceE(nicName string, resGroupName string, subscriptionID string) (*network.Interface, error)
GetNetworkInterfaceE gets a Network Interface in the specified Azure Resource Group.
func GetNetworkInterfacePrivateIPs ¶
func GetNetworkInterfacePrivateIPs(t testing.TestingT, nicName string, resGroupName string, subscriptionID string) []string
GetNetworkInterfacePrivateIPs gets a list of the Private IPs of a Network Interface configs. This function would fail the test if there is an error.
func GetNetworkInterfacePrivateIPsE ¶
func GetNetworkInterfacePrivateIPsE(nicName string, resGroupName string, subscriptionID string) ([]string, error)
GetNetworkInterfacePrivateIPsE gets a list of the Private IPs of a Network Interface configs.
func GetNetworkInterfacePublicIPs ¶
func GetNetworkInterfacePublicIPs(t testing.TestingT, nicName string, resGroupName string, subscriptionID string) []string
GetNetworkInterfacePublicIPs returns a list of all the Public IPs found in the Network Interface configurations. This function would fail the test if there is an error.
func GetNetworkInterfacePublicIPsE ¶
func GetNetworkInterfacePublicIPsE(nicName string, resGroupName string, subscriptionID string) ([]string, error)
GetNetworkInterfacePublicIPsE returns a list of all the Public IPs found in the Network Interface configurations.
func GetPublicIPAddressClientE ¶
func GetPublicIPAddressClientE(subscriptionID string) (*network.PublicIPAddressesClient, error)
GetPublicIPAddressClientE creates a Public IP Addresses client in the specified Azure Subscription.
func GetPublicIPAddressE ¶
func GetPublicIPAddressE(publicIPAddressName string, resGroupName string, subscriptionID string) (*network.PublicIPAddress, error)
GetPublicIPAddressE gets a Public IP Addresses in the specified Azure Resource Group.
func GetRandomRegion ¶
func GetRandomRegion(t testing.TestingT, approvedRegions []string, forbiddenRegions []string, subscriptionID string) string
GetRandomRegion gets a randomly chosen Azure region. If approvedRegions is not empty, this will be a region from the approvedRegions list; otherwise, this method will fetch the latest list of regions from the Azure APIs and pick one of those. If forbiddenRegions is not empty, this method will make sure the returned region is not in the forbiddenRegions list.
func GetRandomRegionE ¶
func GetRandomRegionE(t testing.TestingT, approvedRegions []string, forbiddenRegions []string, subscriptionID string) (string, error)
GetRandomRegionE gets a randomly chosen Azure region. If approvedRegions is not empty, this will be a region from the approvedRegions list; otherwise, this method will fetch the latest list of regions from the Azure APIs and pick one of those. If forbiddenRegions is not empty, this method will make sure the returned region is not in the forbiddenRegions list
func GetRandomStableRegion ¶
func GetRandomStableRegion(t testing.TestingT, approvedRegions []string, forbiddenRegions []string, subscriptionID string) string
GetRandomStableRegion gets a randomly chosen Azure region that is considered stable. Like GetRandomRegion, you can further restrict the stable region list using approvedRegions and forbiddenRegions. We consider stable regions to be those that have been around for at least 1 year. Note that regions in the approvedRegions list that are not considered stable are ignored.
func GetResourceGroupClientE ¶
func GetResourceGroupClientE(subscriptionID string) (*resources.GroupsClient, error)
GetResourceGroupClientE gets a resource group client in a subscription
func GetResourceGroupE ¶
GetResourceGroupE gets a resource group within a subscription
func GetSQLDatabase ¶
func GetSQLDatabase(t testing.TestingT, resGroupName string, serverName string, dbName string, subscriptionID string) *sql.Database
GetSQLDatabase is a helper function that gets the sql db. This function would fail the test if there is an error.
func GetSQLDatabaseE ¶
func GetSQLDatabaseE(t testing.TestingT, subscriptionID string, resGroupName string, serverName string, dbName string) (*sql.Database, error)
GetSQLDatabaseE is a helper function that gets the sql db.
func GetSQLServer ¶
func GetSQLServer(t testing.TestingT, resGroupName string, serverName string, subscriptionID string) *sql.Server
GetSQLServer is a helper function that gets the sql server object. This function would fail the test if there is an error.
func GetSQLServerClient ¶
func GetSQLServerClient(subscriptionID string) (*sql.ServersClient, error)
GetSQLServerClient is a helper function that will setup a sql server client
func GetSQLServerE ¶
func GetSQLServerE(t testing.TestingT, subscriptionID string, resGroupName string, serverName string) (*sql.Server, error)
GetSQLServerE is a helper function that gets the sql server object.
func GetSizeOfVirtualMachine ¶
func GetSizeOfVirtualMachine(t testing.TestingT, vmName string, resGroupName string, subscriptionID string) compute.VirtualMachineSizeTypes
GetSizeOfVirtualMachine gets the Size Type of the specified Azure Virtual Machine. This function would fail the test if there is an error.
func GetSizeOfVirtualMachineE ¶
func GetSizeOfVirtualMachineE(vmName string, resGroupName string, subscriptionID string) (compute.VirtualMachineSizeTypes, error)
GetSizeOfVirtualMachineE gets the Size Type of the specified Azure Virtual Machine.
func GetSubnetClientE ¶
func GetSubnetClientE(subscriptionID string) (*network.SubnetsClient, error)
GetSubnetClientE creates a subnet client.
func GetSubnetE ¶
func GetSubnetE(subnetName string, vnetName string, resGroupName string, subscriptionID string) (*network.Subnet, error)
GetSubnetE gets a subnet.
func GetSubscriptionClient ¶
func GetSubscriptionClient() (*subscriptions.Client, error)
GetSubscriptionClient is a helper function that will setup an Azure Subscription client on your behalf
func GetTargetAzureResourceGroupName ¶
GetTargetAzureResourceGroupName is a helper function to find the correct target Azure Resource Group name, with provided arguments taking precedence over environment variables
func GetTargetAzureSubscription ¶
GetTargetAzureSubscription is a helper function to find the correct target Azure Subscription ID, with provided arguments taking precedence over environment variables
func GetVirtualMachine ¶
func GetVirtualMachine(t testing.TestingT, vmName string, resGroupName string, subscriptionID string) *compute.VirtualMachine
GetVirtualMachine gets a Virtual Machine in the specified Azure Resource Group. This function would fail the test if there is an error.
func GetVirtualMachineAvailabilitySetID ¶
func GetVirtualMachineAvailabilitySetID(t testing.TestingT, vmName string, resGroupName string, subscriptionID string) string
GetVirtualMachineAvailabilitySetID gets the Availability Set ID of the specified Azure Virtual Machine. This function would fail the test if there is an error.
func GetVirtualMachineAvailabilitySetIDE ¶
func GetVirtualMachineAvailabilitySetIDE(vmName string, resGroupName string, subscriptionID string) (string, error)
GetVirtualMachineAvailabilitySetIDE gets the Availability Set ID of the specified Azure Virtual Machine.
func GetVirtualMachineClientE ¶
func GetVirtualMachineClientE(subscriptionID string) (*compute.VirtualMachinesClient, error)
GetVirtualMachineClientE creates a Azure Virtual Machine client in the specified Azure Subscription.
func GetVirtualMachineE ¶
func GetVirtualMachineE(vmName string, resGroupName string, subscriptionID string) (*compute.VirtualMachine, error)
GetVirtualMachineE gets a Virtual Machine in the specified Azure Resource Group.
func GetVirtualMachineManagedDisks ¶
func GetVirtualMachineManagedDisks(t testing.TestingT, vmName string, resGroupName string, subscriptionID string) []string
GetVirtualMachineManagedDisks gets the list of Managed Disk names of the specified Azure Virtual Machine. This function would fail the test if there is an error.
func GetVirtualMachineManagedDisksE ¶
func GetVirtualMachineManagedDisksE(vmName string, resGroupName string, subscriptionID string) ([]string, error)
GetVirtualMachineManagedDisksE gets the list of Managed Disk names of the specified Azure Virtual Machine.
func GetVirtualMachineNics ¶
func GetVirtualMachineNics(t testing.TestingT, vmName string, resGroupName string, subscriptionID string) []string
GetVirtualMachineNics gets a list of Network Interface names for a specifcied Azure Virtual Machine. This function would fail the test if there is an error.
func GetVirtualMachineNicsE ¶
func GetVirtualMachineNicsE(vmName string, resGroupName string, subscriptionID string) ([]string, error)
GetVirtualMachineNicsE gets a list of Network Interface names for a specified Azure Virtual Machine.
func GetVirtualMachineOSDiskName ¶
func GetVirtualMachineOSDiskName(t testing.TestingT, vmName string, resGroupName string, subscriptionID string) string
GetVirtualMachineOSDiskName gets the OS Disk name of the specified Azure Virtual Machine. This function would fail the test if there is an error.
func GetVirtualMachineOSDiskNameE ¶
func GetVirtualMachineOSDiskNameE(vmName string, resGroupName string, subscriptionID string) (string, error)
GetVirtualMachineOSDiskNameE gets the OS Disk name of the specified Azure Virtual Machine.
func GetVirtualMachineTags ¶
func GetVirtualMachineTags(t testing.TestingT, vmName string, resGroupName string, subscriptionID string) map[string]string
GetVirtualMachineTags gets the Tags of the specified Virtual Machine as a map. This function would fail the test if there is an error.
func GetVirtualMachineTagsE ¶
func GetVirtualMachineTagsE(vmName string, resGroupName string, subscriptionID string) (map[string]string, error)
GetVirtualMachineTagsE gets the Tags of the specified Virtual Machine as a map.
func GetVirtualMachinesForResourceGroup ¶
func GetVirtualMachinesForResourceGroup(t testing.TestingT, resGroupName string, subscriptionID string) map[string]compute.VirtualMachineProperties
GetVirtualMachinesForResourceGroup gets all Virtual Machine objects in the specified Resource Group. Each VM Object represents the entire set of VM compute properties accessible by using the VM name as the map key. This function would fail the test if there is an error.
func GetVirtualMachinesForResourceGroupE ¶
func GetVirtualMachinesForResourceGroupE(resourceGroupName string, subscriptionID string) (map[string]compute.VirtualMachineProperties, error)
GetVirtualMachinesForResourceGroupE gets all Virtual Machine objects in the specified Resource Group. Each VM Object represents the entire set of VM compute properties accessible by using the VM name as the map key.
func GetVirtualNetworkDNSServerIPs ¶
func GetVirtualNetworkDNSServerIPs(t testing.TestingT, vnetName string, resGroupName string, subscriptionID string) []string
GetVirtualNetworkDNSServerIPs gets a list of all Virtual Network DNS server IPs. This function would fail the test if there is an error.
func GetVirtualNetworkDNSServerIPsE ¶
func GetVirtualNetworkDNSServerIPsE(vnetName string, resGroupName string, subscriptionID string) ([]string, error)
GetVirtualNetworkDNSServerIPsE gets a list of all Virtual Network DNS server IPs with Error.
func GetVirtualNetworkE ¶
func GetVirtualNetworkE(vnetName string, resGroupName string, subscriptionID string) (*network.VirtualNetwork, error)
GetVirtualNetworkE gets Virtual Network in the specified Azure Resource Group.
func GetVirtualNetworkSubnets ¶
func GetVirtualNetworkSubnets(t testing.TestingT, vnetName string, resGroupName string, subscriptionID string) map[string]string
GetVirtualNetworkSubnets gets all Subnet names and their respective address prefixes in the specified Virtual Network. This function would fail the test if there is an error.
func GetVirtualNetworkSubnetsE ¶
func GetVirtualNetworkSubnetsE(vnetName string, resGroupName string, subscriptionID string) (map[string]string, error)
GetVirtualNetworkSubnetsE gets all Subnet names and their respective address prefixes in the specified Virtual Network. Returning both the name and prefix together helps reduce calls for these frequently accessed properties.
func GetVirtualNetworksClientE ¶
func GetVirtualNetworksClientE(subscriptionID string) (*network.VirtualNetworksClient, error)
GetVirtualNetworksClientE creates a virtual network client in the specified Azure Subscription.
func ListSQLServerDatabases ¶
func ListSQLServerDatabases(t testing.TestingT, resGroupName string, serverName string, subscriptionID string) *[]sql.Database
ListSQLServerDatabases is a helper function that gets a list of databases on a sql server
func ListSQLServerDatabasesE ¶
func ListSQLServerDatabasesE(t testing.TestingT, resGroupName string, serverName string, subscriptionID string) (*[]sql.Database, error)
ListSQLServerDatabasesE is a helper function that gets a list of databases on a sql server
func ListVirtualMachinesForResourceGroup ¶
func ListVirtualMachinesForResourceGroup(t testing.TestingT, resGroupName string, subscriptionID string) []string
ListVirtualMachinesForResourceGroup gets a list of all Virtual Machine names in the specified Resource Group. This function would fail the test if there is an error.
func ListVirtualMachinesForResourceGroupE ¶
func ListVirtualMachinesForResourceGroupE(resourceGroupName string, subscriptionID string) ([]string, error)
ListVirtualMachinesForResourceGroupE gets a list of all Virtual Machine names in the specified Resource Group.
func NetworkInterfaceExists ¶
func NetworkInterfaceExists(t testing.TestingT, nicName string, resGroupName string, subscriptionID string) bool
NetworkInterfaceExists indicates whether the specified Azure Network Interface exists. This function would fail the test if there is an error.
func NetworkInterfaceExistsE ¶
func NetworkInterfaceExistsE(nicName string, resGroupName string, subscriptionID string) (bool, error)
NetworkInterfaceExistsE indicates whether the specified Azure Network Interface exists.
func NewAuthorizer ¶
func NewAuthorizer() (*autorest.Authorizer, error)
NewAuthorizer creates an Azure authorizer adhering to standard auth mechanisms provided by the Azure Go SDK See Azure Go Auth docs here: https://docs.microsoft.com/en-us/go/azure/azure-sdk-go-authorization
func PublicAddressExists ¶
func PublicAddressExists(t testing.TestingT, publicAddressName string, resGroupName string, subscriptionID string) bool
PublicAddressExists indicates whether the specified AzurePublic Address exists. This function would fail the test if there is an error.
func PublicAddressExistsE ¶
func PublicAddressExistsE(publicAddressName string, resGroupName string, subscriptionID string) (bool, error)
PublicAddressExistsE indicates whether the specified AzurePublic Address exists.
func ResourceGroupExists ¶
ResourceGroupExists indicates whether a resource group exists within a subscription; otherwise false This function would fail the test if there is an error.
func ResourceGroupExistsE ¶
ResourceGroupExistsE indicates whether a resource group exists within a subscription
func ResourceNotFoundErrorExists ¶
ResourceNotFoundErrorExists checks the Service Error Code for the 'Resource Not Found' error
func SubnetExists ¶
func SubnetExists(t testing.TestingT, subnetName string, vnetName string, resGroupName string, subscriptionID string) bool
SubnetExists indicates whether the specified Azure Virtual Network Subnet exists. This function would fail the test if there is an error.
func SubnetExistsE ¶
func SubnetExistsE(subnetName string, vnetName string, resGroupName string, subscriptionID string) (bool, error)
SubnetExistsE indicates whether the specified Azure Virtual Network Subnet exists.
func VirtualMachineExists ¶
func VirtualMachineExists(t testing.TestingT, vmName string, resGroupName string, subscriptionID string) bool
VirtualMachineExists indicates whether the specifcied Azure Virtual Machine exists. This function would fail the test if there is an error.
func VirtualMachineExistsE ¶
VirtualMachineExistsE indicates whether the specifcied Azure Virtual Machine exists.
Types ¶
type FailedToParseError ¶
type FailedToParseError struct {
// contains filtered or unexported fields
}
FailedToParseError is returned when an object cannot be parsed
func NewFailedToParseError ¶
func NewFailedToParseError(objectType string, objectID string) FailedToParseError
NewFailedToParseError creates a new not found error when an expected object is not found in the search space
func (FailedToParseError) Error ¶
func (err FailedToParseError) Error() string
type Instance ¶
type Instance struct {
*compute.VirtualMachine
}
Instance of the VM
func (*Instance) GetVirtualMachineInstanceSize ¶
func (vm *Instance) GetVirtualMachineInstanceSize() compute.VirtualMachineSizeTypes
GetVirtualMachineInstanceSize gets the size of the Virtual Machine.
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError is returned when an expected object is not found in the search spa
func NewNotFoundError ¶
func NewNotFoundError(objectType string, objectID string, region string) NotFoundError
NewNotFoundError creates a new not found error when an expected object is not found in the search space
func (NotFoundError) Error ¶
func (err NotFoundError) Error() string
type NsgRuleSummary ¶
type NsgRuleSummary struct { Name string Description string Protocol string SourcePortRange string DestinationPortRange string SourceAddressPrefix string DestinationAddressPrefix string Access string Priority int32 Direction string }
NsgRuleSummary is a string-based (non-pointer) summary of an NSG rule with several helper methods attached to help with verification of rule configuratoin.
func (*NsgRuleSummary) AllowsDestinationPort ¶
func (summarizedRule *NsgRuleSummary) AllowsDestinationPort(t *testing.T, port string) bool
AllowsDestinationPort checks to see if the rule allows a specific destination port. This is helpful when verifying that a given rule is configured properly for a given port.
func (*NsgRuleSummary) AllowsSourcePort ¶
func (summarizedRule *NsgRuleSummary) AllowsSourcePort(t *testing.T, port string) bool
AllowsSourcePort checks to see if the rule allows a specific source port. This is helpful when verifying that a given rule is configured properly for a given port.
type NsgRuleSummaryList ¶
type NsgRuleSummaryList struct {
SummarizedRules []NsgRuleSummary
}
NsgRuleSummaryList holds a colleciton of NsgRuleSummary rules
func GetAllNSGRules ¶
func GetAllNSGRules(t *testing.T, resourceGroupName, nsgName, subscriptionID string) NsgRuleSummaryList
GetAllNSGRules returns an NsgRuleSummaryList instance containing the combined "default" and "custom" rules from a network security group. This function would fail the test if there is an error.
func GetAllNSGRulesE ¶
func GetAllNSGRulesE(resourceGroupName, nsgName, subscriptionID string) (NsgRuleSummaryList, error)
GetAllNSGRulesE returns an NsgRuleSummaryList instance containing the combined "default" and "custom" rules from a network security group.
func (*NsgRuleSummaryList) FindRuleByName ¶
func (summarizedRules *NsgRuleSummaryList) FindRuleByName(name string) NsgRuleSummary
FindRuleByName looks for a matching rule by name within the current collection of rules.
type ResourceGroupNameNotFound ¶
type ResourceGroupNameNotFound struct{}
ResourceGroupNameNotFound is an error that occurs when the target Azure Resource Group name could not be found or was not provided
func (ResourceGroupNameNotFound) Error ¶
func (err ResourceGroupNameNotFound) Error() string
type SubscriptionIDNotFound ¶
type SubscriptionIDNotFound struct{}
SubscriptionIDNotFound is an error that occurs when the Azure Subscription ID could not be found or was not provided
func (SubscriptionIDNotFound) Error ¶
func (err SubscriptionIDNotFound) Error() string
type VMImage ¶
VMImage represents the storage image for the specified Azure Virtual Machine.