machineruncommands

package
v0.20240712.1145105 Latest Latest
Warning

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

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

README

github.com/hashicorp/go-azure-sdk/resource-manager/hybridcompute/2024-05-20-preview/machineruncommands Documentation

The machineruncommands SDK allows for interaction with the Azure Resource Manager Service hybridcompute (API Version 2024-05-20-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/hybridcompute/2024-05-20-preview/machineruncommands"

Client Initialization

client := machineruncommands.NewMachineRunCommandsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: MachineRunCommandsClient.CreateOrUpdate

ctx := context.TODO()
id := machineruncommands.NewRunCommandID("12345678-1234-9876-4563-123456789012", "example-resource-group", "machineValue", "runCommandValue")

payload := machineruncommands.MachineRunCommand{
	// ...
}


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

Example Usage: MachineRunCommandsClient.Delete

ctx := context.TODO()
id := machineruncommands.NewRunCommandID("12345678-1234-9876-4563-123456789012", "example-resource-group", "machineValue", "runCommandValue")

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

Example Usage: MachineRunCommandsClient.Get

ctx := context.TODO()
id := machineruncommands.NewRunCommandID("12345678-1234-9876-4563-123456789012", "example-resource-group", "machineValue", "runCommandValue")

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: MachineRunCommandsClient.List

ctx := context.TODO()
id := machineruncommands.NewMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "machineValue")

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

Example Usage: MachineRunCommandsClient.Update

ctx := context.TODO()
id := machineruncommands.NewRunCommandID("12345678-1234-9876-4563-123456789012", "example-resource-group", "machineValue", "runCommandValue")

payload := machineruncommands.ResourceUpdate{
	// ...
}


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 PossibleValuesForExtensionsStatusLevelTypes

func PossibleValuesForExtensionsStatusLevelTypes() []string

func ValidateMachineID

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

ValidateMachineID checks that 'input' can be parsed as a Machine 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

Types

type CreateOrUpdateOperationResponse

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

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 ExtensionsResourceStatus

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

func (*ExtensionsResourceStatus) GetTimeAsTime

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

func (*ExtensionsResourceStatus) SetTimeAsTime

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

type ExtensionsStatusLevelTypes

type ExtensionsStatusLevelTypes string
const (
	ExtensionsStatusLevelTypesError   ExtensionsStatusLevelTypes = "Error"
	ExtensionsStatusLevelTypesInfo    ExtensionsStatusLevelTypes = "Info"
	ExtensionsStatusLevelTypesWarning ExtensionsStatusLevelTypes = "Warning"
)

func (*ExtensionsStatusLevelTypes) UnmarshalJSON

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

type GetOperationResponse

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

type ListCompleteResult

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

type ListCustomPager

type ListCustomPager struct {
	NextLink *odata.Link `json:"nextLink"`
}
func (p *ListCustomPager) NextPageLink() *odata.Link

type ListOperationOptions

type ListOperationOptions struct {
	Expand *string
}

func DefaultListOperationOptions

func DefaultListOperationOptions() ListOperationOptions

func (ListOperationOptions) ToHeaders

func (o ListOperationOptions) ToHeaders() *client.Headers

func (ListOperationOptions) ToOData

func (o ListOperationOptions) ToOData() *odata.Query

func (ListOperationOptions) ToQuery

type ListOperationResponse

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

type MachineId

type MachineId struct {
	SubscriptionId    string
	ResourceGroupName string
	MachineName       string
}

MachineId is a struct representing the Resource ID for a Machine

func NewMachineID

func NewMachineID(subscriptionId string, resourceGroupName string, machineName string) MachineId

NewMachineID returns a new MachineId struct

func ParseMachineID

func ParseMachineID(input string) (*MachineId, error)

ParseMachineID parses 'input' into a MachineId

func ParseMachineIDInsensitively

func ParseMachineIDInsensitively(input string) (*MachineId, error)

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

func (*MachineId) FromParseResult

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

func (MachineId) ID

func (id MachineId) ID() string

ID returns the formatted Machine ID

func (MachineId) Segments

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

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

func (MachineId) String

func (id MachineId) String() string

String returns a human-readable description of this Machine ID

type MachineRunCommand

type MachineRunCommand struct {
	Id         *string                      `json:"id,omitempty"`
	Location   string                       `json:"location"`
	Name       *string                      `json:"name,omitempty"`
	Properties *MachineRunCommandProperties `json:"properties,omitempty"`
	SystemData *systemdata.SystemData       `json:"systemData,omitempty"`
	Tags       *map[string]string           `json:"tags,omitempty"`
	Type       *string                      `json:"type,omitempty"`
}

type MachineRunCommandInstanceView

type MachineRunCommandInstanceView 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         *[]ExtensionsResourceStatus `json:"statuses,omitempty"`
}

func (*MachineRunCommandInstanceView) GetEndTimeAsTime

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

func (*MachineRunCommandInstanceView) GetStartTimeAsTime

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

func (*MachineRunCommandInstanceView) SetEndTimeAsTime

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

func (*MachineRunCommandInstanceView) SetStartTimeAsTime

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

type MachineRunCommandOperationPredicate

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

func (MachineRunCommandOperationPredicate) Matches

type MachineRunCommandProperties

type MachineRunCommandProperties struct {
	AsyncExecution            *bool                          `json:"asyncExecution,omitempty"`
	ErrorBlobManagedIdentity  *RunCommandManagedIdentity     `json:"errorBlobManagedIdentity,omitempty"`
	ErrorBlobUri              *string                        `json:"errorBlobUri,omitempty"`
	InstanceView              *MachineRunCommandInstanceView `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                    *MachineRunCommandScriptSource `json:"source,omitempty"`
	TimeoutInSeconds          *int64                         `json:"timeoutInSeconds,omitempty"`
}

type MachineRunCommandScriptSource

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

type MachineRunCommandsClient

type MachineRunCommandsClient struct {
	Client *resourcemanager.Client
}

func NewMachineRunCommandsClientWithBaseURI

func NewMachineRunCommandsClientWithBaseURI(sdkApi sdkEnv.Api) (*MachineRunCommandsClient, error)

func (MachineRunCommandsClient) CreateOrUpdate

CreateOrUpdate ...

func (MachineRunCommandsClient) CreateOrUpdateThenPoll

func (c MachineRunCommandsClient) CreateOrUpdateThenPoll(ctx context.Context, id RunCommandId, input MachineRunCommand) error

CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed

func (MachineRunCommandsClient) Delete

Delete ...

func (MachineRunCommandsClient) DeleteThenPoll

func (c MachineRunCommandsClient) DeleteThenPoll(ctx context.Context, id RunCommandId) error

DeleteThenPoll performs Delete then polls until it's completed

func (MachineRunCommandsClient) Get

Get ...

func (MachineRunCommandsClient) List

List ...

func (MachineRunCommandsClient) ListComplete

ListComplete retrieves all the results into a single object

func (MachineRunCommandsClient) ListCompleteMatchingPredicate

func (c MachineRunCommandsClient) ListCompleteMatchingPredicate(ctx context.Context, id MachineId, options ListOperationOptions, predicate MachineRunCommandOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (MachineRunCommandsClient) Update

Update ...

func (MachineRunCommandsClient) UpdateThenPoll

func (c MachineRunCommandsClient) UpdateThenPoll(ctx context.Context, id RunCommandId, input ResourceUpdate) error

UpdateThenPoll performs Update then polls until it's completed

type ResourceUpdate

type ResourceUpdate struct {
	Tags *map[string]string `json:"tags,omitempty"`
}

type RunCommandId

type RunCommandId struct {
	SubscriptionId    string
	ResourceGroupName string
	MachineName       string
	RunCommandName    string
}

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

func NewRunCommandID

func NewRunCommandID(subscriptionId string, resourceGroupName string, machineName string, runCommandName 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 UpdateOperationResponse

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

Jump to

Keyboard shortcuts

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