disks

package
v0.20230405.1143248 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: MPL-2.0 Imports: 11 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/devtestlab/2018-09-15/disks Documentation

The disks SDK allows for interaction with the Azure Resource Manager Service devtestlab (API Version 2018-09-15).

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/devtestlab/2018-09-15/disks"

Client Initialization

client := disks.NewDisksClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: DisksClient.Attach

ctx := context.TODO()
id := disks.NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "userValue", "diskValue")

payload := disks.AttachDiskProperties{
	// ...
}


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

Example Usage: DisksClient.CreateOrUpdate

ctx := context.TODO()
id := disks.NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "userValue", "diskValue")

payload := disks.Disk{
	// ...
}


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

Example Usage: DisksClient.Delete

ctx := context.TODO()
id := disks.NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "userValue", "diskValue")

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

Example Usage: DisksClient.Detach

ctx := context.TODO()
id := disks.NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "userValue", "diskValue")

payload := disks.DetachDiskProperties{
	// ...
}


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

Example Usage: DisksClient.Get

ctx := context.TODO()
id := disks.NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "userValue", "diskValue")

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

Example Usage: DisksClient.List

ctx := context.TODO()
id := disks.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "userValue")

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

Example Usage: DisksClient.Update

ctx := context.TODO()
id := disks.NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "userValue", "diskValue")

payload := disks.UpdateResource{
	// ...
}


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

func PossibleValuesForStorageType() []string

func ValidateDiskID

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

ValidateDiskID checks that 'input' can be parsed as a Disk ID

func ValidateUserID

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

ValidateUserID checks that 'input' can be parsed as a User ID

Types

type AttachDiskProperties

type AttachDiskProperties struct {
	LeasedByLabVMId *string `json:"leasedByLabVmId,omitempty"`
}

type AttachOperationResponse

type AttachOperationResponse struct {
	Poller       polling.LongRunningPoller
	HttpResponse *http.Response
}

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	Poller       polling.LongRunningPoller
	HttpResponse *http.Response
}

type DeleteOperationResponse

type DeleteOperationResponse struct {
	Poller       polling.LongRunningPoller
	HttpResponse *http.Response
}

type DetachDiskProperties

type DetachDiskProperties struct {
	LeasedByLabVMId *string `json:"leasedByLabVmId,omitempty"`
}

type DetachOperationResponse

type DetachOperationResponse struct {
	Poller       polling.LongRunningPoller
	HttpResponse *http.Response
}

type Disk

type Disk struct {
	Id         *string            `json:"id,omitempty"`
	Location   *string            `json:"location,omitempty"`
	Name       *string            `json:"name,omitempty"`
	Properties DiskProperties     `json:"properties"`
	Tags       *map[string]string `json:"tags,omitempty"`
	Type       *string            `json:"type,omitempty"`
}

type DiskId

type DiskId struct {
	SubscriptionId    string
	ResourceGroupName string
	LabName           string
	UserName          string
	DiskName          string
}

DiskId is a struct representing the Resource ID for a Disk

func NewDiskID

func NewDiskID(subscriptionId string, resourceGroupName string, labName string, userName string, diskName string) DiskId

NewDiskID returns a new DiskId struct

func ParseDiskID

func ParseDiskID(input string) (*DiskId, error)

ParseDiskID parses 'input' into a DiskId

func ParseDiskIDInsensitively

func ParseDiskIDInsensitively(input string) (*DiskId, error)

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

func (DiskId) ID

func (id DiskId) ID() string

ID returns the formatted Disk ID

func (DiskId) Segments

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

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

func (DiskId) String

func (id DiskId) String() string

String returns a human-readable description of this Disk ID

type DiskOperationPredicate

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

func (DiskOperationPredicate) Matches

func (p DiskOperationPredicate) Matches(input Disk) bool

type DiskProperties

type DiskProperties struct {
	CreatedDate       *string      `json:"createdDate,omitempty"`
	DiskBlobName      *string      `json:"diskBlobName,omitempty"`
	DiskSizeGiB       *int64       `json:"diskSizeGiB,omitempty"`
	DiskType          *StorageType `json:"diskType,omitempty"`
	DiskUri           *string      `json:"diskUri,omitempty"`
	HostCaching       *string      `json:"hostCaching,omitempty"`
	LeasedByLabVMId   *string      `json:"leasedByLabVmId,omitempty"`
	ManagedDiskId     *string      `json:"managedDiskId,omitempty"`
	ProvisioningState *string      `json:"provisioningState,omitempty"`
	StorageAccountId  *string      `json:"storageAccountId,omitempty"`
	UniqueIdentifier  *string      `json:"uniqueIdentifier,omitempty"`
}

func (*DiskProperties) GetCreatedDateAsTime

func (o *DiskProperties) GetCreatedDateAsTime() (*time.Time, error)

func (*DiskProperties) SetCreatedDateAsTime

func (o *DiskProperties) SetCreatedDateAsTime(input time.Time)

type DisksClient

type DisksClient struct {
	Client autorest.Client
	// contains filtered or unexported fields
}

func NewDisksClientWithBaseURI

func NewDisksClientWithBaseURI(endpoint string) DisksClient

func (DisksClient) Attach

func (c DisksClient) Attach(ctx context.Context, id DiskId, input AttachDiskProperties) (result AttachOperationResponse, err error)

Attach ...

func (DisksClient) AttachThenPoll

func (c DisksClient) AttachThenPoll(ctx context.Context, id DiskId, input AttachDiskProperties) error

AttachThenPoll performs Attach then polls until it's completed

func (DisksClient) CreateOrUpdate

func (c DisksClient) CreateOrUpdate(ctx context.Context, id DiskId, input Disk) (result CreateOrUpdateOperationResponse, err error)

CreateOrUpdate ...

func (DisksClient) CreateOrUpdateThenPoll

func (c DisksClient) CreateOrUpdateThenPoll(ctx context.Context, id DiskId, input Disk) error

CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed

func (DisksClient) Delete

func (c DisksClient) Delete(ctx context.Context, id DiskId) (result DeleteOperationResponse, err error)

Delete ...

func (DisksClient) DeleteThenPoll

func (c DisksClient) DeleteThenPoll(ctx context.Context, id DiskId) error

DeleteThenPoll performs Delete then polls until it's completed

func (DisksClient) Detach

func (c DisksClient) Detach(ctx context.Context, id DiskId, input DetachDiskProperties) (result DetachOperationResponse, err error)

Detach ...

func (DisksClient) DetachThenPoll

func (c DisksClient) DetachThenPoll(ctx context.Context, id DiskId, input DetachDiskProperties) error

DetachThenPoll performs Detach then polls until it's completed

func (DisksClient) Get

func (c DisksClient) Get(ctx context.Context, id DiskId, options GetOperationOptions) (result GetOperationResponse, err error)

Get ...

func (DisksClient) List

func (c DisksClient) List(ctx context.Context, id UserId, options ListOperationOptions) (resp ListOperationResponse, err error)

List ...

func (DisksClient) ListComplete

func (c DisksClient) ListComplete(ctx context.Context, id UserId, options ListOperationOptions) (ListCompleteResult, error)

ListComplete retrieves all of the results into a single object

func (DisksClient) ListCompleteMatchingPredicate

func (c DisksClient) ListCompleteMatchingPredicate(ctx context.Context, id UserId, options ListOperationOptions, predicate DiskOperationPredicate) (resp ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all of the results and then applied the predicate

func (DisksClient) Update

func (c DisksClient) Update(ctx context.Context, id DiskId, input UpdateResource) (result UpdateOperationResponse, err error)

Update ...

type GetOperationOptions

type GetOperationOptions struct {
	Expand *string
}

func DefaultGetOperationOptions

func DefaultGetOperationOptions() GetOperationOptions

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	Model        *Disk
}

type ListCompleteResult

type ListCompleteResult struct {
	Items []Disk
}

type ListOperationOptions

type ListOperationOptions struct {
	Expand  *string
	Filter  *string
	Orderby *string
	Top     *int64
}

func DefaultListOperationOptions

func DefaultListOperationOptions() ListOperationOptions

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	Model        *[]Disk
	// contains filtered or unexported fields
}

func (ListOperationResponse) HasMore

func (r ListOperationResponse) HasMore() bool

func (ListOperationResponse) LoadMore

func (r ListOperationResponse) LoadMore(ctx context.Context) (resp ListOperationResponse, err error)

type StorageType

type StorageType string
const (
	StorageTypePremium     StorageType = "Premium"
	StorageTypeStandard    StorageType = "Standard"
	StorageTypeStandardSSD StorageType = "StandardSSD"
)

type UpdateOperationResponse

type UpdateOperationResponse struct {
	HttpResponse *http.Response
	Model        *Disk
}

type UpdateResource

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

type UserId

type UserId struct {
	SubscriptionId    string
	ResourceGroupName string
	LabName           string
	UserName          string
}

UserId is a struct representing the Resource ID for a User

func NewUserID

func NewUserID(subscriptionId string, resourceGroupName string, labName string, userName string) UserId

NewUserID returns a new UserId struct

func ParseUserID

func ParseUserID(input string) (*UserId, error)

ParseUserID parses 'input' into a UserId

func ParseUserIDInsensitively

func ParseUserIDInsensitively(input string) (*UserId, error)

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

func (UserId) ID

func (id UserId) ID() string

ID returns the formatted User ID

func (UserId) Segments

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

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

func (UserId) String

func (id UserId) String() string

String returns a human-readable description of this User ID

Jump to

Keyboard shortcuts

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