package
0.20240715.1103416
Repository: https://github.com/hashicorp/go-azure-sdk.git
Documentation: pkg.go.dev

# README

github.com/hashicorp/go-azure-sdk/resource-manager/labservices/2022-08-01/virtualmachine Documentation

The virtualmachine SDK allows for interaction with the Azure Resource Manager Service labservices (API Version 2022-08-01).

This readme covers example usages, but further information on using this SDK can be found in the project root.

Import Path

import "github.com/hashicorp/go-azure-sdk/resource-manager/labservices/2022-08-01/virtualmachine"

Client Initialization

client := virtualmachine.NewVirtualMachineClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: VirtualMachineClient.Get

ctx := context.TODO()
id := virtualmachine.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "virtualMachineValue")

read, err := client.Get(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: VirtualMachineClient.LabPlansSaveImage

ctx := context.TODO()
id := virtualmachine.NewLabPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labPlanValue")

payload := virtualmachine.SaveImageBody{
	// ...
}


if err := client.LabPlansSaveImageThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Example Usage: VirtualMachineClient.ListByLab

ctx := context.TODO()
id := virtualmachine.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue")

// alternatively `client.ListByLab(ctx, id)` can be used to do batched pagination
items, err := client.ListByLabComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: VirtualMachineClient.Redeploy

ctx := context.TODO()
id := virtualmachine.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "virtualMachineValue")

if err := client.RedeployThenPoll(ctx, id); err != nil {
	// handle the error
}

Example Usage: VirtualMachineClient.Reimage

ctx := context.TODO()
id := virtualmachine.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "virtualMachineValue")

if err := client.ReimageThenPoll(ctx, id); err != nil {
	// handle the error
}

Example Usage: VirtualMachineClient.ResetPassword

ctx := context.TODO()
id := virtualmachine.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "virtualMachineValue")

payload := virtualmachine.ResetPasswordBody{
	// ...
}


if err := client.ResetPasswordThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Example Usage: VirtualMachineClient.Start

ctx := context.TODO()
id := virtualmachine.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "virtualMachineValue")

if err := client.StartThenPoll(ctx, id); err != nil {
	// handle the error
}

Example Usage: VirtualMachineClient.Stop

ctx := context.TODO()
id := virtualmachine.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "virtualMachineValue")

if err := client.StopThenPoll(ctx, id); err != nil {
	// handle the error
}

# Functions

NewLabID returns a new LabId struct.
NewLabPlanID returns a new LabPlanId struct.
No description provided by the author
NewVirtualMachineID returns a new VirtualMachineId struct.
ParseLabID parses 'input' into a LabId.
ParseLabIDInsensitively parses 'input' case-insensitively into a LabId note: this method should only be used for API response data and not user input.
ParseLabPlanID parses 'input' into a LabPlanId.
ParseLabPlanIDInsensitively parses 'input' case-insensitively into a LabPlanId note: this method should only be used for API response data and not user input.
ParseVirtualMachineID parses 'input' into a VirtualMachineId.
ParseVirtualMachineIDInsensitively parses 'input' case-insensitively into a VirtualMachineId note: this method should only be used for API response data and not user input.
No description provided by the author
No description provided by the author
No description provided by the author
ValidateLabID checks that 'input' can be parsed as a Lab ID.
ValidateLabPlanID checks that 'input' can be parsed as a Lab Plan ID.
ValidateVirtualMachineID checks that 'input' can be parsed as a Virtual Machine ID.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
LabId is a struct representing the Resource ID for a Lab.
LabPlanId is a struct representing the Resource ID for a Lab Plan.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
VirtualMachineId is a struct representing the Resource ID for a Virtual Machine.
No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author
No description provided by the author
No description provided by the author