snapshots

package
v0.20230726.1190715 Latest Latest
Warning

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

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

README

github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-11-01/snapshots Documentation

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

Client Initialization

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

Example Usage: SnapshotsClient.Create

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

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


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

Example Usage: SnapshotsClient.Delete

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

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

Example Usage: SnapshotsClient.Get

ctx := context.TODO()
id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue", "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 := snapshots.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue")

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

Example Usage: SnapshotsClient.RestoreFiles

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

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


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

Example Usage: SnapshotsClient.Update

ctx := context.TODO()
id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue", "snapshotValue")
var payload interface{}

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 ValidateSnapshotID

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

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

func ValidateVolumeID

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

ValidateVolumeID checks that 'input' can be parsed as a Volume ID

Types

type CreateOperationResponse

type CreateOperationResponse 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 GetOperationResponse

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

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *SnapshotsList
}

type RestoreFilesOperationResponse

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

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"`
	Type       *string                `json:"type,omitempty"`
}

type SnapshotId

type SnapshotId struct {
	SubscriptionId    string
	ResourceGroupName string
	NetAppAccountName string
	CapacityPoolName  string
	VolumeName        string
	SnapshotName      string
}

SnapshotId is a struct representing the Resource ID for a Snapshot

func NewSnapshotID

func NewSnapshotID(subscriptionId string, resourceGroupName string, netAppAccountName string, capacityPoolName string, volumeName 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) 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 SnapshotProperties

type SnapshotProperties struct {
	Created           *string `json:"created,omitempty"`
	ProvisioningState *string `json:"provisioningState,omitempty"`
	SnapshotId        *string `json:"snapshotId,omitempty"`
}

func (*SnapshotProperties) GetCreatedAsTime

func (o *SnapshotProperties) GetCreatedAsTime() (*time.Time, error)

func (*SnapshotProperties) SetCreatedAsTime

func (o *SnapshotProperties) SetCreatedAsTime(input time.Time)

type SnapshotRestoreFiles

type SnapshotRestoreFiles struct {
	DestinationPath *string  `json:"destinationPath,omitempty"`
	FilePaths       []string `json:"filePaths"`
}

type SnapshotsClient

type SnapshotsClient struct {
	Client *resourcemanager.Client
}

func NewSnapshotsClientWithBaseURI

func NewSnapshotsClientWithBaseURI(api environments.Api) (*SnapshotsClient, error)

func (SnapshotsClient) Create

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

Create ...

func (SnapshotsClient) CreateThenPoll

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

CreateThenPoll performs Create then polls until it's completed

func (SnapshotsClient) Delete

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

Delete ...

func (SnapshotsClient) DeleteThenPoll

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

DeleteThenPoll performs Delete then polls until it's completed

func (SnapshotsClient) Get

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

Get ...

func (SnapshotsClient) List

func (c SnapshotsClient) List(ctx context.Context, id VolumeId) (result ListOperationResponse, err error)

List ...

func (SnapshotsClient) RestoreFiles

RestoreFiles ...

func (SnapshotsClient) RestoreFilesThenPoll

func (c SnapshotsClient) RestoreFilesThenPoll(ctx context.Context, id SnapshotId, input SnapshotRestoreFiles) error

RestoreFilesThenPoll performs RestoreFiles then polls until it's completed

func (SnapshotsClient) Update

func (c SnapshotsClient) Update(ctx context.Context, id SnapshotId, input interface{}) (result UpdateOperationResponse, err error)

Update ...

func (SnapshotsClient) UpdateThenPoll

func (c SnapshotsClient) UpdateThenPoll(ctx context.Context, id SnapshotId, input interface{}) error

UpdateThenPoll performs Update then polls until it's completed

type SnapshotsList

type SnapshotsList struct {
	Value *[]Snapshot `json:"value,omitempty"`
}

type UpdateOperationResponse

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

type VolumeId

type VolumeId struct {
	SubscriptionId    string
	ResourceGroupName string
	NetAppAccountName string
	CapacityPoolName  string
	VolumeName        string
}

VolumeId is a struct representing the Resource ID for a Volume

func NewVolumeID

func NewVolumeID(subscriptionId string, resourceGroupName string, netAppAccountName string, capacityPoolName string, volumeName string) VolumeId

NewVolumeID returns a new VolumeId struct

func ParseVolumeID

func ParseVolumeID(input string) (*VolumeId, error)

ParseVolumeID parses 'input' into a VolumeId

func ParseVolumeIDInsensitively

func ParseVolumeIDInsensitively(input string) (*VolumeId, error)

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

func (VolumeId) ID

func (id VolumeId) ID() string

ID returns the formatted Volume ID

func (VolumeId) Segments

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

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

func (VolumeId) String

func (id VolumeId) String() string

String returns a human-readable description of this Volume ID

Jump to

Keyboard shortcuts

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