@@ -52,6 +52,23 @@ func GetVirtualMachineClientE(subscriptionID string) (*armcompute.VirtualMachine
5252 return GetVirtualMachineClientContextE (context .Background (), subscriptionID )
5353}
5454
55+ // VirtualMachineExists indicates whether the specified Azure Virtual Machine exists.
56+ // This function would fail the test if there is an error.
57+ //
58+ // Deprecated: Use [VirtualMachineExistsContext] instead.
59+ func VirtualMachineExists (t testing.TestingT , vmName string , resGroupName string , subscriptionID string ) bool {
60+ t .Helper ()
61+
62+ return VirtualMachineExistsContext (t , context .Background (), vmName , resGroupName , subscriptionID )
63+ }
64+
65+ // VirtualMachineExistsE indicates whether the specified Azure Virtual Machine exists.
66+ //
67+ // Deprecated: Use [VirtualMachineExistsContextE] instead.
68+ func VirtualMachineExistsE (vmName string , resGroupName string , subscriptionID string ) (bool , error ) {
69+ return VirtualMachineExistsContextE (context .Background (), vmName , resGroupName , subscriptionID )
70+ }
71+
5572// VirtualMachineExistsContext indicates whether the specified Azure Virtual Machine exists.
5673// This function would fail the test if there is an error.
5774// The ctx parameter supports cancellation and timeouts.
@@ -79,6 +96,23 @@ func VirtualMachineExistsContextE(ctx context.Context, vmName string, resGroupNa
7996 return true , nil
8097}
8198
99+ // GetVirtualMachineNics gets a list of Network Interface names for a specified Azure Virtual Machine.
100+ // This function would fail the test if there is an error.
101+ //
102+ // Deprecated: Use [GetVirtualMachineNicsContext] instead.
103+ func GetVirtualMachineNics (t testing.TestingT , vmName string , resGroupName string , subscriptionID string ) []string {
104+ t .Helper ()
105+
106+ return GetVirtualMachineNicsContext (t , context .Background (), vmName , resGroupName , subscriptionID )
107+ }
108+
109+ // GetVirtualMachineNicsE gets a list of Network Interface names for a specified Azure Virtual Machine.
110+ //
111+ // Deprecated: Use [GetVirtualMachineNicsContextE] instead.
112+ func GetVirtualMachineNicsE (vmName string , resGroupName string , subscriptionID string ) ([]string , error ) {
113+ return GetVirtualMachineNicsContextE (context .Background (), vmName , resGroupName , subscriptionID )
114+ }
115+
82116// GetVirtualMachineNicsContext gets a list of Network Interface names for a specified Azure Virtual Machine.
83117// This function would fail the test if there is an error.
84118// The ctx parameter supports cancellation and timeouts.
@@ -124,6 +158,23 @@ func extractVMNics(vm *armcompute.VirtualMachine) ([]string, error) {
124158 return nics , nil
125159}
126160
161+ // GetVirtualMachineManagedDisks gets the list of Managed Disk names of the specified Azure Virtual Machine.
162+ // This function would fail the test if there is an error.
163+ //
164+ // Deprecated: Use [GetVirtualMachineManagedDisksContext] instead.
165+ func GetVirtualMachineManagedDisks (t testing.TestingT , vmName string , resGroupName string , subscriptionID string ) []string {
166+ t .Helper ()
167+
168+ return GetVirtualMachineManagedDisksContext (t , context .Background (), vmName , resGroupName , subscriptionID )
169+ }
170+
171+ // GetVirtualMachineManagedDisksE gets the list of Managed Disk names of the specified Azure Virtual Machine.
172+ //
173+ // Deprecated: Use [GetVirtualMachineManagedDisksContextE] instead.
174+ func GetVirtualMachineManagedDisksE (vmName string , resGroupName string , subscriptionID string ) ([]string , error ) {
175+ return GetVirtualMachineManagedDisksContextE (context .Background (), vmName , resGroupName , subscriptionID )
176+ }
177+
127178// GetVirtualMachineManagedDisksContext gets the list of Managed Disk names of the specified Azure Virtual Machine.
128179// This function would fail the test if there is an error.
129180// The ctx parameter supports cancellation and timeouts.
@@ -159,6 +210,23 @@ func extractVMManagedDisks(vm *armcompute.VirtualMachine) []string {
159210 return diskNames
160211}
161212
213+ // GetVirtualMachineOSDiskName gets the OS Disk name of the specified Azure Virtual Machine.
214+ // This function would fail the test if there is an error.
215+ //
216+ // Deprecated: Use [GetVirtualMachineOSDiskNameContext] instead.
217+ func GetVirtualMachineOSDiskName (t testing.TestingT , vmName string , resGroupName string , subscriptionID string ) string {
218+ t .Helper ()
219+
220+ return GetVirtualMachineOSDiskNameContext (t , context .Background (), vmName , resGroupName , subscriptionID )
221+ }
222+
223+ // GetVirtualMachineOSDiskNameE gets the OS Disk name of the specified Azure Virtual Machine.
224+ //
225+ // Deprecated: Use [GetVirtualMachineOSDiskNameContextE] instead.
226+ func GetVirtualMachineOSDiskNameE (vmName string , resGroupName string , subscriptionID string ) (string , error ) {
227+ return GetVirtualMachineOSDiskNameContextE (context .Background (), vmName , resGroupName , subscriptionID )
228+ }
229+
162230// GetVirtualMachineOSDiskNameContext gets the OS Disk name of the specified Azure Virtual Machine.
163231// This function would fail the test if there is an error.
164232// The ctx parameter supports cancellation and timeouts.
@@ -187,6 +255,23 @@ func extractVMOSDiskName(vm *armcompute.VirtualMachine) string {
187255 return * vm .Properties .StorageProfile .OSDisk .Name
188256}
189257
258+ // GetVirtualMachineAvailabilitySetID gets the Availability Set ID of the specified Azure Virtual Machine.
259+ // This function would fail the test if there is an error.
260+ //
261+ // Deprecated: Use [GetVirtualMachineAvailabilitySetIDContext] instead.
262+ func GetVirtualMachineAvailabilitySetID (t testing.TestingT , vmName string , resGroupName string , subscriptionID string ) string {
263+ t .Helper ()
264+
265+ return GetVirtualMachineAvailabilitySetIDContext (t , context .Background (), vmName , resGroupName , subscriptionID )
266+ }
267+
268+ // GetVirtualMachineAvailabilitySetIDE gets the Availability Set ID of the specified Azure Virtual Machine.
269+ //
270+ // Deprecated: Use [GetVirtualMachineAvailabilitySetIDContextE] instead.
271+ func GetVirtualMachineAvailabilitySetIDE (vmName string , resGroupName string , subscriptionID string ) (string , error ) {
272+ return GetVirtualMachineAvailabilitySetIDContextE (context .Background (), vmName , resGroupName , subscriptionID )
273+ }
274+
190275// GetVirtualMachineAvailabilitySetIDContext gets the Availability Set ID of the specified Azure Virtual Machine.
191276// This function would fail the test if there is an error.
192277// The ctx parameter supports cancellation and timeouts.
@@ -232,6 +317,23 @@ type VMImage struct {
232317 Version string
233318}
234319
320+ // GetVirtualMachineImage gets the Image of the specified Azure Virtual Machine.
321+ // This function would fail the test if there is an error.
322+ //
323+ // Deprecated: Use [GetVirtualMachineImageContext] instead.
324+ func GetVirtualMachineImage (t testing.TestingT , vmName string , resGroupName string , subscriptionID string ) VMImage {
325+ t .Helper ()
326+
327+ return GetVirtualMachineImageContext (t , context .Background (), vmName , resGroupName , subscriptionID )
328+ }
329+
330+ // GetVirtualMachineImageE gets the Image of the specified Azure Virtual Machine.
331+ //
332+ // Deprecated: Use [GetVirtualMachineImageContextE] instead.
333+ func GetVirtualMachineImageE (vmName string , resGroupName string , subscriptionID string ) (VMImage , error ) {
334+ return GetVirtualMachineImageContextE (context .Background (), vmName , resGroupName , subscriptionID )
335+ }
336+
235337// GetVirtualMachineImageContext gets the Image of the specified Azure Virtual Machine.
236338// This function would fail the test if there is an error.
237339// The ctx parameter supports cancellation and timeouts.
@@ -281,6 +383,23 @@ func extractVMImage(vm *armcompute.VirtualMachine) VMImage {
281383 return img
282384}
283385
386+ // GetSizeOfVirtualMachine gets the Size Type of the specified Azure Virtual Machine.
387+ // This function would fail the test if there is an error.
388+ //
389+ // Deprecated: Use [GetSizeOfVirtualMachineContext] instead.
390+ func GetSizeOfVirtualMachine (t testing.TestingT , vmName string , resGroupName string , subscriptionID string ) armcompute.VirtualMachineSizeTypes {
391+ t .Helper ()
392+
393+ return GetSizeOfVirtualMachineContext (t , context .Background (), vmName , resGroupName , subscriptionID )
394+ }
395+
396+ // GetSizeOfVirtualMachineE gets the Size Type of the specified Azure Virtual Machine.
397+ //
398+ // Deprecated: Use [GetSizeOfVirtualMachineContextE] instead.
399+ func GetSizeOfVirtualMachineE (vmName string , resGroupName string , subscriptionID string ) (armcompute.VirtualMachineSizeTypes , error ) {
400+ return GetSizeOfVirtualMachineContextE (context .Background (), vmName , resGroupName , subscriptionID )
401+ }
402+
284403// GetSizeOfVirtualMachineContext gets the Size Type of the specified Azure Virtual Machine.
285404// This function would fail the test if there is an error.
286405// The ctx parameter supports cancellation and timeouts.
@@ -309,6 +428,23 @@ func extractVMSize(vm *armcompute.VirtualMachine) armcompute.VirtualMachineSizeT
309428 return * vm .Properties .HardwareProfile .VMSize
310429}
311430
431+ // GetVirtualMachineTags gets the Tags of the specified Virtual Machine as a map.
432+ // This function would fail the test if there is an error.
433+ //
434+ // Deprecated: Use [GetVirtualMachineTagsContext] instead.
435+ func GetVirtualMachineTags (t testing.TestingT , vmName string , resGroupName string , subscriptionID string ) map [string ]string {
436+ t .Helper ()
437+
438+ return GetVirtualMachineTagsContext (t , context .Background (), vmName , resGroupName , subscriptionID )
439+ }
440+
441+ // GetVirtualMachineTagsE gets the Tags of the specified Virtual Machine as a map.
442+ //
443+ // Deprecated: Use [GetVirtualMachineTagsContextE] instead.
444+ func GetVirtualMachineTagsE (vmName string , resGroupName string , subscriptionID string ) (map [string ]string , error ) {
445+ return GetVirtualMachineTagsContextE (context .Background (), vmName , resGroupName , subscriptionID )
446+ }
447+
312448// GetVirtualMachineTagsContext gets the Tags of the specified Virtual Machine as a map.
313449// This function would fail the test if there is an error.
314450// The ctx parameter supports cancellation and timeouts.
@@ -351,6 +487,23 @@ func extractVMTags(vm *armcompute.VirtualMachine) map[string]string {
351487// Get multiple Virtual Machines from a Resource Group
352488// ***************************************************** //
353489
490+ // ListVirtualMachinesForResourceGroup gets a list of all Virtual Machine names in the specified Resource Group.
491+ // This function would fail the test if there is an error.
492+ //
493+ // Deprecated: Use [ListVirtualMachinesForResourceGroupContext] instead.
494+ func ListVirtualMachinesForResourceGroup (t testing.TestingT , resGroupName string , subscriptionID string ) []string {
495+ t .Helper ()
496+
497+ return ListVirtualMachinesForResourceGroupContext (t , context .Background (), resGroupName , subscriptionID )
498+ }
499+
500+ // ListVirtualMachinesForResourceGroupE gets a list of all Virtual Machine names in the specified Resource Group.
501+ //
502+ // Deprecated: Use [ListVirtualMachinesForResourceGroupContextE] instead.
503+ func ListVirtualMachinesForResourceGroupE (resGroupName string , subscriptionID string ) ([]string , error ) {
504+ return ListVirtualMachinesForResourceGroupContextE (context .Background (), resGroupName , subscriptionID )
505+ }
506+
354507// ListVirtualMachinesForResourceGroupContext gets a list of all Virtual Machine names in the specified Resource Group.
355508// This function would fail the test if there is an error.
356509// The ctx parameter supports cancellation and timeouts.
@@ -393,6 +546,25 @@ func listVirtualMachineNames(ctx context.Context, client *armcompute.VirtualMach
393546 return vmDetails , nil
394547}
395548
549+ // GetVirtualMachinesForResourceGroup gets all Virtual Machine objects in the specified Resource Group. Each
550+ // VM Object represents the entire set of VM compute properties accessible by using the VM name as the map key.
551+ // This function would fail the test if there is an error.
552+ //
553+ // Deprecated: Use [GetVirtualMachinesForResourceGroupContext] instead.
554+ func GetVirtualMachinesForResourceGroup (t testing.TestingT , resGroupName string , subscriptionID string ) map [string ]armcompute.VirtualMachineProperties {
555+ t .Helper ()
556+
557+ return GetVirtualMachinesForResourceGroupContext (t , context .Background (), resGroupName , subscriptionID )
558+ }
559+
560+ // GetVirtualMachinesForResourceGroupE gets all Virtual Machine objects in the specified Resource Group. Each
561+ // VM Object represents the entire set of VM compute properties accessible by using the VM name as the map key.
562+ //
563+ // Deprecated: Use [GetVirtualMachinesForResourceGroupContextE] instead.
564+ func GetVirtualMachinesForResourceGroupE (resGroupName string , subscriptionID string ) (map [string ]armcompute.VirtualMachineProperties , error ) {
565+ return GetVirtualMachinesForResourceGroupContextE (context .Background (), resGroupName , subscriptionID )
566+ }
567+
396568// GetVirtualMachinesForResourceGroupContext gets all Virtual Machine objects in the specified Resource Group. Each
397569// VM Object represents the entire set of VM compute properties accessible by using the VM name as the map key.
398570// This function would fail the test if there is an error.
@@ -467,6 +639,23 @@ func GetVirtualMachineContext(t testing.TestingT, ctx context.Context, vmName st
467639 return vm
468640}
469641
642+ // GetVirtualMachine gets a Virtual Machine in the specified Azure Resource Group.
643+ // This function would fail the test if there is an error.
644+ //
645+ // Deprecated: Use [GetVirtualMachineContext] instead.
646+ func GetVirtualMachine (t testing.TestingT , vmName string , resGroupName string , subscriptionID string ) * armcompute.VirtualMachine {
647+ t .Helper ()
648+
649+ return GetVirtualMachineContext (t , context .Background (), vmName , resGroupName , subscriptionID )
650+ }
651+
652+ // GetVirtualMachineE gets a Virtual Machine in the specified Azure Resource Group.
653+ //
654+ // Deprecated: Use [GetVirtualMachineContextE] instead.
655+ func GetVirtualMachineE (vmName string , resGroupName string , subscriptionID string ) (* armcompute.VirtualMachine , error ) {
656+ return GetVirtualMachineContextE (context .Background (), vmName , resGroupName , subscriptionID )
657+ }
658+
470659// GetVirtualMachineContextE gets a Virtual Machine in the specified Azure Resource Group.
471660// The ctx parameter supports cancellation and timeouts.
472661func GetVirtualMachineContextE (ctx context.Context , vmName string , resGroupName string , subscriptionID string ) (* armcompute.VirtualMachine , error ) {
0 commit comments