package
0.20240715.1103416
Repository: https://github.com/hashicorp/go-azure-sdk.git
Documentation: pkg.go.dev

# README

github.com/hashicorp/go-azure-sdk/resource-manager/storagecache/2024-03-01/storagetargets Documentation

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

Client Initialization

client := storagetargets.NewStorageTargetsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: StorageTargetsClient.CreateOrUpdate

ctx := context.TODO()
id := storagetargets.NewStorageTargetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheValue", "storageTargetValue")

payload := storagetargets.StorageTarget{
	// ...
}


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

Example Usage: StorageTargetsClient.Delete

ctx := context.TODO()
id := storagetargets.NewStorageTargetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheValue", "storageTargetValue")

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

Example Usage: StorageTargetsClient.DnsRefresh

ctx := context.TODO()
id := storagetargets.NewStorageTargetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheValue", "storageTargetValue")

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

Example Usage: StorageTargetsClient.Get

ctx := context.TODO()
id := storagetargets.NewStorageTargetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheValue", "storageTargetValue")

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: StorageTargetsClient.ListByCache

ctx := context.TODO()
id := storagetargets.NewCacheID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheValue")

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

Example Usage: StorageTargetsClient.RestoreDefaults

ctx := context.TODO()
id := storagetargets.NewStorageTargetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheValue", "storageTargetValue")

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

Example Usage: StorageTargetsClient.StorageTargetFlush

ctx := context.TODO()
id := storagetargets.NewStorageTargetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheValue", "storageTargetValue")

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

Example Usage: StorageTargetsClient.StorageTargetInvalidate

ctx := context.TODO()
id := storagetargets.NewStorageTargetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheValue", "storageTargetValue")

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

Example Usage: StorageTargetsClient.StorageTargetResume

ctx := context.TODO()
id := storagetargets.NewStorageTargetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheValue", "storageTargetValue")

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

Example Usage: StorageTargetsClient.StorageTargetSuspend

ctx := context.TODO()
id := storagetargets.NewStorageTargetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheValue", "storageTargetValue")

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

# Functions

No description provided by the author
NewCacheID returns a new CacheId struct.
NewStorageTargetID returns a new StorageTargetId struct.
No description provided by the author
ParseCacheID parses 'input' into a CacheId.
ParseCacheIDInsensitively parses 'input' case-insensitively into a CacheId note: this method should only be used for API response data and not user input.
ParseStorageTargetID parses 'input' into a StorageTargetId.
ParseStorageTargetIDInsensitively parses 'input' case-insensitively into a StorageTargetId note: this method should only be used for API response data and not user input.
No description provided by the author
No description provided by the author
No description provided by the author
ValidateCacheID checks that 'input' can be parsed as a Cache ID.
ValidateStorageTargetID checks that 'input' can be parsed as a Storage Target ID.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
CacheId is a struct representing the Resource ID for a Cache.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
StorageTargetId is a struct representing the Resource ID for a Storage Target.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author
No description provided by the author
No description provided by the author