disks

package
v0.20240304.1112406 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MPL-2.0 Imports: 13 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       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *Disk
}

type DeleteOperationResponse

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

type DetachDiskProperties

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

type DetachOperationResponse

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

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) FromParseResult

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

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 *resourcemanager.Client
}

func NewDisksClientWithBaseURI

func NewDisksClientWithBaseURI(sdkApi sdkEnv.Api) (*DisksClient, error)

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) (result ListOperationResponse, err error)

List ...

func (DisksClient) ListComplete

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

ListComplete retrieves all the results into a single object

func (DisksClient) ListCompleteMatchingPredicate

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

ListCompleteMatchingPredicate retrieves all the results and then applies 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

func (GetOperationOptions) ToHeaders

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

func (GetOperationOptions) ToOData

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

func (GetOperationOptions) ToQuery

func (o GetOperationOptions) ToQuery() *client.QueryParams

type GetOperationResponse

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

type ListCompleteResult

type ListCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []Disk
}

type ListOperationOptions

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

func DefaultListOperationOptions

func DefaultListOperationOptions() ListOperationOptions

func (ListOperationOptions) ToHeaders

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

func (ListOperationOptions) ToOData

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

func (ListOperationOptions) ToQuery

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]Disk
}

type StorageType

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

func (*StorageType) UnmarshalJSON

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

type UpdateOperationResponse

type UpdateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	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) FromParseResult

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

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