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 ¶
- func PossibleValuesForProvisioningState() []string
- func PossibleValuesForVirtualMachineState() []string
- func PossibleValuesForVirtualMachineType() []string
- func ValidateLabID(input interface{}, key string) (warnings []string, errors []error)
- func ValidateLabPlanID(input interface{}, key string) (warnings []string, errors []error)
- func ValidateVirtualMachineID(input interface{}, key string) (warnings []string, errors []error)
- type GetOperationResponse
- type LabId
- type LabPlanId
- type LabPlansSaveImageOperationResponse
- type ListByLabCompleteResult
- type ListByLabOperationResponse
- type ProvisioningState
- type RedeployOperationResponse
- type ReimageOperationResponse
- type ResetPasswordBody
- type ResetPasswordOperationResponse
- type SaveImageBody
- type StartOperationResponse
- type StopOperationResponse
- type VirtualMachine
- type VirtualMachineClient
- func (c VirtualMachineClient) Get(ctx context.Context, id VirtualMachineId) (result GetOperationResponse, err error)
- func (c VirtualMachineClient) LabPlansSaveImage(ctx context.Context, id LabPlanId, input SaveImageBody) (result LabPlansSaveImageOperationResponse, err error)
- func (c VirtualMachineClient) LabPlansSaveImageThenPoll(ctx context.Context, id LabPlanId, input SaveImageBody) error
- func (c VirtualMachineClient) ListByLab(ctx context.Context, id LabId) (result ListByLabOperationResponse, err error)
- func (c VirtualMachineClient) ListByLabComplete(ctx context.Context, id LabId) (ListByLabCompleteResult, error)
- func (c VirtualMachineClient) ListByLabCompleteMatchingPredicate(ctx context.Context, id LabId, predicate VirtualMachineOperationPredicate) (result ListByLabCompleteResult, err error)
- func (c VirtualMachineClient) Redeploy(ctx context.Context, id VirtualMachineId) (result RedeployOperationResponse, err error)
- func (c VirtualMachineClient) RedeployThenPoll(ctx context.Context, id VirtualMachineId) error
- func (c VirtualMachineClient) Reimage(ctx context.Context, id VirtualMachineId) (result ReimageOperationResponse, err error)
- func (c VirtualMachineClient) ReimageThenPoll(ctx context.Context, id VirtualMachineId) error
- func (c VirtualMachineClient) ResetPassword(ctx context.Context, id VirtualMachineId, input ResetPasswordBody) (result ResetPasswordOperationResponse, err error)
- func (c VirtualMachineClient) ResetPasswordThenPoll(ctx context.Context, id VirtualMachineId, input ResetPasswordBody) error
- func (c VirtualMachineClient) Start(ctx context.Context, id VirtualMachineId) (result StartOperationResponse, err error)
- func (c VirtualMachineClient) StartThenPoll(ctx context.Context, id VirtualMachineId) error
- func (c VirtualMachineClient) Stop(ctx context.Context, id VirtualMachineId) (result StopOperationResponse, err error)
- func (c VirtualMachineClient) StopThenPoll(ctx context.Context, id VirtualMachineId) error
- type VirtualMachineConnectionProfile
- type VirtualMachineId
- type VirtualMachineOperationPredicate
- type VirtualMachineProperties
- type VirtualMachineState
- type VirtualMachineType
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 ¶
ValidateLabID checks that 'input' can be parsed as a Lab ID
func ValidateLabPlanID ¶
ValidateLabPlanID checks that 'input' can be parsed as a Lab Plan ID
func ValidateVirtualMachineID ¶
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 ¶
LabId is a struct representing the Resource ID for a Lab
func ParseLabID ¶
ParseLabID parses 'input' into a LabId
func ParseLabIDInsensitively ¶
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) Segments ¶
func (id LabId) Segments() []resourceids.Segment
Segments returns a slice of Resource ID Segments which comprise this Lab ID
type LabPlanId ¶
LabPlanId is a struct representing the Resource ID for a Lab Plan
func NewLabPlanID ¶
NewLabPlanID returns a new LabPlanId struct
func ParseLabPlanID ¶
ParseLabPlanID parses 'input' into a LabPlanId
func ParseLabPlanIDInsensitively ¶
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) Segments ¶
func (id LabPlanId) Segments() []resourceids.Segment
Segments returns a slice of Resource ID Segments which comprise this Lab Plan ID
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 ResetPasswordBody ¶
type SaveImageBody ¶
type StartOperationResponse ¶
type StopOperationResponse ¶
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 ¶
func (c VirtualMachineClient) Get(ctx context.Context, id VirtualMachineId) (result GetOperationResponse, err error)
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 ¶
func (c VirtualMachineClient) Redeploy(ctx context.Context, id VirtualMachineId) (result RedeployOperationResponse, err error)
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 ¶
func (c VirtualMachineClient) Reimage(ctx context.Context, id VirtualMachineId) (result ReimageOperationResponse, err error)
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 ¶
func (c VirtualMachineClient) ResetPassword(ctx context.Context, id VirtualMachineId, input ResetPasswordBody) (result ResetPasswordOperationResponse, err error)
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 ¶
func (c VirtualMachineClient) Start(ctx context.Context, id VirtualMachineId) (result StartOperationResponse, err error)
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 ¶
func (c VirtualMachineClient) Stop(ctx context.Context, id VirtualMachineId) (result StopOperationResponse, err error)
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 ¶
func (VirtualMachineOperationPredicate) Matches ¶
func (p VirtualMachineOperationPredicate) Matches(input VirtualMachine) bool
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
Source Files ¶
- client.go
- constants.go
- id_lab.go
- id_labplan.go
- id_virtualmachine.go
- method_get.go
- method_labplanssaveimage.go
- method_listbylab.go
- method_redeploy.go
- method_reimage.go
- method_resetpassword.go
- method_start.go
- method_stop.go
- model_resetpasswordbody.go
- model_saveimagebody.go
- model_virtualmachine.go
- model_virtualmachineconnectionprofile.go
- model_virtualmachineproperties.go
- predicates.go
- version.go