virtualmachine

package
v0.20240208.1160128 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/labservices/2021-10-01-preview/virtualmachine Documentation

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

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/2021-10-01-preview/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
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForProvisioningState

func PossibleValuesForProvisioningState() []string

func PossibleValuesForVirtualMachineState

func PossibleValuesForVirtualMachineState() []string

func PossibleValuesForVirtualMachineType

func PossibleValuesForVirtualMachineType() []string

func ValidateLabID

func ValidateLabID(input interface{}, key string) (warnings []string, errors []error)

ValidateLabID checks that 'input' can be parsed as a Lab ID

func ValidateLabPlanID

func ValidateLabPlanID(input interface{}, key string) (warnings []string, errors []error)

ValidateLabPlanID checks that 'input' can be parsed as a Lab Plan ID

func ValidateVirtualMachineID

func ValidateVirtualMachineID(input interface{}, key string) (warnings []string, errors []error)

ValidateVirtualMachineID checks that 'input' can be parsed as a Virtual Machine ID

Types

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *VirtualMachine
}

type LabId

type LabId struct {
	SubscriptionId    string
	ResourceGroupName string
	LabName           string
}

LabId is a struct representing the Resource ID for a Lab

func NewLabID

func NewLabID(subscriptionId string, resourceGroupName string, labName string) LabId

NewLabID returns a new LabId struct

func ParseLabID

func ParseLabID(input string) (*LabId, error)

ParseLabID parses 'input' into a LabId

func ParseLabIDInsensitively

func ParseLabIDInsensitively(input string) (*LabId, error)

ParseLabIDInsensitively parses 'input' case-insensitively into a LabId note: this method should only be used for API response data and not user input

func (*LabId) FromParseResult

func (id *LabId) FromParseResult(input resourceids.ParseResult) error

func (LabId) ID

func (id LabId) ID() string

ID returns the formatted Lab ID

func (LabId) Segments

func (id LabId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Lab ID

func (LabId) String

func (id LabId) String() string

String returns a human-readable description of this Lab ID

type LabPlanId

type LabPlanId struct {
	SubscriptionId    string
	ResourceGroupName string
	LabPlanName       string
}

LabPlanId is a struct representing the Resource ID for a Lab Plan

func NewLabPlanID

func NewLabPlanID(subscriptionId string, resourceGroupName string, labPlanName string) LabPlanId

NewLabPlanID returns a new LabPlanId struct

func ParseLabPlanID

func ParseLabPlanID(input string) (*LabPlanId, error)

ParseLabPlanID parses 'input' into a LabPlanId

func ParseLabPlanIDInsensitively

func ParseLabPlanIDInsensitively(input string) (*LabPlanId, error)

ParseLabPlanIDInsensitively parses 'input' case-insensitively into a LabPlanId note: this method should only be used for API response data and not user input

func (*LabPlanId) FromParseResult

func (id *LabPlanId) FromParseResult(input resourceids.ParseResult) error

func (LabPlanId) ID

func (id LabPlanId) ID() string

ID returns the formatted Lab Plan ID

func (LabPlanId) Segments

func (id LabPlanId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Lab Plan ID

func (LabPlanId) String

func (id LabPlanId) String() string

String returns a human-readable description of this Lab Plan ID

type LabPlansSaveImageOperationResponse

type LabPlansSaveImageOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

type ListByLabCompleteResult

type ListByLabCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []VirtualMachine
}

type ListByLabOperationResponse

type ListByLabOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]VirtualMachine
}

type ProvisioningState

type ProvisioningState string
const (
	ProvisioningStateCreating  ProvisioningState = "Creating"
	ProvisioningStateDeleting  ProvisioningState = "Deleting"
	ProvisioningStateFailed    ProvisioningState = "Failed"
	ProvisioningStateLocked    ProvisioningState = "Locked"
	ProvisioningStateSucceeded ProvisioningState = "Succeeded"
	ProvisioningStateUpdating  ProvisioningState = "Updating"
)

func (*ProvisioningState) UnmarshalJSON

func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error

type RedeployOperationResponse

type RedeployOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

type ReimageOperationResponse

type ReimageOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

type ResetPasswordBody

type ResetPasswordBody struct {
	Password string `json:"password"`
	Username string `json:"username"`
}

type ResetPasswordOperationResponse

type ResetPasswordOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

type SaveImageBody

type SaveImageBody struct {
	LabVirtualMachineId *string `json:"labVirtualMachineId,omitempty"`
	Name                *string `json:"name,omitempty"`
}

type StartOperationResponse

type StartOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

type StopOperationResponse

type StopOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

type VirtualMachine

type VirtualMachine struct {
	Id         *string                  `json:"id,omitempty"`
	Name       *string                  `json:"name,omitempty"`
	Properties VirtualMachineProperties `json:"properties"`
	SystemData *systemdata.SystemData   `json:"systemData,omitempty"`
	Type       *string                  `json:"type,omitempty"`
}

type VirtualMachineClient

type VirtualMachineClient struct {
	Client *resourcemanager.Client
}

func NewVirtualMachineClientWithBaseURI

func NewVirtualMachineClientWithBaseURI(sdkApi sdkEnv.Api) (*VirtualMachineClient, error)

func (VirtualMachineClient) Get

Get ...

func (VirtualMachineClient) LabPlansSaveImage

func (c VirtualMachineClient) LabPlansSaveImage(ctx context.Context, id LabPlanId, input SaveImageBody) (result LabPlansSaveImageOperationResponse, err error)

LabPlansSaveImage ...

func (VirtualMachineClient) LabPlansSaveImageThenPoll

func (c VirtualMachineClient) LabPlansSaveImageThenPoll(ctx context.Context, id LabPlanId, input SaveImageBody) error

LabPlansSaveImageThenPoll performs LabPlansSaveImage then polls until it's completed

func (VirtualMachineClient) ListByLab

func (c VirtualMachineClient) ListByLab(ctx context.Context, id LabId) (result ListByLabOperationResponse, err error)

ListByLab ...

func (VirtualMachineClient) ListByLabComplete

func (c VirtualMachineClient) ListByLabComplete(ctx context.Context, id LabId) (ListByLabCompleteResult, error)

ListByLabComplete retrieves all the results into a single object

func (VirtualMachineClient) ListByLabCompleteMatchingPredicate

func (c VirtualMachineClient) ListByLabCompleteMatchingPredicate(ctx context.Context, id LabId, predicate VirtualMachineOperationPredicate) (result ListByLabCompleteResult, err error)

ListByLabCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (VirtualMachineClient) Redeploy

Redeploy ...

func (VirtualMachineClient) RedeployThenPoll

func (c VirtualMachineClient) RedeployThenPoll(ctx context.Context, id VirtualMachineId) error

RedeployThenPoll performs Redeploy then polls until it's completed

func (VirtualMachineClient) Reimage

Reimage ...

func (VirtualMachineClient) ReimageThenPoll

func (c VirtualMachineClient) ReimageThenPoll(ctx context.Context, id VirtualMachineId) error

ReimageThenPoll performs Reimage then polls until it's completed

func (VirtualMachineClient) ResetPassword

ResetPassword ...

func (VirtualMachineClient) ResetPasswordThenPoll

func (c VirtualMachineClient) ResetPasswordThenPoll(ctx context.Context, id VirtualMachineId, input ResetPasswordBody) error

ResetPasswordThenPoll performs ResetPassword then polls until it's completed

func (VirtualMachineClient) Start

Start ...

func (VirtualMachineClient) StartThenPoll

func (c VirtualMachineClient) StartThenPoll(ctx context.Context, id VirtualMachineId) error

StartThenPoll performs Start then polls until it's completed

func (VirtualMachineClient) Stop

Stop ...

func (VirtualMachineClient) StopThenPoll

func (c VirtualMachineClient) StopThenPoll(ctx context.Context, id VirtualMachineId) error

StopThenPoll performs Stop then polls until it's completed

type VirtualMachineConnectionProfile

type VirtualMachineConnectionProfile struct {
	AdminUsername    *string `json:"adminUsername,omitempty"`
	NonAdminUsername *string `json:"nonAdminUsername,omitempty"`
	PrivateIPAddress *string `json:"privateIpAddress,omitempty"`
	RdpAuthority     *string `json:"rdpAuthority,omitempty"`
	RdpInBrowserUrl  *string `json:"rdpInBrowserUrl,omitempty"`
	SshAuthority     *string `json:"sshAuthority,omitempty"`
	SshInBrowserUrl  *string `json:"sshInBrowserUrl,omitempty"`
}

type VirtualMachineId

type VirtualMachineId struct {
	SubscriptionId     string
	ResourceGroupName  string
	LabName            string
	VirtualMachineName string
}

VirtualMachineId is a struct representing the Resource ID for a Virtual Machine

func NewVirtualMachineID

func NewVirtualMachineID(subscriptionId string, resourceGroupName string, labName string, virtualMachineName string) VirtualMachineId

NewVirtualMachineID returns a new VirtualMachineId struct

func ParseVirtualMachineID

func ParseVirtualMachineID(input string) (*VirtualMachineId, error)

ParseVirtualMachineID parses 'input' into a VirtualMachineId

func ParseVirtualMachineIDInsensitively

func ParseVirtualMachineIDInsensitively(input string) (*VirtualMachineId, error)

ParseVirtualMachineIDInsensitively parses 'input' case-insensitively into a VirtualMachineId note: this method should only be used for API response data and not user input

func (*VirtualMachineId) FromParseResult

func (id *VirtualMachineId) FromParseResult(input resourceids.ParseResult) error

func (VirtualMachineId) ID

func (id VirtualMachineId) ID() string

ID returns the formatted Virtual Machine ID

func (VirtualMachineId) Segments

func (id VirtualMachineId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Virtual Machine ID

func (VirtualMachineId) String

func (id VirtualMachineId) String() string

String returns a human-readable description of this Virtual Machine ID

type VirtualMachineOperationPredicate

type VirtualMachineOperationPredicate struct {
	Id   *string
	Name *string
	Type *string
}

func (VirtualMachineOperationPredicate) Matches

type VirtualMachineProperties

type VirtualMachineProperties struct {
	ClaimedByUserId   *string                          `json:"claimedByUserId,omitempty"`
	ConnectionProfile *VirtualMachineConnectionProfile `json:"connectionProfile,omitempty"`
	ProvisioningState *ProvisioningState               `json:"provisioningState,omitempty"`
	State             *VirtualMachineState             `json:"state,omitempty"`
	VMType            *VirtualMachineType              `json:"vmType,omitempty"`
}

type VirtualMachineState

type VirtualMachineState string
const (
	VirtualMachineStateRedeploying       VirtualMachineState = "Redeploying"
	VirtualMachineStateReimaging         VirtualMachineState = "Reimaging"
	VirtualMachineStateResettingPassword VirtualMachineState = "ResettingPassword"
	VirtualMachineStateRunning           VirtualMachineState = "Running"
	VirtualMachineStateStarting          VirtualMachineState = "Starting"
	VirtualMachineStateStopped           VirtualMachineState = "Stopped"
	VirtualMachineStateStopping          VirtualMachineState = "Stopping"
)

func (*VirtualMachineState) UnmarshalJSON

func (s *VirtualMachineState) UnmarshalJSON(bytes []byte) error

type VirtualMachineType

type VirtualMachineType string
const (
	VirtualMachineTypeTemplate VirtualMachineType = "Template"
	VirtualMachineTypeUser     VirtualMachineType = "User"
)

func (*VirtualMachineType) UnmarshalJSON

func (s *VirtualMachineType) UnmarshalJSON(bytes []byte) error

Jump to

Keyboard shortcuts

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