images

package
v0.20220726.1130940 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2022 License: MPL-2.0 Imports: 11 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/images Documentation

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

Client Initialization

client := images.NewImagesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: ImagesClient.CreateOrUpdate

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

payload := images.Image{
	// ...
}


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

Example Usage: ImagesClient.Delete

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

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

Example Usage: ImagesClient.Get

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

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

Example Usage: ImagesClient.List

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

// 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: ImagesClient.ListByResourceGroup

ctx := context.TODO()
id := images.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: ImagesClient.Update

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

payload := images.ImageUpdate{
	// ...
}


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 PossibleValuesForCachingTypes

func PossibleValuesForCachingTypes() []string

func PossibleValuesForHyperVGenerationTypes

func PossibleValuesForHyperVGenerationTypes() []string

func PossibleValuesForOperatingSystemStateTypes

func PossibleValuesForOperatingSystemStateTypes() []string

func PossibleValuesForOperatingSystemTypes

func PossibleValuesForOperatingSystemTypes() []string

func PossibleValuesForStorageAccountTypes

func PossibleValuesForStorageAccountTypes() []string

func ValidateImageID

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

ValidateImageID checks that 'input' can be parsed as a Image ID

Types

type CachingTypes

type CachingTypes string
const (
	CachingTypesNone      CachingTypes = "None"
	CachingTypesReadOnly  CachingTypes = "ReadOnly"
	CachingTypesReadWrite CachingTypes = "ReadWrite"
)

type CreateOrUpdateOperationResponse

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

type DeleteOperationResponse

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

type GetOperationOptions

type GetOperationOptions struct {
	Expand *string
}

func DefaultGetOperationOptions

func DefaultGetOperationOptions() GetOperationOptions

type GetOperationResponse

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

type HyperVGenerationTypes

type HyperVGenerationTypes string
const (
	HyperVGenerationTypesVOne HyperVGenerationTypes = "V1"
	HyperVGenerationTypesVTwo HyperVGenerationTypes = "V2"
)

type Image

type Image struct {
	ExtendedLocation *edgezones.Model   `json:"extendedLocation,omitempty"`
	Id               *string            `json:"id,omitempty"`
	Location         string             `json:"location"`
	Name             *string            `json:"name,omitempty"`
	Properties       *ImageProperties   `json:"properties,omitempty"`
	Tags             *map[string]string `json:"tags,omitempty"`
	Type             *string            `json:"type,omitempty"`
}

type ImageDataDisk

type ImageDataDisk struct {
	BlobUri            *string              `json:"blobUri,omitempty"`
	Caching            *CachingTypes        `json:"caching,omitempty"`
	DiskEncryptionSet  *SubResource         `json:"diskEncryptionSet,omitempty"`
	DiskSizeGB         *int64               `json:"diskSizeGB,omitempty"`
	Lun                int64                `json:"lun"`
	ManagedDisk        *SubResource         `json:"managedDisk,omitempty"`
	Snapshot           *SubResource         `json:"snapshot,omitempty"`
	StorageAccountType *StorageAccountTypes `json:"storageAccountType,omitempty"`
}

type ImageId

type ImageId struct {
	SubscriptionId    string
	ResourceGroupName string
	ImageName         string
}

ImageId is a struct representing the Resource ID for a Image

func NewImageID

func NewImageID(subscriptionId string, resourceGroupName string, imageName string) ImageId

NewImageID returns a new ImageId struct

func ParseImageID

func ParseImageID(input string) (*ImageId, error)

ParseImageID parses 'input' into a ImageId

func ParseImageIDInsensitively

func ParseImageIDInsensitively(input string) (*ImageId, error)

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

func (ImageId) ID

func (id ImageId) ID() string

ID returns the formatted Image ID

func (ImageId) Segments

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

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

func (ImageId) String

func (id ImageId) String() string

String returns a human-readable description of this Image ID

type ImageOSDisk

type ImageOSDisk struct {
	BlobUri            *string                   `json:"blobUri,omitempty"`
	Caching            *CachingTypes             `json:"caching,omitempty"`
	DiskEncryptionSet  *SubResource              `json:"diskEncryptionSet,omitempty"`
	DiskSizeGB         *int64                    `json:"diskSizeGB,omitempty"`
	ManagedDisk        *SubResource              `json:"managedDisk,omitempty"`
	OsState            OperatingSystemStateTypes `json:"osState"`
	OsType             OperatingSystemTypes      `json:"osType"`
	Snapshot           *SubResource              `json:"snapshot,omitempty"`
	StorageAccountType *StorageAccountTypes      `json:"storageAccountType,omitempty"`
}

type ImageOperationPredicate

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

func (ImageOperationPredicate) Matches

func (p ImageOperationPredicate) Matches(input Image) bool

type ImageProperties

type ImageProperties struct {
	HyperVGeneration     *HyperVGenerationTypes `json:"hyperVGeneration,omitempty"`
	ProvisioningState    *string                `json:"provisioningState,omitempty"`
	SourceVirtualMachine *SubResource           `json:"sourceVirtualMachine,omitempty"`
	StorageProfile       *ImageStorageProfile   `json:"storageProfile,omitempty"`
}

type ImageStorageProfile

type ImageStorageProfile struct {
	DataDisks     *[]ImageDataDisk `json:"dataDisks,omitempty"`
	OsDisk        *ImageOSDisk     `json:"osDisk,omitempty"`
	ZoneResilient *bool            `json:"zoneResilient,omitempty"`
}

type ImageUpdate

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

type ImagesClient

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

func NewImagesClientWithBaseURI

func NewImagesClientWithBaseURI(endpoint string) ImagesClient

func (ImagesClient) CreateOrUpdate

func (c ImagesClient) CreateOrUpdate(ctx context.Context, id ImageId, input Image) (result CreateOrUpdateOperationResponse, err error)

CreateOrUpdate ...

func (ImagesClient) CreateOrUpdateThenPoll

func (c ImagesClient) CreateOrUpdateThenPoll(ctx context.Context, id ImageId, input Image) error

CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed

func (ImagesClient) Delete

func (c ImagesClient) Delete(ctx context.Context, id ImageId) (result DeleteOperationResponse, err error)

Delete ...

func (ImagesClient) DeleteThenPoll

func (c ImagesClient) DeleteThenPoll(ctx context.Context, id ImageId) error

DeleteThenPoll performs Delete then polls until it's completed

func (ImagesClient) Get

func (c ImagesClient) Get(ctx context.Context, id ImageId, options GetOperationOptions) (result GetOperationResponse, err error)

Get ...

func (ImagesClient) List

List ...

func (ImagesClient) ListByResourceGroup

ListByResourceGroup ...

func (ImagesClient) ListByResourceGroupComplete

ListByResourceGroupComplete retrieves all of the results into a single object

func (ImagesClient) ListByResourceGroupCompleteMatchingPredicate

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

ListByResourceGroupCompleteMatchingPredicate retrieves all of the results and then applied the predicate

func (ImagesClient) ListComplete

ListComplete retrieves all of the results into a single object

func (ImagesClient) ListCompleteMatchingPredicate

func (c ImagesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ImageOperationPredicate) (resp ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all of the results and then applied the predicate

func (ImagesClient) Update

func (c ImagesClient) Update(ctx context.Context, id ImageId, input ImageUpdate) (result UpdateOperationResponse, err error)

Update ...

func (ImagesClient) UpdateThenPoll

func (c ImagesClient) UpdateThenPoll(ctx context.Context, id ImageId, input ImageUpdate) error

UpdateThenPoll performs Update then polls until it's completed

type ListByResourceGroupCompleteResult

type ListByResourceGroupCompleteResult struct {
	Items []Image
}

type ListByResourceGroupOperationResponse

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

func (ListByResourceGroupOperationResponse) HasMore

func (ListByResourceGroupOperationResponse) LoadMore

type ListCompleteResult

type ListCompleteResult struct {
	Items []Image
}

type ListOperationResponse

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

func (ListOperationResponse) HasMore

func (r ListOperationResponse) HasMore() bool

func (ListOperationResponse) LoadMore

func (r ListOperationResponse) LoadMore(ctx context.Context) (resp ListOperationResponse, err error)

type OperatingSystemStateTypes

type OperatingSystemStateTypes string
const (
	OperatingSystemStateTypesGeneralized OperatingSystemStateTypes = "Generalized"
	OperatingSystemStateTypesSpecialized OperatingSystemStateTypes = "Specialized"
)

type OperatingSystemTypes

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

type StorageAccountTypes

type StorageAccountTypes string
const (
	StorageAccountTypesPremiumLRS     StorageAccountTypes = "Premium_LRS"
	StorageAccountTypesPremiumZRS     StorageAccountTypes = "Premium_ZRS"
	StorageAccountTypesStandardLRS    StorageAccountTypes = "Standard_LRS"
	StorageAccountTypesStandardSSDLRS StorageAccountTypes = "StandardSSD_LRS"
	StorageAccountTypesStandardSSDZRS StorageAccountTypes = "StandardSSD_ZRS"
	StorageAccountTypesUltraSSDLRS    StorageAccountTypes = "UltraSSD_LRS"
)

type SubResource

type SubResource struct {
	Id *string `json:"id,omitempty"`
}

type UpdateOperationResponse

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

Jump to

Keyboard shortcuts

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