customimages

package
v0.20240402.1085733 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MPL-2.0 Imports: 13 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/devtestlab/2018-09-15/customimages Documentation

The customimages SDK allows for interaction with the Azure Resource Manager Service devtestlab (API Version 2018-09-15).

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/devtestlab/2018-09-15/customimages"

Client Initialization

client := customimages.NewCustomImagesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: CustomImagesClient.CreateOrUpdate

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

payload := customimages.CustomImage{
	// ...
}


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

Example Usage: CustomImagesClient.Delete

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

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

Example Usage: CustomImagesClient.Get

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

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

Example Usage: CustomImagesClient.List

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

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

Example Usage: CustomImagesClient.Update

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

payload := customimages.UpdateResource{
	// ...
}


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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForCustomImageOsType

func PossibleValuesForCustomImageOsType() []string

func PossibleValuesForLinuxOsState

func PossibleValuesForLinuxOsState() []string

func PossibleValuesForStorageType

func PossibleValuesForStorageType() []string

func PossibleValuesForWindowsOsState

func PossibleValuesForWindowsOsState() []string

func ValidateCustomImageID

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

ValidateCustomImageID checks that 'input' can be parsed as a Custom Image ID

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 CreateOrUpdateOperationResponse

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

type CustomImage

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

type CustomImageId

type CustomImageId struct {
	SubscriptionId    string
	ResourceGroupName string
	LabName           string
	CustomImageName   string
}

CustomImageId is a struct representing the Resource ID for a Custom Image

func NewCustomImageID

func NewCustomImageID(subscriptionId string, resourceGroupName string, labName string, customImageName string) CustomImageId

NewCustomImageID returns a new CustomImageId struct

func ParseCustomImageID

func ParseCustomImageID(input string) (*CustomImageId, error)

ParseCustomImageID parses 'input' into a CustomImageId

func ParseCustomImageIDInsensitively

func ParseCustomImageIDInsensitively(input string) (*CustomImageId, error)

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

func (*CustomImageId) FromParseResult

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

func (CustomImageId) ID

func (id CustomImageId) ID() string

ID returns the formatted Custom Image ID

func (CustomImageId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Custom Image ID

func (CustomImageId) String

func (id CustomImageId) String() string

String returns a human-readable description of this Custom Image ID

type CustomImageOperationPredicate

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

func (CustomImageOperationPredicate) Matches

type CustomImageOsType

type CustomImageOsType string
const (
	CustomImageOsTypeLinux   CustomImageOsType = "Linux"
	CustomImageOsTypeNone    CustomImageOsType = "None"
	CustomImageOsTypeWindows CustomImageOsType = "Windows"
)

func (*CustomImageOsType) UnmarshalJSON

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

type CustomImageProperties

type CustomImageProperties struct {
	Author              *string                        `json:"author,omitempty"`
	CreationDate        *string                        `json:"creationDate,omitempty"`
	CustomImagePlan     *CustomImagePropertiesFromPlan `json:"customImagePlan,omitempty"`
	DataDiskStorageInfo *[]DataDiskStorageTypeInfo     `json:"dataDiskStorageInfo,omitempty"`
	Description         *string                        `json:"description,omitempty"`
	IsPlanAuthorized    *bool                          `json:"isPlanAuthorized,omitempty"`
	ManagedImageId      *string                        `json:"managedImageId,omitempty"`
	ManagedSnapshotId   *string                        `json:"managedSnapshotId,omitempty"`
	ProvisioningState   *string                        `json:"provisioningState,omitempty"`
	UniqueIdentifier    *string                        `json:"uniqueIdentifier,omitempty"`
	VM                  *CustomImagePropertiesFromVM   `json:"vm,omitempty"`
	Vhd                 *CustomImagePropertiesCustom   `json:"vhd,omitempty"`
}

func (*CustomImageProperties) GetCreationDateAsTime

func (o *CustomImageProperties) GetCreationDateAsTime() (*time.Time, error)

func (*CustomImageProperties) SetCreationDateAsTime

func (o *CustomImageProperties) SetCreationDateAsTime(input time.Time)

type CustomImagePropertiesCustom

type CustomImagePropertiesCustom struct {
	ImageName *string           `json:"imageName,omitempty"`
	OsType    CustomImageOsType `json:"osType"`
	SysPrep   *bool             `json:"sysPrep,omitempty"`
}

type CustomImagePropertiesFromPlan

type CustomImagePropertiesFromPlan struct {
	Id        *string `json:"id,omitempty"`
	Offer     *string `json:"offer,omitempty"`
	Publisher *string `json:"publisher,omitempty"`
}

type CustomImagePropertiesFromVM

type CustomImagePropertiesFromVM struct {
	LinuxOsInfo   *LinuxOsInfo   `json:"linuxOsInfo,omitempty"`
	SourceVMId    *string        `json:"sourceVmId,omitempty"`
	WindowsOsInfo *WindowsOsInfo `json:"windowsOsInfo,omitempty"`
}

type CustomImagesClient

type CustomImagesClient struct {
	Client *resourcemanager.Client
}

func NewCustomImagesClientWithBaseURI

func NewCustomImagesClientWithBaseURI(sdkApi sdkEnv.Api) (*CustomImagesClient, error)

func (CustomImagesClient) CreateOrUpdate

func (c CustomImagesClient) CreateOrUpdate(ctx context.Context, id CustomImageId, input CustomImage) (result CreateOrUpdateOperationResponse, err error)

CreateOrUpdate ...

func (CustomImagesClient) CreateOrUpdateThenPoll

func (c CustomImagesClient) CreateOrUpdateThenPoll(ctx context.Context, id CustomImageId, input CustomImage) error

CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed

func (CustomImagesClient) Delete

Delete ...

func (CustomImagesClient) DeleteThenPoll

func (c CustomImagesClient) DeleteThenPoll(ctx context.Context, id CustomImageId) error

DeleteThenPoll performs Delete then polls until it's completed

func (CustomImagesClient) Get

Get ...

func (CustomImagesClient) List

List ...

func (CustomImagesClient) ListComplete

ListComplete retrieves all the results into a single object

func (CustomImagesClient) ListCompleteMatchingPredicate

func (c CustomImagesClient) ListCompleteMatchingPredicate(ctx context.Context, id LabId, options ListOperationOptions, predicate CustomImageOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (CustomImagesClient) Update

Update ...

type DataDiskStorageTypeInfo

type DataDiskStorageTypeInfo struct {
	Lun         *string      `json:"lun,omitempty"`
	StorageType *StorageType `json:"storageType,omitempty"`
}

type DeleteOperationResponse

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

type GetOperationOptions

type GetOperationOptions struct {
	Expand *string
}

func DefaultGetOperationOptions

func DefaultGetOperationOptions() GetOperationOptions

func (GetOperationOptions) ToHeaders

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

func (GetOperationOptions) ToOData

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

func (GetOperationOptions) ToQuery

func (o GetOperationOptions) ToQuery() *client.QueryParams

type GetOperationResponse

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

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 LinuxOsInfo

type LinuxOsInfo struct {
	LinuxOsState *LinuxOsState `json:"linuxOsState,omitempty"`
}

type LinuxOsState

type LinuxOsState string
const (
	LinuxOsStateDeprovisionApplied   LinuxOsState = "DeprovisionApplied"
	LinuxOsStateDeprovisionRequested LinuxOsState = "DeprovisionRequested"
	LinuxOsStateNonDeprovisioned     LinuxOsState = "NonDeprovisioned"
)

func (*LinuxOsState) UnmarshalJSON

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

type ListCompleteResult

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

type ListOperationOptions

type ListOperationOptions struct {
	Expand  *string
	Filter  *string
	Orderby *string
	Top     *int64
}

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        *[]CustomImage
}

type StorageType

type StorageType string
const (
	StorageTypePremium     StorageType = "Premium"
	StorageTypeStandard    StorageType = "Standard"
	StorageTypeStandardSSD StorageType = "StandardSSD"
)

func (*StorageType) UnmarshalJSON

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

type UpdateOperationResponse

type UpdateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *CustomImage
}

type UpdateResource

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

type WindowsOsInfo

type WindowsOsInfo struct {
	WindowsOsState *WindowsOsState `json:"windowsOsState,omitempty"`
}

type WindowsOsState

type WindowsOsState string
const (
	WindowsOsStateNonSysprepped    WindowsOsState = "NonSysprepped"
	WindowsOsStateSysprepApplied   WindowsOsState = "SysprepApplied"
	WindowsOsStateSysprepRequested WindowsOsState = "SysprepRequested"
)

func (*WindowsOsState) UnmarshalJSON

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

Jump to

Keyboard shortcuts

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