volumes

package
v0.20231019.1113326 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: MPL-2.0 Imports: 12 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/elasticsan/2021-11-20-preview/volumes Documentation

The volumes SDK allows for interaction with the Azure Resource Manager Service elasticsan (API Version 2021-11-20-preview).

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/2021-11-20-preview/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); 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 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
}

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 {
	Items []Volume
}

type ListByVolumeGroupOperationResponse

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

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

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

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

type SourceCreationData

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

type UpdateOperationResponse

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

type Volume

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

type VolumeCreateOption

type VolumeCreateOption string
const (
	VolumeCreateOptionNone VolumeCreateOption = "None"
)

func (*VolumeCreateOption) UnmarshalJSON added in v0.20230516.1215417

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) 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) 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"`
	SizeGiB       *int64              `json:"sizeGiB,omitempty"`
	StorageTarget *IscsiTargetInfo    `json:"storageTarget,omitempty"`
	VolumeId      *string             `json:"volumeId,omitempty"`
}

type VolumeUpdate

type VolumeUpdate struct {
	Properties *VolumeUpdateProperties `json:"properties,omitempty"`
	Tags       *map[string]string      `json:"tags,omitempty"`
}

type VolumeUpdateProperties

type VolumeUpdateProperties struct {
	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

func (c VolumesClient) Delete(ctx context.Context, id VolumeId) (result DeleteOperationResponse, err error)

Delete ...

func (VolumesClient) DeleteThenPoll

func (c VolumesClient) DeleteThenPoll(ctx context.Context, id VolumeId) 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

Jump to

Keyboard shortcuts

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