images

package
v0.20231129.1170309 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: MPL-2.0 Imports: 13 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-03-01/images Documentation

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

func (*CachingTypes) UnmarshalJSON added in v0.20230808.1103829

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

type CreateOrUpdateOperationResponse

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

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 added in v0.20230808.1103829

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

func (GetOperationOptions) ToOData added in v0.20230808.1103829

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

func (GetOperationOptions) ToQuery added in v0.20230808.1103829

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

type GetOperationResponse

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

type HyperVGenerationTypes

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

func (*HyperVGenerationTypes) UnmarshalJSON added in v0.20230808.1103829

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

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) FromParseResult added in v0.20231127.1171502

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

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 *resourcemanager.Client
}

func NewImagesClientWithBaseURI

func NewImagesClientWithBaseURI(sdkApi sdkEnv.Api) (*ImagesClient, error)

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 the results into a single object

func (ImagesClient) ListByResourceGroupCompleteMatchingPredicate

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

ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (ImagesClient) ListComplete

ListComplete retrieves all the results into a single object

func (ImagesClient) ListCompleteMatchingPredicate

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

ListCompleteMatchingPredicate retrieves all the results and then applies 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
	OData        *odata.OData
	Model        *[]Image
}

type ListCompleteResult

type ListCompleteResult struct {
	Items []Image
}

type ListOperationResponse

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

type OperatingSystemStateTypes

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

func (*OperatingSystemStateTypes) UnmarshalJSON added in v0.20230808.1103829

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

type OperatingSystemTypes

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

func (*OperatingSystemTypes) UnmarshalJSON added in v0.20230808.1103829

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

type StorageAccountTypes

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

func (*StorageAccountTypes) UnmarshalJSON added in v0.20230808.1103829

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

type SubResource

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

type UpdateOperationResponse

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

Jump to

Keyboard shortcuts

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