lab

package
v0.20230123.1111713 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2023 License: MPL-2.0 Imports: 11 Imported by: 1

README

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

The lab 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/lab"

Client Initialization

client := lab.NewLabClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: LabClient.CreateOrUpdate

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

payload := lab.Lab{
	// ...
}


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

Example Usage: LabClient.Delete

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

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

Example Usage: LabClient.Get

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

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: LabClient.ListByResourceGroup

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

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

Example Usage: LabClient.ListBySubscription

ctx := context.TODO()
id := lab.NewSubscriptionID("12345678-1234-9876-4563-123456789012")

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

Example Usage: LabClient.Publish

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

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

Example Usage: LabClient.SyncGroup

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

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

Example Usage: LabClient.Update

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

payload := lab.LabUpdate{
	// ...
}


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 PossibleValuesForConnectionType

func PossibleValuesForConnectionType() []string

func PossibleValuesForCreateOption

func PossibleValuesForCreateOption() []string

func PossibleValuesForEnableState

func PossibleValuesForEnableState() []string

func PossibleValuesForLabState

func PossibleValuesForLabState() []string

func PossibleValuesForOsType

func PossibleValuesForOsType() []string

func PossibleValuesForProvisioningState

func PossibleValuesForProvisioningState() []string

func PossibleValuesForShutdownOnIdleMode

func PossibleValuesForShutdownOnIdleMode() []string

func PossibleValuesForSkuTier

func PossibleValuesForSkuTier() []string

func ValidateLabID

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

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

Types

type AutoShutdownProfile

type AutoShutdownProfile struct {
	DisconnectDelay          *string             `json:"disconnectDelay,omitempty"`
	IdleDelay                *string             `json:"idleDelay,omitempty"`
	NoConnectDelay           *string             `json:"noConnectDelay,omitempty"`
	ShutdownOnDisconnect     *EnableState        `json:"shutdownOnDisconnect,omitempty"`
	ShutdownOnIdle           *ShutdownOnIdleMode `json:"shutdownOnIdle,omitempty"`
	ShutdownWhenNotConnected *EnableState        `json:"shutdownWhenNotConnected,omitempty"`
}

type ConnectionProfile

type ConnectionProfile struct {
	ClientRdpAccess *ConnectionType `json:"clientRdpAccess,omitempty"`
	ClientSshAccess *ConnectionType `json:"clientSshAccess,omitempty"`
	WebRdpAccess    *ConnectionType `json:"webRdpAccess,omitempty"`
	WebSshAccess    *ConnectionType `json:"webSshAccess,omitempty"`
}

type ConnectionType

type ConnectionType string
const (
	ConnectionTypeNone    ConnectionType = "None"
	ConnectionTypePrivate ConnectionType = "Private"
	ConnectionTypePublic  ConnectionType = "Public"
)

type CreateOption

type CreateOption string
const (
	CreateOptionImage      CreateOption = "Image"
	CreateOptionTemplateVM CreateOption = "TemplateVM"
)

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	Poller       polling.LongRunningPoller
	HttpResponse *http.Response
}

type Credentials

type Credentials struct {
	Password *string `json:"password,omitempty"`
	Username string  `json:"username"`
}

type DeleteOperationResponse

type DeleteOperationResponse struct {
	Poller       polling.LongRunningPoller
	HttpResponse *http.Response
}

type EnableState

type EnableState string
const (
	EnableStateDisabled EnableState = "Disabled"
	EnableStateEnabled  EnableState = "Enabled"
)

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	Model        *Lab
}

type ImageReference

type ImageReference struct {
	ExactVersion *string `json:"exactVersion,omitempty"`
	Id           *string `json:"id,omitempty"`
	Offer        *string `json:"offer,omitempty"`
	Publisher    *string `json:"publisher,omitempty"`
	Sku          *string `json:"sku,omitempty"`
	Version      *string `json:"version,omitempty"`
}

type Lab

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

type LabClient

type LabClient struct {
	Client autorest.Client
	// contains filtered or unexported fields
}

func NewLabClientWithBaseURI

func NewLabClientWithBaseURI(endpoint string) LabClient

func (LabClient) CreateOrUpdate

func (c LabClient) CreateOrUpdate(ctx context.Context, id LabId, input Lab) (result CreateOrUpdateOperationResponse, err error)

CreateOrUpdate ...

func (LabClient) CreateOrUpdateThenPoll

func (c LabClient) CreateOrUpdateThenPoll(ctx context.Context, id LabId, input Lab) error

CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed

func (LabClient) Delete

func (c LabClient) Delete(ctx context.Context, id LabId) (result DeleteOperationResponse, err error)

Delete ...

func (LabClient) DeleteThenPoll

func (c LabClient) DeleteThenPoll(ctx context.Context, id LabId) error

DeleteThenPoll performs Delete then polls until it's completed

func (LabClient) Get

func (c LabClient) Get(ctx context.Context, id LabId) (result GetOperationResponse, err error)

Get ...

func (LabClient) ListByResourceGroup

ListByResourceGroup ...

func (LabClient) ListByResourceGroupComplete

func (c LabClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error)

ListByResourceGroupComplete retrieves all of the results into a single object

func (LabClient) ListByResourceGroupCompleteMatchingPredicate

func (c LabClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate LabOperationPredicate) (resp ListByResourceGroupCompleteResult, err error)

ListByResourceGroupCompleteMatchingPredicate retrieves all of the results and then applied the predicate

func (LabClient) ListBySubscription

ListBySubscription ...

func (LabClient) ListBySubscriptionComplete

func (c LabClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (ListBySubscriptionCompleteResult, error)

ListBySubscriptionComplete retrieves all of the results into a single object

func (LabClient) ListBySubscriptionCompleteMatchingPredicate

func (c LabClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate LabOperationPredicate) (resp ListBySubscriptionCompleteResult, err error)

ListBySubscriptionCompleteMatchingPredicate retrieves all of the results and then applied the predicate

func (LabClient) Publish

func (c LabClient) Publish(ctx context.Context, id LabId) (result PublishOperationResponse, err error)

Publish ...

func (LabClient) PublishThenPoll

func (c LabClient) PublishThenPoll(ctx context.Context, id LabId) error

PublishThenPoll performs Publish then polls until it's completed

func (LabClient) SyncGroup

func (c LabClient) SyncGroup(ctx context.Context, id LabId) (result SyncGroupOperationResponse, err error)

SyncGroup ...

func (LabClient) SyncGroupThenPoll

func (c LabClient) SyncGroupThenPoll(ctx context.Context, id LabId) error

SyncGroupThenPoll performs SyncGroup then polls until it's completed

func (LabClient) Update

func (c LabClient) Update(ctx context.Context, id LabId, input LabUpdate) (result UpdateOperationResponse, err error)

Update ...

func (LabClient) UpdateThenPoll

func (c LabClient) UpdateThenPoll(ctx context.Context, id LabId, input LabUpdate) error

UpdateThenPoll performs Update then polls until it's completed

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) 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 LabNetworkProfile

type LabNetworkProfile struct {
	LoadBalancerId *string `json:"loadBalancerId,omitempty"`
	PublicIPId     *string `json:"publicIpId,omitempty"`
	SubnetId       *string `json:"subnetId,omitempty"`
}

type LabOperationPredicate

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

func (LabOperationPredicate) Matches

func (p LabOperationPredicate) Matches(input Lab) bool

type LabProperties

type LabProperties struct {
	AutoShutdownProfile   AutoShutdownProfile   `json:"autoShutdownProfile"`
	ConnectionProfile     ConnectionProfile     `json:"connectionProfile"`
	Description           *string               `json:"description,omitempty"`
	LabPlanId             *string               `json:"labPlanId,omitempty"`
	NetworkProfile        *LabNetworkProfile    `json:"networkProfile,omitempty"`
	ProvisioningState     *ProvisioningState    `json:"provisioningState,omitempty"`
	RosterProfile         *RosterProfile        `json:"rosterProfile,omitempty"`
	SecurityProfile       SecurityProfile       `json:"securityProfile"`
	State                 *LabState             `json:"state,omitempty"`
	Title                 *string               `json:"title,omitempty"`
	VirtualMachineProfile VirtualMachineProfile `json:"virtualMachineProfile"`
}

type LabState

type LabState string
const (
	LabStateDraft      LabState = "Draft"
	LabStatePublished  LabState = "Published"
	LabStatePublishing LabState = "Publishing"
	LabStateScaling    LabState = "Scaling"
	LabStateSyncing    LabState = "Syncing"
)

type LabUpdate

type LabUpdate struct {
	Properties *LabUpdateProperties `json:"properties,omitempty"`
	Tags       *[]string            `json:"tags,omitempty"`
}

type LabUpdateProperties

type LabUpdateProperties struct {
	AutoShutdownProfile   *AutoShutdownProfile   `json:"autoShutdownProfile,omitempty"`
	ConnectionProfile     *ConnectionProfile     `json:"connectionProfile,omitempty"`
	Description           *string                `json:"description,omitempty"`
	LabPlanId             *string                `json:"labPlanId,omitempty"`
	RosterProfile         *RosterProfile         `json:"rosterProfile,omitempty"`
	SecurityProfile       *SecurityProfile       `json:"securityProfile,omitempty"`
	Title                 *string                `json:"title,omitempty"`
	VirtualMachineProfile *VirtualMachineProfile `json:"virtualMachineProfile,omitempty"`
}

type ListByResourceGroupCompleteResult

type ListByResourceGroupCompleteResult struct {
	Items []Lab
}

type ListByResourceGroupOperationResponse

type ListByResourceGroupOperationResponse struct {
	HttpResponse *http.Response
	Model        *[]Lab
	// contains filtered or unexported fields
}

func (ListByResourceGroupOperationResponse) HasMore

func (ListByResourceGroupOperationResponse) LoadMore

type ListBySubscriptionCompleteResult

type ListBySubscriptionCompleteResult struct {
	Items []Lab
}

type ListBySubscriptionOperationResponse

type ListBySubscriptionOperationResponse struct {
	HttpResponse *http.Response
	Model        *[]Lab
	// contains filtered or unexported fields
}

func (ListBySubscriptionOperationResponse) HasMore

func (ListBySubscriptionOperationResponse) LoadMore

type OsType

type OsType string
const (
	OsTypeLinux   OsType = "Linux"
	OsTypeWindows OsType = "Windows"
)

type ProvisioningState

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

type PublishOperationResponse

type PublishOperationResponse struct {
	Poller       polling.LongRunningPoller
	HttpResponse *http.Response
}

type RosterProfile

type RosterProfile struct {
	ActiveDirectoryGroupId *string `json:"activeDirectoryGroupId,omitempty"`
	LmsInstance            *string `json:"lmsInstance,omitempty"`
	LtiClientId            *string `json:"ltiClientId,omitempty"`
	LtiContextId           *string `json:"ltiContextId,omitempty"`
	LtiRosterEndpoint      *string `json:"ltiRosterEndpoint,omitempty"`
}

type SecurityProfile

type SecurityProfile struct {
	OpenAccess       *EnableState `json:"openAccess,omitempty"`
	RegistrationCode *string      `json:"registrationCode,omitempty"`
}

type ShutdownOnIdleMode

type ShutdownOnIdleMode string
const (
	ShutdownOnIdleModeLowUsage    ShutdownOnIdleMode = "LowUsage"
	ShutdownOnIdleModeNone        ShutdownOnIdleMode = "None"
	ShutdownOnIdleModeUserAbsence ShutdownOnIdleMode = "UserAbsence"
)

type Sku

type Sku struct {
	Capacity *int64   `json:"capacity,omitempty"`
	Family   *string  `json:"family,omitempty"`
	Name     string   `json:"name"`
	Size     *string  `json:"size,omitempty"`
	Tier     *SkuTier `json:"tier,omitempty"`
}

type SkuTier

type SkuTier string
const (
	SkuTierBasic    SkuTier = "Basic"
	SkuTierFree     SkuTier = "Free"
	SkuTierPremium  SkuTier = "Premium"
	SkuTierStandard SkuTier = "Standard"
)

type SyncGroupOperationResponse

type SyncGroupOperationResponse struct {
	Poller       polling.LongRunningPoller
	HttpResponse *http.Response
}

type UpdateOperationResponse

type UpdateOperationResponse struct {
	Poller       polling.LongRunningPoller
	HttpResponse *http.Response
}

type VirtualMachineAdditionalCapabilities

type VirtualMachineAdditionalCapabilities struct {
	InstallGpuDrivers *EnableState `json:"installGpuDrivers,omitempty"`
}

type VirtualMachineProfile

type VirtualMachineProfile struct {
	AdditionalCapabilities *VirtualMachineAdditionalCapabilities `json:"additionalCapabilities,omitempty"`
	AdminUser              Credentials                           `json:"adminUser"`
	CreateOption           CreateOption                          `json:"createOption"`
	ImageReference         ImageReference                        `json:"imageReference"`
	NonAdminUser           *Credentials                          `json:"nonAdminUser,omitempty"`
	OsType                 *OsType                               `json:"osType,omitempty"`
	Sku                    Sku                                   `json:"sku"`
	UsageQuota             string                                `json:"usageQuota"`
	UseSharedPassword      *EnableState                          `json:"useSharedPassword,omitempty"`
}

Jump to

Keyboard shortcuts

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