volumes

package
v0.20240710.1100952 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: MPL-2.0 Imports: 13 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/elasticsan/2024-05-01/volumes Documentation

The volumes SDK allows for interaction with the Azure Resource Manager Service elasticsan (API Version 2024-05-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/2024-05-01/volumes"

Client Initialization

client := volumes.NewVolumesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: VolumesClient.Create

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

payload := volumes.Volume{
	// ...
}


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

Example Usage: VolumesClient.Delete

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

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

Example Usage: VolumesClient.Get

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

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: VolumesClient.ListByVolumeGroup

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

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

Example Usage: VolumesClient.Update

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

payload := volumes.VolumeUpdate{
	// ...
}


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 PossibleValuesForOperationalStatus

func PossibleValuesForOperationalStatus() []string

func PossibleValuesForProvisioningStates

func PossibleValuesForProvisioningStates() []string

func PossibleValuesForVolumeCreateOption

func PossibleValuesForVolumeCreateOption() []string

func PossibleValuesForXMsDeleteSnapshots

func PossibleValuesForXMsDeleteSnapshots() []string

func PossibleValuesForXMsForceDelete

func PossibleValuesForXMsForceDelete() []string

func ValidateVolumeGroupID

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

ValidateVolumeGroupID checks that 'input' can be parsed as a Volume Group 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
	Model        *Volume
}

type DeleteOperationOptions

type DeleteOperationOptions struct {
	XMsDeleteSnapshots *XMsDeleteSnapshots
	XMsForceDelete     *XMsForceDelete
}

func DefaultDeleteOperationOptions

func DefaultDeleteOperationOptions() DeleteOperationOptions

func (DeleteOperationOptions) ToHeaders

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

func (DeleteOperationOptions) ToOData

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

func (DeleteOperationOptions) ToQuery

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        *Volume
}

type IscsiTargetInfo

type IscsiTargetInfo struct {
	ProvisioningState    *ProvisioningStates `json:"provisioningState,omitempty"`
	Status               *OperationalStatus  `json:"status,omitempty"`
	TargetIqn            *string             `json:"targetIqn,omitempty"`
	TargetPortalHostname *string             `json:"targetPortalHostname,omitempty"`
	TargetPortalPort     *int64              `json:"targetPortalPort,omitempty"`
}

type ListByVolumeGroupCompleteResult

type ListByVolumeGroupCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []Volume
}

type ListByVolumeGroupCustomPager added in v0.20240628.1153531

type ListByVolumeGroupCustomPager struct {
	NextLink *odata.Link `json:"nextLink"`
}
func (p *ListByVolumeGroupCustomPager) NextPageLink() *odata.Link

type ListByVolumeGroupOperationResponse

type ListByVolumeGroupOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]Volume
}

type ManagedByInfo

type ManagedByInfo struct {
	ResourceId *string `json:"resourceId,omitempty"`
}

type OperationalStatus

type OperationalStatus string
const (
	OperationalStatusHealthy            OperationalStatus = "Healthy"
	OperationalStatusInvalid            OperationalStatus = "Invalid"
	OperationalStatusRunning            OperationalStatus = "Running"
	OperationalStatusStopped            OperationalStatus = "Stopped"
	OperationalStatusStoppedDeallocated OperationalStatus = "Stopped (deallocated)"
	OperationalStatusUnhealthy          OperationalStatus = "Unhealthy"
	OperationalStatusUnknown            OperationalStatus = "Unknown"
	OperationalStatusUpdating           OperationalStatus = "Updating"
)

func (*OperationalStatus) UnmarshalJSON

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

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 SourceCreationData

type SourceCreationData struct {
	CreateSource *VolumeCreateOption `json:"createSource,omitempty"`
	SourceId     *string             `json:"sourceId,omitempty"`
}

type UpdateOperationResponse

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

type Volume

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

type VolumeCreateOption

type VolumeCreateOption string
const (
	VolumeCreateOptionDisk             VolumeCreateOption = "Disk"
	VolumeCreateOptionDiskRestorePoint VolumeCreateOption = "DiskRestorePoint"
	VolumeCreateOptionDiskSnapshot     VolumeCreateOption = "DiskSnapshot"
	VolumeCreateOptionNone             VolumeCreateOption = "None"
	VolumeCreateOptionVolumeSnapshot   VolumeCreateOption = "VolumeSnapshot"
)

func (*VolumeCreateOption) UnmarshalJSON

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

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 VolumeId

type VolumeId struct {
	SubscriptionId    string
	ResourceGroupName string
	ElasticSanName    string
	VolumeGroupName   string
	VolumeName        string
}

VolumeId is a struct representing the Resource ID for a Volume

func NewVolumeID

func NewVolumeID(subscriptionId string, resourceGroupName string, elasticSanName string, volumeGroupName 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) FromParseResult

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

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

type VolumeOperationPredicate

type VolumeOperationPredicate struct {
	Id   *string
	Name *string
	Type *string
}

func (VolumeOperationPredicate) Matches

func (p VolumeOperationPredicate) Matches(input Volume) bool

type VolumeProperties

type VolumeProperties struct {
	CreationData      *SourceCreationData `json:"creationData,omitempty"`
	ManagedBy         *ManagedByInfo      `json:"managedBy,omitempty"`
	ProvisioningState *ProvisioningStates `json:"provisioningState,omitempty"`
	SizeGiB           int64               `json:"sizeGiB"`
	StorageTarget     *IscsiTargetInfo    `json:"storageTarget,omitempty"`
	VolumeId          *string             `json:"volumeId,omitempty"`
}

type VolumeUpdate

type VolumeUpdate struct {
	Properties *VolumeUpdateProperties `json:"properties,omitempty"`
}

type VolumeUpdateProperties

type VolumeUpdateProperties struct {
	ManagedBy *ManagedByInfo `json:"managedBy,omitempty"`
	SizeGiB   *int64         `json:"sizeGiB,omitempty"`
}

type VolumesClient

type VolumesClient struct {
	Client *resourcemanager.Client
}

func NewVolumesClientWithBaseURI

func NewVolumesClientWithBaseURI(sdkApi sdkEnv.Api) (*VolumesClient, error)

func (VolumesClient) Create

func (c VolumesClient) Create(ctx context.Context, id VolumeId, input Volume) (result CreateOperationResponse, err error)

Create ...

func (VolumesClient) CreateThenPoll

func (c VolumesClient) CreateThenPoll(ctx context.Context, id VolumeId, input Volume) error

CreateThenPoll performs Create then polls until it's completed

func (VolumesClient) Delete

Delete ...

func (VolumesClient) DeleteThenPoll

func (c VolumesClient) DeleteThenPoll(ctx context.Context, id VolumeId, options DeleteOperationOptions) error

DeleteThenPoll performs Delete then polls until it's completed

func (VolumesClient) Get

func (c VolumesClient) Get(ctx context.Context, id VolumeId) (result GetOperationResponse, err error)

Get ...

func (VolumesClient) ListByVolumeGroup

func (c VolumesClient) ListByVolumeGroup(ctx context.Context, id VolumeGroupId) (result ListByVolumeGroupOperationResponse, err error)

ListByVolumeGroup ...

func (VolumesClient) ListByVolumeGroupComplete

func (c VolumesClient) ListByVolumeGroupComplete(ctx context.Context, id VolumeGroupId) (ListByVolumeGroupCompleteResult, error)

ListByVolumeGroupComplete retrieves all the results into a single object

func (VolumesClient) ListByVolumeGroupCompleteMatchingPredicate

func (c VolumesClient) ListByVolumeGroupCompleteMatchingPredicate(ctx context.Context, id VolumeGroupId, predicate VolumeOperationPredicate) (result ListByVolumeGroupCompleteResult, err error)

ListByVolumeGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (VolumesClient) Update

func (c VolumesClient) Update(ctx context.Context, id VolumeId, input VolumeUpdate) (result UpdateOperationResponse, err error)

Update ...

func (VolumesClient) UpdateThenPoll

func (c VolumesClient) UpdateThenPoll(ctx context.Context, id VolumeId, input VolumeUpdate) error

UpdateThenPoll performs Update then polls until it's completed

type XMsDeleteSnapshots

type XMsDeleteSnapshots string
const (
	XMsDeleteSnapshotsFalse XMsDeleteSnapshots = "false"
	XMsDeleteSnapshotsTrue  XMsDeleteSnapshots = "true"
)

func (*XMsDeleteSnapshots) UnmarshalJSON

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

type XMsForceDelete

type XMsForceDelete string
const (
	XMsForceDeleteFalse XMsForceDelete = "false"
	XMsForceDeleteTrue  XMsForceDelete = "true"
)

func (*XMsForceDelete) UnmarshalJSON

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

Jump to

Keyboard shortcuts

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