snapshots

package
v0.20240521.1173452 Latest Latest
Warning

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

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

README

github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2024-01-01/snapshots Documentation

The snapshots SDK allows for interaction with the Azure Resource Manager Service containerservice (API Version 2024-01-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-helpers/resourcemanager/commonids"
import "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2024-01-01/snapshots"

Client Initialization

client := snapshots.NewSnapshotsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: SnapshotsClient.CreateOrUpdate

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

payload := snapshots.Snapshot{
	// ...
}


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

Example Usage: SnapshotsClient.Delete

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

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

Example Usage: SnapshotsClient.Get

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

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: SnapshotsClient.List

ctx := context.TODO()
id := commonids.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: SnapshotsClient.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: SnapshotsClient.UpdateTags

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

payload := snapshots.TagsObject{
	// ...
}


read, err := client.UpdateTags(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 PossibleValuesForOSSKU

func PossibleValuesForOSSKU() []string

func PossibleValuesForOSType

func PossibleValuesForOSType() []string

func PossibleValuesForSnapshotType

func PossibleValuesForSnapshotType() []string

func ValidateSnapshotID

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

ValidateSnapshotID checks that 'input' can be parsed as a Snapshot ID

Types

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *Snapshot
}

type CreationData

type CreationData struct {
	SourceResourceId *string `json:"sourceResourceId,omitempty"`
}

type DeleteOperationResponse

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

type GetOperationResponse

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

type ListByResourceGroupCompleteResult

type ListByResourceGroupCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []Snapshot
}

type ListByResourceGroupOperationResponse

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

type ListCompleteResult

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

type ListOperationResponse

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

type OSSKU

type OSSKU string
const (
	OSSKUAzureLinux            OSSKU = "AzureLinux"
	OSSKUCBLMariner            OSSKU = "CBLMariner"
	OSSKUUbuntu                OSSKU = "Ubuntu"
	OSSKUWindowsTwoZeroOneNine OSSKU = "Windows2019"
	OSSKUWindowsTwoZeroTwoTwo  OSSKU = "Windows2022"
)

func (*OSSKU) UnmarshalJSON

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

type OSType

type OSType string
const (
	OSTypeLinux   OSType = "Linux"
	OSTypeWindows OSType = "Windows"
)

func (*OSType) UnmarshalJSON

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

type Snapshot

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

type SnapshotId

type SnapshotId struct {
	SubscriptionId    string
	ResourceGroupName string
	SnapshotName      string
}

SnapshotId is a struct representing the Resource ID for a Snapshot

func NewSnapshotID

func NewSnapshotID(subscriptionId string, resourceGroupName string, snapshotName string) SnapshotId

NewSnapshotID returns a new SnapshotId struct

func ParseSnapshotID

func ParseSnapshotID(input string) (*SnapshotId, error)

ParseSnapshotID parses 'input' into a SnapshotId

func ParseSnapshotIDInsensitively

func ParseSnapshotIDInsensitively(input string) (*SnapshotId, error)

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

func (*SnapshotId) FromParseResult

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

func (SnapshotId) ID

func (id SnapshotId) ID() string

ID returns the formatted Snapshot ID

func (SnapshotId) Segments

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

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

func (SnapshotId) String

func (id SnapshotId) String() string

String returns a human-readable description of this Snapshot ID

type SnapshotOperationPredicate

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

func (SnapshotOperationPredicate) Matches

func (p SnapshotOperationPredicate) Matches(input Snapshot) bool

type SnapshotProperties

type SnapshotProperties struct {
	CreationData      *CreationData `json:"creationData,omitempty"`
	EnableFIPS        *bool         `json:"enableFIPS,omitempty"`
	KubernetesVersion *string       `json:"kubernetesVersion,omitempty"`
	NodeImageVersion  *string       `json:"nodeImageVersion,omitempty"`
	OsSku             *OSSKU        `json:"osSku,omitempty"`
	OsType            *OSType       `json:"osType,omitempty"`
	SnapshotType      *SnapshotType `json:"snapshotType,omitempty"`
	VMSize            *string       `json:"vmSize,omitempty"`
}

type SnapshotType

type SnapshotType string
const (
	SnapshotTypeNodePool SnapshotType = "NodePool"
)

func (*SnapshotType) UnmarshalJSON

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

type SnapshotsClient

type SnapshotsClient struct {
	Client *resourcemanager.Client
}

func NewSnapshotsClientWithBaseURI

func NewSnapshotsClientWithBaseURI(sdkApi sdkEnv.Api) (*SnapshotsClient, error)

func (SnapshotsClient) CreateOrUpdate

func (c SnapshotsClient) CreateOrUpdate(ctx context.Context, id SnapshotId, input Snapshot) (result CreateOrUpdateOperationResponse, err error)

CreateOrUpdate ...

func (SnapshotsClient) Delete

func (c SnapshotsClient) Delete(ctx context.Context, id SnapshotId) (result DeleteOperationResponse, err error)

Delete ...

func (SnapshotsClient) Get

func (c SnapshotsClient) Get(ctx context.Context, id SnapshotId) (result GetOperationResponse, err error)

Get ...

func (SnapshotsClient) List

List ...

func (SnapshotsClient) ListByResourceGroup

ListByResourceGroup ...

func (SnapshotsClient) ListByResourceGroupComplete

ListByResourceGroupComplete retrieves all the results into a single object

func (SnapshotsClient) ListByResourceGroupCompleteMatchingPredicate

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

ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (SnapshotsClient) ListComplete

ListComplete retrieves all the results into a single object

func (SnapshotsClient) ListCompleteMatchingPredicate

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

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (SnapshotsClient) UpdateTags

func (c SnapshotsClient) UpdateTags(ctx context.Context, id SnapshotId, input TagsObject) (result UpdateTagsOperationResponse, err error)

UpdateTags ...

type TagsObject

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

type UpdateTagsOperationResponse

type UpdateTagsOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *Snapshot
}

Jump to

Keyboard shortcuts

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