snapshots

package
v0.20240320.1105218 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MPL-2.0 Imports: 12 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/elasticsan/2023-01-01/snapshots Documentation

The snapshots SDK allows for interaction with the Azure Resource Manager Service elasticsan (API Version 2023-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-sdk/resource-manager/elasticsan/2023-01-01/snapshots"

Client Initialization

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

Example Usage: SnapshotsClient.VolumeSnapshotsCreate

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

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


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

Example Usage: SnapshotsClient.VolumeSnapshotsDelete

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

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

Example Usage: SnapshotsClient.VolumeSnapshotsGet

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

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

Example Usage: SnapshotsClient.VolumeSnapshotsListByVolumeGroup

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForProvisioningStates

func PossibleValuesForProvisioningStates() []string

func ValidateSnapshotID

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

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

func ValidateVolumeGroupID

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

ValidateVolumeGroupID checks that 'input' can be parsed as a Volume Group ID

Types

type ProvisioningStates

type ProvisioningStates string
const (
	ProvisioningStatesCanceled  ProvisioningStates = "Canceled"
	ProvisioningStatesCreating  ProvisioningStates = "Creating"
	ProvisioningStatesDeleting  ProvisioningStates = "Deleting"
	ProvisioningStatesFailed    ProvisioningStates = "Failed"
	ProvisioningStatesInvalid   ProvisioningStates = "Invalid"
	ProvisioningStatesPending   ProvisioningStates = "Pending"
	ProvisioningStatesSucceeded ProvisioningStates = "Succeeded"
	ProvisioningStatesUpdating  ProvisioningStates = "Updating"
)

func (*ProvisioningStates) UnmarshalJSON

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

type Snapshot

type Snapshot struct {
	Id         *string                `json:"id,omitempty"`
	Name       *string                `json:"name,omitempty"`
	Properties SnapshotProperties     `json:"properties"`
	SystemData *systemdata.SystemData `json:"systemData,omitempty"`
	Type       *string                `json:"type,omitempty"`
}

type SnapshotCreationData

type SnapshotCreationData struct {
	SourceId string `json:"sourceId"`
}

type SnapshotId

type SnapshotId struct {
	SubscriptionId    string
	ResourceGroupName string
	ElasticSanName    string
	VolumeGroupName   string
	SnapshotName      string
}

SnapshotId is a struct representing the Resource ID for a Snapshot

func NewSnapshotID

func NewSnapshotID(subscriptionId string, resourceGroupName string, elasticSanName string, volumeGroupName 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
	Name *string
	Type *string
}

func (SnapshotOperationPredicate) Matches

func (p SnapshotOperationPredicate) Matches(input Snapshot) bool

type SnapshotProperties

type SnapshotProperties struct {
	CreationData        SnapshotCreationData `json:"creationData"`
	ProvisioningState   *ProvisioningStates  `json:"provisioningState,omitempty"`
	SourceVolumeSizeGiB *int64               `json:"sourceVolumeSizeGiB,omitempty"`
	VolumeName          *string              `json:"volumeName,omitempty"`
}

type SnapshotsClient

type SnapshotsClient struct {
	Client *resourcemanager.Client
}

func NewSnapshotsClientWithBaseURI

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

func (SnapshotsClient) VolumeSnapshotsCreate

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

VolumeSnapshotsCreate ...

func (SnapshotsClient) VolumeSnapshotsCreateThenPoll

func (c SnapshotsClient) VolumeSnapshotsCreateThenPoll(ctx context.Context, id SnapshotId, input Snapshot) error

VolumeSnapshotsCreateThenPoll performs VolumeSnapshotsCreate then polls until it's completed

func (SnapshotsClient) VolumeSnapshotsDelete

func (c SnapshotsClient) VolumeSnapshotsDelete(ctx context.Context, id SnapshotId) (result VolumeSnapshotsDeleteOperationResponse, err error)

VolumeSnapshotsDelete ...

func (SnapshotsClient) VolumeSnapshotsDeleteThenPoll

func (c SnapshotsClient) VolumeSnapshotsDeleteThenPoll(ctx context.Context, id SnapshotId) error

VolumeSnapshotsDeleteThenPoll performs VolumeSnapshotsDelete then polls until it's completed

func (SnapshotsClient) VolumeSnapshotsGet

func (c SnapshotsClient) VolumeSnapshotsGet(ctx context.Context, id SnapshotId) (result VolumeSnapshotsGetOperationResponse, err error)

VolumeSnapshotsGet ...

func (SnapshotsClient) VolumeSnapshotsListByVolumeGroup

VolumeSnapshotsListByVolumeGroup ...

func (SnapshotsClient) VolumeSnapshotsListByVolumeGroupComplete

VolumeSnapshotsListByVolumeGroupComplete retrieves all the results into a single object

func (SnapshotsClient) VolumeSnapshotsListByVolumeGroupCompleteMatchingPredicate

func (c SnapshotsClient) VolumeSnapshotsListByVolumeGroupCompleteMatchingPredicate(ctx context.Context, id VolumeGroupId, options VolumeSnapshotsListByVolumeGroupOperationOptions, predicate SnapshotOperationPredicate) (result VolumeSnapshotsListByVolumeGroupCompleteResult, err error)

VolumeSnapshotsListByVolumeGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate

type VolumeGroupId

type VolumeGroupId struct {
	SubscriptionId    string
	ResourceGroupName string
	ElasticSanName    string
	VolumeGroupName   string
}

VolumeGroupId is a struct representing the Resource ID for a Volume Group

func NewVolumeGroupID

func NewVolumeGroupID(subscriptionId string, resourceGroupName string, elasticSanName string, volumeGroupName string) VolumeGroupId

NewVolumeGroupID returns a new VolumeGroupId struct

func ParseVolumeGroupID

func ParseVolumeGroupID(input string) (*VolumeGroupId, error)

ParseVolumeGroupID parses 'input' into a VolumeGroupId

func ParseVolumeGroupIDInsensitively

func ParseVolumeGroupIDInsensitively(input string) (*VolumeGroupId, error)

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

func (*VolumeGroupId) FromParseResult

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

func (VolumeGroupId) ID

func (id VolumeGroupId) ID() string

ID returns the formatted Volume Group ID

func (VolumeGroupId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Volume Group ID

func (VolumeGroupId) String

func (id VolumeGroupId) String() string

String returns a human-readable description of this Volume Group ID

type VolumeSnapshotsCreateOperationResponse

type VolumeSnapshotsCreateOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *Snapshot
}

type VolumeSnapshotsDeleteOperationResponse

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

type VolumeSnapshotsGetOperationResponse

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

type VolumeSnapshotsListByVolumeGroupCompleteResult

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

type VolumeSnapshotsListByVolumeGroupOperationOptions

type VolumeSnapshotsListByVolumeGroupOperationOptions struct {
	Filter *string
}

func DefaultVolumeSnapshotsListByVolumeGroupOperationOptions

func DefaultVolumeSnapshotsListByVolumeGroupOperationOptions() VolumeSnapshotsListByVolumeGroupOperationOptions

func (VolumeSnapshotsListByVolumeGroupOperationOptions) ToHeaders

func (VolumeSnapshotsListByVolumeGroupOperationOptions) ToOData

func (VolumeSnapshotsListByVolumeGroupOperationOptions) ToQuery

type VolumeSnapshotsListByVolumeGroupOperationResponse

type VolumeSnapshotsListByVolumeGroupOperationResponse 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