virtualmachineruncommands

package
v0.20240325.1113504 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-03-01/virtualmachineruncommands Documentation

The virtualmachineruncommands SDK allows for interaction with the Azure Resource Manager Service compute (API Version 2023-03-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/compute/2023-03-01/virtualmachineruncommands"

Client Initialization

client := virtualmachineruncommands.NewVirtualMachineRunCommandsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: VirtualMachineRunCommandsClient.CreateOrUpdate

ctx := context.TODO()
id := virtualmachineruncommands.NewVirtualMachineRunCommandID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineValue", "runCommandValue")

payload := virtualmachineruncommands.VirtualMachineRunCommand{
	// ...
}


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

Example Usage: VirtualMachineRunCommandsClient.Delete

ctx := context.TODO()
id := virtualmachineruncommands.NewVirtualMachineRunCommandID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineValue", "runCommandValue")

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

Example Usage: VirtualMachineRunCommandsClient.Get

ctx := context.TODO()
id := virtualmachineruncommands.NewRunCommandID("12345678-1234-9876-4563-123456789012", "locationValue", "commandIdValue")

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: VirtualMachineRunCommandsClient.GetByVirtualMachine

ctx := context.TODO()
id := virtualmachineruncommands.NewVirtualMachineRunCommandID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineValue", "runCommandValue")

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

Example Usage: VirtualMachineRunCommandsClient.List

ctx := context.TODO()
id := virtualmachineruncommands.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue")

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

Example Usage: VirtualMachineRunCommandsClient.ListByVirtualMachine

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

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

Example Usage: VirtualMachineRunCommandsClient.Update

ctx := context.TODO()
id := virtualmachineruncommands.NewVirtualMachineRunCommandID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineValue", "runCommandValue")

payload := virtualmachineruncommands.VirtualMachineRunCommandUpdate{
	// ...
}


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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForExecutionState

func PossibleValuesForExecutionState() []string

func PossibleValuesForOperatingSystemTypes

func PossibleValuesForOperatingSystemTypes() []string

func PossibleValuesForStatusLevelTypes

func PossibleValuesForStatusLevelTypes() []string

func ValidateLocationID

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

ValidateLocationID checks that 'input' can be parsed as a Location ID

func ValidateRunCommandID

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

ValidateRunCommandID checks that 'input' can be parsed as a Run Command 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

func ValidateVirtualMachineRunCommandID

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

ValidateVirtualMachineRunCommandID checks that 'input' can be parsed as a Virtual Machine Run Command ID

Types

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *VirtualMachineRunCommand
}

type DeleteOperationResponse

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

type ExecutionState

type ExecutionState string
const (
	ExecutionStateCanceled  ExecutionState = "Canceled"
	ExecutionStateFailed    ExecutionState = "Failed"
	ExecutionStatePending   ExecutionState = "Pending"
	ExecutionStateRunning   ExecutionState = "Running"
	ExecutionStateSucceeded ExecutionState = "Succeeded"
	ExecutionStateTimedOut  ExecutionState = "TimedOut"
	ExecutionStateUnknown   ExecutionState = "Unknown"
)

func (*ExecutionState) UnmarshalJSON

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

type GetByVirtualMachineOperationOptions

type GetByVirtualMachineOperationOptions struct {
	Expand *string
}

func DefaultGetByVirtualMachineOperationOptions

func DefaultGetByVirtualMachineOperationOptions() GetByVirtualMachineOperationOptions

func (GetByVirtualMachineOperationOptions) ToHeaders

func (GetByVirtualMachineOperationOptions) ToOData

func (GetByVirtualMachineOperationOptions) ToQuery

type GetByVirtualMachineOperationResponse

type GetByVirtualMachineOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *VirtualMachineRunCommand
}

type GetOperationResponse

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

type InstanceViewStatus

type InstanceViewStatus struct {
	Code          *string           `json:"code,omitempty"`
	DisplayStatus *string           `json:"displayStatus,omitempty"`
	Level         *StatusLevelTypes `json:"level,omitempty"`
	Message       *string           `json:"message,omitempty"`
	Time          *string           `json:"time,omitempty"`
}

func (*InstanceViewStatus) GetTimeAsTime

func (o *InstanceViewStatus) GetTimeAsTime() (*time.Time, error)

func (*InstanceViewStatus) SetTimeAsTime

func (o *InstanceViewStatus) SetTimeAsTime(input time.Time)

type ListByVirtualMachineCompleteResult

type ListByVirtualMachineCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []VirtualMachineRunCommand
}

type ListByVirtualMachineOperationOptions

type ListByVirtualMachineOperationOptions struct {
	Expand *string
}

func DefaultListByVirtualMachineOperationOptions

func DefaultListByVirtualMachineOperationOptions() ListByVirtualMachineOperationOptions

func (ListByVirtualMachineOperationOptions) ToHeaders

func (ListByVirtualMachineOperationOptions) ToOData

func (ListByVirtualMachineOperationOptions) ToQuery

type ListByVirtualMachineOperationResponse

type ListByVirtualMachineOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]VirtualMachineRunCommand
}

type ListCompleteResult

type ListCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []RunCommandDocumentBase
}

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]RunCommandDocumentBase
}

type LocationId

type LocationId struct {
	SubscriptionId string
	LocationName   string
}

LocationId is a struct representing the Resource ID for a Location

func NewLocationID

func NewLocationID(subscriptionId string, locationName string) LocationId

NewLocationID returns a new LocationId struct

func ParseLocationID

func ParseLocationID(input string) (*LocationId, error)

ParseLocationID parses 'input' into a LocationId

func ParseLocationIDInsensitively

func ParseLocationIDInsensitively(input string) (*LocationId, error)

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

func (*LocationId) FromParseResult

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

func (LocationId) ID

func (id LocationId) ID() string

ID returns the formatted Location ID

func (LocationId) Segments

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

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

func (LocationId) String

func (id LocationId) String() string

String returns a human-readable description of this Location ID

type OperatingSystemTypes

type OperatingSystemTypes string
const (
	OperatingSystemTypesLinux   OperatingSystemTypes = "Linux"
	OperatingSystemTypesWindows OperatingSystemTypes = "Windows"
)

func (*OperatingSystemTypes) UnmarshalJSON

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

type RunCommandDocument

type RunCommandDocument struct {
	Description string                           `json:"description"`
	Id          string                           `json:"id"`
	Label       string                           `json:"label"`
	OsType      OperatingSystemTypes             `json:"osType"`
	Parameters  *[]RunCommandParameterDefinition `json:"parameters,omitempty"`
	Schema      string                           `json:"$schema"`
	Script      []string                         `json:"script"`
}

type RunCommandDocumentBase

type RunCommandDocumentBase struct {
	Description string               `json:"description"`
	Id          string               `json:"id"`
	Label       string               `json:"label"`
	OsType      OperatingSystemTypes `json:"osType"`
	Schema      string               `json:"$schema"`
}

type RunCommandDocumentBaseOperationPredicate

type RunCommandDocumentBaseOperationPredicate struct {
	Description *string
	Id          *string
	Label       *string
	Schema      *string
}

func (RunCommandDocumentBaseOperationPredicate) Matches

type RunCommandId

type RunCommandId struct {
	SubscriptionId string
	LocationName   string
	CommandId      string
}

RunCommandId is a struct representing the Resource ID for a Run Command

func NewRunCommandID

func NewRunCommandID(subscriptionId string, locationName string, commandId string) RunCommandId

NewRunCommandID returns a new RunCommandId struct

func ParseRunCommandID

func ParseRunCommandID(input string) (*RunCommandId, error)

ParseRunCommandID parses 'input' into a RunCommandId

func ParseRunCommandIDInsensitively

func ParseRunCommandIDInsensitively(input string) (*RunCommandId, error)

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

func (*RunCommandId) FromParseResult

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

func (RunCommandId) ID

func (id RunCommandId) ID() string

ID returns the formatted Run Command ID

func (RunCommandId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Run Command ID

func (RunCommandId) String

func (id RunCommandId) String() string

String returns a human-readable description of this Run Command ID

type RunCommandInputParameter

type RunCommandInputParameter struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type RunCommandManagedIdentity

type RunCommandManagedIdentity struct {
	ClientId *string `json:"clientId,omitempty"`
	ObjectId *string `json:"objectId,omitempty"`
}

type RunCommandParameterDefinition

type RunCommandParameterDefinition struct {
	DefaultValue *string `json:"defaultValue,omitempty"`
	Name         string  `json:"name"`
	Required     *bool   `json:"required,omitempty"`
	Type         string  `json:"type"`
}

type StatusLevelTypes

type StatusLevelTypes string
const (
	StatusLevelTypesError   StatusLevelTypes = "Error"
	StatusLevelTypesInfo    StatusLevelTypes = "Info"
	StatusLevelTypesWarning StatusLevelTypes = "Warning"
)

func (*StatusLevelTypes) UnmarshalJSON

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

type UpdateOperationResponse

type UpdateOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *VirtualMachineRunCommand
}

type VirtualMachineId

type VirtualMachineId struct {
	SubscriptionId     string
	ResourceGroupName  string
	VirtualMachineName string
}

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

func NewVirtualMachineID

func NewVirtualMachineID(subscriptionId string, resourceGroupName 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 VirtualMachineRunCommand

type VirtualMachineRunCommand struct {
	Id         *string                             `json:"id,omitempty"`
	Location   string                              `json:"location"`
	Name       *string                             `json:"name,omitempty"`
	Properties *VirtualMachineRunCommandProperties `json:"properties,omitempty"`
	Tags       *map[string]string                  `json:"tags,omitempty"`
	Type       *string                             `json:"type,omitempty"`
}

type VirtualMachineRunCommandId

type VirtualMachineRunCommandId struct {
	SubscriptionId     string
	ResourceGroupName  string
	VirtualMachineName string
	RunCommandName     string
}

VirtualMachineRunCommandId is a struct representing the Resource ID for a Virtual Machine Run Command

func NewVirtualMachineRunCommandID

func NewVirtualMachineRunCommandID(subscriptionId string, resourceGroupName string, virtualMachineName string, runCommandName string) VirtualMachineRunCommandId

NewVirtualMachineRunCommandID returns a new VirtualMachineRunCommandId struct

func ParseVirtualMachineRunCommandID

func ParseVirtualMachineRunCommandID(input string) (*VirtualMachineRunCommandId, error)

ParseVirtualMachineRunCommandID parses 'input' into a VirtualMachineRunCommandId

func ParseVirtualMachineRunCommandIDInsensitively

func ParseVirtualMachineRunCommandIDInsensitively(input string) (*VirtualMachineRunCommandId, error)

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

func (*VirtualMachineRunCommandId) FromParseResult

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

func (VirtualMachineRunCommandId) ID

ID returns the formatted Virtual Machine Run Command ID

func (VirtualMachineRunCommandId) Segments

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

func (VirtualMachineRunCommandId) String

func (id VirtualMachineRunCommandId) String() string

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

type VirtualMachineRunCommandInstanceView

type VirtualMachineRunCommandInstanceView struct {
	EndTime          *string               `json:"endTime,omitempty"`
	Error            *string               `json:"error,omitempty"`
	ExecutionMessage *string               `json:"executionMessage,omitempty"`
	ExecutionState   *ExecutionState       `json:"executionState,omitempty"`
	ExitCode         *int64                `json:"exitCode,omitempty"`
	Output           *string               `json:"output,omitempty"`
	StartTime        *string               `json:"startTime,omitempty"`
	Statuses         *[]InstanceViewStatus `json:"statuses,omitempty"`
}

func (*VirtualMachineRunCommandInstanceView) GetEndTimeAsTime

func (o *VirtualMachineRunCommandInstanceView) GetEndTimeAsTime() (*time.Time, error)

func (*VirtualMachineRunCommandInstanceView) GetStartTimeAsTime

func (o *VirtualMachineRunCommandInstanceView) GetStartTimeAsTime() (*time.Time, error)

func (*VirtualMachineRunCommandInstanceView) SetEndTimeAsTime

func (o *VirtualMachineRunCommandInstanceView) SetEndTimeAsTime(input time.Time)

func (*VirtualMachineRunCommandInstanceView) SetStartTimeAsTime

func (o *VirtualMachineRunCommandInstanceView) SetStartTimeAsTime(input time.Time)

type VirtualMachineRunCommandOperationPredicate

type VirtualMachineRunCommandOperationPredicate struct {
	Id       *string
	Location *string
	Name     *string
	Type     *string
}

func (VirtualMachineRunCommandOperationPredicate) Matches

type VirtualMachineRunCommandProperties

type VirtualMachineRunCommandProperties struct {
	AsyncExecution                  *bool                                 `json:"asyncExecution,omitempty"`
	ErrorBlobManagedIdentity        *RunCommandManagedIdentity            `json:"errorBlobManagedIdentity,omitempty"`
	ErrorBlobUri                    *string                               `json:"errorBlobUri,omitempty"`
	InstanceView                    *VirtualMachineRunCommandInstanceView `json:"instanceView,omitempty"`
	OutputBlobManagedIdentity       *RunCommandManagedIdentity            `json:"outputBlobManagedIdentity,omitempty"`
	OutputBlobUri                   *string                               `json:"outputBlobUri,omitempty"`
	Parameters                      *[]RunCommandInputParameter           `json:"parameters,omitempty"`
	ProtectedParameters             *[]RunCommandInputParameter           `json:"protectedParameters,omitempty"`
	ProvisioningState               *string                               `json:"provisioningState,omitempty"`
	RunAsPassword                   *string                               `json:"runAsPassword,omitempty"`
	RunAsUser                       *string                               `json:"runAsUser,omitempty"`
	Source                          *VirtualMachineRunCommandScriptSource `json:"source,omitempty"`
	TimeoutInSeconds                *int64                                `json:"timeoutInSeconds,omitempty"`
	TreatFailureAsDeploymentFailure *bool                                 `json:"treatFailureAsDeploymentFailure,omitempty"`
}

type VirtualMachineRunCommandScriptSource

type VirtualMachineRunCommandScriptSource struct {
	CommandId                *string                    `json:"commandId,omitempty"`
	Script                   *string                    `json:"script,omitempty"`
	ScriptUri                *string                    `json:"scriptUri,omitempty"`
	ScriptUriManagedIdentity *RunCommandManagedIdentity `json:"scriptUriManagedIdentity,omitempty"`
}

type VirtualMachineRunCommandUpdate

type VirtualMachineRunCommandUpdate struct {
	Properties *VirtualMachineRunCommandProperties `json:"properties,omitempty"`
	Tags       *map[string]string                  `json:"tags,omitempty"`
}

type VirtualMachineRunCommandsClient

type VirtualMachineRunCommandsClient struct {
	Client *resourcemanager.Client
}

func NewVirtualMachineRunCommandsClientWithBaseURI

func NewVirtualMachineRunCommandsClientWithBaseURI(sdkApi sdkEnv.Api) (*VirtualMachineRunCommandsClient, error)

func (VirtualMachineRunCommandsClient) CreateOrUpdate

CreateOrUpdate ...

func (VirtualMachineRunCommandsClient) CreateOrUpdateThenPoll

CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed

func (VirtualMachineRunCommandsClient) Delete

Delete ...

func (VirtualMachineRunCommandsClient) DeleteThenPoll

DeleteThenPoll performs Delete then polls until it's completed

func (VirtualMachineRunCommandsClient) Get

Get ...

func (VirtualMachineRunCommandsClient) GetByVirtualMachine

GetByVirtualMachine ...

func (VirtualMachineRunCommandsClient) List

List ...

func (VirtualMachineRunCommandsClient) ListByVirtualMachine

ListByVirtualMachine ...

func (VirtualMachineRunCommandsClient) ListByVirtualMachineComplete

ListByVirtualMachineComplete retrieves all the results into a single object

func (VirtualMachineRunCommandsClient) ListByVirtualMachineCompleteMatchingPredicate

ListByVirtualMachineCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (VirtualMachineRunCommandsClient) ListComplete

ListComplete retrieves all the results into a single object

func (VirtualMachineRunCommandsClient) ListCompleteMatchingPredicate

func (c VirtualMachineRunCommandsClient) ListCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate RunCommandDocumentBaseOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (VirtualMachineRunCommandsClient) Update

Update ...

func (VirtualMachineRunCommandsClient) UpdateThenPoll

UpdateThenPoll performs Update then polls until it's completed

Jump to

Keyboard shortcuts

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