func (c *Client) listVM(ctx context.Context, resourceGroupName string) ([]compute.VirtualMachine, *retry.Error) {
	resourceID := fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/virtualMachines",
		autorest.Encode("path", c.subscriptionID),
		autorest.Encode("path", resourceGroupName),
	)

	result := make([]compute.VirtualMachine, 0)
	page := &VirtualMachineListResultPage{}
	page.fn = c.listNextResults

	resp, rerr := c.armClient.GetResource(ctx, resourceID, "")
	defer c.armClient.CloseResponse(ctx, resp)
	if rerr != nil {
		klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "vm.list.request", resourceID, rerr.Error())
		return result, rerr
	}

	var err error
	page.vmlr, err = c.listResponder(resp)
	if err != nil {
		klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "vm.list.respond", resourceID, err)
		return result, retry.GetError(resp, err)
	}

	for page.NotDone() {
		result = append(result, *page.Response().Value...)
		if err = page.NextWithContext(ctx); err != nil {
			klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "vm.list.next", resourceID, err)
			return result, retry.GetError(page.Response().Response.Response, err)
		}
	}

	return result, nil
}
// listVM gets a list of VirtualMachines in the resourceGroupName.
listVM gets a list of VirtualMachines in the resourceGroupName.
// listVM gets a list of VirtualMachines in the resourceGroupName .
func (c *Client) listVM(ctx context.Context, resourceGroupName string) ([]compute.VirtualMachine, *retry.Error) {
	resourceID := fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/virtualMachines",
		autorest.Encode("path", c.subscriptionID),
		autorest.Encode("path", resourceGroupName),
	)
	result := make([]compute.VirtualMachine, 0)
	page := &VirtualMachineListResultPage{}
	page.fn = c.listNextResults
	resp, rerr := c.armClient.GetResource(ctx, resourceID, "")
	defer c.armClient.CloseResponse(ctx, resp)
	if rerr != nil {
		klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "vm.list.request", resourceID, rerr.Error())
		return result, rerr
	}
	var err error
	page.vmlr, err = c.listResponder(resp)
	if err != nil {
		klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "vm.list.respond", resourceID, err)
		return result, retry.GetError(resp, err)
	}
	for page.NotDone() {
		result = append(result, *page.Response().Value...)
		if err = page.NextWithContext(ctx); err != nil {
			klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "vm.list.next", resourceID, err)
			return result, retry.GetError(page.Response().Response.Response, err)
		}
	}
	return result, nil
}
func ( c * Client ) listVM ( ctx context . Context , resourceGroupName string ) ( [ ] compute . VirtualMachine , * retry . Error ) { resourceID := fmt . Sprintf ( " " , autorest . Encode ( " " , c . subscriptionID ) , autorest . Encode ( " " , resourceGroupName ) , ) result := make ( [ ] compute . VirtualMachine , 0 ) page := & VirtualMachineListResultPage { } page . fn = c . listNextResults resp , rerr := c . armClient . GetResource ( ctx , resourceID , " " ) defer c . armClient . CloseResponse ( ctx , resp ) if rerr != nil { klog . V ( 5 ) . Infof ( " " , " " , resourceID , rerr . Error ( ) ) return result , rerr } var err error page . vmlr , err = c . listResponder ( resp ) if err != nil { klog . V ( 5 ) . Infof ( " " , " " , resourceID , err ) return result , retry . GetError ( resp , err ) } for page . NotDone ( ) { result = append ( result , * page . Response ( ) . Value ... ) if err = page . NextWithContext ( ctx ) ; err != nil { klog . V ( 5 ) . Infof ( " " , " " , resourceID , err ) return result , retry . GetError ( page . Response ( ) . Response . Response , err ) } } return result , nil }
listVM gets a list of VirtualMachines in the resourceGroupName.
listVM gets a list of VirtualMachines in the resourceGroupName .