lab

package
v0.20240223.1130721 Latest Latest
Warning

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

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

README

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

The lab 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-helpers/resourcemanager/commonids"
import "github.com/hashicorp/go-azure-sdk/resource-manager/labservices/2021-10-01-preview/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 := commonids.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 := commonids.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"
)

func (*ConnectionType) UnmarshalJSON

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

type CreateOption

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

func (*CreateOption) UnmarshalJSON

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

type CreateOrUpdateOperationResponse

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

type Credentials

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

type DeleteOperationResponse

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

type EnableState

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

func (*EnableState) UnmarshalJSON

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

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	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 *resourcemanager.Client
}

func NewLabClientWithBaseURI

func NewLabClientWithBaseURI(sdkApi sdkEnv.Api) (*LabClient, error)

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

func (c LabClient) ListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result ListByResourceGroupOperationResponse, err error)

ListByResourceGroup ...

func (LabClient) ListByResourceGroupComplete

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

ListByResourceGroupComplete retrieves all the results into a single object

func (LabClient) ListByResourceGroupCompleteMatchingPredicate

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

ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (LabClient) ListBySubscription

func (c LabClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result ListBySubscriptionOperationResponse, err error)

ListBySubscription ...

func (LabClient) ListBySubscriptionComplete

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

ListBySubscriptionComplete retrieves all the results into a single object

func (LabClient) ListBySubscriptionCompleteMatchingPredicate

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

ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies 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) 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 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"
)

func (*LabState) UnmarshalJSON

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

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 {
	LatestHttpResponse *http.Response
	Items              []Lab
}

type ListByResourceGroupOperationResponse

type ListByResourceGroupOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]Lab
}

type ListBySubscriptionCompleteResult

type ListBySubscriptionCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []Lab
}

type ListBySubscriptionOperationResponse

type ListBySubscriptionOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]Lab
}

type OsType

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

func (*OsType) UnmarshalJSON

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

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 PublishOperationResponse

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

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

func (*ShutdownOnIdleMode) UnmarshalJSON

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

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

func (*SkuTier) UnmarshalJSON

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

type SyncGroupOperationResponse

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

type UpdateOperationResponse

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

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